@@ -7,7 +7,7 @@ import Contexts._
77import Decorators ._ , Symbols ._ , Names ._ , NameOps ._ , Types ._ , Flags ._ , Phases ._
88import Denotations .SingleDenotation
99import SymDenotations .SymDenotation
10- import NameKinds .WildcardParamName
10+ import NameKinds .{ WildcardParamName , ContextFunctionParamName }
1111import parsing .Scanners .Token
1212import parsing .Tokens
1313import printing .Highlighting ._
@@ -166,21 +166,24 @@ class AnonymousFunctionMissingParamType(param: untpd.ValDef,
166166 (using Context )
167167extends TypeMsg (AnonymousFunctionMissingParamTypeID ) {
168168 def msg (using Context ) = {
169- val ofFun =
169+ val paramDescription =
170170 if param.name.is(WildcardParamName )
171- || (MethodType .syntheticParamNames(tree.args.length + 1 ) contains param.name)
172- then i " \n\n In expanded function: \n $tree"
171+ || param.name.is(ContextFunctionParamName )
172+ || MethodType .syntheticParamNames(tree.args.length + 1 ).contains(param.name)
173+ then i " \n in expanded function: \n $tree"
173174 else " "
174175
175176 val inferred =
176- if ( inferredType == WildcardType ) " "
177- else i " \n\n Partially inferred type for the parameter : $inferredType"
177+ if inferredType == WildcardType then " "
178+ else i " \n What I could infer was : $inferredType"
178179
179180 val expected =
180- if ( expectedType == WildcardType ) " "
181- else i " \n\ n Expected type for the whole anonymous function: $expectedType"
181+ if expectedType == WildcardType then " "
182+ else i " \n Expected type for the whole anonymous function: \n $expectedType"
182183
183- i " Could not infer type for parameter ${param.name} of anonymous function $ofFun$inferred$expected"
184+ i """ Missing parameter type
185+ |
186+ |I could not infer the type of the parameter ${param.name}$paramDescription$inferred$expected"""
184187 }
185188
186189 def explain (using Context ) = " "
0 commit comments