Skip to content

Commit

Permalink
Revert 2 fixes that build for .NET framework
Browse files Browse the repository at this point in the history
  • Loading branch information
buyaa-n committed Mar 6, 2024
1 parent 386ec50 commit 84c469f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/libraries/Common/src/System/Resources/ResourceWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,11 @@ private static ResourceTypeCode FindTypeCode(object? value, List<string> types)
if (typeName.StartsWith("ResourceTypeCode.", StringComparison.Ordinal))
{
typeName = typeName.Substring(17); // Remove through '.'
#if NETCOREAPP
ResourceTypeCode typeCode = Enum.Parse<ResourceTypeCode>(typeName);
#else
ResourceTypeCode typeCode = (ResourceTypeCode)Enum.Parse(typeof(ResourceTypeCode), typeName);
#endif
return typeCode;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument

private static string GetArgumentName(ExceptionArgument argument)
{
Debug.Assert(Enum.IsDefined(argument),
Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
"The enum value is not defined, please check the ExceptionArgument Enum.");

return argument.ToString();
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AotCompilerTask/MonoAOTCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private bool ProcessAndValidateArguments()

if (!Enum.TryParse(Mode, true, out parsedAotMode))
{
Log.LogError($"Unknown Mode value: {Mode}. '{nameof(Mode)}' must be one of: {string.Join(",", Enum.GetNames<MonoAotMode>())}");
Log.LogError($"Unknown Mode value: {Mode}. '{nameof(Mode)}' must be one of: {string.Join(",", Enum.GetNames(typeof(MonoAotMode)))}");
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private bool DoVisitSection(out bool shouldStop)
shouldStop = false;
byte code = _reader.ReadByte();
Section section = (Section)code;
if (!Enum.IsDefined(section))
if (!Enum.IsDefined(typeof(Section), section))
return false;
uint sectionSize = ReadULEB128();

Expand Down
2 changes: 1 addition & 1 deletion src/tasks/WasmAppBuilder/EmccCompile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private bool ExecuteActual()

if (!Enum.TryParse(OutputMessageImportance, ignoreCase: true, out MessageImportance messageImportance))
{
Log.LogError($"Invalid value for OutputMessageImportance={OutputMessageImportance}. Valid values: {string.Join(", ", Enum.GetNames<MessageImportance>())}");
Log.LogError($"Invalid value for OutputMessageImportance={OutputMessageImportance}. Valid values: {string.Join(", ", Enum.GetNames(typeof(MessageImportance)))}");
return false;
}

Expand Down

0 comments on commit 84c469f

Please sign in to comment.