This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ConstraintSolverTypesNotInEqualityRelation(denv,t1,t2,m,m2,contextInfo) -> | |
let t1, t2, _cxs = NicePrint.minimalStringsOfTwoTypes denv t1 t2 | |
match contextInfo with | |
| ContextInfo.ElseBranchResult range when range = m -> | |
os.Append(FSComp.SR.elseBranchHasWrongType(t1,t2)) |> ignore | |
| _ -> os.Append(ConstraintSolverTypesNotInEqualityRelation2E().Format t1 t2) |> ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let env = { env with eContextInfo = ContextInfo.ElseBranchResult e3.Range } | |
let e3',tpenv = TcExprThatCanBeCtorBody cenv overallTy env tpenv e3 | |
e3',SequencePointAtTarget,tpenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<RequireQualifiedAccess>] | |
/// Information about the context of a type equation. | |
type ContextInfo = | |
/// No context was given. | |
| NoContext | |
/// The type equation comes from a type check of the result of an else branch. | |
| ElseBranchResult of range | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tempTy = NewInferenceType () | |
let e3',tpenv = TcExprThatCanBeCtorBody cenv tempTy env tpenv e3 | |
let env = { env with eContextInfo = ContextInfo.ElseBranch } | |
UnifyTypes cenv env e3.Range overallTy tempty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SynExpr.IfThenElse (e1,e2,e3opt,spIfToThen,isRecovery,mIfToThen,m) -> | |
let e1',tpenv = TcExprThatCantBeCtorBody cenv cenv.g.bool_ty env tpenv e1 | |
let e2',tpenv = | |
if not isRecovery && Option.isNone e3opt then | |
let env = { env with eContextInfo = ContextInfo.OmittedElseBranch } | |
UnifyTypes cenv env m cenv.g.unit_ty overallTy | |
TcExprThatCanBeCtorBody cenv overallTy env tpenv e2 | |
else | |
TcExprThatCanBeCtorBody cenv overallTy env tpenv e2 | |
let e3',sp2,tpenv = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let test = 100 | |
let f x = printfn "%s" x | |
let y = | |
if test > 10 then "test" | |
else | |
f 123 | |
"test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let test = 100 | |
let y = | |
if test > 10 then "test" | |
else 123 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div [] | |
[for i in 0 .. model.Length-1 -> | |
div | |
[] | |
[ for j in 0 .. model.Length-1 -> | |
input | |
[ maxlength 1 | |
property "value" | |
(match model.[i].[j] with | |
| 0 -> unbox "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Collections.Generic | |
type Box = int | |
type Sudoku = Box array array | |
let rows = id | |
let cols (sudoku:Sudoku) = | |
sudoku | |
|> Array.mapi (fun a row -> row |> Array.mapi (fun b cell -> sudoku.[b].[a])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Table<'a> = 'a[] | |
let getKey<'a> = "models/" + typeof<'a>.FullName |