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

Closed jonnyboyC closed 2 weeks ago

jonnyboyC commented 2 months 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.

jonnyboyC commented 2 weeks ago

I believe this was solved by #156

jonnyboyC commented 2 weeks ago

I believe this was solved by #156