]> Cypherpunks repositories - gostls13.git/commitdiff
bug275: cannot apply real() to a complex array element
authorRobert Griesemer <gri@golang.org>
Wed, 19 May 2010 20:10:00 +0000 (13:10 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 19 May 2010 20:10:00 +0000 (13:10 -0700)
R=r, ken2
CC=golang-dev
https://golang.org/cl/1260041

test/bugs/bug275.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug275.go b/test/bugs/bug275.go
new file mode 100644 (file)
index 0000000..2bbc807
--- /dev/null
@@ -0,0 +1,20 @@
+// $G $D/$F.go || echo BUG should compile
+
+// Copyright 2010 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.
+
+// This is a test case for issue 788.
+
+package main
+
+func main() {
+       var a [1]complex64
+
+       t := a[0]
+       _ = real(t) // this works
+
+       _ = real(a[0]) // this doesn't
+}
+
+// bug275.go:17: internal compiler error: subnode not addable
index 1bed6599a8d27bb8726e78d03c8984bef1bfd9da..22f2f98a6149b6444692d5ab10c3b694b822d837 100644 (file)
@@ -180,3 +180,7 @@ BUG: bug260 failed
 
 =========== bugs/bug274.go
 BUG: errchk: command succeeded unexpectedly
+
+=========== bugs/bug275.go
+bugs/bug275.go:17: internal compiler error: subnode not addable
+BUG should compile