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

Expression Int{} should be an error #17943

Closed
eschnett opened this issue Aug 10, 2016 · 4 comments
Closed

Expression Int{} should be an error #17943

eschnett opened this issue Aug 10, 2016 · 4 comments
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@eschnett
Copy link
Contributor

Int is not a type constructor, hence defining additional type parameters doesn't make sense.

@StefanKarpinski
Copy link
Member

One can argue that concrete types as zero-parameter type constructors.

@eschnett
Copy link
Contributor Author

Yes, though that's similar to arguing that scalars are 0d arrays, or that constants are functions that don't take arguments. I don't think it's a good thing. For example, Julia does make a distinction between Tuple and Tuple{}, so the empty curlies are not always a no-op.

I wrote up some thoughts about this a few weeks ago https://eschnett.github.io/julia/2016/06/23/some-thoughts-on-generic-programming-in-julia.

@JeffBezanson
Copy link
Member

I think this can be handled in #8974. It will only be valid to do type application with UnionAll types (plus Tuple and Union as special cases), whereas now the meaning of A{} is fuzzier.

@kshyatt kshyatt added the types and dispatch Types, subtyping and method dispatch label Aug 10, 2016
@JeffBezanson
Copy link
Member

closed by #18457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

4 participants