Explicit Name For Default Constructor #1477
Labels
feature
Proposed language feature that solves one or more problems
state-duplicate
This issue or pull request already exists
There is this ambiguity between types and default constructors, so
[Foo(a)]
is interpreted as 'call the default constructor ofFoo
with argumenta
' but[a].map(Foo)
gives an error becauseFoo
is interpreted as type, so we have to type[a].map((x)=>Foo(x))
. It would be cool to have a way to explicitly call the default constructor, like[a].map(Foo.Foo)
or[a].map(Foo.constructor)
.The text was updated successfully, but these errors were encountered: