Initial import
This commit is contained in:
commit
405b86068e
324 changed files with 163599 additions and 0 deletions
20
tests/tconstr2.nim
Executable file
20
tests/tconstr2.nim
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
# Test array, record constructors
|
||||
|
||||
type
|
||||
TComplexRecord = record
|
||||
s: string
|
||||
x, y: int
|
||||
z: float
|
||||
chars: set[char]
|
||||
|
||||
const
|
||||
things: array [0.., TComplexRecord] = [
|
||||
(chars: {'a', 'b', 'c'}, s: "hi", x: 69, y: 45, z: 0.0),
|
||||
(chars: {'a', 'b', 'c'}, s: "hi", x: 69, z: 0.3, y: 45)]
|
||||
otherThings = [ # the same
|
||||
(chars: {'a', 'b', 'c'}, s: "hi", x: 69, y: 45, z: 0.0),
|
||||
(z: 0.0, chars: {'a', 'b', 'c'}, s: "hi", x: 69, y: 45)]
|
||||
|
||||
write(stdout, things[0].x)
|
||||
#OUT 69
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue