diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 91dc8bb83bd..6f5e8304345 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -532,7 +532,7 @@ let UseOfAddressOfOperatorE() = DeclareResourceString("UseOfAddressOfOperator", let DefensiveCopyWarningE() = DeclareResourceString("DefensiveCopyWarning", "%s") let DeprecatedThreadStaticBindingWarningE() = DeclareResourceString("DeprecatedThreadStaticBindingWarning", "") let FunctionValueUnexpectedE() = DeclareResourceString("FunctionValueUnexpected", "%s") -let UnitTypeExpectedE() = DeclareResourceString("UnitTypeExpected", "") +let UnitTypeExpectedE() = DeclareResourceString("UnitTypeExpected", "%s") let UnitTypeExpectedWithEqualityE() = DeclareResourceString("UnitTypeExpectedWithEquality", "") let UnitTypeExpectedWithPossiblePropertySetterE() = DeclareResourceString("UnitTypeExpectedWithPossiblePropertySetter", "%s%s") let UnitTypeExpectedWithPossibleAssignmentE() = DeclareResourceString("UnitTypeExpectedWithPossibleAssignment", "%s") @@ -1296,8 +1296,9 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = let ty, _cxs = PrettyTypes.PrettifyType denv.g ty os.Append(FunctionValueUnexpectedE().Format (NicePrint.stringOfTy denv ty)) |> ignore - | UnitTypeExpected (_, _, _) -> - let warningText = UnitTypeExpectedE().Format + | UnitTypeExpected (denv, ty, _) -> + let ty, _cxs = PrettyTypes.PrettifyType denv.g ty + let warningText = UnitTypeExpectedE().Format (NicePrint.stringOfTy denv ty) os.Append warningText |> ignore | UnitTypeExpectedWithEquality (_) -> diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index 29df23d2296..94b9d7df4b5 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -886,7 +886,7 @@ This expression is a function value, i.e. is missing arguments. Its type is {0}. - The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. + The result of this expression of type {0} is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'.