80 lines
No EOL
2.6 KiB
Text
80 lines
No EOL
2.6 KiB
Text
==== tests/cases/compiler/varBlock.ts (20 errors) ====
|
|
module m2 {
|
|
|
|
export var a, b2: number = 10, b;
|
|
}
|
|
|
|
declare module m3 {
|
|
var a, b, c;
|
|
var a1, b1 = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
|
|
class C {
|
|
constructor (public c = 10);
|
|
~~~~~~~~~~~~~
|
|
!!! A parameter property is only allowed in a constructor implementation.
|
|
~~~~~~~~~~~~~
|
|
!!! A parameter initializer is only allowed in a function or constructor implementation.
|
|
}
|
|
}
|
|
|
|
declare var b = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
|
|
declare var a2, b2, c2;
|
|
|
|
|
|
|
|
declare var da = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
declare var d3, d4 = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
|
|
module m3 {
|
|
declare var d = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
declare var d2, d3 = 10, d4 = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
export declare var dE = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
export declare var d2E, d3E = 10, d4E = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
}
|
|
|
|
declare module m4 {
|
|
var d = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
var d2, d3 = 10, d4 =10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
export var dE = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
export var d2E, d3E = 10, d4E = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
}
|
|
|
|
declare var c;
|
|
declare var c = 10;
|
|
~
|
|
!!! Initializers are not allowed in ambient contexts.
|
|
~
|
|
!!! Subsequent variable declarations must have the same type. Variable 'c' must be of type 'any', but here has type 'number'. |