]> Cypherpunks repositories - gostls13.git/commitdiff
test: add type alias test that caused gccgo to crash
authorIan Lance Taylor <iant@golang.org>
Thu, 26 Oct 2017 20:39:41 +0000 (13:39 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 26 Oct 2017 22:52:53 +0000 (22:52 +0000)
Change-Id: I3b388e4ac05ace5b7768ade03df2bee5bcc26ba8
Reviewed-on: https://go-review.googlesource.com/73790
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
test/fixedbugs/bug505.go [new file with mode: 0644]

diff --git a/test/fixedbugs/bug505.go b/test/fixedbugs/bug505.go
new file mode 100644 (file)
index 0000000..062a087
--- /dev/null
@@ -0,0 +1,20 @@
+// compile
+
+// Copyright 2017 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.
+
+// gccgo crashed compiling this file with a failed conversion to the
+// alias type when constructing the composite literal.
+
+package p
+
+type I interface{ M() }
+type A = I
+type S struct {
+       f A
+}
+
+func F(i I) S {
+       return S{f: i}
+}