File tree 3 files changed +42
-1
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -2003,7 +2003,10 @@ trait Applications extends Compatibility {
2003
2003
// the arity of that function, otherise -1.
2004
2004
def paramCount (ref : TermRef ) =
2005
2005
val formals = ref.widen.firstParamTypes
2006
- if formals.length > idx then defn.functionArity(formals(idx))
2006
+ if formals.length > idx then
2007
+ formals(idx).dealias match
2008
+ case defn.FunctionNOf (args, _, _) => args.length
2009
+ case _ => - 1
2007
2010
else - 1
2008
2011
2009
2012
val numArgs = args.length
Original file line number Diff line number Diff line change
1
+ import java .util .Map .Entry ;
2
+ import java .util .function .BiConsumer ;
3
+ import java .lang .Iterable
4
+
5
+ trait HttpHeaders extends Iterable [Entry [String , String ]] {
6
+ def forEach (action : BiConsumer [String , String ]): Unit = ???
7
+ }
8
+
9
+ @ main def Test =
10
+ val headers : HttpHeaders = ???
11
+ headers.forEach((a, b) => ??? )
Original file line number Diff line number Diff line change
1
+ import java .util .function .Function
2
+
3
+ trait HttpClient
4
+ trait HttpRequest
5
+ trait HttpResponse
6
+ trait ClientRequestContext
7
+
8
+ trait DecoratingHttpClientFunction {
9
+ def execute (delegate : HttpClient , ctx : ClientRequestContext , req : HttpRequest ): HttpResponse
10
+ }
11
+
12
+ class AbstractClientOptionsBuilder :
13
+ def decorator (fn : Function [? <: HttpClient , ? <: HttpClient ]): AbstractClientOptionsBuilder = ???
14
+ def decorator (fn : DecoratingHttpClientFunction ): AbstractClientOptionsBuilder = ???
15
+
16
+ class WebClientBuilder extends AbstractClientOptionsBuilder :
17
+ override def decorator (fn : Function [? <: HttpClient , ? <: HttpClient ]): WebClientBuilder = ???
18
+ override def decorator (fn : DecoratingHttpClientFunction ): WebClientBuilder = ???
19
+
20
+ class ArmeriaClientBuilder [F [_]]:
21
+ type DecoratingFunction = (HttpClient , ClientRequestContext , HttpRequest ) => HttpResponse
22
+ def clientBuilder : WebClientBuilder = ???
23
+
24
+ def withDecorator (decorator : DecoratingFunction ): ArmeriaClientBuilder [F ] = {
25
+ clientBuilder.decorator(decorator(_, _, _))
26
+ this
27
+ }
You can’t perform that action at this time.
0 commit comments