Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/parser: ParseExprFrom doesn't return errors if there were too many errors #34274

Closed
griesemer opened this issue Sep 12, 2019 · 1 comment
Closed
Assignees
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Sep 12, 2019

Here's a simple test case:

package main

import "go/parser"
import "go/token"
import "fmt"

func main() {
	src := "s[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::]"
	fset := token.NewFileSet()
	_, err := parser.ParseExprFrom(fset, "", src, 0)
	if err != nil {
		fmt.Println(err)
	}
}

This should report:

1:3: 2nd index required in 3-index slice (and 10 more errors)

But it doesn't report an error at all.

See also discussion on https://go-review.googlesource.com/c/go/+/194638 .

@griesemer griesemer added this to the Go1.14 milestone Sep 12, 2019
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 14, 2019

Change https://golang.org/cl/194638 mentions this issue: go/parser: fix ignored errors in ParseExprFrom

@gopherbot gopherbot closed this in d12c62d Sep 15, 2019
@golang golang locked and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.