Skip to content

Indentation of elaborations in related spans is incorrect #32091

@sandersn

Description

@sandersn

This example depends on report-multiple-overload-errors; I'll create a better repro later, but the problem is not hard to reproduce.

import * as React from './node_modules/@types/react'
class BigGreeter extends React.Component<{ x? }, {}> {
    render() {
        return <div>Default hi</div>;
    }
    greeting: string;
}
// Error
let a = <BigGreeter prop1="hello" />

Actual behavior:

app.tsx:9:9 - error TS2755: No suitable overload for this call.

9 let a = <BigGreeter prop1="hello" />
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  app.tsx:9:10
    9 let a = <BigGreeter prop1="hello" />
               ~~~~~~~~~~
    Overload 1 of 2, '(props: Readonly<{ x?: any; }>): BigGreeter', gave the following error.
  Type '{ prop1: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & Readonly<{ x?: any; }> & Readonly<{ children?: ReactNode; }>'.
    Property 'prop1' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & Readonly<{ x?: any; }> & Readonly<{ children?: ReactNode; }>'.
  app.tsx:9:10
    9 let a = <BigGreeter prop1="hello" />
               ~~~~~~~~~~
    Overload 2 of 2, '(props: { x?: any; }, context?: any): BigGreeter', gave the following error.
  Type '{ prop1: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & Readonly<{ x?: any; }> & Readonly<{ children?: ReactNode; }>'.
    Property 'prop1' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<BigGreeter> & Readonly<{ x?: any; }> & Readonly<{ children?: ReactNode; }>'.


Found 1 error.

Expected behavior:

The elaborations under "Overload 1 of 2" and "Overload 2 of 2" should be indented 4 more spaces than they are: 6 instead of 2 and 8 instead of 4.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingDomain: Related Error SpansSpecifying regions for error messages/diagnostics on multiple locations.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions