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

Side by Side Diff: pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart

Issue 3010963002: Report internal error when an exported library isn't loaded.
Patch Set: Created 3 years, 3 months 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 | « no previous file | pkg/front_end/lib/src/fasta/fasta_codes_generated.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta.dill_library_builder; 5 library fasta.dill_library_builder;
6 6
7 import 'dart:convert' show JSON; 7 import 'dart:convert' show JSON;
8 8
9 import 'package:kernel/ast.dart' 9 import 'package:kernel/ast.dart'
10 show 10 show
11 Class, 11 Class,
12 Field, 12 Field,
13 Library, 13 Library,
14 ListLiteral, 14 ListLiteral,
15 Member, 15 Member,
16 Procedure, 16 Procedure,
17 StaticGet, 17 StaticGet,
18 StringLiteral, 18 StringLiteral,
19 Typedef; 19 Typedef;
20 20
21 import '../fasta_codes.dart' show templateUnspecified; 21 import '../fasta_codes.dart'
22 show templateInternalProblemExportedLibraryNotLoaded, templateUnspecified;
22 23
23 import '../problems.dart' show unhandled, unimplemented; 24 import '../problems.dart' show internalProblem, unhandled, unimplemented;
24 25
25 import '../kernel/kernel_builder.dart' 26 import '../kernel/kernel_builder.dart'
26 show 27 show
27 Builder, 28 Builder,
28 InvalidTypeBuilder, 29 InvalidTypeBuilder,
29 KernelInvalidTypeBuilder, 30 KernelInvalidTypeBuilder,
30 KernelTypeBuilder, 31 KernelTypeBuilder,
31 LibraryBuilder, 32 LibraryBuilder,
32 Scope; 33 Scope;
33 34
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 isSetter = node.isSetter; 176 isSetter = node.isSetter;
176 } else if (node is Member) { 177 } else if (node is Member) {
177 libraryUri = node.enclosingLibrary.importUri; 178 libraryUri = node.enclosingLibrary.importUri;
178 name = node.name.name; 179 name = node.name.name;
179 } else if (node is Typedef) { 180 } else if (node is Typedef) {
180 libraryUri = node.enclosingLibrary.importUri; 181 libraryUri = node.enclosingLibrary.importUri;
181 name = node.name; 182 name = node.name;
182 } else { 183 } else {
183 unhandled("${node.runtimeType}", "finalizeExports", -1, fileUri); 184 unhandled("${node.runtimeType}", "finalizeExports", -1, fileUri);
184 } 185 }
185 var library = loader.read(libraryUri, -1); 186 DillLibraryBuilder library = loader.builders[libraryUri];
scheglov 2017/09/04 18:31:14 What if we have mutually exporting libraries?
ahe 2017/09/06 07:55:50 If they're in the same dill file, it shouldn't be
187 if (library == null) {
188 internalProblem(
189 templateInternalProblemExportedLibraryNotLoaded.withArguments(
190 libraryUri, uri),
191 -1,
192 fileUri);
193 }
186 Builder builder; 194 Builder builder;
187 if (isSetter) { 195 if (isSetter) {
188 builder = library.exportScope.setters[name]; 196 builder = library.exportScope.setters[name];
189 exportScopeBuilder.addSetter(name, builder); 197 exportScopeBuilder.addSetter(name, builder);
190 } else { 198 } else {
191 builder = library.exportScope.local[name]; 199 builder = library.exportScope.local[name];
192 exportScopeBuilder.addMember(name, builder); 200 exportScopeBuilder.addMember(name, builder);
193 } 201 }
194 assert(node == builder.target); 202 assert(node == builder.target);
195 } 203 }
196 } 204 }
197 } 205 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/fasta_codes_generated.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698