Remove a few 'is! MixinElement'.

MixinElement does not implement ClassElement anymore.

Change-Id: I0c05f8720b202ad79f3105a4638d8d3d4ff7a404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265403
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2022-10-24 21:33:37 +00:00 committed by Commit Queue
parent 8d925319ca
commit e46bade3d0
4 changed files with 4 additions and 11 deletions

View file

@ -682,8 +682,7 @@ class ClassElementImpl extends ClassOrMixinElementImpl implements ClassElement {
bool get isEnumLike {
// Must be a concrete class.
// TODO(scheglov) `is MixinElement` after the separation.
if (isAbstract || this is MixinElement) {
if (isAbstract) {
return false;
}

View file

@ -907,10 +907,7 @@ class InheritanceManager3 {
static bool _isDeclaredInObject(ExecutableElement element) {
var enclosing = element.enclosingElement;
// TODO(scheglov) `is! MixinElement` after the separation.
return enclosing is InterfaceElement &&
enclosing.supertype == null &&
enclosing is! MixinElement;
return enclosing is ClassElement && enclosing.isDartCoreObject;
}
}

View file

@ -2208,9 +2208,7 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
NamedType namedType,
InterfaceType type) {
final element = type.element;
if (element is! MixinElement &&
element is ClassElement &&
element.isAbstract) {
if (element is ClassElement && element.isAbstract) {
var element = expression.constructorName.staticElement;
if (element != null && !element.isFactory) {
bool isImplicit =

View file

@ -291,8 +291,7 @@ class _ElementWriter {
void _writeClassElement(InterfaceElement e) {
_writeIndentedLine(() {
// TODO(scheglov) `is! MixinElement` after the separation.
if (e is ClassElement && e is! MixinElement) {
if (e is ClassElement) {
_writeIf(e.isAbstract, 'abstract ');
_writeIf(e.isMacro, 'macro ');
}