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
Not sure exactly what's going on, or why I get a stack overflow the first time I try the illegal addition and a crash the second time. This is with Commit 81c84a9 2013-05-22 03:59:37 on OS X.
julia> using Base.Intrinsics
julia> bitstype 8 Mytype <: Unsigned
julia> mytype(x::Integer)=box(Mytype, unbox(Uint8, uint8(x)))
# methods for generic function mytype
mytype(x::Integer) at none:1
julia> mytype(1)+1
ERROR: stack overflow
in + at promotion.jl:135 (repeats 79998 times)
julia> mytype(1)+1
fish: Job 1, 'julia' terminated by signal SIGILL (Illegal instruction)
The text was updated successfully, but these errors were encountered:
You haven't defined a + operator for your bitstype, so it falls back on the generic + operations for numbers, which is to promote the two arguments and try again -- except that you haven't defined a promote_rule either, so the result of promotion is a no-op, and the result of trying again is a stack overflow.
There is no guarantee that the memory corruption has not occurred by the time the stack overflow is reported, so it may crash afterwards.
Not sure exactly what's going on, or why I get a stack overflow the first time I try the illegal addition and a crash the second time. This is with Commit 81c84a9 2013-05-22 03:59:37 on OS X.
The text was updated successfully, but these errors were encountered: