Skip to content

Commit 7a04b11

Browse files
oderskyDarkDimius
authored andcommitted
Removed explicit tuplings from dotc codebase.
Eliminated all "Dotty deviations" which were due to lack of auto-tupling.
1 parent 574a148 commit 7a04b11

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ object desugar {
728728
*/
729729
private object VarPattern {
730730
def unapply(tree: Tree)(implicit ctx: Context): Option[VarInfo] = tree match {
731-
case id: Ident => Some((id, TypeTree())) // Dotty deviation: No auto-tupling
731+
case id: Ident => Some(id, TypeTree())
732732
case Typed(id: Ident, tpt) => Some((id, tpt))
733733
case _ => None
734734
}

src/dotty/tools/dotc/config/Settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ object Settings {
6060
copy(aliases = aliases :+ abbrv)(idx)
6161

6262
def dependsOn[U](setting: Setting[U], value: U): Setting[T] =
63-
copy(depends = depends :+ ((setting, value)))(idx) // Dotty deviation: no auto-tupling
63+
copy(depends = depends :+ (setting, value))(idx)
6464

6565
def valueIn(state: SettingsState): T =
6666
state.value(idx).asInstanceOf[T]

src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ object Contexts {
273273
newctx.implicitsCache = null
274274
newctx.setCreationTrace()
275275
// Dotty deviation: Scala2x allows access to private members implicitCache and setCreationTrace
276-
// even from a subclass prefix. Dotty (and Java) do not. I think that's a bug in Scala2x.
276+
// even from a subclass prefix. Dotty (and Java) do not. It's confirmed as a bug in Scala2x.
277277
newctx.asInstanceOf[FreshContext]
278278
}
279279

src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class Definitions {
292292
lazy val targs = ft.argInfos
293293
if ((FunctionClasses contains tsym) &&
294294
(targs.length - 1 <= MaxFunctionArity) &&
295-
(FunctionClass(targs.length - 1) == tsym)) Some((targs.init, targs.last)) // Dotty deviation: no auto-tupling
295+
(FunctionClass(targs.length - 1) == tsym)) Some(targs.init, targs.last)
296296
else None
297297
}
298298
}

src/dotty/tools/dotc/core/pickling/PickleBuffer.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,25 +229,25 @@ object PickleBuffer {
229229
PARAM -> Param,
230230
PACKAGE -> Package,
231231
MACRO -> Macro,
232-
BYNAMEPARAM -> ((Method, Covariant)), // Dotty deviation: no auto-tupling
233-
LABEL -> ((Label, Contravariant)), // Dotty deviation: no auto-tupling
232+
BYNAMEPARAM -> (Method, Covariant),
233+
LABEL -> (Label, Contravariant),
234234
ABSOVERRIDE -> AbsOverride,
235235
LOCAL -> Local,
236236
JAVA -> JavaDefined,
237237
SYNTHETIC -> Synthetic,
238238
STABLE -> Stable,
239239
STATIC -> Static,
240240
CASEACCESSOR -> CaseAccessor,
241-
DEFAULTPARAM -> ((DefaultParameterized, Trait)), // Dotty deviation: no auto-tupling
241+
DEFAULTPARAM -> (DefaultParameterized, Trait),
242242
BRIDGE -> Bridge,
243243
ACCESSOR -> Accessor,
244244
SUPERACCESSOR -> SuperAccessor,
245245
PARAMACCESSOR -> ParamAccessor,
246246
MODULEVAR -> Scala2ModuleVar,
247247
LAZY -> Lazy,
248-
MIXEDIN -> ((MixedIn, Scala2Existential)), // Dotty deviation: no auto-tupling
248+
MIXEDIN -> (MixedIn, Scala2Existential),
249249
EXPANDEDNAME -> ExpandedName,
250-
IMPLCLASS -> ((Scala2PreSuper, ImplClass)), // Dotty deviation: no auto-tupling
250+
IMPLCLASS -> (Scala2PreSuper, ImplClass),
251251
SPECIALIZED -> Specialized,
252252
DEFAULTINIT -> DefaultInit,
253253
VBRIDGE -> VBridge,

src/dotty/tools/dotc/reporting/UniqueMessagePositions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ trait UniqueMessagePositions extends Reporter {
2121
override def isHidden(d: Diagnostic)(implicit ctx: Context): Boolean =
2222
super.isHidden(d) || {
2323
d.pos.exists && {
24-
positions get ((ctx.source, d.pos.point)) match { // Dotty deviation: no autotupling
24+
positions get (ctx.source, d.pos.point) match {
2525
case Some(s) if s.level >= d.severity.level => true
2626
case _ => positions((ctx.source, d.pos.point)) = d.severity; false
2727
}

0 commit comments

Comments
 (0)