You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related use case at #12185 (comment) which was about (transiently) empty class template during development. (Where empty template body after colon is allowed with end marker.)
What if the answer here is yes, but it expands to
def f: Unit =
???
end f
corresponding to the intention to fill in the blank later.
I don't think Unit is special here. If only "value discard" covered other singleton types, especially this.type.
def add(x: X): this.type =
end add
would I want a default implementation or NotImplemented? Also it looks like stack trace printing in REPL is broken.
Should the compiler allow the following empty def?
I think logically it should not. end markers an optional addition to a program. The program needs to be syntactically correct even if they are missing.
3.0.0-RC2
Should the compiler allow the following empty
def
?Currently, it fails with an error from the parser.
The text was updated successfully, but these errors were encountered: