Skip to content

Commit 8b4c235

Browse files
committed
Commit missing baselines
1 parent 8571a8a commit 8b4c235

File tree

4 files changed

+244
-0
lines changed

4 files changed

+244
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
tests/cases/conformance/externalModules/typeOnly/component.ts(12,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
2+
tests/cases/conformance/externalModules/typeOnly/component.ts(16,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
3+
tests/cases/conformance/externalModules/typeOnly/component.ts(20,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
4+
tests/cases/conformance/externalModules/typeOnly/component.ts(24,4): error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
5+
6+
7+
==== tests/cases/conformance/externalModules/typeOnly/framework-hooks.ts (0 errors) ====
8+
export const onInit = Symbol("onInit");
9+
10+
==== tests/cases/conformance/externalModules/typeOnly/component.ts (4 errors) ====
11+
import type { onInit } from "./framework-hooks";
12+
13+
interface Component {
14+
[onInit]?(): void;
15+
}
16+
17+
type T = {
18+
[onInit]: any;
19+
}
20+
21+
const o = {
22+
[onInit]: 0 // Error
23+
~~~~~~
24+
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
25+
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
26+
};
27+
28+
class C {
29+
[onInit]: any; // Error (because class fields)
30+
~~~~~~
31+
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
32+
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
33+
}
34+
35+
class D {
36+
[onInit] = 0; // Error
37+
~~~~~~
38+
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
39+
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
40+
}
41+
42+
class E {
43+
[onInit]() {} // Error
44+
~~~~~~
45+
!!! error TS1361: 'onInit' cannot be used as a value because it was imported using 'import type'.
46+
!!! related TS1376 tests/cases/conformance/externalModules/typeOnly/component.ts:1:15: 'onInit' was imported here.
47+
}
48+
49+
abstract class F {
50+
abstract [onInit](): void;
51+
}
52+
53+
class G {
54+
declare [onInit]: any;
55+
}
56+
57+
declare class H {
58+
[onInit]: any;
59+
}
60+

tests/baselines/reference/computedPropertyName.js

+51
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,59 @@ import type { onInit } from "./framework-hooks";
99
interface Component {
1010
[onInit]?(): void;
1111
}
12+
13+
type T = {
14+
[onInit]: any;
15+
}
16+
17+
const o = {
18+
[onInit]: 0 // Error
19+
};
20+
21+
class C {
22+
[onInit]: any; // Error (because class fields)
23+
}
24+
25+
class D {
26+
[onInit] = 0; // Error
27+
}
28+
29+
class E {
30+
[onInit]() {} // Error
31+
}
32+
33+
abstract class F {
34+
abstract [onInit](): void;
35+
}
36+
37+
class G {
38+
declare [onInit]: any;
39+
}
40+
41+
declare class H {
42+
[onInit]: any;
43+
}
1244

1345

1446
//// [framework-hooks.js]
1547
export const onInit = Symbol("onInit");
1648
//// [component.js]
49+
var _a;
50+
const o = {
51+
[onInit]: 0 // Error
52+
};
53+
class C {
54+
}
55+
class D {
56+
constructor() {
57+
this[_a] = 0; // Error
58+
}
59+
}
60+
_a = onInit;
61+
class E {
62+
[onInit]() { } // Error
63+
}
64+
class F {
65+
}
66+
class G {
67+
}

tests/baselines/reference/computedPropertyName.symbols

+65
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,68 @@ interface Component {
1515
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
1616
}
1717

18+
type T = {
19+
>T : Symbol(T, Decl(component.ts, 4, 1))
20+
21+
[onInit]: any;
22+
>[onInit] : Symbol([onInit], Decl(component.ts, 6, 10))
23+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
24+
}
25+
26+
const o = {
27+
>o : Symbol(o, Decl(component.ts, 10, 5))
28+
29+
[onInit]: 0 // Error
30+
>[onInit] : Symbol([onInit], Decl(component.ts, 10, 11))
31+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
32+
33+
};
34+
35+
class C {
36+
>C : Symbol(C, Decl(component.ts, 12, 2))
37+
38+
[onInit]: any; // Error (because class fields)
39+
>[onInit] : Symbol(C[onInit], Decl(component.ts, 14, 9))
40+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
41+
}
42+
43+
class D {
44+
>D : Symbol(D, Decl(component.ts, 16, 1))
45+
46+
[onInit] = 0; // Error
47+
>[onInit] : Symbol(D[onInit], Decl(component.ts, 18, 9))
48+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
49+
}
50+
51+
class E {
52+
>E : Symbol(E, Decl(component.ts, 20, 1))
53+
54+
[onInit]() {} // Error
55+
>[onInit] : Symbol(E[onInit], Decl(component.ts, 22, 9))
56+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
57+
}
58+
59+
abstract class F {
60+
>F : Symbol(F, Decl(component.ts, 24, 1))
61+
62+
abstract [onInit](): void;
63+
>[onInit] : Symbol(F[onInit], Decl(component.ts, 26, 18))
64+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
65+
}
66+
67+
class G {
68+
>G : Symbol(G, Decl(component.ts, 28, 1))
69+
70+
declare [onInit]: any;
71+
>[onInit] : Symbol(G[onInit], Decl(component.ts, 30, 9))
72+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
73+
}
74+
75+
declare class H {
76+
>H : Symbol(H, Decl(component.ts, 32, 1))
77+
78+
[onInit]: any;
79+
>[onInit] : Symbol(H[onInit], Decl(component.ts, 34, 17))
80+
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
81+
}
82+

tests/baselines/reference/computedPropertyName.types

+68
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,71 @@ interface Component {
1515
>onInit : unique symbol
1616
}
1717

18+
type T = {
19+
>T : T
20+
21+
[onInit]: any;
22+
>[onInit] : any
23+
>onInit : unique symbol
24+
}
25+
26+
const o = {
27+
>o : { [onInit]: number; }
28+
>{ [onInit]: 0 // Error} : { [onInit]: number; }
29+
30+
[onInit]: 0 // Error
31+
>[onInit] : number
32+
>onInit : unique symbol
33+
>0 : 0
34+
35+
};
36+
37+
class C {
38+
>C : C
39+
40+
[onInit]: any; // Error (because class fields)
41+
>[onInit] : any
42+
>onInit : unique symbol
43+
}
44+
45+
class D {
46+
>D : D
47+
48+
[onInit] = 0; // Error
49+
>[onInit] : number
50+
>onInit : unique symbol
51+
>0 : 0
52+
}
53+
54+
class E {
55+
>E : E
56+
57+
[onInit]() {} // Error
58+
>[onInit] : () => void
59+
>onInit : unique symbol
60+
}
61+
62+
abstract class F {
63+
>F : F
64+
65+
abstract [onInit](): void;
66+
>[onInit] : () => void
67+
>onInit : unique symbol
68+
}
69+
70+
class G {
71+
>G : G
72+
73+
declare [onInit]: any;
74+
>[onInit] : any
75+
>onInit : unique symbol
76+
}
77+
78+
declare class H {
79+
>H : H
80+
81+
[onInit]: any;
82+
>[onInit] : any
83+
>onInit : unique symbol
84+
}
85+

0 commit comments

Comments
 (0)