@@ -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 ._
@@ -167,21 +167,24 @@ class AnonymousFunctionMissingParamType(param: untpd.ValDef,
167167 (using Context )
168168extends TypeMsg (AnonymousFunctionMissingParamTypeID ) {
169169 def msg (using Context ) = {
170- val ofFun =
170+ val paramDescription =
171171 if param.name.is(WildcardParamName )
172- || (MethodType .syntheticParamNames(tree.args.length + 1 ) contains param.name)
173- then i " \n\n In expanded function: \n $tree"
172+ || param.name.is(ContextFunctionParamName )
173+ || MethodType .syntheticParamNames(tree.args.length + 1 ).contains(param.name)
174+ then i " \n in expanded function: \n $tree"
174175 else " "
175176
176177 val inferred =
177- if ( inferredType == WildcardType ) " "
178- else i " \n\n Partially inferred type for the parameter : $inferredType"
178+ if inferredType == WildcardType then " "
179+ else i " \n What I could infer was : $inferredType"
179180
180181 val expected =
181- if ( expectedType == WildcardType ) " "
182- else i " \n\ n Expected type for the whole anonymous function: $expectedType"
182+ if expectedType == WildcardType then " "
183+ else i " \n Expected type for the whole anonymous function: \n $expectedType"
183184
184- i " Could not infer type for parameter ${param.name} of anonymous function $ofFun$inferred$expected"
185+ i """ Missing parameter type
186+ |
187+ |I could not infer the type of the parameter ${param.name}$paramDescription$inferred$expected"""
185188 }
186189
187190 def explain (using Context ) = " "
0 commit comments