-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Using Julia 1.12.1 and current JuliaC fc318f0, the following example fails with trimming when parsing version numbers:
module AppProject
function @main(ARGS)
vs = VersionNumber("1.2.3")
println(Core.stdout, "version number ",vs == vs)
return 0
end
endAppProject is based on the example. It is compiled with:
cd test/AppProject
rm -Rf build/;
juliac --output-exe app_test_exe --bundle build --trim=safe --experimental .
The full error message is:
Verifier error #1: unresolved call from statement Core._apply_iterate(Base.iterate, Base.tuple, %new()::Vector{Union{UInt64, String}})::Tuple{Vararg{Union{UInt64, String}}}
Stacktrace:
[1] split_idents(s::SubString{String})
@ Base version.jl:126 [inlined]
[2] tryparse(::Type{VersionNumber}, v::String)
@ Base version.jl:140
[3] parse(::Type{VersionNumber}, v::String)
@ Base version.jl:146 [inlined]
[4] VersionNumber(v::String)
@ Base version.jl:151 [inlined]
[5] main(ARGS::Vector{String})
@ AppProject ~/src/JuliaC.jl/test/AppProject/src/AppProject.jl:6
[6] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/dev/JuliaC/src/scripts/juliac-buildscript.jl:73
Verifier error #2: unresolved call from statement Core._apply_iterate(Base.iterate, Base.tuple, %new()::Vector{Union{UInt64, String}})::Tuple{Vararg{Union{UInt64, String}}}
Stacktrace:
[1] split_idents(s::SubString{String})
@ Base version.jl:126 [inlined]
[2] tryparse(::Type{VersionNumber}, v::String)
@ Base version.jl:141
[3] parse(::Type{VersionNumber}, v::String)
@ Base version.jl:146 [inlined]
[4] VersionNumber(v::String)
@ Base version.jl:151 [inlined]
[5] main(ARGS::Vector{String})
@ AppProject ~/src/JuliaC.jl/test/AppProject/src/AppProject.jl:6
[6] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/dev/JuliaC/src/scripts/juliac-buildscript.jl:73
Verifier error #3: unresolved call from statement Core._apply_iterate(Base.iterate, Base.tuple, %new()::Vector{Union{UInt64, String}})::Tuple{Vararg{Union{UInt64, String}}}
Stacktrace:
[1] split_idents(s::SubString{String})
@ Base version.jl:126 [inlined]
[2] tryparse(::Type{VersionNumber}, v::String)
@ Base version.jl:140
[3] parse(::Type{VersionNumber}, v::String)
@ Base version.jl:146 [inlined]
[4] VersionNumber(v::String)
@ Base version.jl:151 [inlined]
[5] main(ARGS::Vector{String})
@ AppProject ~/src/JuliaC.jl/test/AppProject/src/AppProject.jl:6
[6] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/dev/JuliaC/src/scripts/juliac-buildscript.jl:73
Verifier error #4: unresolved call from statement Core._apply_iterate(Base.iterate, Base.tuple, %new()::Vector{Union{UInt64, String}})::Tuple{Vararg{Union{UInt64, String}}}
Stacktrace:
[1] split_idents(s::SubString{String})
@ Base version.jl:126 [inlined]
[2] tryparse(::Type{VersionNumber}, v::String)
@ Base version.jl:141
[3] parse(::Type{VersionNumber}, v::String)
@ Base version.jl:146 [inlined]
[4] VersionNumber(v::String)
@ Base version.jl:151 [inlined]
[5] main(ARGS::Vector{String})
@ AppProject ~/src/JuliaC.jl/test/AppProject/src/AppProject.jl:6
[6] _main(argc::Int32, argv::Ptr{Ptr{Int8}})
@ Main ~/.julia/dev/JuliaC/src/scripts/juliac-buildscript.jl:73
The compiler fails at this function:
If I remove trimming, this example code works. Any ideas what could be done to address this?
Here is also a reproducer simplifying the function split_idents:
module AppProject
function split_idents(s::AbstractString)
idents = eachsplit(s, '.')
pidents = UInt64[parse(UInt64, ident) for ident in idents]
return tuple(pidents...) # <- error
end
function @main(ARGS)
split_idents("1.2.3")
return 0
end
endIt appears to be related to the splatting.
Thank you for your great efforts in building JuliaC!
Metadata
Metadata
Assignees
Labels
No labels