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

air: replace Clazz.actualClazz by Clazz.handDown(), fix #2214 #2243

Merged
merged 4 commits into from
Nov 17, 2023

Conversation

fridis
Copy link
Member

@fridis fridis commented Nov 16, 2023

The problem with Clazz.actualClazz was that it replaces all generics found in parents and in outer features. This is a problem when a feature inherits from one of its outer features since there are two possible values of the actual generics and for the examplein #2214, the wrong one was used.

With this patch, Clazzes.down now hands down an inherted type along the inheritance change in each nesting level of features, so we have much better control how inherited types are replaced by the actual values provided in the inherts-call.

This patch also adds a test case with the code from #2214 plus the flang.dev example primes6_broken_map.fz that showed this problem since a long time.

The problem with `Clazz.actualClazz` was that it replaces all generics found in
parents and in outer features.  This is a problem when a feature inherits from
one of its outer features since there are two possible values of the actual
generics and for the examplein #2214, the wrong one was used.

With this patch, `Clazzes.down` now hands down an inherted type along the
inheritance change in each nesting level of features, so we have much better
control how inherited types are replaced by the actual values provided in the
inherts-call.

This patch also adds a test case with the code from #2214 plus the flang.dev
example `primes6_broken_map.fz` that showed this problem since a long time.
@fridis fridis marked this pull request as ready for review November 17, 2023 12:27
@fridis fridis changed the title air: WIP: replace Clazz.actualClazz by Clazzes.down(), fix #2214 air: replace Clazz.actualClazz by Clazz.handDown(), fix #2214 Nov 17, 2023


/**
* Helper for handDown() to hadn down an array of types along a given inheritance chain.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hadn -> hand

@michaellilltokiwa michaellilltokiwa merged commit daa985f into main Nov 17, 2023
5 checks passed
@michaellilltokiwa michaellilltokiwa deleted the fix_2214 branch November 17, 2023 13:20
@michaellilltokiwa michaellilltokiwa mentioned this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants