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

Compiler crashes infering type of generic ivar #3502

Closed
cjgajard opened this issue Nov 4, 2016 · 1 comment
Closed

Compiler crashes infering type of generic ivar #3502

cjgajard opened this issue Nov 4, 2016 · 1 comment

Comments

@cjgajard
Copy link
Contributor

cjgajard commented Nov 4, 2016

"jokke" (from IRC) posted https://p.jreinert.com/m-Z4eWbH/ asking for help.

reduced to:

class Watchdog
  def initialize
    @channel = Channel.new(Float64)
  end
end

watchdog = Watchdog.new

That should raise can't infer the type parameter T for the generic class Channel(T). Please provide it explicitly error (as it does when is assign to a local var) instead of crashing.

@asterite asterite added this to the 0.20.0 milestone Nov 5, 2016
@asterite asterite removed this from the 0.20.0 milestone Nov 22, 2016
@asterite
Copy link
Member

Other codes that reproduce this:

class A(T)
  alias B = C(T) 
  
  class C(T)
    @c : B = C.new
  end
end

and

class A(T)
  alias B = A(T)

  class C
    @c : B
  end
end

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