mirror of
https://github.com/golang/go
synced 2024-11-24 04:00:13 -07:00
5e954047bc
Avoid construction of incorrect syntax trees in presence of errors. For #19663. Change-Id: I43025a3cf0fe02cae9a57e8bb9489b5f628c3fd7 Reviewed-on: https://go-review.googlesource.com/38604 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
25 lines
551 B
Go
25 lines
551 B
Go
// errorcheck
|
|
|
|
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Test that compiler directives are ignored if they
|
|
// don't start at the beginning of the line.
|
|
|
|
package p
|
|
|
|
//line issue18393.go:20
|
|
import 42 // error on line 20
|
|
|
|
|
|
/* //line not at start of line: ignored */ //line issue18393.go:30
|
|
var x // error on line 24, not 30
|
|
|
|
|
|
// ERROR "import path must be a string"
|
|
|
|
|
|
|
|
// ERROR "syntax error: unexpected newline, expecting type"
|