-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add checks for the consistency of the parents in TreeChecker #18935
Conversation
This check is available under |
3345567
to
72f0abf
Compare
563b3a1
to
1723086
Compare
case _ => tree.symbol.isConstructor && tree.symbol.owner.is(Flags.Trait) | ||
tree.symbol.is(Flags.Trait) || isTraitConstructor | ||
|
||
val newParents = if impl.parents.tail eq newTraits then impl.parents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the formatting we use for multiline expressions. It should be all on the right of the =
or at the indented next line.
val newParents =
if impl.parents.tail eq newTraits then impl.parents
else impl.parents.head :: newTraits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a document with "Best practices" when working on Dotty with some of these guidelines.
Otherwise LGTM |
This PR adds a check for the parents in the TreeChecker.
In the context of macro annotations, this PR doesn't allow the modification of the parents. This restriction will probably be partially lifted as we come up with the final specification.
This PR is related to #18677 put does not close it.