Skip to content

Commit d86e4f2

Browse files
committed
Add comment explaining param registration in LambdaType
1 parent d4f836e commit d86e4f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/semanticdb/TypeOps.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class TypeOps:
9797
// and register them to the symbol table with `(<y>, inner) -> <y>`
9898
// instead of `("y", outer) -> <y>`
9999
// We must also check for parameter shadowing such as def shadowParam(x: Int) = {val x = true}
100+
// We skip param symbol check if owner is not a LambdaType for proper MatchType paramRef entry in the paramRefSymtab
101+
// for more information: https://github.com/scala/scala3/pull/23161#discussion_r2097755983
100102

101103
if (sym.is(Flags.Param) || !sym.owner.info.isInstanceOf[LambdaType]) && lam.paramNames.contains(sym.name) then
102104
paramRefSymtab((lam, sym.name)) = sym

0 commit comments

Comments
 (0)