Skip to content

Commit

Permalink
better way to compare basic type
Browse files Browse the repository at this point in the history
  • Loading branch information
mstephano committed Jan 13, 2023
1 parent 24ea199 commit 87e11fb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/code/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ func CompatibleTypes(expected types.Type, actual types.Type) error {
return nil
} else if actual, ok := actual.(*types.Named); ok {
if underlyingBasic, ok := actual.Underlying().(*types.Basic); ok {
if underlyingBasic.Kind() != expected.Kind() {
return fmt.Errorf("basic kind differs with underlying, %s != %s", expected.Name(), underlyingBasic.Name())
}
return nil
return CompatibleTypes(expected, underlyingBasic)
}
}

Expand Down

0 comments on commit 87e11fb

Please sign in to comment.