|
| 1 | +=== tests/cases/compiler/unparenthesizedConstructorTypeInUnionOrIntersection.ts === |
| 2 | +type U1 = string | new () => void; |
| 3 | +>U1 : Symbol(U1, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 0, 0)) |
| 4 | + |
| 5 | +type U2 = string | new (foo: number) => void |
| 6 | +>U2 : Symbol(U2, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 0, 34)) |
| 7 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 1, 24)) |
| 8 | + |
| 9 | +type U3 = | new () => number |
| 10 | +>U3 : Symbol(U3, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 1, 44)) |
| 11 | + |
| 12 | +type U4 = | new (foo?: number) => void; |
| 13 | +>U4 : Symbol(U4, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 2, 28)) |
| 14 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 3, 17)) |
| 15 | + |
| 16 | +type U5 = string | new (number: number, foo?: string) => void | number; |
| 17 | +>U5 : Symbol(U5, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 3, 39)) |
| 18 | +>number : Symbol(number, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 4, 24)) |
| 19 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 4, 39)) |
| 20 | + |
| 21 | +type U6 = |
| 22 | +>U6 : Symbol(U6, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 4, 71)) |
| 23 | + |
| 24 | + | string |
| 25 | + | new (...args: any[]) => void |
| 26 | +>args : Symbol(args, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 7, 9)) |
| 27 | + |
| 28 | + | number; |
| 29 | + |
| 30 | +type I1 = string & new () => void; |
| 31 | +>I1 : Symbol(I1, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 8, 11)) |
| 32 | + |
| 33 | +type I2 = string & new (...foo: number[]) => void; |
| 34 | +>I2 : Symbol(I2, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 10, 34)) |
| 35 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 11, 24)) |
| 36 | + |
| 37 | +type I3 = & new () => boolean |
| 38 | +>I3 : Symbol(I3, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 11, 50)) |
| 39 | + |
| 40 | +type I4 = & new () => boolean & null; |
| 41 | +>I4 : Symbol(I4, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 12, 29)) |
| 42 | + |
| 43 | +type I5 = string & new (any: any, any2: any) => any & any; |
| 44 | +>I5 : Symbol(I5, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 13, 37)) |
| 45 | +>any : Symbol(any, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 14, 24)) |
| 46 | +>any2 : Symbol(any2, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 14, 33)) |
| 47 | + |
| 48 | +type I6 = |
| 49 | +>I6 : Symbol(I6, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 14, 58)) |
| 50 | + |
| 51 | + & string |
| 52 | + & new (foo: any) => void; |
| 53 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 17, 9)) |
| 54 | + |
| 55 | +type M1 = string | number & string | new () => number; |
| 56 | +>M1 : Symbol(M1, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 17, 27)) |
| 57 | + |
| 58 | +type M2 = any & string | any & new () => void; |
| 59 | +>M2 : Symbol(M2, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 19, 54)) |
| 60 | + |
| 61 | +type M3 = any & new (foo: any) => void | new () => void & any; |
| 62 | +>M3 : Symbol(M3, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 20, 46)) |
| 63 | +>foo : Symbol(foo, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 21, 21)) |
| 64 | + |
| 65 | +type OK1 = string | (new ()=> void); |
| 66 | +>OK1 : Symbol(OK1, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 21, 62)) |
| 67 | + |
| 68 | +type OK2 = string | (new ()=> string | number); |
| 69 | +>OK2 : Symbol(OK2, Decl(unparenthesizedConstructorTypeInUnionOrIntersection.ts, 23, 36)) |
| 70 | + |
0 commit comments