https://github.com/JuliaLang/julia
Revision 19fffe1976f900648431b268b8aeaef22ec09f9a authored by Paul Berg on 04 April 2024, 08:54:55 UTC, committed by GitHub on 04 April 2024, 08:54:55 UTC
https://github.com/JuliaLang/julia/pull/53875 allowed
`:throw_undef_if_not` as a frontend form.

However, the `UndefVarError` being tested is thrown because the first
argument is resolved to a global ref:

```julia
julia> @eval function has_tuin()
           $(Expr(:throw_undef_if_not, :x, false))
       end
has_tuin (generic function with 1 method)

julia> @code_lowered has_tuin() # master
CodeInfo(
1 ─ %1 = $(Expr(:throw_undef_if_not, :(Main.x), false))
└──      return %1
)

julia> @code_lowered has_tuin() # this pr
CodeInfo(
1 ─ %1 = $(Expr(:throw_undef_if_not, :x, false))
└──      return %1
)
```

This change skips this global ref resolution for the first argument and
fixes a typo which would throw an error in case of non-const second
argument.
1 parent 0cd3164
History
Tip revision: 19fffe1976f900648431b268b8aeaef22ec09f9a authored by Paul Berg on 04 April 2024, 08:54:55 UTC
Fixes for allowing `:throw_undef_if_not` on the frontend (#53944)
Tip revision: 19fffe1
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 571 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 1012 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 388.1 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 56.4 KB
Makefile -rw-r--r-- 30.4 KB
NEWS.md -rw-r--r-- 4.4 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.9 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 37.8 KB
pkgimage.mk -rw-r--r-- 1.4 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top