-
Notifications
You must be signed in to change notification settings - Fork 12.2k
/
taggedTemplatesWithTypeArguments2.errors.txt
64 lines (53 loc) · 3.14 KB
/
taggedTemplatesWithTypeArguments2.errors.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(13,30): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(15,11): error TS2347: Untyped function calls may not accept type arguments.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(17,30): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(35,5): error TS2377: Constructors for derived classes must contain a 'super' call.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,9): error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,14): error TS2754: 'super' may not use type arguments.
tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(36,34): error TS1034: 'super' must be followed by an argument list or member access.
==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (7 errors) ====
export interface SomethingTaggable {
<T>(t: TemplateStringsArray, ...args: T[]): SomethingNewable;
}
export interface SomethingNewable {
new <T>(...args: T[]): any;
}
declare const tag: SomethingTaggable;
const a = new tag `${100} ${200}`<string>("hello", "world");
const b = new tag<number> `${"hello"} ${"world"}`(100, 200);
~~~~~~~
!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
const c = new tag<number> `${100} ${200}`<string>("hello", "world");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2347: Untyped function calls may not accept type arguments.
const d = new tag<number> `${"hello"} ${"world"}`<string>(100, 200);
~~~~~~~
!!! error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
/**
* Testing ASI. This should never parse as
*
* ```ts
* new tag<number>;
* `hello${369}`();
* ```
*/
const e = new tag<number>
`hello`();
class SomeBase<A, B, C> {
a!: A; b!: B; c!: C;
}
class SomeDerived<T> extends SomeBase<number, string, T> {
constructor() {
~~~~~~~~~~~~~~~
super<number, string, T> `hello world`;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~
!!! error TS17011: 'super' must be called before accessing a property of 'super' in the constructor of a derived class.
~~~~~~~~~~~~~~~~~~~
!!! error TS2754: 'super' may not use type arguments.
~~~~~~~~~~~~~
!!! error TS1034: 'super' must be followed by an argument list or member access.
}
~~~~~
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
}