Javatpoint Logo
Javatpoint Logo

F# Assertion

The assert expression is a debugging feature of F#. You can use it to test an expression. It generates a system error dialog box upon failure in Debug mode.

Syntax:

Condition represents a boolean expression. If expression is true execution continues normally. If expression is false a system error dialog box is generated.

It is enabled only when you compile in Debug mode. Assertion failure error cannot be caught by using exception handling in F#.


F# Assertion Example

In the above code assertion is true. So there is no failure in the code. It will execute code. .

Output:

5
Next TopicF# Modules





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA