Skip to content

reworded.#2612

Closed
cPlayIt wants to merge 9 commits intocaffeinelabs:masterfrom
cPlayIt:patch-17
Closed

reworded.#2612
cPlayIt wants to merge 9 commits intocaffeinelabs:masterfrom
cPlayIt:patch-17

Conversation

@cPlayIt
Copy link
Contributor

@cPlayIt cPlayIt commented Jun 19, 2021

No description provided.

@dfinity-ci
Copy link

This PR does not affect the produced WebAssembly code.

alternative makes most sense to me as an extension of scrutineer.

You have 2 scrutineers, 2 alternatives...

... but with just 1 option, it should probably be scrutineer as there's only one case block doing the scrutinizing if I am following.
Co-authored-by: Claudio Russo <claudio@dfinity.org>
When a pattern check alternative has the potential to fail, then it becomes important to find out whether the whole `switch` expression can fail. If this can happen the execution of the program can trap for certain inputs, posing an operational threat. To this end, the compiler checks for the exhaustiveness of pattern matching by keeping track of the covered shape of the scrutinee. The compiler issues a warning for any non-covered scrutinees ({proglang} even constructs a helpful example of a scrutinee that is not matched). As by-product of the exhaustiveness check, warnings are also issued for dead alternatives.

In summary, pattern checking is a great tool for several use-cases and enables active assistance from the compiler to the programmer by pointing out which inputs are not exhaustively taken care of. The static compile-time nature of coverage checking reliably rules out runtime failures.
In summary, pattern checking is a great tool with several use-cases. By statically analyzing patterns, the compiler can assists the programmer by pointing out unhandled cases and unreachable code, both of which often indicate programmer error. The static compile-time nature of coverage checking reliably rules out runtime failures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In summary, pattern checking is a great tool with several use-cases. By statically analyzing patterns, the compiler can assists the programmer by pointing out unhandled cases and unreachable code, both of which often indicate programmer error. The static compile-time nature of coverage checking reliably rules out runtime failures.
In summary, pattern checking is a great tool with several use-cases. By statically analyzing patterns, the compiler can assists the programmer by pointing out unhandled cases and unreachable code, both of which often indicate programmer error. The static, compile-time nature of coverage checking reliably rules out runtime failures.

@crusso
Copy link
Contributor

crusso commented Jun 21, 2021

Incorporated into #2619

@crusso crusso closed this Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants