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

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

Issue 2691953002: Fix crash in DillClassBuilder.isAbstract. (Closed)
Patch Set: Created 3 years, 10 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 | « pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart ('k') | no next file » | 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.body_builder; 5 library fasta.body_builder;
6 6
7 import 'package:front_end/src/fasta/parser/parser.dart' show 7 import 'package:front_end/src/fasta/parser/parser.dart' show
8 FormalParameterType, 8 FormalParameterType,
9 optional; 9 optional;
10 10
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 arguments.types.addAll(typeArguments); 1639 arguments.types.addAll(typeArguments);
1640 } 1640 }
1641 1641
1642 String errorName; 1642 String errorName;
1643 if (type is ClassBuilder) { 1643 if (type is ClassBuilder) {
1644 Builder b = type.findConstructorOrFactory(name); 1644 Builder b = type.findConstructorOrFactory(name);
1645 Member target; 1645 Member target;
1646 if (b == null) { 1646 if (b == null) {
1647 // Not found. Reported below. 1647 // Not found. Reported below.
1648 } else if (b.isConstructor) { 1648 } else if (b.isConstructor) {
1649 if (type.cls.isAbstract) { 1649 if (type.isAbstract) {
1650 // TODO(ahe): Generate abstract instantiation error. 1650 // TODO(ahe): Generate abstract instantiation error.
1651 } else { 1651 } else {
1652 target = b.target; 1652 target = b.target;
1653 } 1653 }
1654 } else if (b.isFactory) { 1654 } else if (b.isFactory) {
1655 target = getRedirectionTarget(b.target); 1655 target = getRedirectionTarget(b.target);
1656 if (target == null) { 1656 if (target == null) {
1657 push(buildCompileTimeError( 1657 push(buildCompileTimeError(
1658 "Cyclic definition of factory '${name}'.", 1658 "Cyclic definition of factory '${name}'.",
1659 token.charOffset)); 1659 token.charOffset));
1660 return; 1660 return;
1661 } 1661 }
1662 } 1662 }
1663 if (target is Constructor || 1663 if (target is Constructor ||
1664 (target is Procedure && target.kind == ProcedureKind.Factory)) { 1664 (target is Procedure && target.kind == ProcedureKind.Factory)) {
1665 push(buildStaticInvocation( 1665 push(buildStaticInvocation(
1666 target, arguments, isConst: optional("const", token))); 1666 target, arguments, isConst: optional("const", token)));
1667 return; 1667 return;
1668 } else { 1668 } else {
1669 errorName = debugName(type.cls.name, name); 1669 errorName = debugName(type.name, name);
1670 } 1670 }
1671 } else { 1671 } else {
1672 errorName = debugName(getNodeName(type), name); 1672 errorName = debugName(getNodeName(type), name);
1673 } 1673 }
1674 errorName ??= name; 1674 errorName ??= name;
1675 push(throwNoSuchMethodError(errorName, arguments, token.charOffset)); 1675 push(throwNoSuchMethodError(errorName, arguments, token.charOffset));
1676 } 1676 }
1677 1677
1678 @override 1678 @override
1679 void handleConstExpression(Token token) { 1679 void handleConstExpression(Token token) {
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2701 } else if (node is TypeDeclarationBuilder) { 2701 } else if (node is TypeDeclarationBuilder) {
2702 return node.name; 2702 return node.name;
2703 } else if (node is PrefixBuilder) { 2703 } else if (node is PrefixBuilder) {
2704 return node.name; 2704 return node.name;
2705 } else if (node is ThisPropertyAccessor) { 2705 } else if (node is ThisPropertyAccessor) {
2706 return node.name.name; 2706 return node.name.name;
2707 } else { 2707 } else {
2708 return internalError("Unhandled: ${node.runtimeType}"); 2708 return internalError("Unhandled: ${node.runtimeType}");
2709 } 2709 }
2710 } 2710 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698