From 990842ea3fd07e5ab61d5deeac392ba5a983d4e3 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Fri, 22 Sep 2017 01:14:43 -0400 Subject: [PATCH] [tests] Fix linksdk WebKit_NSProxy test. Fixes #59671 (#2746) In release (optimize) mode the compiler would eliminate the unused > var t = typeof (WKWebView); which means the linker would never see `WKWebView`, which in turns removed `NSProxy`. Original bug: https://bugzilla.xamarin.com/show_bug.cgi?id=59247 Original PR: https://github.com/xamarin/xamarin-macios/pull/2732 https://bugzilla.xamarin.com/show_bug.cgi?id=59671 --- tests/linker-ios/link sdk/LinkSdkRegressionTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs b/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs index 7f4c6e15d5..e49b2bfc85 100644 --- a/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs +++ b/tests/linker-ios/link sdk/LinkSdkRegressionTest.cs @@ -1057,6 +1057,7 @@ namespace LinkSdk { { // a reference to WKWebView will bring the internal NSProxy type var t = typeof (WKWebView); + Assert.NotNull (t, "avoid compiler optimization of unused variable"); var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Foundation.NSProxy"); Assert.NotNull (Type.GetType (fqn), fqn); }