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:
@@ -78,6 +78,12 @@ internal object ReminderNotification {
|
||||
}
|
||||
}
|
||||
|
||||
/** Take a reminder off the shade, once it has been acted on. */
|
||||
fun dismiss(
|
||||
context: Context,
|
||||
noteId: String,
|
||||
) = NotificationManagerCompat.from(context).cancel(noteId.hashCode())
|
||||
|
||||
private fun openIntent(
|
||||
context: Context,
|
||||
note: Note,
|
||||
|
||||
Reference in New Issue
Block a user