Skip to content

Commit ff7d5f7

Browse files
committed
Adds type check to stringMap
1 parent 6aa4e91 commit ff7d5f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stringMap.grace

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ once class dictionary⟦K,T⟧ {
1616

1717

1818
class dictionary⟦K, T⟧ (initialBindings: CollectionBindingK,T⟧⟧) {
19+
if (StringK) then {
20+
TypeError.raise "Keys to a stringMap must be Strings, not {K}"
21+
}
1922
native "js" code ‹this.data.inner = { };›
2023
initialBindings.do { b:Binding ->
2124
self.at (b.key) put (b.value)

0 commit comments

Comments
 (0)