You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
dartanalyzer --strong issues the following warning, which is an error in DDC:
[warning] The getter 'name' is not defined for the class 'Token' (yaml/lib/src/parser.dart, line 257, col 47)
In this code:
Event_parseNode({bool block:false, bool indentlessSequence:false}) {
var token = _scanner.peek();
if (token isAliasToken) {
_scanner.scan();
_state = _states.removeLast();
returnnewAliasEvent(token.span, token.name); // <-- WARNING IS HERE
}
Where _scanner.peek() returns a Token and AliasToken is defined as:
classAliasTokenimplementsToken {
get type =>TokenType.ALIAS;
finalFileSpan span;
/// The name of the anchor.finalString name;
AliasToken(this.span, this.name);
StringtoString() =>"ALIAS $name";
}
It looks like dynamic token = promotes to AliasToken but Token token = does not, even in existing analyzer. Not sure why, AliasToken should be a subtype of Token... @vsmenon@leafpetersen thoughts?
The text was updated successfully, but these errors were encountered:
Sigh, I guess this is "not a bug" because of some mutation-in-closure that happens later in the method. And at least as currently spec'd type promotion is not smart enough to know that the closure it's afraid of doesn't even exist yet... Sigh.
I'm running this on the YAML package.
dartanalyzer --strong issues the following warning, which is an error in DDC:
In this code:
Where _scanner.peek() returns a Token and AliasToken is defined as:
It looks like
dynamic token =
promotes to AliasToken butToken token =
does not, even in existing analyzer. Not sure why, AliasToken should be a subtype of Token... @vsmenon @leafpetersen thoughts?The text was updated successfully, but these errors were encountered: