dotnet / dotnet/fsharp

`byref` parameters starting with some non-ASCII identifiers cannot be set.

Open
#18,164 13 comments 1 reaction 0 assignees View on GitHub
Bug help wanted Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

`byref` parameters whose identifier starting with some non-ASCII (like Chinese characters) cannot be set.

**Repro steps**

Enter this code in fsi:

```fsharp
let f (x: int byref) = x <- x + 1
let f3 (a叉: int byref) = a叉 <- a叉 + 1
let f2 (叉: int byref) = 叉 <- 叉 + 1 // fails to compile
let f4 (叉a: int byref) = 叉a <- 叉a + 1 // fails to compile
```

**Expected behavior**

The code can be compiled successfully

**Actual behavior**

A `FS0027` was thrown.

![Image](https://github.com/user-attachments/assets/1eaf41a9-66de-4f2e-b6b3-3cd6ac92a39c)

**Known workarounds**

Don't use non-ASCII identifiers.

**Related information**

Provide any related information (optional):

* Windows 11 23H2
* .NET 9 with F#9
* Editing Tools: fsi or ionide-vscode

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.