diff --git a/internal/checker/relater.go b/internal/checker/relater.go index dbc104ff2f..c682637f41 100644 --- a/internal/checker/relater.go +++ b/internal/checker/relater.go @@ -1052,11 +1052,11 @@ func (c *Checker) findMatchingDiscriminantType(source *Type, target *Type, isRel if match := c.getMatchingUnionConstituentForType(target, source); match != nil { return match } - discriminantProperties := c.findDiscriminantProperties(c.getPropertiesOfType(source), target) - discriminator := &TypeDiscriminator{c: c, props: discriminantProperties, isRelatedTo: isRelatedTo} - discriminated := c.discriminateTypeByDiscriminableItems(target, discriminator) - if discriminated != target { - return discriminated + if discriminantProperties := c.findDiscriminantProperties(c.getPropertiesOfType(source), target); len(discriminantProperties) != 0 { + discriminator := &TypeDiscriminator{c: c, props: discriminantProperties, isRelatedTo: isRelatedTo} + if discriminated := c.discriminateTypeByDiscriminableItems(target, discriminator); discriminated != target { + return discriminated + } } } return nil diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt index f67b3002a1..c0ca33593a 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt @@ -24,9 +24,8 @@ jsxElementType.tsx(78,1): error TS2339: Property 'boop' does not exist on type ' jsxElementType.tsx(79,1): error TS2339: Property 'my-undeclared-custom-element' does not exist on type 'JSX.IntrinsicElements'. jsxElementType.tsx(91,2): error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. Its type '(props: {}, ref: ForwardedRef) => null' is not a valid JSX element type. - Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '((props: any) => React18ReactNode) | (new (props: any) => Component)'. - Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. - Target signature provides too few arguments. Expected 2 or more, but got 1. + Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. + Target signature provides too few arguments. Expected 2 or more, but got 1. jsxElementType.tsx(95,11): error TS2322: Type '{}' is not assignable to type 'LibraryManagedAttributes'. jsxElementType.tsx(98,2): error TS2304: Cannot find name 'Unresolved'. jsxElementType.tsx(99,2): error TS2304: Cannot find name 'Unresolved'. @@ -177,9 +176,8 @@ jsxElementType.tsx(111,19): error TS2322: Type '{ a: string; b: string; }' is no ~~~~~~~~~~~~~~~~~~~ !!! error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. !!! error TS2786: Its type '(props: {}, ref: ForwardedRef) => null' is not a valid JSX element type. -!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '((props: any) => React18ReactNode) | (new (props: any) => Component)'. -!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. -!!! error TS2786: Target signature provides too few arguments. Expected 2 or more, but got 1. +!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. +!!! error TS2786: Target signature provides too few arguments. Expected 2 or more, but got 1. // testing higher-order component compat function f1 React.ReactElement>(Component: T) { diff --git a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff index bb10603ff6..5c5d5179ba 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/jsxElementType.errors.txt.diff @@ -18,18 +18,7 @@ Type '{ excessProp: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. Property 'excessProp' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly<{ children?: ReactNode; }> & Readonly<{ title: string; }>'. jsxElementType.tsx(78,1): error TS2339: Property 'boop' does not exist on type 'JSX.IntrinsicElements'. - jsxElementType.tsx(79,1): error TS2339: Property 'my-undeclared-custom-element' does not exist on type 'JSX.IntrinsicElements'. - jsxElementType.tsx(91,2): error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. - Its type '(props: {}, ref: ForwardedRef) => null' is not a valid JSX element type. -- Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. -- Target signature provides too few arguments. Expected 2 or more, but got 1. -+ Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '((props: any) => React18ReactNode) | (new (props: any) => Component)'. -+ Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. -+ Target signature provides too few arguments. Expected 2 or more, but got 1. - jsxElementType.tsx(95,11): error TS2322: Type '{}' is not assignable to type 'LibraryManagedAttributes'. - jsxElementType.tsx(98,2): error TS2304: Cannot find name 'Unresolved'. - jsxElementType.tsx(99,2): error TS2304: Cannot find name 'Unresolved'. -@@= skipped -129, +125 lines =@@ +@@= skipped -129, +124 lines =@@ ; ~~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. @@ -59,16 +48,4 @@ +!!! related TS2771 react16.d.ts:357:13: The last overload is declared here. // Host element types still work -
; -@@= skipped -42, +38 lines =@@ - ~~~~~~~~~~~~~~~~~~~ - !!! error TS2786: 'ReactNativeFlatList' cannot be used as a JSX component. - !!! error TS2786: Its type '(props: {}, ref: ForwardedRef) => null' is not a valid JSX element type. --!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. --!!! error TS2786: Target signature provides too few arguments. Expected 2 or more, but got 1. -+!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '((props: any) => React18ReactNode) | (new (props: any) => Component)'. -+!!! error TS2786: Type '(props: {}, ref: ForwardedRef) => null' is not assignable to type '(props: any) => React18ReactNode'. -+!!! error TS2786: Target signature provides too few arguments. Expected 2 or more, but got 1. - - // testing higher-order component compat - function f1 React.ReactElement>(Component: T) { \ No newline at end of file +
; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt index 6af267ee06..f979faf99b 100644 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt @@ -1,9 +1,7 @@ a.tsx(6,28): error TS2322: Type '{ children: () => string; }' is not assignable to type '{ children?: ReactNode; }'. Types of property 'children' are incompatible. Type '() => string' is not assignable to type 'ReactNode'. - Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. a.tsx(7,47): error TS2322: Type '() => string' is not assignable to type 'ReactNode'. - Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. ==== a.tsx (2 errors) ==== @@ -17,10 +15,8 @@ a.tsx(7,47): error TS2322: Type '() => string' is not assignable to type 'ReactN !!! error TS2322: Type '{ children: () => string; }' is not assignable to type '{ children?: ReactNode; }'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '() => string' is not assignable to type 'ReactNode'. -!!! error TS2322: Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. const jsxWithReactFragment = {test}; ~~~~ !!! error TS2322: Type '() => string' is not assignable to type 'ReactNode'. -!!! error TS2322: Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. !!! related TS6212 a.tsx:7:47: Did you mean to call this expression? \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt.diff deleted file mode 100644 index af9c9d5f71..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsxFragmentWrongType.errors.txt.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.jsxFragmentWrongType.errors.txt -+++ new.jsxFragmentWrongType.errors.txt -@@= skipped -0, +0 lines =@@ - a.tsx(6,28): error TS2322: Type '{ children: () => string; }' is not assignable to type '{ children?: ReactNode; }'. - Types of property 'children' are incompatible. - Type '() => string' is not assignable to type 'ReactNode'. -+ Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. - a.tsx(7,47): error TS2322: Type '() => string' is not assignable to type 'ReactNode'. -+ Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. - - - ==== a.tsx (2 errors) ==== -@@= skipped -14, +16 lines =@@ - !!! error TS2322: Type '{ children: () => string; }' is not assignable to type '{ children?: ReactNode; }'. - !!! error TS2322: Types of property 'children' are incompatible. - !!! error TS2322: Type '() => string' is not assignable to type 'ReactNode'. -+!!! error TS2322: Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. - const jsxWithReactFragment = {test}; - ~~~~ - !!! error TS2322: Type '() => string' is not assignable to type 'ReactNode'. -+!!! error TS2322: Type '() => string' is not assignable to type 'ReactElement> | ReactFragment | ReactPortal'. - !!! related TS6212 a.tsx:7:47: Did you mean to call this expression? - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt b/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt index 76edc9d2eb..07efb64efb 100644 --- a/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt @@ -3,34 +3,20 @@ potentiallyUncalledDecorators.ts(35,1): error TS1329: 'noArgs' accepts too few a potentiallyUncalledDecorators.ts(37,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? potentiallyUncalledDecorators.ts(38,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? potentiallyUncalledDecorators.ts(41,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof B'. - Type 'OmniDecorator' is not assignable to type 'typeof B'. - Type 'OmniDecorator' provides no match for the signature 'new (): B'. potentiallyUncalledDecorators.ts(43,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. potentiallyUncalledDecorators.ts(44,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. - Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. potentiallyUncalledDecorators.ts(47,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof C'. - Type 'OmniDecorator' is not assignable to type 'typeof C'. - Type 'OmniDecorator' provides no match for the signature 'new (): C'. potentiallyUncalledDecorators.ts(49,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? potentiallyUncalledDecorators.ts(50,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? potentiallyUncalledDecorators.ts(53,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof D'. - Type 'OmniDecorator' is not assignable to type 'typeof D'. - Type 'OmniDecorator' provides no match for the signature 'new (): D'. potentiallyUncalledDecorators.ts(55,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. potentiallyUncalledDecorators.ts(56,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. - Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. potentiallyUncalledDecorators.ts(59,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof E'. - Type 'OmniDecorator' is not assignable to type 'typeof E'. - Type 'OmniDecorator' provides no match for the signature 'new (): E'. potentiallyUncalledDecorators.ts(61,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. potentiallyUncalledDecorators.ts(62,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. - Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. potentiallyUncalledDecorators.ts(65,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof F'. - Type 'OmniDecorator' is not assignable to type 'typeof F'. - Type 'OmniDecorator' provides no match for the signature 'new (): F'. potentiallyUncalledDecorators.ts(67,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. - Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. ==== potentiallyUncalledDecorators.ts (19 errors) ==== @@ -85,8 +71,6 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @allRest ~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof B'. -!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof B'. -!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): B'. class B { @allRest foo: any; ~~~~~~~ @@ -94,14 +78,11 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @allRest bar() { } ~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } @oneOptional ~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof C'. -!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof C'. -!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): C'. class C { @oneOptional foo: any; ~~~~~~~~~~~~ @@ -114,8 +95,6 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @twoOptional ~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof D'. -!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof D'. -!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): D'. class D { @twoOptional foo: any; ~~~~~~~~~~~ @@ -123,14 +102,11 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @twoOptional bar() { } ~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } @threeOptional ~~~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof E'. -!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof E'. -!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): E'. class E { @threeOptional foo: any; ~~~~~~~~~~~~~ @@ -138,14 +114,11 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @threeOptional bar() { } ~~~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } @oneOptionalWithRest ~~~~~~~~~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof F'. -!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof F'. -!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): F'. class F { @oneOptionalWithRest foo: any; ~~~~~~~~~~~~~~~~~~~ @@ -153,7 +126,6 @@ potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return @oneOptionalWithRest bar() { } ~~~~~~~~~~~~~~~~~~~ !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } @anyDec diff --git a/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt.diff deleted file mode 100644 index 81951387ea..0000000000 --- a/testdata/baselines/reference/submodule/compiler/potentiallyUncalledDecorators.errors.txt.diff +++ /dev/null @@ -1,108 +0,0 @@ ---- old.potentiallyUncalledDecorators.errors.txt -+++ new.potentiallyUncalledDecorators.errors.txt -@@= skipped -2, +2 lines =@@ - potentiallyUncalledDecorators.ts(37,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? - potentiallyUncalledDecorators.ts(38,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? - potentiallyUncalledDecorators.ts(41,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof B'. -+ Type 'OmniDecorator' is not assignable to type 'typeof B'. -+ Type 'OmniDecorator' provides no match for the signature 'new (): B'. - potentiallyUncalledDecorators.ts(43,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. - potentiallyUncalledDecorators.ts(44,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+ Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - potentiallyUncalledDecorators.ts(47,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof C'. -+ Type 'OmniDecorator' is not assignable to type 'typeof C'. -+ Type 'OmniDecorator' provides no match for the signature 'new (): C'. - potentiallyUncalledDecorators.ts(49,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? - potentiallyUncalledDecorators.ts(50,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? - potentiallyUncalledDecorators.ts(53,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof D'. -+ Type 'OmniDecorator' is not assignable to type 'typeof D'. -+ Type 'OmniDecorator' provides no match for the signature 'new (): D'. - potentiallyUncalledDecorators.ts(55,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. - potentiallyUncalledDecorators.ts(56,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+ Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - potentiallyUncalledDecorators.ts(59,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof E'. -+ Type 'OmniDecorator' is not assignable to type 'typeof E'. -+ Type 'OmniDecorator' provides no match for the signature 'new (): E'. - potentiallyUncalledDecorators.ts(61,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. - potentiallyUncalledDecorators.ts(62,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+ Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - potentiallyUncalledDecorators.ts(65,2): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof F'. -+ Type 'OmniDecorator' is not assignable to type 'typeof F'. -+ Type 'OmniDecorator' provides no match for the signature 'new (): F'. - potentiallyUncalledDecorators.ts(67,6): error TS1271: Decorator function return type is 'OmniDecorator' but is expected to be 'void' or 'any'. - potentiallyUncalledDecorators.ts(68,6): error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+ Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - - - ==== potentiallyUncalledDecorators.ts (19 errors) ==== -@@= skipped -68, +82 lines =@@ - @allRest - ~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof B'. -+!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof B'. -+!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): B'. - class B { - @allRest foo: any; - ~~~~~~~ -@@= skipped -7, +9 lines =@@ - @allRest bar() { } - ~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - } - - @oneOptional - ~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof C'. -+!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof C'. -+!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): C'. - class C { - @oneOptional foo: any; - ~~~~~~~~~~~~ -@@= skipped -17, +20 lines =@@ - @twoOptional - ~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof D'. -+!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof D'. -+!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): D'. - class D { - @twoOptional foo: any; - ~~~~~~~~~~~ -@@= skipped -7, +9 lines =@@ - @twoOptional bar() { } - ~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - } - - @threeOptional - ~~~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof E'. -+!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof E'. -+!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): E'. - class E { - @threeOptional foo: any; - ~~~~~~~~~~~~~ -@@= skipped -12, +15 lines =@@ - @threeOptional bar() { } - ~~~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - } - - @oneOptionalWithRest - ~~~~~~~~~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | typeof F'. -+!!! error TS1270: Type 'OmniDecorator' is not assignable to type 'typeof F'. -+!!! error TS1270: Type 'OmniDecorator' provides no match for the signature 'new (): F'. - class F { - @oneOptionalWithRest foo: any; - ~~~~~~~~~~~~~~~~~~~ -@@= skipped -12, +15 lines =@@ - @oneOptionalWithRest bar() { } - ~~~~~~~~~~~~~~~~~~~ - !!! error TS1270: Decorator function return type 'OmniDecorator' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+!!! error TS1270: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - } - - @anyDec \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt b/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt index aba854214f..27fb14362f 100644 --- a/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt @@ -4,7 +4,6 @@ typeVariableConstraintedToAliasNotAssignableToUnion.ts(22,5): error TS2322: Type Type 'TableClass' is not assignable to type 'string | number'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(23,5): error TS2322: Type 'T' is not assignable to type 'string | Something'. Type 'TableClass' is not assignable to type 'string | Something'. - Property 'prop' is missing in type 'TableClass' but required in type 'Something'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(24,5): error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. Type 'TableClass' is not assignable to type 'Something | SomethingElse'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(28,5): error TS2322: Type 'T' is not assignable to type 'boolean'. @@ -13,13 +12,11 @@ typeVariableConstraintedToAliasNotAssignableToUnion.ts(29,5): error TS2322: Type Type 'TableClass' is not assignable to type 'string | number'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(30,5): error TS2322: Type 'T' is not assignable to type 'string | Something'. Type 'TableClass' is not assignable to type 'string | Something'. - Property 'prop' is missing in type 'TableClass' but required in type 'Something'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(31,5): error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. Type 'TableClass' is not assignable to type 'Something | SomethingElse'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(35,1): error TS2322: Type 'Table' is not assignable to type 'boolean'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(36,1): error TS2322: Type 'Table' is not assignable to type 'string | number'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(37,1): error TS2322: Type 'Table' is not assignable to type 'string | Something'. - Property 'prop' is missing in type 'TableClass' but required in type 'Something'. typeVariableConstraintedToAliasNotAssignableToUnion.ts(38,1): error TS2322: Type 'Table' is not assignable to type 'Something | SomethingElse'. @@ -56,8 +53,6 @@ typeVariableConstraintedToAliasNotAssignableToUnion.ts(38,1): error TS2322: Type ~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'string | Something'. !!! error TS2322: Type 'TableClass' is not assignable to type 'string | Something'. -!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. someUnion = o; ~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. @@ -77,8 +72,6 @@ typeVariableConstraintedToAliasNotAssignableToUnion.ts(38,1): error TS2322: Type ~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'string | Something'. !!! error TS2322: Type 'TableClass' is not assignable to type 'string | Something'. -!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. someUnion = o; ~~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. @@ -95,8 +88,6 @@ typeVariableConstraintedToAliasNotAssignableToUnion.ts(38,1): error TS2322: Type aStringOrSomething = o; ~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'Table' is not assignable to type 'string | Something'. -!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. someUnion = o; ~~~~~~~~~ !!! error TS2322: Type 'Table' is not assignable to type 'Something | SomethingElse'. diff --git a/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt.diff deleted file mode 100644 index 4bfa0bb54d..0000000000 --- a/testdata/baselines/reference/submodule/compiler/typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt.diff +++ /dev/null @@ -1,51 +0,0 @@ ---- old.typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt -+++ new.typeVariableConstraintedToAliasNotAssignableToUnion.errors.txt -@@= skipped -3, +3 lines =@@ - Type 'TableClass' is not assignable to type 'string | number'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(23,5): error TS2322: Type 'T' is not assignable to type 'string | Something'. - Type 'TableClass' is not assignable to type 'string | Something'. -+ Property 'prop' is missing in type 'TableClass' but required in type 'Something'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(24,5): error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. - Type 'TableClass' is not assignable to type 'Something | SomethingElse'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(28,5): error TS2322: Type 'T' is not assignable to type 'boolean'. -@@= skipped -8, +9 lines =@@ - Type 'TableClass' is not assignable to type 'string | number'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(30,5): error TS2322: Type 'T' is not assignable to type 'string | Something'. - Type 'TableClass' is not assignable to type 'string | Something'. -+ Property 'prop' is missing in type 'TableClass' but required in type 'Something'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(31,5): error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. - Type 'TableClass' is not assignable to type 'Something | SomethingElse'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(35,1): error TS2322: Type 'Table' is not assignable to type 'boolean'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(36,1): error TS2322: Type 'Table' is not assignable to type 'string | number'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(37,1): error TS2322: Type 'Table' is not assignable to type 'string | Something'. -+ Property 'prop' is missing in type 'TableClass' but required in type 'Something'. - typeVariableConstraintedToAliasNotAssignableToUnion.ts(38,1): error TS2322: Type 'Table' is not assignable to type 'Something | SomethingElse'. - - -@@= skipped -41, +43 lines =@@ - ~~~~~~~~~~~~~~~~~~ - !!! error TS2322: Type 'T' is not assignable to type 'string | Something'. - !!! error TS2322: Type 'TableClass' is not assignable to type 'string | Something'. -+!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -+!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. - someUnion = o; - ~~~~~~~~~ - !!! error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. -@@= skipped -19, +21 lines =@@ - ~~~~~~~~~~~~~~~~~~ - !!! error TS2322: Type 'T' is not assignable to type 'string | Something'. - !!! error TS2322: Type 'TableClass' is not assignable to type 'string | Something'. -+!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -+!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. - someUnion = o; - ~~~~~~~~~ - !!! error TS2322: Type 'T' is not assignable to type 'Something | SomethingElse'. -@@= skipped -16, +18 lines =@@ - aStringOrSomething = o; - ~~~~~~~~~~~~~~~~~~ - !!! error TS2322: Type 'Table' is not assignable to type 'string | Something'. -+!!! error TS2322: Property 'prop' is missing in type 'TableClass' but required in type 'Something'. -+!!! related TS2728 typeVariableConstraintedToAliasNotAssignableToUnion.ts:8:5: 'prop' is declared here. - someUnion = o; - ~~~~~~~~~ - !!! error TS2322: Type 'Table' is not assignable to type 'Something | SomethingElse'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt index 74608cafa4..523bfb49a2 100644 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt @@ -1,8 +1,6 @@ file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'? file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. - Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. - Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. ==== file.tsx (3 errors) ==== @@ -51,7 +49,6 @@ file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable ) } ~~~~~~~~~~~~~ !!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. !!! related TS6212 file.tsx:36:15: Did you mean to call this expression? { user => ( ~~~~~~~~~ @@ -60,7 +57,6 @@ file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable ) } ~~~~~~~~~~~~~ !!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. !!! related TS6212 file.tsx:39:15: Did you mean to call this expression? ); diff --git a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt.diff deleted file mode 100644 index 027babfbfe..0000000000 --- a/testdata/baselines/reference/submodule/conformance/checkJsxChildrenProperty4.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.checkJsxChildrenProperty4.errors.txt -+++ new.checkJsxChildrenProperty4.errors.txt -@@= skipped -0, +0 lines =@@ - file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'? - file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -+ Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. - file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -+ Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. - - - ==== file.tsx (3 errors) ==== -@@= skipped -48, +50 lines =@@ - ) } - ~~~~~~~~~~~~~ - !!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -+!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. - !!! related TS6212 file.tsx:36:15: Did you mean to call this expression? - { user => ( - ~~~~~~~~~ -@@= skipped -8, +9 lines =@@ - ) } - ~~~~~~~~~~~~~ - !!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'boolean | any[] | ReactChild'. -+!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'any[] | ReactElement'. - !!! related TS6212 file.tsx:39:15: Did you mean to call this expression? - - ); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt b/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt index c2b957fa97..1ca9f7a2ed 100644 --- a/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt @@ -1,7 +1,6 @@ decoratorOnClassMethod8.ts(4,6): error TS1241: Unable to resolve signature of method decorator when called as an expression. The runtime will invoke the decorator with 3 arguments, but the decorator expects 1. decoratorOnClassMethod8.ts(4,6): error TS1270: Decorator function return type 'C' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. - Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. ==== decoratorOnClassMethod8.ts (2 errors) ==== @@ -14,5 +13,4 @@ decoratorOnClassMethod8.ts(4,6): error TS1270: Decorator function return type 'C !!! error TS1241: The runtime will invoke the decorator with 3 arguments, but the decorator expects 1. ~~~ !!! error TS1270: Decorator function return type 'C' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -!!! error TS1270: Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt.diff deleted file mode 100644 index 23fd57eecc..0000000000 --- a/testdata/baselines/reference/submodule/conformance/decoratorOnClassMethod8.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.decoratorOnClassMethod8.errors.txt -+++ new.decoratorOnClassMethod8.errors.txt -@@= skipped -0, +0 lines =@@ - decoratorOnClassMethod8.ts(4,6): error TS1241: Unable to resolve signature of method decorator when called as an expression. - The runtime will invoke the decorator with 3 arguments, but the decorator expects 1. - decoratorOnClassMethod8.ts(4,6): error TS1270: Decorator function return type 'C' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+ Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - - - ==== decoratorOnClassMethod8.ts (2 errors) ==== -@@= skipped -12, +13 lines =@@ - !!! error TS1241: The runtime will invoke the decorator with 3 arguments, but the decorator expects 1. - ~~~ - !!! error TS1270: Decorator function return type 'C' is not assignable to type 'void | TypedPropertyDescriptor<() => void>'. -+!!! error TS1270: Type 'C' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. - } \ No newline at end of file