|
| 1 | +=== tests/cases/conformance/classes/propertyMemberDeclarations/assignParameterPropertyToPropertyDeclarationES2022.ts === |
| 2 | +class C { |
| 3 | +>C : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 4 | + |
| 5 | + qux = this.bar // should error |
| 6 | +>qux : Symbol(C.qux, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 9)) |
| 7 | +>this.bar : Symbol(C.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 1, 18)) |
| 8 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 9 | +>bar : Symbol(C.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 1, 18)) |
| 10 | + |
| 11 | + bar = this.foo // should error |
| 12 | +>bar : Symbol(C.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 1, 18)) |
| 13 | +>this.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 14 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 15 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 16 | + |
| 17 | + quiz = this.bar // ok |
| 18 | +>quiz : Symbol(C.quiz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 2, 18)) |
| 19 | +>this.bar : Symbol(C.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 1, 18)) |
| 20 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 21 | +>bar : Symbol(C.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 1, 18)) |
| 22 | + |
| 23 | + quench = this.m1() // ok |
| 24 | +>quench : Symbol(C.quench, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 3, 19)) |
| 25 | +>this.m1 : Symbol(C.m1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 5, 22)) |
| 26 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 27 | +>m1 : Symbol(C.m1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 5, 22)) |
| 28 | + |
| 29 | + quanch = this.m3() // should error |
| 30 | +>quanch : Symbol(C.quanch, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 4, 22)) |
| 31 | +>this.m3 : Symbol(C.m3, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 8, 5)) |
| 32 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 33 | +>m3 : Symbol(C.m3, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 8, 5)) |
| 34 | + |
| 35 | + m1() { |
| 36 | +>m1 : Symbol(C.m1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 5, 22)) |
| 37 | + |
| 38 | + this.foo // ok |
| 39 | +>this.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 40 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 41 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 42 | + } |
| 43 | + m3 = function() { } |
| 44 | +>m3 : Symbol(C.m3, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 8, 5)) |
| 45 | + |
| 46 | + constructor(public foo: string) {} |
| 47 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 48 | + |
| 49 | + quim = this.baz // should error |
| 50 | +>quim : Symbol(C.quim, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 38)) |
| 51 | +>this.baz : Symbol(C.baz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 11, 19)) |
| 52 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 53 | +>baz : Symbol(C.baz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 11, 19)) |
| 54 | + |
| 55 | + baz = this.foo; // should error |
| 56 | +>baz : Symbol(C.baz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 11, 19)) |
| 57 | +>this.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 58 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 59 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 60 | + |
| 61 | + quid = this.baz // ok |
| 62 | +>quid : Symbol(C.quid, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 12, 19)) |
| 63 | +>this.baz : Symbol(C.baz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 11, 19)) |
| 64 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 65 | +>baz : Symbol(C.baz, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 11, 19)) |
| 66 | + |
| 67 | + m2() { |
| 68 | +>m2 : Symbol(C.m2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 13, 19)) |
| 69 | + |
| 70 | + this.foo // ok |
| 71 | +>this.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 72 | +>this : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 73 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 74 | + } |
| 75 | +} |
| 76 | + |
| 77 | +class D extends C { |
| 78 | +>D : Symbol(D, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 17, 1)) |
| 79 | +>C : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 80 | + |
| 81 | + quill = this.foo // ok |
| 82 | +>quill : Symbol(D.quill, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 19, 19)) |
| 83 | +>this.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 84 | +>this : Symbol(D, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 17, 1)) |
| 85 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 86 | +} |
| 87 | + |
| 88 | +class E { |
| 89 | +>E : Symbol(E, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 21, 1)) |
| 90 | + |
| 91 | + bar = () => this.foo1 + this.foo2; // both ok |
| 92 | +>bar : Symbol(E.bar, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 23, 9)) |
| 93 | +>this.foo1 : Symbol(E.foo1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 24, 38)) |
| 94 | +>this : Symbol(E, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 21, 1)) |
| 95 | +>foo1 : Symbol(E.foo1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 24, 38)) |
| 96 | +>this.foo2 : Symbol(E.foo2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 26, 16)) |
| 97 | +>this : Symbol(E, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 21, 1)) |
| 98 | +>foo2 : Symbol(E.foo2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 26, 16)) |
| 99 | + |
| 100 | + foo1 = ''; |
| 101 | +>foo1 : Symbol(E.foo1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 24, 38)) |
| 102 | + |
| 103 | + constructor(public foo2: string) {} |
| 104 | +>foo2 : Symbol(E.foo2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 26, 16)) |
| 105 | +} |
| 106 | + |
| 107 | +class F { |
| 108 | +>F : Symbol(F, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 27, 1)) |
| 109 | + |
| 110 | + Inner = class extends F { |
| 111 | +>Inner : Symbol(F.Inner, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 29, 9)) |
| 112 | +>F : Symbol(F, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 27, 1)) |
| 113 | + |
| 114 | + p2 = this.p1 |
| 115 | +>p2 : Symbol((Anonymous class).p2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 30, 29)) |
| 116 | +>this.p1 : Symbol(F.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 32, 5)) |
| 117 | +>this : Symbol((Anonymous class), Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 30, 11)) |
| 118 | +>p1 : Symbol(F.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 32, 5)) |
| 119 | + } |
| 120 | + p1 = 0 |
| 121 | +>p1 : Symbol(F.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 32, 5)) |
| 122 | +} |
| 123 | +class G { |
| 124 | +>G : Symbol(G, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 34, 1)) |
| 125 | + |
| 126 | + Inner = class extends G { |
| 127 | +>Inner : Symbol(G.Inner, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 35, 9)) |
| 128 | +>G : Symbol(G, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 34, 1)) |
| 129 | + |
| 130 | + p2 = this.p1 |
| 131 | +>p2 : Symbol((Anonymous class).p2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 36, 29)) |
| 132 | +>this.p1 : Symbol(G.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 39, 16)) |
| 133 | +>this : Symbol((Anonymous class), Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 36, 11)) |
| 134 | +>p1 : Symbol(G.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 39, 16)) |
| 135 | + } |
| 136 | + constructor(public p1: number) {} |
| 137 | +>p1 : Symbol(G.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 39, 16)) |
| 138 | +} |
| 139 | +class H { |
| 140 | +>H : Symbol(H, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 40, 1)) |
| 141 | + |
| 142 | + constructor(public p1: C) {} |
| 143 | +>p1 : Symbol(H.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 16)) |
| 144 | +>C : Symbol(C, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 0, 0)) |
| 145 | + |
| 146 | + public p2 = () => { |
| 147 | +>p2 : Symbol(H.p2, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 32)) |
| 148 | + |
| 149 | + return this.p1.foo; |
| 150 | +>this.p1.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 151 | +>this.p1 : Symbol(H.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 16)) |
| 152 | +>this : Symbol(H, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 40, 1)) |
| 153 | +>p1 : Symbol(H.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 16)) |
| 154 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 155 | + } |
| 156 | + |
| 157 | + public p3 = () => this.p1.foo; |
| 158 | +>p3 : Symbol(H.p3, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 46, 5)) |
| 159 | +>this.p1.foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 160 | +>this.p1 : Symbol(H.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 16)) |
| 161 | +>this : Symbol(H, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 40, 1)) |
| 162 | +>p1 : Symbol(H.p1, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 42, 16)) |
| 163 | +>foo : Symbol(C.foo, Decl(assignParameterPropertyToPropertyDeclarationES2022.ts, 10, 16)) |
| 164 | +} |
| 165 | + |
0 commit comments