We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5742d9 commit 8545df6Copy full SHA for 8545df6
compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -796,9 +796,9 @@ class Definitions {
796
797
/** Is this type eligible for name based pattern matching?
798
*
799
- * That means either extending `scala.ProductN` or `NameBasedPattern`.
800
- * Ideally only the second condition should be used, first on is kept
801
- * for compatibility with scala2 compiled case classes.
+ * That means either extending `scala.ProductN` OR `NameBasedPattern`.
+ * In the long term, we can remove the first condition by having
+ * `scala.ProductN` inherit `NameBasedPattern`.
802
*/
803
def isNameBasedPatternSubType(tp: Type)(implicit ctx: Context) =
804
(tp.derivesFrom(ProductType.symbol) && tp.baseClasses.exists(isProductClass)) ||
0 commit comments