Skip to content

Type error in one function causes wrong type error report in another function when using type families

This ticket is very similar to #5978 (closed), but this time it is about type families. If I load the attached module I get the two error messages:

TypeCheck7_4_1_TF_IncorrectMsg.hs:27:21:
    Couldn't match type `Float' with `Serial Float'
    Expected type: (ValueTuple Vector, ValueTuple Vector)
      Actual type: (Serial Float, Serial Float)
    In the first argument of `processIO', namely `stereoFromMono'
    In the expression: processIO stereoFromMono

TypeCheck7_4_1_TF_IncorrectMsg.hs:42:27:
    Couldn't match type `IO' with `Serial'
    Expected type: (Float, ValueTuple Vector)
      Actual type: (Float, ValueTuple Float)
    In the first argument of `withArgs', namely `plug'
    In the expression: withArgs plug

If I uncomment 'filterFormant', that is, only the second one of the two criticized parts, then the module is accepted.

These two error messages are very confusing because in the original module 'phoneme' was a complex definition and it was not immediately clear that it is actually correct. Trying hard to fix it does not succeed because it is not broken.

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information