Bug 27279 - Xamarin.iOS assembly contains global namespace Utils causing clashes with user code
Summary: Xamarin.iOS assembly contains global namespace Utils causing clashes with use...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 4.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-02-21 13:06 UTC by kalita
Modified: 2015-02-23 05:52 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description kalita 2015-02-21 13:06:12 UTC
This causes conflicts with user-defined classes or namespaces that are called Utils (a fairly common name).

For example, this will not compile:

// File 1
namespace Library
{
  class Utils
  {
    public static void Func1()
    {
    }
  }
} 

// File 2
using Library;

namespace App
{
  class Class
  {
    void Func2()
    {
      Utils.Func1();  // Error because Library.Utils clashes with global Utils defined in Xamarin.iOS. There is a misleading error message (The type or namespace name `Func1' does not exist in the namespace `Utils')
      Library.Utils.Func1();     // This works
    }
  }
}

I think Xamarin libraries should not define any internal globally-scoped names that may clash with user identifiers.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-02-23 05:52:08 UTC
Fixed.

maccore/master: 56b88e23dc7da6fef18da193972bb20c3ee54660