Skip to content

Commit 5670869

Browse files
alexmarkovcommit-bot@chromium.org
authored andcommitted
[vm/nnbd/bytecode] Distinguish function types with different nullabilities in bytecode generator
Fixes #42807 Change-Id: I054b79c5b199fbc53e512caf8e41ddbcb79d3675 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155682 Reviewed-by: Régis Crelier <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent d2f7039 commit 5670869

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/vm/lib/bytecode/object_table.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,7 @@ class _FunctionTypeHandle extends _TypeHandle {
11491149
hash = _combineHashes(hash, listHashCode(positionalParams));
11501150
hash = _combineHashes(hash, listHashCode(namedParams));
11511151
hash = _combineHashes(hash, returnType.hashCode);
1152+
hash = _combineHashes(hash, nullability.index);
11521153
return hash;
11531154
}
11541155

@@ -1159,7 +1160,8 @@ class _FunctionTypeHandle extends _TypeHandle {
11591160
this.numRequiredParams == other.numRequiredParams &&
11601161
listEquals(this.positionalParams, other.positionalParams) &&
11611162
listEquals(this.namedParams, other.namedParams) &&
1162-
this.returnType == other.returnType;
1163+
this.returnType == other.returnType &&
1164+
this.nullability == other.nullability;
11631165

11641166
@override
11651167
String toString() {

0 commit comments

Comments
 (0)