Skip to content

Commit

Permalink
Do not parenthesize interface types in conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Jan 7, 2023
1 parent 6883791 commit f05d09c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion instrumenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func needsParenthesesForEql(expr ast.Expr) bool {
*ast.ArrayType,
*ast.StructType,
*ast.FuncType,
// TODO: *ast.InterfaceType,
*ast.InterfaceType,
*ast.MapType,
*ast.ChanType:
return false
Expand Down
2 changes: 1 addition & 1 deletion testdata/instrumenter/TypeSwitchStmt.gobco
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func typeSwitchStmtMixed(value interface{}) {
// :95:7: "value.(type) == []int"
// :98:7: "value.(type) == struct{ field int }"
// :101:7: "value.(type) == func(int) int"
// :104:7: "value.(type) == (interface{ ReadByte() (byte, error) })"
// :104:7: "value.(type) == interface{ ReadByte() (byte, error) }"
// :107:7: "value.(type) == map[int]int"
// :110:7: "value.(type) == chan int"
// :113:7: "value.(type) == *int"
Expand Down

0 comments on commit f05d09c

Please sign in to comment.