Skip to content

Commit

Permalink
.NET: Convert System.RuntimeTypeHandle to TypeDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Mar 21, 2024
1 parent 6583503 commit 74050c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion csharp-api/REFrameworkNET/Method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace REFrameworkNET {
REFrameworkNET::InvokeRet^ Method::Invoke(System::Object^ obj, array<System::Object^>^ args) {
if (obj == nullptr && !this->IsStatic()) {
System::String^ declaringName = this->GetDeclaringType() != nullptr ? this->GetDeclaringType()->GetFullName() : "Unknown";
System::String^ declaringName = this->GetDeclaringType() != nullptr ? this->GetDeclaringType()->GetFullName() : gcnew System::String("UnknownType");
System::String^ errorStr = "Cannot invoke a non-static method without an object (" + declaringName + "." + this->GetName() + ")";
REFrameworkNET::API::LogError(errorStr);
throw gcnew System::InvalidOperationException(errorStr);
Expand Down Expand Up @@ -169,6 +169,10 @@ bool Method::HandleInvokeMember_Internal(System::Object^ obj, System::String^ me
// for consistency purposes
MAKE_TYPE_HANDLER_2(System, Single, double, Double)
MAKE_TYPE_HANDLER_2(System, Double, double, Double)
case "System.RuntimeTypeHandle"_fnv: {
result = gcnew REFrameworkNET::TypeDefinition((::REFrameworkTypeDefinitionHandle)tempResult->QWord);
break;
}
default:
result = tempResult;
break;
Expand Down

0 comments on commit 74050c8

Please sign in to comment.