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

0.6-rc1 where throwing "invalid type paramer" error in macro #22026

Closed
dlfivefifty opened this issue May 22, 2017 · 0 comments · Fixed by #22166
Closed

0.6-rc1 where throwing "invalid type paramer" error in macro #22026

dlfivefifty opened this issue May 22, 2017 · 0 comments · Fixed by #22166
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Comments

@dlfivefifty
Copy link
Contributor

The following code demonstrates a problem with the new where syntax. Reverting to the old syntax of putting type paramers first fixes the issue:

julia> module FooModule
               macro foo(TYP)
                       quote
                               foofunction(x::Type{T}) where {T<:Number} = x
                       end
               end
               
               struct Foo end
               @foo Foo
       end
ERROR: syntax: invalid type parameter name "FooModule.T"

julia> module FooModule2
               macro foo(TYP)
                       quote
                               foofunction{T<:Number}(x::Type{T}) = x
                       end
               end
               
               struct Foo end
               @foo Foo
       end
FooModule2
@yuyichao yuyichao added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label May 22, 2017
@JeffBezanson JeffBezanson self-assigned this May 31, 2017
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label May 31, 2017
JeffBezanson added a commit that referenced this issue May 31, 2017
JeffBezanson added a commit that referenced this issue Jun 1, 2017
JeffBezanson added a commit that referenced this issue Jun 1, 2017
JeffBezanson added a commit that referenced this issue Jun 1, 2017
tkelman pushed a commit that referenced this issue Jun 3, 2017
fixes #22135, fixes #22122, fixes #22026, fixes #21581, fixes #16096, fixes #19351

(cherry picked from commit 60675d2)
ref #22166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants