File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff 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? */
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments