mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
//// [tests/cases/compiler/declarationEmitReadonlyComputedProperty.ts] ////
|
|
|
|
=== bug.ts ===
|
|
export const SYMBOL = Symbol()
|
|
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
|
|
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
|
|
|
|
export interface Interface {
|
|
>Interface : Symbol(Interface, Decl(bug.ts, 0, 30))
|
|
|
|
readonly [SYMBOL]: string; // remove readonly and @showEmit to see the expected error
|
|
>[SYMBOL] : Symbol(Interface[SYMBOL], Decl(bug.ts, 2, 28))
|
|
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
|
|
}
|
|
|
|
export function createInstance(): Interface {
|
|
>createInstance : Symbol(createInstance, Decl(bug.ts, 4, 1))
|
|
>Interface : Symbol(Interface, Decl(bug.ts, 0, 30))
|
|
|
|
return {
|
|
[SYMBOL]: ''
|
|
>[SYMBOL] : Symbol([SYMBOL], Decl(bug.ts, 7, 10))
|
|
>SYMBOL : Symbol(SYMBOL, Decl(bug.ts, 0, 12))
|
|
}
|
|
}
|
|
|
|
=== index.ts ===
|
|
import { createInstance } from './bug'
|
|
>createInstance : Symbol(createInstance, Decl(index.ts, 0, 8))
|
|
|
|
export const spread = {
|
|
>spread : Symbol(spread, Decl(index.ts, 2, 12))
|
|
|
|
...createInstance(),
|
|
>createInstance : Symbol(createInstance, Decl(index.ts, 0, 8))
|
|
}
|