@@ -160,23 +160,27 @@ extends SyntaxMsg(CaseClassMissingParamListID) {
160160
161161class AnonymousFunctionMissingParamType (param : untpd.ValDef ,
162162 tree : untpd.Function ,
163- pt : Type )
163+ inferredType : Type ,
164+ expectedType : Type ,
165+ )
164166 (using Context )
165167extends TypeMsg (AnonymousFunctionMissingParamTypeID ) {
166168 def msg (using Context ) = {
167169 val ofFun =
168170 if param.name.is(WildcardParamName )
169171 || (MethodType .syntheticParamNames(tree.args.length + 1 ) contains param.name)
170- then i " of expanded function:\n $tree"
172+ then i " \n\n In expanded function:\n $tree"
171173 else " "
172174
173175 val inferred =
174- if (pt == WildcardType ) " "
175- else i " \n What I could infer was : $pt "
176+ if (inferredType == WildcardType ) " "
177+ else i " \n\n Partially inferred type for the parameter : $inferredType "
176178
177- i """ Missing parameter type
178- |
179- |I could not infer the type of the parameter ${param.name}$ofFun. $inferred"""
179+ val expected =
180+ if (expectedType == WildcardType ) " "
181+ else i " \n\n Expected type for the whole anonymous function: $expectedType"
182+
183+ i " Could not infer type for parameter ${param.name} of anonymous function $ofFun$inferred$expected"
180184 }
181185
182186 def explain (using Context ) = " "
@@ -2985,4 +2989,4 @@ class ImplausiblePatternWarning(pat: tpd.Tree, selType: Type)(using Context)
29852989 i """ |Implausible pattern:
29862990 | $pat could match selector of type $selType
29872991 |only if there is an `equals` method identifying elements of the two types. """
2988- def explain (using Context ) = " "
2992+ def explain (using Context ) = " "
0 commit comments