Commit 5a95228
authored
Suppress warning about
When using `try #require()` to unwrap an optional value, we emit a
compile-time warning if the value is not actually optional. However,
there is a bug in the type checker
(swiftlang/swift#79202) that triggers a false
positive when downcasting an object (of `class` type), e.g.:
```swift
class Animal {}
class Duck: Animal {}
let beast: Animal = Duck()
let definitelyADuck = try #require(beast as? Duck)
// #require(nonOptional) in some cases. (#947)1 parent 6a49142 commit 5a95228
File tree
2 files changed
+33
-0
lines changed- Sources/TestingMacros
- Tests/TestingMacrosTests
2 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
327 | 343 | | |
| 344 | + | |
328 | 345 | | |
329 | 346 | | |
330 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
355 | 371 | | |
356 | 372 | | |
357 | 373 | | |
| |||
0 commit comments