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

Multiple inheritance #58

Open
jacobwilliams opened this issue Oct 28, 2019 · 4 comments
Open

Multiple inheritance #58

jacobwilliams opened this issue Oct 28, 2019 · 4 comments
Labels
Clause 7 Standard Clause 7: Types

Comments

@jacobwilliams
Copy link

Why not allow multiple inheritance? I believe some think this is a bad thing, but from time to time I wish we had it.

Example:

type,extends(base1,base2),public :: myclass
end type myclass

Probably it was discussed at some point?

@FortranFan
Copy link
Member

Fyi for the readers, here are a couple of articles that might be of interest:

Why doesn’t C# support multiple inheritance?

Why not multiple inheritance? Find out why Java's creators prohibited multiple inheritance

@certik
Copy link
Member

certik commented Oct 28, 2019

I feel this feature is the kind of feature that depends on having a long term plan, see #59. The long term plan will then determine whether this is on its path, or not.

As I mentioned in #59, the generic templates should allow an effective "multiple inheritance", so then this feature as proposed here would be superfluous and it'd be better not to have it, to keep the language smaller, without loosing any expressiveness. However, if we decide in #59 that we do not want templates, then this feature might be more compelling.

@klausler
Copy link

klausler commented Nov 1, 2019

Would common base classes be duplicated or combined like C++ virtual bases?

@certik certik added the Clause 7 Standard Clause 7: Types label Apr 23, 2022
@vansnyder
Copy link

I read a long time ago, but I don't remember where (maybe in something that Leslie Hatton wrote), that some language theorist had proven that multiple inheritance is never required. The argument against it is usually entitled "the dreaded diamond-shaped inheritance diagram."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clause 7 Standard Clause 7: Types
Projects
None yet
Development

No branches or pull requests

5 participants