android: restore the dismiss I deleted, and teach the checker to see it
`785ebdb` failed at compileDebugKotlin with two `Unresolved reference 'dismiss'`. Splitting the reminder notification code into its own object, I removed `dismiss` from `Reminders` and never pasted it into `ReminderNotification`. The call sites were correctly qualified; the function simply was not there. All four local gates passed it, and `check-symbols.py` passed it for a reason it documented about itself: it only resolved the LEADING segment of a dotted expression, because that is the part a regex can resolve. `ReminderNotification` existed, so `ReminderNotification.dismiss(...)` looked fine. That was a real gap rather than an inherent one, so the checker now indexes the members of every `object` declared in the package and verifies `Foo.bar` against them. Brace-counted, not regex-matched — an object body is full of nested braces from lambdas and apply blocks, and no regex closes correctly over them. Verified by deleting `dismiss` from a copy of the tree again: it reports the same two call sites the Kotlin compiler did. What it still cannot see is narrowed and written down rather than left implied — members of anything declared outside this package, members reached through a variable rather than a type name, and every question about types.
This commit is contained in:
+6
-2
@@ -219,8 +219,12 @@ python3 android/tools/check-strings.py
|
||||
```
|
||||
|
||||
`check-symbols.py` flags any capitalised identifier that is neither imported,
|
||||
declared in the same package, a type parameter, nor implicitly available. Not a
|
||||
type checker — `compileDebugKotlin` in CI remains the only real one, and it is
|
||||
declared in the same package, a type parameter, nor implicitly available — and
|
||||
members of this package's own `object` declarations, so that `Foo.bar()` fails
|
||||
here when `Foo` has no `bar`. That second case exists because moving a function
|
||||
between two objects and forgetting to paste it into the second cost a red run
|
||||
(785ebdb): the call site was correctly qualified and every other gate passed.
|
||||
Not a type checker — `compileDebugKotlin` in CI remains the only real one, and it is
|
||||
also the ONLY lane that type-checks at all, since there is no Android SDK on the
|
||||
workstation.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user