Improve static error for incorrect arities of subclass constructors
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 601
- Forks
- 74
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
Classes with private immutable fields are currently required to have custom constructors. For example,
#lang rhombus
class Secret(private _secret)
this triggers “class needs a custom constructor to initialize private immutable fields”, while
#lang rhombus
class Secret(private _secret):
constructor (secr):
super(secr)
this works. However, this requirement doesn’t seem to properly propagate. For example,
#lang rhombus
class Secret(private _secret):
nonfinal
constructor (secr):
super(secr)
class TopSecret():
extends Secret
this does not trigger “class needs a custom constructor to initialize private immutable fields”, but it simply cannot work.
Contributor guide
No contributing guide indexed for this repository
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
Reproduce the two Rhombus class examples from the issue and compare the diagnostics for direct and indirect subclass construction. Trace where constructor arity and private immutable-field requirements are checked; done means the indirect subclass reports that a custom constructor is required, with regression coverage for the shown examples.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100