| 1 |
// compile |
| 2 |
|
| 3 |
// Copyright 2018 The Go Authors. All rights reserved. |
| 4 |
// Use of this source code is governed by a BSD-style |
| 5 |
// license that can be found in the LICENSE file. |
| 6 |
|
| 7 |
// A couple of aliases cases that gccgo incorrectly gave errors for. |
| 8 |
|
| 9 |
package p |
| 10 |
|
| 11 |
func F1() { |
| 12 |
type E = struct{} |
| 13 |
type X struct{} |
| 14 |
var x X |
| 15 |
var y E = x |
| 16 |
_ = y |
| 17 |
} |
| 18 |
|
| 19 |
func F2() { |
| 20 |
type E = struct{} |
| 21 |
type S []E |
| 22 |
type T []struct{} |
| 23 |
type X struct{} |
| 24 |
var x X |
| 25 |
s := S{E{}} |
| 26 |
t := T{struct{}{}} |
| 27 |
_ = append(s, x) |
| 28 |
_ = append(s, t[0]) |
| 29 |
_ = append(s, t...) |
| 30 |
} |