File tree 4 files changed +86
-0
lines changed
4 files changed +86
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2019 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package a
6
+
7
+ var pl int
8
+
9
+ type NoitfStruct struct {
10
+ F int
11
+ G int
12
+ }
13
+
14
+ //go:nointerface
15
+ func (t * NoitfStruct ) NoInterfaceMethod () {}
Original file line number Diff line number Diff line change
1
+ // Copyright 2019 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package b
6
+
7
+ import "./a"
8
+
9
+ type EmbedImported struct {
10
+ a.NoitfStruct
11
+ }
12
+
13
+ func Test () []string {
14
+ bad := []string {}
15
+ x := interface {}(new (a.NoitfStruct ))
16
+ if _ , ok := x .(interface {
17
+ NoInterfaceMethod ()
18
+ }); ok {
19
+ bad = append (bad , "fail 1" )
20
+ }
21
+
22
+ x = interface {}(new (EmbedImported ))
23
+ if _ , ok := x .(interface {
24
+ NoInterfaceMethod ()
25
+ }); ok {
26
+ bad = append (bad , "fail 2" )
27
+ }
28
+ return bad
29
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2019 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package main
6
+
7
+ import (
8
+ "fmt"
9
+ "os"
10
+
11
+ "./b"
12
+ )
13
+
14
+ // Test case for issue 30862.
15
+
16
+ // Be aware that unless GOEXPERIMENT=fieldtrack is set when building
17
+ // the compiler, this test will fail if executed with a regular GC
18
+ // compiler.
19
+
20
+ func main () {
21
+ bad := b .Test ()
22
+ if len (bad ) > 0 {
23
+ for _ , s := range bad {
24
+ fmt .Fprintf (os .Stderr , "test failed: %s\n " , s )
25
+ }
26
+ os .Exit (1 )
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ // rundir
2
+
3
+ // Copyright 2019 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
+ // Test case for issue 30862. This test as written will
8
+ // fail for the main 'gc' compiler unless GOEXPERIMENT=fieldtrack
9
+ // is set when building it, whereas gccgo has field tracking
10
+ // enabled by default (hence the build tag below).
11
+
12
+ // +build gccgo
13
+
14
+ package ignored
You can’t perform that action at this time.
0 commit comments