-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override IsByRefLike on S.R.E.*Builder classes (#34846)
* Override IsByRefLike on S.R.E.*Builder classes Fixes #8828 * Adds tests * Update System.Reflection.Emit.Tests.csproj * Bumping CI * Update mono as well
- Loading branch information
1 parent
a637d3e
commit cfb1335
Showing
10 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...flection.Emit/tests/GenericTypeParameterBuilder/GenericTypeParameterBuilderIsByRefLike.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Xunit; | ||
|
||
namespace System.Reflection.Emit.Tests | ||
{ | ||
public class GenericTypeParameterBuilderIsByRefLike | ||
{ | ||
[Fact] | ||
public void IsByRefLikeReturnsFalse() | ||
{ | ||
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); | ||
var typeParamNames = new string[] { "TFirst" }; | ||
GenericTypeParameterBuilder[] typeParams = type.DefineGenericParameters(typeParamNames); | ||
Assert.False(typeParams[0].IsByRefLike); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/libraries/System.Reflection.Emit/tests/TypeBuilder/TypeBuilderIsByRefLike.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Xunit; | ||
|
||
namespace System.Reflection.Emit.Tests | ||
{ | ||
public class TypeBuilderIsByRefLike | ||
{ | ||
[Fact] | ||
public void IsByRefLikeReturnsFalse() | ||
{ | ||
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); | ||
Assert.False(type.IsByRefLike); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -493,6 +493,8 @@ internal override bool IsUserType | |
return false; | ||
} | ||
} | ||
|
||
public override bool IsByRefLike => false; | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters