From c0d67268f149bdd6e02ee9e669d679b6d7b7a272 Mon Sep 17 00:00:00 2001 From: Titian Cernicova-Dragomir Date: Mon, 27 Nov 2023 09:18:20 -0500 Subject: [PATCH] Updated baseline. And added more tests. Signed-off-by: Titian Cernicova-Dragomir --- .../expandoFunctionNestedAssigments.js | 117 ++++++++ .../expandoFunctionNestedAssigments.symbols | 125 +++++++++ .../expandoFunctionNestedAssigments.types | 180 +++++++++++++ ...expandoFunctionNestedAssigmentsDeclared.js | 143 ++++++++++ ...doFunctionNestedAssigmentsDeclared.symbols | 198 ++++++++++++++ ...andoFunctionNestedAssigmentsDeclared.types | 253 ++++++++++++++++++ ...efaultExportWithStaticAssignment.d.ts.diff | 33 +-- ...onEmitExpandoPropertyPrivateName.d.ts.diff | 6 +- ...onEmitFunctionDuplicateNamespace.d.ts.diff | 6 +- ...clarationEmitFunctionKeywordProp.d.ts.diff | 30 ++- ...larationEmitLateBoundAssignments.d.ts.diff | 22 +- ...arationEmitLateBoundAssignments2.d.ts.diff | 60 ++--- .../expandoFunctionNestedAssigments.d.ts.diff | 158 +++++++++++ .../diff/exportDefaultNamespace.d.ts.diff | 6 +- ...tionMemberAssignmentDeclarations.d.ts.diff | 13 +- .../diff/nullPropertyName.d.ts.diff | 241 ++++++++++++++++- .../typeFromPropertyAssignment29.d.ts.diff | 53 ++-- ...EmitDefaultExportWithStaticAssignment.d.ts | 31 ++- ...arationEmitExpandoPropertyPrivateName.d.ts | 6 +- ...arationEmitFunctionDuplicateNamespace.d.ts | 6 +- .../declarationEmitFunctionKeywordProp.d.ts | 28 +- .../declarationEmitLateBoundAssignments.d.ts | 20 +- .../declarationEmitLateBoundAssignments2.d.ts | 60 ++--- .../dte/expandoFunctionNestedAssigments.d.ts | 172 ++++++++++++ .../dte/exportDefaultNamespace.d.ts | 6 +- ...dFunctionMemberAssignmentDeclarations.d.ts | 11 +- .../auto-fixed/dte/nullPropertyName.d.ts | 239 ++++++++++++++++- .../dte/typeFromPropertyAssignment29.d.ts | 29 +- .../tsc/expandoFunctionNestedAssigments.d.ts | 82 ++++++ .../contextualReturnTypeOfIIFE2.d.ts.diff | 6 +- .../typeFromPropertyAssignment32.d.ts.diff | 61 +++++ .../typeFromPropertyAssignment33.d.ts.diff | 65 +++++ .../dte/typeFromPropertyAssignment32.d.ts | 131 +++++++++ .../dte/typeFromPropertyAssignment33.d.ts | 135 ++++++++++ .../tsc/contextualReturnTypeOfIIFE2.d.ts | 6 +- .../tsc/typeFromPropertyAssignment32.d.ts | 113 ++++++++ .../tsc/typeFromPropertyAssignment33.d.ts | 117 ++++++++ .../expandoFunctionNestedAssigments.ts | 49 ++++ ...expandoFunctionNestedAssigmentsDeclared.ts | 74 +++++ .../salsa/typeFromPropertyAssignment32.ts | 1 + .../salsa/typeFromPropertyAssignment33.ts | 1 + 41 files changed, 2892 insertions(+), 201 deletions(-) create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigments.js create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigments.symbols create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigments.types create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.js create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.symbols create mode 100644 tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.types create mode 100644 tests/baselines/reference/isolated-declarations/auto-fixed/diff/expandoFunctionNestedAssigments.d.ts.diff create mode 100644 tests/baselines/reference/isolated-declarations/auto-fixed/dte/expandoFunctionNestedAssigments.d.ts create mode 100644 tests/baselines/reference/isolated-declarations/auto-fixed/tsc/expandoFunctionNestedAssigments.d.ts create mode 100644 tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment32.d.ts.diff create mode 100644 tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment33.d.ts.diff create mode 100644 tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment32.d.ts create mode 100644 tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment33.d.ts create mode 100644 tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment32.d.ts create mode 100644 tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment33.d.ts create mode 100644 tests/cases/compiler/expandoFunctionNestedAssigments.ts create mode 100644 tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts diff --git a/tests/baselines/reference/expandoFunctionNestedAssigments.js b/tests/baselines/reference/expandoFunctionNestedAssigments.js new file mode 100644 index 0000000000000..fb1f2f87a9667 --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigments.js @@ -0,0 +1,117 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +//// [expandoFunctionNestedAssigments.ts] +function Foo(): void { + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + +//// [expandoFunctionNestedAssigments.js] +function Foo() { +} +(Foo.bla = { foo: 1 }).foo = (Foo.baz = 1) + (Foo.bar = 0); +if (Foo.fromIf = 1) { + Foo.inIf = 1; +} +while (Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while (Foo.fromDoCondition = 1); +for (Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1) { + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} +for (var _i = 0, _a = (Foo.forOf = []); _i < _a.length; _i++) { + var f = _a[_i]; + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} +for (var f in (Foo.forIn = [])) { + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + + +//// [expandoFunctionNestedAssigments.d.ts] +declare function Foo(): void; +declare namespace Foo { + var bla: { + foo: number; + }; + var baz: number; + var bar: number; + var fromIf: number; + var inIf: number; + var fromWhileCondition: number; + var fromWhileBody: number; + var fromWhileBodyNested: number; + var fromDoBody: number; + var fromDoBodyNested: number; + var fromDoCondition: number; + var forInit: number; + var forCond: number; + var fromForBody: number; + var fromForBodyNested: number; + var forIncr: number; + var forOf: any[]; + var fromForOfBody: number; + var fromForOfBodyNested: number; + var forIn: any[]; + var fromForInBody: number; + var fromForInBodyNested: number; +} diff --git a/tests/baselines/reference/expandoFunctionNestedAssigments.symbols b/tests/baselines/reference/expandoFunctionNestedAssigments.symbols new file mode 100644 index 0000000000000..948e18a06addd --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigments.symbols @@ -0,0 +1,125 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +=== expandoFunctionNestedAssigments.ts === +function Foo(): void { +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); +>(Foo.bla = { foo: 1}).foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12)) +>Foo.bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigments.ts, 4, 1)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigments.ts, 4, 1)) +>foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12)) +>foo : Symbol(foo, Decl(expandoFunctionNestedAssigments.ts, 4, 12)) +>Foo.baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigments.ts, 4, 29)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigments.ts, 4, 29)) +>Foo.bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigments.ts, 4, 45)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigments.ts, 4, 45)) + +if(Foo.fromIf = 1) { +>Foo.fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigments.ts, 6, 3)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigments.ts, 6, 3)) + + Foo.inIf = 1; +>Foo.inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigments.ts, 6, 20)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigments.ts, 6, 20)) +} + +while(Foo.fromWhileCondition = 1) { +>Foo.fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigments.ts, 10, 6)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigments.ts, 10, 6)) + + Foo.fromWhileBody = 1; +>Foo.fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigments.ts, 10, 35)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigments.ts, 10, 35)) + { + Foo.fromWhileBodyNested = 1; +>Foo.fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigments.ts, 12, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigments.ts, 12, 5)) + } +} + +do { + Foo.fromDoBody = 1; +>Foo.fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigments.ts, 17, 4)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigments.ts, 17, 4)) + { + Foo.fromDoBodyNested = 1; +>Foo.fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigments.ts, 19, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigments.ts, 19, 5)) + } +} while(Foo.fromDoCondition = 1); +>Foo.fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigments.ts, 22, 8)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigments.ts, 22, 8)) + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ +>Foo.forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigments.ts, 24, 4)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigments.ts, 24, 4)) +>Foo.forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigments.ts, 24, 22)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigments.ts, 24, 22)) +>Foo.forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigments.ts, 24, 43)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigments.ts, 24, 43)) + + Foo.fromForBody = 1; +>Foo.fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigments.ts, 24, 61)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigments.ts, 24, 61)) + { + Foo.fromForBodyNested = 1; +>Foo.fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigments.ts, 26, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigments.ts, 26, 5)) + } +} + +for(let f of (Foo.forOf = []) ){ +>f : Symbol(f, Decl(expandoFunctionNestedAssigments.ts, 31, 7)) +>Foo.forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigments.ts, 31, 14)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigments.ts, 31, 14)) + + Foo.fromForOfBody = 1; +>Foo.fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigments.ts, 31, 32)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigments.ts, 31, 32)) + { + Foo.fromForOfBodyNested = 1; +>Foo.fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigments.ts, 33, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigments.ts, 33, 5)) + } +} + + +for(let f in (Foo.forIn = []) ){ +>f : Symbol(f, Decl(expandoFunctionNestedAssigments.ts, 39, 7)) +>Foo.forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigments.ts, 39, 14)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigments.ts, 39, 14)) + + Foo.fromForInBody = 1; +>Foo.fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigments.ts, 39, 32)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigments.ts, 39, 32)) + { + Foo.fromForInBodyNested = 1; +>Foo.fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigments.ts, 41, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigments.ts, 0, 0), Decl(expandoFunctionNestedAssigments.ts, 6, 3), Decl(expandoFunctionNestedAssigments.ts, 10, 6), Decl(expandoFunctionNestedAssigments.ts, 22, 8), Decl(expandoFunctionNestedAssigments.ts, 24, 4) ... and 1 more) +>fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigments.ts, 41, 5)) + } +} diff --git a/tests/baselines/reference/expandoFunctionNestedAssigments.types b/tests/baselines/reference/expandoFunctionNestedAssigments.types new file mode 100644 index 0000000000000..cba2aadd3d754 --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigments.types @@ -0,0 +1,180 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +=== expandoFunctionNestedAssigments.ts === +function Foo(): void { +>Foo : typeof Foo + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); +>(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0) : number +>(Foo.bla = { foo: 1}).foo : number +>(Foo.bla = { foo: 1}) : { foo: number; } +>Foo.bla = { foo: 1} : { foo: number; } +>Foo.bla : { foo: number; } +>Foo : typeof Foo +>bla : { foo: number; } +>{ foo: 1} : { foo: number; } +>foo : number +>1 : 1 +>foo : number +>(Foo.baz = 1) + (Foo.bar = 0) : number +>(Foo.baz = 1) : 1 +>Foo.baz = 1 : 1 +>Foo.baz : number +>Foo : typeof Foo +>baz : number +>1 : 1 +>(Foo.bar = 0) : 0 +>Foo.bar = 0 : 0 +>Foo.bar : number +>Foo : typeof Foo +>bar : number +>0 : 0 + +if(Foo.fromIf = 1) { +>Foo.fromIf = 1 : 1 +>Foo.fromIf : number +>Foo : typeof Foo +>fromIf : number +>1 : 1 + + Foo.inIf = 1; +>Foo.inIf = 1 : 1 +>Foo.inIf : number +>Foo : typeof Foo +>inIf : number +>1 : 1 +} + +while(Foo.fromWhileCondition = 1) { +>Foo.fromWhileCondition = 1 : 1 +>Foo.fromWhileCondition : number +>Foo : typeof Foo +>fromWhileCondition : number +>1 : 1 + + Foo.fromWhileBody = 1; +>Foo.fromWhileBody = 1 : 1 +>Foo.fromWhileBody : number +>Foo : typeof Foo +>fromWhileBody : number +>1 : 1 + { + Foo.fromWhileBodyNested = 1; +>Foo.fromWhileBodyNested = 1 : 1 +>Foo.fromWhileBodyNested : number +>Foo : typeof Foo +>fromWhileBodyNested : number +>1 : 1 + } +} + +do { + Foo.fromDoBody = 1; +>Foo.fromDoBody = 1 : 1 +>Foo.fromDoBody : number +>Foo : typeof Foo +>fromDoBody : number +>1 : 1 + { + Foo.fromDoBodyNested = 1; +>Foo.fromDoBodyNested = 1 : 1 +>Foo.fromDoBodyNested : number +>Foo : typeof Foo +>fromDoBodyNested : number +>1 : 1 + } +} while(Foo.fromDoCondition = 1); +>Foo.fromDoCondition = 1 : 1 +>Foo.fromDoCondition : number +>Foo : typeof Foo +>fromDoCondition : number +>1 : 1 + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ +>Foo.forInit = 1 : 1 +>Foo.forInit : number +>Foo : typeof Foo +>forInit : number +>1 : 1 +>(Foo.forCond = 1) > 1 : boolean +>(Foo.forCond = 1) : 1 +>Foo.forCond = 1 : 1 +>Foo.forCond : number +>Foo : typeof Foo +>forCond : number +>1 : 1 +>1 : 1 +>Foo.forIncr = 1 : 1 +>Foo.forIncr : number +>Foo : typeof Foo +>forIncr : number +>1 : 1 + + Foo.fromForBody = 1; +>Foo.fromForBody = 1 : 1 +>Foo.fromForBody : number +>Foo : typeof Foo +>fromForBody : number +>1 : 1 + { + Foo.fromForBodyNested = 1; +>Foo.fromForBodyNested = 1 : 1 +>Foo.fromForBodyNested : number +>Foo : typeof Foo +>fromForBodyNested : number +>1 : 1 + } +} + +for(let f of (Foo.forOf = []) ){ +>f : any +>(Foo.forOf = []) : undefined[] +>Foo.forOf = [] : undefined[] +>Foo.forOf : any[] +>Foo : typeof Foo +>forOf : any[] +>[] : undefined[] + + Foo.fromForOfBody = 1; +>Foo.fromForOfBody = 1 : 1 +>Foo.fromForOfBody : number +>Foo : typeof Foo +>fromForOfBody : number +>1 : 1 + { + Foo.fromForOfBodyNested = 1; +>Foo.fromForOfBodyNested = 1 : 1 +>Foo.fromForOfBodyNested : number +>Foo : typeof Foo +>fromForOfBodyNested : number +>1 : 1 + } +} + + +for(let f in (Foo.forIn = []) ){ +>f : string +>(Foo.forIn = []) : undefined[] +>Foo.forIn = [] : undefined[] +>Foo.forIn : any[] +>Foo : typeof Foo +>forIn : any[] +>[] : undefined[] + + Foo.fromForInBody = 1; +>Foo.fromForInBody = 1 : 1 +>Foo.fromForInBody : number +>Foo : typeof Foo +>fromForInBody : number +>1 : 1 + { + Foo.fromForInBodyNested = 1; +>Foo.fromForInBodyNested = 1 : 1 +>Foo.fromForInBodyNested : number +>Foo : typeof Foo +>fromForInBodyNested : number +>1 : 1 + } +} diff --git a/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.js b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.js new file mode 100644 index 0000000000000..31245f44ced26 --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.js @@ -0,0 +1,143 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts] //// + +//// [expandoFunctionNestedAssigmentsDeclared.ts] +function Foo(): void { + +} +declare namespace Foo { + var bla: { + foo: number; + }; + var baz: number; + var bar: number; + var fromIf: number; + var inIf: number; + var fromWhileCondition: number; + var fromWhileBody: number; + var fromWhileBodyNested: number; + var fromDoBody: number; + var fromDoBodyNested: number; + var fromDoCondition: number; + var forInit: number; + var forCond: number; + var fromForBody: number; + var fromForBodyNested: number; + var forIncr: number; + var forOf: any[]; + var fromForOfBody: number; + var fromForOfBodyNested: number; + var forIn: any[]; + var fromForInBody: number; + var fromForInBodyNested: number; +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + +//// [expandoFunctionNestedAssigmentsDeclared.js] +function Foo() { +} +(Foo.bla = { foo: 1 }).foo = (Foo.baz = 1) + (Foo.bar = 0); +if (Foo.fromIf = 1) { + Foo.inIf = 1; +} +while (Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while (Foo.fromDoCondition = 1); +for (Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1) { + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} +for (var _i = 0, _a = (Foo.forOf = []); _i < _a.length; _i++) { + var f = _a[_i]; + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} +for (var f in (Foo.forIn = [])) { + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + + +//// [expandoFunctionNestedAssigmentsDeclared.d.ts] +declare function Foo(): void; +declare namespace Foo { + var bla: { + foo: number; + }; + var baz: number; + var bar: number; + var fromIf: number; + var inIf: number; + var fromWhileCondition: number; + var fromWhileBody: number; + var fromWhileBodyNested: number; + var fromDoBody: number; + var fromDoBodyNested: number; + var fromDoCondition: number; + var forInit: number; + var forCond: number; + var fromForBody: number; + var fromForBodyNested: number; + var forIncr: number; + var forOf: any[]; + var fromForOfBody: number; + var fromForOfBodyNested: number; + var forIn: any[]; + var fromForInBody: number; + var fromForInBodyNested: number; +} diff --git a/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.symbols b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.symbols new file mode 100644 index 0000000000000..8bbec04eff4dd --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.symbols @@ -0,0 +1,198 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts] //// + +=== expandoFunctionNestedAssigmentsDeclared.ts === +function Foo(): void { +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) + +} +declare namespace Foo { +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) + + var bla: { +>bla : Symbol(bla, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 4, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 1)) + + foo: number; +>foo : Symbol(foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 4, 14)) + + }; + var baz: number; +>baz : Symbol(baz, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 7, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 29)) + + var bar: number; +>bar : Symbol(bar, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 8, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 45)) + + var fromIf: number; +>fromIf : Symbol(fromIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 9, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3)) + + var inIf: number; +>inIf : Symbol(inIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 10, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 20)) + + var fromWhileCondition: number; +>fromWhileCondition : Symbol(fromWhileCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 11, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6)) + + var fromWhileBody: number; +>fromWhileBody : Symbol(fromWhileBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 12, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 35)) + + var fromWhileBodyNested: number; +>fromWhileBodyNested : Symbol(fromWhileBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 13, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 38, 5)) + + var fromDoBody: number; +>fromDoBody : Symbol(fromDoBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 14, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 43, 4)) + + var fromDoBodyNested: number; +>fromDoBodyNested : Symbol(fromDoBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 15, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 45, 5)) + + var fromDoCondition: number; +>fromDoCondition : Symbol(fromDoCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 16, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8)) + + var forInit: number; +>forInit : Symbol(forInit, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 17, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 4)) + + var forCond: number; +>forCond : Symbol(forCond, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 18, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 22)) + + var fromForBody: number; +>fromForBody : Symbol(fromForBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 19, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 61)) + + var fromForBodyNested: number; +>fromForBodyNested : Symbol(fromForBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 20, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 52, 5)) + + var forIncr: number; +>forIncr : Symbol(forIncr, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 21, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 43)) + + var forOf: any[]; +>forOf : Symbol(forOf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 22, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 14)) + + var fromForOfBody: number; +>fromForOfBody : Symbol(fromForOfBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 23, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 32)) + + var fromForOfBodyNested: number; +>fromForOfBodyNested : Symbol(fromForOfBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 24, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 59, 5)) + + var forIn: any[]; +>forIn : Symbol(forIn, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 25, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 14)) + + var fromForInBody: number; +>fromForInBody : Symbol(fromForInBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 26, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 32)) + + var fromForInBodyNested: number; +>fromForInBodyNested : Symbol(fromForInBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 27, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 67, 5)) +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); +>(Foo.bla = { foo: 1}).foo : Symbol(foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 12)) +>Foo.bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 4, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 1)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>bla : Symbol(Foo.bla, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 4, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 1)) +>foo : Symbol(foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 12)) +>foo : Symbol(foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 12)) +>Foo.baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 7, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 29)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>baz : Symbol(Foo.baz, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 7, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 29)) +>Foo.bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 8, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 45)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>bar : Symbol(Foo.bar, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 8, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 30, 45)) + +if(Foo.fromIf = 1) { +>Foo.fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 9, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromIf : Symbol(Foo.fromIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 9, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3)) + + Foo.inIf = 1; +>Foo.inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 10, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 20)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>inIf : Symbol(Foo.inIf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 10, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 20)) +} + +while(Foo.fromWhileCondition = 1) { +>Foo.fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 11, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromWhileCondition : Symbol(Foo.fromWhileCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 11, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6)) + + Foo.fromWhileBody = 1; +>Foo.fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 12, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 35)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromWhileBody : Symbol(Foo.fromWhileBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 12, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 35)) + { + Foo.fromWhileBodyNested = 1; +>Foo.fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 13, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 38, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromWhileBodyNested : Symbol(Foo.fromWhileBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 13, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 38, 5)) + } +} + +do { + Foo.fromDoBody = 1; +>Foo.fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 14, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 43, 4)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromDoBody : Symbol(Foo.fromDoBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 14, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 43, 4)) + { + Foo.fromDoBodyNested = 1; +>Foo.fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 15, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 45, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromDoBodyNested : Symbol(Foo.fromDoBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 15, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 45, 5)) + } +} while(Foo.fromDoCondition = 1); +>Foo.fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 16, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromDoCondition : Symbol(Foo.fromDoCondition, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 16, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8)) + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ +>Foo.forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 17, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 4)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>forInit : Symbol(Foo.forInit, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 17, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 4)) +>Foo.forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 18, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 22)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>forCond : Symbol(Foo.forCond, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 18, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 22)) +>Foo.forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 21, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 43)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>forIncr : Symbol(Foo.forIncr, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 21, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 43)) + + Foo.fromForBody = 1; +>Foo.fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 19, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 61)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForBody : Symbol(Foo.fromForBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 19, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 50, 61)) + { + Foo.fromForBodyNested = 1; +>Foo.fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 20, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 52, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForBodyNested : Symbol(Foo.fromForBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 20, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 52, 5)) + } +} + +for(let f of (Foo.forOf = []) ){ +>f : Symbol(f, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 7)) +>Foo.forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 22, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 14)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>forOf : Symbol(Foo.forOf, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 22, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 14)) + + Foo.fromForOfBody = 1; +>Foo.fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 23, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 32)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForOfBody : Symbol(Foo.fromForOfBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 23, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 57, 32)) + { + Foo.fromForOfBodyNested = 1; +>Foo.fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 24, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 59, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForOfBodyNested : Symbol(Foo.fromForOfBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 24, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 59, 5)) + } +} + + +for(let f in (Foo.forIn = []) ){ +>f : Symbol(f, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 7)) +>Foo.forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 25, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 14)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>forIn : Symbol(Foo.forIn, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 25, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 14)) + + Foo.fromForInBody = 1; +>Foo.fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 26, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 32)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForInBody : Symbol(Foo.fromForInBody, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 26, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 65, 32)) + { + Foo.fromForInBodyNested = 1; +>Foo.fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 27, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 67, 5)) +>Foo : Symbol(Foo, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 0, 0), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 2, 1), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 32, 3), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 36, 6), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 48, 8) ... and 2 more) +>fromForInBodyNested : Symbol(Foo.fromForInBodyNested, Decl(expandoFunctionNestedAssigmentsDeclared.ts, 27, 7), Decl(expandoFunctionNestedAssigmentsDeclared.ts, 67, 5)) + } +} diff --git a/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.types b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.types new file mode 100644 index 0000000000000..2ebc2183ab46c --- /dev/null +++ b/tests/baselines/reference/expandoFunctionNestedAssigmentsDeclared.types @@ -0,0 +1,253 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts] //// + +=== expandoFunctionNestedAssigmentsDeclared.ts === +function Foo(): void { +>Foo : typeof Foo + +} +declare namespace Foo { +>Foo : typeof Foo + + var bla: { +>bla : { foo: number; } + + foo: number; +>foo : number + + }; + var baz: number; +>baz : number + + var bar: number; +>bar : number + + var fromIf: number; +>fromIf : number + + var inIf: number; +>inIf : number + + var fromWhileCondition: number; +>fromWhileCondition : number + + var fromWhileBody: number; +>fromWhileBody : number + + var fromWhileBodyNested: number; +>fromWhileBodyNested : number + + var fromDoBody: number; +>fromDoBody : number + + var fromDoBodyNested: number; +>fromDoBodyNested : number + + var fromDoCondition: number; +>fromDoCondition : number + + var forInit: number; +>forInit : number + + var forCond: number; +>forCond : number + + var fromForBody: number; +>fromForBody : number + + var fromForBodyNested: number; +>fromForBodyNested : number + + var forIncr: number; +>forIncr : number + + var forOf: any[]; +>forOf : any[] + + var fromForOfBody: number; +>fromForOfBody : number + + var fromForOfBodyNested: number; +>fromForOfBodyNested : number + + var forIn: any[]; +>forIn : any[] + + var fromForInBody: number; +>fromForInBody : number + + var fromForInBodyNested: number; +>fromForInBodyNested : number +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); +>(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0) : number +>(Foo.bla = { foo: 1}).foo : number +>(Foo.bla = { foo: 1}) : { foo: number; } +>Foo.bla = { foo: 1} : { foo: number; } +>Foo.bla : { foo: number; } +>Foo : typeof Foo +>bla : { foo: number; } +>{ foo: 1} : { foo: number; } +>foo : number +>1 : 1 +>foo : number +>(Foo.baz = 1) + (Foo.bar = 0) : number +>(Foo.baz = 1) : 1 +>Foo.baz = 1 : 1 +>Foo.baz : number +>Foo : typeof Foo +>baz : number +>1 : 1 +>(Foo.bar = 0) : 0 +>Foo.bar = 0 : 0 +>Foo.bar : number +>Foo : typeof Foo +>bar : number +>0 : 0 + +if(Foo.fromIf = 1) { +>Foo.fromIf = 1 : 1 +>Foo.fromIf : number +>Foo : typeof Foo +>fromIf : number +>1 : 1 + + Foo.inIf = 1; +>Foo.inIf = 1 : 1 +>Foo.inIf : number +>Foo : typeof Foo +>inIf : number +>1 : 1 +} + +while(Foo.fromWhileCondition = 1) { +>Foo.fromWhileCondition = 1 : 1 +>Foo.fromWhileCondition : number +>Foo : typeof Foo +>fromWhileCondition : number +>1 : 1 + + Foo.fromWhileBody = 1; +>Foo.fromWhileBody = 1 : 1 +>Foo.fromWhileBody : number +>Foo : typeof Foo +>fromWhileBody : number +>1 : 1 + { + Foo.fromWhileBodyNested = 1; +>Foo.fromWhileBodyNested = 1 : 1 +>Foo.fromWhileBodyNested : number +>Foo : typeof Foo +>fromWhileBodyNested : number +>1 : 1 + } +} + +do { + Foo.fromDoBody = 1; +>Foo.fromDoBody = 1 : 1 +>Foo.fromDoBody : number +>Foo : typeof Foo +>fromDoBody : number +>1 : 1 + { + Foo.fromDoBodyNested = 1; +>Foo.fromDoBodyNested = 1 : 1 +>Foo.fromDoBodyNested : number +>Foo : typeof Foo +>fromDoBodyNested : number +>1 : 1 + } +} while(Foo.fromDoCondition = 1); +>Foo.fromDoCondition = 1 : 1 +>Foo.fromDoCondition : number +>Foo : typeof Foo +>fromDoCondition : number +>1 : 1 + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ +>Foo.forInit = 1 : 1 +>Foo.forInit : number +>Foo : typeof Foo +>forInit : number +>1 : 1 +>(Foo.forCond = 1) > 1 : boolean +>(Foo.forCond = 1) : 1 +>Foo.forCond = 1 : 1 +>Foo.forCond : number +>Foo : typeof Foo +>forCond : number +>1 : 1 +>1 : 1 +>Foo.forIncr = 1 : 1 +>Foo.forIncr : number +>Foo : typeof Foo +>forIncr : number +>1 : 1 + + Foo.fromForBody = 1; +>Foo.fromForBody = 1 : 1 +>Foo.fromForBody : number +>Foo : typeof Foo +>fromForBody : number +>1 : 1 + { + Foo.fromForBodyNested = 1; +>Foo.fromForBodyNested = 1 : 1 +>Foo.fromForBodyNested : number +>Foo : typeof Foo +>fromForBodyNested : number +>1 : 1 + } +} + +for(let f of (Foo.forOf = []) ){ +>f : any +>(Foo.forOf = []) : undefined[] +>Foo.forOf = [] : undefined[] +>Foo.forOf : any[] +>Foo : typeof Foo +>forOf : any[] +>[] : undefined[] + + Foo.fromForOfBody = 1; +>Foo.fromForOfBody = 1 : 1 +>Foo.fromForOfBody : number +>Foo : typeof Foo +>fromForOfBody : number +>1 : 1 + { + Foo.fromForOfBodyNested = 1; +>Foo.fromForOfBodyNested = 1 : 1 +>Foo.fromForOfBodyNested : number +>Foo : typeof Foo +>fromForOfBodyNested : number +>1 : 1 + } +} + + +for(let f in (Foo.forIn = []) ){ +>f : string +>(Foo.forIn = []) : undefined[] +>Foo.forIn = [] : undefined[] +>Foo.forIn : any[] +>Foo : typeof Foo +>forIn : any[] +>[] : undefined[] + + Foo.fromForInBody = 1; +>Foo.fromForInBody = 1 : 1 +>Foo.fromForInBody : number +>Foo : typeof Foo +>fromForInBody : number +>1 : 1 + { + Foo.fromForInBodyNested = 1; +>Foo.fromForInBodyNested = 1 : 1 +>Foo.fromForInBodyNested : number +>Foo : typeof Foo +>fromForInBodyNested : number +>1 : 1 + } +} diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitDefaultExportWithStaticAssignment.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitDefaultExportWithStaticAssignment.d.ts.diff index 0efd87f4300da..0ba848b2c0ef7 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitDefaultExportWithStaticAssignment.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitDefaultExportWithStaticAssignment.d.ts.diff @@ -5,7 +5,7 @@ =================================================================== --- TSC declarations +++ DTE declarations -@@ -4,35 +4,66 @@ +@@ -4,35 +4,69 @@ export declare class Foo { } //# sourceMappingURL=foo.d.ts.map @@ -48,10 +48,11 @@ +//# sourceMappingURL=index4.d.ts.map +/// [Errors] //// + -+index1.ts(2,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+index2.ts(3,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+index3.ts(2,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+index4.ts(5,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index1.ts(3,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index2.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index3.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index4.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index4.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + +==== foo.ts (0 errors) ==== @@ -60,37 +61,39 @@ +==== index1.ts (1 errors) ==== + import {Foo} from './foo'; + export default function Example(): void {} -+ ~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Example.Foo = Foo ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + +==== index2.ts (1 errors) ==== + import {Foo} from './foo'; + export {Foo}; + export default function Example(): void {} -+ ~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Example.Foo = Foo ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + +==== index3.ts (1 errors) ==== + export class Bar {} + export default function Example(): void {} -+ ~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + Example.Bar = Bar ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + -+==== index4.ts (1 errors) ==== ++==== index4.ts (2 errors) ==== + function A() { } + + function B() { } + + export function C(): any { -+ ~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return null; + } + + C.A = A; -+ C.B = B; ++ ~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ C.B = B; ++ ~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitExpandoPropertyPrivateName.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitExpandoPropertyPrivateName.d.ts.diff index fee42ef503d45..05c56888cd37a 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitExpandoPropertyPrivateName.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitExpandoPropertyPrivateName.d.ts.diff @@ -15,8 +15,8 @@ +//# sourceMappingURL=b.d.ts.map /// [Errors] //// -+b.ts(3,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. ++b.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== a.ts (0 errors) ==== @@ -27,10 +27,10 @@ import {f} from "./a"; export function q(): void {} -+ ~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. q.val = f(); ~~~~~ !!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. ++ ~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionDuplicateNamespace.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionDuplicateNamespace.d.ts.diff index 0531f3e9527f5..e72eb1bca6e7f 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionDuplicateNamespace.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionDuplicateNamespace.d.ts.diff @@ -18,18 +18,18 @@ +//# sourceMappingURL=declarationEmitFunctionDuplicateNamespace.d.ts.map +/// [Errors] //// + -+declarationEmitFunctionDuplicateNamespace.ts(2,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionDuplicateNamespace.ts(7,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + +==== declarationEmitFunctionDuplicateNamespace.ts (1 errors) ==== + function f(a: 0): 0; + function f(a: 1): 1; -+ ~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + function f(a: 0 | 1) { + return a; + } + + f.x = 2; ++ ~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionKeywordProp.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionKeywordProp.d.ts.diff index ca81448065a12..c7b89b58a426c 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionKeywordProp.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitFunctionKeywordProp.d.ts.diff @@ -5,7 +5,7 @@ =================================================================== --- TSC declarations +++ DTE declarations -@@ -1,20 +1,31 @@ +@@ -1,20 +1,37 @@ //// [declarationEmitFunctionKeywordProp.d.ts] @@ -30,26 +30,32 @@ +//# sourceMappingURL=declarationEmitFunctionKeywordProp.d.ts.map +/// [Errors] //// + -+declarationEmitFunctionKeywordProp.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitFunctionKeywordProp.ts(4,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitFunctionKeywordProp.ts(8,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionKeywordProp.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionKeywordProp.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionKeywordProp.ts(6,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionKeywordProp.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitFunctionKeywordProp.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + -+==== declarationEmitFunctionKeywordProp.ts (3 errors) ==== ++==== declarationEmitFunctionKeywordProp.ts (5 errors) ==== + function foo(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.null = true; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + function bar(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + bar.async = true; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + bar.normal = false; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + function baz(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + baz.class = true; -+ baz.normal = false; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ baz.normal = false; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments.d.ts.diff index 69f1cf0843ab2..1b0fc18ca895e 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments.d.ts.diff @@ -5,7 +5,7 @@ =================================================================== --- TSC declarations +++ DTE declarations -@@ -1,9 +1,28 @@ +@@ -1,9 +1,40 @@ //// [declarationEmitLateBoundAssignments.d.ts] @@ -19,22 +19,34 @@ +//# sourceMappingURL=declarationEmitLateBoundAssignments.d.ts.map +/// [Errors] //// + -+declarationEmitLateBoundAssignments.ts(1,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments.ts(6,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + -+==== declarationEmitLateBoundAssignments.ts (1 errors) ==== ++==== declarationEmitLateBoundAssignments.ts (5 errors) ==== + export function foo(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.bar = 12; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + const _private = Symbol(); + foo[_private] = "ok"; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + const strMem = "strMemName"; + foo[strMem] = "ok"; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + const dashStrMem = "dashed-str-mem"; + foo[dashStrMem] = "ok"; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + const numMem = 42; + foo[numMem] = "ok"; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + const x: string = foo[_private]; + const y: string = foo[strMem]; diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments2.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments2.d.ts.diff index 45cab14944431..f784b50ea72af 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments2.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitLateBoundAssignments2.d.ts.diff @@ -47,16 +47,16 @@ +//# sourceMappingURL=declarationEmitLateBoundAssignments2.d.ts.map +/// [Errors] //// + -+declarationEmitLateBoundAssignments2.ts(9,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(12,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(15,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(18,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(21,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(24,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(27,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(30,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(33,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+declarationEmitLateBoundAssignments2.ts(36,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(16,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(19,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(22,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(25,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(28,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(31,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(34,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++declarationEmitLateBoundAssignments2.ts(37,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + +==== declarationEmitLateBoundAssignments2.ts (10 errors) ==== @@ -69,54 +69,54 @@ + const emoji = "🤷‍♂️" + + export function decl(): void {} -+ ~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl["B"] = 'foo' ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl2(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl2[c] = 0 ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl3(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl3[77] = 0 ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl4(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl4[num] = 0 ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl5(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl5["101"] = 0 ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl6(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl6[numStr] = 0 ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl7(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl7["qwe rty"] = 0 ++ ~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl8(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl8[withWhitespace] = 0 ++ ~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl9(): void {} -+ ~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl9["🤪"] = 0 ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export function decl10(): void {} -+ ~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + decl10[emoji] = 0 ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + export const arrow: { + (): void diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/expandoFunctionNestedAssigments.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/expandoFunctionNestedAssigments.d.ts.diff new file mode 100644 index 0000000000000..3a83bb0a36341 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/expandoFunctionNestedAssigments.d.ts.diff @@ -0,0 +1,158 @@ +// [[Reason: Function declarations are not fixed]] //// + +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +=================================================================== +--- TSC declarations ++++ DTE declarations +@@ -1,31 +1,121 @@ + + + //// [expandoFunctionNestedAssigments.d.ts] + declare function Foo(): void; +-declare namespace Foo { +- var bla: { +- foo: number; +- }; +- var baz: number; +- var bar: number; +- var fromIf: number; +- var inIf: number; +- var fromWhileCondition: number; +- var fromWhileBody: number; +- var fromWhileBodyNested: number; +- var fromDoBody: number; +- var fromDoBodyNested: number; +- var fromDoCondition: number; +- var forInit: number; +- var forCond: number; +- var fromForBody: number; +- var fromForBodyNested: number; +- var forIncr: number; +- var forOf: any[]; +- var fromForOfBody: number; +- var fromForOfBodyNested: number; +- var forIn: any[]; +- var fromForInBody: number; +- var fromForInBodyNested: number; +-} +-//# sourceMappingURL=expandoFunctionNestedAssigments.d.ts.map +\ No newline at end of file ++//# sourceMappingURL=expandoFunctionNestedAssigments.d.ts.map ++/// [Errors] //// ++ ++expandoFunctionNestedAssigments.ts(5,2): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(5,30): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(5,46): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(7,4): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(8,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(11,7): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(12,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(14,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(19,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(21,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(23,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(25,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(25,23): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(25,45): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(26,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(28,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(32,15): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(33,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(35,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(40,15): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(41,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expandoFunctionNestedAssigments.ts(43,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ++ ++==== expandoFunctionNestedAssigments.ts (22 errors) ==== ++ function Foo(): void { ++ ++ } ++ ++ (Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ++ if(Foo.fromIf = 1) { ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ Foo.inIf = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ ++ while(Foo.fromWhileCondition = 1) { ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ Foo.fromWhileBody = 1; ++ ~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ { ++ Foo.fromWhileBodyNested = 1; ++ ~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ } ++ ++ do { ++ Foo.fromDoBody = 1; ++ ~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ { ++ Foo.fromDoBodyNested = 1; ++ ~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ } while(Foo.fromDoCondition = 1); ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ++ for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ Foo.fromForBody = 1; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ { ++ Foo.fromForBodyNested = 1; ++ ~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ } ++ ++ for(let f of (Foo.forOf = []) ){ ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ Foo.fromForOfBody = 1; ++ ~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ { ++ Foo.fromForOfBodyNested = 1; ++ ~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ } ++ ++ ++ for(let f in (Foo.forIn = []) ){ ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ Foo.fromForInBody = 1; ++ ~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ { ++ Foo.fromForInBodyNested = 1; ++ ~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++ } ++ } +\ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/exportDefaultNamespace.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/exportDefaultNamespace.d.ts.diff index 3cb88f6918909..c4061aa1bea42 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/exportDefaultNamespace.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/exportDefaultNamespace.d.ts.diff @@ -20,16 +20,16 @@ +//# sourceMappingURL=exportDefaultNamespace.d.ts.map +/// [Errors] //// + -+exportDefaultNamespace.ts(1,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++exportDefaultNamespace.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + +==== exportDefaultNamespace.ts (1 errors) ==== + export default function someFunc(): string { -+ ~~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return 'hello!'; + } + + someFunc.someProp = 'yo'; ++ ~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/lateBoundFunctionMemberAssignmentDeclarations.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/lateBoundFunctionMemberAssignmentDeclarations.d.ts.diff index d82c7b8ae1c54..b2397abe167ab 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/lateBoundFunctionMemberAssignmentDeclarations.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/lateBoundFunctionMemberAssignmentDeclarations.d.ts.diff @@ -5,7 +5,7 @@ =================================================================== --- TSC declarations +++ DTE declarations -@@ -1,8 +1,20 @@ +@@ -1,8 +1,23 @@ //// [index.d.ts] @@ -18,16 +18,19 @@ +//# sourceMappingURL=index.d.ts.map +/// [Errors] //// + -+index.ts(1,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++index.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + -+==== index.ts (1 errors) ==== ++==== index.ts (2 errors) ==== + export function foo(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.bar = 12; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + const _private = Symbol(); + foo[_private] = "ok"; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + const x: string = foo[_private]; + diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/nullPropertyName.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/nullPropertyName.d.ts.diff index 4ac968f820fc2..c88c213669622 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/nullPropertyName.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/nullPropertyName.d.ts.diff @@ -5,7 +5,7 @@ =================================================================== --- TSC declarations +++ DTE declarations -@@ -1,86 +1,96 @@ +@@ -1,86 +1,327 @@ //// [nullPropertyName.d.ts] @@ -96,93 +96,324 @@ +//# sourceMappingURL=nullPropertyName.d.ts.map +/// [Errors] //// + -+nullPropertyName.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(3,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(7,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(14,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(15,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(16,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(17,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(18,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(19,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(20,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(21,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(22,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(23,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(24,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(25,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(26,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(27,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(28,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(29,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(30,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(31,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(32,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(33,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(34,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(35,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(36,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(37,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(38,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(39,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(40,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(41,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(42,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(43,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(44,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(45,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(46,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(47,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(48,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(49,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(50,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(51,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(52,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(53,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(54,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(55,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(56,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(57,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(58,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(59,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(60,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(61,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(62,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(63,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(64,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(65,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(66,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(67,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(68,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(69,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(70,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(71,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(72,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(73,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(74,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(75,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(76,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(77,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(78,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(79,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(80,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(81,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++nullPropertyName.ts(82,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + -+==== nullPropertyName.ts (1 errors) ==== ++==== nullPropertyName.ts (78 errors) ==== + function foo(): void {} -+ ~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + // properties + foo.x = 1; ++ ~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.y = 1; ++ ~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + // keywords + foo.break = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.case = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.catch = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.class = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.const = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.continue = 1; ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.debugger = 1; ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.default = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.delete = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.do = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.else = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.enum = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.export = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.extends = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.false = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.finally = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.for = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.function = 1; ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.if = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.import = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.in = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.instanceof = 1; ++ ~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.new = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.null = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.return = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.super = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.switch = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.this = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.throw = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.true = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.try = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.typeof = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.var = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.void = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.while = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.with = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.implements = 1; ++ ~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.interface = 1; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.let = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.package = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.private = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.protected = 1; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.public = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.static = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.yield = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.abstract = 1; ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.as = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.asserts = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.any = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.async = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.await = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.boolean = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.constructor = 1; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.declare = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.get = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.infer = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.is = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.keyof = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.module = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.namespace = 1; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.never = 1; ++ ~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.readonly = 1; ++ ~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.require = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.number = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.object = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.set = 1; ++ ~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.string = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.symbol = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.type = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.undefined = 1; ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.unique = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.unknown = 1; ++ ~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.from = 1; ++ ~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.global = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.bigint = 1; ++ ~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + foo.of = 1; ++ ~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/typeFromPropertyAssignment29.d.ts.diff b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/typeFromPropertyAssignment29.d.ts.diff index 93690a4cf2d71..05aa3b0763da6 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/diff/typeFromPropertyAssignment29.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/diff/typeFromPropertyAssignment29.d.ts.diff @@ -46,7 +46,7 @@ export {}; } declare var ExpandoExpr2: (n: number) => string; -@@ -55,33 +42,36 @@ +@@ -55,37 +42,43 @@ declare class ExpandoClass { n: number; } @@ -61,10 +61,11 @@ //# sourceMappingURL=typeFromPropertyAssignment29.d.ts.map /// [Errors] //// -+typeFromPropertyAssignment29.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+typeFromPropertyAssignment29.ts(41,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+typeFromPropertyAssignment29.ts(53,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -+typeFromPropertyAssignment29.ts(66,14): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++typeFromPropertyAssignment29.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++typeFromPropertyAssignment29.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++typeFromPropertyAssignment29.ts(51,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++typeFromPropertyAssignment29.ts(56,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++typeFromPropertyAssignment29.ts(67,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. typeFromPropertyAssignment29.ts(77,14): error TS2339: Property 'prop' does not exist on type '(n: number) => string'. typeFromPropertyAssignment29.ts(78,14): error TS2339: Property 'm' does not exist on type '(n: number) => string'. typeFromPropertyAssignment29.ts(81,30): error TS2339: Property 'prop' does not exist on type '(n: number) => string'. @@ -81,48 +82,50 @@ -==== typeFromPropertyAssignment29.ts (12 errors) ==== -+==== typeFromPropertyAssignment29.ts (17 errors) ==== ++==== typeFromPropertyAssignment29.ts (18 errors) ==== function ExpandoDecl(n: number): string { -+ ~~~~~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return n.toString(); } ExpandoDecl.prop = 2 ++ ~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ExpandoDecl.m = function(n: number) { -@@ -120,8 +110,10 @@ - ++ ~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; } + var n: number = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length - function ExpandoNested(n: number): { -+ ~~~~~~~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - (m: number): number; - total: number; - } { - const nested = function (m: number) { -@@ -132,8 +124,10 @@ +@@ -130,13 +123,17 @@ + nested.total = n + 1_000_000; + return nested; } ExpandoNested.also = -1; ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. function ExpandoMerge(n: number): number { -+ ~~~~~~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return n * 100; } ExpandoMerge.p1 = 111 ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + namespace ExpandoMerge { + export var p2 = 222; + } namespace ExpandoMerge { -@@ -145,8 +139,10 @@ - var n: number = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge(1); +@@ -146,8 +143,10 @@ namespace Ns { function ExpandoNamespace(): void {} -+ ~~~~~~~~~~~~~~~~ -+!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ExpandoNamespace.p6 = 42; ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function foo(): typeof ExpandoNamespace { return ExpandoNamespace; } -@@ -189,8 +185,10 @@ + } +@@ -189,8 +188,10 @@ !!! error TS2339: Property 'm' does not exist on type 'typeof ExpandoClass'. // Class expressions shouldn't work in typescript either diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitDefaultExportWithStaticAssignment.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitDefaultExportWithStaticAssignment.d.ts index 95ff1b7207243..51818a7074b3a 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitDefaultExportWithStaticAssignment.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitDefaultExportWithStaticAssignment.d.ts @@ -58,10 +58,11 @@ export declare function C(): any; //# sourceMappingURL=index4.d.ts.map /// [Errors] //// -index1.ts(2,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -index2.ts(3,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -index3.ts(2,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -index4.ts(5,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index1.ts(3,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index2.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index3.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index4.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index4.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== foo.ts (0 errors) ==== @@ -70,36 +71,38 @@ index4.ts(5,17): error TS9009: Assigning properties to functions without declari ==== index1.ts (1 errors) ==== import {Foo} from './foo'; export default function Example(): void {} - ~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. Example.Foo = Foo + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== index2.ts (1 errors) ==== import {Foo} from './foo'; export {Foo}; export default function Example(): void {} - ~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. Example.Foo = Foo + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== index3.ts (1 errors) ==== export class Bar {} export default function Example(): void {} - ~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. Example.Bar = Bar + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -==== index4.ts (1 errors) ==== +==== index4.ts (2 errors) ==== function A() { } function B() { } export function C(): any { - ~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return null; } C.A = A; - C.B = B; \ No newline at end of file + ~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + C.B = B; + ~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitExpandoPropertyPrivateName.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitExpandoPropertyPrivateName.d.ts index c17c63acb1874..1fb7d6fb34781 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitExpandoPropertyPrivateName.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitExpandoPropertyPrivateName.d.ts @@ -25,8 +25,8 @@ export declare function q(): void; //# sourceMappingURL=b.d.ts.map /// [Errors] //// -b.ts(3,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. +b.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== a.ts (0 errors) ==== @@ -36,9 +36,9 @@ b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using na import {f} from "./a"; export function q(): void {} - ~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. q.val = f(); ~~~~~ !!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"a"'. + ~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionDuplicateNamespace.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionDuplicateNamespace.d.ts index 048af99b0c1da..18e083348ca13 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionDuplicateNamespace.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionDuplicateNamespace.d.ts @@ -20,17 +20,17 @@ declare function f(a: 1): 1; //# sourceMappingURL=declarationEmitFunctionDuplicateNamespace.d.ts.map /// [Errors] //// -declarationEmitFunctionDuplicateNamespace.ts(2,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionDuplicateNamespace.ts(7,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== declarationEmitFunctionDuplicateNamespace.ts (1 errors) ==== function f(a: 0): 0; function f(a: 1): 1; - ~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. function f(a: 0 | 1) { return a; } f.x = 2; + ~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionKeywordProp.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionKeywordProp.d.ts index a9429cd641c04..cb32568b3490d 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionKeywordProp.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitFunctionKeywordProp.d.ts @@ -23,25 +23,31 @@ declare function baz(): void; //# sourceMappingURL=declarationEmitFunctionKeywordProp.d.ts.map /// [Errors] //// -declarationEmitFunctionKeywordProp.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitFunctionKeywordProp.ts(4,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitFunctionKeywordProp.ts(8,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionKeywordProp.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionKeywordProp.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionKeywordProp.ts(6,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionKeywordProp.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitFunctionKeywordProp.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -==== declarationEmitFunctionKeywordProp.ts (3 errors) ==== +==== declarationEmitFunctionKeywordProp.ts (5 errors) ==== function foo(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.null = true; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. function bar(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. bar.async = true; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. bar.normal = false; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. function baz(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. baz.class = true; - baz.normal = false; \ No newline at end of file + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + baz.normal = false; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments.d.ts index 1b199b4532690..5870faeb376be 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments.d.ts @@ -26,22 +26,34 @@ export declare function foo(): void; //# sourceMappingURL=declarationEmitLateBoundAssignments.d.ts.map /// [Errors] //// -declarationEmitLateBoundAssignments.ts(1,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments.ts(6,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -==== declarationEmitLateBoundAssignments.ts (1 errors) ==== +==== declarationEmitLateBoundAssignments.ts (5 errors) ==== export function foo(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.bar = 12; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const _private = Symbol(); foo[_private] = "ok"; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const strMem = "strMemName"; foo[strMem] = "ok"; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const dashStrMem = "dashed-str-mem"; foo[dashStrMem] = "ok"; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const numMem = 42; foo[numMem] = "ok"; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const x: string = foo[_private]; const y: string = foo[strMem]; diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments2.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments2.d.ts index fb3f010b6a3f3..15a6f7e0c2963 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments2.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/declarationEmitLateBoundAssignments2.d.ts @@ -158,16 +158,16 @@ export declare const arrow10: { //# sourceMappingURL=declarationEmitLateBoundAssignments2.d.ts.map /// [Errors] //// -declarationEmitLateBoundAssignments2.ts(9,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(12,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(15,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(18,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(21,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(24,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(27,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(30,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(33,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -declarationEmitLateBoundAssignments2.ts(36,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(16,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(19,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(22,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(25,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(28,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(31,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(34,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +declarationEmitLateBoundAssignments2.ts(37,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== declarationEmitLateBoundAssignments2.ts (10 errors) ==== @@ -180,54 +180,54 @@ declarationEmitLateBoundAssignments2.ts(36,17): error TS9009: Assigning properti const emoji = "🤷‍♂️" export function decl(): void {} - ~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl["B"] = 'foo' + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl2(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl2[c] = 0 + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl3(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl3[77] = 0 + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl4(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl4[num] = 0 + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl5(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl5["101"] = 0 + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl6(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl6[numStr] = 0 + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl7(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl7["qwe rty"] = 0 + ~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl8(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl8[withWhitespace] = 0 + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl9(): void {} - ~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl9["🤪"] = 0 + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function decl10(): void {} - ~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. decl10[emoji] = 0 + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export const arrow: { (): void diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/expandoFunctionNestedAssigments.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/expandoFunctionNestedAssigments.d.ts new file mode 100644 index 0000000000000..4e9502e186a03 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/expandoFunctionNestedAssigments.d.ts @@ -0,0 +1,172 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +//// [expandoFunctionNestedAssigments.ts] +function Foo(): void { + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + +/// [Declarations] //// + + + +//// [expandoFunctionNestedAssigments.d.ts] +declare function Foo(): void; +//# sourceMappingURL=expandoFunctionNestedAssigments.d.ts.map +/// [Errors] //// + +expandoFunctionNestedAssigments.ts(5,2): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(5,30): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(5,46): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(7,4): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(8,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(11,7): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(12,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(14,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(19,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(21,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(23,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(25,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(25,23): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(25,45): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(26,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(28,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(32,15): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(33,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(35,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(40,15): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(41,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expandoFunctionNestedAssigments.ts(43,9): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + +==== expandoFunctionNestedAssigments.ts (22 errors) ==== + function Foo(): void { + + } + + (Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + if(Foo.fromIf = 1) { + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Foo.inIf = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + + while(Foo.fromWhileCondition = 1) { + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Foo.fromWhileBody = 1; + ~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + { + Foo.fromWhileBodyNested = 1; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + } + + do { + Foo.fromDoBody = 1; + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + { + Foo.fromDoBodyNested = 1; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + } while(Foo.fromDoCondition = 1); + ~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + + for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Foo.fromForBody = 1; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + { + Foo.fromForBodyNested = 1; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + } + + for(let f of (Foo.forOf = []) ){ + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Foo.fromForOfBody = 1; + ~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + { + Foo.fromForOfBodyNested = 1; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + } + + + for(let f in (Foo.forIn = []) ){ + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + Foo.fromForInBody = 1; + ~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + { + Foo.fromForInBodyNested = 1; + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/exportDefaultNamespace.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/exportDefaultNamespace.d.ts index 27659536e26e9..f0638fc126207 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/exportDefaultNamespace.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/exportDefaultNamespace.d.ts @@ -17,15 +17,15 @@ export default function someFunc(): string; //# sourceMappingURL=exportDefaultNamespace.d.ts.map /// [Errors] //// -exportDefaultNamespace.ts(1,25): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +exportDefaultNamespace.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== exportDefaultNamespace.ts (1 errors) ==== export default function someFunc(): string { - ~~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return 'hello!'; } someFunc.someProp = 'yo'; + ~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/lateBoundFunctionMemberAssignmentDeclarations.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/lateBoundFunctionMemberAssignmentDeclarations.d.ts index 1c3fe0024b07e..226cb257f6a08 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/lateBoundFunctionMemberAssignmentDeclarations.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/lateBoundFunctionMemberAssignmentDeclarations.d.ts @@ -18,16 +18,19 @@ export declare function foo(): void; //# sourceMappingURL=index.d.ts.map /// [Errors] //// -index.ts(1,17): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index.ts(2,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +index.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -==== index.ts (1 errors) ==== +==== index.ts (2 errors) ==== export function foo(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.bar = 12; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const _private = Symbol(); foo[_private] = "ok"; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const x: string = foo[_private]; \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/nullPropertyName.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/nullPropertyName.d.ts index 7d341991e7448..f480df427ef10 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/nullPropertyName.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/nullPropertyName.d.ts @@ -94,92 +94,323 @@ declare function foo(): void; //# sourceMappingURL=nullPropertyName.d.ts.map /// [Errors] //// -nullPropertyName.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(3,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(7,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(14,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(15,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(16,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(17,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(18,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(19,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(20,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(21,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(22,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(23,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(24,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(25,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(26,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(27,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(28,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(29,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(30,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(31,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(32,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(33,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(34,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(35,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(36,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(37,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(38,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(39,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(40,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(41,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(42,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(43,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(44,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(45,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(46,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(47,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(48,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(49,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(50,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(51,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(52,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(53,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(54,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(55,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(56,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(57,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(58,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(59,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(60,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(61,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(62,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(63,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(64,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(65,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(66,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(67,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(68,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(69,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(70,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(71,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(72,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(73,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(74,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(75,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(76,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(77,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(78,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(79,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(80,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(81,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +nullPropertyName.ts(82,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -==== nullPropertyName.ts (1 errors) ==== +==== nullPropertyName.ts (78 errors) ==== function foo(): void {} - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. // properties foo.x = 1; + ~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.y = 1; + ~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. // keywords foo.break = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.case = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.catch = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.class = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.const = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.continue = 1; + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.debugger = 1; + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.default = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.delete = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.do = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.else = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.enum = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.export = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.extends = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.false = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.finally = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.for = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.function = 1; + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.if = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.import = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.in = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.instanceof = 1; + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.new = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.null = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.return = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.super = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.switch = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.this = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.throw = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.true = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.try = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.typeof = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.var = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.void = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.while = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.with = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.implements = 1; + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.interface = 1; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.let = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.package = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.private = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.protected = 1; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.public = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.static = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.yield = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.abstract = 1; + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.as = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.asserts = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.any = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.async = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.await = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.boolean = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.constructor = 1; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.declare = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.get = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.infer = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.is = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.keyof = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.module = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.namespace = 1; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.never = 1; + ~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.readonly = 1; + ~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.require = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.number = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.object = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.set = 1; + ~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.string = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.symbol = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.type = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.undefined = 1; + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.unique = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.unknown = 1; + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.from = 1; + ~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.global = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.bigint = 1; + ~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. foo.of = 1; + ~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/typeFromPropertyAssignment29.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/typeFromPropertyAssignment29.d.ts index cb7e23d0afe9b..4fc606253920c 100644 --- a/tests/baselines/reference/isolated-declarations/auto-fixed/dte/typeFromPropertyAssignment29.d.ts +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/dte/typeFromPropertyAssignment29.d.ts @@ -157,10 +157,11 @@ declare var n: number; //# sourceMappingURL=typeFromPropertyAssignment29.d.ts.map /// [Errors] //// -typeFromPropertyAssignment29.ts(1,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -typeFromPropertyAssignment29.ts(41,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -typeFromPropertyAssignment29.ts(53,10): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. -typeFromPropertyAssignment29.ts(66,14): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +typeFromPropertyAssignment29.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +typeFromPropertyAssignment29.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +typeFromPropertyAssignment29.ts(51,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +typeFromPropertyAssignment29.ts(56,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +typeFromPropertyAssignment29.ts(67,5): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. typeFromPropertyAssignment29.ts(77,14): error TS2339: Property 'prop' does not exist on type '(n: number) => string'. typeFromPropertyAssignment29.ts(78,14): error TS2339: Property 'm' does not exist on type '(n: number) => string'. typeFromPropertyAssignment29.ts(81,30): error TS2339: Property 'prop' does not exist on type '(n: number) => string'. @@ -176,14 +177,16 @@ typeFromPropertyAssignment29.ts(101,30): error TS2339: Property 'prop' does not typeFromPropertyAssignment29.ts(101,50): error TS2339: Property 'm' does not exist on type 'typeof ExpandoExpr3'. -==== typeFromPropertyAssignment29.ts (17 errors) ==== +==== typeFromPropertyAssignment29.ts (18 errors) ==== function ExpandoDecl(n: number): string { - ~~~~~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return n.toString(); } ExpandoDecl.prop = 2 + ~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ExpandoDecl.m = function(n: number) { + ~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return n + 1; } var n: number = ExpandoDecl.prop + ExpandoDecl.m(12) + ExpandoDecl(101).length @@ -220,8 +223,6 @@ typeFromPropertyAssignment29.ts(101,50): error TS2339: Property 'm' does not exi } function ExpandoNested(n: number): { - ~~~~~~~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. (m: number): number; total: number; } { @@ -232,13 +233,15 @@ typeFromPropertyAssignment29.ts(101,50): error TS2339: Property 'm' does not exi return nested; } ExpandoNested.also = -1; + ~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. function ExpandoMerge(n: number): number { - ~~~~~~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. return n * 100; } ExpandoMerge.p1 = 111 + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. namespace ExpandoMerge { export var p2 = 222; } @@ -249,9 +252,9 @@ typeFromPropertyAssignment29.ts(101,50): error TS2339: Property 'm' does not exi namespace Ns { function ExpandoNamespace(): void {} - ~~~~~~~~~~~~~~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ExpandoNamespace.p6 = 42; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. export function foo(): typeof ExpandoNamespace { return ExpandoNamespace; } diff --git a/tests/baselines/reference/isolated-declarations/auto-fixed/tsc/expandoFunctionNestedAssigments.d.ts b/tests/baselines/reference/isolated-declarations/auto-fixed/tsc/expandoFunctionNestedAssigments.d.ts new file mode 100644 index 0000000000000..dcceaa770005c --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/auto-fixed/tsc/expandoFunctionNestedAssigments.d.ts @@ -0,0 +1,82 @@ +//// [tests/cases/compiler/expandoFunctionNestedAssigments.ts] //// + +//// [expandoFunctionNestedAssigments.ts] +function Foo(): void { + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} + +/// [Declarations] //// + + + +//// [expandoFunctionNestedAssigments.d.ts] +declare function Foo(): void; +declare namespace Foo { + var bla: { + foo: number; + }; + var baz: number; + var bar: number; + var fromIf: number; + var inIf: number; + var fromWhileCondition: number; + var fromWhileBody: number; + var fromWhileBodyNested: number; + var fromDoBody: number; + var fromDoBodyNested: number; + var fromDoCondition: number; + var forInit: number; + var forCond: number; + var fromForBody: number; + var fromForBodyNested: number; + var forIncr: number; + var forOf: any[]; + var fromForOfBody: number; + var fromForOfBodyNested: number; + var forIn: any[]; + var fromForInBody: number; + var fromForInBodyNested: number; +} +//# sourceMappingURL=expandoFunctionNestedAssigments.d.ts.map \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/original/diff/contextualReturnTypeOfIIFE2.d.ts.diff b/tests/baselines/reference/isolated-declarations/original/diff/contextualReturnTypeOfIIFE2.d.ts.diff index 858af1b481a68..29ef91b84a992 100644 --- a/tests/baselines/reference/isolated-declarations/original/diff/contextualReturnTypeOfIIFE2.d.ts.diff +++ b/tests/baselines/reference/isolated-declarations/original/diff/contextualReturnTypeOfIIFE2.d.ts.diff @@ -13,17 +13,17 @@ - -/// [Errors] //// - --contextualReturnTypeOfIIFE2.ts(2,12): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +-contextualReturnTypeOfIIFE2.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - - -==== contextualReturnTypeOfIIFE2.ts (1 errors) ==== - declare namespace app { - function foo(): void; -- ~~~ --!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - } - - app.foo.bar = (function () { +- ~~~~~~~~~~~ +-!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. - const someFun = (arg: number) => {}; - return { someFun }; - })(); diff --git a/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment32.d.ts.diff b/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment32.d.ts.diff new file mode 100644 index 0000000000000..bf75437f17e85 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment32.d.ts.diff @@ -0,0 +1,61 @@ +// [[Reason: Property is defined in another file. DTE can't detect this but TSC has another error for this already]] //// + +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts] //// + +=================================================================== +--- TSC declarations ++++ DTE declarations +@@ -22,16 +22,22 @@ + + expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. ++expando.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. ++expando.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + + +-==== expando.ts (6 errors) ==== ++==== expando.ts (12 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ + !!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; +@@ -44,17 +50,29 @@ + !!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p5 = 555555; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p6 = 66666; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p7 = 777777; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ + !!! error TS2322: Type 'boolean' is not assignable to type 'number'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ + !!! error TS2322: Type 'boolean' is not assignable to type 'number'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + !!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + diff --git a/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment33.d.ts.diff b/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment33.d.ts.diff new file mode 100644 index 0000000000000..5e53b17453465 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/diff/typeFromPropertyAssignment33.d.ts.diff @@ -0,0 +1,65 @@ +// [[Reason: Property is defined in another file. DTE can't detect this but TSC has another error for this already]] //// + +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts] //// + +=================================================================== +--- TSC declarations ++++ DTE declarations +@@ -22,10 +22,16 @@ + + expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ++expando.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. ++expando.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. ++expando.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + +@@ -48,9 +54,9 @@ + export var p2 = 222; + } + + +-==== expando.ts (6 errors) ==== ++==== expando.ts (12 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ + !!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; +@@ -63,17 +69,29 @@ + !!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p5 = 555555; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p6 = 66666; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p7 = 777777; ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ + !!! error TS2322: Type 'boolean' is not assignable to type 'number'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ + !!! error TS2322: Type 'boolean' is not assignable to type 'number'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + !!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + diff --git a/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment32.d.ts b/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment32.d.ts new file mode 100644 index 0000000000000..0b4c572598512 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment32.d.ts @@ -0,0 +1,131 @@ +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts] //// + +//// [expando.ts] +function ExpandoMerge(n: number) { + return n; +} +ExpandoMerge.p1 = 111 +ExpandoMerge.m = function(n: number) { + return n + 1; +} +ExpandoMerge.p4 = 44444; +ExpandoMerge.p5 = 555555; +ExpandoMerge.p6 = 66666; +ExpandoMerge.p7 = 777777; +ExpandoMerge.p8 = false; // type error +ExpandoMerge.p9 = false; // type error +var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + +//// [ns.ts] +namespace ExpandoMerge { + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; +} +namespace ExpandoMerge { + export var p2 = 222; +} + + +/// [Declarations] //// + + + +//// [expando.d.ts] +declare function ExpandoMerge(n: number): invalid; +declare var n: invalid; + +//// [ns.d.ts] +declare namespace ExpandoMerge { + var p3: number; + var p4: number; + var p5: number; + let p6: number; + let p7: number; + var p8: number; + let p9: number; +} +declare namespace ExpandoMerge { + var p2: number; +} + +/// [Errors] //// + +expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + + +==== expando.ts (12 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; + } + ExpandoMerge.p1 = 111 + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.m = function(n: number) { + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p5 = 555555; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p6 = 66666; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p7 = 777777; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + +==== ns.ts (2 errors) ==== + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; + } + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p2 = 222; + } + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment33.d.ts b/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment33.d.ts new file mode 100644 index 0000000000000..09f7fb3e8b4f4 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/dte/typeFromPropertyAssignment33.d.ts @@ -0,0 +1,135 @@ +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts] //// + +//// [ns.ts] +namespace ExpandoMerge { + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; +} +namespace ExpandoMerge { + export var p2 = 222; +} + + +//// [expando.ts] +function ExpandoMerge(n: number) { + return n; +} +ExpandoMerge.p1 = 111 +ExpandoMerge.m = function(n: number) { + return n + 1; +} +ExpandoMerge.p4 = 44444; +ExpandoMerge.p5 = 555555; +ExpandoMerge.p6 = 66666; +ExpandoMerge.p7 = 777777; +ExpandoMerge.p8 = false; // type error +ExpandoMerge.p9 = false; // type error +var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + + + +/// [Declarations] //// + + + +//// [expando.d.ts] +declare function ExpandoMerge(n: number): invalid; +declare var n: invalid; + +//// [ns.d.ts] +declare namespace ExpandoMerge { + var p3: number; + var p4: number; + var p5: number; + let p6: number; + let p7: number; + var p8: number; + let p9: number; +} +declare namespace ExpandoMerge { + var p2: number; +} + +/// [Errors] //// + +expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(8,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(9,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(10,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(11,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(12,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(13,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + + +==== ns.ts (2 errors) ==== + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; + } + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p2 = 222; + } + + +==== expando.ts (12 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; + } + ExpandoMerge.p1 = 111 + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.m = function(n: number) { + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p5 = 555555; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p6 = 66666; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p7 = 777777; + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/original/tsc/contextualReturnTypeOfIIFE2.d.ts b/tests/baselines/reference/isolated-declarations/original/tsc/contextualReturnTypeOfIIFE2.d.ts index 52641ca7bc1a4..7c393fd9f0a13 100644 --- a/tests/baselines/reference/isolated-declarations/original/tsc/contextualReturnTypeOfIIFE2.d.ts +++ b/tests/baselines/reference/isolated-declarations/original/tsc/contextualReturnTypeOfIIFE2.d.ts @@ -24,17 +24,17 @@ declare namespace app { /// [Errors] //// -contextualReturnTypeOfIIFE2.ts(2,12): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +contextualReturnTypeOfIIFE2.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. ==== contextualReturnTypeOfIIFE2.ts (1 errors) ==== declare namespace app { function foo(): void; - ~~~ -!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. } app.foo.bar = (function () { + ~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. const someFun = (arg: number) => {}; return { someFun }; })(); diff --git a/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment32.d.ts b/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment32.d.ts new file mode 100644 index 0000000000000..efb5f71209342 --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment32.d.ts @@ -0,0 +1,113 @@ +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts] //// + +//// [expando.ts] +function ExpandoMerge(n: number) { + return n; +} +ExpandoMerge.p1 = 111 +ExpandoMerge.m = function(n: number) { + return n + 1; +} +ExpandoMerge.p4 = 44444; +ExpandoMerge.p5 = 555555; +ExpandoMerge.p6 = 66666; +ExpandoMerge.p7 = 777777; +ExpandoMerge.p8 = false; // type error +ExpandoMerge.p9 = false; // type error +var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + +//// [ns.ts] +namespace ExpandoMerge { + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; +} +namespace ExpandoMerge { + export var p2 = 222; +} + + +/// [Declarations] //// + + + +//// [expando.d.ts] +declare function ExpandoMerge(n: number): invalid; +declare var n: invalid; + +//// [ns.d.ts] +declare namespace ExpandoMerge { + var p3: number; + var p4: number; + var p5: number; + let p6: number; + let p7: number; + var p8: number; + let p9: number; +} +declare namespace ExpandoMerge { + var p2: number; +} + +/// [Errors] //// + +expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + + +==== expando.ts (6 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; + } + ExpandoMerge.p1 = 111 + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.m = function(n: number) { + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; + ExpandoMerge.p5 = 555555; + ExpandoMerge.p6 = 66666; + ExpandoMerge.p7 = 777777; + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + +==== ns.ts (2 errors) ==== + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; + } + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p2 = 222; + } + \ No newline at end of file diff --git a/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment33.d.ts b/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment33.d.ts new file mode 100644 index 0000000000000..ec931b0ae189c --- /dev/null +++ b/tests/baselines/reference/isolated-declarations/original/tsc/typeFromPropertyAssignment33.d.ts @@ -0,0 +1,117 @@ +//// [tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts] //// + +//// [ns.ts] +namespace ExpandoMerge { + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; +} +namespace ExpandoMerge { + export var p2 = 222; +} + + +//// [expando.ts] +function ExpandoMerge(n: number) { + return n; +} +ExpandoMerge.p1 = 111 +ExpandoMerge.m = function(n: number) { + return n + 1; +} +ExpandoMerge.p4 = 44444; +ExpandoMerge.p5 = 555555; +ExpandoMerge.p6 = 66666; +ExpandoMerge.p7 = 777777; +ExpandoMerge.p8 = false; // type error +ExpandoMerge.p9 = false; // type error +var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + + + +/// [Declarations] //// + + + +//// [expando.d.ts] +declare function ExpandoMerge(n: number): invalid; +declare var n: invalid; + +//// [ns.d.ts] +declare namespace ExpandoMerge { + var p3: number; + var p4: number; + var p5: number; + let p6: number; + let p7: number; + var p8: number; + let p9: number; +} +declare namespace ExpandoMerge { + var p2: number; +} + +/// [Errors] //// + +expando.ts(1,10): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +expando.ts(4,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(5,1): error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. +expando.ts(12,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'. +expando.ts(14,9): error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. +ns.ts(1,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. +ns.ts(10,11): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + + +==== ns.ts (2 errors) ==== + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p3 = 333; + export var p4 = 4; + export var p5 = 5; + export let p6 = 6; + export let p7 = 7; + export var p8 = 6; + export let p9 = 7; + } + namespace ExpandoMerge { + ~~~~~~~~~~~~ +!!! error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged. + export var p2 = 222; + } + + +==== expando.ts (6 errors) ==== + function ExpandoMerge(n: number) { + ~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + return n; + } + ExpandoMerge.p1 = 111 + ~~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + ExpandoMerge.m = function(n: number) { + ~~~~~~~~~~~~~~ +!!! error TS9009: Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function. + return n + 1; + } + ExpandoMerge.p4 = 44444; + ExpandoMerge.p5 = 555555; + ExpandoMerge.p6 = 66666; + ExpandoMerge.p7 = 777777; + ExpandoMerge.p8 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + ExpandoMerge.p9 = false; // type error + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'boolean' is not assignable to type 'number'. + var n = ExpandoMerge.p1 + ExpandoMerge.p2 + ExpandoMerge.p3 + ExpandoMerge.p4 + ExpandoMerge.p5 + ExpandoMerge.p6 + ExpandoMerge.p7 + ExpandoMerge.p8 + ExpandoMerge.p9 + ExpandoMerge.m(12) + ExpandoMerge(1001); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS9007: Declaration emit for this file requires type resolution. An explicit type annotation may unblock declaration emit. + + \ No newline at end of file diff --git a/tests/cases/compiler/expandoFunctionNestedAssigments.ts b/tests/cases/compiler/expandoFunctionNestedAssigments.ts new file mode 100644 index 0000000000000..4d0cb13a02a31 --- /dev/null +++ b/tests/cases/compiler/expandoFunctionNestedAssigments.ts @@ -0,0 +1,49 @@ +// @lib: esnext +// @isolatedDeclarationFixedDiffReason: Function declarations are not fixed +// @declaration: true + +function Foo(): void { + +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} \ No newline at end of file diff --git a/tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts b/tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts new file mode 100644 index 0000000000000..a0375921bf6b5 --- /dev/null +++ b/tests/cases/compiler/expandoFunctionNestedAssigmentsDeclared.ts @@ -0,0 +1,74 @@ +// @lib: esnext +// @declaration: true + +function Foo(): void { + +} +declare namespace Foo { + var bla: { + foo: number; + }; + var baz: number; + var bar: number; + var fromIf: number; + var inIf: number; + var fromWhileCondition: number; + var fromWhileBody: number; + var fromWhileBodyNested: number; + var fromDoBody: number; + var fromDoBodyNested: number; + var fromDoCondition: number; + var forInit: number; + var forCond: number; + var fromForBody: number; + var fromForBodyNested: number; + var forIncr: number; + var forOf: any[]; + var fromForOfBody: number; + var fromForOfBodyNested: number; + var forIn: any[]; + var fromForInBody: number; + var fromForInBodyNested: number; +} + +(Foo.bla = { foo: 1}).foo = (Foo.baz = 1) + (Foo.bar = 0); + +if(Foo.fromIf = 1) { + Foo.inIf = 1; +} + +while(Foo.fromWhileCondition = 1) { + Foo.fromWhileBody = 1; + { + Foo.fromWhileBodyNested = 1; + } +} + +do { + Foo.fromDoBody = 1; + { + Foo.fromDoBodyNested = 1; + } +} while(Foo.fromDoCondition = 1); + +for(Foo.forInit = 1; (Foo.forCond = 1) > 1; Foo.forIncr = 1){ + Foo.fromForBody = 1; + { + Foo.fromForBodyNested = 1; + } +} + +for(let f of (Foo.forOf = []) ){ + Foo.fromForOfBody = 1; + { + Foo.fromForOfBodyNested = 1; + } +} + + +for(let f in (Foo.forIn = []) ){ + Foo.fromForInBody = 1; + { + Foo.fromForInBodyNested = 1; + } +} \ No newline at end of file diff --git a/tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts b/tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts index 498aa151e7306..f58616ff48eb0 100644 --- a/tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts +++ b/tests/cases/conformance/salsa/typeFromPropertyAssignment32.ts @@ -1,3 +1,4 @@ +// @isolatedDeclarationDiffReason: Property is defined in another file. DTE can't detect this but TSC has another error for this already // @Filename: expando.ts function ExpandoMerge(n: number) { return n; diff --git a/tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts b/tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts index d98f689329dd3..d3e95d9a9b2c6 100644 --- a/tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts +++ b/tests/cases/conformance/salsa/typeFromPropertyAssignment33.ts @@ -1,3 +1,4 @@ +// @isolatedDeclarationDiffReason: Property is defined in another file. DTE can't detect this but TSC has another error for this already // @Filename: ns.ts namespace ExpandoMerge { export var p3 = 333;