Skip to content

Commit f01abfb

Browse files
committed
Update comment for harmonize
1 parent 86f249c commit f01abfb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,13 @@ trait Applications extends Compatibility {
22162216
* have added constraints to type parameters which are no longer
22172217
* implied after harmonization. No essential constraints are lost by this because
22182218
* the result of harmonization will be compared again with the expected type.
2219-
* Test cases where this matters are in pos/harmomize.scala.
2219+
* Test cases where this matters are in neg/harmomize.scala and run/weak-conformance.scala.
2220+
*
2221+
* Note: this assumes that the internal typing of the arguments using `op` does
2222+
* not leave any constraints, so the only info that is reset is the relationship
2223+
* between the argument's types and the expected type. I am not sure this will
2224+
* always be the case. If that property does not hold, we risk forgetting constraints
2225+
* which could lead to unsoundness.
22202226
*/
22212227
def harmonic[T](harmonize: List[T] => List[T], pt: Type)(op: => List[T])(using Context): List[T] =
22222228
if (!isFullyDefined(pt, ForceDegree.none)) {

0 commit comments

Comments
 (0)