projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #819 from brendanzagaeski/patch-1
[mono.git]
/
mcs
/
class
/
corlib
/
System
/
Nullable.cs
diff --git
a/mcs/class/corlib/System/Nullable.cs
b/mcs/class/corlib/System/Nullable.cs
index 0d9d5928690bdb5ea239e6d901a134733ade3730..11f6c67dbd4e4d73c69b0a3b4a007025069ea7bd 100644
(file)
--- a/
mcs/class/corlib/System/Nullable.cs
+++ b/
mcs/class/corlib/System/Nullable.cs
@@
-74,22
+74,18
@@
namespace System
{
if (nullableType == null)
throw new ArgumentNullException ("nullableType");
{
if (nullableType == null)
throw new ArgumentNullException ("nullableType");
- if (nullableType.IsGenericType && nullableType.GetGenericTypeDefinition () == typeof (Nullable<>))
- return nullableType.GetGenericArguments ()[0];
- else
- return null;
+
+ return nullableType.IsGenericType && !nullableType.IsGenericTypeDefinition && nullableType.GetGenericTypeDefinition () == typeof(Nullable<>) ?
+ nullableType.GetGenericArguments () [0] : null;
}
}
[Serializable]
}
}
[Serializable]
- [DebuggerDisplay ("{DebuggerDisplay}")]
[DebuggerStepThrough]
public struct Nullable<T> where T: struct
{
#region Sync with runtime code
[DebuggerStepThrough]
public struct Nullable<T> where T: struct
{
#region Sync with runtime code
- [DebuggerBrowsable (DebuggerBrowsableState.Never)]
internal T value;
internal T value;
- [DebuggerBrowsable (DebuggerBrowsableState.Never)]
internal bool has_value;
#endregion
internal bool has_value;
#endregion
@@
-99,19
+95,10
@@
namespace System
this.value = value;
}
this.value = value;
}
- [DebuggerBrowsable (DebuggerBrowsableState.Never)]
- string DebuggerDisplay {
- get {
- return has_value ? value.ToString () : null;
- }
- }
-
- [DebuggerBrowsable (DebuggerBrowsableState.Never)]
public bool HasValue {
get { return has_value; }
}
public bool HasValue {
get { return has_value; }
}
- [DebuggerBrowsable (DebuggerBrowsableState.Never)]
public T Value {
get {
if (!has_value)
public T Value {
get {
if (!has_value)
@@
-152,7
+139,7
@@
namespace System
public T GetValueOrDefault ()
{
public T GetValueOrDefault ()
{
- return
has_value ? value : default (T)
;
+ return
value
;
}
public T GetValueOrDefault (T defaultValue)
}
public T GetValueOrDefault (T defaultValue)