gsdlab/clafer — Issue #8: Non-exhaustive patterns in "Sugar-op" and "Case"
Author: mantkiew
Created: 2011-12-03 20:06:33+00:00
State: open

Using clafer 0.0.3

Case 1)
-----------
abstract A
x ?
y ?
[ (x => ! y) && (y => ! x) ]

produces the following error:

C:\Temp>clafer3 -k -m=clafer non-exhaustive-patterns.cfr

Parse Successful!
[Desugaring]
[Resolving]
[Analyzing String]
[Optimizing]
[Generating Code]
All clafers: 3 | Abstract: 1 | Concrete: 2 | References: 0
Constraints: 1
Global scope: 1..*
All names unique: True

[Saving File]
clafer3: Intermediate\Desugarer.hs:(320,5)-(326,35): Non-exhaustive patterns in function sugarOp

Case 2)
-----------
abstract A
x ?
y ?
[ x => ! y && y => ! x ]

produces the following error:

Parse Successful!
[Desugaring]
[Resolving]
[Analyzing String]
[Optimizing]
[Generating Code]
All clafers: 3 | Abstract: 1 | Concrete: 2 | References: 0
Constraints: 1
Global scope: 1..*
All names unique: True

[Saving File]
clafer3: Intermediate\Desugarer.hs:(316,18)-(328,80): Non-exhaustive patterns in case

Case 3)
-----------
abstract A
x ?
y ?
[ x => ! y
y => ! x ]

produces the following error:

Parse Successful!
[Desugaring]
[Resolving]
[Analyzing String]
[Optimizing]
[Generating Code]
All clafers: 3 | Abstract: 1 | Concrete: 2 | References: 0
Constraints: 1
Global scope: 1..*
All names unique: True

[Saving File]
clafer3: Intermediate\Desugarer.hs:(320,5)-(326,35): Non-exhaustive patterns in function sugarOp

Case 4)
-----------
abstract A
x ?
y ?
[ x => ! y ]
[ y => ! x ]

is correct!