mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
64 lines
2.6 KiB
Plaintext
64 lines
2.6 KiB
Plaintext
forStatements.ts(6,5): error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
|
|
forStatements.ts(10,5): error TS2564: Property 'source' has no initializer and is not definitely assigned in the constructor.
|
|
forStatements.ts(11,5): error TS2564: Property 'recurse' has no initializer and is not definitely assigned in the constructor.
|
|
forStatements.ts(12,5): error TS2564: Property 'wrapped' has no initializer and is not definitely assigned in the constructor.
|
|
forStatements.ts(19,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
|
|
|
|
==== forStatements.ts (5 errors) ====
|
|
interface I {
|
|
id: number;
|
|
}
|
|
|
|
class C implements I {
|
|
id: number;
|
|
~~
|
|
!!! error TS2564: Property 'id' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
class D<T>{
|
|
source: T;
|
|
~~~~~~
|
|
!!! error TS2564: Property 'source' has no initializer and is not definitely assigned in the constructor.
|
|
recurse: D<T>;
|
|
~~~~~~~
|
|
!!! error TS2564: Property 'recurse' has no initializer and is not definitely assigned in the constructor.
|
|
wrapped: D<D<T>>
|
|
~~~~~~~
|
|
!!! error TS2564: Property 'wrapped' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
function F(x: string): number { return 42; }
|
|
|
|
namespace M {
|
|
export class A {
|
|
name: string;
|
|
~~~~
|
|
!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
export function F2(x: number): string { return x.toString(); }
|
|
}
|
|
|
|
for(var aNumber: number = 9.9;;){}
|
|
for(var aString: string = 'this is a string';;){}
|
|
for(var aDate: Date = new Date(12);;){}
|
|
for(var anObject: Object = new Object();;){}
|
|
|
|
for(var anAny: any = null;;){}
|
|
for(var aSecondAny: any = undefined;;){}
|
|
for(var aVoid: void = undefined;;){}
|
|
|
|
for(var anInterface: I = new C();;){}
|
|
for(var aClass: C = new C();;){}
|
|
for(var aGenericClass: D<string> = new D<string>();;){}
|
|
for(var anObjectLiteral: I = { id: 12 };;){}
|
|
for(var anOtherObjectLiteral: { id: number } = new C();;){}
|
|
|
|
for(var aFunction: typeof F = F;;){}
|
|
for(var anOtherFunction: (x: string) => number = F;;){}
|
|
for(var aLambda: typeof F = (x) => 2;;){}
|
|
|
|
for(var aModule: typeof M = M;;){}
|
|
for(var aClassInModule: M.A = new M.A();;){}
|
|
for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} |