Skip to content

Subgoals of compiler solved type classes get ignored #3333

@LiamGoodacre

Description

@LiamGoodacre

In the following reproduction example should require Lacks "hello" r but the compiler accepts this as solved.

module Main where

import Prim.Row (class Lacks)

undefined :: forall a. a
undefined = (\_ -> undefined) 0

data S (r :: Symbol) = S
data R (r :: # Type) = R

union :: forall s r. Lacks s r => S s -> R r
union = undefined

example :: forall r. R (k :: Int | r)
example = union (S :: S "hello")

The implementation of the solved type class Lacks (attempts to) defer to solving the tail of a row when it knows some non-empty prefix.

This isn't specific to Lacks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions