1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
=== tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts ===
interface Base {
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
readonly value: number;
>value : Symbol(Base.value, Decl(intersectionTypeReadonly.ts, 0, 16))
}
interface Identical {
>Identical : Symbol(Identical, Decl(intersectionTypeReadonly.ts, 2, 1))
readonly value: number;
>value : Symbol(Identical.value, Decl(intersectionTypeReadonly.ts, 3, 21))
}
interface Mutable {
>Mutable : Symbol(Mutable, Decl(intersectionTypeReadonly.ts, 5, 1))
value: number;
>value : Symbol(Mutable.value, Decl(intersectionTypeReadonly.ts, 6, 19))
}
interface DifferentType {
>DifferentType : Symbol(DifferentType, Decl(intersectionTypeReadonly.ts, 8, 1))
readonly value: string;
>value : Symbol(DifferentType.value, Decl(intersectionTypeReadonly.ts, 9, 25))
}
interface DifferentName {
>DifferentName : Symbol(DifferentName, Decl(intersectionTypeReadonly.ts, 11, 1))
readonly other: number;
>other : Symbol(DifferentName.other, Decl(intersectionTypeReadonly.ts, 12, 25))
}
let base: Base;
>base : Symbol(base, Decl(intersectionTypeReadonly.ts, 15, 3))
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
base.value = 12 // error, lhs can't be a readonly property
>base.value : Symbol(Base.value, Decl(intersectionTypeReadonly.ts, 0, 16))
>base : Symbol(base, Decl(intersectionTypeReadonly.ts, 15, 3))
>value : Symbol(Base.value, Decl(intersectionTypeReadonly.ts, 0, 16))
let identical: Base & Identical;
>identical : Symbol(identical, Decl(intersectionTypeReadonly.ts, 17, 3))
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
>Identical : Symbol(Identical, Decl(intersectionTypeReadonly.ts, 2, 1))
identical.value = 12; // error, lhs can't be a readonly property
>identical.value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 3, 21))
>identical : Symbol(identical, Decl(intersectionTypeReadonly.ts, 17, 3))
>value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 3, 21))
let mutable: Base & Mutable;
>mutable : Symbol(mutable, Decl(intersectionTypeReadonly.ts, 19, 3))
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
>Mutable : Symbol(Mutable, Decl(intersectionTypeReadonly.ts, 5, 1))
mutable.value = 12; // error, lhs can't be a readonly property
>mutable.value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 6, 19))
>mutable : Symbol(mutable, Decl(intersectionTypeReadonly.ts, 19, 3))
>value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 6, 19))
let differentType: Base & DifferentType;
>differentType : Symbol(differentType, Decl(intersectionTypeReadonly.ts, 21, 3))
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
>DifferentType : Symbol(DifferentType, Decl(intersectionTypeReadonly.ts, 8, 1))
differentType.value = 12; // error, lhs can't be a readonly property
>differentType.value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 9, 25))
>differentType : Symbol(differentType, Decl(intersectionTypeReadonly.ts, 21, 3))
>value : Symbol(value, Decl(intersectionTypeReadonly.ts, 0, 16), Decl(intersectionTypeReadonly.ts, 9, 25))
let differentName: Base & DifferentName;
>differentName : Symbol(differentName, Decl(intersectionTypeReadonly.ts, 23, 3))
>Base : Symbol(Base, Decl(intersectionTypeReadonly.ts, 0, 0))
>DifferentName : Symbol(DifferentName, Decl(intersectionTypeReadonly.ts, 11, 1))
differentName.value = 12; // error, property 'value' doesn't exist
>differentName.value : Symbol(Base.value, Decl(intersectionTypeReadonly.ts, 0, 16))
>differentName : Symbol(differentName, Decl(intersectionTypeReadonly.ts, 23, 3))
>value : Symbol(Base.value, Decl(intersectionTypeReadonly.ts, 0, 16))
|