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
4 changes: 2 additions & 2 deletions src/fsharp/fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ let ConsoleErrorLoggerUpToMaxErrors (tcConfigB: TcConfigBuilder, exiter : Exiter
member __.HandleIssue(tcConfigB, err, isError) =
DoWithErrorColor isError (fun () ->
let diag = OutputDiagnostic (tcConfigB.implicitIncludeDir, tcConfigB.showFullPaths, tcConfigB.flatErrors, tcConfigB.errorStyle, isError)
writeViaBufferWithEnvironmentNewLines stderr diag err
writeViaBuffer stderr diag err
stderr.WriteLine())
} :> ErrorLogger

Expand Down Expand Up @@ -316,7 +316,7 @@ module InterfaceFileWriter =

for (TImplFile (_, _, mexpr, _, _, _)) in declaredImpls do
let denv = BuildInitialDisplayEnvForSigFileGeneration tcGlobals
writeViaBufferWithEnvironmentNewLines os (fun os s -> Printf.bprintf os "%s\n\n" s)
writeViaBuffer os (fun os s -> Printf.bprintf os "%s\n\n" s)
(NicePrint.layoutInferredSigOfModuleExpr true denv infoReader AccessibleFromSomewhere range0 mexpr |> Layout.squashTo 80 |> Layout.showL)

if tcConfig.printSignatureFile <> "" then os.Dispose()
Expand Down
8 changes: 4 additions & 4 deletions src/fsharp/fsi/fsi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ type internal FsiStdinSyphon(errorWriter: TextWriter) =
let isError = true
DoWithErrorColor isError (fun () ->
errorWriter.WriteLine();
writeViaBufferWithEnvironmentNewLines errorWriter (OutputDiagnosticContext " " syphon.GetLine) err;
writeViaBufferWithEnvironmentNewLines errorWriter (OutputDiagnostic (tcConfig.implicitIncludeDir,tcConfig.showFullPaths,tcConfig.flatErrors,tcConfig.errorStyle,isError)) err;
writeViaBuffer errorWriter (OutputDiagnosticContext " " syphon.GetLine) err;
writeViaBuffer errorWriter (OutputDiagnostic (tcConfig.implicitIncludeDir,tcConfig.showFullPaths,tcConfig.flatErrors,tcConfig.errorStyle,isError)) err;
errorWriter.WriteLine()
errorWriter.WriteLine()
errorWriter.Flush()))
Expand Down Expand Up @@ -548,8 +548,8 @@ type internal ErrorLoggerThatStopsOnFirstError(tcConfigB:TcConfigBuilder, fsiStd
DoWithErrorColor isError (fun () ->
if ReportWarning tcConfigB.errorSeverityOptions err then
fsiConsoleOutput.Error.WriteLine()
writeViaBufferWithEnvironmentNewLines fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err
writeViaBufferWithEnvironmentNewLines fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,isError)) err
writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err
writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,isError)) err
fsiConsoleOutput.Error.WriteLine()
fsiConsoleOutput.Error.WriteLine()
fsiConsoleOutput.Error.Flush())
Expand Down
11 changes: 2 additions & 9 deletions src/fsharp/lib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -313,19 +313,12 @@ let bufs f =
f buf
buf.ToString()

let buff (os: TextWriter) f x =
// writing to output stream via a string buffer.
let writeViaBuffer (os: TextWriter) f x =
let buf = System.Text.StringBuilder 100
f buf x
os.Write(buf.ToString())

// Converts "\n" into System.Environment.NewLine before writing to os. See lib.fs:buff
let writeViaBufferWithEnvironmentNewLines (os: TextWriter) f x =
let buf = System.Text.StringBuilder 100
f buf x
let text = buf.ToString()
let text = text.Replace("\n", System.Environment.NewLine)
os.Write text

//---------------------------------------------------------------------------
// Imperative Graphs
//---------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion tests/fsharp/core/load-script/out.stderr.bsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

usesfsi.fsx(2,1): error FS0039: The value, namespace, type or module 'fsi' is not defined. Maybe you want one of the following:

fst
1 change: 0 additions & 1 deletion tests/fsharp/typecheck/sigs/neg04.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ neg04.fs(22,8,22,17): typecheck error FS0912: This declaration element is not pe
neg04.fs(26,8,26,17): typecheck error FS0912: This declaration element is not permitted in an augmentation

neg04.fs(32,8,32,11): typecheck error FS0039: The field, constructor or member 'Nan' is not defined. Maybe you want one of the following:

IsNaN

neg04.fs(46,69,46,94): typecheck error FS0001: Type mismatch. Expecting a
Expand Down
1 change: 0 additions & 1 deletion tests/fsharp/typecheck/sigs/neg06.bsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

neg06.fs(3,40,3,45): typecheck error FS0039: The field, constructor or member 'Ascii' is not defined. Maybe you want one of the following:

ASCII

neg06.fs(12,6,12,31): typecheck error FS0942: Struct types are always sealed
Expand Down
4 changes: 0 additions & 4 deletions tests/fsharp/typecheck/sigs/neg07.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers shou
neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.

neg07.fs(24,13,24,23): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined. Maybe you want one of the following:

X.UnionCase1

neg07.fs(27,11,27,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.
Expand All @@ -14,7 +13,6 @@ neg07.fs(28,11,28,21): typecheck error FS0049: Uppercase variable identifiers sh
neg07.fs(28,11,28,21): typecheck error FS0026: This rule will never be matched

neg07.fs(31,18,31,28): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined. Maybe you want one of the following:

X.UnionCase1

neg07.fs(35,11,35,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.
Expand All @@ -24,11 +22,9 @@ neg07.fs(36,11,36,21): typecheck error FS0049: Uppercase variable identifiers sh
neg07.fs(36,11,36,21): typecheck error FS0026: This rule will never be matched

neg07.fs(46,15,46,27): typecheck error FS0039: The record label 'RecordLabel1' is not defined. Maybe you want one of the following:

R.RecordLabel1

neg07.fs(47,19,47,31): typecheck error FS0039: The record label 'RecordLabel1' is not defined. Maybe you want one of the following:

R.RecordLabel1

neg07.fs(57,10,57,17): typecheck error FS1196: The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case
Expand Down
2 changes: 0 additions & 2 deletions tests/fsharp/typecheck/sigs/neg10.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ neg10.fs(169,32,169,35): typecheck error FS0035: This construct is deprecated: T

neg10.fs(169,32,169,33): typecheck error FS3213: The member 'X : unit -> 'a' matches multiple overloads of the same method.
Please restrict it to one of the following:

X : unit -> 'a

X : unit -> 'a.

neg10.fs(169,19,169,26): typecheck error FS0783: At least one override did not correctly implement its corresponding abstract member
Expand Down
3 changes: 0 additions & 3 deletions tests/fsharp/typecheck/sigs/neg111.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ neg111.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined.
neg111.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined.

neg111.fs(3,624,3,629): typecheck error FS0039: The value or constructor 'fail2' is not defined. Maybe you want one of the following:

Failure

failwith

failwithf

neg111.fs(5,538,5,540): typecheck error FS0003: This value is not a function and cannot be applied.
6 changes: 0 additions & 6 deletions tests/fsharp/typecheck/sigs/neg15.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@ neg15.fs(115,19,115,48): typecheck error FS0072: Lookup on object of indetermina
neg15.fs(116,20,116,73): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg15.fs(122,32,122,57): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following:

InternalUnionType

InternalRecordType

DefaultTagOfInternalType

neg15.fs(128,31,128,61): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg15.fs(135,31,135,56): typecheck error FS0039: The value, constructor, namespace or type 'InternalTagOfInternalType' is not defined. Maybe you want one of the following:

InternalUnionType

InternalRecordType

DefaultTagOfInternalType

neg15.fs(141,30,141,60): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
Expand Down
6 changes: 0 additions & 6 deletions tests/fsharp/typecheck/sigs/neg17.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ neg17b.fs(8,18,8,43): typecheck error FS1092: The type 'PrivateUnionType' is not
neg17b.fs(11,26,11,41): typecheck error FS0039: The field, constructor or member 'PrivateProperty' is not defined.

neg17b.fs(12,24,12,45): typecheck error FS0039: The field, constructor or member 'PrivateStaticProperty' is not defined. Maybe you want one of the following:

InternalStaticProperty

neg17b.fs(13,26,13,39): typecheck error FS0039: The field, constructor or member 'PrivateMethod' is not defined.

neg17b.fs(14,24,14,43): typecheck error FS0039: The field, constructor or member 'PrivateStaticMethod' is not defined. Maybe you want one of the following:

InternalStaticMethod

neg17b.fs(15,17,15,52): typecheck error FS1092: The type 'PrivateRecordType' is not accessible from this code location
Expand All @@ -26,23 +24,19 @@ neg17b.fs(16,19,16,48): typecheck error FS0072: Lookup on object of indeterminat
neg17b.fs(17,19,17,47): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg17b.fs(21,31,21,77): typecheck error FS0039: The value, constructor, namespace or type 'DefaultTagOfUnionTypeWithPrivateRepresentation' is not defined. Maybe you want one of the following:

DefaultTagOfInternalType

UnionTypeWithPrivateRepresentation

neg17b.fs(29,31,29,61): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg17b.fs(30,31,30,84): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg17b.fs(32,24,32,50): typecheck error FS0039: The type 'RecordTypeWithPrivateField' is not defined in 'Neg17.M'. Maybe you want one of the following:

RecordTypeWithPrivateRepresentation

neg17b.fs(43,30,43,60): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.

neg17b.fs(45,23,45,49): typecheck error FS0039: The type 'RecordTypeWithPrivateField' is not defined in 'Neg17.M'. Maybe you want one of the following:

RecordTypeWithPrivateRepresentation

neg17b.fs(54,20,54,50): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved.
3 changes: 0 additions & 3 deletions tests/fsharp/typecheck/sigs/neg25.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ neg25.fs(87,19,87,25): typecheck error FS0366: No implementation was given for '
neg25.fs(104,19,104,27): typecheck error FS0366: No implementation was given for 'abstract member AnotherNegativeTest.ITestSub.Meth1 : int -> int'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.

neg25.fs(126,27,126,35): typecheck error FS0366: No implementation was given for those members:

'abstract member MissingInterfaceMemberTests.Test0.ITestSub.Meth2 : int -> int'

'abstract member MissingInterfaceMemberTests.Test0.ITest.Meth1 : string -> string'

Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.

neg25.fs(147,27,147,35): typecheck error FS0366: No implementation was given for 'abstract member MissingInterfaceMemberTests.Test1.ITest.Meth1 : string -> string'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.
Expand Down
2 changes: 0 additions & 2 deletions tests/fsharp/typecheck/sigs/neg26.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ neg26.fs(40,27,40,32): typecheck error FS0361: The override 'Meth1 : int -> int'

neg26.fs(53,27,53,32): typecheck error FS3213: The member 'Meth1 : 'a -> 'a' matches multiple overloads of the same method.
Please restrict it to one of the following:

Meth1 : int -> int

Meth1 : int -> int.

neg26.fs(52,15,52,23): typecheck error FS0783: At least one override did not correctly implement its corresponding abstract member
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/neg99.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ neg99.fs(19,16,19,64): typecheck error FS0077: Member constraints with the name

neg99.fs(22,18,22,64): typecheck error FS0077: Member constraints with the name 'op_Explicit' are given special status by the F# compiler as certain .NET types are implicitly augmented with this member. This may result in runtime failures if you attempt to invoke the member constraint from your own code.

neg99.fs(25,39,25,43): typecheck error FS0043: The type 'CrashFSC.OhOh.MyByte' does not support a conversion to the type 'CrashFSC.OhOh.MyByte'
neg99.fs(25,39,25,43): typecheck error FS0043: The type 'CrashFSC.OhOh.MyByte' does not support a conversion to the type 'CrashFSC.OhOh.MyByte'
2 changes: 1 addition & 1 deletion tests/fsharp/typecheck/sigs/version46/neg24.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ neg24.fs(62,31,62,41): typecheck error FS0816: One or more of the overloads of t

neg24.fs(64,44,64,48): typecheck error FS0816: One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form.

neg24.fs(70,15,70,18): typecheck error FS0495: The member or object constructor 'M' has no argument or settable return property 'qez'. The required signature is member C.M : abc:int * def:string -> int.
neg24.fs(70,15,70,18): typecheck error FS0495: The member or object constructor 'M' has no argument or settable return property 'qez'. The required signature is member C.M : abc:int * def:string -> int.