thrift-typescript icon indicating copy to clipboard operation
thrift-typescript copied to clipboard

Can't use enums from other files in map constants

Open hayes opened this issue 5 years ago • 4 comments

The following produces an error, but should be valid:

keys.thrift

namespace js example
enum Keys {
  foo = 1,
  bar = 2,
}

map.thrift

namespace js example
include './keys.thrift'

const map<keys.Keys, string>  MyMap = {
  keys.Keys.foo: "foo",
  keys.Keys.bar: "bar",
}

Error: Unable to resolve value of identifier[keys.Keys.foo]

hayes avatar Sep 14 '19 00:09 hayes

Any change to get this PR merged? I'm facing the same issue here:

(node:88856) UnhandledPromiseRejectionWarning: Error: Unable to resolve identifier[FeeType] in xxx/xxx/xxx

hc-danieltiziani avatar Dec 17 '19 15:12 hc-danieltiziani

Same problem here, why this PR is not yet merged after two years ?

thonythony avatar Jun 03 '21 09:06 thonythony

🤷 I know a couple of other small things got addressed since I put this up, but the repo has been pretty in-active for a while. We ended up creating a fork at Airbnb since there were several issues we couldn't get any progress on (I don't work there anymore).

hayes avatar Jun 03 '21 18:06 hayes

Also curious about the feasibility of merging this in.

niodice avatar Jul 20 '23 21:07 niodice