-
Notifications
You must be signed in to change notification settings - Fork 10
some fixes for strong mode. #47
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ Asset generateWebComponentsBootstrap(Resolver resolver, Transform transform, | |
dom.Document document, AssetId scriptId, AssetId newScriptId, | ||
{List<InitializerPlugin> extraPlugins: const []}) { | ||
var htmlImportRecorder = new HtmlImportAnnotationRecorder(); | ||
var plugins = [htmlImportRecorder]..addAll(extraPlugins); | ||
var plugins = [htmlImportRecorder as InitializerPlugin]..addAll(extraPlugins); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be necessary afaik, try specifying cc @munificent @vsmenon , not sure if this thing comes up often for strong mode or its more of an outlier? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. k worked. Actually I thought to have tried it before but probably I made some typos. |
||
|
||
// Bootstrap the application using the `initialize` package and our | ||
// plugins. | ||
|
@@ -39,7 +39,7 @@ Asset generateWebComponentsBootstrap(Resolver resolver, Transform transform, | |
document.head.querySelector('script[type="application/dart"]'); | ||
for (var importPath in htmlImportRecorder.importPaths) { | ||
var import = new dom.Element.tag('link') | ||
..attributes = {'rel': 'import', 'href': importPath,}; | ||
..attributes = (new Map<dynamic,String>()..addAll({'rel': 'import', 'href': importPath,})); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be necessary either, and it should be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was the error in the original code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I put an
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems like a bug as well, according to the api docs |
||
document.head.insertBefore(import, dartScript); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ class _State { | |
final Set<Document> seen = new Set(); | ||
|
||
/// Scripts that have been discovered, in tree order. | ||
final LinkedHashMap<String, _ScriptInfo> scripts = {}; | ||
final LinkedHashMap<String, _ScriptInfo> scripts = new LinkedHashMap<String,_ScriptInfo>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets just change this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what I get then:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you remove the type on the left hand side? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, I missed that. Now it's ok. |
||
} | ||
|
||
/// Holds information about a Dart script tag. | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 changeFuture.then
signature to return adynamic
? Should I send an issue tosdk
or toanalyzer
to ignore it ?There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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>>*/(...)