Commit c956dcdc authored by Daniel Morsing's avatar Daniel Morsing

cmd/gc: Reject parenthesised .(type) expressions.

Fixes #4470.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6949073
parent b9da27be
......@@ -1020,6 +1020,7 @@ pexpr:
case OPACK:
case OTYPE:
case OLITERAL:
case OTYPESW:
$$ = nod(OPAREN, $$, N);
}
}
......
This diff is collapsed.
// errorcheck
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 4470: parens are not allowed around .(type) "expressions"
package main
func main() {
var i interface{}
switch (i.(type)) { // ERROR "outside type switch"
default:
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment