xamarin-macios/tests/linker-ios/link all
Rolf Bjarne Kvinge 706d0e09d7 [registrar] Store the attribute type separately for availability attributes saved for the registrar. (#2807) (#2838)
The registrar requires the availability attributes to work properly, which is
non-trivial when the linker is being used, because the linker runs before the
registrar, and will remove availability attributes.

For this reason we store the availability attributes separately when the
linker removes them so that the registrar can still find them, but
unfortunately it's not enough to store the CustomAttribute instance, because
it may end up crippled: if the attribute type itself is removed by the linker,
then it's not possible to get the attribute type from the CustomAttribute
instance, because 'attribute.Constructor.DeclaringType' returns null (the
linker sets the declaring type of the constructor to null).

Solution: store the attribute type separately; now we use a Tuple of
CustomAttribute and TypeReference.

Fixes this ugly exception:

    System.NullReferenceException: Object reference not set to an instance of an object
      at XamCore.Registrar.Registrar.RegisterAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00146] in /work/maccore/master/xamarin-macios/src/ObjCRuntime/Registrar.cs:2316
      at XamCore.Registrar.StaticRegistrar.Generate (System.Collections.Generic.IEnumerable`1[T] assemblies, System.String header_path, System.String source_path) [0x00035] in /work/maccore/master/xamarin-macios/tools/common/StaticRegistrar.cs:4197
      at Xamarin.Bundler.RunRegistrarTask.Execute () [0x00001] in /work/maccore/master/xamarin-macios/tools/mtouch/BuildTasks.mtouch.cs:154
2017-10-04 10:42:09 -05:00
..
AppDelegate.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
AttributeTest.cs Bump mono to include fix for #47064: [linker] Fix marking types inside custom attributes. (#1376) 2016-12-21 11:52:43 +01:00
CalendarTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
ClassLayoutTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
DataContractTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
Info.plist [tests] Remove Classic test projects, and make the Unified test projects the master projects. (#858) 2016-09-21 22:55:10 +02:00
InterfacesTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
InternalsTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
LinkAllTest.cs [registrar] Store the attribute type separately for availability attributes saved for the registrar. (#2807) (#2838) 2017-10-04 10:42:09 -05:00
LinqExpressionTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
MEFTests.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
Main.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
PreserveTest.cs [linker] Preserve smart enum conversion methods when needed. 2017-09-26 16:14:42 +02:00
SealerTest.cs [linker] Ensure we do not devirtualize methods that needs to be called from a base class to satisfy an interface. Fixes #34308 (#675) 2016-08-26 08:17:01 -04:00
SerializationTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
StructLayoutTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
XmlSerializationTest.cs [tests] Move linker tests from maccore (#69) 2016-05-20 14:07:34 -04:00
link all.csproj [tests] Fix bug 57699 - [iOS]InternalsTest failure (Linkall) tests on device (#2243) 2017-06-22 17:04:40 -05:00