google / google/compile-testing

A deferred diagnostic of a second compilation error on the same element is not reported

Open
#124 1 comment 0 reactions 0 assignees View on GitHub
P3 type=defect
Dominant language
Java
Stars
722
Forks
129
Avg merge
11m
Merged PRs (30d)
4

Description

**Versions**

- **compile-testing**: 0.10 (cannot upgrade to 0.11 because of the incompatibilities of Guava 18 from Neo4j and Guava 20 required by the truth assertion library pulled by compile-testing 0.11, see https://github.com/google/compile-testing/issues/125).
- **javac**: 1.8.0_65
- **OS**: Mac OS 10.12.5

**Context**

In Neo4j, an aggregation function is defined with an `@UserAggregationFunction`-annotated method whose returned type's enclosing class (aka aggregation type) must define two methods, one annotated with `@UserAggregationUpdate`, another `@UserAggregationResult`.

Now, I have got a [unit test](https://github.com/fbiville/neo4j/blob/update_compiler_3.2/community/procedure-compiler/processor/src/test/java/org/neo4j/tooling/procedure/UserAggregationFunctionProcessorTest.java#L70) that makes sure that an aggregation type without those two annotations triggers two compilation errors (1 for the missing `@UserAggregationUpdate`, 1 for the missing `@UserAggregationResult`).

**First diagnostic**

After debugging a bit `com.google.testing.compile.Compiler#compile(java.lang.Iterable)`, it seems the deferred diagnostic for the second compilation error never comes, despite both errors being sent.

**How to reproduce**

```
## setup steps
$> git clone -b update_compiler_3.2 git@github.com:fbiville/neo4j.git && cd neo4j
## this one may take some time (https://xkcd.com/303/)
$> mvn -am -pl community/procedure-compiler/processor clean install -DskipTests
$> sed -i.bak '/@Ignore/d' community/procedure-compiler/processor/src/test/java/org/neo4j/tooling/procedure/UserAggregationFunctionProcessorTest.java
## actually run the failing test
$> mvn test -Dtest="UserAggregationFunctionProcessorTest#fails_if_aggregation_function_exposes_return_type_without_aggregation_methods" -f community/procedure-compiler/processor/pom.xml
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.