-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
Description
Maybe I'm missing something, but I can't get enums to work:
$ cat > example.proto
package figma;
enum ExampleType {
A = 0;
B = 1;
}
message Example {
required ExampleType type = 1;
}
$ ./bin/pbf example.proto > example.js
$ node -e 'pbf = require("./index"), console.log(require("./example").Example.write({type: "A"}, new pbf()))'
pbf/example.js:16
if (example.type !== undefined) pbf.writeMessage(1, writeExampleType, exam
^
ReferenceError: writeExampleType is not defined
at Object.writeExample [as write] (pbf/example.js:16:57)
at [eval]:1:68
at Object.exports.runInThisContext (vm.js:74:17)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:460:26)
at evalScript (node.js:431:25)
at startup (node.js:90:7)
at node.js:814:3
It looks like there's code that should be handling enums, it's just never being called.
Reactions are currently unavailable