Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:KSP-KOS/KOS into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunbaratu committed Mar 8, 2016
2 parents 963cf1c + 8a58855 commit 3a9d101
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/kOS.Safe/Compilation/CalculatorStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ private bool TryCoerceImplicit(OperandPair pair, out OperandPair resultPair)
bool couldCoerce = false;
object newLeft;
object newRight;
if (pair.LeftType == pair.RightType)
{
resultPair = null;
// Since the types are already the same, we can't coerce them to be the same.
// Otherwise, some types will act as if they have been coerced because of
// other implict conversions.
return false;
}
MethodInfo convert2 = pair.LeftType.GetMethod("op_Implicit", FLAGS | BindingFlags.ExactBinding, null, new[] { pair.RightType }, null);
if (convert2 != null)
{
Expand Down

0 comments on commit 3a9d101

Please sign in to comment.