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

evalExpr does not handle universe params, but #eval does #3091

Closed
1 task done
eric-wieser opened this issue Dec 18, 2023 · 0 comments · Fixed by #3090
Closed
1 task done

evalExpr does not handle universe params, but #eval does #3091

eric-wieser opened this issue Dec 18, 2023 · 0 comments · Fixed by #3090
Labels
bug Something isn't working

Comments

@eric-wieser
Copy link
Contributor

eric-wieser commented Dec 18, 2023

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Check that your issue is not already filed.
    • Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.

Description

evalExpr fails if any universe parameters are present, but #eval handles them correctly.

Context

This impedes leanprover-community/mathlib4#9135

Steps to Reproduce

import Lean

open Lean

def foo.{u} : Nat := (ULift.up.{u} Nat.zero).down

-- works
universe u in
#eval foo.{u}

-- fails: (kernel) invalid reference to undefined universe level parameter 'u'
#eval do
  let u : Lean.Level := .param `u
  Meta.evalExpr Nat (.const ``Nat []) (.const ``foo [u])

Expected behavior: both examples succeed and output 0

Actual behavior: the second example fails as shown

Versions

4.4.0-rc1

Impact

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

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

Successfully merging a pull request may close this issue.

1 participant