TypeScript/tests/baselines/reference/genericClassWithStaticsUsingTypeArguments.errors.txt

41 lines
2.2 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(3,20): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(5,15): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(7,15): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(9,30): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(11,29): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(13,18): error TS2302: Static members cannot reference class type parameters.
tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts(13,24): error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/genericClassWithStaticsUsingTypeArguments.ts (7 errors) ====
// Should be error to use 'T' in all declarations within Foo.
class Foo<T> {
static a = (n: T) => { };
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
static b: T;
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
static c: T[] = [];
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
static d = false || ((x: T) => x || undefined)(null)
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
static e = function (x: T) { return null; }
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
static f(xs: T[]): T[] {
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
~
!!! error TS2302: Static members cannot reference class type parameters.
2014-07-13 01:04:16 +02:00
return xs.reverse();
}
}