JSAbrahams / mamba

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

Context builder does not recognize field inits in python constructors #311

Open JSAbrahams opened 2 years ago

JSAbrahams commented 2 years ago

Description of Bug

Context builder does not recognize field inits in python constructors.

How to Reproduce

Build context from following class written in Python:

class MyClass:
    def __init__(self, a: int):
        self.a = a

Expected behavior

It should produce a context with MyClass which has one field a: Int. However, the class has no such field.

Additional context

We should traverse the constructor and make not of all assignments to self.