Skip to content

Commit

Permalink
Revert Framework.Extension project to be CLSCompliant (#1450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Dec 12, 2022
1 parent 48c4e5f commit 4d1d4a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions src/TestFramework/TestFramework.Extensions/PrivateObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public PrivateObject(Type type, Type[]? parameterTypes, object?[]? args)
o = Activator.CreateInstance(type, ConstructorFlags, null, args, null);
}

ConstructFrom(o);
_ = o ?? throw new ArgumentNullException(nameof(o));
_target = o;
_originalType = o.GetType();
}

/// <summary>
Expand All @@ -150,7 +152,8 @@ public PrivateObject(Type type, Type[]? parameterTypes, object?[]? args)
public PrivateObject(object obj)
{
_ = obj ?? throw new ArgumentNullException(nameof(obj));
ConstructFrom(obj);
_target = obj;
_originalType = obj.GetType();
}

/// <summary>
Expand Down Expand Up @@ -742,14 +745,6 @@ private static void ValidateAccessString(string access)
}
}

[MemberNotNull(nameof(_target), nameof(_originalType))]
private void ConstructFrom(object obj)
{
_ = obj ?? throw new ArgumentNullException(nameof(obj));
_target = obj;
_originalType = obj.GetType();
}

private void BuildGenericMethodCacheForType(Type t)
{
DebugEx.Assert(t != null, "type should not be null.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: NeutralResourcesLanguage("en")]
[assembly: CLSCompliant(false)]
[assembly: CLSCompliant(true)]

// Version information for an assembly consists of the following four values:
//
Expand Down

0 comments on commit 4d1d4a0

Please sign in to comment.