Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita2bb40f

Browse files
authored
Cleanup System.Bindingflags on coreclr. Enable more reflect.fs apis on coreclr (dotnet#2457)
1 parentf070cb8 commita2bb40f

File tree

8 files changed

+16
-19
lines changed

8 files changed

+16
-19
lines changed

‎src/FSharpSource.targets‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
264264
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
265265
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONSOLE</DefineConstants>
266+
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_BINDINGFLAGS</DefineConstants>
266267
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
267268
<DefineConstants>$(DefineConstants);FX_NO_TYPECODE</DefineConstants>
268269
<DefineConstants>$(DefineConstants);FX_NO_WEB_CLIENT</DefineConstants>
@@ -297,6 +298,7 @@
297298
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
298299
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
299300
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONSOLE</DefineConstants>
301+
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_BINDINGFLAGS</DefineConstants>
300302
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
301303
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
302304
<DefineConstants>$(DefineConstants);FX_NO_TYPECODE</DefineConstants>
@@ -333,6 +335,7 @@
333335
<DefineConstants>$(DefineConstants);FX_NO_REGISTERED_WAIT_HANDLES</DefineConstants>
334336
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
335337
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_CONSOLE</DefineConstants>
338+
<DefineConstants>$(DefineConstants);FX_NO_SYSTEM_BINDINGFLAGS</DefineConstants>
336339
<DefineConstants>$(DefineConstants);FX_NO_THREAD</DefineConstants>
337340
<DefineConstants>$(DefineConstants);FX_NO_TPL_PARALLEL</DefineConstants>
338341
<DefineConstants>$(DefineConstants);FX_NO_TYPECODE</DefineConstants>

‎src/fsharp/ExtensionTyping.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module internal ExtensionTyping =
1010
openSystem
1111
openSystem.IO
1212
openSystem.Collections.Generic
13+
openSystem.Reflection
1314
openMicrosoft.FSharp.Core.CompilerServices
1415
openMicrosoft.FSharp.Compiler.ErrorLogger
1516
openMicrosoft.FSharp.Compiler.Range
@@ -19,8 +20,6 @@ module internal ExtensionTyping =
1920

2021
#if FX_RESHAPED_REFLECTION
2122
openMicrosoft.FSharp.Core.ReflectionAdapters
22-
#else
23-
typeBindingFlags= System.Reflection.BindingFlags
2423
#endif
2524

2625
typeTypeProviderDesignation= TypeProviderDesignationofstring

‎src/fsharp/FSharp.Core/control.fs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ namespace Microsoft.FSharp.Control
288288
openSystem
289289
openSystem.Diagnostics
290290
openSystem.Diagnostics.CodeAnalysis
291-
openSystem.Threading
292291
openSystem.IO
292+
openSystem.Reflection
293+
openSystem.Threading
293294
openMicrosoft.FSharp.Core
294295
openMicrosoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
295296
openMicrosoft.FSharp.Core.Operators
@@ -298,9 +299,6 @@ namespace Microsoft.FSharp.Control
298299

299300
#if FX_RESHAPED_REFLECTION
300301
openReflectionAdapters
301-
typeinternalBindingFlags= ReflectionAdapters.BindingFlags
302-
#else
303-
typeBindingFlags= System.Reflection.BindingFlags
304302
#endif
305303

306304
#if!FX_NO_TASK

‎src/fsharp/FSharp.Core/event.fs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Microsoft.FSharp.Control
1313

1414
#if FX_RESHAPED_REFLECTION
1515
openReflectionAdapters
16-
typeinternalBindingFlags= ReflectionAdapters.BindingFlags
1716
#endif
1817

1918
#if!FX_NO_DELEGATE_DYNAMIC_METHOD

‎src/fsharp/FSharp.Core/quotations.fs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
namespaceMicrosoft.FSharp.Quotations
44

5-
#if FX_MINIMAL_REFLECTION
6-
#else
5+
#if!FX_MINIMAL_REFLECTION
76
openSystem
87
openSystem.IO
98
openSystem.Reflection
@@ -25,7 +24,6 @@ open Microsoft.FSharp.Text.StructuredPrintfImpl.TaggedTextOps
2524
#if FX_RESHAPED_REFLECTION
2625
openPrimReflectionAdapters
2726
openReflectionAdapters
28-
typeinternalBindingFlags= ReflectionAdapters.BindingFlags
2927
#endif
3028

3129
//--------------------------------------------------------------------------

‎src/fsharp/FSharp.Core/reflect.fs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module internal ReflectionUtils =
1818

1919
openMicrosoft.FSharp.Core.Operators
2020

21-
#ifFX_RESHAPED_REFLECTION
21+
#ifFX_NO_SYSTEM_BINDINGFLAGS
2222
typeBindingFlags= Microsoft.FSharp.Core.ReflectionAdapters.BindingFlags
2323
#else
2424
typeBindingFlags= System.Reflection.BindingFlags
@@ -709,7 +709,6 @@ module internal Impl =
709709

710710
#if FX_RESHAPED_REFLECTION
711711
openReflectionAdapters
712-
typeinternalBindingFlags= ReflectionAdapters.BindingFlags
713712
#endif
714713

715714
[<Sealed>]

‎src/fsharp/FSharp.Core/reflect.fsi‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ type FSharpValue =
7070
/// <returns>A function to read the specified field from the record.</returns>
7171
static memberPreComputeRecordFieldReader:info:PropertyInfo->(obj->obj)
7272

73-
#if FX_RESHAPED_REFLECTION
74-
#else
73+
// These APIs are only internal for portable profile, 7,78 and 259 of FSHarp.Core.dll --- those profiles System.Reflection.BindingFlags
74+
#if!FX_NO_SYSTEM_BINDINGFLAGS
7575
/// <summary>Creates an instance of a record type.</summary>
7676
///
7777
/// <remarks>Assumes the given input is a record type.</remarks>
@@ -263,8 +263,7 @@ type FSharpValue =
263263
///<summary>Contains operations associated with constructing and analyzing F# types such as records, unions and tuples</summary>
264264
type FSharpType=
265265

266-
#if FX_RESHAPED_REFLECTION
267-
#else
266+
#if!FX_NO_SYSTEM_BINDINGFLAGS
268267
/// <summary>Reads all the fields from a record value, in declaration order</summary>
269268
///
270269
/// <remarks>Assumes the given input is a record value. If not, ArgumentException is raised.</remarks>
@@ -530,8 +529,8 @@ namespace Microsoft.FSharp.Reflection
530529
open Microsoft.FSharp.Core
531530

532531
module internal ReflectionUtils=
533-
#ifFX_RESHAPED_REFLECTION
534-
typeinternalBindingFlags= ReflectionAdapters.BindingFlags
532+
#ifFX_NO_SYSTEM_BINDINGFLAGS
533+
typeBindingFlags= ReflectionAdapters.BindingFlags
535534
#else
536535
typeBindingFlags= System.Reflection.BindingFlags
537536
#endif

‎src/utils/reshapedreflection.fs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
22

33
namespaceMicrosoft.FSharp.Core
4+
openSystem.Reflection
45

56
//Replacement for: System.Security.SecurityElement.Escape(line) All platforms
67
moduleinternalXmlAdapters=
@@ -23,14 +24,14 @@ module internal XmlAdapters =
2324
#if FX_RESHAPED_REFLECTION
2425
moduleinternalReflectionAdapters=
2526
openSystem
26-
openSystem.Reflection
2727
#if FX_RESHAPED_REFLECTION_CORECLR
2828
openSystem.Runtime.Loader
2929
#endif
3030
openMicrosoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
3131
openMicrosoft.FSharp.Collections
3232
openPrimReflectionAdapters
3333

34+
#if FX_NO_SYSTEM_BINDINGFLAGS
3435
[<System.FlagsAttribute>]
3536
typeBindingFlags=
3637
| DeclaredOnly=2
@@ -39,6 +40,7 @@ module internal ReflectionAdapters =
3940
| Public=16
4041
| NonPublic=32
4142
| InvokeMethod=0x100
43+
#endif
4244

4345
let inlinehasFlag(flag:BindingFlags)f=(f&&& flag)= flag
4446
letisDeclaredFlag f= hasFlag BindingFlags.DeclaredOnly f

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp