Skip to content

[gosrc2cpg] Fix literal types, pointer-to-pointer, type assertions, and interface resolution#5909

Open
allsmog wants to merge 1 commit intojoernio:masterfrom
allsmog:go/fix-types-assertions-interfaces
Open

[gosrc2cpg] Fix literal types, pointer-to-pointer, type assertions, and interface resolution#5909
allsmog wants to merge 1 commit intojoernio:masterfrom
allsmog:go/fix-types-assertions-interfaces

Conversation

@allsmog
Copy link
Copy Markdown

@allsmog allsmog commented Mar 30, 2026

Fixes Go type system issues and adds interface method resolution.

  • Fix float literals to float64, imaginary to complex128, char to int32 per Go spec
  • Fix pointer-to-pointer (**T) via recursive type resolution
  • Fix TypeAssertExpr to produce Operators.cast call with correct result type
  • Extract interface method sets from InterfaceType declarations
  • Add interface method lookup fallback for method calls on interface-typed receivers

Test plan

  • Updated TypeFullNameTests for correct literal types
  • New InterfaceTypeResolutionTests: type assertion cast, interface TypeDecl, interface method call
  • New E2EGoValidationTests: realistic Go code exercising all fixes
  • All existing gosrc2cpg tests pass

…nd interface resolution

- Fix float literals to float64, imaginary to complex128, char to int32 per Go spec
- Fix pointer-to-pointer (**T) via recursive type resolution
- Fix TypeAssertExpr to produce Operators.cast call with correct result type
- Extract interface method sets and add interface method lookup fallback
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