Skip to content

Commit 464ceb4

Browse files
committed
Only select parameterless get methods in unapplys.
Otherwise we'd get a failure due to an overloaded `get` definition whenever we typecheck a case class that is also a Map (because maps inherit a `get`).
1 parent 2ec12e6 commit 464ceb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object Applications {
3333
def hasNamedArg(args: List[Any]) = args exists isNamedArg
3434

3535
def extractorMemberType(tp: Type, name: Name, errorPos: Position = NoPosition)(implicit ctx:Context) = {
36-
val ref = tp member name
36+
val ref = tp.member(name).suchThat(_.info.isParameterless)
3737
if (ref.isOverloaded)
3838
errorType(i"Overloaded reference to $ref is not allowed in extractor", errorPos)
3939
else if (ref.info.isInstanceOf[PolyType])

0 commit comments

Comments
 (0)