Add missing Uint8Array.setFromHex extern.#4306
Add missing Uint8Array.setFromHex extern.#4306KimlikDAO-bot wants to merge 2 commits intogoogle:masterfrom
Uint8Array.setFromHex extern.#4306Conversation
niloc132
left a comment
There was a problem hiding this comment.
Thanks for catching this!
|
Apologies for the non-compiling PR. Here's what happened: Each declaration type in gcc has one identity dimension [@constructor, @interface, @record] and one shape dimension [@struct, @unrestricted, @dict]. For better optimization, @interface's are preferred over @record's, but they can be more unergonomic when constructing the object. For return value like this, this issue doesn't occur and @interface's basically have no downside; you can still destructure out of interfaces without a cast: const { written, read } = myUint8Array.setFromHex("FF");By default, @interface's declared in this older constructor / prototype pattern have the @unrestricted shape. That's why we explicitly mark it as a @struct, which means you cannot do So to summarize, the ideal identity and shape for this return type appears to be @interface @struct, which is what this CL does. |
PiperOrigin-RevId: 885125258
|
Thanks for the fix! Merged in a9579d2 |
Supplements 64b6c77