You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following artificial example of a struct A{##363} with ##363 a symbol generated by gensym and further a function call to some function foo with argument A or equivalently A{##363} where ##363.
macroadd_parametric_type(expr)
push!(expr.args[2].args, gensym())
esc(expr)
end@add_parametric_typestruct A{} endfoo(::T) where T =1foo(A)
Now executing julia with the --trace-compile option results in the following (invalid) trace file:
precompile(Tuple{getfield(Main, Symbol("#@foo")), LineNumberNode, Module, Expr})
precompile(Tuple{typeof(Main.foo), Type{Main.A{363} where 363}})
Apparently julia just stripes away the ## and outputs the number assigned to the generated symbol which is obviously not correct.
I would be willing to fix this myself, but I'm not sure how to handle this correctly. The generated symbol can not be used directly since the resulting code would be invalid just as well and replacing it by a different "regular" symbol, e.g. A{##363} where ##363 by A{B} where B, is problematic since B might collide with other parameters in general.
Context:
I'm trying to use PackageCompiler to statically compile one of my packages which relies on some macros that append type parameters named via gensym.
Versioninfo:
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_PARDISO = /usr/local/lib/pardiso/
The text was updated successfully, but these errors were encountered:
Consider the following artificial example of a struct
A{##363}
with##363
a symbol generated bygensym
and further a function call to some functionfoo
with argumentA
or equivalentlyA{##363} where ##363
.Now executing julia with the
--trace-compile
option results in the following (invalid) trace file:Apparently julia just stripes away the
##
and outputs the number assigned to the generated symbol which is obviously not correct.I would be willing to fix this myself, but I'm not sure how to handle this correctly. The generated symbol can not be used directly since the resulting code would be invalid just as well and replacing it by a different "regular" symbol, e.g.
A{##363} where ##363
byA{B} where B
, is problematic sinceB
might collide with other parameters in general.Context:
I'm trying to use
PackageCompiler
to statically compile one of my packages which relies on some macros that append type parameters named viagensym
.Versioninfo:
The text was updated successfully, but these errors were encountered: