Skip to content

fix: type inference for user-defined module function return types#811

Merged
SchoolyB merged 1 commit intobugfixes/12-24-2025from
fix/issue-807-user-module-type-inference
Dec 24, 2025
Merged

fix: type inference for user-defined module function return types#811
SchoolyB merged 1 commit intobugfixes/12-24-2025from
fix/issue-807-user-module-type-inference

Conversation

@SchoolyB
Copy link
Copy Markdown
Owner

Summary

  • Fix type inference for user-defined module function return types
  • Add integration test for user module type inference

Problem

The inferModuleCallType() function only handled stdlib modules (std, math, arrays, strings, time) and returned empty types for user-defined modules. This caused type mismatch errors like expects u64, got (empty) when variables were assigned from user module function calls without explicit type annotations.

Solution

Updated the default case in inferModuleCallType() to use GetModuleFunction() to look up user-defined module function signatures and properly infer return types.

Test plan

  • Added integration test integration-tests/pass/multi-file/user-module-type-inference/
  • All existing integration tests pass (311/312, 1 pre-existing failure unrelated)
  • Go unit tests pass

Fixes #807

The inferModuleCallType() function only handled stdlib modules and
returned empty types for user-defined modules. This caused type
mismatch errors when variables were assigned from user module
function calls without explicit type annotations.

Now uses GetModuleFunction() to look up user-defined module function
signatures and properly infer return types.

Fixes #807
@SchoolyB SchoolyB merged commit be278e7 into bugfixes/12-24-2025 Dec 24, 2025
3 checks passed
@SchoolyB SchoolyB deleted the fix/issue-807-user-module-type-inference branch December 24, 2025 03:13
SchoolyB added a commit that referenced this pull request Apr 3, 2026
The inferModuleCallType() function only handled stdlib modules and
returned empty types for user-defined modules. This caused type
mismatch errors when variables were assigned from user module
function calls without explicit type annotations.

Now uses GetModuleFunction() to look up user-defined module function
signatures and properly infer return types.

Fixes #807
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