Enforce that abstract members are implemented

This adds a check that abstract members must be implemented.
If any members lack an implementation, an error is thrown describing
the missing members.

Also: we have a bug in `pkl:base`; class `Set` does not implement all
members of class `Collection`.
This commit is contained in:
Dan Chao
2026-06-12 15:25:51 -07:00
parent a9c98e4396
commit a6b02692bb
15 changed files with 261 additions and 5 deletions
+12
View File
@@ -3562,6 +3562,18 @@ external class Set<out Element> extends Collection<Element> {
/// The difference of this set and [other].
external function difference(other: Set): Set<Element>
function indexOf(_): Int = throw("Set does not implement `indexOf`")
function indexOfOrNull(_): Int? = throw("Set does not implement `indexOfOrNull`")
function lastIndexOf(_): Int = throw("Set does not implement `lastIndexOf`")
function lastIndexOfOrNull(_): Int? = throw("Set does not implement `lastIndexOfOrNull`")
function findIndex(_): Int = throw("Set does not implement `findIndex`")
function findIndexOrNull(_): Int? = throw("Set does not implement `findIndexOrNull`")
function findLastIndex(_): Int = throw("Set does not implement `findLastIndex`")
function findLastIndexOrNull(_): Int? = throw("Set does not implement `findLastIndexOrNull`")
}
/// Creates a map containing the given alternating [keysAndValues].