diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index 02a69da16ce..f2a0877cace 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -431,9 +431,9 @@ type cenv = TcFileState let CopyAndFixupTypars g m rigid tpsorig = FreshenAndFixupTypars g m rigid [] [] tpsorig -let UnifyTypes (cenv: cenv) (env: TcEnv) m actualTy expectedTy = +let UnifyTypes (cenv: cenv) (env: TcEnv) m expectedTy actualTy = let g = cenv.g - AddCxTypeEqualsType env.eContextInfo env.DisplayEnv cenv.css m (tryNormalizeMeasureInType g actualTy) (tryNormalizeMeasureInType g expectedTy) + AddCxTypeEqualsType env.eContextInfo env.DisplayEnv cenv.css m (tryNormalizeMeasureInType g expectedTy) (tryNormalizeMeasureInType g actualTy) // If the overall type admits subsumption or type directed conversion, and the original unify would have failed, // then allow subsumption or type directed conversion. @@ -5884,10 +5884,10 @@ and CheckTupleIsCorrectLength g (env: TcEnv) m tupleTy (args: 'a list) tcArgs = if args.Length <> ptys.Length then let argTys = NewInferenceTypes g args suppressErrorReporting (fun () -> tcArgs argTys) - let expectedTy = TType_tuple (tupInfo, argTys) + let actualTy = TType_tuple (tupInfo, argTys) // We let error recovery handle this exception - error (ErrorFromAddingTypeEquation(g, env.DisplayEnv, tupleTy, expectedTy, + error (ErrorFromAddingTypeEquation(g, env.DisplayEnv, tupleTy, actualTy, (ConstraintSolverTupleDiffLengths(env.DisplayEnv, env.eContextInfo, ptys, argTys, m, m)), m)) and TcExprTuple (cenv: cenv) overallTy env tpenv (isExplicitStruct, args, m) = diff --git a/src/Compiler/Checking/CheckExpressions.fsi b/src/Compiler/Checking/CheckExpressions.fsi index b26381b6b02..0ecc045f05d 100644 --- a/src/Compiler/Checking/CheckExpressions.fsi +++ b/src/Compiler/Checking/CheckExpressions.fsi @@ -863,7 +863,7 @@ val TranslateSynValInfo: val TranslatePartialValReprInfo: tps: Typar list -> PrelimValReprInfo -> ValReprInfo /// Constrain two types to be equal within this type checking context -val UnifyTypes: cenv: TcFileState -> env: TcEnv -> m: range -> actualTy: TType -> expectedTy: TType -> unit +val UnifyTypes: cenv: TcFileState -> env: TcEnv -> m: range -> expectedTy: TType -> actualTy: TType -> unit val TcRuntimeTypeTest: isCast: bool -> diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index fa20b108362..e999152ce54 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -246,9 +246,9 @@ exception ConstraintSolverError of string * range * range exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Typar * TType * error: exn * range: range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * error: exn * range: range +exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * expectedTy: TType * actualTy: TType * error: exn * range: range -exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * actualTy: TType * expectedTy: TType * error: exn * ctxtInfo: ContextInfo * parameterRange: range +exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * expectedTy: TType * actualTy: TType * error: exn * ctxtInfo: ContextInfo * parameterRange: range exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * error: exn * range: range @@ -2732,12 +2732,12 @@ and SolveTypeSubsumesTypeWithWrappedContextualReport (csenv: ConstraintSolverEnv and SolveTypeSubsumesTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln origTy1 ty1 ty2 = SolveTypeSubsumesTypeWithWrappedContextualReport csenv ndeep m trace cxsln origTy1 ty1 ty2 id -and SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln actualTy expectedTy = +and SolveTypeEqualsTypeWithReport (csenv: ConstraintSolverEnv) ndeep m trace cxsln expectedTy actualTy = TryD - (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln actualTy expectedTy) + (fun () -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m trace cxsln expectedTy actualTy) (function | AbortForFailedMemberConstraintResolution as err -> ErrorD err - | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, actualTy, expectedTy, res, m))) + | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, expectedTy, actualTy, res, m))) and ArgsMustSubsumeOrConvert (csenv: ConstraintSolverEnv) @@ -3478,10 +3478,10 @@ let EliminateConstraintsForGeneralizedTypars (denv: DisplayEnv) css m (trace: Op // No error recovery here: we do that on a per-expression basis. //------------------------------------------------------------------------- -let AddCxTypeEqualsType contextInfo denv css m actual expected = +let AddCxTypeEqualsType contextInfo denv css m expected actual = let csenv = MakeConstraintSolverEnv contextInfo css m denv PostponeOnFailedMemberConstraintResolution csenv NoTrace - (fun csenv -> SolveTypeEqualsTypeWithReport csenv 0 m NoTrace None actual expected) + (fun csenv -> SolveTypeEqualsTypeWithReport csenv 0 m NoTrace None expected actual) ErrorD |> RaiseOperationResult diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index d6cc309c6b5..eb48ce3b439 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -187,16 +187,16 @@ exception ErrorFromApplyingDefault of exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * - actualTy: TType * expectedTy: TType * + actualTy: TType * error: exn * range: range exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * - actualTy: TType * expectedTy: TType * + actualTy: TType * error: exn * ctxtInfo: ContextInfo * parameterRange: range