Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Huh?
  • Loading branch information
MichalStrehovsky authored Jul 15, 2021
commit 13c5a500a3bd3107e3df77f1881af85287f868d5
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ public static partial class Activator
assembly = RuntimeAssembly.InternalLoad(assemblyName, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
}

Type type = assembly.GetType(typeName, throwOnError: true, ignoreCase);
Type? type = assembly.GetType(typeName, throwOnError: true, ignoreCase);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this code wasn't needed anymore, is

if (contentType == AssemblyContentType.WindowsRuntime)
sb.Append(", ContentType=WindowsRuntime");
still needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that can also be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that one is reachable:

using System;

Console.WriteLine(AssemblyName.GetAssemblyName(@"C:\Windows\System32\WinMetadata\Windows.UI.winmd"));
Windows.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime


object? o = CreateInstance(type, bindingAttr, binder, args, culture, activationAttributes);
object? o = CreateInstance(type!, bindingAttr, binder, args, culture, activationAttributes);

return o != null ? new ObjectHandle(o) : null;
}
Expand Down