compiler: fix a bug with type conversion in switch
It was incorrectly parsed as void call.
This commit is contained in:
parent
7560aa345a
commit
7d61a567d5
2 changed files with 20 additions and 0 deletions
|
@ -108,6 +108,11 @@ func (c *funcScope) analyzeVoidCalls(node ast.Node) bool {
|
|||
if ok {
|
||||
c.voidCalls[ce] = false
|
||||
}
|
||||
case *ast.SwitchStmt:
|
||||
ce, ok := n.Tag.(*ast.CallExpr)
|
||||
if ok {
|
||||
c.voidCalls[ce] = false
|
||||
}
|
||||
case *ast.CaseClause:
|
||||
for _, e := range n.List {
|
||||
ce, ok := e.(*ast.CallExpr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue