Skip to content

Commit 5819d76

Browse files
committed
Document AOT limitation regarding to @bean type
Closes gh-29944
1 parent 431ae03 commit 5819d76

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

framework-docs/src/docs/asciidoc/core/core-aot.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Applying such optimizations early implies the following restrictions:
1818
** `@Profile`, in particular profile-specific configuration needs to be chosen at build time.
1919
** Environment properties that impact the presence of a bean (`@Conditional`) are only considered at build time.
2020
* Bean definitions with instance suppliers (lambdas or method references) can't be transformed Ahead of Time (see https://github.com/spring-projects/spring-framework/issues/29555[spring-framework#29555] related issue)
21+
* The return type of methods annotated with `@Bean` should be the most specific one in order to allow proper hint inference (typically the concrete class, not an interface).
2122

2223
When these restrictions are in place, it becomes possible to perform ahead-of-time processing at build time and generate additional assets.
2324
A Spring AOT processed application typically generates:

0 commit comments

Comments
 (0)