Adding regression test

This commit is contained in:
Anders Hejlsberg 2016-06-04 14:50:37 -07:00
parent bb7818b837
commit 3b1effb7df
4 changed files with 57 additions and 0 deletions

View file

@ -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;
}());

View file

@ -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))
}

View file

@ -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
}

View file

@ -0,0 +1,9 @@
// @strictNullChecks: true
// Repro from #8967
const LANG = "Turbo Pascal"
class BestLanguage {
name = LANG;
}