Bug 411089 - [GMCS] Expected compilation error when assembly A references only assembly B, which has a class that implements an interface in assembly C
Summary: [GMCS] Expected compilation error when assembly A references only assembly B,...
Status: RESOLVED FIXED
Alias: None
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: SVN
Hardware: All All
: P5 - None : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on: 543537
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-21 21:51 UTC by Mike Voorhees
Modified: 2011-01-12 10:31 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Here are the .cs files used. (732 bytes, application/zip)
2008-07-21 21:52 UTC, Mike Voorhees
Details

Note You need to log in before you can comment on or make changes to this bug.
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