-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for issue #6154 - overriding methods with properties in the deriv…
…ed class (#24343) * Fix to issue 6154 - Overriding a method with a property in the derived class should not cause a compiler error * new baselines * fixed deleted baselines
- Loading branch information
1 parent
9b9ec63
commit 13734e7
Showing
12 changed files
with
101 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
tests/baselines/reference/checkJsFiles_noErrorLocation.errors.txt
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.errors.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//// [propertyOverridingPrototype.ts] | ||
class Base { | ||
foo() { | ||
} | ||
} | ||
|
||
class Derived extends Base { | ||
foo: () => { }; | ||
} | ||
|
||
|
||
|
||
//// [propertyOverridingPrototype.js] | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var Base = /** @class */ (function () { | ||
function Base() { | ||
} | ||
Base.prototype.foo = function () { | ||
}; | ||
return Base; | ||
}()); | ||
var Derived = /** @class */ (function (_super) { | ||
__extends(Derived, _super); | ||
function Derived() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
return Derived; | ||
}(Base)); |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/propertyOverridingPrototype.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
=== tests/cases/compiler/propertyOverridingPrototype.ts === | ||
class Base { | ||
>Base : Symbol(Base, Decl(propertyOverridingPrototype.ts, 0, 0)) | ||
|
||
foo() { | ||
>foo : Symbol(Base.foo, Decl(propertyOverridingPrototype.ts, 0, 12)) | ||
} | ||
} | ||
|
||
class Derived extends Base { | ||
>Derived : Symbol(Derived, Decl(propertyOverridingPrototype.ts, 3, 1)) | ||
>Base : Symbol(Base, Decl(propertyOverridingPrototype.ts, 0, 0)) | ||
|
||
foo: () => { }; | ||
>foo : Symbol(Derived.foo, Decl(propertyOverridingPrototype.ts, 5, 28)) | ||
} | ||
|
||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/propertyOverridingPrototype.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
=== tests/cases/compiler/propertyOverridingPrototype.ts === | ||
class Base { | ||
>Base : Base | ||
|
||
foo() { | ||
>foo : () => void | ||
} | ||
} | ||
|
||
class Derived extends Base { | ||
>Derived : Derived | ||
>Base : Base | ||
|
||
foo: () => { }; | ||
>foo : () => {} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class Base { | ||
foo() { | ||
} | ||
} | ||
|
||
class Derived extends Base { | ||
foo: () => { }; | ||
} | ||
|