mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 14:43:33 +03:00
10 lines
264 B
TypeScript
10 lines
264 B
TypeScript
|
// @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
|