Skip to content

Commit

Permalink
Fix regression #17245
Browse files Browse the repository at this point in the history
  • Loading branch information
jchyb committed Jul 25, 2023
1 parent aac8ba7 commit 94e4df9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ class Definitions {
case ErasedFunctionOf(mt) =>
Some(mt.paramInfos, mt.resType, mt.isContextualMethod)
case _ =>
val tsym = ft.dealias.typeSymbol
val tsym = ft.typeSymbol
if isFunctionSymbol(tsym) && ft.isRef(tsym) then
val targs = ft.dealias.argInfos
if (targs.isEmpty) None
Expand Down
17 changes: 17 additions & 0 deletions tests/pos/i17245.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import scala.reflect.ClassTag

trait MockSettings

object Mockito {
def mock[T : ClassTag]: T = ???
def mock[T : ClassTag](settings: MockSettings): T = ???
}

trait Channel
type OnChannel = Channel => Any

@main def Test =
val case1: OnChannel = Mockito.mock[OnChannel]
val case2: OnChannel = Mockito.mock
val case3 = Mockito.mock[OnChannel]
val case4: OnChannel = Mockito.mock[OnChannel](summon[ClassTag[OnChannel]])

0 comments on commit 94e4df9

Please sign in to comment.