mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add tests for #5173
This commit is contained in:
@@ -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.
|
||||
};
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [errorOnInitializerInObjectType.ts]
|
||||
interface Foo {
|
||||
bar: number = 5;
|
||||
}
|
||||
|
||||
var Foo: {
|
||||
bar: number = 5;
|
||||
};
|
||||
|
||||
|
||||
//// [errorOnInitializerInObjectType.js]
|
||||
var Foo;
|
||||
@@ -0,0 +1,7 @@
|
||||
interface Foo {
|
||||
bar: number = 5;
|
||||
}
|
||||
|
||||
var Foo: {
|
||||
bar: number = 5;
|
||||
};
|
||||
Reference in New Issue
Block a user