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

Avoid CCE when scalac internally uses compileLate #2453

Merged
merged 1 commit into from Feb 11, 2016

Conversation

retronym
Copy link
Member

For example, when the --sourcepath option is provided
and the refchecks phase compiles an annotation found
on a referenced symbol from the sourcepath.

compileLate assumes that all non-sentinel compiler
phases can be down cast to GlobalPhase.

This commit changes the two phases in SBT to extend
this instead of Phase. This has the knock on benefit
of simplifying the phases by letting the GlobalPhase.run
iterator over the list of compilation units and feed them
to us one by one.

I checked that the test case failed before making each
change.

@retronym retronym changed the title Avoid CCE when scalac internally uses compileLate Avoid CCE when scalac internally uses compileLate. Fixes #2452 Feb 10, 2016
@retronym retronym changed the title Avoid CCE when scalac internally uses compileLate. Fixes #2452 Avoid CCE when scalac internally uses compileLate Feb 10, 2016
@eed3si9n
Copy link
Member

Would it make sense to change https://github.com/sbt/sbt/blob/0.13/compile/interface/src/main/scala/xsbt/Analyzer.scala while we're at it?

{
val start = System.currentTimeMillis
currentRun.units.foreach(processUnit)
super.run()
Copy link
Member

Choose a reason for hiding this comment

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

compiler-project / run2.8 failed:

[error] /tmp/sbt_2e562db/xsbt/API.scala:31: error: ApiPhase.super.run of type Unit does not take parameters
[error]         super.run()
[error]                  ^
[error] one error found

For example, when the `--sourcepath` option is provided
and the refchecks phase compiles an annotation found
on a referenced symbol from the sourcepath.

`compileLate` assumes that all non-sentinel compiler
phases can be down cast to `GlobalPhase`.

This commit changes the two phases in SBT to extend
this instead of `Phase`. This has the knock on benefit
of simplifying the phases by letting the `GlobalPhase.run`
iterator over the list of compilation units and feed them
to us one by one.

I checked that the test case failed before making each
change.
@retronym
Copy link
Member Author

@eed3si9n Just updated the extraction phase, too, and fixed the compile error.

@eed3si9n
Copy link
Member

LGTM

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.

None yet

2 participants