TypeScript/tests/cases/compiler/interfaceContextualType.ts
2014-07-12 17:30:19 -07:00

22 lines
400 B
TypeScript

//@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 }
};
}
}