-
Notifications
You must be signed in to change notification settings - Fork 68
Check generated features against SDK constraint of user #361
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
Yes, that seems reasonable. I always thought the analyzer would indicate that the generated code will not work on older sdk versions. (Like it does when we use typedef (typealias) in |
That might be the case... depending on how features are annotated. @dcharkes maybe, classes in I tried and couldn't get the hints to work, but maybe I'm just doing it wrong / or didn't rebuild correctly. Certainly looks like it's exposed in dartdoc. |
If this is added in If this is fixed in the analyzer, we can also simply call |
@mannprerak2 would you like to try to make a PR for the Dart SDK adding the |
Sure, I can try. 😄 |
Same here. The analyzer isn't printing any warnings or errors. I am not sure if the void main(List<String> arguments) {
Future<int>.delayed(Duration(seconds: 1)).onError<int>((e, stackTrace) => 0);
} With the sdk lower bound set to @Since("2.12")
extension FutureExtensions<T> on Future<T> {
Future<T> onError<E extends Object>(... |
cc @lrhn for some light on the semantics on |
I don't know whether the analyzer uses the information in The language versioning only applies to the language, so there is no problem using a |
@jonasfj suggested that we should check the SDK constraint for the package we're generating to and give an error if we generate
dart:ffi
code that does not work on the oldest version.Then we tell our users to bump their SDK version to the one that the generated code will work for so that they don't accidentally upload code to pub which contains
dart:ffi
constructs that will only work on the latest stable release while their pubspec says it would work on older stable releases.The text was updated successfully, but these errors were encountered: