2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts(12,22): error TS1005: '=' expected.
|
|
|
|
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts(12,20): error TS2304: Cannot find name 'C'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/IncompleteMemberVariables/parserErrorRecovery_IncompleteMemberVariable2.ts (2 errors) ====
|
|
|
|
// Interface
|
|
|
|
interface IPoint {
|
|
|
|
getDist(): number;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Module
|
|
|
|
module Shapes {
|
|
|
|
|
|
|
|
// Class
|
|
|
|
export class Point implements IPoint {
|
|
|
|
|
|
|
|
public con:C "hello";
|
|
|
|
~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1005: '=' expected.
|
2014-07-13 01:04:16 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'C'.
|
2014-07-13 01:04:16 +02:00
|
|
|
// 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();
|
|
|
|
|