Skip to content

Commit b2965f8

Browse files
committed
WIP
1 parent e487686 commit b2965f8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

working/4200-metaobjects/feature-specification.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,17 @@ the same member access where the receiver is parenthesized (`(X).foo()`).
489489
*This implies that the member access is treated as a member access on the
490490
result of evaluating the type literal as an expression.*
491491

492+
A term of the form `X.new` where `X` is a type variable whose static type
493+
includes a member signature which is a method with the name `call` is
494+
treated as `X.call`.
495+
496+
*This implies that tear-offs and invocations of forwarders to constructors
497+
can be expressed using the same syntax as statically resolved tear-offs and
498+
invocations, e.g., `X.new` and `X.new(42)`. Note that these forms may also
499+
invoke or tear off a method named `call` in situations where this method
500+
does not forward the tear-off or invocation to a constructor. For example,
501+
it could forward to a static method named `call` for some values of `X`.*
502+
492503
Consider a member access whose receiver is a possibly qualified identifier
493504
that denotes a class, mixin, mixin class, or enum declaration _D_ (e.g.,
494505
`C.foo()` or `prefix.C.foo()`). If the accessed member is not declared as a

0 commit comments

Comments
 (0)