Skip to content

Commit 8545df6

Browse files
Update isNameBasedPatternSubType documentation
1 parent b5742d9 commit 8545df6

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
@@ -796,9 +796,9 @@ class Definitions {
796796

797797
/** Is this type eligible for name based pattern matching?
798798
*
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.
799+
* That means either extending `scala.ProductN` OR `NameBasedPattern`.
800+
* In the long term, we can remove the first condition by having
801+
* `scala.ProductN` inherit `NameBasedPattern`.
802802
*/
803803
def isNameBasedPatternSubType(tp: Type)(implicit ctx: Context) =
804804
(tp.derivesFrom(ProductType.symbol) && tp.baseClasses.exists(isProductClass)) ||

0 commit comments

Comments
 (0)