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

Type inference on type application #780

Closed
soutaro opened this issue May 19, 2023 · 0 comments · Fixed by #789
Closed

Type inference on type application #780

soutaro opened this issue May 19, 2023 · 0 comments · Fixed by #789
Labels
area/core Issues related to the type checker core bug
Milestone

Comments

@soutaro
Copy link
Owner

soutaro commented May 19, 2023

Possible issue found at: https://github.com/ruby/lrama/pull/19/files#diff-ab21254dba99ec48bfb2ce485b2f9b988a3ddc3d4c651d1aed8bd2ec5334e0ecR278.

# @type var s: Array[[Integer, Integer]]
s = actions.each_with_index.map do |n, i|
  [i, n] #: [Integer, Integer]
end

Why we have both variable type declaration and block type assertion.

# This should work
s = actions.each_with_index.map do |n, i|
  [i, n] #: [Integer, Integer]
end

# Or this
# @type var s: Array[[Integer, Integer]]
s = actions.each_with_index.map do |n, i|
  [i, n]
end
@soutaro soutaro added the bug label May 19, 2023
@soutaro soutaro added this to the Steep 1.5 milestone May 19, 2023
@soutaro soutaro added the area/core Issues related to the type checker core label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues related to the type checker core bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant