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

Unification of int, empty array and int array fails #12

Closed
asterite opened this issue Jan 22, 2013 · 1 comment
Closed

Unification of int, empty array and int array fails #12

asterite opened this issue Jan 22, 2013 · 1 comment

Comments

@asterite
Copy link
Member

a = 1
a = []
a = []
a << 1

"a" is incorrectly typed as a union of Int and Array<Int>, but it should be a union of Int, Array<Nil> and Array<Int>

asterite added a commit that referenced this issue Jan 22, 2013
@asterite
Copy link
Member Author

Simpler test case:

class Int
  def value=(x)
  end
end

a = 1
a = Pointer.malloc(1)
a.value = 1
a = Pointer.malloc(1)

It's simpler because it doesn't involve arrays.

And another one with just objects:

generic class Foo
  def value=(value)
    @value = value
  end
end

foo = Foo.new
foo.value = 1
foo = Foo.new

Should be union of Foo<> and Foo<Int> but it's just Foo<Int>

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

1 participant