| This test verifies that analyzers without RunDespiteErrors are not |
| executed on a package containing type errors (see issue #54762). |
| |
| -- go.mod -- |
| module example.com |
| go 1.12 |
| |
| -- a.go -- |
| package a |
| |
| func _() { |
| // A type error. |
| _ = 1 + "" //@diag(`1 + ""`, re"mismatched types|cannot convert") |
| |
| // A violation of an analyzer for which RunDespiteErrors=false: |
| // no (simplifyrange, warning) diagnostic is produced; the diag |
| // comment is merely illustrative. |
| for _ = range "" { //diag("for _", "simplify range expression", ) |
| |
| } |
| } |