mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Add tests for #5173
This commit is contained in:
parent
5b3d299412
commit
068d10c6bb
@ -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.
|
||||
};
|
||||
|
||||
12
tests/baselines/reference/errorOnInitializerInObjectType.js
Normal file
12
tests/baselines/reference/errorOnInitializerInObjectType.js
Normal file
@ -0,0 +1,12 @@
|
||||
//// [errorOnInitializerInObjectType.ts]
|
||||
interface Foo {
|
||||
bar: number = 5;
|
||||
}
|
||||
|
||||
var Foo: {
|
||||
bar: number = 5;
|
||||
};
|
||||
|
||||
|
||||
//// [errorOnInitializerInObjectType.js]
|
||||
var Foo;
|
||||
7
tests/cases/compiler/errorOnInitializerInObjectType.ts
Normal file
7
tests/cases/compiler/errorOnInitializerInObjectType.ts
Normal file
@ -0,0 +1,7 @@
|
||||
interface Foo {
|
||||
bar: number = 5;
|
||||
}
|
||||
|
||||
var Foo: {
|
||||
bar: number = 5;
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user