blob: d0df08d8b2578f732e7a7e1784a40da8d8b8e4bf [file] [log] [blame]
This test exercises diagnostics produced for syntax errors.
Because parser error recovery can be quite lossy, diagnostics
for type errors are suppressed in files with syntax errors;
see issue #59888. But diagnostics are reported for type errors
in well-formed files of the same package.
-- go.mod --
module example.com
go 1.12
-- bad.go --
package p
func f() {
append("") // no diagnostic for type error in file containing syntax error
}
func .() {} //@diag(re"func ().", re"expected 'IDENT', found '.'")
-- good.go --
package p
func g() {
append("") //@diag(re`""`, re"a slice")
}