diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs index 35dae2e3a1102c..ced4a207e16496 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs @@ -109,7 +109,7 @@ private static bool IsByRef(DynamicMetaObject mo) private static Type MakeNewCustomDelegate(Type[] types) { - if (LambdaExpression.CanCompileToIL) + if (RuntimeFeature.IsDynamicCodeSupported) { Type returnType = types[types.Length - 1]; Type[] parameters = types.RemoveLast(); diff --git a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs index c1db2afa8e1462..45ffdbde7c730c 100644 --- a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs @@ -415,7 +415,7 @@ public static void MethodDeclaringTypeHasNoTrueFalseOperator_ThrowsArgumentExcep AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(5), Expression.Constant(5), method)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlso_NoMethod_NotStatic_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -428,7 +428,7 @@ public static void AndAlso_NoMethod_NotStatic_ThrowsInvalidOperationException() Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElse_NoMethod_NotStatic_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -441,7 +441,7 @@ public static void OrElse_NoMethod_NotStatic_ThrowsInvalidOperationException() Assert.Throws(() => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlso_NoMethod_VoidReturnType_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -454,7 +454,7 @@ public static void AndAlso_NoMethod_VoidReturnType_ThrowsArgumentException() AssertExtensions.Throws("method", () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElse_NoMethod_VoidReturnType_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -467,7 +467,7 @@ public static void OrElse_NoMethod_VoidReturnType_ThrowsArgumentException() AssertExtensions.Throws("method", () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(0)] [InlineData(1)] [InlineData(3)] @@ -483,7 +483,7 @@ public static void AndAlso_NoMethod_DoesntHaveTwoParameters_ThrowsInvalidOperati Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData(0)] [InlineData(1)] [InlineData(3)] @@ -499,7 +499,7 @@ public static void OrElse_NoMethod_DoesntHaveTwoParameters_ThrowsInvalidOperatio Assert.Throws(() => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlso_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -512,7 +512,7 @@ public static void AndAlso_NoMethod_ExpressionDoesntMatchMethodParameters_Throws Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElse_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -526,7 +526,7 @@ public static void OrElse_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsI } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlso_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -539,7 +539,7 @@ public static void AndAlso_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArg AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElse_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -569,7 +569,7 @@ public static IEnumerable Operator_IncorrectMethod_TestData() yield return new object[] { GetTypeBuilder(), typeof(bool), new Type[0] }; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void Method_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -590,7 +590,7 @@ public static void Method_TrueOperatorIncorrectMethod_ThrowsArgumentException(Ty AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void Method_FalseOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[]parameterTypes) { @@ -611,7 +611,7 @@ public static void Method_FalseOperatorIncorrectMethod_ThrowsArgumentException(T AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void AndAlso_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -630,7 +630,7 @@ public static void AndAlso_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentEx AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void OrElse_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -649,7 +649,7 @@ public static void OrElse_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentExc AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData("op_True")] [InlineData("op_False")] public static void Method_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -672,7 +672,7 @@ public static void Method_NoTrueFalseOperator_ThrowsArgumentException(string nam AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData("op_True")] [InlineData("op_False")] public static void AndAlso_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -692,7 +692,7 @@ public static void AndAlso_NoMethod_NoTrueFalseOperator_ThrowsArgumentException( AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [InlineData("op_True")] [InlineData("op_False")] public static void OrElse_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -712,7 +712,7 @@ public static void OrElse_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(s AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void Method_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -733,7 +733,7 @@ public static void Method_ParamsDontMatchOperator_ThrowsInvalidOperationExceptio Assert.Throws(() => Expression.OrElse(Expression.Constant(5), Expression.Constant(5), createdMethod)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlso_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -751,7 +751,7 @@ public static void AndAlso_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperati Assert.Throws(() => Expression.OrElse(Expression.Constant(5), Expression.Constant(5))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElse_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -817,14 +817,14 @@ public static void ToStringTest() Assert.Equal("(a OrElse b)", e2.ToString()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void AndAlsoGlobalMethod() { MethodInfo method = GlobalMethod(typeof(int), new[] { typeof(int), typeof(int) }); AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(1), Expression.Constant(2), method)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void OrElseGlobalMethod() { MethodInfo method = GlobalMethod(typeof(int), new [] { typeof(int), typeof(int) }); diff --git a/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs b/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs index 64e20adf5cfddc..0f0294a58465c4 100644 --- a/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs @@ -2373,7 +2373,7 @@ public static IEnumerable EnumerableTypes() yield return typeof(Int64Enum); yield return typeof(UInt64Enum); - if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + if (PlatformDetection.IsReflectionEmitSupported) { yield return NonCSharpTypes.CharEnumType; yield return NonCSharpTypes.BoolEnumType; diff --git a/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs b/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs index 40ff43d0d5ff0e..2483f1756e52d4 100644 --- a/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs @@ -302,7 +302,7 @@ public static void CheckTypeConstantTest(bool useInterpreter) VerifyTypeConstant(value, useInterpreter); } - if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + if (PlatformDetection.IsReflectionEmitSupported) { VerifyTypeConstant(GetTypeBuilder(), useInterpreter); } @@ -328,14 +328,24 @@ public static void CheckMethodInfoConstantTest(bool useInterpreter) typeof(SomePublicMethodsForLdToken).GetMethod(nameof(SomePublicMethodsForLdToken.Qux), BindingFlags.Public | BindingFlags.Static), typeof(SomePublicMethodsForLdToken).GetMethod(nameof(SomePublicMethodsForLdToken.Qux), BindingFlags.Public | BindingFlags.Static).MakeGenericMethod(typeof(int)), typeof(List<>).GetMethod(nameof(List.Add)), - typeof(List).GetMethod(nameof(List.Add)), - GlobalMethod(Type.EmptyTypes), - GlobalMethod(typeof(PrivateGenericClass)), - GlobalMethod(typeof(PrivateGenericClass<>)) + typeof(List).GetMethod(nameof(List.Add)) }) { VerifyMethodInfoConstant(value, useInterpreter); } + + if (PlatformDetection.IsReflectionEmitSupported) + { + foreach (MethodInfo value in new MethodInfo[] + { + GlobalMethod(Type.EmptyTypes), + GlobalMethod(typeof(PrivateGenericClass)), + GlobalMethod(typeof(PrivateGenericClass<>)) + }) + { + VerifyMethodInfoConstant(value, useInterpreter); + } + } } [Theory, ClassData(typeof(CompilationTypes))] diff --git a/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs b/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs index 9d0852a8479164..a627772d7e6804 100644 --- a/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.CompilerServices; using System.Text.RegularExpressions; using Xunit; @@ -57,7 +58,7 @@ public void GetNullaryAction() [MemberData(nameof(ManagedPointerTypeArgs))] public void CantBeFunc(Type[] typeArgs) { - if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + if (!RuntimeFeature.IsDynamicCodeSupported) { Assert.Throws(() => Expression.GetDelegateType(typeArgs)); } @@ -83,7 +84,7 @@ public void CantBeFunc(Type[] typeArgs) public void CantBeAction(Type[] typeArgs) { Type[] delegateArgs = typeArgs.Append(typeof(void)).ToArray(); - if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + if (!RuntimeFeature.IsDynamicCodeSupported) { Assert.Throws(() => Expression.GetDelegateType(delegateArgs)); } diff --git a/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs b/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs index 616f2234524765..934478e72d1177 100644 --- a/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs @@ -54,7 +54,7 @@ public static IEnumerable ObjectArguments() yield return new[] {new object()}; } - [ActiveIssue("https://github.com/dotnet/runtime/issues/55070", typeof(PlatformDetection), nameof(PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/55070", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Theory, MemberData(nameof(ObjectArguments))] public void InvokeVirtualMethod(object value) { @@ -231,8 +231,7 @@ private static dynamic GetObjectWithNonIndexerParameterProperty(bool hasGetter, return Activator.CreateInstance(typeBuild.CreateType()); } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NonIndexerParameterizedDirectAccess() { // If a parameterized property isn't the type's indexer, we should be allowed to use the @@ -243,8 +242,7 @@ public void NonIndexerParameterizedDirectAccess() Assert.Equal(19, value); } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NonIndexerParameterizedGetterAndSetterIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(true, true); @@ -254,8 +252,7 @@ public void NonIndexerParameterizedGetterAndSetterIndexAccess() Assert.Contains("set_ItemProp", ex.Message); } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NonIndexerParameterizedGetterOnlyIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(true, false); @@ -265,8 +262,7 @@ public void NonIndexerParameterizedGetterOnlyIndexAccess() Assert.Contains("get_ItemProp", ex.Message); } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void NonIndexerParameterizedSetterOnlyIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(false, true); @@ -335,8 +331,7 @@ public int GetValue2( int arg10) => 11; } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public void ManyArities() { dynamic d = new ManyOverloads(); @@ -380,8 +375,7 @@ public static IEnumerable SameNameObjectPairs() return testObjects.SelectMany(i => testObjects.Select(j => new[] { i, j })); } - // We're not testing compilation, but we do need Reflection.Emit for the test - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Theory] [MemberData(nameof(SameNameObjectPairs))] public void OperationOnTwoObjectsDifferentTypesOfSameName(object x, object y) { diff --git a/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs b/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs index 26ca0e2ea5119e..40e794a5f69357 100644 --- a/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs +++ b/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs @@ -240,7 +240,7 @@ public void ExpressionsUnwrapeExternallyThrownRuntimeWrappedException(bool useIn Assert.Equal(4, func()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ClassData(typeof(CompilationTypes))] public void CatchFromExternallyThrownString(bool useInterpreter) { diff --git a/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs b/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs index 98a436c9f4a17f..8fb36788766d74 100644 --- a/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs @@ -97,7 +97,7 @@ private static TypeBuilder GetTestTypeBuilder() => .DefineDynamicModule("TestModule") .DefineType("TestType"); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/mono/mono/issues/14920", TestRuntimes.Mono)] public void NoAccessorIndexedProperty() { @@ -113,7 +113,7 @@ public void NoAccessorIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ByRefIndexedProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -144,7 +144,7 @@ public void ByRefIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void VoidIndexedProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -172,7 +172,7 @@ public void VoidIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/mono/mono/issues/14927", TestRuntimes.Mono)] public void IndexedPropertyGetReturnsWrongType() { @@ -201,7 +201,7 @@ public void IndexedPropertyGetReturnsWrongType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertySetterNoParams() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -229,7 +229,7 @@ public void IndexedPropertySetterNoParams() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertySetterByrefValueType() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -257,7 +257,7 @@ public void IndexedPropertySetterByrefValueType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertySetterNotReturnVoid() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -285,7 +285,7 @@ public void IndexedPropertySetterNotReturnVoid() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertyGetterInstanceSetterStatic() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -325,7 +325,7 @@ public void IndexedPropertyGetterInstanceSetterStatic() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/mono/mono/issues/14927", TestRuntimes.Mono)] public void IndexedPropertySetterValueTypeNotMatchPropertyType() { @@ -354,7 +354,7 @@ public void IndexedPropertySetterValueTypeNotMatchPropertyType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertyGetterSetterArgCountMismatch() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -394,7 +394,7 @@ public void IndexedPropertyGetterSetterArgCountMismatch() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertyGetterSetterArgumentTypeMismatch() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -434,7 +434,7 @@ public void IndexedPropertyGetterSetterArgumentTypeMismatch() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0), Expression.Constant(0), Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void IndexedPropertyVarArgs() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -464,7 +464,7 @@ public void IndexedPropertyVarArgs() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0), Expression.Constant(0), Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public void NullInstanceInstanceProperty() { PropertyInfo prop = typeof(Dictionary).GetProperty("Item"); @@ -472,7 +472,7 @@ public void NullInstanceInstanceProperty() AssertExtensions.Throws("instance", () => Expression.Property(null, prop, index)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void InstanceToStaticProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -500,7 +500,7 @@ public void InstanceToStaticProperty() AssertExtensions.Throws("instance", () => Expression.Property(instance, prop, Expression.Constant(0))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ByRefIndexer() { TypeBuilder typeBuild = GetTestTypeBuilder(); diff --git a/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs b/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs index 4298013f5f59c5..9a71ecf4d35ffd 100644 --- a/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs @@ -101,9 +101,7 @@ .maxcontinuation 1 }"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] [ActiveIssue ("https://github.com/dotnet/runtime/issues/53599", platforms: TestPlatforms.MacCatalyst, runtimes: TestRuntimes.Mono)] public static void ConstructorThrows_StackTrace() { @@ -112,9 +110,7 @@ public static void ConstructorThrows_StackTrace() AssertStackTrace(() => f(), "Thrower..ctor"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public static void PropertyGetterThrows_StackTrace() { Expression> e = t => t.Bar; @@ -122,9 +118,7 @@ public static void PropertyGetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.get_Bar"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public static void PropertySetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -133,9 +127,7 @@ public static void PropertySetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.set_Bar"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public static void IndexerGetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -144,9 +136,7 @@ public static void IndexerGetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.get_Item"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public static void IndexerSetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -155,9 +145,7 @@ public static void IndexerSetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.set_Item"); } - // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, - // but this functionality relies on private reflection and that would not work with AOT - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public static void MethodThrows_StackTrace() { Expression> e = t => t.Foo(); diff --git a/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs b/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs index 829e7e435ba331..14fa4ca58fae18 100644 --- a/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs @@ -244,8 +244,7 @@ public static void LambdaAndArgChangeVisit(InvocationExpression invoke) Assert.NotSame(invoke, new ParameterAndConstantChangingVisitor().Visit(invoke)); } - // When we don't have IsNotLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ClassData(typeof(CompilationTypes))] public static void InvokePrivateDelegate(bool useInterpreter) { @@ -263,8 +262,7 @@ public static void InvokePrivateDelegate(bool useInterpreter) Assert.Equal(42, invFunc()); } - // When we don't have IsNotLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ClassData(typeof(CompilationTypes))] public static void InvokePrivateDelegateTypeLambda(bool useInterpreter) { diff --git a/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs b/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs index c62a6ed60273e2..a72d32875128ee 100644 --- a/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs @@ -6,6 +6,7 @@ using System.Collections.ObjectModel; using System.Reflection; using System.Reflection.Emit; +using System.Runtime.CompilerServices; using Xunit; namespace System.Linq.Expressions.Tests @@ -268,9 +269,9 @@ public void ImplicitlyTyped() double, double, double, double, bool>), exp.Type); - // From this point on, the tests require IsLinqExpressionsBuiltWithIsInterpretingOnly (RefEmit) support as SLE needs to create delegate types on the fly. + // From this point on, the tests require Ref.Emit support as SLE needs to create delegate types on the fly. // You can't instantiate Func<> over 20 arguments or over byrefs. - if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + if (!RuntimeFeature.IsDynamicCodeSupported) return; ParameterExpression[] paramList = Enumerable.Range(0, 20).Select(_ => Expression.Variable(typeof(int))).ToArray(); @@ -924,8 +925,7 @@ public void OpenGenericDelegate() AssertExtensions.Throws("delegateType", () => Expression.Lambda(typeof(Action<>), Expression.Empty(), false, Enumerable.Empty())); } - // When we don't have IsLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ClassData(typeof(CompilationTypes))] public void PrivateDelegate(bool useInterpreter) { diff --git a/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs b/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs index 78466bcd842eee..ae9913e9753d2a 100644 --- a/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs @@ -552,7 +552,7 @@ public static void MakeMemberAccess_MemberNotFieldOrProperty_ThrowsArgumentExcep AssertExtensions.Throws("member", () => Expression.MakeMemberAccess(Expression.Constant(new PC()), member)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/mono/mono/issues/14920", TestRuntimes.Mono)] public static void Property_NoGetOrSetAccessors_ThrowsArgumentException() { diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs index 8777d108110b09..cf0e4676f71c09 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs @@ -284,7 +284,7 @@ public void BogusBindingType(MemberBinding binding) AssertExtensions.Throws("bindings[0]", () => Expression.MemberInit(Expression.New(typeof(PropertyAndFields)), binding)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -295,7 +295,7 @@ public void GlobalMethod() AssertExtensions.Throws("propertyAccessor", () => Expression.Bind(globalMethodInfo, Expression.Constant(2))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GlobalField() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs index 3b25685e8368fe..2c607f433a47e7 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs @@ -290,7 +290,7 @@ public void OpenGenericTypesMembers() AssertExtensions.Throws(null, () => Expression.ListBind(method)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs index 8a72d0e39849e2..d3122945ab0b8d 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs @@ -253,7 +253,7 @@ public void StaticReadonlyInnerField(bool useInterpreter) Assert.Throws(() => exp.Compile(useInterpreter)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); diff --git a/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs b/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs index f056ed3df36c1c..e6493c5a6d3003 100644 --- a/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs @@ -555,7 +555,7 @@ public static void OpenGenericConstructorsInvalid(ConstructorInfo ctor, Expressi } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void GlobalMethodInMembers() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -569,7 +569,7 @@ public static void GlobalMethodInMembers() AssertExtensions.Throws("members[0]", () => Expression.New(constructor, arguments, members)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public static void GlobalFieldInMembers() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); diff --git a/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs b/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs index 04804eef82f9b4..e20bba67732241 100644 --- a/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs @@ -70,7 +70,8 @@ public void CreateByRefAliasingInterpreted() CreateByRefAliasing(useInterpreter: true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/19286", typeof(PlatformDetection), nameof(PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly))] + [Fact] public void CreateByRefAliasingCompiled() { CreateByRefAliasing(useInterpreter: false);