MCPcopy
hub / github.com/MadAppGang/dingo / hasConstructorPatterns

Method hasConstructorPatterns

pkg/codegen/match.go:458–465  ·  view source on GitHub ↗

hasConstructorPatterns checks if any arm has constructor patterns. This determines whether we need a type switch or value switch.

()

Source from the content-addressed store, hash-verified

456// hasConstructorPatterns checks if any arm has constructor patterns.
457// This determines whether we need a type switch or value switch.
458func (g *MatchCodeGen) hasConstructorPatterns() bool {
459 for _, arm := range g.Match.Arms {
460 if _, ok := arm.Pattern.(*ast.ConstructorPattern); ok {
461 return true
462 }
463 }
464 return false
465}
466
467// hasBindings checks if any arm has patterns that need variable bindings.
468// This determines whether we need a temp var in the type switch.

Callers 2

generateMatchSwitchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected