OLD | NEW |
1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 # Each entry in this map corresponds to a diagnostic message. Ideally, each | 5 # Each entry in this map corresponds to a diagnostic message. Ideally, each |
6 # entry contains three parts: | 6 # entry contains three parts: |
7 # | 7 # |
8 # 1. A message template (template). | 8 # 1. A message template (template). |
9 # | 9 # |
10 # 2. A suggestion for how to correct the problem (tip). | 10 # 2. A suggestion for how to correct the problem (tip). |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 - "var static foo; main(){}" | 162 - "var static foo; main(){}" |
163 - "var external foo; main(){}" | 163 - "var external foo; main(){}" |
164 - "get var foo; main(){}" | 164 - "get var foo; main(){}" |
165 - "set var foo; main(){}" | 165 - "set var foo; main(){}" |
166 - "final var foo; main(){}" | 166 - "final var foo; main(){}" |
167 - "var var foo; main(){}" | 167 - "var var foo; main(){}" |
168 - "const var foo; main(){}" | 168 - "const var foo; main(){}" |
169 - "abstract var foo; main(){}" | 169 - "abstract var foo; main(){}" |
170 - "static var foo; main(){}" | 170 - "static var foo; main(){}" |
171 - "external var foo; main(){}" | 171 - "external var foo; main(){}" |
172 | |
173 ExtraneousModifierReplace: | |
174 template: "Can't have modifier '#lexeme' here." | |
175 tip: "Try replacing modifier '#lexeme' with 'var', 'final', or a type." | |
176 dart2jsCode: EXTRANEOUS_MODIFIER_REPLACE | |
177 script: | |
178 - "set foo; main(){}" | 172 - "set foo; main(){}" |
179 - "abstract foo; main(){}" | 173 - "abstract foo; main(){}" |
180 - "static foo; main(){}" | 174 - "static foo; main(){}" |
181 - "external foo; main(){}" | 175 - "external foo; main(){}" |
182 | 176 |
183 InvalidAwaitFor: | 177 InvalidAwaitFor: |
184 template: "'await' is only supported in methods with an 'async' or 'async*' bo
dy modifier." | 178 template: "'await' is only supported in methods with an 'async' or 'async*' bo
dy modifier." |
185 tip: "Try adding 'async' or 'async*' to the method body or removing the 'await
' keyword." | 179 tip: "Try adding 'async' or 'async*' to the method body or removing the 'await
' keyword." |
186 dart2jsCode: INVALID_AWAIT_FOR | 180 dart2jsCode: INVALID_AWAIT_FOR |
187 script: > | 181 script: > |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 AwaitAsIdentifier: | 341 AwaitAsIdentifier: |
348 template: "'await' can't be used as an identifier in 'async', 'async*', or 'sy
nc*' methods." | 342 template: "'await' can't be used as an identifier in 'async', 'async*', or 'sy
nc*' methods." |
349 dart2jsCode: FASTA_IGNORED | 343 dart2jsCode: FASTA_IGNORED |
350 | 344 |
351 AwaitNotAsync: | 345 AwaitNotAsync: |
352 template: "'await' can only be used in 'async' or 'async*' methods." | 346 template: "'await' can only be used in 'async' or 'async*' methods." |
353 dart2jsCode: FASTA_IGNORED | 347 dart2jsCode: FASTA_IGNORED |
354 | 348 |
355 BuiltInIdentifierAsType: | 349 BuiltInIdentifierAsType: |
356 template: "Can't use '#lexeme' as a type." | 350 template: "Can't use '#lexeme' as a type." |
357 dart2jsCode: GENERIC | 351 dart2jsCode: EXTRANEOUS_MODIFIER |
358 | 352 |
359 BuiltInIdentifierInDeclaration: | 353 BuiltInIdentifierInDeclaration: |
360 template: "Can't use '#lexeme' as a name here." | 354 template: "Can't use '#lexeme' as a name here." |
361 dart2jsCode: GENERIC | 355 dart2jsCode: GENERIC |
362 | 356 |
363 AwaitForNotAsync: | 357 AwaitForNotAsync: |
364 template: "Asynchronous for-loop can only be used in 'async' or 'async*' metho
ds." | 358 template: "Asynchronous for-loop can only be used in 'async' or 'async*' metho
ds." |
365 dart2jsCode: FASTA_IGNORED | 359 dart2jsCode: FASTA_IGNORED |
366 | 360 |
367 FactoryNotSync: | 361 FactoryNotSync: |
(...skipping 20 matching lines...) Expand all Loading... |
388 | 382 |
389 YieldNotGenerator: | 383 YieldNotGenerator: |
390 template: "'yield' can only be used in 'sync*' or 'async*' methods." | 384 template: "'yield' can only be used in 'sync*' or 'async*' methods." |
391 dart2jsCode: FASTA_IGNORED | 385 dart2jsCode: FASTA_IGNORED |
392 | 386 |
393 OnlyTry: | 387 OnlyTry: |
394 template: "Try block should be followed by 'on', 'catch', or 'finally' block." | 388 template: "Try block should be followed by 'on', 'catch', or 'finally' block." |
395 tip: "Did you forget to add a 'finally' block?" | 389 tip: "Did you forget to add a 'finally' block?" |
396 statement: "try {}" | 390 statement: "try {}" |
397 dart2jsCode: FASTA_IGNORED | 391 dart2jsCode: FASTA_IGNORED |
| 392 |
| 393 TypeAfterVar: |
| 394 template: "Can't have both a type and 'var'." |
| 395 tip: "Try removing 'var.'" |
| 396 dart2jsCode: EXTRANEOUS_MODIFIER |
| 397 |
| 398 TypeRequired: |
| 399 template: "A type or modifier is required here." |
| 400 tip: "Try adding a type, 'var', 'const', or 'final'." |
OLD | NEW |