Skip to content

Pre-SIP: Improvements to Type Classes #19395

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
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d764b20
New modularity language import
odersky Jan 7, 2024
34a49ca
A relaxation concerning exported type aliases
odersky Dec 15, 2023
8fe26f7
Allow class parents to be refined types.
odersky Dec 13, 2023
7746495
Allow vals in using clauses of givens
odersky Nov 18, 2023
062d31a
Introduce tracked class parameters
odersky Nov 18, 2023
7a46264
Some tweaks to modularity.md
odersky Jan 7, 2024
1997045
Make some context bound evidence params tracked
odersky Dec 25, 2023
10e25b6
Make explicit arguments for context bounds an error from 3.5
odersky Dec 23, 2023
8cafe02
Use the name of the type parameter as context bound evidence
odersky Jan 7, 2024
d712f15
Allow contecxt bounds with abstract `This` types
odersky Jan 7, 2024
84aa459
Drop restriction against typedefs at level * only
odersky Jan 7, 2024
78018a8
Allow types in given definitions to be infix types
odersky Jan 7, 2024
093ac5d
New syntax for given defs
odersky Jan 7, 2024
5df5f3e
Rename This to Self as instance type of type classes
odersky Jan 7, 2024
5482680
Add `is` type to Predef
odersky Jan 7, 2024
89e91ae
Allow multiple context bounds in `{...}`
odersky Jan 7, 2024
cf59585
Allow renamings `as N` in context bounds
odersky Jan 7, 2024
73deadc
Implement `deferredSummon`
odersky Jan 7, 2024
aba63cd
Allow context bounds in type declarations
odersky Jan 7, 2024
abca391
Tweak position where synthetic evidence parameters are added
odersky Jan 7, 2024
ab7a521
Fix typing of generated context bound refinements
odersky Jan 7, 2024
1693271
Hylolib: Switch to member based type classes
odersky Jan 2, 2024
c997f35
Hylolib: Use name of bound parameter for context bounds
odersky Jan 2, 2024
7175a21
Hylolib: Some stylistic tweaks
odersky Jan 2, 2024
ae6fb3c
Hylolib: Drop usages of `with` in givens
odersky Jan 2, 2024
d5433c5
Dealias before checking for illegal class parents
odersky Jan 3, 2024
7b51c58
Hylolib: Alternative, statically safe Slice design
odersky Jan 3, 2024
62d08e3
Rename `deferredSummon` to `deferred` and allow it for defs
odersky Jan 7, 2024
2cd7028
Treat new style given syntax without a rhs or template as concrete
odersky Jan 7, 2024
c7be313
Fix typing of RefinedTypes with watching parents
odersky Jan 7, 2024
5be4be4
Show that this solves #10929
odersky Jan 7, 2024
9fc21f9
Disambiguate more towards new given syntax, show solution for #15840
odersky Jan 7, 2024
d5f089d
Also reduce term projections
odersky Jan 6, 2024
399ba70
Refine rules when context bound evidence is tracked
odersky Jan 6, 2024
7cfc150
Add a doc page
odersky Jan 8, 2024
b1a47aa
Do deferred given resolution only at typer phase
odersky Jan 8, 2024
1f10973
Update SemanticDB expects to account for named context bound evidence…
odersky Jan 8, 2024
a516cf6
Fix typos
odersky Jan 8, 2024
a0820a7
Update docs/_docs/reference/experimental/typeclasses.md
odersky Jan 8, 2024
58d2049
Update syntax changes section in doc page
odersky Jan 9, 2024
f074b39
Update docs/_docs/reference/experimental/typeclasses.md
odersky Jan 11, 2024
330f2d6
Rename `is` to `forms`
odersky Jan 14, 2024
af3fd3f
Rename `is` to `forms`
odersky Jan 14, 2024
c9781fa
Avoid overwriting type var instance in instantiateWith
odersky Jan 28, 2024
59ab35e
Refactor instantiate
odersky Jan 28, 2024
b4cd9ba
Rename some remaining occurrences of `is` to `forms`
odersky Jan 30, 2024
7ae6e8e
Another test case
odersky Jan 31, 2024
8203e0c
Remember language imports when expanding toplevel symbols
odersky Feb 4, 2024
a59165a
Update MimaFilters
odersky Feb 24, 2024
102c5ee
Fix typo
odersky Feb 26, 2024
1a7a60f
Expand deferred givens to lazy abstract givens
odersky Feb 27, 2024
f960914
Make deferred a method in the compiletime package
odersky Feb 27, 2024
ab2341a
Update doc page and break out syntax Pre-SIP into separate doc
odersky Feb 27, 2024
683507a
Add compiletime.deferred to MimaFilters
odersky Feb 27, 2024
84b8a21
Changes to default names for context bound witnesses
odersky Feb 28, 2024
8c2f6df
Fix typo
odersky Feb 29, 2024
ff17c71
Don't use member type name for deferred givens
odersky Feb 29, 2024
733af36
Change rules for given prioritization
odersky Dec 21, 2023
fd97d68
Allow ContextBoundParamNames to be unmangled.
odersky Mar 4, 2024
495072a
Implement context bound companions
odersky Mar 8, 2024
7d754d6
Refinements for context-bound companions
odersky Mar 9, 2024
dc8c708
Fix typo in doc page and update MimaFilters, pickling excludes
odersky Mar 11, 2024
7c8116c
More regular handling of tracked for given companion methods
odersky Apr 1, 2024
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
237 changes: 157 additions & 80 deletions compiler/src/dotty/tools/dotc/ast/Desugar.scala

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package ast
import core.*
import Flags.*, Trees.*, Types.*, Contexts.*
import Names.*, StdNames.*, NameOps.*, Symbols.*
import Annotations.Annotation
import NameKinds.ContextBoundParamName
import typer.ConstFold
import reporting.trace

Expand Down Expand Up @@ -376,6 +378,35 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
case _ =>
tree.tpe.isInstanceOf[ThisType]
}

/** Extractor for annotation.internal.WitnessNames(name_1, ..., name_n)`
* represented as an untyped or typed tree.
*/
object WitnessNamesAnnot:
def apply(names0: List[TermName])(using Context): untpd.Tree =
untpd.TypedSplice(tpd.New(
defn.WitnessNamesAnnot.typeRef,
tpd.SeqLiteral(names0.map(n => tpd.Literal(Constant(n.toString))), tpd.TypeTree(defn.StringType)) :: Nil
))

def unapply(tree: Tree)(using Context): Option[List[TermName]] =
def isWitnessNames(tp: Type) = tp match
case tp: TypeRef =>
tp.name == tpnme.WitnessNames && tp.symbol == defn.WitnessNamesAnnot
case _ =>
false
unsplice(tree) match
case Apply(
Select(New(tpt: tpd.TypeTree), nme.CONSTRUCTOR),
SeqLiteral(elems, _) :: Nil
) if isWitnessNames(tpt.tpe) =>
Some:
elems.map:
case Literal(Constant(str: String)) =>
ContextBoundParamName.unmangle(str.toTermName.asSimpleName)
case _ =>
None
end WitnessNamesAnnot
}

trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped] =>
Expand Down
10 changes: 10 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/untpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
case class ContextBounds(bounds: TypeBoundsTree, cxBounds: List[Tree])(implicit @constructorOnly src: SourceFile) extends TypTree
case class PatDef(mods: Modifiers, pats: List[Tree], tpt: Tree, rhs: Tree)(implicit @constructorOnly src: SourceFile) extends DefTree
case class ExtMethods(paramss: List[ParamClause], methods: List[Tree])(implicit @constructorOnly src: SourceFile) extends Tree
case class ContextBoundTypeTree(tycon: Tree, paramName: TypeName, ownName: TermName)(implicit @constructorOnly src: SourceFile) extends Tree
case class MacroTree(expr: Tree)(implicit @constructorOnly src: SourceFile) extends Tree

case class ImportSelector(imported: Ident, renamed: Tree = EmptyTree, bound: Tree = EmptyTree)(implicit @constructorOnly src: SourceFile) extends Tree {
Expand Down Expand Up @@ -230,6 +231,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {

case class Infix()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Infix)

case class Tracked()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Tracked)

/** Used under pureFunctions to mark impure function types `A => B` in `FunctionWithMods` */
case class Impure()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Impure)
}
Expand Down Expand Up @@ -675,6 +678,9 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
def ExtMethods(tree: Tree)(paramss: List[ParamClause], methods: List[Tree])(using Context): Tree = tree match
case tree: ExtMethods if (paramss eq tree.paramss) && (methods == tree.methods) => tree
case _ => finalize(tree, untpd.ExtMethods(paramss, methods)(tree.source))
def ContextBoundTypeTree(tree: Tree)(tycon: Tree, paramName: TypeName, ownName: TermName)(using Context): Tree = tree match
case tree: ContextBoundTypeTree if (tycon eq tree.tycon) && paramName == tree.paramName && ownName == tree.ownName => tree
case _ => finalize(tree, untpd.ContextBoundTypeTree(tycon, paramName, ownName)(tree.source))
def ImportSelector(tree: Tree)(imported: Ident, renamed: Tree, bound: Tree)(using Context): Tree = tree match {
case tree: ImportSelector if (imported eq tree.imported) && (renamed eq tree.renamed) && (bound eq tree.bound) => tree
case _ => finalize(tree, untpd.ImportSelector(imported, renamed, bound)(tree.source))
Expand Down Expand Up @@ -740,6 +746,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
cpy.PatDef(tree)(mods, transform(pats), transform(tpt), transform(rhs))
case ExtMethods(paramss, methods) =>
cpy.ExtMethods(tree)(transformParamss(paramss), transformSub(methods))
case ContextBoundTypeTree(tycon, paramName, ownName) =>
cpy.ContextBoundTypeTree(tree)(transform(tycon), paramName, ownName)
case ImportSelector(imported, renamed, bound) =>
cpy.ImportSelector(tree)(transformSub(imported), transform(renamed), transform(bound))
case Number(_, _) | TypedSplice(_) =>
Expand Down Expand Up @@ -795,6 +803,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
this(this(this(x, pats), tpt), rhs)
case ExtMethods(paramss, methods) =>
this(paramss.foldLeft(x)(apply), methods)
case ContextBoundTypeTree(tycon, paramName, ownName) =>
this(x, tycon)
case ImportSelector(imported, renamed, bound) =>
this(this(this(x, imported), renamed), bound)
case Number(_, _) =>
Expand Down
7 changes: 7 additions & 0 deletions compiler/src/dotty/tools/dotc/config/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,11 @@ object Config {
*/
inline val checkLevelsOnConstraints = false
inline val checkLevelsOnInstantiation = true

/** If a type parameter `X` has a single context bounf `X: C`, should the
* witness parameter be named `X`? This would prevent the creation of a
* context bound companion.
*/
inline val nameSingleContextBounds = true
}

1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/config/Feature.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object Feature:
val pureFunctions = experimental("pureFunctions")
val captureChecking = experimental("captureChecking")
val into = experimental("into")
val modularity = experimental("modularity")

/** Is `feature` enabled by by a command-line setting? The enabling setting is
*
Expand Down
13 changes: 8 additions & 5 deletions compiler/src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Symbols.*
import Scopes.*
import Uniques.*
import ast.Trees.*
import Flags.ParamAccessor
import ast.untpd
import util.{NoSource, SimpleIdentityMap, SourceFile, HashSet, ReusableInstance}
import typer.{Implicits, ImportInfo, SearchHistory, SearchRoot, TypeAssigner, Typer, Nullables}
Expand Down Expand Up @@ -399,7 +400,8 @@ object Contexts {
*
* - as owner: The primary constructor of the class
* - as outer context: The context enclosing the class context
* - as scope: The parameter accessors in the class context
* - as scope: type parameters, the parameter accessors, and
* the context bound companions in the class context,
*
* The reasons for this peculiar choice of attributes are as follows:
*
Expand All @@ -413,10 +415,11 @@ object Contexts {
* context see the constructor parameters instead, but then we'd need a final substitution step
* from constructor parameters to class parameter accessors.
*/
def superCallContext: Context = {
val locals = newScopeWith(owner.typeParams ++ owner.asClass.paramAccessors*)
superOrThisCallContext(owner.primaryConstructor, locals)
}
def superCallContext: Context =
val locals = owner.typeParams
++ owner.asClass.unforcedDecls.filter: sym =>
sym.is(ParamAccessor) || sym.isContextBoundCompanion
superOrThisCallContext(owner.primaryConstructor, newScopeWith(locals*))

/** The context for the arguments of a this(...) constructor call.
* The context is computed from the local auxiliary constructor context.
Expand Down
10 changes: 10 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class Definitions {
@tu lazy val Compiletime_codeOf: Symbol = CompiletimePackageClass.requiredMethod("codeOf")
@tu lazy val Compiletime_erasedValue : Symbol = CompiletimePackageClass.requiredMethod("erasedValue")
@tu lazy val Compiletime_uninitialized: Symbol = CompiletimePackageClass.requiredMethod("uninitialized")
@tu lazy val Compiletime_deferred : Symbol = CompiletimePackageClass.requiredMethod("deferred")
@tu lazy val Compiletime_error : Symbol = CompiletimePackageClass.requiredMethod(nme.error)
@tu lazy val Compiletime_requireConst : Symbol = CompiletimePackageClass.requiredMethod("requireConst")
@tu lazy val Compiletime_constValue : Symbol = CompiletimePackageClass.requiredMethod("constValue")
Expand Down Expand Up @@ -458,6 +459,13 @@ class Definitions {
@tu lazy val andType: TypeSymbol = enterBinaryAlias(tpnme.AND, AndType(_, _))
@tu lazy val orType: TypeSymbol = enterBinaryAlias(tpnme.OR, OrType(_, _, soft = false))

@tu lazy val CBCompanion: TypeSymbol = // type `<context-bound-companion>`[-Refs]
enterPermanentSymbol(tpnme.CBCompanion,
TypeBounds(NothingType,
HKTypeLambda(tpnme.syntheticTypeParamName(0) :: Nil, Contravariant :: Nil)(
tl => TypeBounds.empty :: Nil,
tl => AnyType))).asType

/** Method representing a throw */
@tu lazy val throwMethod: TermSymbol = enterMethod(OpsPackageClass, nme.THROWkw,
MethodType(List(ThrowableType), NothingType))
Expand Down Expand Up @@ -1063,6 +1071,7 @@ class Definitions {
@tu lazy val RetainsCapAnnot: ClassSymbol = requiredClass("scala.annotation.retainsCap")
@tu lazy val RetainsByNameAnnot: ClassSymbol = requiredClass("scala.annotation.retainsByName")
@tu lazy val PublicInBinaryAnnot: ClassSymbol = requiredClass("scala.annotation.publicInBinary")
@tu lazy val WitnessNamesAnnot: ClassSymbol = requiredClass("scala.annotation.internal.WitnessNames")

@tu lazy val JavaRepeatableAnnot: ClassSymbol = requiredClass("java.lang.annotation.Repeatable")

Expand Down Expand Up @@ -2140,6 +2149,7 @@ class Definitions {
NullClass,
NothingClass,
SingletonClass,
CBCompanion,
MaybeCapabilityAnnot)

@tu lazy val syntheticCoreClasses: List[Symbol] = syntheticScalaClasses ++ List(
Expand Down
12 changes: 7 additions & 5 deletions compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ object Flags {
/** Symbol cannot be found as a member during typer */
val (Invisible @ _, _, _) = newFlags(45, "<invisible>")

/** Tracked modifier for class parameter / a class with some tracked parameters */
val (Tracked @ _, _, Dependent @ _) = newFlags(46, "tracked")

// ------------ Flags following this one are not pickled ----------------------------------

/** Symbol is not a member of its owner */
Expand Down Expand Up @@ -452,7 +455,7 @@ object Flags {
CommonSourceModifierFlags.toTypeFlags | Abstract | Sealed | Opaque | Open

val TermSourceModifierFlags: FlagSet =
CommonSourceModifierFlags.toTermFlags | Inline | AbsOverride | Lazy
CommonSourceModifierFlags.toTermFlags | Inline | AbsOverride | Lazy | Tracked

/** Flags representing modifiers that can appear in trees */
val ModifierFlags: FlagSet =
Expand All @@ -466,7 +469,7 @@ object Flags {
val FromStartFlags: FlagSet = commonFlags(
Module, Package, Deferred, Method, Case, Enum, Param, ParamAccessor,
Scala2SpecialFlags, MutableOrOpen, Opaque, Touched, JavaStatic,
OuterOrCovariant, LabelOrContravariant, CaseAccessor,
OuterOrCovariant, LabelOrContravariant, CaseAccessor, Tracked,
Extension, NonMember, Implicit, Given, Permanent, Synthetic, Exported,
SuperParamAliasOrScala2x, Inline, Macro, ConstructorProxy, Invisible)

Expand All @@ -477,7 +480,7 @@ object Flags {
*/
val AfterLoadFlags: FlagSet = commonFlags(
FromStartFlags, AccessFlags, Final, AccessorOrSealed,
Abstract, LazyOrTrait, SelfName, JavaDefined, JavaAnnotation, Transparent)
Abstract, LazyOrTrait, SelfName, JavaDefined, JavaAnnotation, Transparent, Tracked)

/** A value that's unstable unless complemented with a Stable flag */
val UnstableValueFlags: FlagSet = Mutable | Method
Expand Down Expand Up @@ -540,8 +543,6 @@ object Flags {
/** Flags retained in type export forwarders */
val RetainedExportTypeFlags = Infix

val MandatoryExportTypeFlags = Exported | Final

/** Flags that apply only to classes */
val ClassOnlyFlags = Sealed | Open | Abstract.toTypeFlags

Expand Down Expand Up @@ -569,6 +570,7 @@ object Flags {
val DeferredOrLazyOrMethod: FlagSet = Deferred | Lazy | Method
val DeferredOrTermParamOrAccessor: FlagSet = Deferred | ParamAccessor | TermParam // term symbols without right-hand sides
val DeferredOrTypeParam: FlagSet = Deferred | TypeParam // type symbols without right-hand sides
val DeferredGivenFlags = Deferred | Given | HasDefault
val EnumValue: FlagSet = Enum | StableRealizable // A Scala enum value
val FinalOrInline: FlagSet = Final | Inline
val FinalOrModuleClass: FlagSet = Final | ModuleClass // A module class or a final class
Expand Down
17 changes: 10 additions & 7 deletions compiler/src/dotty/tools/dotc/core/Mode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ object Mode {
val Pattern: Mode = newMode(0, "Pattern")
val Type: Mode = newMode(1, "Type")

val PatternOrTypeBits: Mode = Pattern | Type

val ImplicitsEnabled: Mode = newMode(2, "ImplicitsEnabled")
val InferringReturnType: Mode = newMode(3, "InferringReturnType")

Expand Down Expand Up @@ -101,16 +103,19 @@ object Mode {
*/
val CheckBoundsOrSelfType: Mode = newMode(14, "CheckBoundsOrSelfType")

/** Use Scala2 scheme for overloading and implicit resolution */
val OldOverloadingResolution: Mode = newMode(15, "OldOverloadingResolution")
/** Use previous Scheme for implicit resolution. Currently significant
* in 3.0-migration where we use Scala-2's scheme instead and in 3.5-migration
* where we use the previous scheme up to 3.4 instead.
*/
val OldImplicitResolution: Mode = newMode(15, "OldImplicitResolution")

/** Treat CapturingTypes as plain AnnotatedTypes even in phase CheckCaptures.
* Reuses the value of OldOverloadingResolution to save Mode bits.
* This is OK since OldOverloadingResolution only affects implicit search, which
* Reuses the value of OldImplicitResolution to save Mode bits.
* This is OK since OldImplicitResolution only affects implicit search, which
* is done during phases Typer and Inlinig, and IgnoreCaptures only has an
* effect during phase CheckCaptures.
*/
val IgnoreCaptures = OldOverloadingResolution
val IgnoreCaptures = OldImplicitResolution

/** Allow hk applications of type lambdas to wildcard arguments;
* used for checking that such applications do not normally arise
Expand All @@ -120,8 +125,6 @@ object Mode {
/** Read original positions when unpickling from TASTY */
val ReadPositions: Mode = newMode(17, "ReadPositions")

val PatternOrTypeBits: Mode = Pattern | Type

/** We are elaborating the fully qualified name of a package clause.
* In this case, identifiers should never be imported.
*/
Expand Down
37 changes: 17 additions & 20 deletions compiler/src/dotty/tools/dotc/core/NameKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ object NameKinds {
case DerivedName(underlying, info: this.NumberedInfo) => Some((underlying, info.num))
case _ => None
}
protected def skipSeparatorAndNum(name: SimpleName, separator: String): Int = {
protected def skipSeparatorAndNum(name: SimpleName, separator: String): Int =
var i = name.length
while (i > 0 && name(i - 1).isDigit) i -= 1
if (i > separator.length && i < name.length &&
name.slice(i - separator.length, i).toString == separator) i
while i > 0 && name(i - 1).isDigit do i -= 1
if i >= separator.length && i < name.length
&& name.slice(i - separator.length, i).toString == separator
then i
else -1
}

numberedNameKinds(tag) = this: @unchecked
}
Expand Down Expand Up @@ -240,6 +240,16 @@ object NameKinds {
}
}

/** Unique names that can be unmangled */
class UniqueNameKindWithUnmangle(separator: String) extends UniqueNameKind(separator):
override def unmangle(name: SimpleName): TermName =
val i = skipSeparatorAndNum(name, separator)
if i > 0 then
val index = name.drop(i).toString.toInt
val original = name.take(i - separator.length).asTermName
apply(original, index)
else name

/** Names of the form `prefix . name` */
val QualifiedName: QualifiedNameKind = new QualifiedNameKind(QUALIFIED, ".")

Expand Down Expand Up @@ -288,7 +298,7 @@ object NameKinds {
*
* The "evidence$" prefix is a convention copied from Scala 2.
*/
val ContextBoundParamName: UniqueNameKind = new UniqueNameKind("evidence$")
val ContextBoundParamName: UniqueNameKind = new UniqueNameKindWithUnmangle("evidence$")

/** The name of an inferred contextual function parameter:
*
Expand Down Expand Up @@ -323,20 +333,7 @@ object NameKinds {
val InlineBinderName: UniqueNameKind = new UniqueNameKind("$proxy")
val MacroNames: UniqueNameKind = new UniqueNameKind("$macro$")

/** A kind of unique extension methods; Unlike other unique names, these can be
* unmangled.
*/
val UniqueExtMethName: UniqueNameKind = new UniqueNameKind("$extension") {
override def unmangle(name: SimpleName): TermName = {
val i = skipSeparatorAndNum(name, separator)
if (i > 0) {
val index = name.drop(i).toString.toInt
val original = name.take(i - separator.length).asTermName
apply(original, index)
}
else name
}
}
val UniqueExtMethName: UniqueNameKind = new UniqueNameKindWithUnmangle("$extension")

/** Kinds of unique names generated by the pattern matcher */
val PatMatStdBinderName: UniqueNameKind = new UniqueNameKind("x")
Expand Down
Loading