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

Side by Side Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 1994613004: Handle use of constant constructors with default values. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 4 years, 7 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 elements; 5 library elements;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constructors.dart'; 10 import '../constants/constructors.dart';
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 abstract class LocalElement extends Element 998 abstract class LocalElement extends Element
999 implements AstElement, TypedElement, Local {} 999 implements AstElement, TypedElement, Local {}
1000 1000
1001 /// A top level, static or instance field, a formal parameter or local variable. 1001 /// A top level, static or instance field, a formal parameter or local variable.
1002 abstract class VariableElement extends ExecutableElement { 1002 abstract class VariableElement extends ExecutableElement {
1003 @override 1003 @override
1004 VariableDefinitions get node; 1004 VariableDefinitions get node;
1005 1005
1006 Expression get initializer; 1006 Expression get initializer;
1007 1007
1008 bool get hasConstant;
1009
1008 /// The constant expression defining the (initial) value of the variable. 1010 /// The constant expression defining the (initial) value of the variable.
1009 /// 1011 ///
1010 /// If the variable is `const` the value is always non-null, possibly an 1012 /// If the variable is `const` the value is always non-null, possibly an
1011 /// [ErroneousConstantExpression], otherwise, the value is null when the 1013 /// [ErroneousConstantExpression], otherwise, the value is null when the
1012 /// initializer isn't a constant expression. 1014 /// initializer isn't a constant expression.
1013 ConstantExpression get constant; 1015 ConstantExpression get constant;
1014 } 1016 }
1015 1017
1016 /// An entity that defines a local entity (memory slot) in generated code. 1018 /// An entity that defines a local entity (memory slot) in generated code.
1017 /// 1019 ///
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 /// A top level, static or instance function. 1231 /// A top level, static or instance function.
1230 abstract class MethodElement extends FunctionElement implements MemberElement {} 1232 abstract class MethodElement extends FunctionElement implements MemberElement {}
1231 1233
1232 /// A local function or closure (anonymous local function). 1234 /// A local function or closure (anonymous local function).
1233 abstract class LocalFunctionElement extends FunctionElement 1235 abstract class LocalFunctionElement extends FunctionElement
1234 implements LocalElement {} 1236 implements LocalElement {}
1235 1237
1236 /// A constructor. 1238 /// A constructor.
1237 abstract class ConstructorElement extends FunctionElement 1239 abstract class ConstructorElement extends FunctionElement
1238 implements MemberElement { 1240 implements MemberElement {
1241 /// Returns `true` if [effectiveTarget] has been computed for this
1242 /// constructor.
1243 bool get hasEffectiveTarget;
1244
1239 /// The effective target of this constructor, that is the non-redirecting 1245 /// The effective target of this constructor, that is the non-redirecting
1240 /// constructor that is called on invocation of this constructor. 1246 /// constructor that is called on invocation of this constructor.
1241 /// 1247 ///
1242 /// Consider for instance this hierarchy: 1248 /// Consider for instance this hierarchy:
1243 /// 1249 ///
1244 /// class C { factory C.c() = D.d; } 1250 /// class C { factory C.c() = D.d; }
1245 /// class D { factory D.d() = E.e2; } 1251 /// class D { factory D.d() = E.e2; }
1246 /// class E { E.e1(); 1252 /// class E { E.e1();
1247 /// E.e2() : this.e1(); } 1253 /// E.e2() : this.e1(); }
1248 /// 1254 ///
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 /// by a field. 1830 /// by a field.
1825 bool get isDeclaredByField; 1831 bool get isDeclaredByField;
1826 1832
1827 /// Returns `true` if this member is abstract. 1833 /// Returns `true` if this member is abstract.
1828 bool get isAbstract; 1834 bool get isAbstract;
1829 1835
1830 /// If abstract, [implementation] points to the overridden concrete member, 1836 /// If abstract, [implementation] points to the overridden concrete member,
1831 /// if any. Otherwise [implementation] points to the member itself. 1837 /// if any. Otherwise [implementation] points to the member itself.
1832 Member get implementation; 1838 Member get implementation;
1833 } 1839 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698