1
0
mirror of https://github.com/golang/go synced 2024-11-12 03:40:21 -07:00
go/test/syntax
Robert Griesemer c65a2781be cmd/compile: better handling of incorrect type switches
Don't report errors if we don't have a correct type switch
guard; instead ignore it and leave it to the type-checker
to report the error. This leads to better error messages
concentrating on the type switch guard rather than errors
around (confusing) syntactic details.

Also clean up some code setting up AssertExpr (they never
have a nil Type field) and remove some incorrect TODOs.

Fixes #24470.

Change-Id: I69512f36e0417e3b5ea9c8856768e04b19d654a8
Reviewed-on: https://go-review.googlesource.com/103615
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2018-04-03 05:34:20 +00:00
..
chan1.go cmd/compile/internal/parser: improved a couple of error messages 2017-02-24 18:54:36 +00:00
chan.go
composite.go
ddd.go
else.go
if.go
import.go
initvar.go cmd/compile/internal/syntax: generalize error about var decls in init clauses 2017-02-13 23:15:32 +00:00
interface.go
semi1.go cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header 2017-02-09 03:54:47 +00:00
semi2.go
semi3.go cmd/compile/internal/parser: improved syntax error for incorrect if/for/switch header 2017-02-09 03:54:47 +00:00
semi4.go cmd/compile/internal/parser: improved a couple of error messages 2017-02-24 18:54:36 +00:00
semi5.go
semi6.go cmd/compile/internal/syntax: differentiate between ';' and '\n' in syntax errors 2017-02-09 01:45:17 +00:00
semi7.go
topexpr.go
typesw.go cmd/compile: better handling of incorrect type switches 2018-04-03 05:34:20 +00:00
vareq1.go
vareq.go