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: suppress typecheck errors in a type switch case with broken type #28965

Closed
wants to merge 5 commits into from
Closed

cmd/compile: suppress typecheck errors in a type switch case with broken type #28965

wants to merge 5 commits into from

Conversation

Skarlso
Copy link
Contributor

@Skarlso Skarlso commented Nov 27, 2018

Once a switch's case broke with a type check error all further checks in the case's body should be suppressed. Checking should continue normally after the broken case's body is passed.

Fixes: #28926

@googlebot googlebot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Nov 27, 2018
@gopherbot
Copy link

This PR (HEAD: d8a6d0f) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/151323 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

Message from Gergely Brautigam:

Patch Set 1:

Hi!

I need some further guidance on how to handle the error testcase and how to test for compiler output.

I was looking at issue22662b.go which if I understand correctly checks the compiler's output? Is that correct? Is there another sample I could look at?

Also, right now the solution looks like this:

❯ go tool compile main.go
main.go:8:7: undefined: G
main.go:11:7: undefined: E
main.go:14:2: undefined: asdf

With code like this:

package main

var t int

func main() {
var e interface{}
switch e := e.(type) {
case G:
e.M()
asdf
case E:
e.D()
}
asdf
}

Is this okay?

Thanks,
Gergely.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: 8a29aaf) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/151323 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

This PR (HEAD: 62ba0a4) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/151323 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

This PR (HEAD: 6c78929) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/151323 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

Message from Kale Blankenship:

Patch Set 6: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gobot Gobot:

Patch Set 6:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=cfa0c444


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gobot Gobot:

Patch Set 6:

Build is still in progress...
This change failed on misc-vet-vetall:
See https://storage.googleapis.com/go-build-log/cfa0c444/misc-vet-vetall_d09767c3.log

Consult https://build.golang.org/ to see whether it's a new failure. Other builds still in progress; subsequent failure notices suppressed until final report.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gobot Gobot:

Patch Set 6: TryBot-Result-1

1 of 19 TryBots failed:
Failed on misc-vet-vetall: https://storage.googleapis.com/go-build-log/cfa0c444/misc-vet-vetall_d09767c3.log

Consult https://build.golang.org/ to see whether they are new failures.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Kale Blankenship:

Patch Set 6:

Doesn't seem like the vet failure is related to this change. Perhaps someone else can advise on that.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 6:

Doesn't seem like the vet failure is related to this change. Perhaps someone else can advise on that.

The vet error should go away if you rebase to tip.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: 03c62d5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/151323 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link

Message from Kale Blankenship:

Patch Set 7: Run-TryBot+1

Patch Set 6: TryBot-Result-1

1 of 19 TryBots failed:
Failed on misc-vet-vetall: https://storage.googleapis.com/go-build-log/cfa0c444/misc-vet-vetall_d09767c3.log

Consult https://build.golang.org/ to see whether they are new failures.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gobot Gobot:

Patch Set 7:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=63f48957


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gobot Gobot:

Patch Set 7: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gergely Brautigam:

Patch Set 7:

Patch Set 7: TryBot-Result+1

TryBots are happy.

I hope you'll still be able to cherry pick this. I had to nuke my Go fork. :/ Now it's saying unknown repository as source. :/

If this doesn't work, I'm happy to open another one.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Brad Fitzpatrick:

Patch Set 7:

Patch Set 7:

Patch Set 7: TryBot-Result+1

TryBots are happy.

I hope you'll still be able to cherry pick this. I had to nuke my Go fork. :/ Now it's saying unknown repository as source. :/

git fetch https://go.googlesource.com/go refs/changes/23/151323/7 && git cherry-pick FETCH_HEAD

If this doesn't work, I'm happy to open another one.

Please just keep using this Change-Id.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

Skarlso added a commit to Skarlso/go that referenced this pull request Dec 19, 2018
…ken type

Once a switch's case broke with a type check error all further checks in the case's body should be suppressed. Checking should continue normally after the broken case's body is passed.

Fixes: golang#28926

Change-Id: I936fcf784c7df15cd39fdc1e43f2c425304f417e
GitHub-Last-Rev: 03c62d5
GitHub-Pull-Request: golang#28965
@gopherbot
Copy link

Message from Gergely Brautigam:

Patch Set 7:

Please just keep using this Change-Id.

Cool! Thanks Brad!


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Josh Bleecher Snyder:

Patch Set 7:

(6 comments)

Looks to me like this is on the right track. Lots of little comments.

My apologies again for the very slow review time. Speedy reviews are critical to the health of the contributor community.


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Gergely Brautigam:

Patch Set 7:

Patch Set 7:

(6 comments)

Looks to me like this is on the right track. Lots of little comments.

My apologies again for the very slow review time. Speedy reviews are critical to the health of the contributor community.

Thanks! No worries! :) I'll address them as soon as I can. :)


Please don’t reply on this GitHub thread. Visit golang.org/cl/151323.
After addressing review feedback, remember to publish your drafts!

@Skarlso Skarlso closed this Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants