Open xieyuheng opened 2 years ago
Solution 1:
Do not support nullary class application.
Because from the following example, we see that,
new ABC()
is only useful when all properties are fulfilled.
class ABC {
a: String = "a"
b: String = "b"
c: String = "c"
}
check new ABC(): ABC
But in this case, we can simply use object:
let abc = {
a: "a",
b: "b",
c: "c",
}
Problem:
In js/ts there are
new User()
andnew User
.How should we handle nullary applications?