Skip to content

Commit 3663632

Browse files
authored
Merge pull request #3757 from agentgt/issue_3756
Add cast of lambda constructor to jooby-apt to fix ambiguous compiler error #3756
2 parents b1dc85b + b674084 commit 3663632

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

modules/jooby-apt/src/main/resources/io/jooby/internal/apt/Source.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class ${generatedClassName} implements io.jooby.MvcExtension {
99
}
1010

1111
public ${generatedClassName}(java.util.function.Supplier<${className}> provider) {
12-
this(ctx -> provider.get());
12+
this(ctx -> (${className}) provider.get());
1313
}
1414

1515
public ${generatedClassName}(java.util.function.Function<io.jooby.Context, ${className}> factory) {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
6+
package io.jooby.i3756;
7+
8+
import io.jooby.annotation.GET;
9+
import io.jooby.annotation.Path;
10+
11+
@Path("/C3756")
12+
public class C3756 {
13+
private final S3756 s3756;
14+
15+
public C3756(S3756 s3756) {
16+
super();
17+
this.s3756 = s3756;
18+
}
19+
20+
@GET
21+
public String handle() {
22+
s3756.accept("hello");
23+
return "hello";
24+
}
25+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Jooby https://jooby.io
3+
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
4+
* Copyright 2014 Edgar Espina
5+
*/
6+
package io.jooby.i3756;
7+
8+
public interface S3756 {
9+
10+
void accept(String s);
11+
}

0 commit comments

Comments
 (0)