]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/types/check_test.go
[dev.typeparams] all: merge master (46fd547) into dev.typeparams
[gostls13.git] / src / go / types / check_test.go
index 692004facf1ab7173e26bb51671995ca4ee60916..8c8452c9c683d26c478fcef3b6808560c87f978e 100644 (file)
@@ -354,6 +354,13 @@ func TestIndexRepresentability(t *testing.T) {
        testFiles(t, &StdSizes{4, 4}, []string{"index.go"}, [][]byte{[]byte(src)}, false, nil)
 }
 
+func TestIssue47243_TypedRHS(t *testing.T) {
+       // The RHS of the shift expression below overflows uint on 32bit platforms,
+       // but this is OK as it is explicitly typed.
+       const src = "package issue47243\n\nvar a uint64; var _ = a << uint64(4294967296)" // uint64(1<<32)
+       testFiles(t, &StdSizes{4, 4}, []string{"p.go"}, [][]byte{[]byte(src)}, false, nil)
+}
+
 func TestCheck(t *testing.T)     { DefPredeclaredTestFuncs(); testDirFiles(t, "testdata/check", false) }
 func TestExamples(t *testing.T)  { testDirFiles(t, "testdata/examples", false) }
 func TestFixedbugs(t *testing.T) { testDirFiles(t, "testdata/fixedbugs", false) }