diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.js b/tests/baselines/reference/controlFlowPropertyInitializer.js new file mode 100644 index 00000000000..5d8e10651fa --- /dev/null +++ b/tests/baselines/reference/controlFlowPropertyInitializer.js @@ -0,0 +1,19 @@ +//// [controlFlowPropertyInitializer.ts] + +// Repro from #8967 + +const LANG = "Turbo Pascal" + +class BestLanguage { + name = LANG; +} + +//// [controlFlowPropertyInitializer.js] +// Repro from #8967 +var LANG = "Turbo Pascal"; +var BestLanguage = (function () { + function BestLanguage() { + this.name = LANG; + } + return BestLanguage; +}()); diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.symbols b/tests/baselines/reference/controlFlowPropertyInitializer.symbols new file mode 100644 index 00000000000..70e6c2da8a1 --- /dev/null +++ b/tests/baselines/reference/controlFlowPropertyInitializer.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/controlFlowPropertyInitializer.ts === + +// Repro from #8967 + +const LANG = "Turbo Pascal" +>LANG : Symbol(LANG, Decl(controlFlowPropertyInitializer.ts, 3, 5)) + +class BestLanguage { +>BestLanguage : Symbol(BestLanguage, Decl(controlFlowPropertyInitializer.ts, 3, 27)) + + name = LANG; +>name : Symbol(BestLanguage.name, Decl(controlFlowPropertyInitializer.ts, 5, 20)) +>LANG : Symbol(LANG, Decl(controlFlowPropertyInitializer.ts, 3, 5)) +} diff --git a/tests/baselines/reference/controlFlowPropertyInitializer.types b/tests/baselines/reference/controlFlowPropertyInitializer.types new file mode 100644 index 00000000000..d35a4c13698 --- /dev/null +++ b/tests/baselines/reference/controlFlowPropertyInitializer.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/controlFlowPropertyInitializer.ts === + +// Repro from #8967 + +const LANG = "Turbo Pascal" +>LANG : string +>"Turbo Pascal" : string + +class BestLanguage { +>BestLanguage : BestLanguage + + name = LANG; +>name : string +>LANG : string +} diff --git a/tests/cases/compiler/controlFlowPropertyInitializer.ts b/tests/cases/compiler/controlFlowPropertyInitializer.ts new file mode 100644 index 00000000000..0b75f280b1d --- /dev/null +++ b/tests/cases/compiler/controlFlowPropertyInitializer.ts @@ -0,0 +1,9 @@ +// @strictNullChecks: true + +// Repro from #8967 + +const LANG = "Turbo Pascal" + +class BestLanguage { + name = LANG; +} \ No newline at end of file