Skip to content

Commit a3e5190

Browse files
authored
Fix warn scopes trivia for fantomas (#18637)
1 parent c4a9f34 commit a3e5190

14 files changed

+32
-64
lines changed

docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
### Breaking Changes
2121

22-
* Scoped Nowarn: Add the #warnon compiler directive ([Language suggestion #278](https://github.com/fsharp/fslang-suggestions/issues/278), [RFC FS-1146 PR](https://github.com/fsharp/fslang-design/pull/782), [PR #18049](https://github.com/dotnet/fsharp/pull/18049))
22+
* Scoped Nowarn: Add the #warnon compiler directive ([Language suggestion #278](https://github.com/fsharp/fslang-suggestions/issues/278), [RFC FS-1146 PR](https://github.com/fsharp/fslang-design/pull/782), [PR #18049](https://github.com/dotnet/fsharp/pull/18049) and [PR #18637](https://github.com/dotnet/fsharp/pull/18637))

src/Compiler/Driver/ParseAndCheckInputs.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ let private collectCodeComments (lexbuf: UnicodeLexing.Lexbuf) =
221221
[
222222
yield! CommentStore.GetComments(lexbuf)
223223
yield! (List.map CommentTrivia.LineComment tripleSlashComments)
224-
yield! WarnScopes.getCommentTrivia lexbuf
225224
]
226225
|> List.sortBy (function
227226
| CommentTrivia.LineComment r

src/Compiler/SyntaxTree/SyntaxTrivia.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ and [<RequireQualifiedAccess; NoEquality; NoComparison>] IfDirectiveExpression =
2424

2525
[<RequireQualifiedAccess; NoEquality; NoComparison>]
2626
type WarnDirectiveTrivia =
27-
| Nowarn of warnNumbers: int list * range
28-
| Warnon of warnNumbers: int list * range
27+
| Nowarn of range
28+
| Warnon of range
2929

3030
[<RequireQualifiedAccess; NoEquality; NoComparison>]
3131
type CommentTrivia =

src/Compiler/SyntaxTree/SyntaxTrivia.fsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ type IfDirectiveExpression =
3636

3737
[<RequireQualifiedAccess; NoEquality; NoComparison>]
3838
type WarnDirectiveTrivia =
39-
| Nowarn of warnNumbers: int list * range
40-
| Warnon of warnNumbers: int list * range
39+
| Nowarn of range
40+
| Warnon of range
4141

4242
[<RequireQualifiedAccess; NoEquality; NoComparison>]
4343
type CommentTrivia =

src/Compiler/SyntaxTree/WarnScopes.fs

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ module internal WarnScopes =
3636

3737
type private WarnDirective =
3838
{
39-
DirectiveRange: range
40-
CommentRange: range option
4139
WarnCmds: WarnCmd list
40+
DirectiveRange: range
4241
}
4342

4443
let private isWarnonDirective (w: WarnDirective) =
@@ -148,11 +147,9 @@ module internal WarnScopes =
148147
let startPos = lexbuf.StartPos
149148

150149
let mGroups = (regex.Match text).Groups
151-
let dIdentGroup = mGroups[2]
152-
let dIdent = dIdentGroup.Value
153-
let argsGroup = mGroups[3]
154-
let argCaptures = [ for c in argsGroup.Captures -> c ]
155-
let commentGroup = mGroups[5]
150+
let totalLength = mGroups[0].Length
151+
let dIdent = mGroups[2].Value
152+
let argCaptures = [ for c in mGroups[3].Captures -> c ]
156153

157154
let positions line offset length =
158155
mkPos line (startPos.Column + offset), mkPos line (startPos.Column + offset + length)
@@ -165,19 +162,7 @@ module internal WarnScopes =
165162
positions lexbuf.StartPos.OriginalLine offset length
166163
||> mkFileIndexRange originalFileIndex
167164

168-
let directiveLength =
169-
if argsGroup.Success then
170-
argsGroup.Index - (dIdentGroup.Index - 1) + argsGroup.Length
171-
else
172-
dIdentGroup.Length + 1
173-
174-
let directiveRange = mkRange (dIdentGroup.Index - 1) directiveLength
175-
176-
let commentRange =
177-
if commentGroup.Success then
178-
Some(mkRange commentGroup.Index commentGroup.Length)
179-
else
180-
None
165+
let directiveRange = mkRange 0 totalLength
181166

182167
if argCaptures.IsEmpty then
183168
errorR (Error(FSComp.SR.lexWarnDirectiveMustHaveArgs (), directiveRange))
@@ -190,13 +175,12 @@ module internal WarnScopes =
190175
match dIdent with
191176
| "warnon" -> argCaptures |> List.choose (mkDirective WarnCmd.Warnon)
192177
| "nowarn" -> argCaptures |> List.choose (mkDirective WarnCmd.Nowarn)
193-
| _ ->
178+
| _ -> // like "warnonx"
194179
errorR (Error(FSComp.SR.fsiInvalidDirective ($"#{dIdent}", ""), directiveRange))
195180
[]
196181

197182
{
198183
DirectiveRange = directiveRange
199-
CommentRange = commentRange
200184
WarnCmds = warnCmds
201185
}
202186

@@ -365,18 +349,12 @@ module internal WarnScopes =
365349
let getDirectiveTrivia (lexbuf: Lexbuf) =
366350
let mkTrivia d =
367351
if isWarnonDirective d then
368-
WarnDirectiveTrivia.Warnon(d.WarnCmds |> List.map _.WarningNumber, d.DirectiveRange)
352+
WarnDirectiveTrivia.Warnon d.DirectiveRange
369353
else
370-
WarnDirectiveTrivia.Nowarn(d.WarnCmds |> List.map _.WarningNumber, d.DirectiveRange)
354+
WarnDirectiveTrivia.Nowarn d.DirectiveRange
371355

372356
(getLexbufData lexbuf).WarnDirectives |> List.rev |> List.map mkTrivia
373357

374-
let getCommentTrivia (lexbuf: Lexbuf) =
375-
(getLexbufData lexbuf).WarnDirectives
376-
|> List.rev
377-
|> List.choose _.CommentRange
378-
|> List.map CommentTrivia.LineComment
379-
380358
// *************************************
381359
// Apply the warn scopes after lexing
382360
// *************************************

src/Compiler/SyntaxTree/WarnScopes.fsi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ module internal WarnScopes =
2323
/// Get the collected ranges of the warn directives
2424
val getDirectiveTrivia: Lexbuf -> WarnDirectiveTrivia list
2525

26-
/// Get the ranges of comments after warn directives
27-
val getCommentTrivia: Lexbuf -> CommentTrivia list
28-
2926
/// Check if the range is inside a "warnon" scope for the given warning number.
3027
val IsWarnon: FSharpDiagnosticOptions -> warningNumber: int -> mo: range option -> bool
3128

tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10829,22 +10829,18 @@ FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption
1082910829
FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword()
1083010830
FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: System.String ToString()
1083110831
FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range])
10832-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range Item2
10833-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range get_Item2()
10834-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers()
10835-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers
10832+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range Item
10833+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range get_Item()
1083610834
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Nowarn
1083710835
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Warnon
10838-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range Item2
10839-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range get_Item2()
10840-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers()
10841-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers
10836+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range Item
10837+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range get_Item()
1084210838
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsNowarn
1084310839
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsWarnon
1084410840
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsNowarn()
1084510841
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsWarnon()
10846-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewNowarn(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range)
10847-
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewWarnon(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range)
10842+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewNowarn(FSharp.Compiler.Text.Range)
10843+
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewWarnon(FSharp.Compiler.Text.Range)
1084810844
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn
1084910845
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags
1085010846
FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon

tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+getOptionArgList@307::Invoke([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, string)][offset 0x0000003E][found Char] Unexpected type on the stack.
3838
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+getSwitch@325::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack.
3939
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<FSharp.Compiler.CompilerOptions+CompilerOption>)][offset 0x00000E9F][found Char] Unexpected type on the stack.
40-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1781@1781::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack.
41-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1781@1781::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack.
40+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1780@1780::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack.
41+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1780@1780::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack.
4242
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000062B][found Char] Unexpected type on the stack.
4343
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x00000634][found Char] Unexpected type on the stack.
4444
[IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000065][found Byte] Unexpected type on the stack.

tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<FSharp.Compiler.CompilerOptions+CompilerOption>)][offset 0x00000E9F][found Char] Unexpected type on the stack.
5454
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+processArg@333::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<string>)][offset 0x0000004D][found Char] Unexpected type on the stack.
5555
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000031][found Char] Unexpected type on the stack.
56-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1781@1781::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack.
57-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1781@1781::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack.
56+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1780@1780::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack.
57+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1780@1780::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack.
5858
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+line@570-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack.
5959
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000062B][found Char] Unexpected type on the stack.
6060
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x00000634][found Char] Unexpected type on the stack.

tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::attempt@372([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<string,Microsoft.FSharp.Core.Unit>, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<FSharp.Compiler.CompilerOptions+CompilerOptionBlock>, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<string>, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<string>, string, string, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1<FSharp.Compiler.CompilerOptions+CompilerOption>)][offset 0x00000A99][found Char] Unexpected type on the stack.
4040
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack.
4141
[IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,!!0>)][offset 0x0000005E] Stack underflow.
42-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack.
43-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack.
42+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1780::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack.
43+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1780::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack.
4444
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack.
4545
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x000005A5][found Char] Unexpected type on the stack.
4646
[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2<!!0,System.Tuple`2<int32,!!1>>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873-1<T1>'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<int32,T0>,int32>'] Unexpected type on the stack.

tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::subSystemVersionSwitch$cont@656([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000000B][found Char] Unexpected type on the stack.
5656
[IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,!!0>)][offset 0x0000005E] Stack underflow.
5757
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000026][found Char] Unexpected type on the stack.
58-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack.
59-
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack.
58+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1780::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack.
59+
[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1780::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack.
6060
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@568-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000021][found Char] Unexpected type on the stack.
6161
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@568-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000003B][found Char] Unexpected type on the stack.
6262
[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerConfig+TcConfig::.ctor([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, bool)][offset 0x0000059C][found Char] Unexpected type on the stack.

tests/service/data/SyntaxTree/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs.bsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ ImplFile
77
([TripleQuoteStringAsParsedHashDirectiveArgument], false, AnonModule,
88
[], PreXmlDocEmpty, [], None, (3,0--3,0), { LeadingKeyword = None })],
99
(true, true), { ConditionalDirectives = []
10-
WarnDirectives = [Nowarn ([40], (2,0--2,16))]
10+
WarnDirectives = [Nowarn (2,0--2,16)]
1111
CodeComments = [] }, set []))

tests/service/data/SyntaxTree/WarnScope/WarnScope.fs.bsl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ ImplFile
77
Expr (Const (Unit, (4,0--4,2)), (4,0--4,2))], PreXmlDocEmpty, [],
88
None, (2,0--4,2), { LeadingKeyword = None })], (true, true),
99
{ ConditionalDirectives = []
10-
WarnDirectives =
11-
[Nowarn ([20], (1,0--1,10)); Warnon ([20], (3,0--3,10))]
12-
CodeComments = [LineComment (3,12--3,24)] }, set []))
10+
WarnDirectives = [Nowarn (1,0--1,10); Warnon (3,0--3,24)]
11+
CodeComments = [] }, set []))

tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ ImplFile
1717
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None,
1818
(1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true),
1919
{ ConditionalDirectives = []
20-
WarnDirectives =
21-
[Nowarn ([20; 25], (3,4--3,17)); Warnon ([20; 25], (5,4--5,17))]
22-
CodeComments = [LineComment (5,18--5,30)] }, set []))
20+
WarnDirectives = [Nowarn (3,0--3,17); Warnon (5,0--5,30)]
21+
CodeComments = [] }, set []))

0 commit comments

Comments
 (0)