Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: tests/compiler/dart2js/diagnose_ambiguous_test.dart

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 5
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:compiler/compiler_new.dart' show Diagnostic; 7 import 'package:compiler/compiler_new.dart' show Diagnostic;
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import 'memory_compiler.dart'; 9 import 'memory_compiler.dart';
10 10
11 void main() { 11 void main() {
12 DiagnosticCollector collector = new DiagnosticCollector(); 12 DiagnosticCollector collector = new DiagnosticCollector();
13 asyncTest(() async { 13 asyncTest(() async {
14 CompilationResult result = await runCompiler( 14 CompilationResult result = await runCompiler(
15 memorySourceFiles: MEMORY_SOURCE_FILES, 15 memorySourceFiles: MEMORY_SOURCE_FILES,
16 diagnosticHandler: collector, 16 diagnosticHandler: collector,
17 options: ['--analyze-all']); 17 options: ['--analyze-all']);
18 18
19 List<String> diagnostics = <String>[]; 19 List<String> diagnostics = <String>[];
20 collector.messages.forEach((DiagnosticMessage message) { 20 collector.messages.forEach((DiagnosticMessage message) {
21 if (message.kind == Diagnostic.VERBOSE_INFO) return; 21 if (message.kind == Diagnostic.VERBOSE_INFO) return;
22 diagnostics.add(message.toString()); 22 diagnostics.add(message.toString());
23 }); 23 });
24 diagnostics.sort(); 24 diagnostics.sort();
25 var expected = [ 25 var expected = [
26 "memory:exporter.dart:43:47:'hest' is defined here.:info", 26 "MessageKind.AMBIGUOUS_LOCATION:"
27 "memory:library.dart:41:45:'hest' is defined here.:info", 27 "memory:exporter.dart:43:47:'hest' is defined here.:info",
28 "memory:main.dart:0:22:'hest' is imported here.:info", 28 "MessageKind.AMBIGUOUS_LOCATION:"
29 "memory:main.dart:23:46:'hest' is imported here.:info", 29 "memory:library.dart:41:45:'hest' is defined here.:info",
30 "memory:main.dart:86:92:Duplicate import of 'hest'.:warning", 30 "MessageKind.DUPLICATE_IMPORT:"
31 "memory:main.dart:86:92:Duplicate import of 'hest'.:warning",
32 "MessageKind.IMPORTED_HERE:"
33 "memory:main.dart:0:22:'hest' is imported here.:info",
34 "MessageKind.IMPORTED_HERE:"
35 "memory:main.dart:23:46:'hest' is imported here.:info",
31 ]; 36 ];
32 Expect.listEquals(expected, diagnostics); 37 Expect.listEquals(expected, diagnostics);
33 Expect.isTrue(result.isSuccess); 38 Expect.isTrue(result.isSuccess);
34 }); 39 });
35 } 40 }
36 41
37 const Map MEMORY_SOURCE_FILES = const { 42 const Map MEMORY_SOURCE_FILES = const {
38 'main.dart': """ 43 'main.dart': """
39 import 'library.dart'; 44 import 'library.dart';
40 import 'exporter.dart'; 45 import 'exporter.dart';
(...skipping 15 matching lines...) Expand all
56 hest() {} 61 hest() {}
57 """, 62 """,
58 'exporter.dart': """ 63 'exporter.dart': """
59 library exporter; 64 library exporter;
60 65
61 export 'library.dart'; 66 export 'library.dart';
62 67
63 hest() {} 68 hest() {}
64 """, 69 """,
65 }; 70 };
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698