fix and optimize erroneous code paths#58
Conversation
Co-authored-by: Sebastian Pfitzner <pfitzseb@gmail.com>
c42f
left a comment
There was a problem hiding this comment.
This looks great, thanks. Feel free to merge it!
| else | ||
| print(io, node.val isa Symbol ? string(node.val) : repr(node.val)) | ||
| val = node.val | ||
| print(io, val isa Symbol ? string(val) : repr(val)) |
There was a problem hiding this comment.
I'm curious - is this stylistic or does it do something more?
Ah wait I think I see - this allows inference to prove that val::Symbol inside the first branch.
There was a problem hiding this comment.
Yeah currently inference can propagate conditional type information about local variable but not about memory owned by local variable. So we need to extract the field value into a local variable to get that extra type propagation.
| str, sizeof(str), buffer, nwords, options, | ||
| @cfunction(utf8proc_custom_func, UInt32, (UInt32, Ptr{Cvoid})), C_NULL) | ||
| ret < 0 && utf8proc_error(ret) | ||
| ret < 0 && Base.Unicode.utf8proc_error(ret) |
| message = !isnothing(error) ? error : | ||
| !isnothing(warning) ? warning : | ||
| error("No message in diagnostic") | ||
| Base.error("No message in diagnostic") |
Thanks! I don't have a write access to this repository so please merge this👍 |
|
Oh, I thought you'd have access as a member of the JuliaLang/committers group. I'd add you to this repo directly but I seem to have lost admin when I transferred this repo (requesting access again now...) For now I'll just merge this. Thanks @pfitzseb for the review :) |
Co-authored-by: Sebastian Pfitzner <pfitzseb@gmail.com>
Co-authored-by: Sebastian Pfitzner <pfitzseb@gmail.com>
No description provided.