blob: d9b77a9dba45b5267bd520c2327c10a38796a740 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package main
import . "./constructor_copy"
func main() {
f1 := NewFoo1(3)
f11 := NewFoo1(f1)
if f1.GetX() != f11.GetX() {
panic("f1/f11 x mismatch")
}
bi := NewBari(5)
bc := NewBari(bi)
if bi.GetX() != bc.GetX() {
panic("bi/bc x mismatch")
}
bd := NewBard(5)
good := false
func() {
defer func() {
if recover() != nil {
good = true
}
}()
NewBard(bd)
}()
if !good {
panic("bd !good")
}
}
|