Skip to content

Commit a198745

Browse files
stereotype441tvolkert
authored andcommitted
Rework mixins to avoid extending non-Object. (#116)
The ability for a class extending non-Object to be used as a mixin will be removed from Dart in an upcoming release. In general, code taking advantage of this ability can be fixed in two ways: - The class can be changed to use the new "mixin" syntax (see https://github.com/dart-lang/language/blob/master/working/0006.%20Super-invocations%20in%20mixins/0007.%20Mixin%20declarations/lrhn-strawman.md). - If the class contains no references to "super", the base class can simply be moved into the "implements" clause (e.g. "abstract class M extends A implements B {...}" can be changed to "abstract class M implements A, B {...}" This CL adopts the second strategy, since it's feasible (the classes in question do not use "super") and since it's backwards compatible to older versions of Dart.
1 parent 7ef7e0c commit a198745

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/file/lib/src/forwarding/forwarding_directory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:file/file.dart';
99

1010
/// A directory that forwards all methods and properties to a delegate.
1111
abstract class ForwardingDirectory<T extends Directory>
12-
extends ForwardingFileSystemEntity<T, io.Directory> implements Directory {
12+
implements ForwardingFileSystemEntity<T, io.Directory>, Directory {
1313
@override
1414
T wrap(io.Directory delegate) => wrapDirectory(delegate);
1515

packages/file/lib/src/forwarding/forwarding_file.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import 'package:file/src/io.dart' as io;
99
import 'package:file/file.dart';
1010

1111
/// A file that forwards all methods and properties to a delegate.
12-
abstract class ForwardingFile extends ForwardingFileSystemEntity<File, io.File>
13-
implements File {
12+
abstract class ForwardingFile
13+
implements ForwardingFileSystemEntity<File, io.File>, File {
1414
@override
1515
ForwardingFile wrap(io.File delegate) => wrapFile(delegate);
1616

packages/file/lib/src/forwarding/forwarding_link.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import 'package:file/src/io.dart' as io;
88
import 'package:file/file.dart';
99

1010
/// A link that forwards all methods and properties to a delegate.
11-
abstract class ForwardingLink extends ForwardingFileSystemEntity<Link, io.Link>
12-
implements Link {
11+
abstract class ForwardingLink
12+
implements ForwardingFileSystemEntity<Link, io.Link>, Link {
1313
@override
1414
ForwardingLink wrap(io.Link delegate) => wrapLink(delegate);
1515

0 commit comments

Comments
 (0)