Skip to content

Quotation string matching fails? #19527

Closed

Description

@Thorium

I'm trying to build an old project with new VS, it throws compile time error:

error FS0452: Quotations cannot contain inline assembly code or pattern matching on arrays

There is a <@@ match x with ... @@> over x (a string, which is a char-array). Is this intended behaviour now?

Expected behavior

Should compile

Actual behavior

Fails

Related information

Provide any related information (optional):

  • Operating system Win 11
  • .NET Runtime 10.0.201
  • Editing Tools VS2026 18.4.2

Edit: Workaround: Use if instead of match.

Activity

  1. added theissue type on Mar 31, 2026
  2. added this to the Backlog milestone on Mar 31, 2026
  3. T-Gro commented on Mar 31, 2026

    @T-Gro
    Member

    Oh, I think this might be caused by a new optimization doing "" match not via .Equals, but rather via .Length check.
    And the quotation translator refuses that - but this pattern (.Length = 0) should be workable.

    Just to confirm: Is there a "" in the hidden ... part of your match?

  4. added
    Area-Quotations
    and removed on Mar 31, 2026
  5. Thorium commented on Mar 31, 2026

    @Thorium
    ContributorAuthor

    Yes, there was two cases, the first one being "" and the other was anything else.

  6. pezipink commented on Apr 1, 2026

    @pezipink
    Contributor

    Confirm, I have this issue in a ton of places when trying to use VS2026, our team won't be able to upgrade with this issue.

  7. smoothdeveloper commented on May 29, 2026

    @smoothdeveloper
    Contributor

    Could it be related to #19189?

  8. T-Gro commented on May 29, 2026

    @T-Gro
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-QuotationsBug

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions