Skip to content
Closed
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
7 changes: 4 additions & 3 deletions src/fsharp/CompileOps.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 (_) ->
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@
<value>This expression is a function value, i.e. is missing arguments. Its type is {0}.</value>
</data>
<data name="UnitTypeExpected" xml:space="preserve">
<value>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'.</value>
<value>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'.</value>
</data>
<data name="UnitTypeExpectedWithEquality" xml:space="preserve">
<value>The result of this equality expression is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'.</value>
Expand Down