Closed
Description
The following file is ok in tsc and bad in tsgo
declare global {
interface SymbolConstructor {
readonly observable: symbol;
}
}
type X = {
[Symbol.observable](): any;
};
export {};
tsgo gives the following error:
test2.ts:8:3 - error TS1170: A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.
8 [Symbol.observable](): any;
~~~~~~~~~~~~~~~~~~~