Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial classes - feature proposal #678

Open
kevmoo opened this issue Nov 11, 2019 · 7 comments
Open

Partial classes - feature proposal #678

kevmoo opened this issue Nov 11, 2019 · 7 comments
Assignees
Labels
feature Proposed language feature that solves one or more problems

Comments

@kevmoo
Copy link
Member

kevmoo commented Nov 11, 2019

A proposal to address request #252

Pending PR: #680

@kevmoo
Copy link
Member Author

kevmoo commented May 20, 2020

@Levi-Lesches
Copy link

Love this feature. Metaprogramming and code-gen is being discussed in #1482 and I'm working on the second version of my proposal (initially #1507) and the idea of where does the code go and how can it be interacted with from other libraries is a big one. My driving principle is that generated code in a .g.dart file should behave the same as though it were hand-written in regular .dart file.

PS: I'm in favor of partial class X instead of class X partial. It fits better with mixin, abstract, extension, and var which describe the declaration itself instead of implements, extends, and on, which only slightly modify the declaration (and thus go after).

@insinfo
Copy link

insinfo commented Sep 15, 2021

Love this feature

@Levi-Lesches
Copy link

I opened #1753 to discuss how modules might revive the discussion around partial classes by answering some fundamental question, and how code-generation boosts the need for this feature.

@kevmoo
Copy link
Member Author

kevmoo commented Oct 29, 2021

@munificent – I'm MORE than happy to close this out and defer to https://github.com/dart-lang/language/blob/master/working/augmentation-libraries/feature-specification.md – just say the word! 😄

@JohnGalt1717
Copy link

This would be great for protobuf as an example because then like C# the classes can be adorned with partial and then we can do things like add interfaces to the classes generated which can be vital when protobuf doesn't support generics but you want to know that a response type has a specific set of properties on it to work with (i.e. totalCount for paging etc.)

@Levi-Lesches
Copy link

Levi-Lesches commented Sep 14, 2022

@JohnGalt1717 not sure about your use case specifically, but you might want to look into extensions. Also:

I'm MORE than happy to close this out and defer to https://github.com/dart-lang/language/blob/master/working/augmentation-libraries/feature-specification.md – just say the word! 😄

@munificent ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems
Projects
None yet
Development

No branches or pull requests

4 participants