question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generated code for union with field named 'result' does not compile

See original GitHub issue

(with builderless)

Because a val $name = [...] will be generated by generateReadCall and there exists a var result = [...] on the outer scope that will conflict with val $name if $name is ‘result’.

See these two lines: https://github.com/microsoft/thrifty/blob/master/thrifty-kotlin-codegen/src/main/kotlin/com/microsoft/thrifty/kgen/KotlinCodeGenerator.kt#L1150 https://github.com/microsoft/thrifty/blob/master/thrifty-kotlin-codegen/src/main/kotlin/com/microsoft/thrifty/kgen/KotlinCodeGenerator.kt#L1370

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
benjamin-badercommented, Nov 23, 2020

Fixed in master; I can’t really predict when this will be shipped in a proper release. I’ll update here when that happens.

0reactions
luqasncommented, Nov 24, 2020

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compile Time Union Array - c++ - Stack Overflow
arr() function is not a compile time constant. Reading from a union can only be done on the active field of a union,...
Read more >
Code Gen Options (Using the GNU Compiler Collection (GCC))
In this case GCC falls back to generating multiple accesses rather than code that will fault or truncate the result at run time....
Read more >
Python Generated Code | Protocol Buffers - Google Developers
The protocol buffer compiler generates a class called Foo , which subclasses google.protobuf.Message . The class is a concrete class; no abstract methods...
Read more >
Schema Language - Cap'n Proto
You must define your message structure in a special language, then invoke the Cap'n Proto compiler ( capnp compile ) to generate source...
Read more >
v/docs.md at master · vlang/v - GitHub
Any imported module name can be aliased using the as keyword: NOTE: this example will not compile unless you have created mymod/sha256.v.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found