From 9459dfe7e072849450f5c79d1cc94530206f9f4e Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 23 Jun 2026 13:16:22 -0700 Subject: [PATCH] Infer void for statement-less function bodies in ID inference --- internal/checker/pseudotypenodebuilder.go | 4 + internal/fourslash/_scripts/failingTests.txt | 4 + internal/pseudochecker/lookup.go | 3 + internal/pseudochecker/type.go | 2 + .../isolatedDeclarationErrors.errors.txt | 7 +- ...solatedDeclarationErrorsClasses.errors.txt | 10 +- ...clarationErrorsExpandoFunctions.errors.txt | 26 +- ...ationErrorsFunctionDeclarations.errors.txt | 6 +- ...ErrorsFunctionDeclarations.errors.txt.diff | 20 + ...solatedDeclarationErrorsObjects.errors.txt | 22 +- ...edDeclarationErrorsObjects.errors.txt.diff | 59 +++ ...tedDeclarationErrorsReturnTypes.errors.txt | 248 ++++++------ .../isolatedDeclarationLazySymbols.errors.txt | 6 +- ...atedDeclarationLazySymbols.errors.txt.diff | 20 + .../isolatedDeclarationErrors.errors.txt.diff | 10 +- ...edDeclarationErrorsClasses.errors.txt.diff | 45 ++- ...tionErrorsExpandoFunctions.errors.txt.diff | 31 +- ...clarationErrorsReturnTypes.errors.txt.diff | 367 +++++++++++++++--- 18 files changed, 619 insertions(+), 271 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt.diff diff --git a/internal/checker/pseudotypenodebuilder.go b/internal/checker/pseudotypenodebuilder.go index a08187c2478..a2ed2b116ed 100644 --- a/internal/checker/pseudotypenodebuilder.go +++ b/internal/checker/pseudotypenodebuilder.go @@ -171,6 +171,8 @@ func (b *NodeBuilderImpl) pseudoTypeToNode(t *pseudochecker.PseudoType) *ast.Nod return b.f.NewLiteralTypeNode(b.f.NewKeywordExpression(ast.KindFalseKeyword)) case pseudochecker.PseudoTypeKindTrue: return b.f.NewLiteralTypeNode(b.f.NewKeywordExpression(ast.KindTrueKeyword)) + case pseudochecker.PseudoTypeKindVoid: + return b.f.NewKeywordTypeNode(ast.KindVoidKeyword) case pseudochecker.PseudoTypeKindSingleCallSignature: d := t.AsPseudoTypeSingleCallSignature() signature := b.ch.getSignatureFromDeclaration(d.Signature) @@ -744,6 +746,8 @@ func (b *NodeBuilderImpl) pseudoTypeToType(t *pseudochecker.PseudoType) *Type { return b.ch.falseType case pseudochecker.PseudoTypeKindTrue: return b.ch.trueType + case pseudochecker.PseudoTypeKindVoid: + return b.ch.voidType case pseudochecker.PseudoTypeKindStringLiteral, pseudochecker.PseudoTypeKindNumericLiteral, pseudochecker.PseudoTypeKindBigIntLiteral: source := t.AsPseudoTypeLiteral().Node return b.ch.getRegularTypeOfExpression(source) // big shortcut, uses cached expression types where possible diff --git a/internal/fourslash/_scripts/failingTests.txt b/internal/fourslash/_scripts/failingTests.txt index 6b5b6c602c4..ec5d42bcb5a 100644 --- a/internal/fourslash/_scripts/failingTests.txt +++ b/internal/fourslash/_scripts/failingTests.txt @@ -63,10 +63,14 @@ TestCodeFixInferFromUsageRestParam3 TestCodeFixInferFromUsageVariable3JS TestCodeFixMissingTypeAnnotationOnExports11 TestCodeFixMissingTypeAnnotationOnExports16 +TestCodeFixMissingTypeAnnotationOnExports22_formatting TestCodeFixMissingTypeAnnotationOnExports23_heritage_formatting TestCodeFixMissingTypeAnnotationOnExports24_heritage_formatting_2 TestCodeFixMissingTypeAnnotationOnExports25_heritage_formatting_3 TestCodeFixMissingTypeAnnotationOnExports28_long_types +TestCodeFixMissingTypeAnnotationOnExports33_methods +TestCodeFixMissingTypeAnnotationOnExports43_expando_functions_2 +TestCodeFixMissingTypeAnnotationOnExports46_decorators_experimental TestCodeFixSpelling4 TestCodeFixSpelling5 TestCodeFixSpellingCaseSensitive1 diff --git a/internal/pseudochecker/lookup.go b/internal/pseudochecker/lookup.go index 40be9a5cc02..b50765de537 100644 --- a/internal/pseudochecker/lookup.go +++ b/internal/pseudochecker/lookup.go @@ -226,6 +226,9 @@ func (ch *PseudoChecker) typeFromSingleReturnExpression(fn *ast.Node) *PseudoTyp body := fn.Body() if ast.IsBlock(body) { + if len(body.Statements()) == 0 { + return PseudoTypeVoid + } ast.ForEachReturnStatement(body, func(stmt *ast.Node) bool { if stmt.Parent != body { // Why bail on nested return statements? candidateExpr = nil diff --git a/internal/pseudochecker/type.go b/internal/pseudochecker/type.go index d9a8d1816eb..13218912ad8 100644 --- a/internal/pseudochecker/type.go +++ b/internal/pseudochecker/type.go @@ -33,6 +33,7 @@ const ( PseudoTypeKindBoolean PseudoTypeKindFalse PseudoTypeKindTrue + PseudoTypeKindVoid PseudoTypeKindSingleCallSignature PseudoTypeKindTuple PseudoTypeKindObjectLiteral @@ -77,6 +78,7 @@ var ( PseudoTypeBoolean = newPseudoType(PseudoTypeKindBoolean, &PseudoTypeBase{}) PseudoTypeFalse = newPseudoType(PseudoTypeKindFalse, &PseudoTypeBase{}) PseudoTypeTrue = newPseudoType(PseudoTypeKindTrue, &PseudoTypeBase{}) + PseudoTypeVoid = newPseudoType(PseudoTypeKindVoid, &PseudoTypeBase{}) ) // PseudoTypeDirect directly encodes the type referred to by a given TypeNode diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.errors.txt index 6a3e41ddf67..3097615b791 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrors.errors.txt @@ -2,12 +2,11 @@ isolatedDeclarationErrors.ts(2,1): error TS9023: Assigning properties to functio isolatedDeclarationErrors.ts(2,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrors.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrors.ts(5,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrors.ts(7,30): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrors.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrors.ts(8,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -==== isolatedDeclarationErrors.ts (7 errors) ==== +==== isolatedDeclarationErrors.ts (6 errors) ==== function errorOnAssignmentBelowDecl(): void {} errorOnAssignmentBelowDecl.a = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -23,10 +22,6 @@ isolatedDeclarationErrors.ts(8,1): error TS9013: Expression type can't be inferr !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. const errorOnMissingReturn = () => {} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9027 isolatedDeclarationErrors.ts:7:7: Add a type annotation to the variable errorOnMissingReturn. -!!! related TS9030 isolatedDeclarationErrors.ts:7:30: Add a return type to the function expression. errorOnMissingReturn.a = ""; ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.errors.txt index 3ad94372e0c..d44c899893a 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsClasses.errors.txt @@ -1,5 +1,4 @@ isolatedDeclarationErrorsClasses.ts(3,5): error TS9012: Property must have an explicit type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsClasses.ts(4,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(8,18): error TS7006: Parameter 'p' implicitly has an 'any' type. isolatedDeclarationErrorsClasses.ts(8,18): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(9,23): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. @@ -11,7 +10,6 @@ isolatedDeclarationErrorsClasses.ts(36,5): error TS9038: Computed property names isolatedDeclarationErrorsClasses.ts(36,6): error TS2304: Cannot find name 'missing'. isolatedDeclarationErrorsClasses.ts(38,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(40,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsClasses.ts(42,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(42,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(44,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(44,35): error TS7006: Parameter 'v' implicitly has an 'any' type. @@ -26,7 +24,7 @@ isolatedDeclarationErrorsClasses.ts(56,5): error TS7010: '[noAnnotationLiteralNa isolatedDeclarationErrorsClasses.ts(56,5): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -==== isolatedDeclarationErrorsClasses.ts (26 errors) ==== +==== isolatedDeclarationErrorsClasses.ts (24 errors) ==== export class Cls { field = 1 + 1; @@ -34,9 +32,6 @@ isolatedDeclarationErrorsClasses.ts(56,5): error TS9013: Expression type can't b !!! error TS9012: Property must have an explicit type annotation with --isolatedDeclarations. !!! related TS9029 isolatedDeclarationErrorsClasses.ts:3:5: Add a type annotation to the property field. method() {} - ~~~~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9034 isolatedDeclarationErrorsClasses.ts:4:5: Add a return type to the method methodOk(): void {} @@ -103,9 +98,6 @@ isolatedDeclarationErrorsClasses.ts(56,5): error TS9013: Expression type can't b [noAnnotationStringName]() { } ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9034 isolatedDeclarationErrorsClasses.ts:42:5: Add a return type to the method - ~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. [noParamAnnotationStringName](v): void { } diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt index 1fd5ef55705..fe3bda130d4 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt @@ -1,70 +1,46 @@ -isolatedDeclarationErrorsExpandoFunctions.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsExpandoFunctions.ts(3,13): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsExpandoFunctions.ts(4,12): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsExpandoFunctions.ts(5,12): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsExpandoFunctions.ts(6,14): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsExpandoFunctions.ts(7,16): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationErrorsExpandoFunctions.ts(8,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(9,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -==== isolatedDeclarationErrorsExpandoFunctions.ts (19 errors) ==== +==== isolatedDeclarationErrorsExpandoFunctions.ts (13 errors) ==== export function foo() {} - ~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9031 isolatedDeclarationErrorsExpandoFunctions.ts:1:17: Add a return type to the function declaration. foo.apply = () => {} ~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ~~~~~~~~~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:3:13: Add a return type to the function expression. foo.call = ()=> {} ~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ~~~~~~~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. - ~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:4:12: Add a return type to the function expression. foo.bind = ()=> {} ~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ~~~~~~~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. - ~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:5:12: Add a return type to the function expression. foo.caller = ()=> {} ~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ~~~~~~~~~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. - ~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:6:14: Add a return type to the function expression. foo.toString = ()=> {} ~~~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. - ~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:7:16: Add a return type to the function expression. foo.length = 10 ~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt index cbec933ded0..3d3b066c1a8 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt @@ -1,4 +1,3 @@ -isolatedDeclarationErrorsFunctionDeclarations.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsFunctionDeclarations.ts(3,35): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. isolatedDeclarationErrorsFunctionDeclarations.ts(7,49): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. isolatedDeclarationErrorsFunctionDeclarations.ts(7,66): error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -6,11 +5,8 @@ isolatedDeclarationErrorsFunctionDeclarations.ts(7,81): error TS9013: Expression isolatedDeclarationErrorsFunctionDeclarations.ts(9,55): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -==== isolatedDeclarationErrorsFunctionDeclarations.ts (6 errors) ==== +==== isolatedDeclarationErrorsFunctionDeclarations.ts (5 errors) ==== export function noReturn() {} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9031 isolatedDeclarationErrorsFunctionDeclarations.ts:1:17: Add a return type to the function declaration. export function noParamAnnotation(p): void {} ~ diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt.diff new file mode 100644 index 00000000000..e7431ea0d33 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsFunctionDeclarations.errors.txt.diff @@ -0,0 +1,20 @@ +--- old.isolatedDeclarationErrorsFunctionDeclarations.errors.txt ++++ new.isolatedDeclarationErrorsFunctionDeclarations.errors.txt +@@= skipped -0, +0 lines =@@ +-isolatedDeclarationErrorsFunctionDeclarations.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsFunctionDeclarations.ts(3,35): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsFunctionDeclarations.ts(7,49): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsFunctionDeclarations.ts(7,66): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +@@= skipped -5, +4 lines =@@ + isolatedDeclarationErrorsFunctionDeclarations.ts(9,55): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + + +-==== isolatedDeclarationErrorsFunctionDeclarations.ts (6 errors) ==== ++==== isolatedDeclarationErrorsFunctionDeclarations.ts (5 errors) ==== + export function noReturn() {} +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9031 isolatedDeclarationErrorsFunctionDeclarations.ts:1:17: Add a return type to the function declaration. + + export function noParamAnnotation(p): void {} + ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt index 8fa23907bd2..3bf5c1d3d94 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt @@ -1,11 +1,7 @@ isolatedDeclarationErrorsObjects.ts(7,8): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsObjects.ts(12,12): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsObjects.ts(16,12): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsObjects.ts(21,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsObjects.ts(24,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsObjects.ts(25,8): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsObjects.ts(29,9): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsObjects.ts(32,9): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsObjects.ts(40,9): error TS7032: Property 'singleSetterBad' implicitly has type 'any', because its set accessor lacks a parameter type annotation. isolatedDeclarationErrorsObjects.ts(40,25): error TS7006: Parameter 'value' implicitly has an 'any' type. isolatedDeclarationErrorsObjects.ts(40,25): error TS9009: At least one accessor must have an explicit type annotation with --isolatedDeclarations. @@ -19,7 +15,7 @@ isolatedDeclarationErrorsObjects.ts(77,5): error TS9016: Objects that contain sh isolatedDeclarationErrorsObjects.ts(84,9): error TS9015: Objects that contain spread assignments can't be inferred with --isolatedDeclarations. -==== isolatedDeclarationErrorsObjects.ts (19 errors) ==== +==== isolatedDeclarationErrorsObjects.ts (15 errors) ==== export let o = { a: 1, b: "" @@ -53,17 +49,9 @@ isolatedDeclarationErrorsObjects.ts(84,9): error TS9015: Objects that contain sp export let oWithMethods = { method() { }, - ~~~~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9027 isolatedDeclarationErrorsObjects.ts:20:12: Add a type annotation to the variable oWithMethods. -!!! related TS9034 isolatedDeclarationErrorsObjects.ts:21:5: Add a return type to the method okMethod(): void { }, a: 1, bad() { }, - ~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9027 isolatedDeclarationErrorsObjects.ts:20:12: Add a type annotation to the variable oWithMethods. -!!! related TS9034 isolatedDeclarationErrorsObjects.ts:24:5: Add a return type to the method e: V, ~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -73,17 +61,9 @@ isolatedDeclarationErrorsObjects.ts(84,9): error TS9015: Objects that contain sp export let oWithMethodsNested = { foo: { method() { }, - ~~~~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9027 isolatedDeclarationErrorsObjects.ts:27:12: Add a type annotation to the variable oWithMethodsNested. -!!! related TS9034 isolatedDeclarationErrorsObjects.ts:29:9: Add a return type to the method a: 1, okMethod(): void { }, bad() { } - ~~~ -!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9027 isolatedDeclarationErrorsObjects.ts:27:12: Add a type annotation to the variable oWithMethodsNested. -!!! related TS9034 isolatedDeclarationErrorsObjects.ts:32:9: Add a return type to the method } } diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt.diff new file mode 100644 index 00000000000..fb07d7d2353 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsObjects.errors.txt.diff @@ -0,0 +1,59 @@ +--- old.isolatedDeclarationErrorsObjects.errors.txt ++++ new.isolatedDeclarationErrorsObjects.errors.txt +@@= skipped -0, +0 lines =@@ + isolatedDeclarationErrorsObjects.ts(7,8): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + isolatedDeclarationErrorsObjects.ts(12,12): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + isolatedDeclarationErrorsObjects.ts(16,12): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +-isolatedDeclarationErrorsObjects.ts(21,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsObjects.ts(24,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsObjects.ts(25,8): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +-isolatedDeclarationErrorsObjects.ts(29,9): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsObjects.ts(32,9): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsObjects.ts(40,9): error TS7032: Property 'singleSetterBad' implicitly has type 'any', because its set accessor lacks a parameter type annotation. + isolatedDeclarationErrorsObjects.ts(40,25): error TS7006: Parameter 'value' implicitly has an 'any' type. + isolatedDeclarationErrorsObjects.ts(40,25): error TS9009: At least one accessor must have an explicit type annotation with --isolatedDeclarations. +@@= skipped -18, +14 lines =@@ + isolatedDeclarationErrorsObjects.ts(84,9): error TS9015: Objects that contain spread assignments can't be inferred with --isolatedDeclarations. + + +-==== isolatedDeclarationErrorsObjects.ts (19 errors) ==== ++==== isolatedDeclarationErrorsObjects.ts (15 errors) ==== + export let o = { + a: 1, + b: "" +@@= skipped -34, +34 lines =@@ + + export let oWithMethods = { + method() { }, +- ~~~~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9027 isolatedDeclarationErrorsObjects.ts:20:12: Add a type annotation to the variable oWithMethods. +-!!! related TS9034 isolatedDeclarationErrorsObjects.ts:21:5: Add a return type to the method + okMethod(): void { }, + a: 1, + bad() { }, +- ~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9027 isolatedDeclarationErrorsObjects.ts:20:12: Add a type annotation to the variable oWithMethods. +-!!! related TS9034 isolatedDeclarationErrorsObjects.ts:24:5: Add a return type to the method + e: V, + ~ + !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. +@@= skipped -20, +12 lines =@@ + export let oWithMethodsNested = { + foo: { + method() { }, +- ~~~~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9027 isolatedDeclarationErrorsObjects.ts:27:12: Add a type annotation to the variable oWithMethodsNested. +-!!! related TS9034 isolatedDeclarationErrorsObjects.ts:29:9: Add a return type to the method + a: 1, + okMethod(): void { }, + bad() { } +- ~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9027 isolatedDeclarationErrorsObjects.ts:27:12: Add a type annotation to the variable oWithMethodsNested. +-!!! related TS9034 isolatedDeclarationErrorsObjects.ts:32:9: Add a return type to the method + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt index b9dfb496711..f3cd191ed1b 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt @@ -1,46 +1,46 @@ -isolatedDeclarationErrorsReturnTypes.ts(13,45): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(16,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(19,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(109,65): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(13,40): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(16,36): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(19,36): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(109,60): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(110,43): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(112,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(112,56): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(113,39): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(115,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(115,56): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(116,39): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(119,83): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(120,66): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(122,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(123,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(125,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(126,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(119,78): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(120,61): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(122,74): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(123,57): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(125,74): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(126,57): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(129,62): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(130,45): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(132,58): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(133,41): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(135,58): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(136,41): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(138,73): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(138,68): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(139,51): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(141,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(141,64): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(142,47): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(144,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(144,64): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(145,47): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(151,38): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(152,21): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(153,57): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(154,40): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(156,51): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(157,34): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(158,70): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(159,53): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(162,53): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(163,36): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(164,72): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(165,55): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(167,66): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(168,49): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(169,85): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -isolatedDeclarationErrorsReturnTypes.ts(170,68): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(151,33): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(152,16): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(153,52): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(154,35): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(156,46): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(157,29): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(158,65): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(159,48): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(162,48): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(163,31): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(164,67): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(165,50): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(167,61): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(168,44): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(169,80): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(170,63): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(173,44): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(174,27): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrorsReturnTypes.ts(175,63): error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -73,24 +73,24 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c // No Errors export const fnExpressionConstVariableOk = function foo(): number { return 0;} export const fnArrowConstVariableOk = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:13:40: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:13:45: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:13:40: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnExpressionLetVariableOk = function foo(): number { return 0;} export let fnArrowLetVariableOk = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:16:36: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:16:41: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:16:36: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnExpressionVarVariableOk = function foo(): number { return 0;} export var fnArrowVarVariableOk = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:19:36: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:19:41: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:19:36: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // Not exported const fnExpressionConstVariableInternal = function foo() { return 0;} @@ -181,10 +181,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c // In Function Variables - No annotations export const fnParamExpressionConstVariable = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:109:60: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:109:65: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:109:60: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamArrowConstVariable = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -192,10 +192,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c !!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:110:43: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamExpressionLetVariable = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:112:56: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:112:61: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:112:56: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamArrowLetVariable = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -203,10 +203,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c !!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:113:39: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamExpressionVarVariable = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:115:56: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:115:61: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:115:56: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamArrowVarVariable = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -215,37 +215,37 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c // In Function Variables - No annotations on parameter export const fnParamExpressionConstVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:119:78: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:119:83: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:119:78: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamArrowConstVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:120:61: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:120:66: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:120:61: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamExpressionLetVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:122:74: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:122:79: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:122:74: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamArrowLetVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:123:57: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:123:62: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:123:57: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamExpressionVarVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:125:74: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:125:79: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:125:74: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamArrowVarVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:126:57: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:126:62: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:126:57: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // No Errors export const fnParamExpressionConstVariableOk = function foo(cb = function(): void{ }): number { return 0;} @@ -282,10 +282,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c !!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:136:41: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamExpressionConstVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:138:68: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:138:73: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:138:68: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamArrowConstVariableInternal = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -293,10 +293,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c !!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:139:51: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamExpressionLetVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:141:64: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:141:69: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:141:64: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamArrowLetVariableInternal = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -304,10 +304,10 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c !!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:142:47: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamExpressionVarVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:144:64: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:144:69: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:144:64: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamArrowVarVariableInternal = (cb = () => 1) => "S"; ~~~~~~~~~~~~ !!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -319,89 +319,89 @@ isolatedDeclarationErrorsReturnTypes.ts(192,50): error TS9013: Expression type c export class FnParamsExportedClass { // Should Error fnExpression = function foo(cb = function(){ }) { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:151:33: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:151:38: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:151:33: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. fnArrow = (cb = function(){ }) => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:152:16: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:152:21: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:152:16: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected fnExpressionProtected = function foo(cb = function(){ }) { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:153:52: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:153:57: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:153:52: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected fnArrowProtected = (cb = function(){ }) => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:154:35: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:154:40: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:154:35: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. static fnStaticExpression = function foo(cb = function(){ }) { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:156:46: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:156:51: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:156:46: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. static fnStaticArrow = (cb = function(){ }) => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:157:29: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:157:34: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:157:29: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected static fnStaticExpressionProtected = function foo(cb = function(){ }) { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:158:65: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:158:70: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:158:65: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected static fnStaticArrowProtected = (cb = function(){ }) => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:159:48: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:159:53: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:159:48: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // Have annotation on owner fnExpressionMethodHasReturn = function foo(cb = function(){ }): number { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:162:48: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:162:53: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:162:48: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. fnArrowMethodHasReturn = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:163:31: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:163:36: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:163:31: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected fnExpressionProtectedMethodHasReturn = function foo(cb = function(){ }): number { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:164:67: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:164:72: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:164:67: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected fnArrowProtectedMethodHasReturn = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:165:50: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:165:55: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:165:50: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. static fnStaticExpressionMethodHasReturn = function foo(cb = function(){ }): number { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:167:61: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:167:66: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:167:61: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. static fnStaticArrowMethodHasReturn = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:168:44: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:168:49: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:168:44: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected static fnStaticExpressionProtectedMethodHasReturn = function foo(cb = function(){ }): number { return 0; } - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:169:80: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:169:85: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:169:80: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. protected static fnStaticArrowProtectedMethodHasReturn = (cb = function(){ }): string => "S"; - ~~~~~~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:170:63: Add a type annotation to the parameter cb. -!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:170:68: Add a return type to the function expression. +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:170:63: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // Have annotation only on parameter fnExpressionOnlyOnParam = function foo(cb = function(): void { }) { return 0; } diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt index 812ec2c1bea..941d9aa3a36 100644 --- a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt @@ -1,4 +1,3 @@ -isolatedDeclarationLazySymbols.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationLazySymbols.ts(13,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. isolatedDeclarationLazySymbols.ts(16,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. isolatedDeclarationLazySymbols.ts(16,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. @@ -6,11 +5,8 @@ isolatedDeclarationLazySymbols.ts(21,5): error TS9038: Computed property names o isolatedDeclarationLazySymbols.ts(22,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. -==== isolatedDeclarationLazySymbols.ts (6 errors) ==== +==== isolatedDeclarationLazySymbols.ts (5 errors) ==== export function foo() { - ~~~ -!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -!!! related TS9031 isolatedDeclarationLazySymbols.ts:1:17: Add a return type to the function declaration. } diff --git a/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt.diff new file mode 100644 index 00000000000..b22f956dcf4 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/isolatedDeclarationLazySymbols.errors.txt.diff @@ -0,0 +1,20 @@ +--- old.isolatedDeclarationLazySymbols.errors.txt ++++ new.isolatedDeclarationLazySymbols.errors.txt +@@= skipped -0, +0 lines =@@ +-isolatedDeclarationLazySymbols.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. + isolatedDeclarationLazySymbols.ts(13,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + isolatedDeclarationLazySymbols.ts(16,5): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. + isolatedDeclarationLazySymbols.ts(16,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. +@@= skipped -5, +4 lines =@@ + isolatedDeclarationLazySymbols.ts(22,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + + +-==== isolatedDeclarationLazySymbols.ts (6 errors) ==== ++==== isolatedDeclarationLazySymbols.ts (5 errors) ==== + export function foo() { +- ~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9031 isolatedDeclarationLazySymbols.ts:1:17: Add a return type to the function declaration. + + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrors.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrors.errors.txt.diff index 4b5a5eafb05..06c5e608211 100644 --- a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrors.errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrors.errors.txt.diff @@ -4,8 +4,8 @@ isolatedDeclarationErrors.ts(2,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrors.ts(2,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. isolatedDeclarationErrors.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +-isolatedDeclarationErrors.ts(7,30): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +isolatedDeclarationErrors.ts(5,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrors.ts(7,30): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrors.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - - @@ -13,7 +13,7 @@ +isolatedDeclarationErrors.ts(8,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + + -+==== isolatedDeclarationErrors.ts (7 errors) ==== ++==== isolatedDeclarationErrors.ts (6 errors) ==== function errorOnAssignmentBelowDecl(): void {} errorOnAssignmentBelowDecl.a = ""; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -29,8 +29,10 @@ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. const errorOnMissingReturn = () => {} - ~~~~~~~~ -@@= skipped -22, +29 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9027 isolatedDeclarationErrors.ts:7:7: Add a type annotation to the variable errorOnMissingReturn. +-!!! related TS9030 isolatedDeclarationErrors.ts:7:30: Add a return type to the function expression. errorOnMissingReturn.a = ""; ~~~~~~~~~~~~~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsClasses.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsClasses.errors.txt.diff index 125f06adf32..5da356bd3ec 100644 --- a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsClasses.errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsClasses.errors.txt.diff @@ -1,6 +1,8 @@ --- old.isolatedDeclarationErrorsClasses.errors.txt +++ new.isolatedDeclarationErrorsClasses.errors.txt -@@= skipped -2, +2 lines =@@ +@@= skipped -0, +0 lines =@@ + isolatedDeclarationErrorsClasses.ts(3,5): error TS9012: Property must have an explicit type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsClasses.ts(4,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(8,18): error TS7006: Parameter 'p' implicitly has an 'any' type. isolatedDeclarationErrorsClasses.ts(8,18): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. isolatedDeclarationErrorsClasses.ts(9,23): error TS9011: Parameter must have an explicit type annotation with --isolatedDeclarations. @@ -9,7 +11,34 @@ isolatedDeclarationErrorsClasses.ts(12,9): error TS7032: Property 'setOnly' implicitly has type 'any', because its set accessor lacks a parameter type annotation. isolatedDeclarationErrorsClasses.ts(12,17): error TS7006: Parameter 'value' implicitly has an 'any' type. isolatedDeclarationErrorsClasses.ts(12,17): error TS9009: At least one accessor must have an explicit type annotation with --isolatedDeclarations. -@@= skipped -49, +49 lines =@@ +@@= skipped -10, +9 lines =@@ + isolatedDeclarationErrorsClasses.ts(36,6): error TS2304: Cannot find name 'missing'. + isolatedDeclarationErrorsClasses.ts(38,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + isolatedDeclarationErrorsClasses.ts(40,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. +-isolatedDeclarationErrorsClasses.ts(42,5): error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. + isolatedDeclarationErrorsClasses.ts(42,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + isolatedDeclarationErrorsClasses.ts(44,5): error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + isolatedDeclarationErrorsClasses.ts(44,35): error TS7006: Parameter 'v' implicitly has an 'any' type. +@@= skipped -15, +14 lines =@@ + isolatedDeclarationErrorsClasses.ts(56,5): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + + +-==== isolatedDeclarationErrorsClasses.ts (26 errors) ==== ++==== isolatedDeclarationErrorsClasses.ts (24 errors) ==== + export class Cls { + + field = 1 + 1; +@@= skipped -8, +8 lines =@@ + !!! error TS9012: Property must have an explicit type annotation with --isolatedDeclarations. + !!! related TS9029 isolatedDeclarationErrorsClasses.ts:3:5: Add a type annotation to the property field. + method() {} +- ~~~~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9034 isolatedDeclarationErrorsClasses.ts:4:5: Add a return type to the method + + methodOk(): void {} + +@@= skipped -18, +15 lines =@@ !!! related TS9028 isolatedDeclarationErrorsClasses.ts:9:19: Add a type annotation to the parameter p. get getOnly() { return 1 + 1 } @@ -21,4 +50,14 @@ +!!! related TS9035 isolatedDeclarationErrorsClasses.ts:11:28: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. set setOnly(value) { } ~~~~~~~ - !!! error TS7032: Property 'setOnly' implicitly has type 'any', because its set accessor lacks a parameter type annotation. \ No newline at end of file + !!! error TS7032: Property 'setOnly' implicitly has type 'any', because its set accessor lacks a parameter type annotation. +@@= skipped -49, +50 lines =@@ + !!! error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + + [noAnnotationStringName]() { } +- ~~~~~~~~~~~~~~~~~~~~~~~~ +-!!! error TS9008: Method must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9034 isolatedDeclarationErrorsClasses.ts:42:5: Add a return type to the method + ~~~~~~~~~~~~~~~~~~~~~~~~ + !!! error TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt.diff index dc967587fb9..d41d3f87d7f 100644 --- a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsExpandoFunctions.errors.txt.diff @@ -1,22 +1,17 @@ --- old.isolatedDeclarationErrorsExpandoFunctions.errors.txt +++ new.isolatedDeclarationErrorsExpandoFunctions.errors.txt @@= skipped -0, +0 lines =@@ - isolatedDeclarationErrorsExpandoFunctions.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsExpandoFunctions.ts(1,17): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrorsExpandoFunctions.ts(3,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+isolatedDeclarationErrorsExpandoFunctions.ts(3,13): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrorsExpandoFunctions.ts(4,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+isolatedDeclarationErrorsExpandoFunctions.ts(4,12): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrorsExpandoFunctions.ts(5,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+isolatedDeclarationErrorsExpandoFunctions.ts(5,12): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrorsExpandoFunctions.ts(6,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+isolatedDeclarationErrorsExpandoFunctions.ts(6,14): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +isolatedDeclarationErrorsExpandoFunctions.ts(7,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+isolatedDeclarationErrorsExpandoFunctions.ts(7,16): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. isolatedDeclarationErrorsExpandoFunctions.ts(8,1): error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - - @@ -25,51 +20,37 @@ +isolatedDeclarationErrorsExpandoFunctions.ts(9,1): error TS9013: Expression type can't be inferred with --isolatedDeclarations. + + -+==== isolatedDeclarationErrorsExpandoFunctions.ts (19 errors) ==== ++==== isolatedDeclarationErrorsExpandoFunctions.ts (13 errors) ==== export function foo() {} - ~~~ - !!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -@@= skipped -15, +27 lines =@@ +- ~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-!!! related TS9031 isolatedDeclarationErrorsExpandoFunctions.ts:1:17: Add a return type to the function declaration. + foo.apply = () => {} ~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+ ~~~~~~~~ -+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -+!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:3:13: Add a return type to the function expression. foo.call = ()=> {} ~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+ ~~~~~~~ -+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -+!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:4:12: Add a return type to the function expression. foo.bind = ()=> {} ~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+ ~~~~~~~ -+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -+!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:5:12: Add a return type to the function expression. foo.caller = ()=> {} ~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+ ~~~~~~~ -+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -+!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:6:14: Add a return type to the function expression. foo.toString = ()=> {} ~~~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -+ ~~~~~~~ -+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -+!!! related TS9030 isolatedDeclarationErrorsExpandoFunctions.ts:7:16: Add a return type to the function expression. foo.length = 10 ~~~~~~~~~~ !!! error TS9023: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt.diff index 27ddaaa55e0..96718016ec7 100644 --- a/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/isolatedDeclarationErrorsReturnTypes.errors.txt.diff @@ -1,42 +1,83 @@ --- old.isolatedDeclarationErrorsReturnTypes.errors.txt +++ new.isolatedDeclarationErrorsReturnTypes.errors.txt -@@= skipped -1, +1 lines =@@ - isolatedDeclarationErrorsReturnTypes.ts(16,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(19,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(109,65): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +@@= skipped -0, +0 lines =@@ +-isolatedDeclarationErrorsReturnTypes.ts(13,45): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(16,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(19,41): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(109,65): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(112,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(115,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(119,83): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(120,66): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(122,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(123,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(125,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(126,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(138,73): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(141,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(144,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(151,38): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(152,21): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(153,57): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(154,40): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(156,51): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(157,34): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(158,70): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(159,53): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(162,53): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(163,36): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(164,72): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(165,55): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(167,66): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(168,49): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(169,85): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +-isolatedDeclarationErrorsReturnTypes.ts(170,68): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. +- +- +-==== isolatedDeclarationErrorsReturnTypes.ts (31 errors) ==== ++isolatedDeclarationErrorsReturnTypes.ts(13,40): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(16,36): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(19,36): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(109,60): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(110,43): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(112,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(112,56): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(113,39): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(115,61): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(115,56): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(116,39): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(119,83): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(120,66): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(122,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(123,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(125,79): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(126,62): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(119,78): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(120,61): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(122,74): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(123,57): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(125,74): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(126,57): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(129,62): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(130,45): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(132,58): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(133,41): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(135,58): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(136,41): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(138,73): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(138,68): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(139,51): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(141,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(141,64): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(142,47): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(144,69): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(144,64): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(145,47): error TS9013: Expression type can't be inferred with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(151,38): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(152,21): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(153,57): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -@@= skipped -27, +39 lines =@@ - isolatedDeclarationErrorsReturnTypes.ts(168,49): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(169,85): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. - isolatedDeclarationErrorsReturnTypes.ts(170,68): error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. -- -- --==== isolatedDeclarationErrorsReturnTypes.ts (31 errors) ==== ++isolatedDeclarationErrorsReturnTypes.ts(151,33): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(152,16): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(153,52): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(154,35): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(156,46): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(157,29): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(158,65): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(159,48): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(162,48): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(163,31): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(164,67): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(165,50): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(167,61): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(168,44): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(169,80): error TS9013: Expression type can't be inferred with --isolatedDeclarations. ++isolatedDeclarationErrorsReturnTypes.ts(170,63): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(173,44): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(174,27): error TS9013: Expression type can't be inferred with --isolatedDeclarations. +isolatedDeclarationErrorsReturnTypes.ts(175,63): error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -59,9 +100,51 @@ // Function Variables export const fnExpressionConstVariable = function foo() { return 0;} export const fnArrowConstVariable = () => "S"; -@@= skipped -129, +145 lines =@@ +@@= skipped -44, +72 lines =@@ + // No Errors + export const fnExpressionConstVariableOk = function foo(): number { return 0;} + export const fnArrowConstVariableOk = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:13:40: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:13:45: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:13:40: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + export let fnExpressionLetVariableOk = function foo(): number { return 0;} + export let fnArrowLetVariableOk = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:16:36: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:16:41: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:16:36: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + export var fnExpressionVarVariableOk = function foo(): number { return 0;} + export var fnArrowVarVariableOk = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:19:36: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:19:41: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:19:36: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + // Not exported + const fnExpressionConstVariableInternal = function foo() { return 0;} +@@= skipped -108, +108 lines =@@ + + // In Function Variables - No annotations + export const fnParamExpressionConstVariable = function foo(cb = function(){ }) { return 0;} +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:109:60: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:109:65: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:109:65: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:109:60: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamArrowConstVariable = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -69,10 +152,13 @@ +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:110:43: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamExpressionLetVariable = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -@@= skipped -7, +11 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:112:56: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:112:61: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:112:61: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:112:56: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamArrowLetVariable = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -80,10 +166,13 @@ +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:113:39: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamExpressionVarVariable = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -@@= skipped -7, +11 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:115:56: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:115:61: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:115:61: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:115:56: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamArrowVarVariable = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -92,7 +181,55 @@ // In Function Variables - No annotations on parameter export const fnParamExpressionConstVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} -@@= skipped -37, +41 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:119:78: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:119:83: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:119:78: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + export const fnParamArrowConstVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:120:61: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:120:66: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:120:61: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + export let fnParamExpressionLetVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:122:74: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:122:79: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:122:74: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + export let fnParamArrowLetVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:123:57: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:123:62: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:123:57: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + export var fnParamExpressionVarVariableOwnerHasReturnType = function foo(cb = function(){ }): number { return 0;} +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:125:74: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:125:79: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:125:74: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + export var fnParamArrowVarVariableOwnerHasReturnType = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:126:57: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:126:62: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:126:57: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // No Errors export const fnParamExpressionConstVariableOk = function foo(cb = function(): void{ }): number { return 0;} @@ -129,10 +266,13 @@ +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:136:41: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamExpressionConstVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -@@= skipped -14, +38 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:138:68: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:138:73: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:138:73: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:138:68: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export const fnParamArrowConstVariableInternal = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -140,10 +280,13 @@ +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:139:51: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamExpressionLetVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -@@= skipped -7, +11 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:141:64: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:141:69: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:141:69: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:141:64: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export let fnParamArrowLetVariableInternal = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -151,10 +294,13 @@ +!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:142:47: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamExpressionVarVariableInternal = function foo(cb = function(){ }) { return 0;} - ~~~~~~~~ -@@= skipped -7, +11 lines =@@ +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:144:64: Add a type annotation to the parameter cb. - !!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:144:69: Add a return type to the function expression. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:144:69: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:144:64: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. export var fnParamArrowVarVariableInternal = (cb = () => 1) => "S"; + ~~~~~~~~~~~~ +!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. @@ -163,7 +309,140 @@ // In Function Fields -@@= skipped -92, +96 lines =@@ + export class FnParamsExportedClass { + // Should Error + fnExpression = function foo(cb = function(){ }) { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:151:33: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:151:38: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:151:33: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + fnArrow = (cb = function(){ }) => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:152:16: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:152:21: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:152:16: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected fnExpressionProtected = function foo(cb = function(){ }) { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:153:52: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:153:57: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:153:52: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected fnArrowProtected = (cb = function(){ }) => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:154:35: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:154:40: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:154:35: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + static fnStaticExpression = function foo(cb = function(){ }) { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:156:46: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:156:51: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:156:46: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + static fnStaticArrow = (cb = function(){ }) => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:157:29: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:157:34: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:157:29: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected static fnStaticExpressionProtected = function foo(cb = function(){ }) { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:158:65: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:158:70: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:158:65: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected static fnStaticArrowProtected = (cb = function(){ }) => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:159:48: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:159:53: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:159:48: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + // Have annotation on owner + fnExpressionMethodHasReturn = function foo(cb = function(){ }): number { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:162:48: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:162:53: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:162:48: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + fnArrowMethodHasReturn = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:163:31: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:163:36: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:163:31: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected fnExpressionProtectedMethodHasReturn = function foo(cb = function(){ }): number { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:164:67: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:164:72: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:164:67: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected fnArrowProtectedMethodHasReturn = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:165:50: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:165:55: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:165:50: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + + static fnStaticExpressionMethodHasReturn = function foo(cb = function(){ }): number { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:167:61: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:167:66: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:167:61: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + static fnStaticArrowMethodHasReturn = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:168:44: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:168:49: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:168:44: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected static fnStaticExpressionProtectedMethodHasReturn = function foo(cb = function(){ }): number { return 0; } +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:169:80: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:169:85: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:169:80: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. + protected static fnStaticArrowProtectedMethodHasReturn = (cb = function(){ }): string => "S"; +- ~~~~~~~~ +-!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. + !!! related TS9028 isolatedDeclarationErrorsReturnTypes.ts:170:63: Add a type annotation to the parameter cb. +-!!! related TS9030 isolatedDeclarationErrorsReturnTypes.ts:170:68: Add a return type to the function expression. ++!!! related TS9035 isolatedDeclarationErrorsReturnTypes.ts:170:63: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. // Have annotation only on parameter fnExpressionOnlyOnParam = function foo(cb = function(): void { }) { return 0; }