feat(go): Close stdlib type inference gap in GetReturnType (PR-07b)#555
Merged
shivasurya merged 1 commit intomainfrom Feb 25, 2026
Merged
feat(go): Close stdlib type inference gap in GetReturnType (PR-07b)#555shivasurya merged 1 commit intomainfrom
shivasurya merged 1 commit intomainfrom
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Feb 25, 2026
Owner
Author
This was referenced Feb 25, 2026
Owner
Author
Merge activity
|
…-07b) Enhance GoTypeInferenceEngine.GetReturnType to query the stdlib registry when local user-code types are not found. All code paths that call GetReturnType (chaining, bidirectional inference, variable extraction) now benefit from stdlib type resolution automatically. - Add stdlib fallback to GetReturnType using Registry.StdlibLoader - Add stdlibNormalizeType helper (pointer/slice/builtin/qualified handling) - 100% coverage on every function in go_types.go (15/15 functions) - Fix extraction test: stdlib type now resolved via engine (Source: stdlib) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cb724bb to
0b2c209
Compare
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
GoTypeInferenceEngine.GetReturnTypeinresolution/go_types.goto fall back to the stdlib registry when the local user-code type map has no answerGetReturnType(type chaining, bidirectional inference, variable extraction) now receive stdlib type data automatically without any per-caller changesstdlibNormalizeTypehelper with the same pointer/slice/builtin/cross-package normalization logic as the extraction layerSource: "stdlib",Confidence: 1.0) instead of the extraction-layer fallbackGap closed
Previously
GoTypeInferenceEngine.GetReturnTypeonly looked up user-code types. Any code path that called it for a stdlib function got(nil, false)even whenStdlibLoaderwas set. The extraction-layer helper ingo_variables.goworked around this for variable assignments, but chaining and bidirectional inference paths were still blind to stdlib types.Test coverage
go_types.go: 100% coverage on every function (15/15)stdlibNormalizeType: all branches covered (builtin, pointer, slice, cross-package, unqualified, empty)GetReturnTypestdlib fallback: 10 new focused tests (nil loader, no dot, not stdlib, fn not found, error-only return, empty-typeFQN skip, local priority, pointer return, cross-package, simple function)Files changed
resolution/go_types.goGetReturnType+stdlibNormalizeTypehelperresolution/go_types_test.gomockGoTypesStdlibLoader, 10+ new tests covering all new branchesextraction/go_variables_stdlib_test.gostdlib_registry→stdlib