MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / canConstantBecome

Function canConstantBecome

pkg/sql/sem/tree/constant.go:97–105  ·  view source on GitHub ↗

canConstantBecome returns whether the provided Constant can become resolved as the provided type.

(c Constant, typ *types.T)

Source from the content-addressed store, hash-verified

95// canConstantBecome returns whether the provided Constant can become resolved
96// as the provided type.
97func canConstantBecome(c Constant, typ *types.T) bool {
98 avail := c.AvailableTypes()
99 for _, availTyp := range avail {
100 if availTyp.Equivalent(typ) {
101 return true
102 }
103 }
104 return false
105}
106
107// NumVal represents a constant numeric value.
108type NumVal struct {

Callers 3

TypeCheckMethod · 0.85
typeCheckSameTypedConstsFunction · 0.85
typeCheckOverloadedExprsFunction · 0.85

Calls 2

EquivalentMethod · 0.80
AvailableTypesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…