google / protobuf.dart

Runtime library for Dart protobufs
https://pub.dev/packages/protobuf
BSD 3-Clause "New" or "Revised" License
527 stars 183 forks source link

NoSuchMethodError: Closure call with mismatched arguments: function '_memberNamesSuffix' #377

Closed hjlp20150803 closed 2 years ago

hjlp20150803 commented 4 years ago

I think this should be a bug, cause the same proto file is good when I use '$ protoc ./test.proto --go_out=grpc:./dart',but it's wrong with '$ protoc ./test.proto --dart_out=grpc:./dart'.

The problem should be here: 'string Create=11;', it's good when I change it to 'string Create0=11;'

I am not sure if the 'Create' is the protected word.

$ pub --version
Pub 2.8.4

$ dart --version
Dart VM version: 2.9.0-13.0.dev.flutter-54adfeb93f (be) (Tue Jun 2 18:40:43 2020 +0000) on "macos_x64"

$ brew info dart
dart-lang/dart/dart: stable 2.8.4, devel 2.9.0-13.0.dev
The Dart SDK
https://dart.dev
Conflicts with:
  dart-beta (because dart-beta ships the same binaries)
/usr/local/Cellar/dart/2.8.4 (502 files, 486MB) *
  Built from source on 2020-06-05 at 09:50:05
From: https://github.com/dart-lang/homebrew-dart/blob/master/dart.rb
==> Options
--devel
    Install development version 2.9.0-13.0.dev
==> Caveats
Please note the path to the Dart SDK:
  /usr/local/opt/dart/libexec

test.proto:
syntax = "proto3";

package bridge;
//protoc-c --c_cout=.  *.proto
//protoc --go_out=. *.proto 
//protoc --dart_out=. *.proto

message AccessTime{
    string          Access=9;
    string          Write=10;
    string          Create=11;
}

$ protoc  ./test.proto --dart_out=grpc:./dart
Unhandled exception:
NoSuchMethodError: Closure call with mismatched arguments: function '_memberNamesSuffix'
Receiver: Closure: (_SyncIterator<String>) => bool
Tried calling: _memberNamesSuffix()
Found: _memberNamesSuffix(_SyncIterator<String>) => bool
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      _SyncIterable.iterator (dart:core-patch/core_patch.dart:117:45)
#2      disambiguateName (package:protoc_plugin/names.dart:166:27)
#3      _unusedMemberNames (package:protoc_plugin/names.dart:419:17)
#4      messageMemberNames (package:protoc_plugin/names.dart:291:11)
#5      MessageGenerator.resolve (package:protoc_plugin/message_generator.dart:187:27)
#6      FileGenerator.resolve (package:protoc_plugin/file_generator.dart:183:9)
#7      link (package:protoc_plugin/linker.dart:24:7)
#8      CodeGenerator.generate.<anonymous closure> (package:protoc_plugin/code_generator.dart:92:7)
#9      _RootZone.runUnary (dart:async/zone.dart:1450:54)
#10     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#11     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#12     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#13     Future._complete (dart:async/future_impl.dart:519:7)
#14     Stream.fold.<anonymous closure> (dart:async/stream.dart:776:14)
#15     _RootZone.runGuarded (dart:async/zone.dart:1372:10)
#16     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:410:13)
#17     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:420:15)
#18     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:305:7)
#19     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
#20     _StreamController._closeUnchecked (dart:async/stream_controller.dart:644:7)
#21     _StreamController.close (dart:async/stream_controller.dart:637:5)
#22     _Socket._onData (dart:io-patch/socket_patch.dart:2027:21)
#23     _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#24     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#25     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#26     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#27     _StreamController._add (dart:async/stream_controller.dart:655:7)
#28     _StreamController.add (dart:async/stream_controller.dart:597:5)
#29     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1563:35)
#30     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1045:18)
#31     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#32     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#33     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#34     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
--dart_out: protoc-gen-dart: Plugin failed with status code 255.
osa1 commented 2 years ago

I couldn't reproduce this, but from the description it looks similar to #159.

hjlp20150803 commented 2 years ago

I almost forgot this ,but thanks anyway!

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送

发件人: Ömer Sinan @.> 发送时间: 2022年5月11日 18:58 收件人: @.> 抄送: @.>; @.> 主题: Re: [google/protobuf.dart] NoSuchMethodError: Closure call with mismatched arguments: function '_memberNamesSuffix' (#377)

I couldn't reproduce this, but from the description it looks similar to #159https://github.com/google/protobuf.dart/issues/159.

— Reply to this email directly, view it on GitHubhttps://github.com/google/protobuf.dart/issues/377#issuecomment-1123576896, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADH5BCTKCASWR3DQYOFQZ3DVJOHDVANCNFSM4NTG3WYA. You are receiving this because you authored the thread.Message ID: @.***>

osa1 commented 2 years ago

I couldn't reproduce this, but from the description it looks similar to #159.

Looking at this again, this looks nothing like #159..

In any case, I tried to reproduce this again today, and it works, so closing this issue. If the problem persists on your end please try again with the latest protobuf and protoc_plugin.