UnionAll type where T<:...
conflict with type T
leads to syntax error "invalid type parameter name 'SSAValue'"
#53940
Labels
bug
Indicates an unexpected problem or unintended behavior
compiler:lowering
Syntax lowering (compiler front end, 2nd stage)
When an UnionAll type with a nonunique name is specified, a syntax error "invalid type parameter name "SSAValue"" is raised.
MWE (error):
Foo{T<:Integer, U<:AbstractArray{T} where T<:Integer}
When it is a simple type, the nested type
T
is identified as the first oneT<:Integer
.Without UnionAll (no error):
Bar{T<:Integer, U<:AbstractArray{T}}
With a simple UnionAll type, everything works as expected
Without conflicting name (no error):
FooBar{U<:AbstractArray{T} where T<:Integer}
Below are existing errors for different, but similar situations
function static parameter name not unique:
struct BarFoo{T<:Integer, T<:AbstractFloat}
function argument and static parameter name not distinct:
foo(A::A) where A<:Integer = A()
versioninfo
Thanks!
The text was updated successfully, but these errors were encountered: