cartazio / omega

Automatically exported from code.google.com/p/omega
Other
4 stars 0 forks source link

pattern matching of functions should be rejected (as in GHC) #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The below expression type-checks and executes in Omega:

case Just of { Just -> 42 }

Here is the transcript:

prompt> case Just of { Just -> 42 }

Case match failure
The value: <primfun Just>
doesn't match any of the patterns:
  Just
(Vprimfun Just)

GHC rejects it (rightfully so):

Prelude> case Just of { Just -> 42 }

<interactive>:1:15:
    Couldn't match expected type `a -> Maybe a'
           against inferred type `Maybe a1'
    In the pattern: Just
    In a case alternative: Just -> 42
    In the expression: case Just of { Just -> 42 }

Original issue reported on code.google.com by ggr...@gmail.com on 3 Feb 2011 at 10:43

GoogleCodeExporter commented 9 years ago
Looking at GHCi's output ...
... looks also buggy to me ;-)

Original comment by ggr...@gmail.com on 29 Aug 2011 at 6:33