Comments (3)
Thanks for the comments! I think the correct thing to do here would be to rename the generated types to contain the parent message name. I will give it a try and post updates here. Thanks for your patience!
from elm-protobuf.
The compiler errors:
-- DUPLICATE DEFINITION -------------------------------- ./src/Proto/Triples.elm
Naming multiple top-level values `Change` makes things ambiguous. When you say
`Change` which one do you want?
225|>type alias Change =
226|> { changeOneof : ChangeOneof
227|> }
Find all the top-level values named `Change` and do some renaming. Make sure the
names are distinct!
-- DUPLICATE DEFINITION -------------------------------- ./src/Proto/Triples.elm
Naming multiple top-level values `Event` makes things ambiguous. When you say
`Event` which one do you want?
78|>type alias Event =
79|> { eventOneof : EventOneof
80|> }
Find all the top-level values named `Event` and do some renaming. Make sure the
names are distinct!
-- DUPLICATE DEFINITION -------------------------------- ./src/Proto/Triples.elm
Naming multiple top-level values `Match` makes things ambiguous. When you say
`Match` which one do you want?
13|>type ClaimType
14|> = Match -- 0
15|> | Nomatch
Find all the top-level values named `Match` and do some renaming. Make sure the
names are distinct!
Detected errors in 1 module.
from elm-protobuf.
This is an issue for me as well. I created a simplified proto file that exhibits this problem:
syntax = "proto3";
package com.example;
message FirstMessage {
oneof same_fieldname{
string foo = 1;
int32 bar = 2;
}
}
message SecondMessage{
oneof same_fieldname{
int64 baz = 1;
string bip = 2;
}
}
All of the files to reproduce this bug are uploaded here:
ElmProtoBug.zip
Running elm-reactor and navigating to http://localhost:8000/src/Bad.elm reproduces the problem.
Error output
Starting downloads...
● elm-lang/virtual-dom 2.0.4
● tiziano88/elm-protobuf 2.1.0
● elm-lang/core 5.1.1
● elm-lang/html 2.0.0
● jweir/elm-iso8601
3.0.2
Packages configured successfully!
Detected errors in 1 module.
-- DUPLICATE DEFINITION -------------------------------------------- src/Bad.elm
Naming multiple top-level values `sameFieldnameDecoder` makes things ambiguous.
When you say `sameFieldnameDecoder` which one do you want?
70| sameFieldnameDecoder =
^^^^^^^^^^^^^^^^^^^^
Find all the top-level values named `sameFieldnameDecoder` and do some renaming.
Make sure the names are distinct!
-- DUPLICATE DEFINITION -------------------------------------------- src/Bad.elm
Naming multiple top-level values `sameFieldnameEncoder` makes things ambiguous.
When you say `sameFieldnameEncoder` which one do you want?
79| sameFieldnameEncoder v =
^^^^^^^^^^^^^^^^^^^^
Find all the top-level values named `sameFieldnameEncoder` and do some renaming.
Make sure the names are distinct!
-- DUPLICATE DEFINITION -------------------------------------------- src/Bad.elm
Naming multiple top-level values `SameFieldnameUnspecified` makes things
ambiguous. When you say `SameFieldnameUnspecified` which one do you want?
19|>type SameFieldname
20|> = SameFieldnameUnspecified
21|> | Foo String
22|> | Bar Int
Find all the top-level values named `SameFieldnameUnspecified` and do some
renaming. Make sure the names are distinct!
-- DUPLICATE DEFINITION -------------------------------------------- src/Bad.elm
There are multiple types named `SameFieldname` in this module.
19|>type SameFieldname
20|> = SameFieldnameUnspecified
21|> | Foo String
22|> | Bar Int
Search through this module, find all the types named `SameFieldname`, and give
each of them a unique name.
Workaround: Changing the proto file to the following fixes the problem
syntax = "proto3";
package com.example;
message FirstMessage {
oneof same_fieldname{
string foo = 1;
int32 bar = 2;
}
}
message SecondMessage{
oneof different_fieldname{
int64 baz = 1;
string bip = 2;
}
}
from elm-protobuf.
Related Issues (11)
- Support for proto2 syntax? HOT 10
- infix functions in generated decoders HOT 2
- Elm 0.19 upgrade not working HOT 2
- Update Functions HOT 4
- support gRPC services HOT 6
- Update tags to support Go modules HOT 3
- Incorrect code generated with type names
- Map support HOT 7
- LIst of items not decoding HOT 1
- enum as int32 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-protobuf.