mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 23:34:10 +02:00
Added a 'cast' intrinsic
This commit is contained in:
parent
660e7d8125
commit
1f20d76f94
14 changed files with 75 additions and 22 deletions
|
@ -102,7 +102,7 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(.Method /*1*/ | .Invocation | .Property)]
|
||||
[AttributeUsage(.Method | .Constructor | .Invocation | .Property)]
|
||||
public struct InlineAttribute : Attribute
|
||||
{
|
||||
|
||||
|
|
|
@ -13,7 +13,9 @@ namespace System
|
|||
[AlwaysInclude]
|
||||
static class Internal
|
||||
{
|
||||
[Intrinsic("cast")]
|
||||
public static extern Object UnsafeCastToObject(void* ptr);
|
||||
[Intrinsic("cast")]
|
||||
public static extern void* UnsafeCastToPtr(Object obj);
|
||||
[NoReturn]
|
||||
public static extern void ThrowIndexOutOfRange(int stackOffset = 0);
|
||||
|
|
|
@ -70,7 +70,10 @@ namespace System
|
|||
[Inline]
|
||||
public static implicit operator Nullable<T>(T value)
|
||||
{
|
||||
return Nullable<T>(value);
|
||||
Nullable<T> result;
|
||||
result.mHasValue = true;
|
||||
result.mValue = value;
|
||||
return result;
|
||||
}
|
||||
|
||||
[Inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue