1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Merge pull request #1490 from disarray2077/patch-9

Improve ConvertTo Variant
This commit is contained in:
Brian Fiete 2022-03-17 19:46:10 +01:00 committed by GitHub
commit fa152a0084
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,6 +94,9 @@ namespace System.Reflection
int64 intVal = ToInt64(variant); int64 intVal = ToInt64(variant);
switch (type.[Friend]mTypeCode) switch (type.[Friend]mTypeCode)
{ {
case .Boolean:
bool val = intVal != 0;
return Variant.Create(type, &val);
case .Float: case .Float:
float val = (.)intVal; float val = (.)intVal;
return Variant.Create(type, &val); return Variant.Create(type, &val);