Skip to content
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

fix regression: inline match crash when rhs uses private inlined methods #18595

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

kasiaMarek
Copy link
Contributor

resolves: #18589

@@ -38,6 +38,7 @@ class CompilationTests {
compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
compileFile("tests/pos-special/utf8encoded.scala", defaultOptions.and("-encoding", "UTF8")),
compileFile("tests/pos-special/utf16encoded.scala", defaultOptions.and("-encoding", "UTF16")),
compileDir("tests/pos-special/i18589", defaultOptions.and("-Ysafe-init").without("-Ycheck:all")),
Copy link
Member

@bishabosha bishabosha Sep 25, 2023

Choose a reason for hiding this comment

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

is there a reason for these special flags? maybe a comment would help

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, basically "-Ycheck-all" option causes this test to fail. But this isn't a regression caused by #18557 it seems to had been this way before. It would be nice to fix it though.

Copy link
Member

Choose a reason for hiding this comment

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

What's the failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some positions in the tree are missing.

*** error while checking tests/pos-special/i18589/test_1.scala after phase inlining ***
assertion failed: position not set for NamedCodecPlatform.Builder[Any] # -1
of class dotty.tools.dotc.ast.Trees$TypeTree in tests/pos-special/i18589/test_1.scala

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. Looks like it's the TypeTree in the cast in

              val Builder_this: NamedCodecPlatform.Builder[Any] =
                Builder_this.asInstanceOf[NamedCodecPlatform.Builder[Any]]

which is unpositioned. /cc @nicolasstucki

I agree you should just find a way to ignore that. I've not seen .without("-Ycheck:all") being used before, but I'm ok with it.

@bishabosha bishabosha merged commit 63eb5e4 into scala:main Sep 26, 2023
18 checks passed
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
WojciechMazur added a commit that referenced this pull request Jun 20, 2024
…lined methods" to LTS (#20621)

Backports #18595 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
WojciechMazur added a commit that referenced this pull request Jun 20, 2024
…lined methods" to LTS (#20678)

Backports #18595 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

Inlined match crashes when rhs uses private inlined methods
4 participants