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

+(x::T,y::T) where {T} not parsing correctly #21440

Closed
musm opened this issue Apr 19, 2017 · 3 comments
Closed

+(x::T,y::T) where {T} not parsing correctly #21440

musm opened this issue Apr 19, 2017 · 3 comments
Assignees
Labels
kind:bug Indicates an unexpected problem or unintended behavior parser Language parsing and surface syntax
Milestone

Comments

@musm
Copy link
Contributor

musm commented Apr 19, 2017

Not sure if this is expected or not but the following declaration does not parse
+(x::T,y::T) where {T} = #

whereas this correctly does
+{T}(x::T,y::T) = #

I know it works if you use parenthesis, but there seems to be an inconsistency when there is no parens.

@TotalVerb
Copy link
Contributor

The version without parentheses should in my opinion be disallowed. +(1, 2) still looks like a unary operator applied to a tuple.

@StefanKarpinski StefanKarpinski added parser Language parsing and surface syntax kind:bug Indicates an unexpected problem or unintended behavior labels Apr 19, 2017
@StefanKarpinski StefanKarpinski added this to the 0.6.x milestone Apr 19, 2017
@ftxi
Copy link

ftxi commented Apr 20, 2017

(+)(1, 2) or (+(1, 2)) still looks like an unary operator applied to a tuple, though.

@TotalVerb
Copy link
Contributor

(+(1, 2)) does, but (+)(1, 2) is fine.

@JeffBezanson JeffBezanson self-assigned this Apr 20, 2017
JeffBezanson added a commit that referenced this issue Apr 21, 2017
fix #21440, parsing `+(x::T,y::T) where {T}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

5 participants