41 lines
No EOL
1.5 KiB
Text
41 lines
No EOL
1.5 KiB
Text
tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'.
|
|
|
|
|
|
==== tests/cases/compiler/duplicateLocalVariable2.ts (1 errors) ====
|
|
export class TestCase {
|
|
constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) {
|
|
}
|
|
}
|
|
export class TestRunner {
|
|
static arrayCompare(arg1: any[], arg2: any[]): boolean {
|
|
return false;
|
|
}
|
|
|
|
public addTest(test: TestCase) {
|
|
}
|
|
}
|
|
|
|
export var tests: TestRunner = (function () {
|
|
var testRunner = new TestRunner();
|
|
|
|
testRunner.addTest(new TestCase("Check UTF8 encoding",
|
|
function () {
|
|
var fb: any;
|
|
fb.writeUtf8Bom();
|
|
var chars = [0x0054];
|
|
for (var i in chars) {
|
|
fb.writeUtf8CodePoint(chars[i]);
|
|
}
|
|
fb.index = 0;
|
|
var bytes = [];
|
|
for (var i = 0; i < 14; i++) {
|
|
~
|
|
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'any', but here has type 'number'.
|
|
bytes.push(fb.readByte());
|
|
}
|
|
var expected = [0xEF];
|
|
return TestRunner.arrayCompare(bytes, expected);
|
|
}));
|
|
|
|
return testRunner;
|
|
})(); |