aboutsummaryrefslogtreecommitdiffhomepage
path: root/errortest/mainapp/typecompat.slul
blob: 8aad686bf26797dfa5ebcb81dc4ed2712c88db97 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542

#
# Test of type compatibility (negative tests).
# See also testexec/mainapp/typecompat.slul for positive tests.
#
# Copyright © 2022-2023 Samuel Lidén Borell <samuel@kodafritt.se>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

# ERROR .34: error: Incompatible types
data bool typecompat_incompat1 = ""
# ERROR .36: error: Incompatible types
data string typecompat_incompat2 = true

# ERROR .35: error: Incompatible types. Array lengths differ
data [1]int typecompat_int_arr1 = typecompat_int_arr
data [2]int typecompat_int_arr = [11,22]
# ERROR .35: error: Incompatible types. Array lengths differ
data [3]int typecompat_int_arr3 = typecompat_int_arr
# ERROR .37: error: Incompatible types. Nested types must match exactly
data [2]bool typecompat_bool_arr1 = typecompat_int_arr
# ERROR .40: error: Incompatible types. Nested types must match exactly
data [2]uint64 typecompat_uint64_arr = typecompat_int_arr
# ERROR +2.38: error: Incompatible types
# ERROR .40: error: Incompatible types
data [2]bool typecompat_bool_arr2 = [1,2]
data [3,2]int typecompat_arr_deep = [[1,2], [3,4], [5,6]]
# ERROR +4.42: error: Incompatible types. Array lengths differ
# ERROR +3.43: error: Incompatible types. Array lengths differ
# ERROR +2.50: error: Incompatible types. Array lengths differ
# ERROR .57: error: Incompatible types. Array lengths differ
data [2,3]int typecompat_arr_mismatch1 = [[1,2], [3,4], [5,6]]
# ERROR .42: error: Incompatible types. Array lengths differ
data [2,3]int typecompat_arr_mismatch2 = typecompat_arr_deep
# ERROR .40: error: Incompatible types. Array lengths differ
data [3]int typecompat_arr_mismatch3 = typecompat_arr_deep[0]

type TypeCompat1 = int   # used in tests of reference types
type TypeCompatA = int
type TypeCompatB = int
data TypeCompatA typecompat_named1 = 123
# ERROR .38: error: Mismatch of named types
data TypeCompatB typecompat_named2 = typecompat_named3
data TypeCompatA typecompat_named3 = 123
# ERROR .38: error: Mismatch of named types
data TypeCompatB typecompat_named4 = typecompat_named3

data struct { int a } exprchk_struct1 = (.a=123)
# ERROR .35: error: Struct types have different number of fields
data struct { } exprchk_struct2 = exprchk_struct1
# ERROR .42: error: Incompatible types. Nested types must match exactly
data struct { bool a } exprchk_struct3 = exprchk_struct1
type ExprChkStructTypeA = struct {
    int x
    # ERROR .5: <-- target type: ExprChkStructTypeA
    ref bool y
}
type ExprChkStructTypeB = struct {
    int x
    # ERROR .5: <-- target type: ExprChkStructTypeB
    ref int y
}
type ExprChkStructTypeC = struct {
    int x
    int y
}

func typecompat_named()
{
    TypeCompatA a = 1
    # ERROR .21: error: Mismatch of named types
    TypeCompatB b = a
    # ERROR +2.21: error: Mismatch of named types
    # ERROR .25: error: Mismatch of named types
    TypeCompatB c = a + a
    # ERROR .31: error: Mismatch of named types
    TypeCompatB d = (1+2) + ((a+3) + (4+5))
}

func typecompat_refto_deref()
{
    int i = 123
    var int vi = 123
    bool b = true
    var bool vb = true

    # TODO get rid of second error
    # ERROR +2.26: error: Incompatible references. Types must match exactly
    # ERROR .32: error: Incompatible types
    var ref var int ip = refto vb
    # ERROR .28: error: Incompatible references. Qualifiers must be compatible
    var ref var bool vbp = refto b
    # TODO require "aliased" qualifier in cases like this
    #var ref bool bp = refto vb
    # TODO get rid of second error
    # ERROR +2.10: error: Incompatible references. Types must match exactly
    # ERROR .16: error: Incompatible types
    ip = refto vb
    # ERROR .16: error: Incompatible types
    deref ip = b
    # ERROR .16: error: Incompatible types
    vi = deref vbp
}

func typecompat_get_open_type() -> ref OpenType
{
    while true { }
}

func typecompat_open_types()
{
    # ERROR .14: error: Open types can only be used inside a "ref"
    OpenType ot1
    # ERROR .17: error: Open types can only be used inside a "ref"
    [2]OpenType ot2
    # ERROR .21: error: Open types can only be used inside a "ref"
    ref [2]OpenType ot3
    ref OpenType ot_ref = typecompat_get_open_type()
    ClosedType ct = (.x=123)
    # ERROR .20: error: Mismatch of named types
    deref ot_ref = ct
    # ERROR .20: error: Struct cannot be created outside its implementation module
    deref ot_ref = (.x=123)
}

func typecompat_builtins_ranges()
{
    var int i = 123
    var int8 i8 = 123
    var int16 i16 = 123
    var int32 i32 = 123
    var int64 i64 = 123
    var uint ui = 123
    var byte u8 = 123
    var uint16 u16 = 123
    var uint32 u32 = 123
    var uint64 u64 = 123
    var wuint wui = 123
    var wuint8 wu8 = 123
    var wuint16 wu16 = 123
    var wuint32 wu32 = 123
    var wuint64 wu64 = 123
    var usize us = 123
    var ssize ss = 123
    var fileoffs fo = 123

    # ERROR .9: error: Incompatible types. Target type has shorter range
    i = i64
    # ERROR .9: error: Incompatible types. Target type has shorter range
    i = u32
    # ERROR .9: error: Incompatible types. Target type has shorter range
    i = u64
    # ERROR .9: error: Incompatible types. Target type has shorter range
    i = wu32
    # ERROR .9: error: Incompatible types. Target type has shorter range
    i = wu64
    # ERROR .9: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i = us
    # ERROR .9: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i = ss
    # ERROR .9: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i = fo

    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = i
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = i16
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = i32
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = i64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = ui
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = u8
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = u16
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = u32
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = u64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = wui
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = wu8
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = wu16
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = wu32
    # ERROR .10: error: Incompatible types. Target type has shorter range
    i8 = wu64
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i8 = us
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i8 = ss
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i8 = fo

    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = i
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = i32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = i64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = ui
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = u16
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = u32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = u64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = wui
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = wu16
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = wu32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i16 = wu64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i16 = us
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i16 = ss
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i16 = fo

    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = i64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = ui
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = u32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = u64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = wu32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i32 = wu64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i32 = us
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i32 = ss
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i32 = fo

    # ERROR .11: error: Incompatible types. Target type has shorter range
    i64 = u64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    i64 = wu64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i64 = us
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i64 = ss
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    i64 = fo

    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = i
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = i8
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = i16
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = i32
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = i64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    ui = u64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    ui = wu64
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    ui = us
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = ss
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    ui = fo

    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = i
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = i8
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = i16
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = i32
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = i64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = ui
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = u16
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = u32
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = u64
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = wui
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = wu16
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = wu32
    # ERROR .10: error: Incompatible types. Target type has shorter range
    u8 = wu64
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    u8 = us
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = ss
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    u8 = fo

    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = i
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = i8
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = i16
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = i32
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = i64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = ui
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = u32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = u64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = wui
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = wu32
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u16 = wu64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    u16 = us
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = ss
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u16 = fo

    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = i
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = i8
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = i16
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = i32
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = i64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u32 = u64
    # ERROR .11: error: Incompatible types. Target type has shorter range
    u32 = wu64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    u32 = us
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = ss
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u32 = fo

    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = i
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = i8
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = i16
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = i32
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = i64
    # ERROR .11: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    u64 = us
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = ss
    # ERROR .11: error: Incompatible types. Target type does not accept signed types
    u64 = fo

    # ERROR .12: error: Incompatible types. Target type does not accept signed types
    wu64 = i
    # ERROR .11: error: Incompatible types. Target type has shorter range
    wu8 = u16
    # ERROR .12: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    wu64 = us
    # ERROR .12: error: Incompatible types. Target type does not accept signed types
    wu64 = ss
    # ERROR .12: error: Incompatible types. Target type does not accept signed types
    wu64 = fo

    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    us = i
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    us = i8
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range (but at least 32 bits)
    us = u64
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    us = ss
    # ERROR .10: error: Incompatible types. Target type does not accept signed types
    us = fo

    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range (but at least 32 bits)
    ss = u32
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range (but at least 32 bits)
    ss = u64
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    ss = us
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    ss = fo

    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range (but at least 32 bits)
    fo = u32
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range (but at least 32 bits)
    fo = u64
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    fo = us
    # ERROR .10: error: Incompatible types. usize/ssize/fileoffs types have system-dependent range
    fo = ss
}


func get_ref()   -> ref   var TypeCompat1 { while true {} }
func get_arena() -> arena var TypeCompat1 { while true {} }
func get_own()   -> own   var TypeCompat1 { while true {} }
func take_ref(ref TypeCompat1 x)      { while true {} }
func take_arena(arena TypeCompat1 x)  { while true {} }
func take_own(own TypeCompat1 x)      { while true {} }

func get_refref() -> ref ref var TypeCompat1 { while true {} }
func take_refref(ref ref var TypeCompat1 x) { while true {} }

func get_const_ref() -> ref TypeCompat1 { while true {} }

func typecompat_refs()
{
    # ERROR .23: error: Incompatible types
    take_arena(get_ref())
    # ERROR .21: error: Incompatible types
    take_own(get_ref())

    # ERROR .36: error: Incompatible types
    own TypeCompat1 owned = get_ref()
    take_own(owned)
    ref TypeCompat1 refd = get_ref()
    # ERROR .14: error: Incompatible types
    take_own(refd)

    # ERROR .33: error: Incompatible references. Types must match exactly
    ref bool wrongtype = get_ref()

    # ERROR .37: error: Incompatible nested reference types
    ref ref var int rr1 = get_refref()
    # ERROR .41: error: Incompatible nested reference types. Qualifiers must be exactly the same
    ref ref TypeCompat1 rr2 = get_refref()
    # ERROR .17: error: Incompatible nested reference types. Qualifiers must be exactly the same
    take_refref(rr2)

    # ERROR .47: error: Incompatible references. Qualifiers must be compatible
    ref var TypeCompat1 quals1 = get_const_ref()
    # ERROR .53: error: Incompatible nested reference types. Qualifiers must be exactly the same
    ref ref threaded TypeCompat1 quals2 = get_refref()
}

func typecompat_structs()
{
    var struct {
        int x
        int y
    } ac = (.x=0, .y=0)
    # ERROR +4.12: error: Incompatible types. Nested type does not match
    var struct {
        int x
        ref int y
    } ab = ac
    # ERROR +4.12: error: Incompatible types. Nested types must match exactly
    var struct {
        int x
        ref bool y
    } aa = ab
    var ExprChkStructTypeC nc = (.x=0, .y=0)
    # ERROR .33: error: Incompatible types. Nested type does not match
    var ExprChkStructTypeA na = ac
    # ERROR .33: error: Incompatible types. Nested type does not match
    var ExprChkStructTypeB nb = ac
    # TODO allow anonymous enum types in local variables? and forbid anonymous struct types in parameters?
    # XXX related: add "," as a separator? e.g.  type T = struct { int x, bool b }

    na = na
    nb = nb
    nc = nc
    aa = aa
    ab = ab
    ac = ac

    na = aa
    nb = ab
    nc = ac
    aa = na
    ab = nb
    ac = nc

    # ERROR .10: error: Mismatch of named types
    na = nb
    # ERROR .10: error: Mismatch of named types
    na = nc
    # ERROR .10: error: Mismatch of named types
    nb = na
    # ERROR .10: error: Mismatch of named types
    nb = nc
    # ERROR .10: error: Mismatch of named types
    nc = na
    # ERROR .10: error: Mismatch of named types
    nc = nb

    # ERROR .10: error: Incompatible types. Nested types must match exactly
    aa = ab
    # ERROR .10: error: Incompatible types. Nested type does not match
    aa = ac
    # ERROR .10: error: Incompatible types. Nested types must match exactly
    ab = aa
    # ERROR .10: error: Incompatible types. Nested type does not match
    ab = ac
    # ERROR .10: error: Incompatible types. Nested type does not match
    ac = aa
    # ERROR .10: error: Incompatible types. Nested type does not match
    ac = ab
}