Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,8 @@ module Ast implements AstSig<Py::Location> {
}
}

/** A wildcard case (`case _:`). */
class DefaultCase extends Case {
DefaultCase() { this.isWildcard() }
DefaultCase() { none() }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reclassifying should be caught by the consistency checks. The test code you propose would leave dead code. Still, it is a valid suggestion, perhaps case _ if cond: then case _: would be even better.

}

/** A conditional expression (`x if cond else y`). */
Expand Down Expand Up @@ -1754,6 +1753,11 @@ private module Input implements InputSig1, InputSig2 {
n2.isAdditional(assertStmt, assertThrowTag())
)
}

predicate matchAll(Ast::Case c) {
// A wildcard case (`case _:`) will match all values.
c.isWildcard()
}
}

import Public
Expand Down
Loading