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

Regression in inferring universe levels between v4.9.1 and v4.10.0-rc1 #5035

Closed
3 tasks done
mik-jozef opened this issue Aug 14, 2024 · 1 comment
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@mik-jozef
Copy link

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The following code typechecks with Lean 4.9.1, but not with 4.10.1-rc1 and later:

structure Asdf: Type u where

def foo (T: Type u) : Asdf.{u} := {}

def bar
  (T: Type u)
  (holdsForAll: ∀ n: Asdf, True)
:
  True
:=
  let n := foo T
  
  holdsForAll n

The error:

application type mismatch
  holdsForAll n
argument
  n
has type
  Asdf : Type u
but is expected to have type
  Asdf : Type u_1

An easy workaround is to propagate the universe explicitly:

(holdsForAll: ∀ n: Asdf.{u}, True)

Expected behavior: The code produces no errors.

Versions

Lean versions affected: 4.10.0-rc1, lean nightly as of wriging
OS: Ubuntu 22.04.4 LTS

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@mik-jozef mik-jozef added the bug Something isn't working label Aug 14, 2024
@Kha
Copy link
Member

Kha commented Aug 14, 2024

This is an intentional change: #4482

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants