Skip to content

Support global variable aliases - #503

Merged
sinsoku merged 1 commit into
ruby:masterfrom
pvcresin:support-alias-global-variable
Nov 30, 2026
Merged

sinsoku merged 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.
@sinsoku
sinsoku merged commit 49ead50 into ruby:master Nov 30, 2026
6 checks passed
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.

2 participants