1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
>let whenGuardFailure cardsArray =
- let subFunc v1 v2 v3 v4 =
- v1 = v2 && v2 = v3 && v3 = v4
- match cardsArray with
- | [| Card (v1, _); Card (v2, _); Card (v3, _); Card (v4, _) |] when subFunc v1 v2 v3 v4 -> printfn "Excellent!"
- | _ -> printfn "Bouh!"
-
-whenGuardFailure [| Card (10, H); Card (10, D); Card (10, S); Card (10, C) |];;
System.InvalidProgramException: Invalid IL code in FSI_0013:subFunc@89-4<int> (int,int,int,int): IL_004f: ret
at FSI_0013.whenGuardFailure (.PlayingCard[] cardsArray) [0x00000]
at <StartupCode$FSI_0013>.$FSI_0013.main@ () [0x00000]
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
Stopped due to error |
Partager