File: constants.go

package info (click to toggle)
golang-golang-x-exp 0.0~git20231006.7918f67-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 6,492 kB
  • sloc: ansic: 1,900; objc: 276; sh: 272; asm: 48; makefile: 27
file content (53 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (4)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package p

// old
type u1 int

// both
type u2 int

// type changes
// old

const (
	C1     = 1
	C2 int = 2
	C3     = 3
	C4 u1  = 4
)

var V8 int

// new
const (
	// i C1: changed from untyped int to untyped string
	C1 = "1"
	// i C2: changed from int to untyped int
	C2 = -1
	// i C3: changed from untyped int to int
	C3 int = 3
	// i V8: changed from var to const
	V8 int = 1
	C4 u2  = 4 // OK: u1 corresponds to u2
)

// value change
// old
const (
	Cr1 = 1
	Cr2 = "2"
	Cr3 = 3.5
	Cr4 = complex(0, 4.1)
)

// new
const (
	// i Cr1: value changed from 1 to -1
	Cr1 = -1
	// i Cr2: value changed from "2" to "3"
	Cr2 = "3"
	// i Cr3: value changed from 3.5 to 3.8
	Cr3 = 3.8
	// i Cr4: value changed from (0 + 4.1i) to (4.1 + 0i)
	Cr4 = complex(4.1, 0)
)