File tree 1 file changed +8
-0
lines changed
service/inject/codegen/src/main/java/io/helidon/service/inject/codegen
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,14 @@ private List<TypedElementInfo> fieldInjectElements(TypeInfo typeInfo) {
1066
1066
.filter (ElementInfoPredicates ::isPrivate )
1067
1067
.findFirst ();
1068
1068
if (firstFound .isPresent ()) {
1069
+ if (typeInfo .kind () == ElementKind .RECORD ) {
1070
+ throw new CodegenException ("Discovered " + InjectCodegenTypes .INJECTION_INJECT .fqName ()
1071
+ + " annotation on record field(s). This is not supported. "
1072
+ + "If this is the only constructor, you can remove the Inject annotation; "
1073
+ + "if you need to inject the default constructor, kindly create an explicit"
1074
+ + " default constructor and annotate it with Inject." ,
1075
+ firstFound .get ().originatingElementValue ());
1076
+ }
1069
1077
throw new CodegenException ("Discovered " + InjectCodegenTypes .INJECTION_INJECT .fqName ()
1070
1078
+ " annotation on private field(s). We cannot support private field injection." ,
1071
1079
firstFound .get ().originatingElementValue ());
You can’t perform that action at this time.
0 commit comments