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

[1.x] Generate AbstractZincFile during -sourcepath workflow #1309

Open
wants to merge 1 commit into
base: 1.10.x
Choose a base branch
from

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Dec 15, 2023

This PR fixes #1304, #963

Issue

val sourceFile: VirtualFile = unit.source.file match { case AbstractZincFile(vf) => vf }

In certain codepath, unit.source.file is a PlainFile, which causes a MatchError.

Fix

When unit.source is built, convert unit.source.file to AbstractZincFile.

Validating the fix

The PR includes reproduction scripted test by lrytz. The test passes after the fix.

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

@Friendseeker Friendseeker changed the base branch from develop to 1.10.x September 27, 2024 04:44
@Friendseeker Friendseeker requested review from eed3si9n and dwijnand and removed request for dwijnand September 27, 2024 06:53
@Friendseeker Friendseeker changed the title Generate ZincPlainFile during -sourcepath workflow [1.x] Generate ZincPlainFile during -sourcepath workflow Sep 27, 2024
@Friendseeker Friendseeker changed the title [1.x] Generate ZincPlainFile during -sourcepath workflow [1.x] Generate AbstractZincFile during -sourcepath workflow Sep 27, 2024
@Friendseeker Friendseeker force-pushed the plainfile-match-fail branch 4 times, most recently from 99fbd8f to 6a1ef09 Compare September 28, 2024 06:15
In certain codepath, unit.source.file is a PlainFile, which causes a MatchError.

This PR converts PlainFile to AbstractZincFile, avoiding the MatchError.
@Friendseeker
Copy link
Member Author

@eed3si9n While the PR is in Changes requested status, would it be possible for you to dismiss the stale review and force merge it if everything looks okay?

My concern is that since this PR involves AnalysisCallback3 and #1306 is already merged in, if a Zinc release is made before the PR is merged, we would need to introduce AnalysisCallback4.

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.

MatchError in ApiPhase.processScalaUnit with -sourcepath compiler option
3 participants