Fix tests

This commit is contained in:
Anders Hejlsberg 2016-01-24 13:44:22 -08:00
parent 49dd54e91a
commit ea4e3afd98
4 changed files with 10 additions and 10 deletions

View File

@ -5,6 +5,6 @@ enum E {
b = 1
}
var x = E;
var x: { a: E; b: E;[x: number]: string; }; // Shouldnt error
var x: { readonly a: E; readonly b: E; readonly [x: number]: string; }; // Shouldnt error
var y = E;
var y: { a: E; b: E;[x: number]: string;[x: number]: string } // two errors: the types are not identical and duplicate signatures
var y: { readonly a: E; readonly b: E; readonly [x: number]: string; readonly [x: number]: string } // two errors: the types are not identical and duplicate signatures

View File

@ -11,10 +11,10 @@ var x: number = E1.A;
// Enum object type is anonymous with properties of the enum type and numeric indexer
var e = E1;
var e: {
A: E1;
B: E1;
C: E1;
[n: number]: string;
readonly A: E1;
readonly B: E1;
readonly C: E1;
readonly [n: number]: string;
};
var e: typeof E1;

View File

@ -16,11 +16,11 @@ var callSig3: { num: (n: number) => string; };
// Get accessor only, type of the property is the annotated return type of the get accessor
var getter1 = { get x(): string { return undefined; } };
var getter1: { x: string; }
var getter1: { readonly x: string; }
// Get accessor only, type of the property is the inferred return type of the get accessor
var getter2 = { get x() { return ''; } };
var getter2: { x: string; }
var getter2: { readonly x: string; }
// Set accessor only, type of the property is the param type of the set accessor
var setter1 = { set x(n: number) { } };

View File

@ -9,7 +9,7 @@
////var /*2*/x = point./*3*/x;
goTo.marker('1');
verify.quickInfoIs("function makePoint(x: number): {\n x: number;\n}", undefined);
verify.quickInfoIs("function makePoint(x: number): {\n readonly x: number;\n}", undefined);
goTo.marker('2');
verify.quickInfoIs("var x: number", undefined);
@ -18,4 +18,4 @@ goTo.marker('3');
verify.memberListContains("x", "(property) x: number", undefined);
goTo.marker('4');
verify.quickInfoIs("var point: {\n x: number;\n}", undefined);
verify.quickInfoIs("var point: {\n readonly x: number;\n}", undefined);