[dart2wasm] Handle void getters in selector return counts

These tests now pass:

co19/Language/Classes/Getters/void_return_type_t01
language/void/generalized_void_syntax_test
language/void/void_type_usage_test/instance3_argument_void
language/void/void_type_usage_test/instance3_as
language/void/void_type_usage_test/instance3_conditional
language/void/void_type_usage_test/instance3_for
language/void/void_type_usage_test/instance3_literal_map_key_init
language/void/void_type_usage_test/instance3_literal_map_value_init
language/void/void_type_usage_test/instance3_literal_void_list_init
language/void/void_type_usage_test/instance3_null_equals1
language/void/void_type_usage_test/instance3_return_to_void
language/void/void_type_usage_test/instance3_stmt
language/void/void_type_usage_test/instance3_void_init

Change-Id: Iadcff0269360515267e0848bc7256e5bc51104fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263720
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
Ömer Sinan Ağacan 2022-10-17 09:30:08 +00:00 committed by Commit Queue
parent c8bda70c66
commit 045cb1a711
2 changed files with 4 additions and 4 deletions

View file

@ -230,8 +230,8 @@ class DispatchTable {
? metadata.getterSelectorId
: metadata.methodOrSetterSelectorId;
ParameterInfo paramInfo = ParameterInfo.fromMember(target);
int returnCount = isGetter ||
member is Procedure && member.function.returnType is! VoidType
final int returnCount = (isGetter && member.getterType is! VoidType) ||
(member is Procedure && member.function.returnType is! VoidType)
? 1
: 0;

View file

@ -19,12 +19,12 @@ extension GetterSetterReference on Reference {
bool get isGetter {
Member member = asMember;
return member is Procedure && member.isGetter || isImplicitGetter;
return (member is Procedure && member.isGetter) || isImplicitGetter;
}
bool get isSetter {
Member member = asMember;
return member is Procedure && member.isSetter || isImplicitSetter;
return (member is Procedure && member.isSetter) || isImplicitSetter;
}
}