-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Issue with generic function definition ((String?) => Future<String>' is not a subtype of type '((dynamic) => FutureOr<String?>)?') #125387
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
Comments
Thanks for the detailed report. Using the code sample provided, seeing the same error on latest stable and master.
stable, master flutter doctor -v
|
This looks like a question for the Dart programming language unrelated to Flutter. You may want to try raising it in the Dart issue tracker here: https://github.com/dart-lang/sdk/issues |
Based on above comment, I'll close this from here. Please open it in dedicated repo. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Is there an existing issue for this?
Steps to reproduce
Run the code below with Flutter 3.7.11 as a test.
Expected results
It should run without runtime exceptions.
Actual results
The mentioned code will throw a runtime exception at line 68 at the snippet
testClass.validator
with the messagetype '(String?) => Future<String>' is not a subtype of type '((dynamic) => FutureOr<String?>)?'
. In my production code, I have a List where the specific type of each entry could vary, that's why the first workaround in my sample code is not feasible. The other two workarounds are helping for now but on the one side unnecessary code and additionally are marked by the linter as unnecessary.Thank you for the support! :)
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: