Repository navigation
Commit 5013598
Skip records in the external-spec pass (#370)
Fixes #369.
## Problem
Since #363 (Spoon 11), any `record` crashed verification with an NPE in
`TypeChecker.scan`. Spoon 11 dispatches records to `visitCtRecord`;
`ExternalRefinementTypeChecker` overrides only `visitCtClass` (to skip
user classes), so it walked the record's methods with `prefix == null`
and `createReference(null)` threw. Building the error message then
failed on the record's implicit members, which have no source file.
## Change
- `ExternalRefinementTypeChecker.visitCtRecord`: skip, as for classes.
- `TypeChecker.scan`: when the failing element has no source file, the
message says so instead of throwing an NPE.
With this, record methods are verified: a refinement violation inside a
record method is reported (related to #342).
## Tests
- `CorrectRecord`: a record with a method calling a refined method
correctly; crashed on main, now passes.
- `ErrorRecordMethod`: a violation in a record method is reported.
- `mvn test` passes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 43023fc commit 5013598
4 files changed
Lines changed: 37 additions & 1 deletion
File tree
- liquidjava-example/src/main/java/testSuite
- liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
0 commit comments