# Are any of these bugs?

**URL:** https://discourse.julialang.org/t/are-any-of-these-bugs/3569
**Category:** General Usage
**Created:** [May 6, 2017, 11:23pm UTC](https://discourse.julialang.org/t/are-any-of-these-bugs/3569 "2017-05-06T23:23:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![loisel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/loisel/32/50626_2.png) [@loisel](https://discourse.julialang.org/u/loisel)
#### Post date: [May 6, 2017, 11:23pm UTC](https://discourse.julialang.org/t/are-any-of-these-bugs/3569/1 "2017-05-06T23:23:17Z")

</div>

julia\> immutable Z \<: Unsigned  
foo  
end

julia\> Z(12)  
Error showing value of type Z:  
ERROR: MethodError: no method matching leading\_zeros(::Z)  
Closest candidates are:  
leading\_zeros{T\<:Union{Int128,Int16,Int32,Int64,Int8,UInt128,UInt16,UInt32,UInt64,UInt8}}(::T\<:Union{Int128,Int16,Int32,Int64,Int8,UInt128,UInt16,UInt32,UInt64,UInt8}) at int.jl:150  
in hex(::Z, ::Int64, ::Bool) at ./intfuncs.jl:303  
in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol(“text/plain”)}, ::Z) at ./REPL.jl:132  
in display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::Z) at ./REPL.jl:135  
in display(::Z) at ./multimedia.jl:143  
in print\_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:154  
in print\_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:139  
in (::Base.REPL.##22#23{Bool,Base.REPL.##33#42{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:652  
in run\_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at ./LineEdit.jl:1579  
in run\_interface(::Base.Terminals.TTYTerminal, ::Base.LineEdit.ModalInterface) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
in run\_frontend(::Base.REPL.LineEditREPL, ::Base.REPL.REPLBackendRef) at ./REPL.jl:903  
in run\_repl(::Base.REPL.LineEditREPL, ::Base.##930#931) at ./REPL.jl:188  
in \_start() at ./client.jl:360  
in \_start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?  
julia\> Base.:==(a::Z,b::Z) = “hello, world”  
ERROR: syntax: invalid identifier name “:=”

julia\> Base.isequal(a::Z,b::Z) = “hello, world”

julia\> Z(12)==Z(13)  
false

julia\> isequal(Z(12),Z(13))  
“hello, world”

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [May 6, 2017, 11:59pm UTC](https://discourse.julialang.org/t/are-any-of-these-bugs/3569/3 "2017-05-06T23:59:30Z")

</div>

None of these are behavioral bugs though it is currently not extremely clear on what method needs to be extended when implementing certain kind of types so you could say it’s interface documentation bugs.

---

<div class="post-metadata">

### Author: ![loisel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/loisel/32/50626_2.png) [@loisel](https://discourse.julialang.org/u/loisel)
#### Post date: [May 7, 2017, 3:05pm UTC](https://discourse.julialang.org/t/are-any-of-these-bugs/3569/4 "2017-05-07T15:05:40Z")

</div>

OK thanks. I mean, I can create an Unsigned type that does not cause these problems but I find it an odd design choice that subtyping Unsigned automatically breaks the P in REPL.
