mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 15:12:08 +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
|