Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ijklam opened this issue Dec 19, 2024 · 2 comments
Open

Comments

@ijklam
Copy link
Contributor

ijklam commented Dec 19, 2024

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

Repro steps

Enter this code in fsi:

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

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
@github-actions github-actions bot added this to the Backlog milestone Dec 19, 2024
@ijklam ijklam changed the title byref parameters with non-ASCII identifiers cannot be set. byref parameters with starting with some non-ASCII identifiers cannot be set. Dec 19, 2024
@ijklam ijklam changed the title byref parameters with starting with some non-ASCII identifiers cannot be set. byref parameters starting with some non-ASCII identifiers cannot be set. Dec 19, 2024
@ijklam
Copy link
Contributor Author

ijklam commented Dec 20, 2024

Update: Even the capital-letter-leading byref parameters are considered as immutable. Is this by designed?

Image

It seems that this is because these functions are firstly be parsed to a lambda with a match rather than a normal lambda.

let f2 (叉: int byref) = 叉 <- 1;;
Image

let f2 (a: int byref) = a <- 1;;
Image

@brianrourkeboll
Copy link
Contributor

That seems pretty unlikely to me to be by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

2 participants