Skip to content
This repository was archived by the owner on Jan 20, 2018. It is now read-only.

some fixes for strong mode. #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dam0vm3nt
Copy link
Contributor

No description provided.

@kevmoo
Copy link

kevmoo commented Aug 8, 2016

Please rebase this on master – eliminate the "merge pull request"

@@ -81,11 +81,11 @@ class ScriptCompactor {

Future<Asset> run() {
var crawler = new ImportCrawler(transform, primaryInput, logger);
return crawler.crawlImports().then((imports) {
return crawler.crawlImports().then((imports) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This async/await stuff shouldn't be necessary afaik, if there is a strong mode error that is probably a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analyzer wants a (...)- > Asset and instead it gets a (...) -> Future<Asset>. They shoud change Future.then signature to return a dynamic ? Should I send an issue to sdk or to analyzer to ignore it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this is an issue with Future flattening? cc @jmesserly

Copy link
Contributor

@jmesserly jmesserly Aug 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a flattening bug, it is an inference issue dart-lang/sdk#25944, which I have a CL out, waiting for one more LGTM.

async is a good workaround, another good one is to pass the type arg explicitly like .then/*<Future<Asset>>*/(...)

@jakemac53
Copy link
Contributor

Can you also check in the .analysis_options file?

@dam0vm3nt
Copy link
Contributor Author

Actually I'm building it with the dev_compiler, passing an AnalyzerOptions object to it using only defaults.

@jakemac53
Copy link
Contributor

Would you mind adding an .analysis_options files with this content:

analyzer:
  strong-mode: true

That helps make sure that we will stay strong mode clean

@dam0vm3nt
Copy link
Contributor Author

should I close this ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

6 participants