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

Getting error "Method does not override any method from its superclass" from generated output when using maps #109

Closed
DeepAnchor opened this issue Jan 25, 2016 · 10 comments
Assignees
Labels

Comments

@DeepAnchor
Copy link

Hey,

Thanks for creating this project!

I have a simple message definition with map types like so:

syntax = "proto3";

message ParticipantWrapper {
  map<string, Participant> participant = 1;
}

message Participant {
  uint32 id = 1;
  string name = 2;
}

When I compile it (using the Protobuf3.0-Swift2.0 branch), the generated output shows many errors with "Method does not override any method from its superclass". I don't think I've used any reserved keywords so it does not appear to be related to #34. Idea idea what the problem could be?

@alexeyxo
Copy link
Owner

What version runtime library you have use?

@DeepAnchor
Copy link
Author

I believe it's version 1.6 from the ProtoBuf3.0-Swift2.0 branch. Installed it from cocoapods with

pod 'ProtocolBuffers-Swift', :git => 'https://github.com/alexeyxo/protobuf-swift.git', :branch => 'ProtoBuf3.0-Swift2.0'

*I should add that I've also tried 2.4.1, with the same results.

@albeebe
Copy link

albeebe commented Jan 27, 2016

This may be unrelated but I pulled the latest code and got compilation errors about overriding a superclass and the solution was to upgrade to the latest protobuf-swift protoc plugin.

@DeepAnchor
Copy link
Author

hey, thanks for the info @albeebe, yeah I'm pretty sure i'm doing something wrong on my end since the latest travis build seems to be passing. Did you mean you updated the swift runtime or the compiler plugin?
If you're talking about the runtime, which version worked for you?

I tried running it with a clean build in xcode with the latest runtime (2.4.1) and it showed these errors.

@albeebe
Copy link

albeebe commented Jan 27, 2016

Yesterday I upgraded the runtime to the current code in the repo and I got compilation errors about overriding the superclass. It wasn't until later on in the day I upgraded to the latest version of the compiler that the errors went away. Right now I'm using the most up to date runtime and compiler and things are working.

Up until today I was using a copy of the runtime and compiler that I installed back in October.

@albeebe
Copy link

albeebe commented Jan 27, 2016

@DeepAnchor I should note that I'm using the code from the master branch

@DeepAnchor
Copy link
Author

hmm, interesting. Just to clarify, are you using syntax="proto3"?

@albeebe
Copy link

albeebe commented Jan 27, 2016

no proto2 is what I'm using

On Wednesday, January 27, 2016, DeepAnchor notifications@github.com wrote:

hmm, interesting. Just to clarify, are you using syntax="proto3"?


Reply to this email directly or view it on GitHub
#109 (comment)
.

@alexeyxo
Copy link
Owner

I think you use compiler from "Proto3.0-Swift2.0" branch, but runtime library from master.
You should use compiler and library from "Proto3.0-Swift2.0" branch. Your example is working in my test project.

@alexeyxo alexeyxo self-assigned this Jan 28, 2016
@DeepAnchor
Copy link
Author

Ok, the problem is solved now. I think it had something to do with the cocoapods cache referring to the master branch instead of the Proto3.0-Swift2.0 branch, even though I had clearly installed the runtime from the Proto3.0-Swift2.0 branch. Very odd indeed, since I had tried clearing the cache and reloading the workspace several times.

What I ended up doing was just deleting everything related to cocoapods, clearing all cached pods as well as removing the Pods/ folder and just starting with a fresh pod install.

Thanks for all your help!

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

3 participants