@@ -1619,25 +1619,25 @@ function return_type_tfunc(interp::AbstractInterpreter, argtypes::Vector{Any}, s
1619
1619
if isa (rt, Const)
1620
1620
# output was computed to be constant
1621
1621
return Const (typeof (rt. val))
1622
+ end
1623
+ rt = widenconst (rt)
1624
+ if rt === Bottom || (isconcretetype (rt) && ! iskindtype (rt))
1625
+ # output cannot be improved so it is known for certain
1626
+ return Const (rt)
1627
+ elseif ! isempty (sv. pclimitations)
1628
+ # conservatively express uncertainty of this result
1629
+ # in two ways: both as being a subtype of this, and
1630
+ # because of LimitedAccuracy causes
1631
+ return Type{<: rt }
1632
+ elseif (isa (tt, Const) || isconstType (tt)) &&
1633
+ (isa (aft, Const) || isconstType (aft))
1634
+ # input arguments were known for certain
1635
+ # XXX : this doesn't imply we know anything about rt
1636
+ return Const (rt)
1637
+ elseif isType (rt)
1638
+ return Type{rt}
1622
1639
else
1623
- inaccurate = nothing
1624
- rt isa LimitedAccuracy && (inaccurate = rt. causes; rt = rt. typ)
1625
- rt = widenconst (rt)
1626
- if hasuniquerep (rt) || rt === Bottom
1627
- # output type was known for certain
1628
- return Const (rt)
1629
- elseif inaccurate != = nothing
1630
- return LimitedAccuracy (Type{<: rt }, inaccurate)
1631
- elseif (isa (tt, Const) || isconstType (tt)) &&
1632
- (isa (aft, Const) || isconstType (aft))
1633
- # input arguments were known for certain
1634
- # XXX : this doesn't imply we know anything about rt
1635
- return Const (rt)
1636
- elseif isType (rt)
1637
- return Type{rt}
1638
- else
1639
- return Type{<: rt }
1640
- end
1640
+ return Type{<: rt }
1641
1641
end
1642
1642
end
1643
1643
end
0 commit comments