dotty-feature-requests icon indicating copy to clipboard operation
dotty-feature-requests copied to clipboard

allow inline and protected modifier for exports

Open robstoll opened this issue 5 years ago • 0 comments

This includes two feature request and could be split up if needed. IMO it would be nice if we have a way to define export clauses which are only available in subtypes i.e. add a protected modifier to the methods. I see use cases where the repetition of the identifier of the composed/aggregated instance makes readability worse. With the current possibilities a circumstance which is acceptable as adding own protected members which merely delegate are too much boiler plate.

A similar use case is adding the inline modifier (sometimes combined with protected). Here I see mainly use cases where an API is spread over many different components and we wish to unify into a single API / compose it differently but where we don't want to introduce more code which needs to be binary compatible. Having the inline modifier would free us from this problem almost entirely without a big effort.

robstoll avatar May 11 '20 19:05 robstoll