Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ fix #3448 ] Fix %search in constraint #3451

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

spcfox
Copy link
Contributor

@spcfox spcfox commented Dec 20, 2024

Description

Added parameters to constraint hints to fix #3448

Should this change go in the CHANGELOG?

  • If this is a fix, user-facing change, a compiler change, or a new paper
    implementation, I have updated CHANGELOG_NEXT.md (and potentially also
    CONTRIBUTORS.md).

@spcfox spcfox changed the title [ fix #3448 ] Fix constraint search [ fix #3448 ] Fix %search in constraint Dec 20, 2024
@spcfox
Copy link
Contributor Author

spcfox commented Dec 20, 2024

%search still can't find implicitly bound parameters:

X : Type
data Y : X -> Type

failing "While processing constructor MkZ. Can't find an implementation for X"
  interface Y %search => Z (y : Y x) where
    constructor MkZ

interface Y x => Z (y : Y x) where
  constructor MkZ

0 getX : Z y => X
getX = %search

I expected that adding pNames would fix it, but no

@spcfox
Copy link
Contributor Author

spcfox commented Dec 20, 2024

Ok, it's not a problem with interfaces

X : Type
data Y : X -> Type

failing "While processing constructor MkZ. Can't find an implementation for X"
  interface Y %search => Z (y : Y x) where
    constructor MkZ

-- The interface is elaborated into such data
failing "While processing constructor MkZ. Can't find an implementation for X"
  data Z : Y x -> Type where
    MkZ : {y : Y x} -> Y %search => Z y

I created issue #3452 for this

@dunhamsteve
Copy link
Collaborator

This also fixes the issue that I was addressing in #3052, where this would not compile:

%unbound_implicits off
interface Foo a where
interface Foo a => Bar (a : Type) where

The issue there was that the constraints were relying on the unbound implicits mechanism to pick up the a, while all of the other generated code for interfaces was explicitly adding the parameters.

@buzden buzden merged commit 4e8847b into idris-lang:main Feb 17, 2025
22 checks passed
@spcfox spcfox deleted the fix-constraint-search branch February 21, 2025 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

%search cannot find the parameter in the interface constraint
5 participants