@@ -420,7 +420,8 @@ function typevar_tfunc(@nospecialize(n), @nospecialize(lb_arg), @nospecialize(ub
420420 ub = Any
421421 ub_certain = lb_certain = true
422422 if isa (n, Const)
423- isa (n. val, Symbol) || return Union{}
423+ nval = n. val
424+ isa (nval, Symbol) || return Union{}
424425 if isa (lb_arg, Const)
425426 lb = lb_arg. val
426427 elseif isType (lb_arg)
@@ -437,7 +438,7 @@ function typevar_tfunc(@nospecialize(n), @nospecialize(lb_arg), @nospecialize(ub
437438 else
438439 return TypeVar
439440 end
440- tv = TypeVar (n . val , lb, ub)
441+ tv = TypeVar (nval , lb, ub)
441442 return PartialTypeVar (tv, lb_certain, ub_certain)
442443 end
443444 return TypeVar
@@ -1273,11 +1274,10 @@ function apply_type_tfunc(@nospecialize(headtypetype), @nospecialize args...)
12731274 return Union{}
12741275 end
12751276 uw = unwrap_unionall (headtype)
1276- isnamedtuple = isa (uw, DataType) && uw. name === _NAMEDTUPLE_NAME
12771277 uncertain = false
12781278 canconst = true
12791279 tparams = Any[]
1280- outervars = Any []
1280+ outervars = TypeVar []
12811281 varnamectr = 1
12821282 ua = headtype
12831283 for i = 1 : largs
@@ -1324,7 +1324,7 @@ function apply_type_tfunc(@nospecialize(headtypetype), @nospecialize args...)
13241324 # end
13251325 else
13261326 # Is this the second parameter to a NamedTuple?
1327- if isnamedtuple && isa (ua, UnionAll) && uw. parameters[2 ] === ua. var
1327+ if isa (uw, DataType) && uw . name === _NAMEDTUPLE_NAME && isa (ua, UnionAll) && uw. parameters[2 ] === ua. var
13281328 # If the names are known, keep the upper bound, but otherwise widen to Tuple.
13291329 # This is a widening heuristic to avoid keeping type information
13301330 # that's unlikely to be useful.
@@ -1510,9 +1510,11 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ
15101510 # Additionally check element type compatibility
15111511 a = widenconst (argtypes[2 ])
15121512 # Check that we can determine the element type
1513- (isa (a, DataType) && isa (a. parameters[1 ], Type)) || return false
1513+ isa (a, DataType) || return false
1514+ ap1 = a. parameters[1 ]
1515+ isa (ap1, Type) || return false
15141516 # Check that the element type is compatible with the element we're assigning
1515- ( argtypes[3 ] ⊑ a . parameters[ 1 ]) || return false
1517+ argtypes[3 ] ⊑ ap1 || return false
15161518 return true
15171519 elseif f === arrayref || f === const_arrayref
15181520 return array_builtin_common_nothrow (argtypes, 3 )
@@ -1568,7 +1570,7 @@ function builtin_tfunction(interp::AbstractInterpreter, @nospecialize(f), argtyp
15681570 end
15691571 if isa (f, IntrinsicFunction)
15701572 if is_pure_intrinsic_infer (f) && _all (@nospecialize (a) -> isa (a, Const), argtypes)
1571- argvals = anymap (a :: Const -> a . val, argtypes)
1573+ argvals = anymap (@nospecialize (a) -> (a :: Const ) . val, argtypes)
15721574 try
15731575 return Const (f (argvals... ))
15741576 catch
0 commit comments