mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
62 lines
1.7 KiB
Plaintext
62 lines
1.7 KiB
Plaintext
exportCodeGen.ts(37,22): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
exportCodeGen.ts(49,15): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
|
|
|
|
==== exportCodeGen.ts (2 errors) ====
|
|
// should replace all refs to 'x' in the body,
|
|
// with fully qualified
|
|
namespace A {
|
|
export var x = 12;
|
|
function lt12() {
|
|
return x < 12;
|
|
}
|
|
}
|
|
|
|
// should not fully qualify 'x'
|
|
namespace B {
|
|
var x = 12;
|
|
function lt12() {
|
|
return x < 12;
|
|
}
|
|
}
|
|
|
|
// not copied, since not exported
|
|
namespace C {
|
|
function no() {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
// copies, since exported
|
|
namespace D {
|
|
export function yes() {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// validate all exportable statements
|
|
namespace E {
|
|
export enum Color { Red }
|
|
export function fn() { }
|
|
export interface I { id: number }
|
|
export class C { name: string }
|
|
~~~~
|
|
!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
export namespace M {
|
|
export var x = 42;
|
|
}
|
|
}
|
|
|
|
// validate all exportable statements,
|
|
// which are not exported
|
|
namespace F {
|
|
enum Color { Red }
|
|
function fn() { }
|
|
interface I { id: number }
|
|
class C { name: string }
|
|
~~~~
|
|
!!! error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
|
|
namespace M {
|
|
var x = 42;
|
|
}
|
|
} |