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

SomeClass.class.is_a?(SomeConst) gets BUG: already had enclosing call #4364

Closed
c910335 opened this issue May 1, 2017 · 0 comments
Closed
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler

Comments

@c910335
Copy link
Contributor

c910335 commented May 1, 2017

This was found while I was testing with #4362.

code

class A end
AA = A
p A.class.is_a?(AA)

result

Error in test.cr:3: BUG: already had enclosing call

p A.class.is_a?(AA)
  ^

version

$ crystal -v
Crystal 0.22.0 (2017-04-22) LLVM 4.0.0

$ uname -srvmo
Linux 4.8.8-2-ARCH #1 SMP PREEMPT Thu Nov 17 14:51:03 CET 2016 x86_64 GNU/Linux
@mverzilli mverzilli added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels May 3, 2017
rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 8, 2017
rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 8, 2017
fixed crystal-lang#4364

`(Something.some_method).is_a?(Const)` will transform to
`Const === Something.some_method`

It should clone the `node.const` and `node.obj` to do this work.
mverzilli pushed a commit that referenced this issue May 8, 2017
* Add spec for #4364
* Compiler: fixed is_a? will trigger enclosing call bug

Fixes #4364

`(Something.some_method).is_a?(Const)` will transform to
`Const === Something.some_method`

It should clone the `node.const` and `node.obj` to do this work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Projects
None yet
Development

No branches or pull requests

2 participants