-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove all mixin traits from Contexts. In particular:
- `newSymbol`, `requiredSymbol` etc, now are available from Symbols, no `ctx.` prefix needed - All reporing methods are available from `report` object. Also: - Change functions from Context to context functions. - Add atPhase, atPhaseNoLater, addPhaseNoEarlier and have them replace most uss of `withPhase`... - Add inMode, withMode, withoutMode utility wrappers - Move error messages directly into reporting: this avoids an annoying import - Convert old style implicit parameters to `(using Context)` - Reorganize TyperState.test: Instead of overwriting fields of TyperState, keep test contexts in an explicit stack, so that they can be re-used. This is simpler and since there is more decoupling between tests. Usage is now `Contexts.explore(...)` instead of `ctx.test(...)`. # Conflicts: # compiler/src/dotty/tools/dotc/core/Definitions.scala # Conflicts: # compiler/src/dotty/tools/dotc/Run.scala # compiler/src/dotty/tools/dotc/core/Annotations.scala # compiler/src/dotty/tools/dotc/core/Contexts.scala # compiler/src/dotty/tools/dotc/core/Definitions.scala # compiler/src/dotty/tools/dotc/core/Phases.scala # compiler/src/dotty/tools/dotc/core/TyperState.scala # compiler/src/dotty/tools/dotc/core/Types.scala # compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala # compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala # compiler/src/dotty/tools/dotc/transform/TreeChecker.scala # compiler/src/dotty/tools/dotc/typer/Namer.scala
- Loading branch information
Showing
11 changed files
with
71 additions
and
57 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
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
21 changes: 21 additions & 0 deletions
21
compiler/src/dotty/tools/dotc/reporting/ExploringReporter.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,21 @@ | ||
package dotty.tools | ||
package dotc | ||
package reporting | ||
|
||
import collection.mutable | ||
import core.Contexts.Context | ||
import Diagnostic._ | ||
|
||
/** A re-usable Reporter used in Contexts#test */ | ||
class ExploringReporter extends StoreReporter(null): | ||
infos = new mutable.ListBuffer[Diagnostic] | ||
|
||
override def hasUnreportedErrors: Boolean = | ||
infos.exists(_.isInstanceOf[Error]) | ||
|
||
override def removeBufferedMessages(using Context): List[Diagnostic] = | ||
try infos.toList finally reset() | ||
|
||
def reset(): Unit = infos.clear() | ||
|
||
end ExploringReporter |
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