fix #15447: object is empty object type (#16290)

This commit is contained in:
Herrington Darkholme
2017-06-07 01:08:33 +08:00
committed by Mohamed Hegazy
parent a6e1cedfd7
commit 0600a27dd9
4 changed files with 33 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
// @declaration: true
var a: object & string = ""; // error
var b: object | string = ""; // ok
var c: object & {} = 123; // error
a = b; // error
b = a; // ok
const foo: object & {} = {bar: 'bar'}; // ok
const bar: object & {err: string} = {bar: 'bar'}; // error