Skip to content

Commit

Permalink
Removed C# 7.0 usage to improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
liiir1985 committed May 7, 2020
1 parent fee5b4f commit 12db019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ILRuntime/CLR/TypeSystem/ILType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,9 @@ public IMethod GetVirtualMethod(IMethod method)
var m = GetMethod(method.Name, method.Parameters, genericArguments, method.ReturnType, true);
if (m == null && method.DeclearingType.IsInterface)
{
if(method.DeclearingType is ILType iltype)
if(method.DeclearingType is ILType)
{
ILType iltype = (ILType)method.DeclearingType;
m = GetMethod(string.Format("{0}.{1}", iltype.fullNameForNested, method.Name), method.Parameters, genericArguments, method.ReturnType, true);
}
else
Expand Down
3 changes: 2 additions & 1 deletion ILRuntime/Runtime/Enviorment/CLRRedirections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,9 @@ static object CheckCrossBindingAdapter(object obj)
intp.Free(p);

bool res = false;
if(ins is ILEnumTypeInstance enumIns)
if(ins is ILEnumTypeInstance)
{
ILEnumTypeInstance enumIns = (ILEnumTypeInstance)ins;
int num = enumIns.Fields[0].Value;
int valNum = ((ILEnumTypeInstance)val).Fields[0].Value;
res = (num & valNum) == valNum;
Expand Down

0 comments on commit 12db019

Please sign in to comment.