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
It's pretty easy to mistakenly define promote_type methods when you meant to define promote_rule methods. This can produce a fatal error in some cases, though:
julia>struct MyType{T}
a::Tend
julia> Base.promote_type(::Type{<:MyType}, ::Type{T}) where {T<:Number} = MyType{T}
fatal: error thrown and no exception handler available.
MethodError(f=typeof(Base.promote_type)(), args=(Core.TypeofBottom(), Int64), world=0x0000000000006cd8)
jl_method_error_bare at /cygdrive/d/buildbot/worker/package_win64/build/src\gf.c:1798
jl_method_error at /cygdrive/d/buildbot/worker/package_win64/build/src\gf.c:1816
jl_lookup_generic_ at /cygdrive/d/buildbot/worker/package_win64/build/src\gf.c:2373
jl_apply_generic at /cygdrive/d/buildbot/worker/package_win64/build/src\gf.c:2394
promote_result at .\promotion.jl:237 [inlined]
promote_type at .\promotion.jl:223 [inlined]
promote_typeof at .\promotion.jl:262 [inlined]
+ at .\int.jl:919
threadid at .\threadingconstructs.jl:10
task_done_hook at .\task.jl:432
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
jl_finish_task at /cygdrive/d/buildbot/worker/package_win64/build/src\task.c:198
start_task at /cygdrive/d/buildbot/worker/package_win64/build/src\task.c:717
error in running finalizer:MethodError(f=typeof(Base.promote_type)(), args=(Core.TypeofBottom(), Int64), world=0x0000000000006cd8)
error in running finalizer:MethodError(f=typeof(Base.promote_type)(), args=(Core.TypeofBottom(), Int64), world=0x0000000000006cd8)
julia>versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-2323:17 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU:Intel(R) Xeon(R) E-2276M CPU @ 2.80GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered:
It's pretty easy to mistakenly define
promote_type
methods when you meant to definepromote_rule
methods. This can produce a fatal error in some cases, though:The text was updated successfully, but these errors were encountered: