Skip to content

Instance does not work with predefined instance member that is alias #126

@Ingo60

Description

@Ingo60

Code:

data Byte = pure native "byte" where
    pure native byte "(byte)" :: Int -> Byte
    --- this gives the 'Int' corresponding to the *signed* interpretation of the 'Byte'
    pure native signed "(int)"  :: Byte -> Int
    --- this gives the 'Int' corresponding to the *unsigned* interpretation of the 'Byte'
    unsigned b = signed b Int..&. 0xFF
    hashCode  = Byte.unsigned 

instance Eq Byte where
    pure native == :: Byte -> Byte -> Bool
    pure native != :: Byte -> Byte -> Bool

Error:

F src/tests/comp/Issue126.fr:13:  funForCIT: expected type member, found alias for data type member function `Byte.unsigned`

It does work as soon as one does eta-expansion, i.e.

    hashCode b = Byte.unsigned b

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions