@@ -541,31 +541,6 @@ struct type with no fields.
541
541
"""
542
542
issingletontype (@nospecialize (t)) = (@_pure_meta ; isa (t, DataType) && isdefined (t, :instance ))
543
543
544
- """
545
- Base.parameter_upper_bound(t::UnionAll, idx)
546
-
547
- Determine the upper bound of a type parameter in the underlying datatype.
548
- This method should generally not be relied upon:
549
- code instead should usually use static parameters in dispatch to extract these values.
550
-
551
- # Examples
552
- ```jldoctest
553
- julia> struct Foo{T<:AbstractFloat, N}
554
- x::Tuple{T, N}
555
- end
556
-
557
- julia> Base.parameter_upper_bound(Foo, 1)
558
- AbstractFloat
559
-
560
- julia> Base.parameter_upper_bound(Foo, 2)
561
- Any
562
- ```
563
- """
564
- function parameter_upper_bound (t:: UnionAll , idx)
565
- @_pure_meta
566
- return rewrap_unionall ((unwrap_unionall (t):: DataType ). parameters[idx], t)
567
- end
568
-
569
544
"""
570
545
typeintersect(T, S)
571
546
@@ -730,13 +705,12 @@ julia> instances(Color)
730
705
function instances end
731
706
732
707
function to_tuple_type (@nospecialize (t))
733
- @_pure_meta
734
- if isa (t,Tuple) || isa (t,AbstractArray) || isa (t,SimpleVector)
708
+ if isa (t, Tuple) || isa (t, AbstractArray) || isa (t, SimpleVector)
735
709
t = Tuple{t... }
736
710
end
737
- if isa (t,Type) && t<: Tuple
711
+ if isa (t, Type) && t <: Tuple
738
712
for p in unwrap_unionall (t). parameters
739
- if ! (isa (p,Type) || isa (p,TypeVar))
713
+ if ! (isa (p, Type) || isa (p, TypeVar))
740
714
error (" argument tuple type must contain only types" )
741
715
end
742
716
end
0 commit comments