Opened 9 years ago

Closed 9 years ago

Last modified 44 years ago

#460 closed bug (Fixed)

reporting the origin of kind errors

Reported by: nokta_kanto Owned by: nobody
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 6.4
Keywords: Cc:
Operating System: Architecture:
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This code produces a kind error in the class declaration.  
There is indeed a kind error, but I think the error message 
is somewhat misleading.  It reports a kind error in the class 
declaration.  The kind error is due to an inconsistency 
between usage of "Name" in the class and data 
declarations. 
 
It would make more sense to me if the kind error were 
reported in the data declaration, or if it contained some 
information on how the expected kind was inferred. 
 
-- beginning of code 
class (Show a, Eq a, Monad m) => Name m a where 
    hashName :: a -> Int 
    newName :: m a 
 
data Name a => Exp a 
-- end of code 
 
The error reported is: 
test2.hs:1:0: 
    Couldn't match kind `*' against `k_a16S -> *' 
    In the class declaration for `Name' 
 

Change History (2)

comment:1 Changed 9 years ago by simonpj

Logged In: YES 
user_id=50165

Happily this one is fixed already: (Will be in 6.4.1)

Foo1.hs:7:5:
    Kind error: `Name a' is not applied to enough type 
arguments
    In the data type declaration for `Exp'

Thanks for reporting it

comment:2 Changed 9 years ago by simonpj

  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.