1// Copyright 2020 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
5package main
6
7type MyBool bool
8type MyComplex128 complex128
9type MyComplex64 complex64
10type MyFloat32 float32
11type MyFloat64 float64
12type MyInt int
13type MyInt8 int8
14type MyInt16 int16
15type MyInt32 int32
16type MyInt64 int64
17type MyString string
18type MyUint uint
19type MyUint8 uint8
20type MyUint16 uint16
21type MyUint32 uint32
22type MyUint64 uint64
23type MyUintptr uintptr
24
25func panicCustomComplex64() {
26	panic(MyComplex64(0.11 + 3i))
27}
28
29func panicCustomComplex128() {
30	panic(MyComplex128(32.1 + 10i))
31}
32
33func panicCustomString() {
34	panic(MyString("Panic\nline two"))
35}
36
37func panicCustomBool() {
38	panic(MyBool(true))
39}
40
41func panicCustomInt() {
42	panic(MyInt(93))
43}
44
45func panicCustomInt8() {
46	panic(MyInt8(93))
47}
48
49func panicCustomInt16() {
50	panic(MyInt16(93))
51}
52
53func panicCustomInt32() {
54	panic(MyInt32(93))
55}
56
57func panicCustomInt64() {
58	panic(MyInt64(93))
59}
60
61func panicCustomUint() {
62	panic(MyUint(93))
63}
64
65func panicCustomUint8() {
66	panic(MyUint8(93))
67}
68
69func panicCustomUint16() {
70	panic(MyUint16(93))
71}
72
73func panicCustomUint32() {
74	panic(MyUint32(93))
75}
76
77func panicCustomUint64() {
78	panic(MyUint64(93))
79}
80
81func panicCustomUintptr() {
82	panic(MyUintptr(93))
83}
84
85func panicCustomFloat64() {
86	panic(MyFloat64(-93.70))
87}
88
89func panicCustomFloat32() {
90	panic(MyFloat32(-93.70))
91}
92
93func init() {
94	register("panicCustomComplex64", panicCustomComplex64)
95	register("panicCustomComplex128", panicCustomComplex128)
96	register("panicCustomBool", panicCustomBool)
97	register("panicCustomFloat32", panicCustomFloat32)
98	register("panicCustomFloat64", panicCustomFloat64)
99	register("panicCustomInt", panicCustomInt)
100	register("panicCustomInt8", panicCustomInt8)
101	register("panicCustomInt16", panicCustomInt16)
102	register("panicCustomInt32", panicCustomInt32)
103	register("panicCustomInt64", panicCustomInt64)
104	register("panicCustomString", panicCustomString)
105	register("panicCustomUint", panicCustomUint)
106	register("panicCustomUint8", panicCustomUint8)
107	register("panicCustomUint16", panicCustomUint16)
108	register("panicCustomUint32", panicCustomUint32)
109	register("panicCustomUint64", panicCustomUint64)
110	register("panicCustomUintptr", panicCustomUintptr)
111}
112