Accepted baselines.

This commit is contained in:
Daniel Rosenwasser
2018-04-19 15:15:53 -07:00
parent 70feb7b10b
commit 87bb96d7b2
4 changed files with 100 additions and 3 deletions

View File

@@ -1,9 +1,12 @@
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 TS1034: 'super' must be followed by an argument list or member access.
==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (3 errors) ====
==== tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts (6 errors) ====
export interface SomethingTaggable {
<T>(t: TemplateStringsArray, ...args: T[]): SomethingNewable;
}
@@ -37,4 +40,22 @@ tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts(17,30
* ```
*/
const e = new tag<number>
`hello`();
`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 TS1034: 'super' must be followed by an argument list or member access.
}
~~~~~
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
}

View File

@@ -26,7 +26,17 @@ const d = new tag<number> `${"hello"} ${"world"}`<string>(100, 200);
* ```
*/
const e = new tag<number>
`hello`();
`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`;
}
}
//// [taggedTemplatesWithTypeArguments2.js]
const a = new tag `${100} ${200}`("hello", "world");
@@ -42,3 +52,10 @@ const d = (new tag `${"hello"} ${"world"}`)(100, 200);
* ```
*/
const e = new tag `hello`();
class SomeBase {
}
class SomeDerived extends SomeBase {
constructor() {
super. `hello world`;
}
}

View File

@@ -53,3 +53,31 @@ const e = new tag<number>
>tag : Symbol(tag, Decl(taggedTemplatesWithTypeArguments2.ts, 8, 13))
`hello`();
class SomeBase<A, B, C> {
>SomeBase : Symbol(SomeBase, Decl(taggedTemplatesWithTypeArguments2.ts, 27, 10))
>A : Symbol(A, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 15))
>B : Symbol(B, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 17))
>C : Symbol(C, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 20))
a!: A; b!: B; c!: C;
>a : Symbol(SomeBase.a, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 25))
>A : Symbol(A, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 15))
>b : Symbol(SomeBase.b, Decl(taggedTemplatesWithTypeArguments2.ts, 30, 10))
>B : Symbol(B, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 17))
>c : Symbol(SomeBase.c, Decl(taggedTemplatesWithTypeArguments2.ts, 30, 17))
>C : Symbol(C, Decl(taggedTemplatesWithTypeArguments2.ts, 29, 20))
}
class SomeDerived<T> extends SomeBase<number, string, T> {
>SomeDerived : Symbol(SomeDerived, Decl(taggedTemplatesWithTypeArguments2.ts, 31, 1))
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments2.ts, 33, 18))
>SomeBase : Symbol(SomeBase, Decl(taggedTemplatesWithTypeArguments2.ts, 27, 10))
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments2.ts, 33, 18))
constructor() {
super<number, string, T> `hello world`;
>super : Symbol(SomeBase, Decl(taggedTemplatesWithTypeArguments2.ts, 27, 10))
>T : Symbol(T, Decl(taggedTemplatesWithTypeArguments2.ts, 33, 18))
}
}

View File

@@ -87,3 +87,34 @@ const e = new tag<number>
`hello`();
>`hello` : "hello"
class SomeBase<A, B, C> {
>SomeBase : SomeBase<A, B, C>
>A : A
>B : B
>C : C
a!: A; b!: B; c!: C;
>a : A
>A : A
>b : B
>B : B
>c : C
>C : C
}
class SomeDerived<T> extends SomeBase<number, string, T> {
>SomeDerived : SomeDerived<T>
>T : T
>SomeBase : SomeBase<number, string, T>
>T : T
constructor() {
super<number, string, T> `hello world`;
>super<number, string, T> `hello world` : any
>super : any
>super : SomeBase<number, string, T>
> : any
>T : T
>`hello world` : "hello world"
}
}