Add tests cover using statement difference between mcs and csc. #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@marek-safar I could use your opinion on whether or not you think this is a bug in the linker.
This PR contains just tests to reproduce what I think is a bug. I did not implement a fix yet. I wanted to confirm whether or not you think it is a bug before I spend time on a fix.
AssemblyOnlyUsedByUsingWithCsc
is the test that currently fails and I think it should pass.What it does is
Compile an assembly called
library.dll
Compile an assembly called
copied.dll
that makes use oflibrary.dll
with only the following codeAnd
copied.dll
is setup to haveAssemblyAction.Copy
And most importantly, compile
copied.dll
withcsc
Note that
csc
will include a reference tolibrary.dll
incopied.dll
where asmcs
will not.AssemblyOnlyUsedByUsingWithCsc
fails because I have an assert expecting thatlibrary.dll
survives stripping. I think this is a valid assertion given thatcopied.dll
referenceslibrary.dll
andcopied.dll
hadAssemblyAction.Copy
.It seems to me that there is a bug in that references of an assembly with AssemblyAction.Copy should always exist after stripping, even if they've been stripped down to empty assemblies. Would you agree? What are your thoughts?
Note that I added the test
AssemblyOnlyUsedByUsingWithMcs
just to show what happens withmcs
. This test passes.