Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for final, interface, and sealed mixins #3369

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
dartfmt and lints
  • Loading branch information
jcollins-g committed Mar 21, 2023
commit 7f82be08023570e616f21309de7a5549a3a5b3d9
4 changes: 2 additions & 2 deletions lib/src/element_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class UndefinedElementType extends ElementType {

@override
String get name {
if (type.isVoid) return 'void';
if (type is VoidType) return 'void';
if (type.isDynamic) return 'dynamic';
assert(const {'Never'}.contains(typeElement!.name),
'Unrecognized type for UndefinedElementType: ${type.toString()}');
Expand Down Expand Up @@ -436,7 +436,7 @@ class GenericTypeAliasElementType extends TypeParameterElementType {
extension on DartType {
/// The dartdoc nullability suffix for this type in [library].
String nullabilitySuffixWithin(Library library) {
if (!isVoid && !isBottom) {
if (this is! VoidType && !isBottom) {
/// If a legacy type appears inside the public interface of a Null
/// safety library, we pretend it is nullable for the purpose of
/// documentation (since star-types are not supposed to be public).
Expand Down
5 changes: 3 additions & 2 deletions lib/src/model/extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:dartdoc/src/element_type.dart';
import 'package:dartdoc/src/model/comment_referable.dart';
import 'package:dartdoc/src/model/extension_target.dart';
Expand All @@ -23,7 +24,7 @@ class Extension extends Container implements EnclosedElement {
/// Detect if this extension applies to every object.
bool get alwaysApplies =>
extendedType.instantiatedType.isDynamic ||
extendedType.instantiatedType.isVoid ||
extendedType.instantiatedType is VoidType ||
extendedType.instantiatedType.isDartCoreObject;

bool couldApplyTo<T extends ExtensionTarget>(T c) =>
Expand All @@ -32,7 +33,7 @@ class Extension extends Container implements EnclosedElement {
/// Whether this extension could apply to [type].
bool _couldApplyTo(DefinedElementType type) {
if (extendedType.instantiatedType.isDynamic ||
extendedType.instantiatedType.isVoid) {
extendedType.instantiatedType is VoidType) {
return true;
}
var typeInstantiated = type.instantiatedType;
Expand Down
1 change: 1 addition & 0 deletions lib/src/model/mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Mixin extends InheritingContainer with TypeImplementing {
bool get isInterface => false;

@override

/// Mixins are not mixin classes by definition.
bool get isMixinClass => false;

Expand Down