We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following two macros for defining parametric concrete or abstract types:
macro m1() quote abstract type A{S<:Real, V<:AbstractVector{S}} end end end macro m2() quote struct A{S<:Real, V<:AbstractVector{S}} end end end
While they are very similar, their behavior appears to be inconsistent:
@macroexpand @m1
quote #= REPL[17]:3 =# abstract type (Main.A){Main.S <: Main.Real, Main.V <: (Main.AbstractVector){Main.S}} end end
@macroexpand @m2
quote #= REPL[18]:3 =# struct A{#1#S <: Main.Real, #2#V <: (Main.AbstractVector){#1#S}} #= REPL[18]:3 =# end end
Below the versioinfo which is 0.7, but @mauro3 (who wrote the above minimal example) reproduced this on 1.0 as well.
versioinfo
Julia Version 0.7.0 Commit a4cb80f (2018-08-08 06:46 UTC) Platform Info: OS: macOS (x86_64-apple-darwin14.5.0) CPU: Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)
The text was updated successfully, but these errors were encountered:
fix #28593, macro hygiene problems in type definitions
fdda092
cd850de
fix #28593, macro hygiene problems in type definitions (#28706)
0caae7c
(cherry picked from commit cd850de)
9df6e8b
1180fef
58f6dac
78435fe
JeffBezanson
No branches or pull requests
Consider the following two macros for defining parametric concrete or abstract types:
While they are very similar, their behavior appears to be inconsistent:
Below the
versioinfo
which is 0.7, but @mauro3 (who wrote the above minimal example) reproduced this on 1.0 as well.The text was updated successfully, but these errors were encountered: