parapluu / encore

The Encore compiler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access to arrays is broken for non-array accesses

kikofernandez opened this issue · comments

The problem is that the parser considers an ArrayAccess anything that matches x(y) = z. The typechecker goes along and considers that the AST node given by the parser is an array, and tries to typecheck it incorrectly, crashing the compiler.

This has been shown in #823 and also in this example:

active class Main
  def main(): unit
    val x = 3
    x(1) = 2
  end
end

Error thrown:

encorec: No match in record selector argTypes