I’d like to get some opinions on an alternative syntax for singleton types.

### Status quo

At the moment we have a different syntax to describe literals and stable paths:

```
val c: 1 = 1
val z: x.y.type = x.y
```

though the distinction strikes me as a bit arbitrary. Furthermore, the common case of a path dependency on some parameter is rather verbose (e.g. `x.type`

).

### Proposal

I would like to propose an alternative syntax for singleton types that is both uniform and concise: If we parse a type `T`

of the form `'{' expr '}'`

and the type of `expr`

before widening is stable, then `T`

may be used as a singleton type.

For instance, the above example would become more consistent and (arguably) slightly more legible:

```
val c: {1} = 1
val z: {x.y} = x.y
```

Besides the uniformity I like this syntax for having intuitive semantics: as types, `{1}`

and `{x.y}`

correspond to the singleton sets of their underlying expressions, `1`

and `x.y`

.

My original motivation was to come up with an alternative syntax that’s also pleasant when dealing with more complex singletons. In a recent Dotty PR (#3887) I propose changes to the type checker that would allow paths to include applications of pure methods, e.g. `x + 1`

. The examples in that PR’s tests illustrate the syntax a bit more, for instance:

```
val x = 1
val y: {x} = x
implicitly[{x + 1} =:= {y + 1}]
```

The implementation of the proposed syntax is included in the PR and turns out to be rather straightforward.