• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37917

27 Sep 2024 02:34AM UTC coverage: 87.243% (-0.5%) from 87.72%
#37917

push

local

web-flow
inference: add missing `TypeVar` handling for `instanceof_tfunc` (#55884)

I thought these sort of problems had been addressed by d60f92c, but it
seems some were missed. Specifically, `t.a` and `t.b` from `t::Union`
could be `TypeVar`, and if they are passed to a subroutine or recursed
without being unwrapped or rewrapped, errors like JuliaLang/julia#55882
could occur.

This commit resolves the issue by calling `unwraptv` in the `Union`
handling within `instanceof_tfunc`. I also found a similar issue inside
`nfields_tfunc`, so that has also been fixed, and test cases have been
added. While I haven't been able to make up a test case specifically for
the fix in `instanceof_tfunc`, I have confirmed that this commit
certainly fixes the issue reported in JuliaLang/julia#55882.

- fixes JuliaLang/julia#55882

4 of 4 new or added lines in 1 file covered. (100.0%)

448 existing lines in 25 files now uncovered.

77170 of 88454 relevant lines covered (87.24%)

16041082.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/stdlib/Markdown/src/IPython/IPython.jl
1
# This file is a part of Julia. License is MIT: https://julialang.org/license
2

3
mutable struct LaTeX
4
    formula::String
431✔
5
end
6

7
@trigger '$' ->
×
8
function tex(stream::IO, md::MD)
9
    result = parse_inline_wrapper(stream, "\$", rep = true)
21,242✔
10
    return result === nothing ? nothing : LaTeX(result)
21,243✔
11
end
12

13
function blocktex(stream::IO, md::MD)
21,242✔
14
    withstream(stream) do
21,242✔
15
        ex = tex(stream, md)
21,243✔
16
        if ex ≡ nothing
21,242✔
17
            return false
21,241✔
18
        else
19
            push!(md, ex)
1✔
20
            return true
1✔
21
        end
22
    end
23
end
24

UNCOV
25
show(io::IO, tex::LaTeX) =
×
26
    print(io, '$', tex.formula, '$')
27

UNCOV
28
latex(io::IO, tex::LaTeX) =
×
29
    println(io, "\$\$", tex.formula, "\$\$")
30

UNCOV
31
latexinline(io::IO, tex::LaTeX) =
×
32
    print(io, '$', tex.formula, '$')
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc