Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>2017-05-09 20:57:10 +0300
committerGitHub <noreply@github.com>2017-05-09 20:57:10 +0300
commit767741623bf4613cb7b1d25ce0fa097aa2742bae (patch)
tree22006a9a8a9917b4f4fcbda43a47956f7501b0ae /src/System.Private.Reflection.Execution
parenta951141e08c7a1a9bcde21dc6583bb74f1909286 (diff)
Fix more CoreFx on ILC tests (#3559)
- Make Enum.Parse() throw OverflowException when it's supposed to. - Now that we support all the multidim array ranks that the full framework did, throw the same exception it does when you go outside that allowance.
Diffstat (limited to 'src/System.Private.Reflection.Execution')
-rw-r--r--src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs7
-rw-r--r--src/System.Private.Reflection.Execution/src/Resources/Strings.resx7
2 files changed, 11 insertions, 3 deletions
diff --git a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
index 895f7651b..8c314929d 100644
--- a/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
+++ b/src/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
@@ -268,9 +268,14 @@ namespace Internal.Reflection.Execution
return false;
}
+ if (rank == 1)
+ {
+ throw new PlatformNotSupportedException(SR.PlatformNotSupported_NoMultiDims_Rank1);
+ }
+
if ((rank < MDArray.MinRank) || (rank > MDArray.MaxRank))
{
- throw new PlatformNotSupportedException(SR.Format(SR.PlatformNotSupported_NoMultiDims, rank));
+ throw new TypeLoadException(SR.Format(SR.MultiDim_Of_This_Rank_Not_Supported, rank));
}
return TypeLoaderEnvironment.Instance.TryGetArrayTypeForElementType(elementTypeHandle, true, rank, out arrayTypeHandle);
diff --git a/src/System.Private.Reflection.Execution/src/Resources/Strings.resx b/src/System.Private.Reflection.Execution/src/Resources/Strings.resx
index 905717d33..10bd0a418 100644
--- a/src/System.Private.Reflection.Execution/src/Resources/Strings.resx
+++ b/src/System.Private.Reflection.Execution/src/Resources/Strings.resx
@@ -174,8 +174,11 @@
<data name="MissingConstructor_Name" xml:space="preserve">
<value>Constructor on type '{0}' not found.</value>
</data>
- <data name="PlatformNotSupported_NoMultiDims" xml:space="preserve">
- <value>Multidimensional arrays of rank {0} are not supported on this runtime.</value>
+ <data name="PlatformNotSupported_NoMultiDims_Rank1" xml:space="preserve">
+ <value>Multidimensional arrays of rank 1 are not supported on this runtime.</value>
+ </data>
+ <data name="MultiDim_Of_This_Rank_Not_Supported" xml:space="preserve">
+ <value>Multidimensional arrays of rank {0} are not supported.</value>
</data>
<data name="Object_NotInvokable" xml:space="preserve">
<value>This object cannot be invoked because it was metadata-enabled for browsing only: '{0}' For more information, please visit http://go.microsoft.com/fwlink/?LinkID=616867</value>