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/types: error cascade #8799

Closed
adonovan opened this issue Sep 24, 2014 · 3 comments
Closed

go/types: error cascade #8799

adonovan opened this issue Sep 24, 2014 · 3 comments
Assignees
Milestone

Comments

@adonovan
Copy link
Contributor

@adonovan adonovan commented Sep 24, 2014

% cat a.go
package main

func main() {
        x, ok := missing()
        if !ok {
                x = ""
        }
        print(x)
}

% go build a.go
./a.go:4: undefined: missing

% ssadump a.go
a.go:4:11: undeclared name: missing
a.go:4:11: undeclared name: missing
a.go:4:11: assignment count mismatch (2 vs 1)
a.go:5:6: invalid operation: operator ! not defined for ok (variable with invalid type)

There is a cascade of errors arising from a single mistake: that 'missing' is undefined
or mis-spelled.  Given that missing, x, and ok have type 'invalid', as witnessed by the
final error, errors #2-#4 should be suppressed.
@griesemer
Copy link
Contributor

@griesemer griesemer commented Sep 24, 2014

Comment 1:

Labels changed: added release-go1.4, repo-tools.

Status changed to Started.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 24, 2014

Comment 2:

CL https://golang.org/cl/143560043 mentions this issue.

Loading

@griesemer
Copy link
Contributor

@griesemer griesemer commented Sep 24, 2014

Comment 3:

This issue was closed by revision golang/tools@37dd89e.

Status changed to Fixed.

Loading

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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
4 participants