Changelog
All notable changes to this project will be documented here.
The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.2]
Fixed
-
@Aroundon functions with complex bodies now compiles correctly — the IR deep-copy of the local function body was performed statement-by-statement, giving each call its ownSymbolRemapper. References between local variables (e.g.val b = a + 1) were left pointing to the outer function's symbols, which the JVM lowering phase misidentified as closure captures. Once the outer body was cleared the missing frame slot causedIllegalStateException: No mapping for symbolat codegen. The entire body is now deep-copied in a single pass so all intra-body references are correctly remapped. (#AroundLocalFunctionGenerationTest) -
@Aroundon functions containing lambdas or nested local functions no longer returns wrong values —BodyTransformer.visitReturnpreviously redirected everyIrReturnto the generated$<name>local function, including returns inside nested lambdas and local functions. This caused constructs such aslistOf(1,2,3).sumOf { it + base }to short-circuit after the first element. The transformer now only redirects returns that originally targeted the outer function.
Added
-
Extension functions on
JoinPoint(JoinPointExtensions.kt):getArg<T>(name)— retrieves a named argument, cast toT; throws on missing namegetArgOrNull<T>(name)— same as above but returnsnullon missing name or cast failuregetTarget<T>()— caststargettoT; throws onnullor cast failuregetTargetOrNull<T>()— caststargettoT; returnsnullotherwisefindAnnotation<T>()— findsAnnotationInfoby annotation type on the intercepted function
-
Extension functions on
MethodSignature(MethodSignatureExtensions.kt):findAnnotation<T>()— findsAnnotationInfoby annotation type inannotations
-
Extension functions on
AnnotationInfo(AnnotationInfoExtensions.kt):getArg<T>(paramName)— retrieves a named annotation argument, cast toTgetArgOrNull<T>(paramName)— same but returnsnullon missing name or cast failure
[0.2.0]
Added
@Afteradvice annotation: runs after the target function body in afinallyblock, regardless of whether an exception was thrown@Aroundadvice annotation: replaces the target function call; the original body is invoked viaProceedingJoinPoint.proceed()ProceedingJoinPointinterface withproceed()andproceed(vararg args)for argument substitutionDefaultProceedingJoinPointruntime implementation generated at each@Aroundcall site
Changed
- Advice generation pipeline restructured: each
AspectContextis now dispatched directly to its generator, eliminating redundant internal lookups
[0.1.1]
Added
- Kotlin version validation: AspectK now throws a
GradleExceptionat configuration time if the project's Kotlin compiler version is not in the supported range
Changed
- Kotlin version updated to 2.3.10
pluginIdinAspectKCompilerPluginRegistrarnow referencesBuildConfig.COMPILER_PLUGIN_IDinstead of a hardcoded string
[0.1.0] — Initial Release
Added
@Aspectannotation to mark aspect classes@Beforeadvice annotation withtargetandinheritsparametersJoinPointinterface withtarget,signature, andargsMethodSignaturewith full compile-time metadataMethodParameterwith type, name, annotations, and nullability infoAnnotationInfofor runtime-accessible annotation metadata- Kotlin Multiplatform support (JVM, JS, WASM, Native Tier 1–3)
- K2 IR-based compiler plugin (
AspectKCompilerPluginRegistrar) - Gradle plugin (
io.github.mole-labs.aspectk.compiler) - Many-to-many aspect-to-target relationships
- Inheritance support via
inherits = true - Thread-safe
AspectLookUpimplementation