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

case-split fails on private definition in nested namespace #74

Closed
edwinb opened this issue May 20, 2020 · 2 comments
Closed

case-split fails on private definition in nested namespace #74

edwinb opened this issue May 20, 2020 · 2 comments
Labels

Comments

@edwinb
Copy link
Collaborator

edwinb commented May 20, 2020

Issue by MarcelineVQ
Sunday May 10, 2020 at 05:21 GMT
Originally opened as edwinb/Idris2-boot#363


Steps to Reproduce

module Main

namespace Foo1
  foo : Nat -> ()
  foo k1 = ?foo1_rhs
  
namespace Foo2
  export
  foo2 : Nat -> ()
  foo2 k2 = ?foo2_rhs

foo3 : Nat -> ()
foo3 k3 = ?foo3_rhs

Split k1 with any method, e.g. :cs 5 7 k1

Expected Behavior

Expect k1 k2 k3 can all be split to Z (S k) cases.

Observed Behavior

An error of No valid case splits but the underlying cause is a hidden error of :1:1--1:1:Name Main.Foo1.foo is private
This error comes from handleUnify in mkCase called from src/TTImp/Interactive/CaseSplit.idr:getSplitsLHS

This issue does not occur on private definitions that are at the top level, only in nested namespaces.
This issue also appears for the :gd command.

@edwinb edwinb added the status: confirmed bug Something isn't working label May 20, 2020
@idris-lang idris-lang deleted a comment Jun 12, 2020
@jfdm
Copy link
Collaborator

jfdm commented Sep 3, 2020

I've recently been bitten by this bug, but have noticed an interesting aspect.

Given the following snippet:

module Bug

namespace BazzFoo
  public export
  data BazzFoo : Type where
    MkPair : Int -> BazzFoo

  getInt : BazzFoo -> Int
  getInt x = ?getInt_rhs

getInt : BazzFoo -> Int
getInt x = ?getInt_rhs_a

Case splitting on the pattern variable x in Bug.BazzFoo.getInt results in No valid case splits. However, case splitting on x in Bug.getInt works as expected.

redfish64 added a commit to redfish64/Idris2 that referenced this issue Nov 9, 2020
…ined in a sub

module, then the current namespace (accessed by calling getNS) differs
from the function namespace, therefore it is not considered visible by
TTImp.Elab.App.checkVisibleNS
redfish64 added a commit to redfish64/Idris2 that referenced this issue Nov 9, 2020
…ined in a sub

module, then the current namespace (accessed by calling getNS) differs
from the function namespace, therefore it is not considered visible by
TTImp.Elab.App.checkVisibleNS
redfish64 added a commit to redfish64/Idris2 that referenced this issue Nov 9, 2020
…ined in a sub

module, then the current namespace (accessed by calling getNS) differs
from the function namespace, therefore it is not considered visible by
TTImp.Elab.App.checkVisibleNS
redfish64 added a commit to redfish64/Idris2 that referenced this issue Nov 9, 2020
…ined in a sub

module, then the current namespace (accessed by calling getNS) differs
from the function namespace, therefore it is not considered visible by
TTImp.Elab.App.checkVisibleNS
gallais pushed a commit that referenced this issue Nov 11, 2020
module, then the current namespace (accessed by calling getNS) differs
from the function namespace, therefore it is not considered visible by
TTImp.Elab.App.checkVisibleNS
@gallais
Copy link
Member

gallais commented Nov 11, 2020

Fixed by 72af040

@gallais gallais closed this as completed Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants