JSAbrahams / mamba

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

Desugar match rule always expects Id type #138

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Description of Bug

Desugar rule expects id type as condition, so we cannot for instance have an id or underscore without accompanying type.

How to Reproduce

The following will trigger the error:

def a <- self.z_modified handle
            err: Err1 => print "hello"
            err => print "world" # this causes an error during desugar stage

Expected behavior

The desugar stage should be able to handle id and underscore as match arm conditions, in addition to the current id type.