@@ -29,15 +29,15 @@ struct ReturnInstruction{T} <: AbstractInstruction
29
29
arg:: TypedVar{T}
30
30
end
31
31
32
- mutable struct TapedFunction{F, T }
32
+ mutable struct TapedFunction{F}
33
33
func:: F # maybe a function, a constructor, or a callable object
34
34
arity:: Int
35
35
ir:: Core.CodeInfo
36
36
tape:: RawTape
37
37
unified_tape:: Vector{FunctionWrapper{Nothing, Tuple{TapedFunction}}}
38
38
counter:: Int
39
39
bindings:: Dict{Symbol, Any}
40
- retval:: TypedVar{T }
40
+ retval:: TypedVar{<:Any }
41
41
42
42
function TapedFunction (f:: F , args... ; cache= false ) where {F}
43
43
args_type = _accurate_typeof .(args)
@@ -55,17 +55,16 @@ mutable struct TapedFunction{F, T}
55
55
utape = Vector {FunctionWrapper{Nothing, Tuple{TapedFunction}}} ()
56
56
bindings = translate! (tape, ir)
57
57
58
- T = isa (ir. rettype, Core. Const) ? typeof (ir. rettype. val) : ir. rettype
59
- tf = new {F, T} (f, length (args), ir, tape, utape, 1 ,
60
- bindings, TypedVar {T} (:none ))
58
+ tf = new {F} (f, length (args), ir, tape, utape, 1 ,
59
+ bindings, TypedVar {Any} (:none ))
61
60
TRCache[cache_key] = tf # set cache
62
61
# unify!(tf)
63
62
return tf
64
63
end
65
64
66
- function TapedFunction (tf:: TapedFunction{F, T } ) where {F, T }
67
- new {F, T } (tf. func, tf. arity, tf. ir, tf. tape, tf. unified_tape,
68
- tf. counter, tf. bindings, tf . retval )
65
+ function TapedFunction (tf:: TapedFunction{F} ) where {F}
66
+ new {F} (tf. func, tf. arity, tf. ir, tf. tape, tf. unified_tape,
67
+ tf. counter, tf. bindings, TypedVar {Any} ( :none ) )
69
68
end
70
69
end
71
70
0 commit comments