1
0
mirror of https://github.com/golang/go synced 2024-11-06 01:46:12 -07:00
go/test/fixedbugs/issue18393.go
Robert Griesemer 5e954047bc cmd/compile: be slightly more tolerant in case of certain syntax errors
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>
2017-03-24 20:07:15 +00:00

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"