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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart

Issue 2974933002: Remove deprecated_internalProblem. (Closed)
Patch Set: Created 3 years, 5 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
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.kernel_procedure_builder; 5 library fasta.kernel_procedure_builder;
6 6
7 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
8 show KernelProcedure;
9
10 import 'package:front_end/src/fasta/source/source_library_builder.dart'
11 show SourceLibraryBuilder;
12
13 import 'package:front_end/src/fasta/type_inference/type_inference_listener.dart'
14 show TypeInferenceListener;
15
16 import 'package:kernel/ast.dart' 7 import 'package:kernel/ast.dart'
17 show 8 show
18 Arguments, 9 Arguments,
19 AsyncMarker, 10 AsyncMarker,
20 Constructor, 11 Constructor,
21 ConstructorInvocation, 12 ConstructorInvocation,
22 DartType, 13 DartType,
23 DynamicType, 14 DynamicType,
24 EmptyStatement, 15 EmptyStatement,
25 Expression, 16 Expression,
(...skipping 11 matching lines...) Expand all
37 StringLiteral, 28 StringLiteral,
38 SuperInitializer, 29 SuperInitializer,
39 TypeParameter, 30 TypeParameter,
40 VariableDeclaration, 31 VariableDeclaration,
41 VariableGet, 32 VariableGet,
42 VoidType, 33 VoidType,
43 setParents; 34 setParents;
44 35
45 import 'package:kernel/type_algebra.dart' show containsTypeVariable, substitute; 36 import 'package:kernel/type_algebra.dart' show containsTypeVariable, substitute;
46 37
47 import '../deprecated_problems.dart' show deprecated_internalProblem; 38 import '../loader.dart' show Loader;
48 39
49 import '../messages.dart' show messageNonInstanceTypeVariableUse, warning; 40 import '../messages.dart'
41 show
42 messageInternalProblemBodyOnAbstractMethod,
43 messageNonInstanceTypeVariableUse,
44 warning;
50 45
51 import '../loader.dart' show Loader; 46 import '../problems.dart' show internalProblem;
47
48 import '../source/source_library_builder.dart' show SourceLibraryBuilder;
49
50 import '../type_inference/type_inference_listener.dart'
51 show TypeInferenceListener;
52 52
53 import 'kernel_builder.dart' 53 import 'kernel_builder.dart'
54 show 54 show
55 Builder, 55 Builder,
56 ClassBuilder, 56 ClassBuilder,
57 ConstructorReferenceBuilder, 57 ConstructorReferenceBuilder,
58 FormalParameterBuilder, 58 FormalParameterBuilder,
59 KernelFormalParameterBuilder, 59 KernelFormalParameterBuilder,
60 KernelLibraryBuilder, 60 KernelLibraryBuilder,
61 KernelTypeBuilder, 61 KernelTypeBuilder,
62 KernelTypeVariableBuilder, 62 KernelTypeVariableBuilder,
63 LibraryBuilder, 63 LibraryBuilder,
64 MetadataBuilder, 64 MetadataBuilder,
65 ProcedureBuilder, 65 ProcedureBuilder,
66 TypeVariableBuilder, 66 TypeVariableBuilder,
67 isRedirectingGenerativeConstructorImplementation, 67 isRedirectingGenerativeConstructorImplementation,
68 deprecated_memberError; 68 deprecated_memberError;
69 69
70 import 'kernel_shadow_ast.dart' show KernelProcedure;
71
70 abstract class KernelFunctionBuilder 72 abstract class KernelFunctionBuilder
71 extends ProcedureBuilder<KernelTypeBuilder> { 73 extends ProcedureBuilder<KernelTypeBuilder> {
72 final String nativeMethodName; 74 final String nativeMethodName;
73 75
74 FunctionNode function; 76 FunctionNode function;
75 77
76 Statement actualBody; 78 Statement actualBody;
77 79
78 KernelFunctionBuilder( 80 KernelFunctionBuilder(
79 List<MetadataBuilder> metadata, 81 List<MetadataBuilder> metadata,
80 int modifiers, 82 int modifiers,
81 KernelTypeBuilder returnType, 83 KernelTypeBuilder returnType,
82 String name, 84 String name,
83 List<TypeVariableBuilder> typeVariables, 85 List<TypeVariableBuilder> typeVariables,
84 List<FormalParameterBuilder> formals, 86 List<FormalParameterBuilder> formals,
85 KernelLibraryBuilder compilationUnit, 87 KernelLibraryBuilder compilationUnit,
86 int charOffset, 88 int charOffset,
87 this.nativeMethodName) 89 this.nativeMethodName)
88 : super(metadata, modifiers, returnType, name, typeVariables, formals, 90 : super(metadata, modifiers, returnType, name, typeVariables, formals,
89 compilationUnit, charOffset); 91 compilationUnit, charOffset);
90 92
91 void set body(Statement newBody) { 93 void set body(Statement newBody) {
92 if (newBody != null) { 94 if (newBody != null) {
93 if (isAbstract) { 95 if (isAbstract) {
94 return deprecated_internalProblem( 96 return internalProblem(messageInternalProblemBodyOnAbstractMethod,
95 "Attempting to set body on abstract method."); 97 newBody.fileOffset, fileUri);
96 } 98 }
97 if (isExternal) { 99 if (isExternal) {
98 return library.deprecated_addCompileTimeError( 100 return library.deprecated_addCompileTimeError(
99 newBody.fileOffset, "An external method can't have a body."); 101 newBody.fileOffset, "An external method can't have a body.");
100 } 102 }
101 if (isConstructor && isConst) { 103 if (isConstructor && isConst) {
102 return library.deprecated_addCompileTimeError( 104 return library.deprecated_addCompileTimeError(
103 newBody.fileOffset, "A const constructor can't have a body."); 105 newBody.fileOffset, "A const constructor can't have a body.");
104 } 106 }
105 } 107 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 412 }
411 } 413 }
412 initializers.add(initializer..parent = constructor); 414 initializers.add(initializer..parent = constructor);
413 initializers.add(superInitializer); 415 initializers.add(superInitializer);
414 return; 416 return;
415 } 417 }
416 initializers.add(initializer); 418 initializers.add(initializer);
417 initializer.parent = constructor; 419 initializer.parent = constructor;
418 } 420 }
419 } 421 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698