dart-lang / dart-lang/language
Will modules facilitate partial classes?
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
From https://github.com/dart-lang/language/issues/1749#issuecomment-884605718:
> For me it is seems logical that for friends all visibility related features work as they were the same module - not just access, but also overrides. In particular because access and overrides are the same feature - building the interface of a class.
Would this discussion benefit "partial classes" (#252)? Previously, a few questions came up in discussion and in my head:
1. How would the compiler know when to stop looking for more `partial` declarations?
2. Where should the "canonical" declaration go? In other words, what do you import?
3. Which libraries should get to reference private members? What if each partial declaration has its own private members?
Modules would answer all of those questions: the partial class may be split between different libraries, but the class as a whole would belong to the module. I saw that partial classes are not yet on the roadmap, maybe this can change that? Not to mention, both partial classes and modules are a huge step towards metaprogramming. Thoughts?
Contributor guide
Research direction
Start by reading the linked discussion in issue #1749 and the partial-classes discussion in issue #252. Compare the three questions about compiler stopping points, canonical declarations, and private-member visibility with the proposed module model. Done would require an agreed language design and a clear decision on whether modules should affect the partial-classes roadmap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100