Context
When a trie is attached using attachAndConsume, the trie is consumed and subsequent modifications to it are not reflected in the parent trie. Currently, adding routes to a consumed trie after attachment is a silent no-op.
Enhancement Request
Consider throwing an error when attempting to add routes to a consumed trie to make it apparent that the operation has no effect.
References
Related Code
trieB.add(NormalizedPath('/'), 1);
trieA.attachAndConsume(NormalizedPath('/api'), trieB);
// Add a new route to trieB after attachment
trieB.add(NormalizedPath('/new'), 2); // This is currently a no-op
The suggestion is to throw an error at this point to make the no-op behavior explicit.
Context
When a trie is attached using
attachAndConsume, the trie is consumed and subsequent modifications to it are not reflected in the parent trie. Currently, adding routes to a consumed trie after attachment is a silent no-op.Enhancement Request
Consider throwing an error when attempting to add routes to a consumed trie to make it apparent that the operation has no effect.
References
Related Code
The suggestion is to throw an error at this point to make the no-op behavior explicit.