Skip to content

Support global variable aliases - #503

Open
pvcresin wants to merge 1 commit into
ruby:masterfrom
pvcresin:support-alias-global-variable
Open

pvcresin wants to merge 1 commit into
ruby:masterfrom
pvcresin:support-alias-global-variable

Conversation

@pvcresin

@pvcresin pvcresin commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor
def foo
  $v = :ok
end

def bar
  alias $new_v $v
  $new_v
end

bar was inferred as -> untyped because alias $new $old was ignored. Now the two global variables are connected in both directions so that they share types.

This resolves scenario/known-issues/alias-global-variable.rb, so it is moved to scenario/variable/.

`alias $new $old` was ignored, so `$new` was always untyped. Connect
the two global variables in both directions so that they share types.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant