Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #476: isdefined with QuoteNode #477

Merged
merged 1 commit into from
Apr 22, 2021
Merged

fix #476: isdefined with QuoteNode #477

merged 1 commit into from
Apr 22, 2021

Conversation

simeonschaub
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #477 (63dd5b3) into master (5e723d4) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #477   +/-   ##
=======================================
  Coverage   89.28%   89.29%           
=======================================
  Files          12       12           
  Lines        2342     2344    +2     
=======================================
+ Hits         2091     2093    +2     
  Misses        251      251           
Impacted Files Coverage Δ
src/interpret.jl 86.87% <66.66%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e723d4...63dd5b3. Read the comment docs.

Copy link
Member

@pfitzseb pfitzseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems correct to me, although I'm a bit uncomfortable with removing the error fallback (mostly because I'm too unfamiliar with what else is valid in a @isdefined expression).

@simeonschaub
Copy link
Collaborator Author

simeonschaub commented Apr 22, 2021

Ok, I just had a look at what the base interpreter does and looks like it is buggy as well 😆 (it will error if asserts are enabled):

~ >>> julia-latest --compile=min                                                                              ✓ 506
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.0-DEV.945 (2021-04-18)
 _/ |\__'_|_|_|\__'_|  |  Commit 55dd2f4e92* (4 days old master)
|__/                   |

julia> @generated f() = Expr(:isdefined, :($(QuoteNode(Float64))))
f (generic function with 1 method)

julia> f()
false

Base has an additional case for Core.Argument, which I don't really think should occur in untyped IR, but I can add this here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants