Bug 52664 - [generator] Deriving from certain protocol interfaces causes the generator to throw a BI0000: NullReferenceException
Summary: [generator] Deriving from certain protocol interfaces causes the generator to...
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.3
Assignee: Alex Soto [MSFT]
Depends on:
Reported: 2017-02-22 12:04 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-06-13 13:10 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rolf Bjarne Kvinge [MSFT] 2017-02-22 12:04:46 UTC
Test case:

using Foundation;
using UIKit;
namespace X {
    [Protocol] interface C89 : INSTextLayoutOrientationProvider {}
    [Protocol] interface C268 : IUIViewControllerPreviewing {}
    [Protocol] [BaseType (typeof (NSObject))] interface M89 : INSTextLayoutOrientationProvider {}
    [Protocol] [BaseType (typeof (NSObject))] interface M268 : IUIViewControllerPreviewing {}
Comment 1 Rolf Bjarne Kvinge [MSFT] 2017-02-22 12:05:19 UTC

error BI0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.NullReferenceException: Object reference not set to an instance of an object
  at Generator.GetSetterExportAttribute (System.Reflection.PropertyInfo pinfo) [0x0002e] in /work/maccore/master/xamarin-macios/src/generator.cs:1981 
  at Generator.Go () [0x007e3] in /work/maccore/master/xamarin-macios/src/generator.cs:2162 
  at BindingTouch.Main2 (System.String[] args) [0x010b2] in /work/maccore/master/xamarin-macios/src/btouch.cs:435 
  at BindingTouch.Main (System.String[] args) [0x0001d] in /work/maccore/master/xamarin-macios/src/btouch.cs:77 
  at System.Environment.get_StackTrace () [0x00000] in /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System/Environment.cs:321 
  at ErrorHelper.ShowInternal (System.Exception e) [0x000dc] in /work/maccore/master/xamarin-macios/src/error.cs:200 
  at ErrorHelper.Show (System.Exception e) [0x00027] in /work/maccore/master/xamarin-macios/src/error.cs:151 
  at BindingTouch.Main (System.String[] args) [0x0002b] in /work/maccore/master/xamarin-macios/src/btouch.cs:79
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-02-22 15:54:36 UTC
This can be reverted when this bug is fixed: https://github.com/xamarin/xamarin-macios/pull/1745/commits/9f036b218a7246822000488695f0edd0e43c4778
Comment 3 Alex Soto [MSFT] 2017-05-24 19:57:24 UTC
PR: https://github.com/xamarin/xamarin-macios/pull/2131
Comment 4 Alex Soto [MSFT] 2017-05-25 19:45:36 UTC
PR merged in xamarin-macios/master @ 43e220df7fbea8e438b8a0ce422a0c283120b62e
Comment 5 Neha Kharbade 2017-06-05 09:53:39 UTC
Hello @Rolf Bjarne Kvinge,
Can you please provide me proper steps or description for verify this bug with expectation.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2017-06-13 13:10:11 UTC
A unit test case was committed when this was fixed; there's no need for QA to verify anything.