Skip to content

Organize static functions by declaring module#2554

Merged
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:functions
Jan 8, 2026
Merged

Organize static functions by declaring module#2554
ChristianGruen merged 1 commit intoBaseXdb:mainfrom
GuntherRademacher:functions

Conversation

@GuntherRademacher
Copy link
Copy Markdown
Member

Private functions declared in a library module are no longer required to be in the module namespace (see 5.18 Function Declarations). The corresponding check can be adapted easily, but the management of static functions in the StaticFuncs class currently mixes functions from all modules without taking into account where they were declared. As a result, it is not possible to use the same private function name in multiple modules.

This PR

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

Tests for this have been added in ModuleTest.functionVisibility.

@ChristianGruen ChristianGruen merged commit 83b448b into BaseXdb:main Jan 8, 2026
1 check passed
@ChristianGruen ChristianGruen deleted the functions branch January 8, 2026 11:04
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