TypeScript/tests/cases/compiler/interfaceContextualType.ts

22 lines
400 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//@module: commonjs
export interface IOptions {
italic?: boolean;
bold?: boolean;
}
export interface IMap {
[s: string]: IOptions;
}
class Bug {
public values: IMap;
ok() {
this.values = {};
this.values['comments'] = { italic: true };
}
shouldBeOK() {
this.values = {
comments: { italic: true }
};
}
}