Skip to content

ast: Simplification (and maybe fix) in ctypeInheritanceCall#6822

Draft
fridis wants to merge 1 commit intomainfrom
ast_experimental_simplification_in_cotypeInhheritanceCall
Draft

ast: Simplification (and maybe fix) in ctypeInheritanceCall#6822
fridis wants to merge 1 commit intomainfrom
ast_experimental_simplification_in_cotypeInhheritanceCall

Conversation

@fridis
Copy link
Copy Markdown
Member

@fridis fridis commented Mar 26, 2026

Replaced !isCallToOUterRef() && !isField() by isConstructur(), which is IMHO the main point here, a constructor sets a specific target type, while for a field or function, the result type is important.

This is an attempt to simplify the code introduced in #6818.

Replaced `!isCallToOUterRef() && !isField()` by `isConstructur()`, which is IMHO
the main point here, a constructor sets a specific target type, while for a
field or function, the result type is important.
res, that, null);
var oc = o == null || o.isUniverse()
? Universe.instance
: target instanceof AbstractCall ac && ac.calledFeature().isConstructor()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about choices? Maybe even:

Suggested change
: target instanceof AbstractCall ac && ac.calledFeature().isConstructor()
: target instanceof AbstractCall ac && ac.calledFeature().definesType()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A choice should not be called, so this should be equivalent in the case of no reported errors.

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.

2 participants