JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Type checker does not recursively check assign #297

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

Description of Bug

How to Reproduce

class Y(def a: Float)

class X
    def y: Y
    def init(self, a: Float) =>
         self.y := Y(a)

def x := X(10)

x.y.a := x.y.a + 2
x.y.a := x.y.a - 3
x.y.a := x.y.a * 6

x.y.a := x.y.a / 7
x.y.a := x.y.a ^ 2

x.y.a := x.y.a << 10

Gives an error that the type checker does not recognize x.y.a

Expected behavior

It should treat x.y.a as a Float in the above example.

Likely need to add more generation logic to fully check the above expression.