From 6222997047dda627e9b65c880e772ac5042d62d8 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 26 Oct 2017 13:39:41 -0700 Subject: [PATCH] test: add type alias test that caused gccgo to crash Change-Id: I3b388e4ac05ace5b7768ade03df2bee5bcc26ba8 Reviewed-on: https://go-review.googlesource.com/73790 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Than McIntosh --- test/fixedbugs/bug505.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/fixedbugs/bug505.go diff --git a/test/fixedbugs/bug505.go b/test/fixedbugs/bug505.go new file mode 100644 index 0000000000..062a087168 --- /dev/null +++ b/test/fixedbugs/bug505.go @@ -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} +} -- 2.48.1