Commit 6d7ba9a
committed
Improve nothrow analysis of :new with missing sparam
Similar to #46693, but for :new, rather than getfield.
Unfortunately, this is somewhat limited as we don't really
have the ability to encode type equality constraints in the
lattice. In particular, it would be nice to analyze:
```
struct Foo{T}
x::T
Foo(x::T) where {T} = new{T}(x)
end
```
and be able to prove this nothrow. If it's really
important, we could probably pattern match it, but
for the moment, this is not easy to do. Nevertheless,
we can do something about the similar, but simpler pattern
```
struct Foo{T}
x
Foo(x::T) where {T} = new{T}(x)
end
```
which is what this PR does.1 parent f7dea04 commit 6d7ba9a
2 files changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
262 | 271 | | |
263 | 272 | | |
264 | 273 | | |
265 | 274 | | |
266 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
267 | 282 | | |
268 | 283 | | |
269 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
0 commit comments