Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(172)

Issue 4914044: code review 4914044: go/parser: fix type switch scoping (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by gri
Modified:
13 years, 10 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

go/parser: fix type switch scoping Introduce extra scope for the variable declared by a TypeSwitchGuard so that it doesn't conflict with vars declared by the initial SimpleStmt of a type switch. This is a replacement for CL 4896053 which caused a build breakage. Also: - explicitly detect type switches (as opposed to detecting expression switches and then do extra testing for type switches) - fix all outstanding TODOs in parser.go - ran all tests

Patch Set 1 #

Patch Set 2 : diff -r 5e1502ab5e21 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 5e1502ab5e21 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r d67e691bae3f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -28 lines) Patch
M src/cmd/gotype/testdata/test1.go View 1 1 chunk +17 lines, -0 lines 0 comments Download
M src/pkg/go/parser/parser.go View 1 8 chunks +41 lines, -28 lines 0 comments Download
M src/pkg/go/parser/parser_test.go View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 3
gri
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 10 months ago (2011-08-18 20:46:56 UTC) #1
rsc
LGTM
13 years, 10 months ago (2011-08-23 15:36:55 UTC) #2
gri
13 years, 10 months ago (2011-08-23 16:22:44 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=7052ad4cdc6a ***

go/parser: fix type switch scoping

Introduce extra scope for the variable declared by a
TypeSwitchGuard so that it doesn't conflict with vars
declared by the initial SimpleStmt of a type switch.

This is a replacement for CL 4896053 which caused
a build breakage.

Also:
- explicitly detect type switches (as opposed to detecting
  expression switches and then do extra testing for type switches)
- fix all outstanding TODOs in parser.go
- ran all tests

R=rsc
CC=golang-dev
http://codereview.appspot.com/4914044
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b