Skip to content

Better type error on un-data-encodable records #809

Open
@SeungheonOh

Description

data PFoo (s :: S) = PFoo
  { foo :: Term s (PAsData (PBuiltinList Crypto.PPubKeyHash))
  }

Current, above compiles fine with DeriveAsDataStruct because strategy actually don't check if each field is PIsData. Instead, it checks to see if PInnerMost of each fields are PData. This is to reduce requiring PIsData constraint on every polymorphic types. Technically, it is fine as it is. Since there's no instance PIsData (PBuiltinList Crypto.PPubKeyHash), it is impossible to construct such value altogether.

But, I'd like to have this fail on compilation for better UX

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions