Skip to content

Conversation

@GuntherRademacher
Copy link
Member

@GuntherRademacher GuntherRademacher commented Nov 19, 2025

Private variables declared in a library module are no longer required to be in the module namespace (see 5.16 Variable Declaration). The corresponding check can be adapted easily, but the management of global variables in the Variables class currently mixes variables from all modules without taking into account where they were declared. As a result, it is not possible to use the same private variable name in multiple modules.

This PR

  • groups variables by declaring module to avoid name clashes
  • checks the declaring module to prevent main-module variables from becoming visible in imported modules
  • allows private variables of a module to be visible in all files comprising that module (as public variables already are)

Tests for this have been added in ModuleTest.variableVisibility.

There is also an unrelated fix for a typo in a built-in record field name in enum Records.

The changed naming rules apply to functions as well, but I’d prefer to address that in a separate task.

@GuntherRademacher GuntherRademacher changed the title Organize global variables by declaring module to accommodate new naming rules Organize global variables by declaring module Dec 2, 2025
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