orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
40 stars 3 forks source link

Compiler crashes on clause with value pattern and guard #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Procedure to Repeat:
def g(0, x) if (true) = x
def g(x, y) = x+1 #
g(0)

OR

def g(0) if (true) = 0
def g(x) = x+1 #
g(0)

will crash the compiler with an assertion (caused by a reference to a variable 
not in the context). However if you remove the guard they work fine.

Version and Platform:
r3117 inside eclipse on linux and Try Orc.

I believe this problem is caused by a generated variable being referenced 
without binding. 

Original issue reported on code.google.com by arthur.peters on 4 Dec 2012 at 9:51

GoogleCodeExporter commented 9 years ago

Original comment by arthur.peters on 4 Dec 2012 at 10:04

GoogleCodeExporter commented 9 years ago
Fixed in r3133. This was an operator precedence mistake caused by the 
difference between the Orc and Scala DSL operator precedence.

Original comment by arthur.peters on 11 Dec 2012 at 12:06