[vm/nnbd/bytecode] Distinguish function types with different nullabilities in bytecode generator

Fixes https://github.com/dart-lang/sdk/issues/42807

Change-Id: I054b79c5b199fbc53e512caf8e41ddbcb79d3675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155682
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov 2020-07-24 01:26:44 +00:00 committed by commit-bot@chromium.org
parent d2f7039e9c
commit 56708696a9

View file

@ -1149,6 +1149,7 @@ class _FunctionTypeHandle extends _TypeHandle {
hash = _combineHashes(hash, listHashCode(positionalParams));
hash = _combineHashes(hash, listHashCode(namedParams));
hash = _combineHashes(hash, returnType.hashCode);
hash = _combineHashes(hash, nullability.index);
return hash;
}
@ -1159,7 +1160,8 @@ class _FunctionTypeHandle extends _TypeHandle {
this.numRequiredParams == other.numRequiredParams &&
listEquals(this.positionalParams, other.positionalParams) &&
listEquals(this.namedParams, other.namedParams) &&
this.returnType == other.returnType;
this.returnType == other.returnType &&
this.nullability == other.nullability;
@override
String toString() {