Skip to content

Commit 48768c4

Browse files
Update isNameBasedPatternSubType documentation
1 parent dffac2d commit 48768c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,9 @@ class Definitions {
843843

844844
/** Is this type eligible for name based pattern matching?
845845
*
846-
* That means either extending `scala.ProductN` or `NameBasedPattern`.
847-
* Ideally only the second condition should be used, first on is kept
848-
* for compatibility with scala2 compiled case classes.
846+
* That means either extending `scala.ProductN` OR `NameBasedPattern`.
847+
* In the long term, we can remove the first condition by having
848+
* `scala.ProductN` inherit `NameBasedPattern`.
849849
*/
850850
def isNameBasedPatternSubType(tp: Type)(implicit ctx: Context) =
851851
(tp.derivesFrom(ProductType.symbol) && tp.baseClasses.exists(isProductClass)) ||

0 commit comments

Comments
 (0)