dotnet / dotnet/fsharp

Atomic list index syntax is marked as NonAtomic

Open
#12,309 3 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-Syntax Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

I'm not entirely sure but when I have the following code:

```fsharp
let y = [ 0; 2; 4 ][1]
```

I get
```fsharp
App
(NonAtomic, false,
ArrayOrListComputed
(false,
Sequential
(SuppressNeither, true,
Const (Int32 0, tmp.fsx (1,10--1,11)),
Sequential
(SuppressNeither, true,
Const (Int32 2, tmp.fsx (1,13--1,14)),
Const (Int32 4, tmp.fsx (1,16--1,17)),
tmp.fsx (1,13--1,17)), tmp.fsx (1,10--1,17)),
tmp.fsx (1,8--1,19)),
ArrayOrListComputed
(false, Const (Int32 1, tmp.fsx (1,20--1,21)),
tmp.fsx (1,19--1,22)), tmp.fsx (1,8--1,22))
```

**Expected behavior**

I was expecting `App(Atomic, false, ...)`

**Actual behavior**

The`SynExpr.App` contains `NonAtomic` while inside fsi I get:

![image](https://user-images.githubusercontent.com/2621499/139197734-acce8ee0-4c9a-4fbf-b636-c80f01dbf191.png)

**Known workarounds**

/

**Related information**

Provide any related information (optional):

FCS 41.0.0-preview.21472.3

//cc @dsyme

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.