-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #632 from adpi2/scala34
Add support for Scala 3.4
- Loading branch information
Showing
23 changed files
with
127 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
modules/expression-compiler/src/main/scala-3.0/dotty/tools/dotc/evaluation/SymUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package dotty.tools.dotc.evaluation | ||
|
||
import dotty.tools.dotc.core.Contexts.Context | ||
import dotty.tools.dotc.core.Symbols.Symbol | ||
|
||
object SymUtils: | ||
export dotty.tools.dotc.transform.SymUtils.{isLocal => _, enclosingMethodOrClass => _, *} | ||
|
||
extension (self: Symbol) def isLocal(using Context) = dotty.tools.dotc.transform.SymUtils.isLocal(self) |
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
modules/expression-compiler/src/main/scala-3.3/dotty/tools/dotc/evaluation/SymUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package dotty.tools.dotc.evaluation | ||
|
||
import dotty.tools.dotc.core.Contexts.Context | ||
import dotty.tools.dotc.core.Symbols.Symbol | ||
|
||
object SymUtils: | ||
export dotty.tools.dotc.transform.SymUtils.{isLocal => _, enclosingMethodOrClass => _, *} | ||
|
||
extension (self: Symbol) def isLocal(using Context) = dotty.tools.dotc.transform.SymUtils.isLocal(self) |
17 changes: 17 additions & 0 deletions
17
modules/expression-compiler/src/main/scala-3.4/dotty/tools/dotc/ExpressionCompiler.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package dotty.tools.dotc | ||
|
||
import dotty.tools.dotc.core.Contexts.Context | ||
import dotty.tools.dotc.core.Phases.Phase | ||
import dotty.tools.dotc.evaluation.* | ||
|
||
class ExpressionCompiler(using ExpressionContext)(using Context) extends Compiler: | ||
|
||
override protected def frontendPhases: List[List[Phase]] = | ||
val parser :: others = super.frontendPhases: @unchecked | ||
parser :: List(InsertExpression()) :: others | ||
|
||
override protected def picklerPhases: List[List[Phase]] = | ||
super.picklerPhases :+ List(ExtractExpression()) | ||
|
||
override protected def transformPhases: List[List[Phase]] = | ||
super.transformPhases :+ List(ResolveReflectEval()) |
17 changes: 17 additions & 0 deletions
17
modules/expression-compiler/src/main/scala-3.4/dotty/tools/dotc/ExpressionReporter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package dotty.tools.dotc | ||
|
||
import dotty.tools.dotc.core.Contexts.* | ||
import dotty.tools.dotc.reporting.AbstractReporter | ||
import dotty.tools.dotc.reporting.Diagnostic | ||
|
||
class ExpressionReporter(reportError: String => Unit) extends AbstractReporter: | ||
override def doReport(dia: Diagnostic)(using Context): Unit = | ||
// println(messageAndPos(dia)) | ||
dia match | ||
case error: Diagnostic.Error => | ||
val newPos = error.pos.source.positionInUltimateSource(error.pos) | ||
val errorWithNewPos = new Diagnostic.Error(error.msg, newPos) | ||
reportError(stripColor(messageAndPos(errorWithNewPos))) | ||
case _ => | ||
// TODO report the warnings | ||
() |
3 changes: 3 additions & 0 deletions
3
modules/expression-compiler/src/main/scala-3.4/dotty/tools/dotc/evaluation/SymUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package dotty.tools.dotc.evaluation | ||
|
||
object SymUtils extends dotty.tools.dotc.core.SymUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.