-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Assertion at /Users/runner/work/1/s/src/mono/mono/metadata/class-setup-vtable.c:1007, condition `is_ok (error)' not met, function:apply_override, VAR 1 (V) cannot be expanded in this context with 1 instantiations #70190
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: Issue DetailsDescriptionWhen I'm trying to run my CLI project, I get this error thrown by Mono when it's loading my code. It gets thrown with both .NET 6 and 7 (preview 4), and my code works fine when I run it without Mono. In the past, I was blocked by a similar issue (#61244), and while that issue has since been fixed, this new one is coming up. I was able to determine a pretty simple reproduction example, and it's very similar to that other issue I just linked to, though definitely different (or maybe that previous bug was only partially fixed?), since I'm no longer seeing that previous issue occur. Also, I need to run my project with Mono because it's currently a functioning CLI application (when run without Mono) but I'm trying to eventually turn it into a Blazor WASM application. It seems to occur when: One interface defines a method; a second interface, which is a child of the first and has at least one generic type variable, gives that method a default implementation; a third class/interface, which is a child of the second, overrides that default implementation with a different default implementation, has more generic type variables than the parent/second interface, and has its last generic type variable being passed to one of the parent/second interface's generic type variables. Reproduction StepsTry to run the following C# code with Mono:
I added these lines (inside a PropertyGroup) to my project's .csproj file to get it to run with Mono:
Expected behaviorCode runs successfully Actual behaviorAssertion at /Users/runner/work/1/s/src/mono/mono/metadata/class-setup-vtable.c:1007, condition `is_ok (error)' not met, function:apply_override, VAR 1 (V) cannot be expanded in this context with 1 instantiations This error gets thrown and aborts execution. Regression?No response Known WorkaroundsNo response Configuration.NET Version: .NET 6 or .NET 7 (Preview 4) Other informationSeems very similar to but is not the same as #61244
|
cc @lambdageek |
Moving to 8.0.0 milestone, and will consider a backport to earlier release ff the fix isn't risky cc @vargaz |
working on this one... |
…verrides (#74379) Due to rearranging the logic in #64102 we already inflated the interfaces that are generic instances. Inflating again is wrong and will use the wrong generic context. * use member access, not type punning * Add regression test for #70190 * Assert that overrides are already inflated how we expect * remove unused var * Remove one more inflate, there's nothing to do In #64102 (comment) we concluded that this branch is never taken. * Add link to issue for failing tests
…applying DIM overrides (#74519) * do we need to inflate here? it seems like we always get the right class * use member access, not type punning * Add regression test for #70190 * Assert code from #64102 is unreachable In #64102 (comment) we concluded that this branch is never taken. * Assert that overrides are already inflated how we expect * try to enable some disabled DIM tests * remove unused var * Don't assert - code is reachable, there's just nothing to do * Add link to issue for failing tests Co-authored-by: Aleksey Kliger <alklig@microsoft.com> Co-authored-by: Aleksey Kliger <aleksey@lambdageek.org>
Description
When I'm trying to run my CLI project, I get this error thrown by Mono when it's loading my code. It gets thrown with both .NET 6 and 7 (preview 4), and my code works fine when I run it without Mono. In the past, I was blocked by a similar issue (#61244), and while that issue has since been fixed, this new one is coming up. I was able to determine a pretty simple reproduction example, and it's very similar to that other issue I just linked to, though definitely different (or maybe that previous bug was only partially fixed?), since I'm no longer seeing that previous issue occur. Also, I need to run my project with Mono because it's currently a functioning CLI application (when run without Mono) but I'm trying to eventually turn it into a Blazor WASM application.
It seems to occur when: One interface defines a method; a second interface, which is a child of the first and has at least one generic type variable, gives that method a default implementation; a third class/interface, which is a child of the second, overrides that default implementation with a different default implementation, has more generic type variables than the parent/second interface, and has its last generic type variable being passed to one of the parent/second interface's generic type variables.
Reproduction Steps
Try to run the following C# code with Mono:
I added these lines (inside a PropertyGroup) to my project's .csproj file to get it to run with Mono:
Expected behavior
Code runs successfully
Actual behavior
Assertion at /Users/runner/work/1/s/src/mono/mono/metadata/class-setup-vtable.c:1007, condition `is_ok (error)' not met, function:apply_override, VAR 1 (V) cannot be expanded in this context with 1 instantiations
This error gets thrown and aborts execution.
Regression?
No response
Known Workarounds
No response
Configuration
.NET Version: .NET 6 or .NET 7 (Preview 4)
OS: macOS Monterey
Architecture: x64
I don't think it's specific to this configuration
Issue appears in all browsers (when I try to reference my existing code from the sample Blazor WASM project)
Other information
Seems very similar to but is not the same as #61244
The text was updated successfully, but these errors were encountered: