...
1 package main
2
3 import (
4 "os"
5 "reflect"
6 "runtime"
7
8 "testshared/depBase"
9 )
10
11
12
13 func DeclaredInMain() {
14 }
15
16 type C struct {
17 }
18
19 func F() *C {
20 return nil
21 }
22
23 var slicePtr interface{} = &[]int{}
24
25 func main() {
26 defer depBase.ImplementedInAsm()
27
28
29
30 reflect.TypeOf(os.Stdout).Elem()
31 runtime.GC()
32 depBase.V = depBase.F() + 1
33
34 var c *C
35 if reflect.TypeOf(F).Out(0) != reflect.TypeOf(c) {
36 panic("bad reflection results, see golang.org/issue/18252")
37 }
38
39 sp := reflect.New(reflect.TypeOf(slicePtr).Elem())
40 s := sp.Interface()
41
42 if reflect.TypeOf(s) != reflect.TypeOf(slicePtr) {
43 panic("bad reflection results, see golang.org/issue/18729")
44 }
45 }
46
View as plain text