agda / agda

Agda is a dependently typed programming language / interactive theorem prover.

Home Page:https://wiki.portal.chalmers.se/agda/pmwiki.php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression when giving instances with visible arguments

ncfavier opened this issue · comments

module Bug where

postulate
  T : Set
  I : T  Set

record Foo : Set where
  field
    t : T
    instance
      I-t : I t

auto :  {ℓ} {A : Set ℓ}  ⦃ A ⦄  A
auto ⦃ a ⦄ = a

module _ (f : Foo) where -- f needs to be visible
  open Foo f
  bug : I t
  bug = {! auto !}

Trying to give auto fails with

No instance of type I t was found in scope.
when checking that the expression auto has type I t

yet auto is accepted if the hole is removed. This regression appeared somewhere between a445e3b and aa5d8bb.

womp womp. The issue is that I remove instances that have visible arguments in their telescope after the top-level module is checked, but this happens before any interaction. I should do that when serializing it instead