Skip to content

Commit 839e47c

Browse files
committed
Companion methods are not real methods
1 parent 3785135 commit 839e47c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,12 @@ object SymDenotations {
482482
* - not an accessor
483483
* - not a label
484484
* - not an anonymous function
485+
* - not a companion method
485486
*/
486487
final def isRealMethod(implicit ctx: Context) =
487-
this.is(Method, butNot = AccessorOrLabel) && !isAnonymousFunction
488+
this.is(Method, butNot = AccessorOrLabel) &&
489+
!isAnonymousFunction &&
490+
!isCompanionMethod
488491

489492
/** Is this a setter? */
490493
final def isGetter(implicit ctx: Context) =

src/dotty/tools/dotc/transform/ValueClasses.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ object ValueClasses {
2424
isDerivedValueClass(d.owner) &&
2525
!d.isConstructor &&
2626
!d.is(SuperAccessor) &&
27-
!d.is(Macro) &&
28-
!d.isCompanionMethod
27+
!d.is(Macro)
2928

3029
/** The member that of a derived value class that unboxes it. */
3130
def valueClassUnbox(d: ClassDenotation)(implicit ctx: Context): Symbol =

0 commit comments

Comments
 (0)