Skip to content

Remove PreName add (almost) all other implicit conversions #4077

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,6 @@ object Contexts {

Copy link
Contributor

Choose a reason for hiding this comment

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

This commit LGTM

object Context {

/** Implicit conversion that injects all printer operations into a context */
implicit def toPrinter(ctx: Context): Printer = ctx.printer

/** implicit conversion that injects all ContextBase members into a context */
implicit def toBase(ctx: Context): ContextBase = ctx.base

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Denotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ object Denotations {
/** Show declaration string; useful for showing declarations
* as seen from subclasses.
*/
def showDcl(implicit ctx: Context): String = ctx.dclText(this).show
def showDcl(implicit ctx: Context): String = ctx.printer.dclText(this).show

override def toString =
if (symbol == NoSymbol) symbol.toString
Expand Down
12 changes: 6 additions & 6 deletions compiler/src/dotty/tools/dotc/core/Symbols.scala
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,12 @@ object Symbols {

def toText(printer: Printer): Text = printer.toText(this)

def showLocated(implicit ctx: Context): String = ctx.locatedText(this).show
def showExtendedLocation(implicit ctx: Context): String = ctx.extendedLocationText(this).show
def showDcl(implicit ctx: Context): String = ctx.dclText(this).show
def showKind(implicit ctx: Context): String = ctx.kindString(this)
def showName(implicit ctx: Context): String = ctx.nameString(this)
def showFullName(implicit ctx: Context): String = ctx.fullNameString(this)
def showLocated(implicit ctx: Context): String = ctx.printer.locatedText(this).show
def showExtendedLocation(implicit ctx: Context): String = ctx.printer.extendedLocationText(this).show
def showDcl(implicit ctx: Context): String = ctx.printer.dclText(this).show
def showKind(implicit ctx: Context): String = ctx.printer.kindString(this)
def showName(implicit ctx: Context): String = ctx.printer.nameString(this)
def showFullName(implicit ctx: Context): String = ctx.printer.fullNameString(this)

override def hashCode() = id // for debugging.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ object messages {
val kind = "Compatibility"
val msg = "Failure to eliminate existential type. Proceed at own risk."
val explanation = {
val originalType = ctx.dclsText(boundSyms, "; ").show
val originalType = ctx.printer.dclsText(boundSyms, "; ").show
hl"""original type : $tp forSome ${originalType}
|reduces to : $tp1
|type used instead: $tp2"""
Expand Down Expand Up @@ -1968,7 +1968,7 @@ object messages {

val msg = {
val denotationOwner = denot.owner
val denotationName = ctx.fresh.setSetting(ctx.settings.YdebugNames, true).nameString(denot.name)
val denotationName = ctx.fresh.setSetting(ctx.settings.YdebugNames, true).printer.nameString(denot.name)
val file = denot.symbol.associatedFile
val (location, src) =
if (file != null) (s" in $file", file.toString)
Expand Down