34 lines
No EOL
1 KiB
Text
34 lines
No EOL
1 KiB
Text
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts(12,21): error TS1110: Type expected.
|
|
|
|
|
|
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable1.ts (1 errors) ====
|
|
// Interface
|
|
interface IPoint {
|
|
getDist(): number;
|
|
}
|
|
|
|
// Module
|
|
module Shapes {
|
|
|
|
// Class
|
|
export class Point implements IPoint {
|
|
|
|
public con: "hello";
|
|
~~~~~~~
|
|
!!! error TS1110: Type expected.
|
|
// Constructor
|
|
constructor (public x: number, public y: number) { }
|
|
|
|
// Instance member
|
|
getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
|
|
|
|
// Static member
|
|
static origin = new Point(0, 0);
|
|
}
|
|
|
|
}
|
|
|
|
// Local variables
|
|
var p: IPoint = new Shapes.Point(3, 4);
|
|
var dist = p.getDist();
|
|
|