Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/dev/flang/ast/AbstractFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,13 @@ && outer().isCotype()
Call cotypeInheritanceCall(SourcePosition p, List<AbstractType> typeParameters, Resolution res, AbstractFeature that, Expr target)
{
var o = outer();
var oc = o == null || o.isUniverse() ? Universe.instance
: target instanceof AbstractCall ac && !ac.isCallToOuterRef() && ! ac.calledFeature().isField()
? ac.cotypeInheritanceCall(res, that)
: o.cotypeInheritanceCall(p, new List<>(o.selfType(),
o.genericsAsActuals().map(that::rebaseTypeForCotype)),
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.

? ac.cotypeInheritanceCall(res, that)
: o.cotypeInheritanceCall(p, new List<>(o.selfType(),
o.genericsAsActuals().map(that::rebaseTypeForCotype)),
res, that, null);

var tf = res.cotype(this);
return new Call(p,
Expand Down
Loading