Skip to content
  • Sebastian Graf's avatar
    Encode refutable `ConLike`s in `TmOracle` for correct warnings in the presence of `COMPLETE` groups · 3534f4c7
    Sebastian Graf authored
    Previously, we had an elaborate mechanism for selecting the warnings to
    generate in the presence of different `COMPLETE` matching groups that,
    albeit finely-tuned, produced wrong results from an end user's
    perspective in some cases (#13363).
    
    The underlying issue is that at the point where the `ConVar` case has to
    commit to a particular `COMPLETE` group, there's not enough information
    to do so and the status quo was to just enumerate all possible complete
    sets nondeterministically.  The `getResult` function would then pick the
    outcome according to metrics defined in accordance to the user's guide.
    But crucially, it lacked knowledge about the order in which affected
    clauses appear, leading to the surprising behavior in #13363.
    
    In !1010 we taught the term oracle to reason about literal values a
    variable can certainly not take on. This MR extends that idea to
    `ConLike`s and thereby fixes #13363: Instead of committing to a
    particular `COMPLETE` group in the `ConVar` case, we now split off the
    matching constructor incrementally and record the newly covered case as
    a refutable shape in the term oracle.  After all clauses have been
    processed this way, we filter out any value vector abstractions from the
    uncovered set involving variables whose set of covered constructors
    completely overlap a `COMPLETE` set.
    3534f4c7