Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Can't compile due to name conflicts in some cases #196

Open
inobu opened this issue Mar 17, 2023 · 1 comment
Open

bug: Can't compile due to name conflicts in some cases #196

inobu opened this issue Mar 17, 2023 · 1 comment
Labels
bug Something isn't working needs discussion A issue needs discussion and community interest

Comments

@inobu
Copy link

inobu commented Mar 17, 2023

Summary

Can't compile due to name conflicts in some cases

About

If the field 'has_${message_name}' and the field '${message_name}' exist in the same message, the name of 'has_${message_name}' automatically generated by '${message_name}' conflicts.

Example

proto

syntax = "proto3";

message EmbeddedMessage {
  string a = 1;
}

message ConflictMessage {
  EmbeddedMessage embedded_message = 1;
  bool has_embedded_message = 2;
}

ts

---

    get has_embedded_message() {
        return pb_1.Message.getField(this, 1) != null;
    }
    get has_embedded_message() {
        return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
    }

---
@inobu inobu changed the title Can't compile due to name conflicts in some cases bug: Can't compile due to name conflicts in some cases Mar 17, 2023
@thesayyn
Copy link
Owner

that's expected. what do you think should be the behavior when we encounter this case? not generate the conflicting names?

@thesayyn thesayyn added bug Something isn't working needs discussion A issue needs discussion and community interest labels Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs discussion A issue needs discussion and community interest
Projects
None yet
Development

No branches or pull requests

2 participants