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

Analyzer issue with optional new and generic types on methods. #33647

Closed
a14n opened this issue Jun 27, 2018 · 18 comments
Closed

Analyzer issue with optional new and generic types on methods. #33647

a14n opened this issue Jun 27, 2018 · 18 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@a14n
Copy link
Contributor

a14n commented Jun 27, 2018

In the following code:

import 'dart:async';

var a = new Future<int>.sync(() => 3).then<int>((e) => e);
var b = Future<int>.sync(() => 3).then((e) => e);
var c = Future<int>.sync(() => 3).then<int>((e) => e);

dartanalyzer displays errors on c variable because of the type argument on .then.

$ dartanalyzer --version
dartanalyzer version 2.0.0-dev.65.0
$ cat bin/test.dart
import 'dart:async';

var a = new Future<int>.sync(() => 3).then<int>((e) => e);
var b = Future<int>.sync(() => 3).then((e) => e);
var c = Future<int>.sync(() => 3).then<int>((e) => e);
$ dartanalyzer bin/test.dart
Analyzing bin/test.dart...
  error • The operator '<' isn't defined for the class 'Function' at bin/test.dart:5:39 • undefined_operator
  error • Expected to find ';' at bin/test.dart:5:40 • expected_token
  error • Expected a method, getter, setter or operator declaration at bin/test.dart:5:43 • expected_executable
  error • Unexpected text '>' at bin/test.dart:5:43 • unexpected_token
  error • Undefined class 'e' at bin/test.dart:5:46 • undefined_class
  error • Unexpected text ')' at bin/test.dart:5:47 • unexpected_token
  error • Expected a method, getter, setter or operator declaration at bin/test.dart:5:47 • expected_executable
  error • Undefined class 'e' at bin/test.dart:5:52 • undefined_class
  error • Unexpected text ')' at bin/test.dart:5:53 • unexpected_token
  error • The name '' is already defined at bin/test.dart:5:53 • duplicate_definition
  error • Expected a method, getter, setter or operator declaration at bin/test.dart:5:53 • expected_executable
11 errors found.
@a14n
Copy link
Contributor Author

a14n commented Jun 27, 2018

/cc @bwilkerson

@lrhn lrhn added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Jun 27, 2018
@bwilkerson
Copy link
Member

@danrubel Could you check this on the fasta parser?

@mit-mit
Copy link
Member

mit-mit commented Jul 2, 2018

tagging P1, this is blocking flutter/flutter#18604

@mit-mit mit-mit added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jul 2, 2018
@dgrove dgrove added this to the Dart2Stable milestone Jul 4, 2018
@devoncarew
Copy link
Member

@a14n, thanks for the reduced case! I'm curious, where did this occur in the Flutter codebase?

@mit-mit
Copy link
Member

mit-mit commented Jul 9, 2018

@devoncarew what the status on this? Anyone working on resolving it?

@danrubel
Copy link

danrubel commented Jul 9, 2018

I'm spinning back up after a week off. I'll try to repro with the fasta parser.

@danrubel
Copy link

danrubel commented Jul 9, 2018

The fasta parser correctly handles this case where as the old parser does not.
I added some new parser tests to assert this.
I don't know if we want to fix the old parser.

@danrubel danrubel assigned devoncarew and unassigned danrubel Jul 9, 2018
@bwilkerson
Copy link
Member

If we're going to move to the fasta parser as quickly as I think we will, then it probably isn't worth fixing the old parser.

@dgrove
Copy link
Contributor

dgrove commented Jul 9, 2018

I agree, @bwilkerson . Moving to Dart 2.1 milestone.

dart-bot pushed a commit that referenced this issue Jul 9, 2018
The fasta parser correctly handles the code specified in
#33647

Change-Id: I690311ce031e458dc9c5ea978c954ba7a4b60262
Reviewed-on: https://dart-review.googlesource.com/64200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
@mit-mit
Copy link
Member

mit-mit commented Jul 10, 2018

cc @dgrove this one is blocking flutter/flutter#18604 which in turn is blocking https://github.com/dart-lang/sdk/issues/32596m which is 2.0 stable.

If we were to punt this, when would we get the needed support via fasta?

@devoncarew
Copy link
Member

This would likely happen soon after the dart 2 branch, in the neighborhood of days after.

@mit-mit
Copy link
Member

mit-mit commented Jul 10, 2018

Do we know if Flutter would track the master or stable branch?

@devoncarew
Copy link
Member

I assume Flutter will continue to track Dart SDK dev releases; pinging @tvolkert and @Hixie.

@Hixie
Copy link
Contributor

Hixie commented Jul 10, 2018

@cbracken and @a-siva are probably the appropriate people to make that call.

@a-siva
Copy link
Contributor

a-siva commented Jul 10, 2018

Yes we will continue to actively roll Dart from top of tree into Flutter on a regular basis.

@devoncarew
Copy link
Member

To update, this is blocked on #33543.

@bwilkerson bwilkerson added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 27, 2018
@dgrove
Copy link
Contributor

dgrove commented Sep 4, 2018

#33543 has been closed. Can this be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. customer-flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

9 participants