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

Bug: union of Int32 and BigRational leads to Number #5073

Closed
vladfaust opened this issue Oct 3, 2017 · 3 comments
Closed

Bug: union of Int32 and BigRational leads to Number #5073

vladfaust opened this issue Oct 3, 2017 · 3 comments

Comments

@vladfaust
Copy link
Contributor

vladfaust commented Oct 3, 2017

https://carc.in/#/r/2uh7

require "big_rational"

class Foo
  @foo = Hash(Symbol, Int32 | BigRational).new
end

Error in temp2.cr:4: instance variable '@foo' of Foo must be Hash(Symbol, Number), not (Hash(Symbol, BigRational | Int32) | Hash(Symbol, Number))

  @foo = Hash(Symbol, Int32 | BigRational).new
  ^~~~
$ crystal -v
Crystal 0.23.1 [e2a1389] (2017-07-13) LLVM 3.8.1

The hash is defined in macro as seen here, so I'm unable to unify types in one Number.

Related: onyxframework/sql#8

@asterite asterite changed the title Compiler bug? (don't even know how to name it) Bug: union of Int32 and BigRational leads to Number Oct 15, 2017
@asterite asterite added this to the Next milestone Oct 17, 2017
@RX14
Copy link
Contributor

RX14 commented Oct 17, 2017

We typically add the PRs instead of the closed issues to the Next milestone @asterite. That way we track what code was actually merged instead of just the issues, when one PR might close multiple or introduce it's own side effect.

@asterite
Copy link
Member

@RX14 Mmm... But when you browse the milestone you have no idea then what bugs were fixed.

@RX14
Copy link
Contributor

RX14 commented Oct 18, 2017

@asterite PRs almost always have some mention or link of the issue they're related to. At the very least if they don't, the PR contains a description of the bug. We wouldn't know how to review a PR ourselves if we didn't know what it fixed.

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

No branches or pull requests

3 participants