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

Ambigous Implementations when using using on a constrainted interface implementation #57

Closed
edwinb opened this issue May 20, 2020 · 1 comment

Comments

@edwinb
Copy link
Collaborator

edwinb commented May 20, 2020

Issue by fabianhjr
Wednesday Apr 22, 2020 at 01:23 GMT
Originally opened as edwinb/Idris2-boot#307


Steps to Reproduce

module Test

interface Simple a where
  op : a -> a -> a

interface Simple a => Constraint a where
  square : a -> a
  square x = x `op` x  

-- And
[NamedSimple1] Simple Bool where
  op True True = True
  op _    _    = False

-- Or
[NamedSimple2] Simple Bool where
  op False False = False
  op _     _     = True

[Constrainted1] Constraint Bool using NamedSimple1 where
[Constrainted2] Constraint Bool using NamedSimple2 where

Expected Behavior

Should typecheck and use their corresponding implementations

Observed Behavior

Test.idr:21:1--23:1:While processing right hand side of Constrainted2 at Test.idr:21:1--23:1:
Multiple solutions found in search. Possible correct results:
	NamedSimple1
	NamedSimple2
melted pushed a commit to melted/Idris2 that referenced this issue Jun 1, 2020
Fixes idris-lang#57. Also move much of the 'with' machinery to its own source
file.
@gallais
Copy link
Member

gallais commented Feb 22, 2021

This is now successfully accepted. \o/

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

No branches or pull requests

2 participants