Files
swift-mirror/test/StringProcessing/Sema/Inputs/dummy.swift
Hamish Knight c56ea461b6 [Sema] Add fix-it to import RegexBuilder
For code such as the following:

```
let r = Regex {
  /abc/
}
```

If RegexBuilder has not been imported, emit a
specialized diagnostic and fix-it to add
`import RegexBuilder` to the file.

Unfortunately we're currently prevented from
emitting the specialized diagnostic in cases where
the builder contains references to RegexBuilder
types, such as:

```
let r = Regex {
  Capture {
    /abc/
  }
}
```

This is due to the fact that we bail from CSGen
due to the reference to `Capture` being turned
into an `ErrorExpr`. We ought to be able to
handle solving in the presence of such errors, but
for now I'm leaving it as future work.

rdar://93176036
2022-06-28 11:38:41 +01:00

2 lines
1 B
Swift