diff --git a/java/dagger/hilt/processor/internal/aggregateddeps/AggregatedDepsMetadata.java b/java/dagger/hilt/processor/internal/aggregateddeps/AggregatedDepsMetadata.java index 840ba9c00fb..0caaf7ba282 100644 --- a/java/dagger/hilt/processor/internal/aggregateddeps/AggregatedDepsMetadata.java +++ b/java/dagger/hilt/processor/internal/aggregateddeps/AggregatedDepsMetadata.java @@ -107,8 +107,11 @@ public static AggregatedDepsIr toIr(AggregatedDepsMetadata metadata) { } private static AggregatedDepsMetadata create(XTypeElement element, XProcessingEnv env) { + checkState( + element.hasAnnotation(ClassNames.AGGREGATED_DEPS), + "Missing @AggregatedDeps annotation on %s", + element.getClassName().canonicalName()); XAnnotation annotation = element.getAnnotation(ClassNames.AGGREGATED_DEPS); - return new AutoValue_AggregatedDepsMetadata( element, getTestElement(annotation.getAnnotationValue("test"), env),