13f319b6ec
Simplify parser and avoid the need to pass around 'inNewExpression' information. Make error span smaller for "new Foo[]" errors.
33 lines
875 B
Plaintext
33 lines
875 B
Plaintext
tests/cases/compiler/objectLitArrayDeclNoNew.ts(27,1): error TS1128: Declaration or statement expected.
|
|
|
|
|
|
==== tests/cases/compiler/objectLitArrayDeclNoNew.ts (1 errors) ====
|
|
declare var console;
|
|
"use strict";
|
|
module Test {
|
|
export interface IState {
|
|
}
|
|
|
|
export interface IToken {
|
|
}
|
|
|
|
export interface ILineTokens {
|
|
tokens: IToken[];
|
|
endState: IState;
|
|
}
|
|
|
|
export class Gar {
|
|
public moo: number = 0;
|
|
}
|
|
|
|
export function bug(): ILineTokens {
|
|
var state:IState= null;
|
|
return {
|
|
tokens: Gar[],//IToken[], // Missing new. Correct syntax is: tokens: new IToken[]
|
|
endState: state
|
|
};
|
|
}
|
|
}
|
|
}
|
|
~
|
|
!!! error TS1128: Declaration or statement expected. |