mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-25 05:29:07 -05: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