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

Clarify order of well-known-type conversion vs. selection, indexing, and type check #76

Open
JimLarson opened this issue Jul 13, 2019 · 0 comments
Labels

Comments

@JimLarson
Copy link
Contributor

The language spec doesn't clearly explain how the automatic conversion of dynamic value protos interacts with type checking and runtime selection/indexing. For instance, given the following proto definitions:

message FakeAny {
    bytes value = 2;
}

and the following declarations and bindings

a: google.protobuf.Int64Value = 7
b: google.protobuf.Any = {...encoding of FakeAny{ value: "\377\377\377" }...}

do the following expressions type check, and what do they evaluate to?

a + 3
a.int_value + 3
b.value
b.value.value

I believe that what's intended is that the first and third will execute without error yielding 10 and b'\377\377\377' respectively, while the second and fourth should fail.

@JimLarson JimLarson added the 1.0 label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@JimLarson and others