Zulip Chat Archive

Stream: new members

Topic: Unused variable in set constructor


Lars Ericson (Dec 06 2024 at 13:50):

If I say

import Mathlib
def TotalSet := { n:  | True }

I get warning message

unused variable `n`
note: this linter can be disabled with `set_option linter.unusedVariables false`

If I change it to

import Mathlib

def TotalSet := { _:  | True }

I get error message

unexpected syntax
  {_ :  | True}

Is there a way to satisfy the linter without disabling it?

Ruben Van de Velde (Dec 06 2024 at 14:06):

Does _n work?

Lars Ericson (Dec 06 2024 at 14:12):

Yes, thanks.

import Mathlib
def TotalSet := { _n:  | True }

Last updated: May 02 2025 at 03:31 UTC