Add tests for #5173

This commit is contained in:
Nathan Yee 2015-11-25 14:31:46 -08:00
parent 5b3d299412
commit 068d10c6bb
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,17 @@
tests/cases/compiler/errorOnInitializerInObjectType.ts(2,17): error TS1246: An object type property cannot have an initializer.
tests/cases/compiler/errorOnInitializerInObjectType.ts(6,17): error TS1246: An object type property cannot have an initializer.
==== tests/cases/compiler/errorOnInitializerInObjectType.ts (2 errors) ====
interface Foo {
bar: number = 5;
~
!!! error TS1246: An object type property cannot have an initializer.
}
var Foo: {
bar: number = 5;
~
!!! error TS1246: An object type property cannot have an initializer.
};

View File

@ -0,0 +1,12 @@
//// [errorOnInitializerInObjectType.ts]
interface Foo {
bar: number = 5;
}
var Foo: {
bar: number = 5;
};
//// [errorOnInitializerInObjectType.js]
var Foo;

View File

@ -0,0 +1,7 @@
interface Foo {
bar: number = 5;
}
var Foo: {
bar: number = 5;
};