Skip to content

(kernel) application type mismatch #10353

@MikaelMayer

Description

@MikaelMayer

Prerequisites

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

Description

The following file has a kernel issue. Any comment with RB indicates that doing so will remove the bug, so it's pretty unstable. I was not able to reduce it further.

-- RB == removes bug
-- Removing IndentW RB
structure IW : Type 1 where
  I : Type

mutual

def aux (iw: IW) (e : Nat) (sm : List iw.I)
  : Nat :=
  e

-- I: Type instead of iw: IW RB
def aval (iw: IW) (n : Nat) (e : Nat) : Nat :=
  match n with
  | 0 => e
  | n' + 1 =>
      let e1 :=
        let input_map: List iw.I := [] --lifting RB
        let new_e := aux iw e input_map -- removing args RB
        avalCore iw n' new_e -- inlining RB
      avalCore iw n' e

-- Inlining RB
def avalCore (iw: IW) (n' : Nat) (e : Nat) : Nat :=
  aval iw n' e

end

Output

(kernel) application type mismatch
  aux (wfParam iw) (wfParam e) n'
argument has type
  Nat
but function has type
  List (IW.I (wfParam iw)) → Nat

Context

I minimize a lambda calculus rewriting and stumbled on this today.

Steps to Reproduce

  1. Copy the code above
  2. Paste it on https://live.lean-lang.org/#project=lean-nightly
  3. Expand the info and observe the error message

Expected behavior: The file shouldn't fail

Actual behavior: The file fails

Versions

4.23.0-rc2
live.lean-lang.org and Windows

Additional Information

No configuration necessary

Impact

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

Metadata

Metadata

Assignees

Labels

P-mediumWe may work on this issue if we find the timebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions