JSAbrahams / mamba

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

Outsiders can access private fields #173

Closed JSAbrahams closed 4 years ago

JSAbrahams commented 4 years ago

Description of Bug

Even if a function or field is marked as private, an outsider can still access these.

How to Reproduce

class A
    def private my_field: Int <- 10

def a <- A()
# this should cause the type checker to error, but it doesn't
print a.my_field

Expected behaviour

The type checker should error if we try to access a private field.