File tree 2 files changed +18
-2
lines changed
compiler/src/dotty/tools/dotc/typer 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ object Implicits {
60
60
61
61
/** Return those references in `refs` that are compatible with type `pt`. */
62
62
protected def filterMatching (pt : Type )(implicit ctx : Context ): List [Candidate ] = track(" filterMatching" ) {
63
+ val ptNorm = normalize(pt, pt) // `pt` could be implicit function types, check i2749
63
64
64
65
def refMatches (ref : TermRef )(implicit ctx : Context ) = /* ctx.traceIndented(i"refMatches $ref $pt")*/ {
65
66
@@ -124,8 +125,7 @@ object Implicits {
124
125
false
125
126
}
126
127
else
127
- NoViewsAllowed .isCompatible(normalize(ref, pt), pt) ||
128
- NoViewsAllowed .isCompatible(ref, pt) // `pt` could be an implicit function type, check i2749
128
+ NoViewsAllowed .isCompatible(normalize(ref, pt), ptNorm)
129
129
}
130
130
}
131
131
Original file line number Diff line number Diff line change @@ -5,3 +5,19 @@ object Test {
5
5
6
6
f : Boolean
7
7
}
8
+
9
+ object Test2 {
10
+ val f : implicit (implicit Int => Char ) => Boolean = ???
11
+ implicit val s : String = null
12
+ implicit val g : implicit Int => implicit String => Char = ???
13
+
14
+ f : Boolean
15
+ }
16
+
17
+ object Test3 {
18
+ val f : implicit (implicit Int => implicit String => Char ) => Boolean = ???
19
+ implicit val n : Int = 3
20
+ implicit val g : implicit Int => Char = ???
21
+
22
+ f : Boolean
23
+ }
You can’t perform that action at this time.
0 commit comments