Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) =
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Checking/CheckExpressions.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
14 changes: 7 additions & 7 deletions src/Compiler/Checking/ConstraintSolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Checking/ConstraintSolver.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down