Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1654,17 +1654,13 @@
(define (expand-or e)
(let ((e (cdr (flatten-ex '|\|\|| e))))
(let loop ((tail e))
(if (null? tail)
'(false)
(if (null? (cdr tail))
(car tail)
(if (symbol-like? (car tail))
`(if ,(car tail) ,(car tail)
,(loop (cdr tail)))
(let ((g (make-ssavalue)))
`(block (= ,g ,(car tail))
(if ,g ,g
,(loop (cdr tail)))))))))))
(cond ((null? tail)
'(false))
((null? (cdr tail))
(car tail))
(else `(if ,(car tail)
(true)
,(loop (cdr tail))))))))

(define (expand-for lhss itrs body)
(define (outer? x) (and (pair? x) (eq? (car x) 'outer)))
Expand Down
6 changes: 6 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3820,3 +3820,9 @@ end |> only == Int
end
end |> only === Union{UnionNarrowingByIsdefinedA, UnionNarrowingByIsdefinedB}
end

# issue #43130
@test Base.return_types((Any,Type)) do uw, ti
(uw isa DataType && ti <: uw.name.wrapper) || return nothing
uw
end[] === Union{DataType, Nothing}