aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/record_extension.elna
blob: 5f61d60d3c927fe0b684b79418eac7a9590dbc9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
type
  ElnaLexerToken = record
    kind: Word
  end
  ElnaLexerStringToken = record(ElnaLexerToken)
    value: []const Word8
  end

var
  token_memory: ElnaLexerStringToken
  current_token: ^ElnaLexerToken

program()
begin
  current_token := @token_memory;
  cast(current_token: ^ElnaLexerStringToken)^.value := "Some string";

  assert(token_memory.value = "Some string")
return 0u8

end.