Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

M3/heisenbug #11

Closed
wants to merge 15 commits into from
Closed
Prev Previous commit
Next Next commit
With the change in Taits.jl the Heisebug is gone?!
  • Loading branch information
mauro3 committed Apr 11, 2015
commit 823e2bc7eb15d24076771d2eb4fabb74005317f7
6 changes: 2 additions & 4 deletions src/Traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,14 @@ end
function isfitting(tm::Method, fm::Method; verbose=false) # tm=trait-method, fm=function-method
println_verb = verbose ? println : x->x
println_verb = verbose ? x->x : x->x
iscall_overload(tm,fm) = fm.func.code.name==:call && tm.func.code.name!=:call

# Special casing for call-overloading. This is a bit of a hack:
# make a new method tm which includes the include the ::Type{...}.
if iscall_overload(tm,fm)
if fm.func.code.name==:call && tm.func.code.name!=:call
# Make a throw-away method:
tmold = tm
tm = FakeMethod(tm.sig, tm.tvars, tm.va)
## Alternative would be to make a proper throw-away method:
## Alternative would be to make a proper throw-away method, this would make tm typestable:
# tmpf967858() = 1
# tmpf967858.env.defs.sig = tm.sig
# tmpf967858.env.defs.tvars = tm.tvars
Expand All @@ -258,7 +257,6 @@ function isfitting(tm::Method, fm::Method; verbose=false) # tm=trait-method, fm=
end
end
end
println(tm.sig, tmold.sig)
end

# No Vararg methods implement yet
Expand Down
3 changes: 1 addition & 2 deletions src/commontraits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ end
end

@traitdef Assoc{X} <: Indexable{X} begin
tmp1 = println(X)
K,V = eltype(X)
tmp = println(K,V)

# note, ObjectId dict is not part of this interface
haskey(X, Any)
get(X, Any, Any)
Expand Down