mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Removed '=' in generic constraints
This commit is contained in:
parent
4890303508
commit
a681da30be
6 changed files with 69 additions and 107 deletions
|
@ -236,17 +236,17 @@ namespace System
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T + TOther where TResult : struct
|
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T + TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue + rhs);
|
return Nullable<TResult>(lhs.mValue + rhs);
|
||||||
}
|
}
|
||||||
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther + T where TResult : struct
|
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther + T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs + rhs.mValue);
|
return Nullable<TResult>(lhs + rhs.mValue);
|
||||||
}
|
}
|
||||||
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T + TOther where TResult : struct
|
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T + TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue + rhs.mValue);
|
return Nullable<TResult>(lhs.mValue + rhs.mValue);
|
||||||
|
@ -254,19 +254,19 @@ namespace System
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther - T where TResult : struct
|
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther - T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs - rhs.mValue);
|
return Nullable<TResult>(lhs - rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T - TOther where TResult : struct
|
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T - TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue - rhs);
|
return Nullable<TResult>(lhs.mValue - rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T - TOther where TResult : struct
|
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T - TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue - rhs.mValue);
|
return Nullable<TResult>(lhs.mValue - rhs.mValue);
|
||||||
|
@ -274,19 +274,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther * T where TResult : struct
|
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther * T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs * rhs.mValue);
|
return Nullable<TResult>(lhs * rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T * TOther where TResult : struct
|
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T * TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue * rhs);
|
return Nullable<TResult>(lhs.mValue * rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T * TOther where TResult : struct
|
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T * TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue * rhs.mValue);
|
return Nullable<TResult>(lhs.mValue * rhs.mValue);
|
||||||
|
@ -294,19 +294,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther / T where TResult : struct
|
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther / T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs / rhs.mValue);
|
return Nullable<TResult>(lhs / rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T / TOther where TResult : struct
|
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T / TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue / rhs);
|
return Nullable<TResult>(lhs.mValue / rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T / TOther where TResult : struct
|
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T / TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue / rhs.mValue);
|
return Nullable<TResult>(lhs.mValue / rhs.mValue);
|
||||||
|
@ -314,19 +314,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther % T where TResult : struct
|
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther % T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs % rhs.mValue);
|
return Nullable<TResult>(lhs % rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T % TOther where TResult : struct
|
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T % TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue % rhs);
|
return Nullable<TResult>(lhs.mValue % rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T % TOther where TResult : struct
|
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T % TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue % rhs.mValue);
|
return Nullable<TResult>(lhs.mValue % rhs.mValue);
|
||||||
|
@ -334,19 +334,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ^ T where TResult : struct
|
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ^ T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs ^ rhs.mValue);
|
return Nullable<TResult>(lhs ^ rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ^ TOther where TResult : struct
|
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ^ TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ^ rhs);
|
return Nullable<TResult>(lhs.mValue ^ rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ^ TOther where TResult : struct
|
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ^ TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ^ rhs.mValue);
|
return Nullable<TResult>(lhs.mValue ^ rhs.mValue);
|
||||||
|
@ -354,19 +354,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther & T where TResult : struct
|
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther & T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs & rhs.mValue);
|
return Nullable<TResult>(lhs & rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T & TOther where TResult : struct
|
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T & TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue & rhs);
|
return Nullable<TResult>(lhs.mValue & rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T & TOther where TResult : struct
|
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T & TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue & rhs.mValue);
|
return Nullable<TResult>(lhs.mValue & rhs.mValue);
|
||||||
|
@ -374,19 +374,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther | T where TResult : struct
|
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther | T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs | rhs.mValue);
|
return Nullable<TResult>(lhs | rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T | TOther where TResult : struct
|
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T | TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue | rhs);
|
return Nullable<TResult>(lhs.mValue | rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T | TOther where TResult : struct
|
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T | TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue | rhs.mValue);
|
return Nullable<TResult>(lhs.mValue | rhs.mValue);
|
||||||
|
@ -399,19 +399,19 @@ namespace System
|
||||||
return (lhs.mHasValue) ? lhs.mValue : rhs;
|
return (lhs.mHasValue) ? lhs.mValue : rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ?? T where TResult : struct
|
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ?? T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs ?? rhs.mValue);
|
return Nullable<TResult>(lhs ?? rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ?? TOther where TResult : struct
|
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ?? TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ?? rhs);
|
return Nullable<TResult>(lhs.mValue ?? rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ?? TOther where TResult : struct
|
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ?? TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ?? rhs.mValue);
|
return Nullable<TResult>(lhs.mValue ?? rhs.mValue);
|
||||||
|
@ -419,19 +419,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther << T where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther << T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs << rhs.mValue);
|
return Nullable<TResult>(lhs << rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T << TOther where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T << TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue << rhs);
|
return Nullable<TResult>(lhs.mValue << rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T << TOther where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T << TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue << rhs.mValue);
|
return Nullable<TResult>(lhs.mValue << rhs.mValue);
|
||||||
|
|
|
@ -236,17 +236,17 @@ namespace System
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T + TOther where TResult : struct
|
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T + TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue + rhs);
|
return Nullable<TResult>(lhs.mValue + rhs);
|
||||||
}
|
}
|
||||||
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther + T where TResult : struct
|
public static TResult? operator+<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther + T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs + rhs.mValue);
|
return Nullable<TResult>(lhs + rhs.mValue);
|
||||||
}
|
}
|
||||||
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T + TOther where TResult : struct
|
public static TResult? operator+<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T + TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue + rhs.mValue);
|
return Nullable<TResult>(lhs.mValue + rhs.mValue);
|
||||||
|
@ -254,19 +254,19 @@ namespace System
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther - T where TResult : struct
|
public static TResult? operator-<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther - T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs - rhs.mValue);
|
return Nullable<TResult>(lhs - rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T - TOther where TResult : struct
|
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T - TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue - rhs);
|
return Nullable<TResult>(lhs.mValue - rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T - TOther where TResult : struct
|
public static TResult? operator-<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T - TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue - rhs.mValue);
|
return Nullable<TResult>(lhs.mValue - rhs.mValue);
|
||||||
|
@ -274,19 +274,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther * T where TResult : struct
|
public static TResult? operator*<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther * T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs * rhs.mValue);
|
return Nullable<TResult>(lhs * rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T * TOther where TResult : struct
|
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T * TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue * rhs);
|
return Nullable<TResult>(lhs.mValue * rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T * TOther where TResult : struct
|
public static TResult? operator*<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T * TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue * rhs.mValue);
|
return Nullable<TResult>(lhs.mValue * rhs.mValue);
|
||||||
|
@ -294,19 +294,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther / T where TResult : struct
|
public static TResult? operator/<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther / T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs / rhs.mValue);
|
return Nullable<TResult>(lhs / rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T / TOther where TResult : struct
|
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T / TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue / rhs);
|
return Nullable<TResult>(lhs.mValue / rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T / TOther where TResult : struct
|
public static TResult? operator/<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T / TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue / rhs.mValue);
|
return Nullable<TResult>(lhs.mValue / rhs.mValue);
|
||||||
|
@ -314,19 +314,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther % T where TResult : struct
|
public static TResult? operator%<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther % T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs % rhs.mValue);
|
return Nullable<TResult>(lhs % rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T % TOther where TResult : struct
|
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T % TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue % rhs);
|
return Nullable<TResult>(lhs.mValue % rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T % TOther where TResult : struct
|
public static TResult? operator%<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T % TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue % rhs.mValue);
|
return Nullable<TResult>(lhs.mValue % rhs.mValue);
|
||||||
|
@ -334,19 +334,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ^ T where TResult : struct
|
public static TResult? operator^<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ^ T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs ^ rhs.mValue);
|
return Nullable<TResult>(lhs ^ rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ^ TOther where TResult : struct
|
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ^ TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ^ rhs);
|
return Nullable<TResult>(lhs.mValue ^ rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ^ TOther where TResult : struct
|
public static TResult? operator^<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ^ TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ^ rhs.mValue);
|
return Nullable<TResult>(lhs.mValue ^ rhs.mValue);
|
||||||
|
@ -354,19 +354,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther & T where TResult : struct
|
public static TResult? operator&<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther & T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs & rhs.mValue);
|
return Nullable<TResult>(lhs & rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T & TOther where TResult : struct
|
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T & TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue & rhs);
|
return Nullable<TResult>(lhs.mValue & rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T & TOther where TResult : struct
|
public static TResult? operator&<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T & TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue & rhs.mValue);
|
return Nullable<TResult>(lhs.mValue & rhs.mValue);
|
||||||
|
@ -374,19 +374,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther | T where TResult : struct
|
public static TResult? operator|<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther | T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs | rhs.mValue);
|
return Nullable<TResult>(lhs | rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T | TOther where TResult : struct
|
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T | TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue | rhs);
|
return Nullable<TResult>(lhs.mValue | rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T | TOther where TResult : struct
|
public static TResult? operator|<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T | TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue | rhs.mValue);
|
return Nullable<TResult>(lhs.mValue | rhs.mValue);
|
||||||
|
@ -399,19 +399,19 @@ namespace System
|
||||||
return (lhs.mHasValue) ? lhs.mValue : rhs;
|
return (lhs.mHasValue) ? lhs.mValue : rhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther ?? T where TResult : struct
|
public static TResult? operator??<TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther ?? T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs ?? rhs.mValue);
|
return Nullable<TResult>(lhs ?? rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T ?? TOther where TResult : struct
|
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T ?? TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ?? rhs);
|
return Nullable<TResult>(lhs.mValue ?? rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T ?? TOther where TResult : struct
|
public static TResult? operator??<TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T ?? TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue ?? rhs.mValue);
|
return Nullable<TResult>(lhs.mValue ?? rhs.mValue);
|
||||||
|
@ -419,19 +419,19 @@ namespace System
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult = operator TOther << T where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(TOther lhs, Nullable<T> rhs) where TResult : operator TOther << T where TResult : struct
|
||||||
{
|
{
|
||||||
if (!rhs.mHasValue) return null;
|
if (!rhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs << rhs.mValue);
|
return Nullable<TResult>(lhs << rhs.mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult = operator T << TOther where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, TOther rhs) where TResult : operator T << TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if (!lhs.mHasValue) return null;
|
if (!lhs.mHasValue) return null;
|
||||||
return Nullable<TResult>(lhs.mValue << rhs);
|
return Nullable<TResult>(lhs.mValue << rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult = operator T << TOther where TResult : struct
|
public static TResult? operator<< <TOther, TResult>(Nullable<T> lhs, Nullable<TOther> rhs) where TOther : struct where TResult : operator T << TOther where TResult : struct
|
||||||
{
|
{
|
||||||
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
if ((!lhs.mHasValue) || (!rhs.mHasValue)) return null;
|
||||||
return Nullable<TResult>(lhs.mValue << rhs.mValue);
|
return Nullable<TResult>(lhs.mValue << rhs.mValue);
|
||||||
|
|
|
@ -282,8 +282,6 @@ void BfDefBuilder::ParseGenericParams(BfGenericParamsDeclaration* genericParamsD
|
||||||
name = tokenPairNode->mLeft->ToString() + tokenPairNode->mRight->ToString();
|
name = tokenPairNode->mLeft->ToString() + tokenPairNode->mRight->ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasEquals = (genericConstraint->mColonToken != NULL) && (genericConstraint->mColonToken->mToken == BfToken_AssignEquals);
|
|
||||||
|
|
||||||
if (!name.empty())
|
if (!name.empty())
|
||||||
{
|
{
|
||||||
if ((name == "class") || (name == "struct") || (name == "struct*") || (name == "const") || (name == "var") || (name == "concrete") || (name == "interface") || (name == "enum"))
|
if ((name == "class") || (name == "struct") || (name == "struct*") || (name == "const") || (name == "var") || (name == "concrete") || (name == "interface") || (name == "enum"))
|
||||||
|
@ -356,18 +354,6 @@ void BfDefBuilder::ParseGenericParams(BfGenericParamsDeclaration* genericParamsD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasEquals)
|
|
||||||
{
|
|
||||||
if (constraintDef->mConstraints.IsEmpty())
|
|
||||||
{
|
|
||||||
constraintDef->mGenericParamFlags = (BfGenericParamFlags)(constraintDef->mGenericParamFlags | BfGenericParamFlag_Equals);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Fail("Type assignment must be the first constraint", genericConstraint->mColonToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constraintDef->mConstraints.Add(constraintNode);
|
constraintDef->mConstraints.Add(constraintNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1429,9 +1429,6 @@ bool BfMethodMatcher::WantsCheckMethod(BfProtectionCheckFlags& flags, BfTypeInst
|
||||||
|
|
||||||
bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstance, BfGenericParamInstance* genericParamInst, BfTypeVector* methodGenericArgs)
|
bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstance, BfGenericParamInstance* genericParamInst, BfTypeVector* methodGenericArgs)
|
||||||
{
|
{
|
||||||
// if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_Equals) == 0)
|
|
||||||
// return false;
|
|
||||||
|
|
||||||
if (!genericParamInst->mExternType->IsGenericParam())
|
if (!genericParamInst->mExternType->IsGenericParam())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1441,17 +1438,6 @@ bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstan
|
||||||
|
|
||||||
BfType* checkArgType = NULL;
|
BfType* checkArgType = NULL;
|
||||||
|
|
||||||
if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_Equals_Type) != 0)
|
|
||||||
{
|
|
||||||
checkArgType = genericParamInst->mTypeConstraint;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_Equals_IFace) != 0)
|
|
||||||
{
|
|
||||||
if (!genericParamInst->mInterfaceConstraints.IsEmpty())
|
|
||||||
checkArgType = genericParamInst->mInterfaceConstraints[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& checkOpConstraint : genericParamInst->mOperatorConstraints)
|
for (auto& checkOpConstraint : genericParamInst->mOperatorConstraints)
|
||||||
{
|
{
|
||||||
auto leftType = checkOpConstraint.mLeftType;
|
auto leftType = checkOpConstraint.mLeftType;
|
||||||
|
@ -1492,7 +1478,7 @@ bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstan
|
||||||
exprEvaluator.PerformBinaryOperation(NULL, NULL, checkOpConstraint.mBinaryOp, NULL, BfBinOpFlag_NoClassify, leftValue, rightValue);
|
exprEvaluator.PerformBinaryOperation(NULL, NULL, checkOpConstraint.mBinaryOp, NULL, BfBinOpFlag_NoClassify, leftValue, rightValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_Equals_Op) != 0)
|
if (exprEvaluator.mResult)
|
||||||
checkArgType = exprEvaluator.mResult.mType;
|
checkArgType = exprEvaluator.mResult.mType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1523,7 +1509,7 @@ bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstan
|
||||||
exprEvaluator.mResult = rightValue;
|
exprEvaluator.mResult = rightValue;
|
||||||
exprEvaluator.PerformUnaryOperation(NULL, checkOpConstraint.mUnaryOp, NULL, BfUnaryOpFlag_IsConstraintCheck);
|
exprEvaluator.PerformUnaryOperation(NULL, checkOpConstraint.mUnaryOp, NULL, BfUnaryOpFlag_IsConstraintCheck);
|
||||||
|
|
||||||
if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_Equals_Op) != 0)
|
if (exprEvaluator.mResult)
|
||||||
checkArgType = exprEvaluator.mResult.mType;
|
checkArgType = exprEvaluator.mResult.mType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7214,8 +7214,6 @@ void BfModule::ResolveGenericParamConstraints(BfGenericParamInstance* genericPar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((constraintDef->mGenericParamFlags & BfGenericParamFlag_Equals) != 0)
|
|
||||||
genericParamInstance->mGenericParamFlags = (BfGenericParamFlags)(genericParamInstance->mGenericParamFlags | BfGenericParamFlag_Equals_Op);
|
|
||||||
genericParamInstance->mOperatorConstraints.Add(opConstraintInstance);
|
genericParamInstance->mOperatorConstraints.Add(opConstraintInstance);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -7323,20 +7321,12 @@ void BfModule::ResolveGenericParamConstraints(BfGenericParamInstance* genericPar
|
||||||
checkEquality = true;
|
checkEquality = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((constraintDef->mGenericParamFlags & BfGenericParamFlag_Equals) != 0)
|
|
||||||
{
|
|
||||||
genericParamInstance->mGenericParamFlags = (BfGenericParamFlags)(genericParamInstance->mGenericParamFlags | BfGenericParamFlag_Equals_Type);
|
|
||||||
checkEquality = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkEquality)
|
if (checkEquality)
|
||||||
{
|
{
|
||||||
genericParamInstance->mTypeConstraint = constraintType;
|
genericParamInstance->mTypeConstraint = constraintType;
|
||||||
}
|
}
|
||||||
else if (constraintType->IsInterface())
|
else if (constraintType->IsInterface())
|
||||||
{
|
{
|
||||||
if ((constraintDef->mGenericParamFlags & BfGenericParamFlag_Equals) != 0)
|
|
||||||
genericParamInstance->mGenericParamFlags = (BfGenericParamFlags)(genericParamInstance->mGenericParamFlags | BfGenericParamFlag_Equals_IFace);
|
|
||||||
genericParamInstance->mInterfaceConstraints.push_back(constraintType->ToTypeInstance());
|
genericParamInstance->mInterfaceConstraints.push_back(constraintType->ToTypeInstance());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -9565,7 +9565,7 @@ BfGenericConstraintsDeclaration* BfReducer::CreateGenericConstraintsDeclaration(
|
||||||
if (genericParamName != NULL)
|
if (genericParamName != NULL)
|
||||||
{
|
{
|
||||||
MEMBER_SET(genericConstraint, mTypeRef, genericParamName);
|
MEMBER_SET(genericConstraint, mTypeRef, genericParamName);
|
||||||
tokenNode = ExpectTokenAfter(genericConstraint, BfToken_Colon, BfToken_AssignEquals);
|
tokenNode = ExpectTokenAfter(genericConstraint, BfToken_Colon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
isDone = true;
|
isDone = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue