Skip to content

Conversation

@mlechu
Copy link
Member

@mlechu mlechu commented Feb 27, 2025

This change removes an inconsistency between >: and <:. We were parsing where {A>:B>:C} forms, but not recognizing them in lowering.

Before:

julia> Vector{T} where Int<:T<:Number
Vector{T} where Int64<:T<:Number

julia> Vector{T} where Number>:T>:Int
ERROR: syntax: invalid bounds in "where" around REPL[14]:1

After:

julia> Vector{T} where Number>:T>:Int
Vector{T} where Int64<:T<:Number

@mlechu mlechu added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Feb 27, 2025
@topolarity
Copy link
Member

Thanks @mlechu !

@topolarity topolarity merged commit 2e57730 into JuliaLang:master Feb 27, 2025
8 checks passed
@topolarity topolarity added the backport 1.12 Change should be backported to release-1.12 label Feb 28, 2025
KristofferC pushed a commit that referenced this pull request Mar 3, 2025
This change removes an inconsistency between `>:` and `<:`. We were
parsing `where {A>:B>:C}` forms, but not recognizing them in lowering.

Before:
```
julia> Vector{T} where Int<:T<:Number
Vector{T} where Int64<:T<:Number

julia> Vector{T} where Number>:T>:Int
ERROR: syntax: invalid bounds in "where" around REPL[14]:1
```

After:
```
julia> Vector{T} where Number>:T>:Int
Vector{T} where Int64<:T<:Number
```

(cherry picked from commit 2e57730)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants