Skip to content

FutureOr<T> gets interpreted as "dynamic" #1482

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

Closed
matanlurey opened this issue Aug 15, 2017 · 10 comments
Closed

FutureOr<T> gets interpreted as "dynamic" #1482

matanlurey opened this issue Aug 15, 2017 · 10 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on

Comments

@matanlurey
Copy link

Example:
https://www.dartdocs.org/documentation/io/0.2.0/io/isExecutable.html

@devoncarew
Copy link
Member

Thanks for the report! Note that those docs were generated using dartdoc 0.12.0 - released circa late May.

@matanlurey
Copy link
Author

matanlurey commented Aug 16, 2017 via email

@devoncarew
Copy link
Member

Is it possible for me to opt-in to a newer version of dartdoc?

On dartdocs.org? I'm not familiar enough with it to know. My guess would be no.

My note was more for @jcollins-g, so she didn't spend too much time tracking down something that may no longer be an issue in a current version of dartdoc.

I believe @kevmoo has a plan to support dartdocs.org, or something with similar functionality, in the not too distant future.

@kevmoo
Copy link
Member

kevmoo commented Aug 17, 2017

I believe @kevmoo has a plan to support dartdocs.org, or something with similar functionality, in the not too distant future.

Well, hopefully this year...

@jcollins-g jcollins-g added the P2 A bug or feature request we're likely to work on label Sep 12, 2017
@matanlurey
Copy link
Author

I tried it out @HEAD, and it still prints dynamic:

screen shot 2017-09-28 at 9 05 53 pm

I'm going to take a shot fixing it if it is trivial 😈

@matanlurey matanlurey self-assigned this Sep 29, 2017
@matanlurey
Copy link
Author

Must be some sort of analyzer bug or misconfiguration of the analysis engine/driver/context - the raw DartType and Element are both dynamic, and even return false for DartType.isDartAsyncFutureOr.

... wait, aha!

var options = new AnalysisOptionsImpl()
      ..enableAssertInitializer = true;

... I thought maybe it was a lack of strongMode = true, but doesn't look like that either.

@matanlurey
Copy link
Author

Or... maybe it is? I do see this in analyzer:

// In non-strong mode `FutureOr<T>` is treated as `dynamic`
if (!typeSystem.isStrong && type.isDartAsyncFutureOr) {

... so I'll keep digging.

@matanlurey
Copy link
Author

Yup, there are two places AnalysisContext is created, and one wasn't strong mode!

This looks much better:

screen shot 2017-09-28 at 9 52 28 pm

@matanlurey
Copy link
Author

Looks like this is getting fixed by #1611!

@jcollins-g
Copy link
Contributor

Reopening for the tests; I have a PR on deck after the strong mode bit lands, for the FutureOr tests from #1507 plus a few new ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants