Descriptionfix part of #25200, we now reject non-generic fn subtype of generic fn
A few other fixes:
* inference of generic function expressions now works. It was broken because they ignored type parameters.
* fixes subtype of generic functions in the "normal" type system. These types are only possible if generic methods support is enabled, which can be accessed via a flag. The generic methods DEP is designed to work with the normal Dart type system, too, so we try to keep these code paths working. ("normal" type equality for function types already handled this correctly.) This is also needed because strong mode delegates to normal type system for some cases, e.g. to pick warning vs error.
* also refactors structural comparison of two generic function types, along the lines of recent changes, so there is less code duplication. This was my original motivation, but reviewing the code led to the discovery of the other issues.
* refactors strong_test_helper. The existing way of matching up errors did not work with generic function expressions like: /*<T>*/(x) => x. Simplified it to just look for the right offset. This also exposed a bug in a test -- previously, it was possible to have an error that wasn't validated.
R=leafp@google.com, rnystrom@google.com
Committed: https://github.com/dart-lang/sdk/commit/f97640745e533b47fe9208f4724b0ab5b9230dc9
Patch Set 1 #
Total comments: 40
Patch Set 2 : #Patch Set 3 : fix synthetic ctor #
Messages
Total messages: 11 (3 generated)
|