Skip to content

Commit f778c80

Browse files
authored
Merge pull request #8247 from dotnet/merges/master-to-feature/and-bang
Merge master to feature/and-bang
2 parents 95a5b53 + 68ea1f9 commit f778c80

File tree

15 files changed

+10
-46
lines changed

15 files changed

+10
-46
lines changed

src/fsharp/fsc.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ let ConsoleErrorLoggerUpToMaxErrors (tcConfigB: TcConfigBuilder, exiter : Exiter
102102
member __.HandleIssue(tcConfigB, err, isError) =
103103
DoWithErrorColor isError (fun () ->
104104
let diag = OutputDiagnostic (tcConfigB.implicitIncludeDir, tcConfigB.showFullPaths, tcConfigB.flatErrors, tcConfigB.errorStyle, isError)
105-
writeViaBufferWithEnvironmentNewLines stderr diag err
105+
writeViaBuffer stderr diag err
106106
stderr.WriteLine())
107107
} :> ErrorLogger
108108

@@ -316,7 +316,7 @@ module InterfaceFileWriter =
316316

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

322322
if tcConfig.printSignatureFile <> "" then os.Dispose()

src/fsharp/fsi/fsi.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ type internal FsiStdinSyphon(errorWriter: TextWriter) =
502502
let isError = true
503503
DoWithErrorColor isError (fun () ->
504504
errorWriter.WriteLine();
505-
writeViaBufferWithEnvironmentNewLines errorWriter (OutputDiagnosticContext " " syphon.GetLine) err;
506-
writeViaBufferWithEnvironmentNewLines errorWriter (OutputDiagnostic (tcConfig.implicitIncludeDir,tcConfig.showFullPaths,tcConfig.flatErrors,tcConfig.errorStyle,isError)) err;
505+
writeViaBuffer errorWriter (OutputDiagnosticContext " " syphon.GetLine) err;
506+
writeViaBuffer errorWriter (OutputDiagnostic (tcConfig.implicitIncludeDir,tcConfig.showFullPaths,tcConfig.flatErrors,tcConfig.errorStyle,isError)) err;
507507
errorWriter.WriteLine()
508508
errorWriter.WriteLine()
509509
errorWriter.Flush()))
@@ -548,8 +548,8 @@ type internal ErrorLoggerThatStopsOnFirstError(tcConfigB:TcConfigBuilder, fsiStd
548548
DoWithErrorColor isError (fun () ->
549549
if ReportWarning tcConfigB.errorSeverityOptions err then
550550
fsiConsoleOutput.Error.WriteLine()
551-
writeViaBufferWithEnvironmentNewLines fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err
552-
writeViaBufferWithEnvironmentNewLines fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,isError)) err
551+
writeViaBuffer fsiConsoleOutput.Error (OutputDiagnosticContext " " fsiStdinSyphon.GetLine) err
552+
writeViaBuffer fsiConsoleOutput.Error (OutputDiagnostic (tcConfigB.implicitIncludeDir,tcConfigB.showFullPaths,tcConfigB.flatErrors,tcConfigB.errorStyle,isError)) err
553553
fsiConsoleOutput.Error.WriteLine()
554554
fsiConsoleOutput.Error.WriteLine()
555555
fsiConsoleOutput.Error.Flush())

src/fsharp/lib.fs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,12 @@ let bufs f =
313313
f buf
314314
buf.ToString()
315315

316-
let buff (os: TextWriter) f x =
316+
// writing to output stream via a string buffer.
317+
let writeViaBuffer (os: TextWriter) f x =
317318
let buf = System.Text.StringBuilder 100
318319
f buf x
319320
os.Write(buf.ToString())
320321

321-
// Converts "\n" into System.Environment.NewLine before writing to os. See lib.fs:buff
322-
let writeViaBufferWithEnvironmentNewLines (os: TextWriter) f x =
323-
let buf = System.Text.StringBuilder 100
324-
f buf x
325-
let text = buf.ToString()
326-
let text = text.Replace("\n", System.Environment.NewLine)
327-
os.Write text
328-
329322
//---------------------------------------------------------------------------
330323
// Imperative Graphs
331324
//---------------------------------------------------------------------------
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

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

tests/fsharp/typecheck/sigs/neg04.bsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ neg04.fs(22,8,22,17): typecheck error FS0912: This declaration element is not pe
1212
neg04.fs(26,8,26,17): typecheck error FS0912: This declaration element is not permitted in an augmentation
1313

1414
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:
15-
1615
IsNaN
1716

1817
neg04.fs(46,69,46,94): typecheck error FS0001: Type mismatch. Expecting a

tests/fsharp/typecheck/sigs/neg06.bsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
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:
3-
43
ASCII
54

65
neg06.fs(12,6,12,31): typecheck error FS0942: Struct types are always sealed

tests/fsharp/typecheck/sigs/neg07.bsl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers shou
44
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.
55

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

109
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.
@@ -14,7 +13,6 @@ neg07.fs(28,11,28,21): typecheck error FS0049: Uppercase variable identifiers sh
1413
neg07.fs(28,11,28,21): typecheck error FS0026: This rule will never be matched
1514

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

2018
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.
@@ -24,11 +22,9 @@ neg07.fs(36,11,36,21): typecheck error FS0049: Uppercase variable identifiers sh
2422
neg07.fs(36,11,36,21): typecheck error FS0026: This rule will never be matched
2523

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

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

3430
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

tests/fsharp/typecheck/sigs/neg10.bsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ neg10.fs(169,32,169,35): typecheck error FS0035: This construct is deprecated: T
6363

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

7169
neg10.fs(169,19,169,26): typecheck error FS0783: At least one override did not correctly implement its corresponding abstract member

tests/fsharp/typecheck/sigs/neg111.bsl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ neg111.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined.
44
neg111.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined.
55

66
neg111.fs(3,624,3,629): typecheck error FS0039: The value or constructor 'fail2' is not defined. Maybe you want one of the following:
7-
87
Failure
9-
108
failwith
11-
129
failwithf
1310

1411
neg111.fs(5,538,5,540): typecheck error FS0003: This value is not a function and cannot be applied.

tests/fsharp/typecheck/sigs/neg15.bsl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,15 @@ neg15.fs(115,19,115,48): typecheck error FS0072: Lookup on object of indetermina
3030
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.
3131

3232
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:
33-
3433
InternalUnionType
35-
3634
InternalRecordType
37-
3835
DefaultTagOfInternalType
3936

4037
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.
4138

4239
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:
43-
4440
InternalUnionType
45-
4641
InternalRecordType
47-
4842
DefaultTagOfInternalType
4943

5044
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.

0 commit comments

Comments
 (0)