Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse empty list of type arguments #714

Open
phischu opened this issue Nov 25, 2024 · 1 comment
Open

Parse empty list of type arguments #714

phischu opened this issue Nov 25, 2024 · 1 comment
Labels
feature New feature or request

Comments

@phischu
Copy link
Collaborator

phischu commented Nov 25, 2024

The following program does not parse with the error "expected identifier"

def f() = 42

def main(): Unit = {
  println(f[]())
}

I would like to be able to write an empty list of type arguments to disambiguate overloads. Indeed, writing no type argument list should mean "inferred", which is different from "annotated as empty list".

On the definition site this is not necessary, since omitting the list of type parameters means "empty list" unambiguously.

@phischu phischu added the feature New feature or request label Nov 25, 2024
@jiribenes
Copy link
Contributor

jiribenes commented Nov 25, 2024

I agree with the underlying premise: it would be nice to be able to specify "I want the version with no type params" to the overload resolution.

I don't really care which syntax we use as long as there is at least some way to specify this behaviour...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants