support for `scoped` and `local` default instances
Open
Nobody has claimed this yet.
bug
P-medium
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
The attribute default_instance currently does not support local and scoped modifiers.
Motivation:
/-- info: 1 + 2 : Nat -/
#guard_msgs in #check 1 + 2
@[local default_instance 101] -- Error: `default_instance` must be global
instance instOfNatInt (n : Nat) : OfNat Int n where
ofNat := n
/-- info: 1 + 2 : Int -/
#guard_msgs in #check 1 + 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of the default_instance attribute and how local and scoped modifiers are handled for other attributes. Use the supplied #guard_msgs examples as regression tests; done means both modifiers are accepted and the expected Nat and Int instance selection works.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100