Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: improve function return type resolution to correctly handle 'any…
…' prefixes and 'record' types.
  • Loading branch information
noxymon committed Mar 6, 2026
commit b634f95712833367a4c59d9402ce8ee47ac6c4a7
3 changes: 2 additions & 1 deletion internal/compiler/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log/slog"
"strconv"
"strings"

"github.com/sqlc-dev/sqlc/internal/sql/ast"
"github.com/sqlc-dev/sqlc/internal/sql/astutils"
Expand Down Expand Up @@ -155,7 +156,7 @@ func (comp *Compiler) resolveCatalogRefs(qc *QueryCatalog, rvs []*ast.RangeVar,
}
if funcCallSide != nil {
fun, ferr := c.ResolveFuncCall(funcCallSide)
if ferr == nil && fun.ReturnType != nil && fun.ReturnType.Name != "any" {
if ferr == nil && fun.ReturnType != nil && !strings.HasPrefix(fun.ReturnType.Name, "any") && fun.ReturnType.Name != "record" {
defaultP := named.NewInferredParam(ref.name, true)
p, isNamed := params.FetchMerge(ref.ref.Number, defaultP)
a = append(a, Parameter{
Expand Down
Loading