Bug 9545 - Explicitly implement an interface method with weaker type parameter constraint
Summary: Explicitly implement an interface method with weaker type parameter constraint
Status: CONFIRMED
Alias: None
Product: Runtime
Classification: Mono
Component: Verifier (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-01-14 08:16 UTC by Marek Safar
Modified: 2017-10-04 06:02 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
test (3.00 KB, application/x-msdownload)
2013-01-14 08:16 UTC, Marek Safar
Details

Description Marek Safar 2013-01-14 08:16:47 UTC
Created attachment 3211 [details]
test

.NET

Unhandled Exception: System.TypeLoadException: Method 'IA.f' on type 'A' from as
sembly 'test-996, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' tried t
o explicitly implement an interface method with weaker type parameter constraint
s.

Mono
<nothing>
Comment 1 Rodrigo Kumpera 2013-05-02 08:22:11 UTC
Ouch! This one is really really hard.

How do I check if a given set of constraints is weaker than another?
Comment 2 Marek Safar 2013-05-02 08:44:07 UTC
Yeah.

I think by weaker they mean is not as restrictive as the other type parameter which is quite simple for non-inflated versions (you just match set of ifaces+base type) but it's more complicated for inflated type parameters. C# implementation is in TypeParameterSpec::HasSameConstraintsImplementation and it should match to runtime checks and vice versa I think.
Comment 3 Rodrigo Kumpera 2017-10-03 20:07:30 UTC
This is really really complex and virtual generic method constraints are contravariant.

I'm moving this down to enhancement as it would be a huge time sink to implement it.

Note You need to log in before you can comment on or make changes to this bug.