-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting "Method reference is used with definition return type / parameter." / Due to TypeForwardedTo type #359
Comments
I tried to investigate further and trail gone cold in RepackImporter.cs:50 at Import(ExportedType type, Collection<ExportedType> col, ModuleDefinition module) Type forwards are processed there, but IMHO incorrectly. |
we can remove Microsoft.Extensions.Logging.Configuration from tests to minimize the repro |
if I remove that continue statement, I no longer get the warning about ILoggingBuilder |
With better diagnostic message I have found and fixed most on these warning, but not all. One is left:
of course |
Unfortunately I can't just isolate this case as a small set of assemblies. But I found that if I move this code a little lower, the problem disappears: It is unable match/map They are not matching due to rename of anonymous type Both assemblies (maybe even more that 2) have |
can you send me your full list of assemblies so I can debug too? |
I can't send you all my libraries because it is private project. But I'm trying to create minimal repro: I have 2 types: both have default After merge I get one merged type with only ONE constructor. My thoughts it is breaking behavior. I'm still working on minimal repro. |
Also I have found that
|
It's taking too much time to reproduce these circumstances. |
@deniszykov @KirillOsenkov Hi guys. I met the same issue with TypeForwardingTo and Microsoft.Extensions.Logging library. |
A small self-contained repro would help here |
Ok, let me work on it. |
Here it is, please follow the readme: @KirillOsenkov Thanks for your help! |
@KirillOsenkov Did you have a chance to test the issue? |
I hope I'll have time this weekend |
Hi @KirillOsenkov. Any updates? |
Please give the latest commit a try (I haven't published a new version of the NuGet package yet) |
This is a great fix, thank you for your help! |
Issue:
I'm getting following warning message:
Because
ReferenceFixator
is failing to map declaring type ofILoggingBuilder::get_Services()
method in ReferenceFixator.cs: 436and it is failing because
TypeReference.Scope
formethod.DeclaringType
is Microsoft.Extensions.Logging while type is declared in Microsoft.Extensions.Logging.Abstractions and being forwarded:Steps to reproduce:
libs.zip
Expected:
Type forwarding is respected. Probably type is registered twice in
MappingHandler
with both scopes when it is forwarded.The text was updated successfully, but these errors were encountered: