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
Very similar to #21243. Distilled from RigidBodyDynamics.jl:
type SpanningTree{V, E}
end
immutable TreePath{V, E}
source::V
source_to_lca::Vector{E}endfunctionpath{V, E}(src::V, target::V, tree::SpanningTree{V, E})
TreePath(src, E[])
end
type RigidBody{T<:Number}
end
type Joint{T<:Number}
endnum_velocities(itr) =error("bad")
num_velocities{T}(p::TreePath{RigidBody{T}, Joint{T}}) =0
type Mechanism{T<:Number}
bodies::Vector{RigidBody{T}}
tree::SpanningTree{RigidBody{T}, Joint{T}}function (::Type{Mechanism{T}}){T<:Number}(rootBody::RigidBody{T}; bla =0)
tree =SpanningTree{RigidBody{T}, Joint{T}}()
new{T}([rootBody], tree)
endendMechanism{T}(rootBody::RigidBody{T}; kwargs...) =Mechanism{T}(rootBody; kwargs...)
bodies(mechanism::Mechanism) = mechanism.bodies
path(mechanism::Mechanism, from::RigidBody, to::RigidBody) =path(from, to, mechanism.tree)
functionfoo()
mechanism =Mechanism(RigidBody{Float64}())
b =first(bodies(mechanism))
p =path(mechanism, b, b)
nvpath =num_velocities(p)
endfoo()
With --inline=no, this results in
signal (4): Illegal instruction: 4
while loading /Users/twan/code/julia/RigidBodyDynamics/v0.6/RigidBodyDynamics/perf/runbenchmarks.jl, in expression starting on line 43
foo at /Users/twan/code/julia/RigidBodyDynamics/v0.6/RigidBodyDynamics/perf/runbenchmarks.jl:40
unknown function (ip: 0x3151a23ff)
do_call at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:75
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:242
jl_interpret_toplevel_expr at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:34
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:577
jl_parse_eval_all at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/ast.c:873
jl_load at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:616 [inlined]
jl_load_ at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:623
include_from_node1 at ./loading.jl:539
jlcall_include_from_node1_18834 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
include at ./sysimg.jl:14
jlcall_include_1043 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
process_options at ./client.jl:305
_start at ./client.jl:371
jlcall__start_19032 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
true_main at /Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia (unknown line)
main at /Applications/Julia-0.6.app/Contents/Resources/julia/bin/julia (unknown line)
Allocations: 848930 (Pool: 847706; Big: 1224); GC: 0
Illegal instruction: 4
Perhaps more worrying, without --inline=no this results in
ERROR: LoadError: bad
Stacktrace:
[1] foo() at /Users/twan/code/julia/RigidBodyDynamics/v0.6/RigidBodyDynamics/perf/runbenchmarks.jl:40
[2] include_from_node1(::String) at ./loading.jl:539
[3] include(::String) at ./sysimg.jl:14
[4] process_options(::Base.JLOptions) at ./client.jl:305
[5] _start() at ./client.jl:371
while loading /Users/twan/code/julia/RigidBodyDynamics/v0.6/RigidBodyDynamics/perf/runbenchmarks.jl, in expression starting on line 43
julia> a=Core.Inference.return_type(path, Tuple{Any, RigidBody{T} where T<:Number, RigidBody{T} where T<:Number})
TreePath{_,Joint{T<:Number}} where _
julia> Core.Inference.has_free_typevars(a)
true
julia>typeintersect(a, TreePath{RigidBody{T},Joint{T}} where T)
Union{}
The inferred return type of path should probably not have an unbound typevar, i.e. it's missing a where T, right?
julia>functionfoo{V, E}(::V, ::Pair{V, E})
E
end
foo (generic function with 1 method)
julia>code_warntype(foo, Tuple{Ref, Pair{Ref{T},Ref{T}} where T<:Number})
Variables:#self#::#foo#unused#@_2::Any#unused#@_3::Any
Body:beginreturn$(Expr(:static_parameter, 2))
end::Type{Ref{T<:Number}}
IIUC, this should be Type{Ref{T}} where T <: Number.
Very similar to #21243. Distilled from RigidBodyDynamics.jl:
With
--inline=no
, this results inPerhaps more worrying, without
--inline=no
this results inversioninfo()
:The text was updated successfully, but these errors were encountered: