Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

EtaExpansion object extractor seems to record constraints #13205

Discussion options

Hello,
I have a question regarding the EtaExpansion object extractor, and more
specifically, its weakerBounds private method (from line 45):
https://github.com/lampepfl/dotty/blob/0a9b48fba3a4e120ae4cd123b1ac1f9311d10182/compiler/src/dotty/tools/dotc/core/TypeApplications.scala#L27-L68

At line 56, <:< is employed which performs subtyping check with constraints recording whenever necessary (if I understand correctly).
Is this the expected behavior? Shouldn't we instead perform a subtyping check in a frozen context?

For example, in RefinedPrinter#toText, the extractor is used at line 229:
https://github.com/lampepfl/dotty/blob/0a9b48fba3a4e120ae4cd123b1ac1f9311d10182/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala#L244-L247

This can cause constraints to be recorded while printing a type, which is a bit surprising.

Thank you

You must be logged in to vote

Shouldn't we instead perform a subtyping check in a frozen context?

It looks like an error to me. Can you try to change it and make a PR if it succeeds?

Replies: 1 comment 1 reply

Comment options

Shouldn't we instead perform a subtyping check in a frozen context?

It looks like an error to me. Can you try to change it and make a PR if it succeeds?

You must be logged in to vote
1 reply
Comment options

Corresponding PR: #13229

Answer selected by mario-bucev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /