aboutsummaryrefslogtreecommitdiff
path: root/testsuite/runnable/record_extension.elna
blob: b195759550abbba77fc55c9139335b516d7185f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")
end.