Skip to content

Specified type is not checked for use! binding #19005

Closed

Description

@DedSec256

Repro:

async {
    use! x: askjdhaskjd = failwith ""
    return 5
}

The type askjdhaskjd does not exist, but the code compiles successfully, and there are no errors in the editor.

Image

.NET SDK 10.0.100-rc.2

Activity

  1. added theissue type on Oct 15, 2025
  2. added this to the Backlog milestone on Oct 15, 2025
  3. edgarfgp commented on Oct 15, 2025

    @edgarfgp
    Contributor

    I can have a look at this during the week if you have not already fixed :).

  4. changed the title [-]Specified type does not checked for use! binding[/-] [+]Specified type is not checked for use! binding[/+] on Oct 15, 2025
  5. DedSec256 commented on Oct 15, 2025

    @DedSec256
    ContributorAuthor

    @edgarfgp I don't have a ready fix. For now, it's only clear that the return type info is not checked in any way for let! / use!. The type checking logic was only for pattern annotation and only for let!, because previously it was impossible to specify a type for use!. At the same time, the problem for let! is not reproducible only because previously there was type checking logic for pattern annotation, and now binding annotation is transformed to pattern annotation (more information here #19004). After the fixes in #19004, the specified type will also not be checked for let! because this logic never existed and it was not added with new-added annotations syntax for let! / use! bindings

  6. added
    Area-Compiler-CheckingType checking, attributes and all aspects of logic checking
    Area-ComputationExpressionsEnd-to-end experience for computation expressions (except async and state machine compilation)
    and removed on Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingArea-ComputationExpressionsEnd-to-end experience for computation expressions (except async and state machine compilation)Bug

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions