Giter Site home page Giter Site logo

Comments (7)

nad avatar nad commented on September 24, 2024

@jespercockx, I guess this is related to issue #6124.

from agda.

cmcmA20 avatar cmcmA20 commented on September 24, 2024
  go2 : Name → Term → TC ⊤
  go2 cons-name hole = do
    raw-ty ← getType cons-name
    inf-ty ← inferType (con cons-name [])
    unify inf-ty raw-ty
    returnTC _

Same error.

fail2 : Set₁
fail2 = {@0 A : Set} → A → Copy A

mk-copy' : {@0 A : Set} → A → Copy A 
mk-copy' = mk-copy

Inlining fail2 in the signature of mk-copy' is OK, but standalone fail2 raises an error.

from agda.

cmcmA20 avatar cmcmA20 commented on September 24, 2024

Btw, for a simplified example

data Copy (A : Set) : Set where
  mk-copy : A → Copy A

checkExpr reports a peculiar type

Checking {@0 A : Set₀} (z : A) → Copy A : Set
            at  $HOME/ErasedReflectionBug.agda:34,8-19
     -->  Set

This is universe inconsistent, Set must be Set1.

from agda.

andreasabel avatar andreasabel commented on September 24, 2024

The following variant passes with Agda 2.6.3 but fails with 2.6.4, so it could be labelled regression:

{-# OPTIONS --erase-record-parameters --safe #-}

open import Agda.Primitive
open import Agda.Builtin.Equality
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit

_>>=_ : {a b : Level} {A : Set a} {B : Set b}  TC A  (A  TC B)  TC B
_>>=_ = bindTC

macro
  go : Name  Term  TC ⊤
  go cons-name hole = do
    raw-ty  getType cons-name
    ty  reduce raw-ty --<-- here
    returnTC _

record Copy {ℓ} (A : Set ℓ) : Setwhere
  constructor mk-copy
  field the-copy : A

success1 success2 : ⊤
success1 = go []
success2 = go _∷_

fail : ⊤
fail = go mk-copy

from agda.

andreasabel avatar andreasabel commented on September 24, 2024

@cmcmA20 Is your issue related/identical to this one?

from agda.

cmcmA20 avatar cmcmA20 commented on September 24, 2024

@andreasabel I guess it is. Slapping workOnTypes on top of all typechecker calls inside tcReduce resolves the problem with go but it feels ad hoc.

from agda.

andreasabel avatar andreasabel commented on September 24, 2024

Maybe since you are reducing a type, using workOnTypes isn't so strange to request here.
The general story is #6400. Closing as duplicate then...

from agda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.