Bug 43400

Summary: "using static" dependent on compile order
Product: [Mono] Compilers Reporter: yufeih
Component: C#Assignee: Marek Safar <masafa>
Severity: normal CC: david, mono-bugs+mono
Priority: ---    
Version: 4.4.2 (C7SR1)   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description yufeih 2016-08-16 01:39:53 UTC
Originally posted here: http://forums.xamarin.com/discussion/73275/xamarin-ios-compiler-bug-with-using-static

Here is the repo project: https://github.com/yufeih/xamarin_ios_using_static_bug/tree/master
It compiles in visual studio. But xamarin studio on mac produces the following error:
Error CS0117: `Nine.UI.BuggyLayoutBuilder<int>' does not contain a definition for `Dock' (CS0117) (using_static_bug)
This only occurs when:
The class is a generic class
A "using static" statement is declared
The source file order in csproj matters. In the repro project, Buggy.cs is declared before AppDelegate.cs, if you swap the order of these 2 files, the error goes away.
Detailed xamarin version:
Xamarin Studio Community
Version 6.0.2 (build 73)
Installation UUID: 1ba755cf-c07b-494e-9378-97ad60ccfdb3
    Mono 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 404020011

Not Installed

Apple Developer Tools
Xcode 7.3.1 (10188.1)
Build 7D1014

Version: (Xamarin Studio Community)
Hash: f37444a
Branch: cycle7-sr1
Build date: 2016-07-28 12:17:02-0400

Version: (Xamarin Studio Community)

Not Installed

Xamarin Android Player
Not Installed

Build Information
Release ID: 600020073
Git revision: a6f7a24a9723a2d4f5d33c176615b0d44703ab5b
Build date: 2016-07-26 13:36:15-04
Xamarin addins: f5acb37866a0141bc5ddbe95118f18dae4014568
Build lane: monodevelop-lion-cycle7-sr1

Operating System
Mac OS X 10.11.6
Darwin  15.6.0 Darwin Kernel Version 15.6.0
    Thu Jun 23 18:25:34 PDT 2016
    root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
Comment 1 Marek Safar 2016-08-16 12:13:03 UTC
Fixed in master and Mono 4.6