Pattern Matching Causes Infinite Type Error
Howsagoin,
This is a report about ghci (7.8.4) with CLaSH 0.4.1
I have a collection of modules that show an odd error. I don't want to send them to the list but I can send them to the developers if they think the described behaviour is definitely an error, which I suspect it is.
When I write:
(a,b) = expression
I get a type error about an occurs check: cannot construct infinite type: t0 ~ (t0 + 1) -1. The error message doesn't mention t0.
However, when I leave out the pattern matching on the tuple and write
var = expression a = fst var b = snd var
where var is a fresh variable, everything is fine. This is odd, because all I did was stripping off the pattern matching.
To make sure, I also tried
var = expression (a,b) = var
This also gave the same type checking error.
If there's anybody willing to have a look at this, please feel free to contact me by email. If you think I should produce a small example, also please let me know, but please note that it already took me several hours before I found that leaving out the pattern matching solved the problem:-(
TIA for your time.
Marc van Dongen dongen@cs.ucc.ie
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.4 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |