Files
tsgo/testdata/baselines/reference/submodule/compiler/genericClasses3.errors.txt

38 lines
1.5 KiB
Plaintext

genericClasses3.ts(2,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
genericClasses3.ts(3,5): error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor.
genericClasses3.ts(7,12): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
genericClasses3.ts(12,9): error TS2454: Variable 'v2' is used before being assigned.
genericClasses3.ts(13,9): error TS2454: Variable 'v2' is used before being assigned.
genericClasses3.ts(15,9): error TS2454: Variable 'v2' is used before being assigned.
==== genericClasses3.ts (6 errors) ====
class B<T> {
a: T;
~
!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
b: T;
~
!!! error TS2564: Property 'b' has no initializer and is not definitely assigned in the constructor.
}
class C<T> extends B<T> {
public x: T;
~
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
}
var v2: C <string>;
var y = v2.x; // should be 'string'
~~
!!! error TS2454: Variable 'v2' is used before being assigned.
var u = v2.a; // should be 'string'
~~
!!! error TS2454: Variable 'v2' is used before being assigned.
var z = v2.b;
~~
!!! error TS2454: Variable 'v2' is used before being assigned.