mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 12:12:16 +03:00
22 lines
383 B
TypeScript
22 lines
383 B
TypeScript
|
// @noEmit: true
|
||
|
// @allowJs: true
|
||
|
// @checkJs: true
|
||
|
// @noImplicitAny: true
|
||
|
// @strictNullChecks: true
|
||
|
// @Filename: a.js
|
||
|
class Base {
|
||
|
m() {
|
||
|
this.p = 1
|
||
|
}
|
||
|
}
|
||
|
class Derived extends Base {
|
||
|
constructor() {
|
||
|
super();
|
||
|
// should be OK, and p should have type number from this assignment
|
||
|
this.p = 1
|
||
|
}
|
||
|
test() {
|
||
|
return this.p
|
||
|
}
|
||
|
}
|