blob: e6e1719dbc091881cd7b76c7219045ca9f59d326 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
Type system problems
====================
Mutable structs with immutable fields
-------------------------------------
Assume that we have a struct:
type S = struct {
var int a
int b # <--- not modifiable
}
Assume that we have two definitions of it, where one is "var":
var S a
S b
Since S has a const field, this means that we can't do the following:
a = b
The type system should enforce this
|