Skip to content

text.find doesn't find Nat literals in pattern match #6073

@ceedubs

Description

@ceedubs

Describe and demonstrate the bug

It seems to work on Nat literals that are in other places and on Text literals in pattern matches, but not on Nat literals on the left side of a pattern match.

``` ucm
> builtins.merge

  Done.
```

``` unison
openSesame : Nat -> Text
openSesame = cases
  230971246918247 -> "You guessed the password!"
  _ -> "Try again."
```

``` ucm :added-by-ucm
  Loading changes detected in scratch.u.

  + openSesame : Nat -> Text

  Run `update` to apply these changes to your codebase.
```

``` ucm
> update
> text.find "230971246918247"
```

🛑

The transcript failed due to an error in the stanza above. The error is:

``` 
😶 I couldn't find any matches.

Tip: `text.find.all` will search `lib` as well.
```

Environment (please complete the following information):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions