mirror of
https://github.com/golang/go
synced 2024-11-18 10:04:43 -07:00
internal/lsp: return in the default case in cloneExpr
As a follow-up to CL 232990, return in the default case so that the compiler will complain if we fail to return. Change-Id: Ib771dfcd1a67b33fd51508ac183b861c00417efb Reviewed-on: https://go-review.googlesource.com/c/tools/+/232992 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
parent
ead0a56930
commit
2212a7e161
@ -386,7 +386,6 @@ func cloneExpr(expr ast.Expr, info *types.Info, clonedInfo map[token.Pos]*types.
|
||||
if obj, ok := info.ObjectOf(x).(*types.PkgName); ok {
|
||||
clonedInfo[s.X.Pos()] = obj
|
||||
}
|
||||
|
||||
}
|
||||
return s
|
||||
case *ast.StarExpr:
|
||||
@ -400,8 +399,9 @@ func cloneExpr(expr ast.Expr, info *types.Info, clonedInfo map[token.Pos]*types.
|
||||
Fields: cloneFieldList(expr.Fields, info, clonedInfo),
|
||||
Incomplete: expr.Incomplete,
|
||||
}
|
||||
default:
|
||||
return expr
|
||||
}
|
||||
return expr
|
||||
}
|
||||
|
||||
func cloneFieldList(fl *ast.FieldList, info *types.Info, clonedInfo map[token.Pos]*types.PkgName) *ast.FieldList {
|
||||
|
Loading…
Reference in New Issue
Block a user