This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
Conversation
Restored most of the Reflection surface
area in Project N's S.P.Corelib.dll
to match the bringup in CoreClr
and get it suitable for a N targeting
pack for corefx to consume.
Stuff still do to:
Type/TypeInfo: Something about migrating apis
from TypeInfo to Type makes ILC very cranky
in shared mode. While I find the right
people to sort that out, I'm committing
what I've already got. It's big enough
already.
TypeDelegator: blocked on Type/TypeInfo.
Actually, this probably could live in
the System.Runtime facade, not corelib.
No one uses it inside corelib.
AssemblyName: Just didn't get to this -
will do in future PR.
operator==: They need to be done together
(once Type/TypeInfo is done) to keep MemberInfo:==
from recursing infinitely.
Most of the new apis throw NotImplemented,
but everything that worked in N before
still works.
Things that might look strange:
- A few odds and ends like System.ModuleHandle
are just member-less shells since they appear
in Reflection api signatures. I don't
plan to own them or fill them out.
- Moved Type.TryGetEEType() to a helper class
and converted it to an extension method. The Type.cs
class that's coming down is basically
the desktop Type.cs (with 2016-era formatting)
and it's just nice to have the N-specific
stuff de-intermingled from it.
- MethodBody properties that throw
"new ArgumentNullException("array");"
Yeah, we just do more efficiently what
CoreClr does by calling Array.AsReadOnly()
on a null array fetched from a field
that's never set and can never be set
by a derived class since it's private.
(when the CoreClr framework creates a
MethodBody, it sets the field from native
code inside the VM.)
- RuntimeNamedMethodInfo had an internal
property named "MethodHandle" (which returns
a Project N metadata handle.) The
incoming MethodInfo has an api named
"MethodHandle". Yay. Renamed.
- With BindingFlags defined in both Corelib
and S.R.TypeExtensions, I scanned for
assemblies that were referencing both.
S.P.Interop and S.P.TypeLoader were
referencing it and not using it.
S.P.R.Execution was referencing
it just so it could use the
Type.GetGenericArguments()
extension method. Since this is a real
instance member on the incoming Type,
I just went ahead and added it to
System.Type now so we can drop that
reference.
- BindingFlags.cs: I'm just adding the enum
values that were missing but the file in
Project N was so lamely styled, I just
bulldozed it with the coreclr version instead.
.NET Native CoreLib Reflection Bringup
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.