hasConstructorPatterns checks if any arm has constructor patterns. This determines whether we need a type switch or value switch.
()
| 456 | // hasConstructorPatterns checks if any arm has constructor patterns. |
| 457 | // This determines whether we need a type switch or value switch. |
| 458 | func (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. |
no outgoing calls
no test coverage detected