Skip to content

Make Case Doesn't expand variables into dot patterns #180

@eldritch-cookie

Description

@eldritch-cookie

using the following code with the standard library

open import Data.Nat 
  using (ℕ; _+_)
open 
data _≤_ : Set where
  lte : (a b : ℕ)  a ≤ a + b
infix 4 _≤_
suc-mono : {x y : ℕ}  x ≤ y  suc x ≤ suc y
suc-mono {x} {y} x≤y = {! !}

if you MakeCase on x≤y then y will be constrained and should be a dot pattern
we can be certain of this because if we try to then MakeCase on y the following error will appear

/home/daily/projects/learn/agda/src/MREdot.agda:10.30-35: error: [Interaction.CaseSplitError]
Cannot split on variable y, because it is bound to x + b
when checking that the expression ? has type suc x ≤ suc (x + b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions