-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The match:kind getRankCover has an incorrect list of known tags.
Steps to reproduce
import '@endo/init';
import { makePassableKit } from '@endo/marshal';
import { M, getRankCover } from '@endo/patterns';
const { encodePassable } = makePassableKit();
const goodMatcher = M.kind('copySet');
console.log(getRankCover(goodMatcher));
// => [ ':', ';' ]
const badMatcher = M.kind('copyBag');
console.log(getRankCover(badMatcher));
// => TypeError: Cannot read properties of undefined (reading 'cover')
const unknownMatcher = M.kind('foo');
console.log(getRankCover(unknownMatcher));
// => TypeError: Cannot read properties of undefined (reading 'cover')Expected behavior
getRankCover treats copyBag matchers the same as copySet matchers. I also think it should emit a range covering all taggeds for an unknown kind matcher, but (for accommodating the possibility of introducing new pass styles in the future) a case could also be made for emitting a range that covers all values, or for preserving the current behavior of throwing an exception. But as noted elsewhere, I'm not comfortable with mixing known pass styles and known tag names into a single "kind" concept at all.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working