mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add test for quoted constructors
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
class C {
|
||||
x: number;
|
||||
"constructor"() {
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
(new C).constructor(); // Error
|
||||
|
||||
class D {
|
||||
x: number;
|
||||
'constructor'() {
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
(new C).constructor(); // Error
|
||||
|
||||
class E {
|
||||
x: number;
|
||||
['constructor']() {
|
||||
this.x = 0;
|
||||
}
|
||||
}
|
||||
(new E).constructor();
|
||||
Reference in New Issue
Block a user