Laythe-lang / Laythe

A gradually typed language originally based on the crafting interpreters series
MIT License
65 stars 4 forks source link

Inline Cache is broken for the repl #149

Open jonnyboyC opened 1 month ago

jonnyboyC commented 1 month ago

Running the following in the repl blows up

class A {
  init() {
    @a = 10;
  }
}
let b = A();

This occurs because repl shares a single module. Currently compile each line one at a time which in term nukes the inline cache. When we then attempt a lookup for @a = 10 we miss the cache and bail out.

There are many options here for how to address.