Skip to content

Commit d07d669

Browse files
committed
Improve doc comments
1 parent 5d02fe1 commit d07d669

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ object SymDenotations {
386386
/** Is symbol a primitive value class? */
387387
def isPrimitiveValueClass(implicit ctx: Context) = defn.ScalaValueClasses contains symbol
388388

389-
/** Is symbol a primitive value class? */
389+
/** Is symbol a primitive numeric value class? */
390390
def isNumericValueClass(implicit ctx: Context) = defn.ScalaNumericValueClasses contains symbol
391391

392392
/** Is symbol a phantom class for which no runtime representation exists? */

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,9 @@ trait Applications extends Compatibility { self: Typer =>
10571057
else ts
10581058
}
10591059

1060+
/** If `trees` all have numeric value types, and they do not have all the same type,
1061+
* pick a common numeric supertype and convert all trees to this type.
1062+
*/
10601063
def harmonize(trees: List[Tree])(implicit ctx: Context): List[Tree] = {
10611064
def adapt(tree: Tree, pt: Type): Tree = tree match {
10621065
case cdef: CaseDef => tpd.cpy.CaseDef(cdef)(body = adapt(cdef.body, pt))
@@ -1065,6 +1068,9 @@ trait Applications extends Compatibility { self: Typer =>
10651068
harmonizeWith(trees)(_.tpe, adapt)
10661069
}
10671070

1071+
/** If all `types` are numeric value types, and they are not all the same type,
1072+
* pick a common numeric supertype and return it instead of every original type.
1073+
*/
10681074
def harmonizeTypes(tpes: List[Type])(implicit ctx: Context): List[Type] =
10691075
harmonizeWith(tpes)(identity, (tp, pt) => pt)
10701076
}

0 commit comments

Comments
 (0)