Skip to content

Commit 11f92e9

Browse files
ALTreemdempsky
authored andcommitted
cmd/compile: add test for fixed ICE on untyped conversion
The ICE reported as #33308 was fixed by a related CL; this change adds a regression test with the crasher. Fixes #33308 Change-Id: I3260075dbe3823b56b8825e6269e57a0fad185a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/243458 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
1 parent 0951939 commit 11f92e9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/fixedbugs/issue33308.go

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// errorcheck
2+
3+
// Copyright 2020 The Go Authors. All rights reserved. Use of this
4+
// source code is governed by a BSD-style license that can be found in
5+
// the LICENSE file.
6+
7+
// Test that the compiler does not crash on a []byte conversion of an
8+
// untyped expression.
9+
package p
10+
11+
var v uint
12+
var x = []byte((1 << v) + 1) // ERROR "cannot convert"

0 commit comments

Comments
 (0)