Skip to content

Generalized async return VerificationException #21500

@palladin

Description

@palladin

Version Used:
C# 7 using .net framework 4.5.2
Steps to Reproduce:

  1. Create a custom async method builder
    [AsyncMethodBuilder(typeof(CustomMethodBuilder<>))]

Implement AwaitOnCompleted, AwaitUnsafeOnCompleted with a custom interface like
where TAwaiter : IFoo
3.
try to await an awaiter that doesn't implement IFoo

Expected Behavior:
Compile error

Actual Behavior:
---- System.Security.VerificationException : Method Eff.Core.CustomMethodBuilder1[System.Int32].AwaitUnsafeOnCompleted: type argument 'MyTestType1[System.Int32]' violates the constraint of type parameter 'TAwaiter'.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions