This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree 3 files changed +8
-5
lines changed 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ class Loader {
127
127
throw new YamlException ("Invalid tag for sequence." , firstEvent.span);
128
128
}
129
129
130
- var children = [];
130
+ var children = < YamlNode > [];
131
131
var node = new YamlList .internal (
132
132
children, firstEvent.span, firstEvent.style);
133
133
_registerAnchor (firstEvent.anchor, node);
Original file line number Diff line number Diff line change @@ -443,7 +443,8 @@ class Scanner {
443
443
var token = _tokens.last;
444
444
if (token.type == TokenType .FLOW_SEQUENCE_END ||
445
445
token.type == TokenType .FLOW_MAPPING_END ||
446
- (token.type == TokenType .SCALAR && token.style.isQuoted)) {
446
+ (token.type == TokenType .SCALAR &&
447
+ (token as ScalarToken ).style.isQuoted)) {
447
448
_fetchValue ();
448
449
return ;
449
450
}
Original file line number Diff line number Diff line change @@ -81,15 +81,17 @@ YamlDocument loadYamlDocument(String yaml, {sourceUrl}) {
81
81
YamlList loadYamlStream (String yaml, {sourceUrl}) {
82
82
var loader = new Loader (yaml, sourceUrl: sourceUrl);
83
83
84
- var documents = [];
84
+ var documents = < YamlDocument > [];
85
85
var document = loader.load ();
86
86
while (document != null ) {
87
87
documents.add (document);
88
88
document = loader.load ();
89
89
}
90
90
91
+ // TODO(jmesserly): the type on the `document` parameter is a workaround for:
92
+ // https://github.com/dart-lang/dev_compiler/issues/203
91
93
return new YamlList .internal (
92
- documents.map ((document) => document.contents).toList (),
94
+ documents.map ((YamlDocument document) => document.contents).toList (),
93
95
loader.span,
94
96
CollectionStyle .ANY );
95
97
}
@@ -101,7 +103,7 @@ YamlList loadYamlStream(String yaml, {sourceUrl}) {
101
103
List <YamlDocument > loadYamlDocuments (String yaml, {sourceUrl}) {
102
104
var loader = new Loader (yaml, sourceUrl: sourceUrl);
103
105
104
- var documents = [];
106
+ var documents = < YamlDocument > [];
105
107
var document = loader.load ();
106
108
while (document != null ) {
107
109
documents.add (document);
You can’t perform that action at this time.
0 commit comments