Bug 411089

Summary: [GMCS] Expected compilation error when assembly A references only assembly B, which has a class that implements an interface in assembly C
Product: [Mono] Mono: Compilers Reporter: Mike Voorhees <Vernish13>
Component: C#Assignee: Marek Safar <msafar>
Status: RESOLVED FIXED QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None    
Version: SVN   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 543537    
Bug Blocks:    
Attachments: Here are the .cs files used.

Description Mike Voorhees 2008-07-21 21:51:21 UTC
gmcs allows compilation of an assembly, A, which references B and B references assembly C. A declares a class that is in B.  B has a class that implements an interface in assembly C.

To reproduce compile the attached files with these command line arguments:

bash-3.00$ gmcs -t:library LibOne.cs
bash-3.00$ gmcs -t:library LibTwo.cs -r:LibOne.dll
bash-3.00$ gmcs Program.cs -r:LibTwo.dll
Compilation succeeded - 1 warning(s)
bash-3.00$

The output from using csc is:

>csc -t:library LibOne.cs
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.


>csc -t:library LibTwo.cs -r:LibOne.dll
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.


>csc Program.cs -r:LibTwo.dll
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

Program.cs(11,4): error CS0012: The type 'LibraryOne.A' is defined in an
        assembly that is not referenced. You must add a reference to assembly
        'LibOne, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
LibTwo.dll: (Location of symbol related to previous error)
Comment 1 Mike Voorhees 2008-07-21 21:52:43 UTC
Created attachment 229184 [details]
Here are the .cs files used.
Comment 2 Marek Safar 2011-01-12 10:31:09 UTC
Fixed in master