Skip to content

Exception thrown then generating runtime type for private interface #9

Description

@JSkimming

Generic methods that have private interface constraints are resulting on the following exception when trying to generate the runtime type.

This does not result in a decent error message, and prevents all the tests from executing.

System.InvalidOperationException
An exception was thrown while getting data for theory AutoTest.ExampleLibrary.Issues.Issue009.Issue009.TestNullArguments:
System.TypeLoadException is attempting to implement an inaccessible interface.: Type 'T_Dynamic_99c3a9e895934e578acbe36e46206079' from assembly 'TypesMapping_08ce31c0455c43d2965342b1ae176fc0, Version=0.5.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
at System.Reflection.Emit.TypeBuilder.CreateType()
at AutoTest.ArgNullEx.GenericTypeConversion.GenerateRuntimeType(Type genericType) in c:\git\AutoTest.ArgumentNullException\src\AutoTest.ArgumentNullException\GenericTypeConversion.cs:line 182
at AutoTest.ArgNullEx.GenericTypeConversion.GetNonGenericType(Type genericType) in c:\git\AutoTest.ArgumentNullException\src\AutoTest.ArgumentNullException\GenericTypeConversion.cs:line 88
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at AutoTest.ArgNullEx.Filter.MethodFiltering.ConvertGenericMethod(MethodBase method) in c:\git\AutoTest.ArgumentNullException\src\AutoTest.ArgumentNullException\Filter\MethodFiltering.cs:line 59
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at AutoTest.ArgNullEx.Filter.MethodFiltering.GetMethods(Type type, BindingFlags bindingAttr, IEnumerable`1 filters) in c:\git\AutoTest.ArgumentNullException\src\AutoTest.ArgumentNullException\Filter\MethodFiltering.cs:line 37
at AutoTest.ArgNullEx.ArgumentNullExceptionFixture.<GetData>b__2(Type type) in c:\git\AutoTest.ArgumentNullException\src\AutoTest.ArgumentNullException\ArgumentNullExceptionFixture.cs:line 154
at System.Linq.Enumerable.<SelectManyIterator>d__31`3.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__31`3.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Xunit.Extensions.TheoryAttribute.<GetData>d__7.MoveNext()
at Xunit.Extensions.TheoryAttribute.EnumerateTestCommands(IMethodInfo method)
at Xunit.Extensions.TheoryAttribute.<>c__DisplayClass5.<EnumerateTestCommands>b__1()
at Xunit.Extensions.TheoryAttribute.LambdaTestCommand.Execute(Object testClass)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions