We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5154f36 + 311717e commit 8943ebbCopy full SHA for 8943ebb
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -3281,8 +3281,11 @@ class Typer extends Namer
3281
def issueErrors(): Tree = {
3282
def paramSymWithMethodTree(paramName: TermName) =
3283
if tree.symbol.exists then
3284
- val paramSyms = tree.symbol.paramSymss.flatten.map(sym => sym.name -> sym).toMap
3285
- Some((paramSyms(paramName), tree))
+ tree.symbol.paramSymss.flatten
+ .map(sym => sym.name -> sym)
3286
+ .toMap
3287
+ .get(paramName)
3288
+ .map((_, tree))
3289
else
3290
None
3291
tests/neg/i11614.scala
@@ -0,0 +1,4 @@
1
+class I
2
+val c: (i: I) ?=> i.type = x ?=> x
3
+val d: (i: I) ?=> i.type = c
4
+val i = c // error
0 commit comments