Bugzilla – Bug 411089
[GMCS] Expected compilation error when assembly A references only assembly B, which has a class that implements an interface in assembly C
Last modified: 2011-01-12 10:31:09 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)
Created attachment 229184 [details] Here are the .cs files used.
Fixed in master