-
Notifications
You must be signed in to change notification settings - Fork 380
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,30 +15,6 @@ Warning: We are about to implicitly bind the following lowercase names. | |
You may be unintentionally shadowing the associated global definitions: | ||
a is shadowing Main.R2.R2.a, Main.R1.R1.a | ||
|
||
Fld:76:1--81:38 | ||
76 | interface Show a => (num : Num a) => MyIface a where -- Some interface with | ||
77 | constructor MkIface | ||
78 | -- constraints | ||
79 | data MyData : a -> Type -- and a data declaration. | ||
80 | someFunc : a -> a -- Constraints are now elaborated as auto implicits (as one would expect) | ||
81 | giveBack : {x : a} -> MyData x -> a -- (previously as explicit arguments of the interface | ||
|
||
Warning: We are about to implicitly bind the following lowercase names. | ||
You may be unintentionally shadowing the associated global definitions: | ||
a is shadowing Main.R2.R2.a, Main.R1.R1.a | ||
|
||
Fld:76:1--81:38 | ||
76 | interface Show a => (num : Num a) => MyIface a where -- Some interface with | ||
77 | constructor MkIface | ||
78 | -- constraints | ||
79 | data MyData : a -> Type -- and a data declaration. | ||
80 | someFunc : a -> a -- Constraints are now elaborated as auto implicits (as one would expect) | ||
81 | giveBack : {x : a} -> MyData x -> a -- (previously as explicit arguments of the interface | ||
|
||
Warning: We are about to implicitly bind the following lowercase names. | ||
You may be unintentionally shadowing the associated global definitions: | ||
a is shadowing Main.R2.R2.a, Main.R1.R1.a | ||
|
||
Comment on lines
-18
to
-41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like these warnings were occurring in hints for constraints. They disappeared after changes to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
To me these warning look completely okay, since both interface definition and interface implementations seem to shadow the top-level There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but in the following code a : Type
interface MyIface0 a where
f0 : a -> Type
interface Show a => MyIface1 a where
f1 : a -> Type
interface Show a => (num : Num a) => MyIface2 a where
f2 : a -> Type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A warning about shadowing is produced when a : Type
-- Produce warning
interface Iface1 (x : a) where
-- No warning
interface Iface2 a (x : a) where Previously, it was unbound at elaboration constraint hint |
||
Fld:86:3--86:37 | ||
82 | -- constructor) | ||
83 | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
X : Type | ||
data Y : X -> Type | ||
|
||
interface Y %search => Z (x : X) where |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1/1: Building Issue3448 (Issue3448.idr) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
. ../../../testutils.sh | ||
|
||
check Issue3448.idr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to add parameters?
like in
mkIfaceData
Idris2/src/Idris/Elab/Interface.idr
Line 114 in 457ca7c
and in
getMethDecl
Idris2/src/Idris/Elab/Interface.idr
Line 152 in 457ca7c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that this might be necessary since I added parameters to
fty
, but I can't think of an example where this would have an impact