Skip to content

Commit 5f6af5a

Browse files
committed
Accept new baselines
1 parent 339a3d7 commit 5f6af5a

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
checkInheritedProperty.ts(7,14): error TS2729: Property 'b' is used before its initialization.
2+
3+
4+
==== checkInheritedProperty.ts (1 errors) ====
5+
class Base {
6+
}
7+
8+
declare const BaseFactory: new() => Base & { c: string }
9+
10+
class Derived extends BaseFactory {
11+
a = this.b
12+
~
13+
!!! error TS2729: Property 'b' is used before its initialization.
14+
!!! related TS2728 checkInheritedProperty.ts:8:5: 'b' is declared here.
15+
b = "abc"
16+
}
17+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [tests/cases/compiler/checkInheritedProperty.ts] ////
2+
3+
=== checkInheritedProperty.ts ===
4+
class Base {
5+
>Base : Symbol(Base, Decl(checkInheritedProperty.ts, 0, 0))
6+
}
7+
8+
declare const BaseFactory: new() => Base & { c: string }
9+
>BaseFactory : Symbol(BaseFactory, Decl(checkInheritedProperty.ts, 3, 13))
10+
>Base : Symbol(Base, Decl(checkInheritedProperty.ts, 0, 0))
11+
>c : Symbol(c, Decl(checkInheritedProperty.ts, 3, 44))
12+
13+
class Derived extends BaseFactory {
14+
>Derived : Symbol(Derived, Decl(checkInheritedProperty.ts, 3, 56))
15+
>BaseFactory : Symbol(BaseFactory, Decl(checkInheritedProperty.ts, 3, 13))
16+
17+
a = this.b
18+
>a : Symbol(Derived.a, Decl(checkInheritedProperty.ts, 5, 35))
19+
>this.b : Symbol(Derived.b, Decl(checkInheritedProperty.ts, 6, 14))
20+
>this : Symbol(Derived, Decl(checkInheritedProperty.ts, 3, 56))
21+
>b : Symbol(Derived.b, Decl(checkInheritedProperty.ts, 6, 14))
22+
23+
b = "abc"
24+
>b : Symbol(Derived.b, Decl(checkInheritedProperty.ts, 6, 14))
25+
}
26+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//// [tests/cases/compiler/checkInheritedProperty.ts] ////
2+
3+
=== checkInheritedProperty.ts ===
4+
class Base {
5+
>Base : Base
6+
> : ^^^^
7+
}
8+
9+
declare const BaseFactory: new() => Base & { c: string }
10+
>BaseFactory : new () => Base & { c: string; }
11+
> : ^^^^^^^^^^
12+
>c : string
13+
> : ^^^^^^
14+
15+
class Derived extends BaseFactory {
16+
>Derived : Derived
17+
> : ^^^^^^^
18+
>BaseFactory : Base & { c: string; }
19+
> : ^^^^^^^^^^^^ ^^^
20+
21+
a = this.b
22+
>a : string
23+
> : ^^^^^^
24+
>this.b : string
25+
> : ^^^^^^
26+
>this : this
27+
> : ^^^^
28+
>b : string
29+
> : ^^^^^^
30+
31+
b = "abc"
32+
>b : string
33+
> : ^^^^^^
34+
>"abc" : "abc"
35+
> : ^^^^^
36+
}
37+

0 commit comments

Comments
 (0)