Discussion:
[dart-misc] Dart 2 Breaking Change: New methods and constructors on Invocation
'Leaf Petersen' via Dart Misc
2018-02-21 23:06:56 UTC
Permalink
TLDR: If you don't have code that implements or mixes in the `Invocation`
class, you can stop reading.

We (the Dart team) are making some small breaking changes to the
`Invocation` class to reflect the addition of generic methods to Dart 2.
See below for a summary of the change and its impact.

*What is changing*

We are adding the following getter to `Invocation`:

List<Type> get typeArguments;

The method is added as non-abstract and returning an empty list, so all
classes that currently extend Invocation will remain valid.

The Invocation class now has constructors that can create all instances
with any valid state, so many classes implementing Invocation are probably
now unnecessary. As a result however, the Invocation class can no longer
be used as a mixin.

*What will break?*



*All classes that implement `Invocation` need to add a corresponding
getter: @override List<Type> get typeArguments { throw new
UnimplementedError("typeArguments"); }*
Classes that use `Invocation` as a mixin will no longer work. We are not
aware of any such uses.

*Why is this change being made?*

Dart 2 adds generic methods to the language, and so method invocations may
include type arguments which may need to be passed on to a noSuchMethod
invocation. There is currently no place in the `Invocation` class to
record these type arguments.

I will update here when this change lands. Please reach out to me here or
offline with any concerns, and/or with help resolving any issues after this
change has landed.

thanks,
-leaf
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Leaf Petersen' via Dart Misc
2018-04-11 00:07:13 UTC
Permalink
This has landed
<https://api.dartlang.org/dev/2.0.0-dev.47.0/dart-core/Invocation-class.html>.
Please let me know if you see any issues.

-leaf
Post by 'Leaf Petersen' via Dart Misc
TLDR: If you don't have code that implements or mixes in the `Invocation`
class, you can stop reading.
We (the Dart team) are making some small breaking changes to the
`Invocation` class to reflect the addition of generic methods to Dart 2.
See below for a summary of the change and its impact.
*What is changing*
List<Type> get typeArguments;
The method is added as non-abstract and returning an empty list, so all
classes that currently extend Invocation will remain valid.
The Invocation class now has constructors that can create all instances
with any valid state, so many classes implementing Invocation are probably
now unnecessary. As a result however, the Invocation class can no
longer be used as a mixin.
*What will break?*
*All classes that implement `Invocation` need to add a corresponding
UnimplementedError("typeArguments"); }*
Classes that use `Invocation` as a mixin will no longer work. We are not
aware of any such uses.
*Why is this change being made?*
Dart 2 adds generic methods to the language, and so method invocations may
include type arguments which may need to be passed on to a noSuchMethod
invocation. There is currently no place in the `Invocation` class to
record these type arguments.
I will update here when this change lands. Please reach out to me here or
offline with any concerns, and/or with help resolving any issues after this
change has landed.
thanks,
-leaf
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/aece7f71-f9df-4148-a555-dcd99effa4c8%40dartlang.org.
Loading...