mutable decl syntax change
This commit is contained in:
@@ -19,7 +19,7 @@ native_pair func(value native.Pair) native.Pair {
|
||||
global_pair native.Pair :: native.Pair { left = 1, right = 2 }
|
||||
|
||||
main func() i32 {
|
||||
pair native.Pair = native_pair(global_pair)
|
||||
pair native.Pair := native_pair(global_pair)
|
||||
pair.left = 10
|
||||
pair = native.echo_pair(pair)
|
||||
pairs [1]native.Pair :: [pair]
|
||||
@@ -33,7 +33,7 @@ main func() i32 {
|
||||
tail = 13,
|
||||
})
|
||||
arrays native.Arrays :: native.echo_arrays(native.Arrays { values = [14, 15, 16] })
|
||||
choice native.Choice = native.Choice { decimal = 1.0 }
|
||||
choice native.Choice := native.Choice { decimal = 1.0 }
|
||||
choice.integer = 17
|
||||
choice = native.echo_choice(choice)
|
||||
forward native.Forward :: native.echo_forward(native.Forward { value = 19 })
|
||||
|
||||
@@ -5,7 +5,7 @@ native :: import "../include/native.h"
|
||||
# self-referential `?*mut Node` field as C-layout-compatible.
|
||||
|
||||
main func() i32 {
|
||||
node native.Node = native.Node { next = null, value = 7 }
|
||||
node native.Node := native.Node { next = null, value = 7 }
|
||||
if node.next |_| {
|
||||
return 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user