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

Regression in Int#times unable to apply it over union of ints #2887

Closed
bcardiff opened this issue Jun 21, 2016 · 1 comment
Closed

Regression in Int#times unable to apply it over union of ints #2887

bcardiff opened this issue Jun 21, 2016 · 1 comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler
Milestone

Comments

@bcardiff
Copy link
Member

a = 2i32
b = 5i64

c = rand > 0.5 ? a : b

c.times do 
  puts "x"
end

0.18.0 / 0.18.2 does not compile https://play.crystal-lang.org/#/r/1264, https://play.crystal-lang.org/#/r/1262
0.17.4 runs as expected https://play.crystal-lang.org/#/r/1263

@asterite
Copy link
Member

Reduced:

struct Int
  def foo(&block : self ->)
    yield self
  end
end

(1 || 1_i64).foo do
end

@asterite asterite added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler labels Jun 21, 2016
@jhass jhass added this to the 0.18.3 milestone Jun 21, 2016
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

3 participants