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

Side by Side Diff: pkg/compiler/lib/src/constants/expressions.dart

Issue 2996723002: Support typedef type literals (Closed)
Patch Set: Cleanup Created 3 years, 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.constants.expressions; 5 library dart2js.constants.expressions;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/constant_system.dart'; 8 import '../constants/constant_system.dart';
9 import '../common_elements.dart'; 9 import '../common_elements.dart';
10 import '../elements/entities.dart'; 10 import '../elements/entities.dart';
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 /// Type literal. 734 /// Type literal.
735 class TypeConstantExpression extends ConstantExpression { 735 class TypeConstantExpression extends ConstantExpression {
736 /// Either [DynamicType] or a raw [GenericType]. 736 /// Either [DynamicType] or a raw [GenericType].
737 final DartType type; 737 final DartType type;
738 final String name; 738 final String name;
739 739
740 TypeConstantExpression(this.type, this.name) { 740 TypeConstantExpression(this.type, this.name) {
741 assert( 741 assert(
742 type.isInterfaceType || 742 type.isInterfaceType ||
743 type.isTypedef || 743 type.isTypedef ||
744 type.isFunctionType || 744 type.isDynamic
745 type.isDynamic, 745 // TODO(johnniwinther): Remove this when [KernelAstAdapter] is remov ed.
Siggi Cherem (dart-lang) 2017/08/09 16:38:06 which one do you intend to remove? isFunctionType?
Johnni Winther 2017/08/10 08:18:34 Done.
746 ||
747 type.isFunctionType,
746 "Unexpected type constant type: $type"); 748 "Unexpected type constant type: $type");
747 } 749 }
748 750
749 ConstantExpressionKind get kind => ConstantExpressionKind.TYPE; 751 ConstantExpressionKind get kind => ConstantExpressionKind.TYPE;
750 752
751 accept(ConstantExpressionVisitor visitor, [context]) { 753 accept(ConstantExpressionVisitor visitor, [context]) {
752 return visitor.visitType(this, context); 754 return visitor.visitType(this, context);
753 } 755 }
754 756
755 @override 757 @override
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 visit(exp.name); 1929 visit(exp.name);
1928 if (exp.defaultValue != null) { 1930 if (exp.defaultValue != null) {
1929 sb.write(', defaultValue: '); 1931 sb.write(', defaultValue: ');
1930 visit(exp.defaultValue); 1932 visit(exp.defaultValue);
1931 } 1933 }
1932 sb.write(')'); 1934 sb.write(')');
1933 } 1935 }
1934 1936
1935 String toString() => sb.toString(); 1937 String toString() => sb.toString();
1936 } 1938 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/entities.dart » ('j') | pkg/compiler/lib/src/elements/entities.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698