59 lines
799 B
Plaintext
59 lines
799 B
Plaintext
=== tests/cases/compiler/deleteReadonly.ts ===
|
|
interface A {
|
|
>A : A
|
|
|
|
readonly b
|
|
>b : any
|
|
}
|
|
var a: A = {
|
|
>a : A
|
|
>A : A
|
|
>{ b: 123} : { b: number; }
|
|
|
|
b: 123
|
|
>b : number
|
|
>123 : 123
|
|
|
|
};
|
|
|
|
delete a.b;
|
|
>delete a.b : boolean
|
|
>a.b : any
|
|
>a : A
|
|
>b : any
|
|
|
|
interface B {
|
|
>B : B
|
|
|
|
readonly [k: string]: string
|
|
>k : string
|
|
}
|
|
|
|
var b: B = {
|
|
>b : B
|
|
>B : B
|
|
>{ 'test': 'test'} : { 'test': string; }
|
|
|
|
'test': 'test'
|
|
>'test' : string
|
|
>'test' : "test"
|
|
|
|
};
|
|
|
|
delete b['test'];
|
|
>delete b['test'] : boolean
|
|
>b['test'] : string
|
|
>b : B
|
|
>'test' : "test"
|
|
|
|
delete ((((b['test']))));
|
|
>delete ((((b['test'])))) : boolean
|
|
>((((b['test'])))) : string
|
|
>(((b['test']))) : string
|
|
>((b['test'])) : string
|
|
>(b['test']) : string
|
|
>b['test'] : string
|
|
>b : B
|
|
>'test' : "test"
|
|
|