Skip to content

Fix GH-8750: Can not create VT_ERROR variant type #8886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jun 28, 2022

We add support for creating VT_ERROR variants via __construct(),
and allow casting to int via variant_cast() and variant_set_type().
We do not, however, allow type conversion by other means, to avoid
otherwise easily introduced type confusion. VB(A) also only allows
explicit type conversion.

We also introduce DISP_E_PARAMNOTFOUND which might be the most
important scode for this purpose, since this allows to skip optional
parameters in method calls.


This would be an alternative solution to PR #8840. I'm not really happy with either solution, but I think it is important to have at least some minimal support for VT_ERROR (besides the already supported variant_get_type().

If we go with this, we need to consider whether we want to support casting int to error via variant_cast() and variant_set_type() (this currently fails).

We add support for creating `VT_ERROR` variants via `__construct()`,
and allow casting to int via `variant_cast()` and `variant_set_type()`.
We do not, however, allow type conversion by other means, to avoid
otherwise easily introduced type confusion.  VB(A) also only allows
explicit type conversion.

We also introduce `DISP_E_PARAMNOTFOUND` which might be the most
important `scode` for this purpose, since this allows to skip optional
parameters in method calls.
@cmb69
Copy link
Member Author

cmb69 commented Jul 5, 2022

Any objections to merging this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

php_com_dotnet - can not create VT_ERROR variant type
1 participant