Skip to content

Commit

Permalink
[dart2js] (New RTI) Check function subtypes after checking for FutureOr.
Browse files Browse the repository at this point in the history
Change-Id: I0cde41a8010563d7288d5473669cb87f0064ce63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112483
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
  • Loading branch information
fishythefish authored and commit-bot@chromium.org committed Aug 9, 2019
1 parent af5a466 commit 3d9a356
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sdk/lib/_internal/js_runtime/lib/rti.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1877,14 +1877,6 @@ bool _isSubtype(universe, Rti s, sEnv, Rti t, tEnv) {

if (isNullType(s)) return true;

if (Rti._isFunctionType(t)) {
return _isFunctionSubtype(universe, s, sEnv, t, tEnv);
}

if (Rti._isFunctionType(s)) {
return isFunctionType(t);
}

if (isFutureOrType(t)) {
// [t] is FutureOr<T>.
Rti tTypeArgument = Rti._getFutureOrArgument(t);
Expand All @@ -1904,6 +1896,14 @@ bool _isSubtype(universe, Rti s, sEnv, Rti t, tEnv) {
}
}

if (Rti._isFunctionType(t)) {
return _isFunctionSubtype(universe, s, sEnv, t, tEnv);
}

if (Rti._isFunctionType(s)) {
return isFunctionType(t);
}

assert(Rti._getKind(t) == Rti.kindInterface);
String tName = Rti._getInterfaceName(t);
var tArgs = Rti._getInterfaceTypeArguments(t);
Expand Down

0 comments on commit 3d9a356

Please sign in to comment.