Skip to content

Fixes: #135 Type inference assigns boxed type#271

Open
AnAvailableName wants to merge 9 commits into
mainfrom
type-inference
Open

Fixes: #135 Type inference assigns boxed type#271
AnAvailableName wants to merge 9 commits into
mainfrom
type-inference

Conversation

@AnAvailableName

Copy link
Copy Markdown
Collaborator

No description provided.

return typeReferences.typeRef(List.class, typeRef);
}

private void addJoinExpression(MainQuery mainQuery, Join join, int joinIndex) {

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.

I would call this addJoinExpressions, as there can be multiple, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes

"Type mismatch: cannot convert from EShort (short) to EBoolean (boolean)",
"Type mismatch: cannot convert from EShort (short) to EString (String)",
"Type mismatch: cannot convert from EBoolean (boolean) to EShort (short)",
"Type mismatch: cannot convert from EShortObject (Short) to EBoolean (boolean)"

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.

If I understand this correctly, the EShortObject (Short) to EBoolean (boolean) issue is no longer reported, because in this case the EShort (short) to EBoolean (boolean) issue is reported instead. However, we should then check that this issue is actually reported twice (for p1 and p4). If hasIssues does not support this, we could split this test case in two separates ones.

.isEqualTo(fixture.expectedClassifier);
}

private String filmSummeryPerYearQuery(String summeryBody) {

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.

Summary

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes.

""".formatted(summeryBody);
}

private record CheckInferredFeatureTypeFixture(

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.

I would move this record to before it's used for the test sources. Also, we could create a separate test class for inferring the primitive types correctly.

String featureName,
String featureDeclaration,
EClassifier expectedClassifier,
Boolean shouldBeMany

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.

Is there a reason why you're using the boxed type here?

}
}

private Feature getFeatureOrFail(Query query, String featureName) {

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.

These methods should probably be moved to a test util class, as they could be of use in other test classes as well.

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