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

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 649733002: Check field type when evaluating initializing formals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 4657 matching lines...) Expand 10 before | Expand all | Expand 10 after
4668 * 4668 *
4669 * @param baseElement the element on which the parameterized element was creat ed 4669 * @param baseElement the element on which the parameterized element was creat ed
4670 * @param definingType the type in which the element is defined 4670 * @param definingType the type in which the element is defined
4671 */ 4671 */
4672 FieldFormalParameterMember(FieldFormalParameterElement baseElement, Parameteri zedType definingType) : super(baseElement, definingType); 4672 FieldFormalParameterMember(FieldFormalParameterElement baseElement, Parameteri zedType definingType) : super(baseElement, definingType);
4673 4673
4674 @override 4674 @override
4675 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi s); 4675 accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(thi s);
4676 4676
4677 @override 4677 @override
4678 FieldElement get field => (baseElement as FieldFormalParameterElement).field; 4678 FieldElement get field {
4679 FieldElement field = (baseElement as FieldFormalParameterElement).field;
4680 if (field is FieldElement) {
4681 return FieldMember.from(field, definingType);
4682 }
4683 return field;
4684 }
4679 } 4685 }
4680 4686
4681 /** 4687 /**
4682 * Instances of the class `FieldMember` represent a field element defined in a p arameterized 4688 * Instances of the class `FieldMember` represent a field element defined in a p arameterized
4683 * type where the values of the type parameters are known. 4689 * type where the values of the type parameters are known.
4684 */ 4690 */
4685 class FieldMember extends VariableMember implements FieldElement { 4691 class FieldMember extends VariableMember implements FieldElement {
4686 /** 4692 /**
4687 * If the given field's type is different when any type parameters from the de fining type's 4693 * If the given field's type is different when any type parameters from the de fining type's
4688 * declaration are replaced with the actual type arguments from the defining t ype, create a field 4694 * declaration are replaced with the actual type arguments from the defining t ype, create a field
(...skipping 6989 matching lines...) Expand 10 before | Expand all | Expand 10 after
11678 if (type is UnionType) { 11684 if (type is UnionType) {
11679 return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visite dTypePairs); 11685 return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visite dTypePairs);
11680 } 11686 }
11681 // The only subtype relations that pertain to void are therefore: 11687 // The only subtype relations that pertain to void are therefore:
11682 // void <: void (by reflexivity) 11688 // void <: void (by reflexivity)
11683 // bottom <: void (as bottom is a subtype of all types). 11689 // bottom <: void (as bottom is a subtype of all types).
11684 // void <: dynamic (as dynamic is a supertype of all types) 11690 // void <: dynamic (as dynamic is a supertype of all types)
11685 return identical(type, this) || identical(type, DynamicTypeImpl.instance); 11691 return identical(type, this) || identical(type, DynamicTypeImpl.instance);
11686 } 11692 }
11687 } 11693 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698