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

cmd/compile: too many errors stops too early -- check other related errors #5142

Open
btracey opened this issue Mar 28, 2013 · 7 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@btracey
Copy link
Contributor

btracey commented Mar 28, 2013

I'm in the middle of debugging a package which is full of a bunch of code I wrote
quickly. At present, the package consists of three files

http://play.golang.org/p/XgNpoFpwcp   filename fluidtensors.go
http://play.golang.org/p/p9897ak11y    filename threedtensor.go
http://play.golang.org/p/8QrkK-IzCp     filename computations.go


when I run gc (version 1.0.3), I get the following output

brendan:~/Documents/mygo$ go build ransuq/tensor
# ransuq/tensor
src/ransuq/tensor/computations.go:9: re.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:10: re.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:11: re.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:13: re.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:25: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:26: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:27: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:29: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:41: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:53: tau.SymTensor.Dim() used as value
src/ransuq/tensor/computations.go:53: too many errors

re.SymTensor.Dim() being used as a value is not a problem. The problem is that the Dim()
method of SymTensor (in threedtensor.go) is incorrectly returning a value. Relevant code
segment:

func (s *SymTensor) Dim() {
    return t.nDim
}

In the ideal case, the compiler would check that the full method of SymTensor is correct
before throwing the error about Dim() being used as a value. Barring that, it would be
nice if the compiler would output some other errors not of that form. The code is
computations is not logically incorrect, it's the code is threedtensor that's incorrect,
and so having this as the only output error is confusing.
@remyoudompheng
Copy link
Contributor

Comment 1:

Did you try the -e compiler flag?

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added priority-later, go1.2maybe, removed priority-triage.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 3:

Not happening for 1.2.

Labels changed: added go1.3maybe, removed go1.2maybe.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 4:

Labels changed: removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 5:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 6:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 7:

Labels changed: added repo-main.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/gc: too many errors stops too early -- check other related errors cmd/compile: too many errors stops too early -- check other related errors Jun 8, 2015
@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants