From f4710e30f913b910ab468f0ca19dc67b7e561727 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 9 Jan 2025 14:32:00 +0100 Subject: [PATCH 001/134] Versioning for 17.14 and 9.0.300 (#18222) --- azure-pipelines.yml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e5aaebbdf9..95c03d1c0d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ variables: # Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9 # Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice. - name: FSharpReleaseBranchName - value: release/dev17.13 + value: release/dev17.14 # VS Insertion branch name (NOT the same as F# branch) # Should be previous release branch or 'main' in 'main' and 'main' in release branch # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), @@ -88,7 +88,7 @@ extends: # Signed build # #-------------------------------------------------------------------------------------------------------------------# # Localization: we only run it for specific release branches - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.13') }}: + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.14') }}: - template: /eng/common/templates-official/job/onelocbuild.yml@self parameters: MirrorRepo: fsharp diff --git a/eng/Versions.props b/eng/Versions.props index 7727e2eda17..00bbbc51afb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,7 +14,7 @@ 9 0 - 200 + 300 0 @@ -53,7 +53,7 @@ 17 - 13 + 14 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 372d464ee2f4bfd09fd154c91a6b3be8b1218f3e Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 4 Mar 2025 12:25:52 +0100 Subject: [PATCH 002/134] Update MSBuild (#18347) * msbuild * Update Versions.props * Revert "Update Versions.props" This reverts commit c1c61eb947a74e7ff182d7d5af724f90a48d5fb3. * Update SourceBuildPrebuiltBaseline.xml --------- Co-authored-by: Kevin Ransom (msft) --- eng/SourceBuildPrebuiltBaseline.xml | 8 ++++++++ eng/Versions.props | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml index 18f3b782d76..cc63b5594e3 100644 --- a/eng/SourceBuildPrebuiltBaseline.xml +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -26,4 +26,12 @@ + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index bacdd4e3233..97afcbb5f76 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -94,7 +94,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.11.0-preview-24178-03 + 17.12.6 $(RoslynVersion) $(RoslynVersion) From 70171b7ebd461c10345861558c8afddc84e8ef29 Mon Sep 17 00:00:00 2001 From: Ben Hopkins Date: Wed, 5 Mar 2025 15:40:10 +0000 Subject: [PATCH 003/134] Update xcopy-msbuild to latest available version (#18351) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 598d8b7367b..c4d9f0a9ee5 100644 --- a/global.json +++ b/global.json @@ -11,7 +11,7 @@ "Microsoft.VisualStudio.Component.FSharp" ] }, - "xcopy-msbuild": "17.12.0" + "xcopy-msbuild": "17.13.0" }, "native-tools": { "perl": "5.38.2.2" From 82119a07ed606d221e66a4fe8c439100762adc3e Mon Sep 17 00:00:00 2001 From: Maxime Mangel Date: Sat, 8 Mar 2025 22:14:31 +0100 Subject: [PATCH 004/134] Fix nullness RFC link in issue template (#18369) --- .github/ISSUE_TEMPLATE/nullness_issue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/nullness_issue.yml b/.github/ISSUE_TEMPLATE/nullness_issue.yml index 5d46cbdffae..5902c3feb47 100644 --- a/.github/ISSUE_TEMPLATE/nullness_issue.yml +++ b/.github/ISSUE_TEMPLATE/nullness_issue.yml @@ -13,7 +13,7 @@ body: - type: markdown attributes: value: | - Please check at [Nullable Reference Types RFC](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1060-nullable-reference-types.md) if this issue isn't a known limitation, such as missing flow-control analysis after branching constructs like `if` or `while`. Also check at [existing nullness issues](https://github.com/dotnet/fsharp/issues?q=is%3Aissue+label%3AArea-Nullness+) if it hasn't been reported already. + Please check at [Nullable Reference Types RFC](https://github.com/fsharp/fslang-design/blob/main/FSharp-9.0/FS-1060-nullable-reference-types.md) if this issue isn't a known limitation, such as missing flow-control analysis after branching constructs like `if` or `while`. Also check at [existing nullness issues](https://github.com/dotnet/fsharp/issues?q=is%3Aissue+label%3AArea-Nullness+) if it hasn't been reported already. Please provide a succinct description of the issue and choose 1 or more from the following categories of impact - type: checkboxes id: categories @@ -73,4 +73,4 @@ body: Are there any language constructs (typically pattern matching, library constructs, Null/NonNull active patterns, explicit type annotations) allowing the same logic be expressed differently in order to mitigate the experienced nullness issue? placeholder: Possible workaround validations: - required: false \ No newline at end of file + required: false From 55067b14b799b6fe7396cc2c3527bd8e58a72a38 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 10 Mar 2025 11:34:30 +0100 Subject: [PATCH 005/134] Format TypedTreePickle (#18356) --- src/Compiler/TypedTree/TypedTreePickle.fs | 3830 +++++++++++++-------- 1 file changed, 2438 insertions(+), 1392 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index d2b3bd0ec79..b55b784f8f5 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -34,17 +34,19 @@ let verbose = false #endif let ffailwith fileName str = - let msg = FSComp.SR.pickleErrorReadingWritingMetadata(fileName, str) + let msg = FSComp.SR.pickleErrorReadingWritingMetadata (fileName, str) System.Diagnostics.Debug.Assert(false, msg) failwith msg // Fixup pickled data w.r.t. a set of CCU thunks indexed by name [] type PickledDataWithReferences<'rawData> = - { /// The data that uses a collection of CcuThunks internally - RawData: 'rawData - /// The assumptions that need to be fixed up - FixupThunks: CcuThunk [] } + { + /// The data that uses a collection of CcuThunks internally + RawData: 'rawData + /// The assumptions that need to be fixed up + FixupThunks: CcuThunk[] + } member x.Fixup loader = x.FixupThunks |> Array.iter (fun reqd -> reqd.Fixup(loader reqd.AssemblyName)) @@ -53,13 +55,15 @@ type PickledDataWithReferences<'rawData> = /// Like Fixup but loader may return None, in which case there is no fixup. member x.OptionalFixup loader = x.FixupThunks - |> Array.iter(fun reqd-> + |> Array.iter (fun reqd -> // Only fixup what needs fixing up if reqd.IsUnresolvedReference then match loader reqd.AssemblyName with | Some loaded -> - if reqd.IsUnresolvedReference then reqd.Fixup loaded - | _ -> () ) + if reqd.IsUnresolvedReference then + reqd.Fixup loaded + | _ -> ()) + x.RawData //--------------------------------------------------------------------------- @@ -68,108 +72,132 @@ type PickledDataWithReferences<'rawData> = [] type Table<'T when 'T: not null> = - { name: string - tbl: Dictionary<'T, int> - mutable rows: ResizeArray<'T> - mutable count: int } + { + name: string + tbl: Dictionary<'T, int> + mutable rows: ResizeArray<'T> + mutable count: int + } + member tbl.AsArray = Seq.toArray tbl.rows member tbl.Size = tbl.rows.Count + member tbl.Add x = let n = tbl.count tbl.count <- tbl.count + 1 tbl.tbl[x] <- n tbl.rows.Add x n + member tbl.FindOrAdd x = match tbl.tbl.TryGetValue x with | true, res -> res | _ -> tbl.Add x - static member Create n = - { name = n - tbl = Dictionary<_, _>(1000, HashIdentity.Structural) - rows= ResizeArray<_>(1000) - count=0 } + { + name = n + tbl = Dictionary<_, _>(1000, HashIdentity.Structural) + rows = ResizeArray<_>(1000) + count = 0 + } [] type InputTable<'T> = - { itbl_name: string - itbl_rows: 'T array } + { + itbl_name: string + itbl_rows: 'T array + } -let new_itbl n r = { itbl_name=n; itbl_rows=r } +let new_itbl n r = { itbl_name = n; itbl_rows = r } [] type NodeOutTable<'Data, 'Node> = - { NodeStamp : 'Node -> Stamp - NodeName : 'Node -> string - GetRange : 'Node -> range - Deref: 'Node -> 'Data - Name: string - Table: Table } + { + NodeStamp: 'Node -> Stamp + NodeName: 'Node -> string + GetRange: 'Node -> range + Deref: 'Node -> 'Data + Name: string + Table: Table + } + member x.Size = x.Table.Size // inline this to get known-type-information through to the HashMultiMap constructor - static member inline Create (stampF, nameF, rangeF, derefF, nm) = - { NodeStamp = stampF - NodeName = nameF - GetRange = rangeF - Deref = derefF - Name = nm - Table = Table<_>.Create nm } + static member inline Create(stampF, nameF, rangeF, derefF, nm) = + { + NodeStamp = stampF + NodeName = nameF + GetRange = rangeF + Deref = derefF + Name = nm + Table = Table<_>.Create nm + } [] type WriterState = - { os: ByteBuffer - osB: ByteBuffer - oscope: CcuThunk - occus: Table - oentities: NodeOutTable - otypars: NodeOutTable - ovals: NodeOutTable - oanoninfos: NodeOutTable - ostrings: Table - opubpaths: Table - onlerefs: Table - osimpletys: Table - oglobals : TcGlobals - mutable isStructThisArgPos : bool - ofile : string - /// Indicates if we are using in-memory format, where we store XML docs as well - oInMem : bool - } + { + os: ByteBuffer + osB: ByteBuffer + oscope: CcuThunk + occus: Table + oentities: NodeOutTable + otypars: NodeOutTable + ovals: NodeOutTable + oanoninfos: NodeOutTable + ostrings: Table + opubpaths: Table + onlerefs: Table + osimpletys: Table + oglobals: TcGlobals + mutable isStructThisArgPos: bool + ofile: string + /// Indicates if we are using in-memory format, where we store XML docs as well + oInMem: bool + } + let pfailwith st str = ffailwith st.ofile str [] type NodeInTable<'Data, 'Node> = - { LinkNode : 'Node -> 'Data -> unit - IsLinked : 'Node -> bool - Name : string - Nodes : 'Node[] } + { + LinkNode: 'Node -> 'Data -> unit + IsLinked: 'Node -> bool + Name: string + Nodes: 'Node[] + } + member x.Get n = x.Nodes[n] member x.Count = x.Nodes.Length - static member Create (mkEmpty, lnk, isLinked, nm, n) = - { LinkNode = lnk; IsLinked = isLinked; Name = nm; Nodes = Array.init n (fun _i -> mkEmpty() ) } + static member Create(mkEmpty, lnk, isLinked, nm, n) = + { + LinkNode = lnk + IsLinked = isLinked + Name = nm + Nodes = Array.init n (fun _i -> mkEmpty ()) + } [] type ReaderState = - { is: ByteStream - // secondary stream of information for F# 5.0 - isB: ByteStream - iilscope: ILScopeRef - iccus: InputTable - ientities: NodeInTable - itypars: NodeInTable - ivals: NodeInTable - ianoninfos: NodeInTable - istrings: InputTable - ipubpaths: InputTable - inlerefs: InputTable - isimpletys: InputTable - ifile: string - iILModule : ILModuleDef option // the Abstract IL metadata for the DLL being read - } + { + is: ByteStream + // secondary stream of information for F# 5.0 + isB: ByteStream + iilscope: ILScopeRef + iccus: InputTable + ientities: NodeInTable + itypars: NodeInTable + ivals: NodeInTable + ianoninfos: NodeInTable + istrings: InputTable + ipubpaths: InputTable + inlerefs: InputTable + isimpletys: InputTable + ifile: string + iILModule: ILModuleDef option // the Abstract IL metadata for the DLL being read + } let ufailwith st str = ffailwith st.ifile str @@ -186,23 +214,23 @@ let p_byteB b st = st.osB.EmitIntAsByte b let p_bool b st = p_byte (if b then 1 else 0) st /// Write an uncompressed integer to the main stream. -let prim_p_int32 i st = +let prim_p_int32 i st = p_byte (b0 i) st p_byte (b1 i) st p_byte (b2 i) st p_byte (b3 i) st /// Write an uncompressed integer to the B stream. -let prim_p_int32B i st = +let prim_p_int32B i st = p_byteB (b0 i) st p_byteB (b1 i) st p_byteB (b2 i) st p_byteB (b3 i) st -/// Compress integers according to the same scheme used by CLR metadata -/// This halves the size of pickled data -let p_int32 n st = - if n >= 0 && n <= 0x7F then +/// Compress integers according to the same scheme used by CLR metadata +/// This halves the size of pickled data +let p_int32 n st = + if n >= 0 && n <= 0x7F then p_byte (b0 n) st else if n >= 0x80 && n <= 0x3FFF then p_byte (0x80 ||| (n >>> 8)) st @@ -212,17 +240,18 @@ let p_int32 n st = prim_p_int32 n st /// Write a compressed integer to the B stream. -let p_int32B n st = - if n >= 0 && n <= 0x7F then +let p_int32B n st = + if n >= 0 && n <= 0x7F then p_byteB (b0 n) st - else if n >= 0x80 && n <= 0x3FFF then - p_byteB ( (0x80 ||| (n >>> 8))) st - p_byteB ( (n &&& 0xFF)) st - else + else if n >= 0x80 && n <= 0x3FFF then + p_byteB ((0x80 ||| (n >>> 8))) st + p_byteB ((n &&& 0xFF)) st + else p_byteB 0xFF st prim_p_int32B n st let space = () + let p_space n () st = for i = 0 to n - 1 do p_byte 0 st @@ -257,44 +286,80 @@ let p_uint8 (i: byte) st = p_byte (int i) st let p_int16 (i: int16) st = p_int32 (int32 i) st let p_uint16 (x: uint16) st = p_int32 (int32 x) st let p_uint32 (x: uint32) st = p_int32 (int32 x) st + let p_int64 (i: int64) st = p_int32 (int32 (i &&& 0xFFFFFFFFL)) st p_int32 (int32 (i >>> 32)) st let p_uint64 (x: uint64) st = p_int64 (int64 x) st -let bits_of_float32 (x: float32) = System.BitConverter.ToInt32(System.BitConverter.GetBytes x, 0) +let bits_of_float32 (x: float32) = + System.BitConverter.ToInt32(System.BitConverter.GetBytes x, 0) + let bits_of_float (x: float) = System.BitConverter.DoubleToInt64Bits x let p_single i st = p_int32 (bits_of_float32 i) st let p_char i st = p_uint16 (uint16 (int32 i)) st let inline p_tup2 p1 p2 (a, b) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit) + (p1 a st: unit) + (p2 b st: unit) let inline p_tup3 p1 p2 p3 (a, b, c) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit) - -let inline p_tup4 p1 p2 p3 p4 (a, b, c, d) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit); (p4 d st : unit) - -let inline p_tup5 p1 p2 p3 p4 p5 (a, b, c, d, e) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit); (p4 d st : unit); (p5 e st : unit) - -let inline p_tup6 p1 p2 p3 p4 p5 p6 (a, b, c, d, e, f) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit); (p4 d st : unit); (p5 e st : unit); (p6 f st : unit) - -let inline p_tup9 p1 p2 p3 p4 p5 p6 p7 p8 p9 (a, b, c, d, e, f, x7, x8, x9) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit); (p4 d st : unit); (p5 e st : unit); (p6 f st : unit); (p7 x7 st : unit); (p8 x8 st : unit); (p9 x9 st : unit) - -let inline p_tup11 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 (a, b, c, d, e, f, x7, x8, x9, x10, x11) (st: WriterState) = - (p1 a st : unit); (p2 b st : unit); (p3 c st : unit); (p4 d st : unit); (p5 e st : unit); (p6 f st : unit); (p7 x7 st : unit); (p8 x8 st : unit); (p9 x9 st : unit); (p10 x10 st : unit); (p11 x11 st : unit) + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + +let inline p_tup4 p1 p2 p3 p4 (a, b, c, d) (st: WriterState) = + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + (p4 d st: unit) + +let inline p_tup5 p1 p2 p3 p4 p5 (a, b, c, d, e) (st: WriterState) = + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + (p4 d st: unit) + (p5 e st: unit) + +let inline p_tup6 p1 p2 p3 p4 p5 p6 (a, b, c, d, e, f) (st: WriterState) = + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + (p4 d st: unit) + (p5 e st: unit) + (p6 f st: unit) + +let inline p_tup9 p1 p2 p3 p4 p5 p6 p7 p8 p9 (a, b, c, d, e, f, x7, x8, x9) (st: WriterState) = + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + (p4 d st: unit) + (p5 e st: unit) + (p6 f st: unit) + (p7 x7 st: unit) + (p8 x8 st: unit) + (p9 x9 st: unit) + +let inline p_tup11 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 (a, b, c, d, e, f, x7, x8, x9, x10, x11) (st: WriterState) = + (p1 a st: unit) + (p2 b st: unit) + (p3 c st: unit) + (p4 d st: unit) + (p5 e st: unit) + (p6 f st: unit) + (p7 x7 st: unit) + (p8 x8 st: unit) + (p9 x9 st: unit) + (p10 x10 st: unit) + (p11 x11 st: unit) let u_byte st = int (st.is.ReadByte()) /// Unpickle an uncompressed integer from the B stream /// The extra B stream of bytes is implicitly 0 if not present -let u_byteB st = +let u_byteB st = if st.isB.IsEOF then 0 else int (st.isB.ReadByte()) type unpickler<'T> = ReaderState -> 'T @@ -303,14 +368,14 @@ let u_bool st = let b = u_byte st in (b = 1) /// Unpickle an uncompressed integer from the main stream let prim_u_int32 st = - let b0 = (u_byte st) - let b1 = (u_byte st) - let b2 = (u_byte st) - let b3 = (u_byte st) + let b0 = (u_byte st) + let b1 = (u_byte st) + let b2 = (u_byte st) + let b3 = (u_byte st) b0 ||| (b1 <<< 8) ||| (b2 <<< 16) ||| (b3 <<< 24) /// Unpickle an uncompressed integer from the B stream -let prim_u_int32B st = +let prim_u_int32B st = let b0 = u_byteB st let b1 = u_byteB st let b2 = u_byteB st @@ -319,37 +384,40 @@ let prim_u_int32B st = let u_int32 st = let b0 = u_byte st - if b0 <= 0x7F then b0 + + if b0 <= 0x7F then + b0 else if b0 <= 0xbf then let b0 = b0 &&& 0x7F let b1 = (u_byte st) (b0 <<< 8) ||| b1 else - assert(b0 = 0xFF) + assert (b0 = 0xFF) prim_u_int32 st /// Unpickle a compressed integer from the B stream. /// The integer is 0 if the B stream is not present. -let u_int32B st = +let u_int32B st = let b0 = u_byteB st - if b0 <= 0x7F then b0 - else if b0 <= 0xbf then + + if b0 <= 0x7F then + b0 + else if b0 <= 0xbf then let b0 = b0 &&& 0x7F let b1 = u_byteB st (b0 <<< 8) ||| b1 - else - assert(b0 = 0xFF) + else + assert (b0 = 0xFF) prim_u_int32B st let u_byte_memory st = - let n = (u_int32 st) + let n = (u_int32 st) st.is.ReadBytes n -let u_bytes st = - (u_byte_memory st).ToArray() +let u_bytes st = (u_byte_memory st).ToArray() let u_prim_string st = - let len = (u_int32 st) + let len = (u_int32 st) st.is.ReadUtf8String len let u_int st = u_int32 st @@ -359,26 +427,33 @@ let u_uint8 st = byte (u_byte st) let u_int16 st = int16 (u_int32 st) let u_uint16 st = uint16 (u_int32 st) let u_uint32 st = uint32 (u_int32 st) + let u_int64 st = let b1 = (int64 (u_int32 st)) &&& 0xFFFFFFFFL let b2 = int64 (u_int32 st) b1 ||| (b2 <<< 32) let u_uint64 st = uint64 (u_int64 st) -let float32_of_bits (x: int32) = System.BitConverter.ToSingle(System.BitConverter.GetBytes x, 0) + +let float32_of_bits (x: int32) = + System.BitConverter.ToSingle(System.BitConverter.GetBytes x, 0) + let float_of_bits (x: int64) = System.BitConverter.Int64BitsToDouble x let u_single st = float32_of_bits (u_int32 st) let u_char st = char (int32 (u_uint16 st)) + let u_space n st = for i = 0 to n - 1 do let b = u_byte st + if b <> 0 then - warning(Error(FSComp.SR.pickleUnexpectedNonZero st.ifile, range0)) + warning (Error(FSComp.SR.pickleUnexpectedNonZero st.ifile, range0)) /// Represents space that was reserved but is now possibly used let u_used_space1 f st = let b = u_byte st + match b with | 0 -> None | 1 -> @@ -386,47 +461,102 @@ let u_used_space1 f st = u_space 1 st Some x | _ -> - warning(Error(FSComp.SR.pickleUnexpectedNonZero st.ifile, range0)); None + warning (Error(FSComp.SR.pickleUnexpectedNonZero st.ifile, range0)) + None +let inline u_tup2 p1 p2 (st: ReaderState) = + let a = p1 st in + let b = p2 st in + (a, b) -let inline u_tup2 p1 p2 (st: ReaderState) = let a = p1 st in let b = p2 st in (a, b) - -let inline u_tup3 p1 p2 p3 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in (a, b, c) +let inline u_tup3 p1 p2 p3 (st: ReaderState) = + let a = p1 st in + let b = p2 st in + let c = p3 st in + (a, b, c) let inline u_tup4 p1 p2 p3 p4 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in (a, b, c, d) + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + (a, b, c, d) let inline u_tup5 p1 p2 p3 p4 p5 (st: ReaderState) = - let a = p1 st - let b = p2 st - let c = p3 st - let d = p4 st - let e = p5 st - (a, b, c, d, e) + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + (a, b, c, d, e) let inline u_tup6 p1 p2 p3 p4 p5 p6 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in (a, b, c, d, e, f) + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + let e = p5 st in + let f = p6 st in + (a, b, c, d, e, f) let inline u_tup8 p1 p2 p3 p4 p5 p6 p7 p8 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in (a, b, c, d, e, f, x7, x8) + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + let e = p5 st in + let f = p6 st in + let x7 = p7 st in + let x8 = p8 st in + (a, b, c, d, e, f, x7, x8) let inline u_tup9 p1 p2 p3 p4 p5 p6 p7 p8 p9 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in (a, b, c, d, e, f, x7, x8, x9) + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + let e = p5 st in + let f = p6 st in + let x7 = p7 st in + let x8 = p8 st in + let x9 = p9 st in + (a, b, c, d, e, f, x7, x8, x9) let inline u_tup13 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in - let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in - let x9 = p9 st in let x10 = p10 st in let x11 = p11 st in let x12 = p12 st in let x13 = p13 st in - (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13) + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + let e = p5 st in + let f = p6 st in + let x7 = p7 st in + let x8 = p8 st in + let x9 = p9 st in + let x10 = p10 st in + let x11 = p11 st in + let x12 = p12 st in + let x13 = p13 st in + (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13) let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (st: ReaderState) = - let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in - let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in - let x9 = p9 st in let x10 = p10 st in let x11 = p11 st in let x12 = p12 st in let x13 = p13 st in - let x14 = p14 st in let x15 = p15 st in let x16 = p16 st in let x17 = p17 st in - (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) - + let a = p1 st in + let b = p2 st in + let c = p3 st in + let d = p4 st in + let e = p5 st in + let f = p6 st in + let x7 = p7 st in + let x8 = p8 st in + let x9 = p9 st in + let x10 = p10 st in + let x11 = p11 st in + let x12 = p12 st in + let x13 = p13 st in + let x14 = p14 st in + let x15 = p15 st in + let x16 = p16 st in + let x17 = p17 st in + (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) //--------------------------------------------------------------------------- // Pickle/unpickle operations for observably shared graph nodes @@ -435,8 +565,8 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // exception Nope // ctxt is for debugging -let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = - let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) +let p_osgn_ref (_ctxt: string) (outMap: NodeOutTable<_, _>) x st = + let idx = outMap.Table.FindOrAdd(outMap.NodeStamp x) //if ((idx = 0) && outMap.Name = "oentities") then // let msg = // sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" @@ -447,7 +577,7 @@ let p_osgn_ref (_ctxt: string) (outMap : NodeOutTable<_, _>) x st = // System.Diagnostics.Debug.Assert(false, msg ) p_int idx st -let p_osgn_decl (outMap : NodeOutTable<_, _>) p x st = +let p_osgn_decl (outMap: NodeOutTable<_, _>) p x st = let stamp = outMap.NodeStamp x let idx = outMap.Table.FindOrAdd stamp //dprintf "decl %d#%d in table %s has name %s\n" idx (outMap.NodeStamp x) outMap.Name (outMap.NodeName x) @@ -455,7 +585,10 @@ let p_osgn_decl (outMap : NodeOutTable<_, _>) p x st = let u_osgn_ref (inMap: NodeInTable<_, _>) st = let n = u_int st - if n < 0 || n >= inMap.Count then ufailwith st ("u_osgn_ref: out of range, table = "+inMap.Name+", n = "+string n) + + if n < 0 || n >= inMap.Count then + ufailwith st ("u_osgn_ref: out of range, table = " + inMap.Name + ", n = " + string n) + inMap.Get n let u_osgn_decl (inMap: NodeInTable<_, _>) u st = @@ -470,9 +603,20 @@ let u_osgn_decl (inMap: NodeInTable<_, _>) u st = //--------------------------------------------------------------------------- let encode_uniq (tbl: Table<_>) key = tbl.FindOrAdd key + let lookup_uniq st tbl n = let arr = tbl.itbl_rows - if n < 0 || n >= arr.Length then ufailwith st ("lookup_uniq in table "+tbl.itbl_name+" out of range, n = "+string n+ ", sizeof(tab) = " + string (Array.length arr)) + + if n < 0 || n >= arr.Length then + ufailwith + st + ("lookup_uniq in table " + + tbl.itbl_name + + " out of range, n = " + + string n + + ", sizeof(tab) = " + + string (Array.length arr)) + arr[n] //--------------------------------------------------------------------------- @@ -481,7 +625,7 @@ let lookup_uniq st tbl n = //------------------------------------------------------------------------- let p_array_core f (x: 'T[]) st = - for i = 0 to x.Length-1 do + for i = 0 to x.Length - 1 do f x[i] st let p_array f (x: 'T[]) st = @@ -496,26 +640,31 @@ let p_list f x st = p_int (List.length x) st p_list_core f x st -let p_listB f x st = +let p_listB f x st = p_intB (List.length x) st p_list_core f x st -let p_list_ext extraf f x st = +let p_list_ext extraf f x st = let n = List.length x let n = if Option.isSome extraf then n ||| 0x80000000 else n p_int n st + match extraf with | None -> () | Some f -> f st + p_list_core f x st let p_List f (x: 'T list) st = p_list f x st -let p_wrap (f: 'T -> 'U) (p : 'U pickler) : 'T pickler = (fun x st -> p (f x) st) +let p_wrap (f: 'T -> 'U) (p: 'U pickler) : 'T pickler = (fun x st -> p (f x) st) + let p_option f x st = match x with | None -> p_byte 0 st - | Some h -> p_byte 1 st; f h st + | Some h -> + p_byte 1 st + f h st // Pickle lazy values in such a way that they can, in some future F# compiler version, be read back // lazily. However, a lazy reader is not used in this version because the value may contain the definitions of some @@ -544,7 +693,7 @@ let private p_lazy_impl p v st = p v st // Determine and fixup the length of the pickled data let idx2 = st.os.Position - st.os.FixupInt32 fixupPos1 (idx2-idx1) + st.os.FixupInt32 fixupPos1 (idx2 - idx1) // Determine and fixup the ranges of OSGN nodes defined within the lazy portion let otyconsIdx2 = st.oentities.Size let otyparsIdx2 = st.otypars.Size @@ -559,29 +708,39 @@ let private p_lazy_impl p v st = let p_lazy p x st = p_lazy_impl p (InterruptibleLazy.force x) st -let p_maybe_lazy p (x: MaybeLazy<_>) st = - p_lazy_impl p x.Value st +let p_maybe_lazy p (x: MaybeLazy<_>) st = p_lazy_impl p x.Value st let p_hole () = let mutable h = None - (fun f -> h <- Some f), (fun x st -> match h with Some f -> f x st | None -> pfailwith st "p_hole: unfilled hole") + + (fun f -> h <- Some f), + (fun x st -> + match h with + | Some f -> f x st + | None -> pfailwith st "p_hole: unfilled hole") let p_hole2 () = let mutable h = None - (fun f -> h <- Some f), (fun arg x st -> match h with Some f -> f arg x st | None -> pfailwith st "p_hole2: unfilled hole") + + (fun f -> h <- Some f), + (fun arg x st -> + match h with + | Some f -> f arg x st + | None -> pfailwith st "p_hole2: unfilled hole") let u_array_core f n st = let res = Array.zeroCreate n - for i = 0 to n-1 do + + for i = 0 to n - 1 do res[i] <- f st + res let u_array f st = let n = u_int st u_array_core f n st -let u_list_core f n st = - List.init n (fun _ -> f st) +let u_list_core f n st = List.init n (fun _ -> f st) let u_list f st = let n = u_int st @@ -594,11 +753,13 @@ let u_listB f st = let u_list_ext extra f st = let n = u_int st + let extraItem = if n &&& 0x80000000 = 0x80000000 then - Some (extra st) + Some(extra st) else None + let list = u_list_core f (n &&& 0x7FFFFFFF) st extraItem, list @@ -607,37 +768,45 @@ let u_List f st = u_list f st // new List<_> (u_array f st) // Mark up default constraints with a priority in reverse order: last gets 0 etc. See comment on TyparConstraint.DefaultsTo let u_list_revi f st = let n = u_int st - [ for i = 0 to n-1 do - yield f st (n-1-i) ] + [ + for i = 0 to n - 1 do + yield f st (n - 1 - i) + ] -let u_wrap (f: 'U -> 'T) (u : 'U unpickler) : 'T unpickler = (u >> f) +let u_wrap (f: 'U -> 'T) (u: 'U unpickler) : 'T unpickler = (u >> f) let u_option f st = let tag = u_byte st + match tag with | 0 -> None - | 1 -> Some (f st) + | 1 -> Some(f st) | n -> ufailwith st ("u_option: found number " + string n) let u_lazy u st = // Read the number of bytes in the record - let len = prim_u_int32 st // fixupPos1 + let len = prim_u_int32 st // fixupPos1 // These are the ranges of OSGN nodes defined within the lazily read portion of the graph let otyconsIdx1 = prim_u_int32 st // fixupPos2 let otyconsIdx2 = prim_u_int32 st // fixupPos3 let otyparsIdx1 = prim_u_int32 st // fixupPos4 let otyparsIdx2 = prim_u_int32 st // fixupPos5 - let ovalsIdx1 = prim_u_int32 st // fixupPos6 - let ovalsIdx2 = prim_u_int32 st // fixupPos7 + let ovalsIdx1 = prim_u_int32 st // fixupPos6 + let ovalsIdx2 = prim_u_int32 st // fixupPos7 ignore (len, otyconsIdx1, otyconsIdx2, otyparsIdx1, otyparsIdx2, ovalsIdx1, ovalsIdx2) InterruptibleLazy.FromValue(u st) let u_hole () = let mutable h = None - (fun f -> h <- Some f), (fun st -> match h with Some f -> f st | None -> ufailwith st "u_hole: unfilled hole") + + (fun f -> h <- Some f), + (fun st -> + match h with + | Some f -> f st + | None -> ufailwith st "u_hole: unfilled hole") //--------------------------------------------------------------------------- // Pickle/unpickle F# interface data @@ -649,7 +818,7 @@ let encode_string stringTab x = encode_uniq stringTab x let decode_string x = x let lookup_string st stringTab x = lookup_uniq st stringTab x let u_encoded_string = u_prim_string -let u_string st = lookup_uniq st st.istrings (u_int st) +let u_string st = lookup_uniq st st.istrings (u_int st) let u_strings = u_list u_string let p_encoded_string = p_prim_string let p_string s st = p_int (encode_string st.ostrings s) st @@ -659,11 +828,13 @@ let p_strings = p_list p_string // A huge number of these occur in pickled F# data, so make them unique let encode_ccuref ccuTab (x: CcuThunk) = encode_uniq ccuTab x.AssemblyName let lookup_ccuref st ccuTab x = lookup_uniq st ccuTab x + let u_encoded_ccuref st = match u_byte st with | 0 -> u_prim_string st | n -> ufailwith st ("u_encoded_ccuref: found number " + string n) -let u_ccuref st = lookup_uniq st st.iccus (u_int st) + +let u_ccuref st = lookup_uniq st st.iccus (u_int st) let p_encoded_ccuref x st = p_byte 0 st // leave a dummy tag to make room for future encodings of ccurefs @@ -673,17 +844,25 @@ let p_ccuref s st = p_int (encode_ccuref st.occus s) st // References to public items in this module // A huge number of these occur in pickled F# data, so make them unique -let decode_pubpath st stringTab a = PubPath(Array.map (lookup_string st stringTab) a) +let decode_pubpath st stringTab a = + PubPath(Array.map (lookup_string st stringTab) a) + let u_encoded_pubpath = u_array u_int let u_pubpath st = lookup_uniq st st.ipubpaths (u_int st) -let encode_pubpath stringTab pubpathTab (PubPath a) = encode_uniq pubpathTab (Array.map (encode_string stringTab) a) +let encode_pubpath stringTab pubpathTab (PubPath a) = + encode_uniq pubpathTab (Array.map (encode_string stringTab) a) + let p_encoded_pubpath = p_array p_int -let p_pubpath x st = p_int (encode_pubpath st.ostrings st.opubpaths x) st + +let p_pubpath x st = + p_int (encode_pubpath st.ostrings st.opubpaths x) st // References to other modules // A huge number of these occur in pickled F# data, so make them unique -let decode_nleref st ccuTab stringTab (a, b) = mkNonLocalEntityRef (lookup_ccuref st ccuTab a) (Array.map (lookup_string st stringTab) b) +let decode_nleref st ccuTab stringTab (a, b) = + mkNonLocalEntityRef (lookup_ccuref st ccuTab a) (Array.map (lookup_string st stringTab) b) + let lookup_nleref st nlerefTab x = lookup_uniq st nlerefTab x let u_encoded_nleref = u_tup2 u_int (u_array u_int) let u_nleref st = lookup_uniq st st.inlerefs (u_int st) @@ -695,7 +874,9 @@ let encode_nleref ccuTab stringTab nlerefTab thisCcu (nleref: NonLocalEntityRef) let nleref = match nleref.Deref.PublicPath with | Some pubpath when nleref.Deref.IsProvidedGeneratedTycon -> - if verbose then dprintfn "remapping pickled reference to provider-generated type %s" nleref.Deref.DisplayNameWithStaticParameters + if verbose then + dprintfn "remapping pickled reference to provider-generated type %s" nleref.Deref.DisplayNameWithStaticParameters + rescopePubPath thisCcu pubpath | _ -> nleref #else @@ -704,8 +885,11 @@ let encode_nleref ccuTab stringTab nlerefTab thisCcu (nleref: NonLocalEntityRef) let (NonLocalEntityRef(a, b)) = nleref encode_uniq nlerefTab (encode_ccuref ccuTab a, Array.map (encode_string stringTab) b) + let p_encoded_nleref = p_tup2 p_int (p_array p_int) -let p_nleref x st = p_int (encode_nleref st.occus st.ostrings st.onlerefs st.oscope x) st + +let p_nleref x st = + p_int (encode_nleref st.occus st.ostrings st.onlerefs st.oscope x) st // Simple types are types like "int", represented as TType(Ref_nonlocal(..., "int"), []). // A huge number of these occur in pickled F# data, so make them unique. @@ -714,121 +898,172 @@ let p_nleref x st = p_int (encode_nleref st.occus st.ostrings st.onlerefs st.osc // For old assemblies it is, if we give those assemblies the ambivalent interpretation. // For new assemblies compiled with null-checking on it isn't, if the default is to give // those the KnownWithoutNull interpretation by default. -let decode_simpletyp st _ccuTab _stringTab nlerefTab a = TType_app(ERefNonLocal (lookup_nleref st nlerefTab a), [], KnownAmbivalentToNull) -let u_encoded_simpletyp st = u_int st +let decode_simpletyp st _ccuTab _stringTab nlerefTab a = + TType_app(ERefNonLocal(lookup_nleref st nlerefTab a), [], KnownAmbivalentToNull) + +let u_encoded_simpletyp st = u_int st let u_simpletyp st = lookup_uniq st st.isimpletys (u_int st) -let encode_simpletyp ccuTab stringTab nlerefTab simpleTyTab thisCcu a = encode_uniq simpleTyTab (encode_nleref ccuTab stringTab nlerefTab thisCcu a) + +let encode_simpletyp ccuTab stringTab nlerefTab simpleTyTab thisCcu a = + encode_uniq simpleTyTab (encode_nleref ccuTab stringTab nlerefTab thisCcu a) + let p_encoded_simpletyp x st = p_int x st -let p_simpletyp x st = p_int (encode_simpletyp st.occus st.ostrings st.onlerefs st.osimpletys st.oscope x) st + +let p_simpletyp x st = + p_int (encode_simpletyp st.occus st.ostrings st.onlerefs st.osimpletys st.oscope x) st /// Arbitrary value [] let PickleBufferCapacity = 50000 let pickleObjWithDanglingCcus inMem file g scope p x = - let st1 = - { os = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) - osB = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) - oscope=scope - occus= Table<_>.Create "occus" - oentities=NodeOutTable<_, _>.Create((fun (tc: Tycon) -> tc.Stamp), (fun tc -> tc.LogicalName), (fun tc -> tc.Range), id , "otycons") - otypars=NodeOutTable<_, _>.Create((fun (tp: Typar) -> tp.Stamp), (fun tp -> tp.DisplayName), (fun tp -> tp.Range), id , "otypars") - ovals=NodeOutTable<_, _>.Create((fun (v: Val) -> v.Stamp), (fun v -> v.LogicalName), (fun v -> v.Range), id , "ovals") - oanoninfos=NodeOutTable<_, _>.Create((fun (v: AnonRecdTypeInfo) -> v.Stamp), (fun v -> string v.IlTypeName), (fun _ -> range0), id, "oanoninfos") - ostrings=Table<_>.Create "ostrings" - onlerefs=Table<_>.Create "onlerefs" - opubpaths=Table<_>.Create "opubpaths" - osimpletys=Table<_>.Create "osimpletys" - oglobals=g - ofile=file - oInMem=inMem - isStructThisArgPos = false } - - let ccuNameTab,(ntycons, ntypars, nvals, nanoninfos),stringTab,pubpathTab,nlerefTab,simpleTyTab,phase1bytes,phase1bytesB = - p x st1 - let sizes = - st1.oentities.Size, - st1.otypars.Size, - st1.ovals.Size, - st1.oanoninfos.Size - st1.occus, sizes, st1.ostrings, st1.opubpaths, st1.onlerefs, st1.osimpletys, st1.os.AsMemory(), st1.osB - - let st2 = - { os = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) - osB = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) - oscope=scope - occus= Table<_>.Create "occus (fake)" - oentities=NodeOutTable<_, _>.Create((fun (tc: Tycon) -> tc.Stamp), (fun tc -> tc.LogicalName), (fun tc -> tc.Range), id, "otycons") - otypars=NodeOutTable<_, _>.Create((fun (tp: Typar) -> tp.Stamp), (fun tp -> tp.DisplayName), (fun tp -> tp.Range), id, "otypars") - ovals=NodeOutTable<_, _>.Create((fun (v: Val) -> v.Stamp), (fun v -> v.LogicalName), (fun v -> v.Range), (fun osgn -> osgn), "ovals") - oanoninfos=NodeOutTable<_, _>.Create((fun (v: AnonRecdTypeInfo) -> v.Stamp), (fun v -> string v.IlTypeName), (fun _ -> range0), id, "oanoninfos") - ostrings=Table<_>.Create "ostrings (fake)" - opubpaths=Table<_>.Create "opubpaths (fake)" - onlerefs=Table<_>.Create "onlerefs (fake)" - osimpletys=Table<_>.Create "osimpletys (fake)" - oglobals=g - ofile=file - oInMem=inMem - isStructThisArgPos = false } - - let phase2bytes = - p_array p_encoded_ccuref ccuNameTab.AsArray st2 - // Add a 4th integer indicated by a negative 1st integer - let z1 = if nanoninfos > 0 then -ntycons-1 else ntycons - p_int z1 st2 - p_tup2 p_int p_int (ntypars, nvals) st2 - if nanoninfos > 0 then - p_int nanoninfos st2 - p_tup5 - (p_array p_encoded_string) - (p_array p_encoded_pubpath) - (p_array p_encoded_nleref) - (p_array p_encoded_simpletyp) - p_memory - (stringTab.AsArray, pubpathTab.AsArray, nlerefTab.AsArray, simpleTyTab.AsArray, phase1bytes) - st2 - - // The B stream should be empty in the second phase - let phase2bytesB = st2.osB.AsMemory() - if phase2bytesB.Length <> 0 then failwith "expected phase2bytesB.Length = 0" - (st2.osB :> System.IDisposable).Dispose() - st2.os - - (st1.os :> System.IDisposable).Dispose() - - phase2bytes, phase1bytesB - -let check (ilscope: ILScopeRef) (inMap: NodeInTable<_,_>) = + let st1 = + { + os = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) + osB = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) + oscope = scope + occus = Table<_>.Create "occus" + oentities = + NodeOutTable<_, _> + .Create((fun (tc: Tycon) -> tc.Stamp), (fun tc -> tc.LogicalName), (fun tc -> tc.Range), id, "otycons") + otypars = + NodeOutTable<_, _> + .Create((fun (tp: Typar) -> tp.Stamp), (fun tp -> tp.DisplayName), (fun tp -> tp.Range), id, "otypars") + ovals = + NodeOutTable<_, _> + .Create((fun (v: Val) -> v.Stamp), (fun v -> v.LogicalName), (fun v -> v.Range), id, "ovals") + oanoninfos = + NodeOutTable<_, _> + .Create((fun (v: AnonRecdTypeInfo) -> v.Stamp), (fun v -> string v.IlTypeName), (fun _ -> range0), id, "oanoninfos") + ostrings = Table<_>.Create "ostrings" + onlerefs = Table<_>.Create "onlerefs" + opubpaths = Table<_>.Create "opubpaths" + osimpletys = Table<_>.Create "osimpletys" + oglobals = g + ofile = file + oInMem = inMem + isStructThisArgPos = false + } + + let ccuNameTab, (ntycons, ntypars, nvals, nanoninfos), stringTab, pubpathTab, nlerefTab, simpleTyTab, phase1bytes, phase1bytesB = + p x st1 + + let sizes = + st1.oentities.Size, st1.otypars.Size, st1.ovals.Size, st1.oanoninfos.Size + + st1.occus, sizes, st1.ostrings, st1.opubpaths, st1.onlerefs, st1.osimpletys, st1.os.AsMemory(), st1.osB + + let st2 = + { + os = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) + osB = ByteBuffer.Create(PickleBufferCapacity, useArrayPool = true) + oscope = scope + occus = Table<_>.Create "occus (fake)" + oentities = + NodeOutTable<_, _> + .Create((fun (tc: Tycon) -> tc.Stamp), (fun tc -> tc.LogicalName), (fun tc -> tc.Range), id, "otycons") + otypars = + NodeOutTable<_, _> + .Create((fun (tp: Typar) -> tp.Stamp), (fun tp -> tp.DisplayName), (fun tp -> tp.Range), id, "otypars") + ovals = + NodeOutTable<_, _> + .Create((fun (v: Val) -> v.Stamp), (fun v -> v.LogicalName), (fun v -> v.Range), (fun osgn -> osgn), "ovals") + oanoninfos = + NodeOutTable<_, _> + .Create((fun (v: AnonRecdTypeInfo) -> v.Stamp), (fun v -> string v.IlTypeName), (fun _ -> range0), id, "oanoninfos") + ostrings = Table<_>.Create "ostrings (fake)" + opubpaths = Table<_>.Create "opubpaths (fake)" + onlerefs = Table<_>.Create "onlerefs (fake)" + osimpletys = Table<_>.Create "osimpletys (fake)" + oglobals = g + ofile = file + oInMem = inMem + isStructThisArgPos = false + } + + let phase2bytes = + p_array p_encoded_ccuref ccuNameTab.AsArray st2 + // Add a 4th integer indicated by a negative 1st integer + let z1 = if nanoninfos > 0 then -ntycons - 1 else ntycons + p_int z1 st2 + p_tup2 p_int p_int (ntypars, nvals) st2 + + if nanoninfos > 0 then + p_int nanoninfos st2 + + p_tup5 + (p_array p_encoded_string) + (p_array p_encoded_pubpath) + (p_array p_encoded_nleref) + (p_array p_encoded_simpletyp) + p_memory + (stringTab.AsArray, pubpathTab.AsArray, nlerefTab.AsArray, simpleTyTab.AsArray, phase1bytes) + st2 + + // The B stream should be empty in the second phase + let phase2bytesB = st2.osB.AsMemory() + + if phase2bytesB.Length <> 0 then + failwith "expected phase2bytesB.Length = 0" + + (st2.osB :> System.IDisposable).Dispose() + st2.os + + (st1.os :> System.IDisposable).Dispose() + + phase2bytes, phase1bytesB + +let check (ilscope: ILScopeRef) (inMap: NodeInTable<_, _>) = for i = 0 to inMap.Count - 1 do - let n = inMap.Get i - if not (inMap.IsLinked n) then - warning(Error(FSComp.SR.pickleMissingDefinition (i, inMap.Name, ilscope.QualifiedName), range0)) - // Note for compiler developers: to get information about which item this index relates to, - // enable the conditional in Pickle.p_osgn_ref to refer to the given index number and recompile - // an identical copy of the source for the DLL containing the data being unpickled. A message will - // then be printed indicating the name of the item. - -let unpickleObjWithDanglingCcus file viewedScope (ilModule: ILModuleDef option) u (phase2bytes: ReadOnlyByteMemory) (phase1bytesB: ReadOnlyByteMemory) = + let n = inMap.Get i + + if not (inMap.IsLinked n) then + warning (Error(FSComp.SR.pickleMissingDefinition (i, inMap.Name, ilscope.QualifiedName), range0)) +// Note for compiler developers: to get information about which item this index relates to, +// enable the conditional in Pickle.p_osgn_ref to refer to the given index number and recompile +// an identical copy of the source for the DLL containing the data being unpickled. A message will +// then be printed indicating the name of the item. + +let unpickleObjWithDanglingCcus + file + viewedScope + (ilModule: ILModuleDef option) + u + (phase2bytes: ReadOnlyByteMemory) + (phase1bytesB: ReadOnlyByteMemory) + = let st2 = - { is = ByteStream.FromBytes (phase2bytes, 0, phase2bytes.Length) - isB = ByteStream.FromBytes (ByteMemory.FromArray([| |]).AsReadOnly(), 0, 0) - iilscope = viewedScope - iccus = new_itbl "iccus (fake)" [| |] - ientities = NodeInTable<_, _>.Create (Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itycons", 0) - itypars = NodeInTable<_, _>.Create (Typar.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itypars", 0) - ivals = NodeInTable<_, _>.Create (Val.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ivals", 0) - ianoninfos = NodeInTable<_, _>.Create(AnonRecdTypeInfo.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ianoninfos", 0) - istrings = new_itbl "istrings (fake)" [| |] - inlerefs = new_itbl "inlerefs (fake)" [| |] - ipubpaths = new_itbl "ipubpaths (fake)" [| |] - isimpletys = new_itbl "isimpletys (fake)" [| |] - ifile = file - iILModule = ilModule } + { + is = ByteStream.FromBytes(phase2bytes, 0, phase2bytes.Length) + isB = ByteStream.FromBytes(ByteMemory.FromArray([||]).AsReadOnly(), 0, 0) + iilscope = viewedScope + iccus = new_itbl "iccus (fake)" [||] + ientities = + NodeInTable<_, _> + .Create(Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itycons", 0) + itypars = + NodeInTable<_, _> + .Create(Typar.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itypars", 0) + ivals = + NodeInTable<_, _> + .Create(Val.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ivals", 0) + ianoninfos = + NodeInTable<_, _> + .Create(AnonRecdTypeInfo.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ianoninfos", 0) + istrings = new_itbl "istrings (fake)" [||] + inlerefs = new_itbl "inlerefs (fake)" [||] + ipubpaths = new_itbl "ipubpaths (fake)" [||] + isimpletys = new_itbl "isimpletys (fake)" [||] + ifile = file + iILModule = ilModule + } + let ccuNameTab = u_array u_encoded_ccuref st2 let z1 = u_int st2 - let ntycons = if z1 < 0 then -z1-1 else z1 + let ntycons = if z1 < 0 then -z1 - 1 else z1 let ntypars, nvals = u_tup2 u_int u_int st2 let nanoninfos = if z1 < 0 then u_int st2 else 0 + let stringTab, pubpathTab, nlerefTab, simpleTyTab, phase1bytes = u_tup5 (u_array u_encoded_string) @@ -837,27 +1072,52 @@ let unpickleObjWithDanglingCcus file viewedScope (ilModule: ILModuleDef option) (u_array u_encoded_simpletyp) u_byte_memory st2 - let ccuTab = new_itbl "iccus" (Array.map CcuThunk.CreateDelayed ccuNameTab) - let stringTab = new_itbl "istrings" (Array.map decode_string stringTab) - let pubpathTab = new_itbl "ipubpaths" (Array.map (decode_pubpath st2 stringTab) pubpathTab) - let nlerefTab = new_itbl "inlerefs" (Array.map (decode_nleref st2 ccuTab stringTab) nlerefTab) - let simpletypTab = new_itbl "simpleTyTab" (Array.map (decode_simpletyp st2 ccuTab stringTab nlerefTab) simpleTyTab) + + let ccuTab = new_itbl "iccus" (Array.map CcuThunk.CreateDelayed ccuNameTab) + let stringTab = new_itbl "istrings" (Array.map decode_string stringTab) + + let pubpathTab = + new_itbl "ipubpaths" (Array.map (decode_pubpath st2 stringTab) pubpathTab) + + let nlerefTab = + new_itbl "inlerefs" (Array.map (decode_nleref st2 ccuTab stringTab) nlerefTab) + + let simpletypTab = + new_itbl "simpleTyTab" (Array.map (decode_simpletyp st2 ccuTab stringTab nlerefTab) simpleTyTab) + let data = let st1 = - { is = ByteStream.FromBytes (phase1bytes, 0, phase1bytes.Length) - isB = ByteStream.FromBytes (phase1bytesB, 0, phase1bytesB.Length) - iccus = ccuTab - iilscope = viewedScope - ientities = NodeInTable<_, _>.Create(Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itycons", ntycons) - itypars = NodeInTable<_, _>.Create(Typar.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itypars", ntypars) - ivals = NodeInTable<_, _>.Create(Val.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ivals", nvals) - ianoninfos = NodeInTable<_, _>.Create(AnonRecdTypeInfo.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ianoninfos", nanoninfos) - istrings = stringTab - ipubpaths = pubpathTab - inlerefs = nlerefTab - isimpletys = simpletypTab - ifile = file - iILModule = ilModule } + { + is = ByteStream.FromBytes(phase1bytes, 0, phase1bytes.Length) + isB = ByteStream.FromBytes(phase1bytesB, 0, phase1bytesB.Length) + iccus = ccuTab + iilscope = viewedScope + ientities = + NodeInTable<_, _> + .Create(Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itycons", ntycons) + itypars = + NodeInTable<_, _> + .Create(Typar.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "itypars", ntypars) + ivals = + NodeInTable<_, _> + .Create(Val.NewUnlinked, (fun osgn tg -> osgn.Link tg), (fun osgn -> osgn.IsLinked), "ivals", nvals) + ianoninfos = + NodeInTable<_, _> + .Create( + AnonRecdTypeInfo.NewUnlinked, + (fun osgn tg -> osgn.Link tg), + (fun osgn -> osgn.IsLinked), + "ianoninfos", + nanoninfos + ) + istrings = stringTab + ipubpaths = pubpathTab + inlerefs = nlerefTab + isimpletys = simpletypTab + ifile = file + iILModule = ilModule + } + let res = u st1 check viewedScope st1.ientities check viewedScope st1.ientities @@ -865,8 +1125,10 @@ let unpickleObjWithDanglingCcus file viewedScope (ilModule: ILModuleDef option) check viewedScope st1.itypars res - {RawData=data; FixupThunks=ccuTab.itbl_rows } - + { + RawData = data + FixupThunks = ccuTab.itbl_rows + } //========================================================================= // PART II @@ -878,29 +1140,49 @@ let unpickleObjWithDanglingCcus file viewedScope (ilModule: ILModuleDef option) let p_ILPublicKey x st = match x with - | PublicKey b -> p_byte 0 st; p_bytes b st - | PublicKeyToken b -> p_byte 1 st; p_bytes b st + | PublicKey b -> + p_byte 0 st + p_bytes b st + | PublicKeyToken b -> + p_byte 1 st + p_bytes b st -let p_ILVersion (x: ILVersionInfo) st = p_tup4 p_uint16 p_uint16 p_uint16 p_uint16 (x.Major, x.Minor, x.Build, x.Revision) st +let p_ILVersion (x: ILVersionInfo) st = + p_tup4 p_uint16 p_uint16 p_uint16 p_uint16 (x.Major, x.Minor, x.Build, x.Revision) st let p_ILModuleRef (x: ILModuleRef) st = p_tup3 p_string p_bool (p_option p_bytes) (x.Name, x.HasMetadata, x.Hash) st let p_ILAssemblyRef (x: ILAssemblyRef) st = p_byte 0 st // leave a dummy tag to make room for future encodings of assembly refs - p_tup6 p_string (p_option p_bytes) (p_option p_ILPublicKey) p_bool (p_option p_ILVersion) (p_option p_string) - ( x.Name, x.Hash, x.PublicKey, x.Retargetable, x.Version, x.Locale) st + + p_tup6 + p_string + (p_option p_bytes) + (p_option p_ILPublicKey) + p_bool + (p_option p_ILVersion) + (p_option p_string) + (x.Name, x.Hash, x.PublicKey, x.Retargetable, x.Version, x.Locale) + st let p_ILScopeRef x st = match x with - | ILScopeRef.Local -> p_byte 0 st - | ILScopeRef.Module mref -> p_byte 1 st; p_ILModuleRef mref st - | ILScopeRef.Assembly aref -> p_byte 2 st; p_ILAssemblyRef aref st + | ILScopeRef.Local -> p_byte 0 st + | ILScopeRef.Module mref -> + p_byte 1 st + p_ILModuleRef mref st + | ILScopeRef.Assembly aref -> + p_byte 2 st + p_ILAssemblyRef aref st // Encode primary assembly as a normal assembly ref - | ILScopeRef.PrimaryAssembly -> p_byte 2 st; p_ILAssemblyRef st.oglobals.ilg.primaryAssemblyRef st + | ILScopeRef.PrimaryAssembly -> + p_byte 2 st + p_ILAssemblyRef st.oglobals.ilg.primaryAssemblyRef st let u_ILPublicKey st = let tag = u_byte st + match tag with | 0 -> u_bytes st |> PublicKey | 1 -> u_bytes st |> PublicKeyToken @@ -916,9 +1198,12 @@ let u_ILModuleRef st = let u_ILAssemblyRef st = let tag = u_byte st + match tag with | 0 -> - let a, b, c, d, e, f = u_tup6 u_string (u_option u_bytes) (u_option u_ILPublicKey) u_bool (u_option u_ILVersion) (u_option u_string) st + let a, b, c, d, e, f = + u_tup6 u_string (u_option u_bytes) (u_option u_ILPublicKey) u_bool (u_option u_ILVersion) (u_option u_string) st + ILAssemblyRef.Create(a, b, c, d, e, f) | _ -> ufailwith st "u_ILAssemblyRef" @@ -928,52 +1213,79 @@ let u_ILAssemblyRef st = let u_ILScopeRef st = let res = let tag = u_byte st + match tag with | 0 -> ILScopeRef.Local | 1 -> u_ILModuleRef st |> ILScopeRef.Module | 2 -> u_ILAssemblyRef st |> ILScopeRef.Assembly | _ -> ufailwith st "u_ILScopeRef" + let res = rescopeILScopeRef st.iilscope res res let p_ILHasThis x st = - p_byte (match x with - | ILThisConvention.Instance -> 0 - | ILThisConvention.InstanceExplicit -> 1 - | ILThisConvention.Static -> 2) st + p_byte + (match x with + | ILThisConvention.Instance -> 0 + | ILThisConvention.InstanceExplicit -> 1 + | ILThisConvention.Static -> 2) + st -let p_ILArrayShape = p_wrap (fun (ILArrayShape x) -> x) (p_list (p_tup2 (p_option p_int32) (p_option p_int32))) +let p_ILArrayShape = + p_wrap (fun (ILArrayShape x) -> x) (p_list (p_tup2 (p_option p_int32) (p_option p_int32))) let rec p_ILType ty st = match ty with - | ILType.Void -> p_byte 0 st - | ILType.Array (shape, ty) -> p_byte 1 st; p_tup2 p_ILArrayShape p_ILType (shape, ty) st - | ILType.Value tspec -> p_byte 2 st; p_ILTypeSpec tspec st - | ILType.Boxed tspec -> p_byte 3 st; p_ILTypeSpec tspec st - | ILType.Ptr ty -> p_byte 4 st; p_ILType ty st - | ILType.Byref ty -> p_byte 5 st; p_ILType ty st - | ILType.FunctionPointer csig -> p_byte 6 st; p_ILCallSig csig st - | ILType.TypeVar n -> p_byte 7 st; p_uint16 n st - | ILType.Modified (req, tref, ty) -> p_byte 8 st; p_tup3 p_bool p_ILTypeRef p_ILType (req, tref, ty) st + | ILType.Void -> p_byte 0 st + | ILType.Array(shape, ty) -> + p_byte 1 st + p_tup2 p_ILArrayShape p_ILType (shape, ty) st + | ILType.Value tspec -> + p_byte 2 st + p_ILTypeSpec tspec st + | ILType.Boxed tspec -> + p_byte 3 st + p_ILTypeSpec tspec st + | ILType.Ptr ty -> + p_byte 4 st + p_ILType ty st + | ILType.Byref ty -> + p_byte 5 st + p_ILType ty st + | ILType.FunctionPointer csig -> + p_byte 6 st + p_ILCallSig csig st + | ILType.TypeVar n -> + p_byte 7 st + p_uint16 n st + | ILType.Modified(req, tref, ty) -> + p_byte 8 st + p_tup3 p_bool p_ILTypeRef p_ILType (req, tref, ty) st and p_ILTypes tys = p_list p_ILType tys and p_ILBasicCallConv x st = - p_byte (match x with - | ILArgConvention.Default -> 0 - | ILArgConvention.CDecl -> 1 - | ILArgConvention.StdCall -> 2 - | ILArgConvention.ThisCall -> 3 - | ILArgConvention.FastCall -> 4 - | ILArgConvention.VarArg -> 5) st + p_byte + (match x with + | ILArgConvention.Default -> 0 + | ILArgConvention.CDecl -> 1 + | ILArgConvention.StdCall -> 2 + | ILArgConvention.ThisCall -> 3 + | ILArgConvention.FastCall -> 4 + | ILArgConvention.VarArg -> 5) + st -and p_ILCallConv (Callconv(x, y)) st = p_tup2 p_ILHasThis p_ILBasicCallConv (x, y) st +and p_ILCallConv (Callconv(x, y)) st = + p_tup2 p_ILHasThis p_ILBasicCallConv (x, y) st -and p_ILCallSig x st = p_tup3 p_ILCallConv p_ILTypes p_ILType (x.CallingConv, x.ArgTypes, x.ReturnType) st +and p_ILCallSig x st = + p_tup3 p_ILCallConv p_ILTypes p_ILType (x.CallingConv, x.ArgTypes, x.ReturnType) st -and p_ILTypeRef (x: ILTypeRef) st = p_tup3 p_ILScopeRef p_strings p_string (x.Scope, x.Enclosing, x.Name) st +and p_ILTypeRef (x: ILTypeRef) st = + p_tup3 p_ILScopeRef p_strings p_string (x.Scope, x.Enclosing, x.Name) st -and p_ILTypeSpec (a: ILTypeSpec) st = p_tup2 p_ILTypeRef p_ILTypes (a.TypeRef, a.GenericArgs) st +and p_ILTypeSpec (a: ILTypeSpec) st = + p_tup2 p_ILTypeRef p_ILTypes (a.TypeRef, a.GenericArgs) st let u_ILBasicCallConv st = match u_byte st with @@ -992,67 +1304,112 @@ let u_ILHasThis st = | 2 -> ILThisConvention.Static | _ -> ufailwith st "u_ILHasThis" -let u_ILCallConv st = let a, b = u_tup2 u_ILHasThis u_ILBasicCallConv st in Callconv(a, b) -let u_ILTypeRef st = let a, b, c = u_tup3 u_ILScopeRef u_strings u_string st in ILTypeRef.Create(a, b, c) -let u_ILArrayShape = u_wrap (ILArrayShape) (u_list (u_tup2 (u_option u_int32) (u_option u_int32))) +let u_ILCallConv st = + let a, b = u_tup2 u_ILHasThis u_ILBasicCallConv st in Callconv(a, b) +let u_ILTypeRef st = + let a, b, c = u_tup3 u_ILScopeRef u_strings u_string st in ILTypeRef.Create(a, b, c) + +let u_ILArrayShape = + u_wrap (ILArrayShape) (u_list (u_tup2 (u_option u_int32) (u_option u_int32))) let rec u_ILType st = let tag = u_byte st + match tag with | 0 -> ILType.Void - | 1 -> u_tup2 u_ILArrayShape u_ILType st |> ILType.Array - | 2 -> u_ILTypeSpec st |> ILType.Value - | 3 -> u_ILTypeSpec st |> mkILBoxedType - | 4 -> u_ILType st |> ILType.Ptr - | 5 -> u_ILType st |> ILType.Byref - | 6 -> u_ILCallSig st |> ILType.FunctionPointer - | 7 -> u_uint16 st |> mkILTyvarTy - | 8 -> u_tup3 u_bool u_ILTypeRef u_ILType st |> ILType.Modified + | 1 -> u_tup2 u_ILArrayShape u_ILType st |> ILType.Array + | 2 -> u_ILTypeSpec st |> ILType.Value + | 3 -> u_ILTypeSpec st |> mkILBoxedType + | 4 -> u_ILType st |> ILType.Ptr + | 5 -> u_ILType st |> ILType.Byref + | 6 -> u_ILCallSig st |> ILType.FunctionPointer + | 7 -> u_uint16 st |> mkILTyvarTy + | 8 -> u_tup3 u_bool u_ILTypeRef u_ILType st |> ILType.Modified | _ -> ufailwith st "u_ILType" and u_ILTypes st = u_list u_ILType st -and u_ILCallSig = u_wrap (fun (a, b, c) -> {CallingConv=a; ArgTypes=b; ReturnType=c}) (u_tup3 u_ILCallConv u_ILTypes u_ILType) - -and u_ILTypeSpec st = let a, b = u_tup2 u_ILTypeRef u_ILTypes st in ILTypeSpec.Create(a, b) +and u_ILCallSig = + u_wrap + (fun (a, b, c) -> + { + CallingConv = a + ArgTypes = b + ReturnType = c + }) + (u_tup3 u_ILCallConv u_ILTypes u_ILType) + +and u_ILTypeSpec st = + let a, b = u_tup2 u_ILTypeRef u_ILTypes st in ILTypeSpec.Create(a, b) + +let p_ILMethodRef (x: ILMethodRef) st = + p_tup6 + p_ILTypeRef + p_ILCallConv + p_int + p_string + p_ILTypes + p_ILType + (x.DeclaringTypeRef, x.CallingConv, x.GenericArity, x.Name, x.ArgTypes, x.ReturnType) + st +let p_ILFieldRef (x: ILFieldRef) st = + p_tup3 p_ILTypeRef p_string p_ILType (x.DeclaringTypeRef, x.Name, x.Type) st -let p_ILMethodRef (x: ILMethodRef) st = p_tup6 p_ILTypeRef p_ILCallConv p_int p_string p_ILTypes p_ILType (x.DeclaringTypeRef, x.CallingConv, x.GenericArity, x.Name, x.ArgTypes, x.ReturnType) st +let p_ILMethodSpec (x: ILMethodSpec) st = + p_tup3 p_ILMethodRef p_ILType p_ILTypes (x.MethodRef, x.DeclaringType, x.GenericArgs) st -let p_ILFieldRef (x: ILFieldRef) st = p_tup3 p_ILTypeRef p_string p_ILType (x.DeclaringTypeRef, x.Name, x.Type) st +let p_ILFieldSpec (x: ILFieldSpec) st = + p_tup2 p_ILFieldRef p_ILType (x.FieldRef, x.DeclaringType) st -let p_ILMethodSpec (x: ILMethodSpec) st = p_tup3 p_ILMethodRef p_ILType p_ILTypes (x.MethodRef, x.DeclaringType, x.GenericArgs) st +let p_ILBasicType x st = + p_int + (match x with + | DT_R -> 0 + | DT_I1 -> 1 + | DT_U1 -> 2 + | DT_I2 -> 3 + | DT_U2 -> 4 + | DT_I4 -> 5 + | DT_U4 -> 6 + | DT_I8 -> 7 + | DT_U8 -> 8 + | DT_R4 -> 9 + | DT_R8 -> 10 + | DT_I -> 11 + | DT_U -> 12 + | DT_REF -> 13) + st -let p_ILFieldSpec (x : ILFieldSpec) st = p_tup2 p_ILFieldRef p_ILType (x.FieldRef, x.DeclaringType) st +let p_ILVolatility x st = + p_int + (match x with + | Volatile -> 0 + | Nonvolatile -> 1) + st -let p_ILBasicType x st = - p_int (match x with - | DT_R -> 0 - | DT_I1 -> 1 - | DT_U1 -> 2 - | DT_I2 -> 3 - | DT_U2 -> 4 - | DT_I4 -> 5 - | DT_U4 -> 6 - | DT_I8 -> 7 - | DT_U8 -> 8 - | DT_R4 -> 9 - | DT_R8 -> 10 - | DT_I -> 11 - | DT_U -> 12 - | DT_REF -> 13) st - -let p_ILVolatility x st = p_int (match x with Volatile -> 0 | Nonvolatile -> 1) st -let p_ILReadonly x st = p_int (match x with ReadonlyAddress -> 0 | NormalAddress -> 1) st +let p_ILReadonly x st = + p_int + (match x with + | ReadonlyAddress -> 0 + | NormalAddress -> 1) + st let u_ILMethodRef st = - let x1, x2, x3, x4, x5, x6 = u_tup6 u_ILTypeRef u_ILCallConv u_int u_string u_ILTypes u_ILType st + let x1, x2, x3, x4, x5, x6 = + u_tup6 u_ILTypeRef u_ILCallConv u_int u_string u_ILTypes u_ILType st + ILMethodRef.Create(x1, x2, x4, x3, x5, x6) let u_ILFieldRef st = let x1, x2, x3 = u_tup3 u_ILTypeRef u_string u_ILType st - {DeclaringTypeRef=x1;Name=x2;Type=x3} + + { + DeclaringTypeRef = x1 + Name = x2 + Type = x3 + } let u_ILMethodSpec st = let x1, x2, x3 = u_tup3 u_ILMethodRef u_ILType u_ILTypes st @@ -1060,7 +1417,7 @@ let u_ILMethodSpec st = let u_ILFieldSpec st = let x1, x2 = u_tup2 u_ILFieldRef u_ILType st - {FieldRef=x1;DeclaringType=x2} + { FieldRef = x1; DeclaringType = x2 } let u_ILBasicType st = match u_int st with @@ -1080,113 +1437,254 @@ let u_ILBasicType st = | 13 -> DT_REF | _ -> ufailwith st "u_ILBasicType" -let u_ILVolatility st = (match u_int st with 0 -> Volatile | 1 -> Nonvolatile | _ -> ufailwith st "u_ILVolatility" ) -let u_ILReadonly st = (match u_int st with 0 -> ReadonlyAddress | 1 -> NormalAddress | _ -> ufailwith st "u_ILReadonly" ) - -let [] itag_nop = 0 -let [] itag_ldarg = 1 -let [] itag_ldnull = 2 -let [] itag_ilzero = 3 -let [] itag_call = 4 -let [] itag_add = 5 -let [] itag_sub = 6 -let [] itag_mul = 7 -let [] itag_div = 8 -let [] itag_div_un = 9 -let [] itag_rem = 10 -let [] itag_rem_un = 11 -let [] itag_and = 12 -let [] itag_or = 13 -let [] itag_xor = 14 -let [] itag_shl = 15 -let [] itag_shr = 16 -let [] itag_shr_un = 17 -let [] itag_neg = 18 -let [] itag_not = 19 -let [] itag_conv = 20 -let [] itag_conv_ovf = 22 -let [] itag_conv_ovf_un = 23 -let [] itag_callvirt = 24 -let [] itag_ldobj = 25 -let [] itag_ldstr = 26 -let [] itag_castclass = 27 -let [] itag_isinst = 28 -let [] itag_unbox = 29 -let [] itag_throw = 30 -let [] itag_ldfld = 31 -let [] itag_ldflda = 32 -let [] itag_stfld = 33 -let [] itag_ldsfld = 34 -let [] itag_ldsflda = 35 -let [] itag_stsfld = 36 -let [] itag_stobj = 37 -let [] itag_box = 38 -let [] itag_newarr = 39 -let [] itag_ldlen = 40 -let [] itag_ldelema = 41 -let [] itag_ckfinite = 42 -let [] itag_ldtoken = 43 -let [] itag_add_ovf = 44 -let [] itag_add_ovf_un = 45 -let [] itag_mul_ovf = 46 -let [] itag_mul_ovf_un = 47 -let [] itag_sub_ovf = 48 -let [] itag_sub_ovf_un = 49 -let [] itag_ceq = 50 -let [] itag_cgt = 51 -let [] itag_cgt_un = 52 -let [] itag_clt = 53 -let [] itag_clt_un = 54 -let [] itag_ldvirtftn = 55 -let [] itag_localloc = 56 -let [] itag_rethrow = 57 -let [] itag_sizeof = 58 -let [] itag_ldelem_any = 59 -let [] itag_stelem_any = 60 -let [] itag_unbox_any = 61 -let [] itag_ldlen_multi = 62 -let [] itag_initobj = 63 -let [] itag_initblk = 64 -let [] itag_cpobj = 65 -let [] itag_cpblk = 66 +let u_ILVolatility st = + (match u_int st with + | 0 -> Volatile + | 1 -> Nonvolatile + | _ -> ufailwith st "u_ILVolatility") + +let u_ILReadonly st = + (match u_int st with + | 0 -> ReadonlyAddress + | 1 -> NormalAddress + | _ -> ufailwith st "u_ILReadonly") + +[] +let itag_nop = 0 + +[] +let itag_ldarg = 1 + +[] +let itag_ldnull = 2 + +[] +let itag_ilzero = 3 + +[] +let itag_call = 4 + +[] +let itag_add = 5 + +[] +let itag_sub = 6 + +[] +let itag_mul = 7 + +[] +let itag_div = 8 + +[] +let itag_div_un = 9 + +[] +let itag_rem = 10 + +[] +let itag_rem_un = 11 + +[] +let itag_and = 12 + +[] +let itag_or = 13 + +[] +let itag_xor = 14 + +[] +let itag_shl = 15 + +[] +let itag_shr = 16 + +[] +let itag_shr_un = 17 + +[] +let itag_neg = 18 + +[] +let itag_not = 19 + +[] +let itag_conv = 20 + +[] +let itag_conv_ovf = 22 + +[] +let itag_conv_ovf_un = 23 + +[] +let itag_callvirt = 24 + +[] +let itag_ldobj = 25 + +[] +let itag_ldstr = 26 + +[] +let itag_castclass = 27 + +[] +let itag_isinst = 28 + +[] +let itag_unbox = 29 + +[] +let itag_throw = 30 + +[] +let itag_ldfld = 31 + +[] +let itag_ldflda = 32 + +[] +let itag_stfld = 33 + +[] +let itag_ldsfld = 34 + +[] +let itag_ldsflda = 35 + +[] +let itag_stsfld = 36 + +[] +let itag_stobj = 37 + +[] +let itag_box = 38 + +[] +let itag_newarr = 39 + +[] +let itag_ldlen = 40 + +[] +let itag_ldelema = 41 + +[] +let itag_ckfinite = 42 + +[] +let itag_ldtoken = 43 + +[] +let itag_add_ovf = 44 + +[] +let itag_add_ovf_un = 45 + +[] +let itag_mul_ovf = 46 + +[] +let itag_mul_ovf_un = 47 + +[] +let itag_sub_ovf = 48 + +[] +let itag_sub_ovf_un = 49 + +[] +let itag_ceq = 50 + +[] +let itag_cgt = 51 + +[] +let itag_cgt_un = 52 + +[] +let itag_clt = 53 + +[] +let itag_clt_un = 54 + +[] +let itag_ldvirtftn = 55 + +[] +let itag_localloc = 56 + +[] +let itag_rethrow = 57 + +[] +let itag_sizeof = 58 + +[] +let itag_ldelem_any = 59 + +[] +let itag_stelem_any = 60 + +[] +let itag_unbox_any = 61 + +[] +let itag_ldlen_multi = 62 + +[] +let itag_initobj = 63 + +[] +let itag_initblk = 64 + +[] +let itag_cpobj = 65 + +[] +let itag_cpblk = 66 let simple_instrs = - [ itag_add, AI_add - itag_add_ovf, AI_add_ovf - itag_add_ovf_un, AI_add_ovf_un - itag_and, AI_and - itag_div, AI_div - itag_div_un, AI_div_un - itag_ceq, AI_ceq - itag_cgt, AI_cgt - itag_cgt_un, AI_cgt_un - itag_clt, AI_clt - itag_clt_un, AI_clt_un - itag_mul, AI_mul - itag_mul_ovf, AI_mul_ovf - itag_mul_ovf_un, AI_mul_ovf_un - itag_rem, AI_rem - itag_rem_un, AI_rem_un - itag_shl, AI_shl - itag_shr, AI_shr - itag_shr_un, AI_shr_un - itag_sub, AI_sub - itag_sub_ovf, AI_sub_ovf - itag_sub_ovf_un, AI_sub_ovf_un - itag_xor, AI_xor - itag_or, AI_or - itag_neg, AI_neg - itag_not, AI_not - itag_ldnull, AI_ldnull - itag_ckfinite, AI_ckfinite - itag_nop, AI_nop - itag_localloc, I_localloc - itag_throw, I_throw - itag_ldlen, I_ldlen - itag_rethrow, I_rethrow - itag_rethrow, I_rethrow - itag_initblk, I_initblk (Aligned, Nonvolatile) - itag_cpblk, I_cpblk (Aligned, Nonvolatile) + [ + itag_add, AI_add + itag_add_ovf, AI_add_ovf + itag_add_ovf_un, AI_add_ovf_un + itag_and, AI_and + itag_div, AI_div + itag_div_un, AI_div_un + itag_ceq, AI_ceq + itag_cgt, AI_cgt + itag_cgt_un, AI_cgt_un + itag_clt, AI_clt + itag_clt_un, AI_clt_un + itag_mul, AI_mul + itag_mul_ovf, AI_mul_ovf + itag_mul_ovf_un, AI_mul_ovf_un + itag_rem, AI_rem + itag_rem_un, AI_rem_un + itag_shl, AI_shl + itag_shr, AI_shr + itag_shr_un, AI_shr_un + itag_sub, AI_sub + itag_sub_ovf, AI_sub_ovf + itag_sub_ovf_un, AI_sub_ovf_un + itag_xor, AI_xor + itag_or, AI_or + itag_neg, AI_neg + itag_not, AI_not + itag_ldnull, AI_ldnull + itag_ckfinite, AI_ckfinite + itag_nop, AI_nop + itag_localloc, I_localloc + itag_throw, I_throw + itag_ldlen, I_ldlen + itag_rethrow, I_rethrow + itag_rethrow, I_rethrow + itag_initblk, I_initblk(Aligned, Nonvolatile) + itag_cpblk, I_cpblk(Aligned, Nonvolatile) ] let encode_table = Dictionary<_, _>(300, HashIdentity.Structural) @@ -1195,95 +1693,163 @@ let encode_instr si = encode_table[si] let isNoArgInstr s = encode_table.ContainsKey s let decoders = - [ itag_ldarg, u_uint16 >> mkLdarg - itag_call, u_ILMethodSpec >> (fun a -> I_call (Normalcall, a, None)) - itag_callvirt, u_ILMethodSpec >> (fun a -> I_callvirt (Normalcall, a, None)) - itag_ldvirtftn, u_ILMethodSpec >> I_ldvirtftn - itag_conv, u_ILBasicType >> AI_conv - itag_conv_ovf, u_ILBasicType >> AI_conv_ovf - itag_conv_ovf_un, u_ILBasicType >> AI_conv_ovf_un - itag_ldfld, u_tup2 u_ILVolatility u_ILFieldSpec >> (fun (b, c) -> I_ldfld (Aligned, b, c)) - itag_ldflda, u_ILFieldSpec >> I_ldflda - itag_ldsfld, u_tup2 u_ILVolatility u_ILFieldSpec >> I_ldsfld - itag_ldsflda, u_ILFieldSpec >> I_ldsflda - itag_stfld, u_tup2 u_ILVolatility u_ILFieldSpec >> (fun (b, c) -> I_stfld (Aligned, b, c)) - itag_stsfld, u_tup2 u_ILVolatility u_ILFieldSpec >> I_stsfld - itag_ldtoken, u_ILType >> (ILToken.ILType >> I_ldtoken) - itag_ldstr, u_string >> I_ldstr - itag_box, u_ILType >> I_box - itag_unbox, u_ILType >> I_unbox - itag_unbox_any, u_ILType >> I_unbox_any - itag_newarr, u_tup2 u_ILArrayShape u_ILType >> I_newarr - itag_stelem_any, u_tup2 u_ILArrayShape u_ILType >> I_stelem_any - itag_ldelem_any, u_tup2 u_ILArrayShape u_ILType >> I_ldelem_any - itag_ldelema, u_tup3 u_ILReadonly u_ILArrayShape u_ILType >> (fun (a, b, c) -> I_ldelema(a, false, b, c)) - itag_castclass, u_ILType >> I_castclass - itag_isinst, u_ILType >> I_isinst - itag_ldobj, u_ILType >> (fun c -> I_ldobj (Aligned, Nonvolatile, c)) - itag_stobj, u_ILType >> (fun c -> I_stobj (Aligned, Nonvolatile, c)) - itag_sizeof, u_ILType >> I_sizeof - itag_ldlen_multi, u_tup2 u_int32 u_int32 >> EI_ldlen_multi - itag_ilzero, u_ILType >> EI_ilzero - itag_ilzero, u_ILType >> EI_ilzero - itag_initobj, u_ILType >> I_initobj - itag_cpobj, u_ILType >> I_cpobj - ] + [ + itag_ldarg, u_uint16 >> mkLdarg + itag_call, u_ILMethodSpec >> (fun a -> I_call(Normalcall, a, None)) + itag_callvirt, u_ILMethodSpec >> (fun a -> I_callvirt(Normalcall, a, None)) + itag_ldvirtftn, u_ILMethodSpec >> I_ldvirtftn + itag_conv, u_ILBasicType >> AI_conv + itag_conv_ovf, u_ILBasicType >> AI_conv_ovf + itag_conv_ovf_un, u_ILBasicType >> AI_conv_ovf_un + itag_ldfld, u_tup2 u_ILVolatility u_ILFieldSpec >> (fun (b, c) -> I_ldfld(Aligned, b, c)) + itag_ldflda, u_ILFieldSpec >> I_ldflda + itag_ldsfld, u_tup2 u_ILVolatility u_ILFieldSpec >> I_ldsfld + itag_ldsflda, u_ILFieldSpec >> I_ldsflda + itag_stfld, u_tup2 u_ILVolatility u_ILFieldSpec >> (fun (b, c) -> I_stfld(Aligned, b, c)) + itag_stsfld, u_tup2 u_ILVolatility u_ILFieldSpec >> I_stsfld + itag_ldtoken, u_ILType >> (ILToken.ILType >> I_ldtoken) + itag_ldstr, u_string >> I_ldstr + itag_box, u_ILType >> I_box + itag_unbox, u_ILType >> I_unbox + itag_unbox_any, u_ILType >> I_unbox_any + itag_newarr, u_tup2 u_ILArrayShape u_ILType >> I_newarr + itag_stelem_any, u_tup2 u_ILArrayShape u_ILType >> I_stelem_any + itag_ldelem_any, u_tup2 u_ILArrayShape u_ILType >> I_ldelem_any + itag_ldelema, + u_tup3 u_ILReadonly u_ILArrayShape u_ILType + >> (fun (a, b, c) -> I_ldelema(a, false, b, c)) + itag_castclass, u_ILType >> I_castclass + itag_isinst, u_ILType >> I_isinst + itag_ldobj, u_ILType >> (fun c -> I_ldobj(Aligned, Nonvolatile, c)) + itag_stobj, u_ILType >> (fun c -> I_stobj(Aligned, Nonvolatile, c)) + itag_sizeof, u_ILType >> I_sizeof + itag_ldlen_multi, u_tup2 u_int32 u_int32 >> EI_ldlen_multi + itag_ilzero, u_ILType >> EI_ilzero + itag_ilzero, u_ILType >> EI_ilzero + itag_initobj, u_ILType >> I_initobj + itag_cpobj, u_ILType >> I_cpobj + ] let decode_tab = - let tab = Array.init 256 (fun n -> (fun st -> ufailwith st ("no decoder for instruction "+string n))) - let add_instr (icode, f) = tab[icode] <- f + let tab = + Array.init 256 (fun n -> (fun st -> ufailwith st ("no decoder for instruction " + string n))) + + let add_instr (icode, f) = tab[icode] <- f List.iter add_instr decoders List.iter (fun (icode, mk) -> add_instr (icode, (fun _ -> mk))) simple_instrs tab let p_ILInstr x st = match x with - | si when isNoArgInstr si -> p_byte (encode_instr si) st - | I_call(Normalcall, mspec, None) -> p_byte itag_call st; p_ILMethodSpec mspec st - | I_callvirt(Normalcall, mspec, None) -> p_byte itag_callvirt st; p_ILMethodSpec mspec st - | I_ldvirtftn mspec -> p_byte itag_ldvirtftn st; p_ILMethodSpec mspec st - | I_ldarg x -> p_byte itag_ldarg st; p_uint16 x st - | AI_conv a -> p_byte itag_conv st; p_ILBasicType a st - | AI_conv_ovf a -> p_byte itag_conv_ovf st; p_ILBasicType a st - | AI_conv_ovf_un a -> p_byte itag_conv_ovf_un st; p_ILBasicType a st - | I_ldfld (Aligned, b, c) -> p_byte itag_ldfld st; p_tup2 p_ILVolatility p_ILFieldSpec (b, c) st - | I_ldsfld (a, b) -> p_byte itag_ldsfld st; p_tup2 p_ILVolatility p_ILFieldSpec (a, b) st - | I_stfld (Aligned, b, c) -> p_byte itag_stfld st; p_tup2 p_ILVolatility p_ILFieldSpec (b, c) st - | I_stsfld (a, b) -> p_byte itag_stsfld st; p_tup2 p_ILVolatility p_ILFieldSpec (a, b) st - | I_ldflda c -> p_byte itag_ldflda st; p_ILFieldSpec c st - | I_ldsflda a -> p_byte itag_ldsflda st; p_ILFieldSpec a st - | I_ldtoken (ILToken.ILType ty) -> p_byte itag_ldtoken st; p_ILType ty st - | I_ldstr s -> p_byte itag_ldstr st; p_string s st - | I_box ty -> p_byte itag_box st; p_ILType ty st - | I_unbox ty -> p_byte itag_unbox st; p_ILType ty st - | I_unbox_any ty -> p_byte itag_unbox_any st; p_ILType ty st - | I_newarr (a, b) -> p_byte itag_newarr st; p_tup2 p_ILArrayShape p_ILType (a, b) st - | I_stelem_any (a, b) -> p_byte itag_stelem_any st; p_tup2 p_ILArrayShape p_ILType (a, b) st - | I_ldelem_any (a, b) -> p_byte itag_ldelem_any st; p_tup2 p_ILArrayShape p_ILType (a, b) st - | I_ldelema (a, _, b, c) -> p_byte itag_ldelema st; p_tup3 p_ILReadonly p_ILArrayShape p_ILType (a, b, c) st - | I_castclass ty -> p_byte itag_castclass st; p_ILType ty st - | I_isinst ty -> p_byte itag_isinst st; p_ILType ty st - | I_ldobj (Aligned, Nonvolatile, c) -> p_byte itag_ldobj st; p_ILType c st - | I_stobj (Aligned, Nonvolatile, c) -> p_byte itag_stobj st; p_ILType c st - | I_sizeof ty -> p_byte itag_sizeof st; p_ILType ty st - | EI_ldlen_multi (n, m) -> p_byte itag_ldlen_multi st; p_tup2 p_int32 p_int32 (n, m) st - | EI_ilzero a -> p_byte itag_ilzero st; p_ILType a st - | I_initobj c -> p_byte itag_initobj st; p_ILType c st - | I_cpobj c -> p_byte itag_cpobj st; p_ILType c st + | si when isNoArgInstr si -> p_byte (encode_instr si) st + | I_call(Normalcall, mspec, None) -> + p_byte itag_call st + p_ILMethodSpec mspec st + | I_callvirt(Normalcall, mspec, None) -> + p_byte itag_callvirt st + p_ILMethodSpec mspec st + | I_ldvirtftn mspec -> + p_byte itag_ldvirtftn st + p_ILMethodSpec mspec st + | I_ldarg x -> + p_byte itag_ldarg st + p_uint16 x st + | AI_conv a -> + p_byte itag_conv st + p_ILBasicType a st + | AI_conv_ovf a -> + p_byte itag_conv_ovf st + p_ILBasicType a st + | AI_conv_ovf_un a -> + p_byte itag_conv_ovf_un st + p_ILBasicType a st + | I_ldfld(Aligned, b, c) -> + p_byte itag_ldfld st + p_tup2 p_ILVolatility p_ILFieldSpec (b, c) st + | I_ldsfld(a, b) -> + p_byte itag_ldsfld st + p_tup2 p_ILVolatility p_ILFieldSpec (a, b) st + | I_stfld(Aligned, b, c) -> + p_byte itag_stfld st + p_tup2 p_ILVolatility p_ILFieldSpec (b, c) st + | I_stsfld(a, b) -> + p_byte itag_stsfld st + p_tup2 p_ILVolatility p_ILFieldSpec (a, b) st + | I_ldflda c -> + p_byte itag_ldflda st + p_ILFieldSpec c st + | I_ldsflda a -> + p_byte itag_ldsflda st + p_ILFieldSpec a st + | I_ldtoken(ILToken.ILType ty) -> + p_byte itag_ldtoken st + p_ILType ty st + | I_ldstr s -> + p_byte itag_ldstr st + p_string s st + | I_box ty -> + p_byte itag_box st + p_ILType ty st + | I_unbox ty -> + p_byte itag_unbox st + p_ILType ty st + | I_unbox_any ty -> + p_byte itag_unbox_any st + p_ILType ty st + | I_newarr(a, b) -> + p_byte itag_newarr st + p_tup2 p_ILArrayShape p_ILType (a, b) st + | I_stelem_any(a, b) -> + p_byte itag_stelem_any st + p_tup2 p_ILArrayShape p_ILType (a, b) st + | I_ldelem_any(a, b) -> + p_byte itag_ldelem_any st + p_tup2 p_ILArrayShape p_ILType (a, b) st + | I_ldelema(a, _, b, c) -> + p_byte itag_ldelema st + p_tup3 p_ILReadonly p_ILArrayShape p_ILType (a, b, c) st + | I_castclass ty -> + p_byte itag_castclass st + p_ILType ty st + | I_isinst ty -> + p_byte itag_isinst st + p_ILType ty st + | I_ldobj(Aligned, Nonvolatile, c) -> + p_byte itag_ldobj st + p_ILType c st + | I_stobj(Aligned, Nonvolatile, c) -> + p_byte itag_stobj st + p_ILType c st + | I_sizeof ty -> + p_byte itag_sizeof st + p_ILType ty st + | EI_ldlen_multi(n, m) -> + p_byte itag_ldlen_multi st + p_tup2 p_int32 p_int32 (n, m) st + | EI_ilzero a -> + p_byte itag_ilzero st + p_ILType a st + | I_initobj c -> + p_byte itag_initobj st + p_ILType c st + | I_cpobj c -> + p_byte itag_cpobj st + p_ILType c st | i -> pfailwith st (sprintf "the IL instruction '%+A' cannot be emitted" i) let u_ILInstr st = let n = u_byte st - decode_tab[n] st - - + decode_tab[n]st //--------------------------------------------------------------------------- // Pickle/unpickle for F# types and module signatures //--------------------------------------------------------------------------- let p_Map_core pk pv xs st = - xs |> Map.iter (fun k v -> pk k st; pv v st) + xs + |> Map.iter (fun k v -> + pk k st + pv v st) let p_Map pk pv x st = p_int (Map.count x) st @@ -1302,64 +1868,97 @@ let u_Map uk uv st = let u_qlist uv = u_wrap QueueList.ofList (u_list uv) let u_namemap u = u_Map u_string u -let p_pos (x: pos) st = p_tup2 p_int p_int (x.Line, x.Column) st +let p_pos (x: pos) st = + p_tup2 p_int p_int (x.Line, x.Column) st let p_range (x: range) st = let fileName = PathMap.apply st.oglobals.pathMap x.FileName p_tup3 p_string p_pos p_pos (fileName, x.Start, x.End) st -let p_dummy_range : range pickler = fun _x _st -> () -let p_ident (x: Ident) st = p_tup2 p_string p_range (x.idText, x.idRange) st -let p_xmldoc (doc: XmlDoc) st = p_array p_string doc.UnprocessedLines st +let p_dummy_range: range pickler = fun _x _st -> () + +let p_ident (x: Ident) st = + p_tup2 p_string p_range (x.idText, x.idRange) st + +let p_xmldoc (doc: XmlDoc) st = + p_array p_string doc.UnprocessedLines st + +let u_pos st = + let a = u_int st in + let b = u_int st in + mkPos a b -let u_pos st = let a = u_int st in let b = u_int st in mkPos a b -let u_range st = let a = u_string st in let b = u_pos st in let c = u_pos st in mkRange a b c +let u_range st = + let a = u_string st in + let b = u_pos st in + let c = u_pos st in + mkRange a b c // Most ranges (e.g. on optimization expressions) can be elided from stored data -let u_dummy_range : range unpickler = fun _st -> range0 -let u_ident st = let a = u_string st in let b = u_range st in ident(a, b) -let u_xmldoc st = XmlDoc (u_array u_string st, range0) +let u_dummy_range: range unpickler = fun _st -> range0 + +let u_ident st = + let a = u_string st in + let b = u_range st in + ident (a, b) + +let u_xmldoc st = XmlDoc(u_array u_string st, range0) let p_local_item_ref ctxt tab st = p_osgn_ref ctxt tab st let p_tcref ctxt (x: EntityRef) st = match x with - | ERefLocal x -> p_byte 0 st; p_local_item_ref ctxt st.oentities x st - | ERefNonLocal x -> p_byte 1 st; p_nleref x st + | ERefLocal x -> + p_byte 0 st + p_local_item_ref ctxt st.oentities x st + | ERefNonLocal x -> + p_byte 1 st + p_nleref x st -let p_ucref (UnionCaseRef(a, b)) st = p_tup2 (p_tcref "ucref") p_string (a, b) st -let p_rfref (RecdFieldRef(a, b)) st = p_tup2 (p_tcref "rfref") p_string (a, b) st -let p_tpref x st = p_local_item_ref "typar" st.otypars x st +let p_ucref (UnionCaseRef(a, b)) st = + p_tup2 (p_tcref "ucref") p_string (a, b) st + +let p_rfref (RecdFieldRef(a, b)) st = + p_tup2 (p_tcref "rfref") p_string (a, b) st + +let p_tpref x st = + p_local_item_ref "typar" st.otypars x st let u_local_item_ref tab st = u_osgn_ref tab st let u_tcref st = let tag = u_byte st + match tag with - | 0 -> u_local_item_ref st.ientities st |> ERefLocal - | 1 -> u_nleref st |> ERefNonLocal + | 0 -> u_local_item_ref st.ientities st |> ERefLocal + | 1 -> u_nleref st |> ERefNonLocal | _ -> ufailwith st "u_item_ref" -let u_ucref st = let a, b = u_tup2 u_tcref u_string st in UnionCaseRef(a, b) +let u_ucref st = + let a, b = u_tup2 u_tcref u_string st in UnionCaseRef(a, b) -let u_rfref st = let a, b = u_tup2 u_tcref u_string st in RecdFieldRef(a, b) +let u_rfref st = + let a, b = u_tup2 u_tcref u_string st in RecdFieldRef(a, b) let u_tpref st = u_local_item_ref st.itypars st // forward reference -let fill_p_ty2, p_ty2 = p_hole2() +let fill_p_ty2, p_ty2 = p_hole2 () let p_ty = p_ty2 false let p_tys = (p_list p_ty) -let fill_p_attribs, p_attribs = p_hole() +let fill_p_attribs, p_attribs = p_hole () // In F# 4.5, the type of the "this" pointer for structs is considered to be inref for the purposes of checking the implementation // of the struct. However for backwards compat reasons we can't serialize this as the type. let checkForInRefStructThisArg st ty = let g = st.oglobals let _, tauTy = tryDestForallTy g ty - isFunTy g tauTy && isFunTy g (rangeOfFunTy g tauTy) && isInByrefTy g (domainOfFunTy g tauTy) + + isFunTy g tauTy + && isFunTy g (rangeOfFunTy g tauTy) + && isInByrefTy g (domainOfFunTy g tauTy) let p_nonlocal_val_ref (nlv: NonLocalValOrMemberRef) st = let a = nlv.EnclosingEntity @@ -1370,22 +1969,28 @@ let p_nonlocal_val_ref (nlv: NonLocalValOrMemberRef) st = p_bool pkey.MemberIsOverride st p_string pkey.LogicalName st p_int pkey.TotalArgCount st + let isStructThisArgPos = match key.TypeForLinkage with | None -> false | Some ty -> checkForInRefStructThisArg st ty + p_option (p_ty2 isStructThisArgPos) key.TypeForLinkage st let rec p_vref ctxt x st = match x with - | VRefLocal x -> p_byte 0 st; p_local_item_ref ctxt st.ovals x st - | VRefNonLocal x -> p_byte 1 st; p_nonlocal_val_ref x st + | VRefLocal x -> + p_byte 0 st + p_local_item_ref ctxt st.ovals x st + | VRefNonLocal x -> + p_byte 1 st + p_nonlocal_val_ref x st let p_vrefs ctxt = p_list (p_vref ctxt) -let fill_u_ty, u_ty = u_hole() +let fill_u_ty, u_ty = u_hole () let u_tys = (u_list u_ty) -let fill_u_attribs, u_attribs = u_hole() +let fill_u_attribs, u_attribs = u_hole () let u_nonlocal_val_ref st : NonLocalValOrMemberRef = let a = u_tcref st @@ -1394,11 +1999,24 @@ let u_nonlocal_val_ref st : NonLocalValOrMemberRef = let b3 = u_string st let c = u_int st let d = u_option u_ty st - { EnclosingEntity = a - ItemKey=ValLinkageFullKey({ MemberParentMangledName=b1; MemberIsOverride=b2;LogicalName=b3; TotalArgCount=c }, d) } + + { + EnclosingEntity = a + ItemKey = + ValLinkageFullKey( + { + MemberParentMangledName = b1 + MemberIsOverride = b2 + LogicalName = b3 + TotalArgCount = c + }, + d + ) + } let u_vref st = let tag = u_byte st + match tag with | 0 -> u_local_item_ref st.ivals st |> VRefLocal | 1 -> u_nonlocal_val_ref st |> VRefNonLocal @@ -1407,18 +2025,22 @@ let u_vref st = let u_vrefs = u_list u_vref let p_kind x st = - p_byte (match x with - | TyparKind.Type -> 0 - | TyparKind.Measure -> 1) st + p_byte + (match x with + | TyparKind.Type -> 0 + | TyparKind.Measure -> 1) + st let p_member_kind x st = - p_byte (match x with - | SynMemberKind.Member -> 0 - | SynMemberKind.PropertyGet -> 1 - | SynMemberKind.PropertySet -> 2 - | SynMemberKind.Constructor -> 3 - | SynMemberKind.ClassConstructor -> 4 - | SynMemberKind.PropertyGetSet -> pfailwith st "pickling: SynMemberKind.PropertyGetSet only expected in parse trees") st + p_byte + (match x with + | SynMemberKind.Member -> 0 + | SynMemberKind.PropertyGet -> 1 + | SynMemberKind.PropertySet -> 2 + | SynMemberKind.Constructor -> 3 + | SynMemberKind.ClassConstructor -> 4 + | SynMemberKind.PropertyGetSet -> pfailwith st "pickling: SynMemberKind.PropertyGetSet only expected in parse trees") + st let u_kind st = match u_byte st with @@ -1436,24 +2058,31 @@ let u_member_kind st = | _ -> ufailwith st "u_member_kind" let p_MemberFlags (x: SynMemberFlags) st = - p_tup6 p_bool p_bool p_bool p_bool p_bool p_member_kind - (x.IsInstance, - false (* _x3UnusedBoolInFormat *), - x.IsDispatchSlot, - x.IsOverrideOrExplicitImpl, - x.IsFinal, - x.MemberKind) st -let u_MemberFlags st : SynMemberFlags= - let x2, _x3UnusedBoolInFormat, x4, x5, x6, x7 = u_tup6 u_bool u_bool u_bool u_bool u_bool u_member_kind st - { IsInstance=x2 - IsDispatchSlot=x4 - IsOverrideOrExplicitImpl=x5 - IsFinal=x6 - GetterOrSetterIsCompilerGenerated=false - MemberKind=x7 } - -let fill_u_Expr_hole, u_expr_fwd = u_hole() -let fill_p_Expr_hole, p_expr_fwd = p_hole() + p_tup6 + p_bool + p_bool + p_bool + p_bool + p_bool + p_member_kind + (x.IsInstance, false (* _x3UnusedBoolInFormat *) , x.IsDispatchSlot, x.IsOverrideOrExplicitImpl, x.IsFinal, x.MemberKind) + st + +let u_MemberFlags st : SynMemberFlags = + let x2, _x3UnusedBoolInFormat, x4, x5, x6, x7 = + u_tup6 u_bool u_bool u_bool u_bool u_bool u_member_kind st + + { + IsInstance = x2 + IsDispatchSlot = x4 + IsOverrideOrExplicitImpl = x5 + IsFinal = x6 + GetterOrSetterIsCompilerGenerated = false + MemberKind = x7 + } + +let fill_u_Expr_hole, u_expr_fwd = u_hole () +let fill_p_Expr_hole, p_expr_fwd = p_hole () let p_anonInfo_data (anonInfo: AnonRecdTypeInfo) st = p_tup3 p_ccuref p_bool (p_array p_ident) (anonInfo.Assembly, evalTupInfoIsStruct anonInfo.TupInfo, anonInfo.SortedIds) st @@ -1464,29 +2093,34 @@ let p_anonInfo x st = let p_trait_sln sln st = match sln with | ILMethSln(a, b, c, d, None) -> - p_byte 0 st; p_tup4 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys (a, b, c, d) st + p_byte 0 st + p_tup4 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys (a, b, c, d) st | FSMethSln(a, b, c, None) -> - p_byte 1 st; p_tup3 p_ty (p_vref "trait") p_tys (a, b, c) st - | BuiltInSln -> - p_byte 2 st + p_byte 1 st + p_tup3 p_ty (p_vref "trait") p_tys (a, b, c) st + | BuiltInSln -> p_byte 2 st | ClosedExprSln expr -> - p_byte 3 st; p_expr_fwd expr st + p_byte 3 st + p_expr_fwd expr st | FSRecdFieldSln(a, b, c) -> - p_byte 4 st; p_tup3 p_tys p_rfref p_bool (a, b, c) st + p_byte 4 st + p_tup3 p_tys p_rfref p_bool (a, b, c) st | FSAnonRecdFieldSln(a, b, c) -> - p_byte 5 st; p_tup3 p_anonInfo p_tys p_int (a, b, c) st + p_byte 5 st + p_tup3 p_anonInfo p_tys p_int (a, b, c) st | ILMethSln(a, b, c, d, Some e) -> - p_byte 6 st; p_tup5 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys p_ty (a, b, c, d, e) st + p_byte 6 st + p_tup5 p_ty (p_option p_ILTypeRef) p_ILMethodRef p_tys p_ty (a, b, c, d, e) st | FSMethSln(a, b, c, Some d) -> - p_byte 7 st; p_tup4 p_ty (p_vref "trait") p_tys p_ty (a, b, c, d) st - + p_byte 7 st + p_tup4 p_ty (p_vref "trait") p_tys p_ty (a, b, c, d) st -let p_trait (TTrait(a, b, c, d, e, _, f)) st = +let p_trait (TTrait(a, b, c, d, e, _, f)) st = p_tup6 p_tys p_string p_MemberFlags p_tys (p_option p_ty) (p_option p_trait_sln) (a, b, c, d, e, f.Value) st let u_anonInfo_data st = let ccu, info, nms = u_tup3 u_ccuref u_bool (u_array u_ident) st - AnonRecdTypeInfo.Create (ccu, mkTupInfo info, nms) + AnonRecdTypeInfo.Create(ccu, mkTupInfo info, nms) let u_anonInfo st = u_osgn_decl st.ianoninfos u_anonInfo_data st @@ -1494,6 +2128,7 @@ let u_anonInfo st = // We have to store trait solutions since they can occur in optimization data let u_trait_sln st = let tag = u_byte st + match tag with | 0 -> let a, b, c, d = u_tup4 u_ty (u_option u_ILTypeRef) u_ILMethodRef u_tys st @@ -1501,16 +2136,14 @@ let u_trait_sln st = | 1 -> let a, b, c = u_tup3 u_ty u_vref u_tys st FSMethSln(a, b, c, None) - | 2 -> - BuiltInSln - | 3 -> - ClosedExprSln (u_expr_fwd st) + | 2 -> BuiltInSln + | 3 -> ClosedExprSln(u_expr_fwd st) | 4 -> let a, b, c = u_tup3 u_tys u_rfref u_bool st FSRecdFieldSln(a, b, c) | 5 -> - let a, b, c = u_tup3 u_anonInfo u_tys u_int st - FSAnonRecdFieldSln(a, b, c) + let a, b, c = u_tup3 u_anonInfo u_tys u_int st + FSAnonRecdFieldSln(a, b, c) | 6 -> let a, b, c, d, e = u_tup5 u_ty (u_option u_ILTypeRef) u_ILMethodRef u_tys u_ty st ILMethSln(a, b, c, d, Some e) @@ -1520,56 +2153,78 @@ let u_trait_sln st = | _ -> ufailwith st "u_trait_sln" let u_trait st = - let a, b, c, d, e, f = u_tup6 u_tys u_string u_MemberFlags u_tys (u_option u_ty) (u_option u_trait_sln) st - TTrait (a, b, c, d, e, ref None, ref f) + let a, b, c, d, e, f = + u_tup6 u_tys u_string u_MemberFlags u_tys (u_option u_ty) (u_option u_trait_sln) st + TTrait(a, b, c, d, e, ref None, ref f) -let p_rational q st = p_int32 (GetNumerator q) st; p_int32 (GetDenominator q) st +let p_rational q st = + p_int32 (GetNumerator q) st + p_int32 (GetDenominator q) st -let p_measure_con tcref st = p_byte 0 st; p_tcref "measure" tcref st +let p_measure_con tcref st = + p_byte 0 st + p_tcref "measure" tcref st -let p_measure_var v st = p_byte 3 st; p_tpref v st +let p_measure_var v st = + p_byte 3 st + p_tpref v st let p_measure_one = p_byte 4 // Pickle a unit-of-measure variable or constructor let p_measure_varcon unt st = - match unt with - | Measure.Const(tyconRef= tcref) -> p_measure_con tcref st - | Measure.Var v -> p_measure_var v st - | _ -> pfailwith st "p_measure_varcon: expected measure variable or constructor" + match unt with + | Measure.Const(tyconRef = tcref) -> p_measure_con tcref st + | Measure.Var v -> p_measure_var v st + | _ -> pfailwith st "p_measure_varcon: expected measure variable or constructor" // Pickle a positive integer power of a unit-of-measure variable or constructor let rec p_measure_pospower unt n st = - if n = 1 - then p_measure_varcon unt st - else p_byte 2 st; p_measure_varcon unt st; p_measure_pospower unt (n-1) st + if n = 1 then + p_measure_varcon unt st + else + p_byte 2 st + p_measure_varcon unt st + p_measure_pospower unt (n - 1) st // Pickle a non-zero integer power of a unit-of-measure variable or constructor let p_measure_intpower unt n st = - if n < 0 - then p_byte 1 st; p_measure_pospower unt (-n) st - else p_measure_pospower unt n st + if n < 0 then + p_byte 1 st + p_measure_pospower unt (-n) st + else + p_measure_pospower unt n st // Pickle a rational power of a unit-of-measure variable or constructor let rec p_measure_power unt q st = - if q = ZeroRational then p_measure_one st - elif GetDenominator q = 1 - then p_measure_intpower unt (GetNumerator q) st - else p_byte 5 st; p_measure_varcon unt st; p_rational q st + if q = ZeroRational then + p_measure_one st + elif GetDenominator q = 1 then + p_measure_intpower unt (GetNumerator q) st + else + p_byte 5 st + p_measure_varcon unt st + p_rational q st // Pickle a normalized unit-of-measure expression // Normalized means of the form cv1 ^ q1 * ... * cvn ^ qn // where q1, ..., qn are non-zero, and cv1, ..., cvn are distinct unit-of-measure variables or constructors let rec p_normalized_measure unt st = - let unt = stripUnitEqnsAux false unt - match unt with - | Measure.Const(tyconRef= tcref) -> p_measure_con tcref st - | Measure.Inv x -> p_byte 1 st; p_normalized_measure x st - | Measure.Prod(measure1= x1; measure2= x2) -> p_byte 2 st; p_normalized_measure x1 st; p_normalized_measure x2 st - | Measure.Var v -> p_measure_var v st - | Measure.One _ -> p_measure_one st - | Measure.RationalPower(measure= x; power= q) -> p_measure_power x q st + let unt = stripUnitEqnsAux false unt + + match unt with + | Measure.Const(tyconRef = tcref) -> p_measure_con tcref st + | Measure.Inv x -> + p_byte 1 st + p_normalized_measure x st + | Measure.Prod(measure1 = x1; measure2 = x2) -> + p_byte 2 st + p_normalized_measure x1 st + p_normalized_measure x2 st + | Measure.Var v -> p_measure_var v st + | Measure.One _ -> p_measure_one st + | Measure.RationalPower(measure = x; power = q) -> p_measure_power x q st // By normalizing the unit-of-measure and treating integer powers as a special case, // we ensure that the pickle format for rational powers of units (byte 5 followed by @@ -1577,80 +2232,107 @@ let rec p_normalized_measure unt st = // compatibility of formats with versions prior to F# 4.0. // // See https://github.com/dotnet/fsharp/issues/69 -let p_measure_expr unt st = p_normalized_measure (normalizeMeasure st.oglobals unt) st +let p_measure_expr unt st = + p_normalized_measure (normalizeMeasure st.oglobals unt) st let u_rational st = - let a, b = u_tup2 u_int32 u_int32 st in DivRational (intToRational a) (intToRational b) + let a, b = u_tup2 u_int32 u_int32 st in DivRational (intToRational a) (intToRational b) let rec u_measure_expr st = let tag = u_byte st + match tag with | 0 -> let a = u_tcref st in Measure.Const(a, range0) | 1 -> let a = u_measure_expr st in Measure.Inv a - | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod (a, b, range0) + | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod(a, b, range0) | 3 -> let a = u_tpref st in Measure.Var(a) | 4 -> Measure.One(range0) - | 5 -> let a = u_measure_expr st in let b = u_rational st in Measure.RationalPower (a, b) + | 5 -> + let a = u_measure_expr st in + let b = u_rational st in + Measure.RationalPower(a, b) | _ -> ufailwith st "u_measure_expr" let p_tyar_constraint x st = match x with - | TyparConstraint.CoercesTo (a, _) -> p_byte 0 st; p_ty a st - | TyparConstraint.MayResolveMember(traitInfo, _) -> p_byte 1 st; p_trait traitInfo st - | TyparConstraint.DefaultsTo(_, rty, _) -> p_byte 2 st; p_ty rty st - | TyparConstraint.SupportsNull _ -> p_byte 3 st - | TyparConstraint.IsNonNullableStruct _ -> p_byte 4 st - | TyparConstraint.IsReferenceType _ -> p_byte 5 st - | TyparConstraint.RequiresDefaultConstructor _ -> p_byte 6 st - | TyparConstraint.SimpleChoice(tys, _) -> p_byte 7 st; p_tys tys st - | TyparConstraint.IsEnum(ty, _) -> p_byte 8 st; p_ty ty st - | TyparConstraint.IsDelegate(aty, bty, _) -> p_byte 9 st; p_ty aty st; p_ty bty st - | TyparConstraint.SupportsComparison _ -> p_byte 10 st - | TyparConstraint.SupportsEquality _ -> p_byte 11 st - | TyparConstraint.IsUnmanaged _ -> p_byte 12 st - + | TyparConstraint.CoercesTo(a, _) -> + p_byte 0 st + p_ty a st + | TyparConstraint.MayResolveMember(traitInfo, _) -> + p_byte 1 st + p_trait traitInfo st + | TyparConstraint.DefaultsTo(_, rty, _) -> + p_byte 2 st + p_ty rty st + | TyparConstraint.SupportsNull _ -> p_byte 3 st + | TyparConstraint.IsNonNullableStruct _ -> p_byte 4 st + | TyparConstraint.IsReferenceType _ -> p_byte 5 st + | TyparConstraint.RequiresDefaultConstructor _ -> p_byte 6 st + | TyparConstraint.SimpleChoice(tys, _) -> + p_byte 7 st + p_tys tys st + | TyparConstraint.IsEnum(ty, _) -> + p_byte 8 st + p_ty ty st + | TyparConstraint.IsDelegate(aty, bty, _) -> + p_byte 9 st + p_ty aty st + p_ty bty st + | TyparConstraint.SupportsComparison _ -> p_byte 10 st + | TyparConstraint.SupportsEquality _ -> p_byte 11 st + | TyparConstraint.IsUnmanaged _ -> p_byte 12 st + | TyparConstraint.NotSupportsNull _ - | TyparConstraint.AllowsRefStruct _ -> - failwith $"%A{x} constraints should only be emitted to streamB" + | TyparConstraint.AllowsRefStruct _ -> failwith $"%A{x} constraints should only be emitted to streamB" // Some extra F#9+ constraints are stored in stream B, these will be ignored by earlier F# compilers -let p_tyar_constraintB x st = - match x with - | TyparConstraint.NotSupportsNull _ -> p_byteB 1 st - | TyparConstraint.AllowsRefStruct _ -> p_byteB 2 st +let p_tyar_constraintB x st = + match x with + | TyparConstraint.NotSupportsNull _ -> p_byteB 1 st + | TyparConstraint.AllowsRefStruct _ -> p_byteB 2 st | _ -> failwith "only NotSupportsNull and AllowsRefStruct constraints should be emitted to streamB" -let p_tyar_constraints cxs st = - let cxs1, cxs2 = cxs |> List.partition (function TyparConstraint.NotSupportsNull _ | TyparConstraint.AllowsRefStruct _ -> false | _ -> true) +let p_tyar_constraints cxs st = + let cxs1, cxs2 = + cxs + |> List.partition (function + | TyparConstraint.NotSupportsNull _ + | TyparConstraint.AllowsRefStruct _ -> false + | _ -> true) + p_list p_tyar_constraint cxs1 st // Some extra F#9+ constraints are stored in stream B, these will be ignored by earlier F# compilers p_listB p_tyar_constraintB cxs2 st let u_tyar_constraint st = let tag = u_byte st + match tag with - | 0 -> u_ty st |> (fun a _ -> TyparConstraint.CoercesTo (a, range0) ) - | 1 -> u_trait st |> (fun a _ -> TyparConstraint.MayResolveMember(a, range0)) - | 2 -> u_ty st |> (fun a ridx -> TyparConstraint.DefaultsTo(ridx, a, range0)) - | 3 -> (fun _ -> TyparConstraint.SupportsNull range0) - | 4 -> (fun _ -> TyparConstraint.IsNonNullableStruct range0) - | 5 -> (fun _ -> TyparConstraint.IsReferenceType range0) - | 6 -> (fun _ -> TyparConstraint.RequiresDefaultConstructor range0) - | 7 -> u_tys st |> (fun a _ -> TyparConstraint.SimpleChoice(a, range0)) - | 8 -> u_ty st |> (fun a _ -> TyparConstraint.IsEnum(a, range0)) - | 9 -> u_tup2 u_ty u_ty st |> (fun (a, b) _ -> TyparConstraint.IsDelegate(a, b, range0)) - | 10 -> (fun _ -> TyparConstraint.SupportsComparison range0) - | 11 -> (fun _ -> TyparConstraint.SupportsEquality range0) - | 12 -> (fun _ -> TyparConstraint.IsUnmanaged range0) + | 0 -> u_ty st |> (fun a _ -> TyparConstraint.CoercesTo(a, range0)) + | 1 -> u_trait st |> (fun a _ -> TyparConstraint.MayResolveMember(a, range0)) + | 2 -> u_ty st |> (fun a ridx -> TyparConstraint.DefaultsTo(ridx, a, range0)) + | 3 -> (fun _ -> TyparConstraint.SupportsNull range0) + | 4 -> (fun _ -> TyparConstraint.IsNonNullableStruct range0) + | 5 -> (fun _ -> TyparConstraint.IsReferenceType range0) + | 6 -> (fun _ -> TyparConstraint.RequiresDefaultConstructor range0) + | 7 -> u_tys st |> (fun a _ -> TyparConstraint.SimpleChoice(a, range0)) + | 8 -> u_ty st |> (fun a _ -> TyparConstraint.IsEnum(a, range0)) + | 9 -> + u_tup2 u_ty u_ty st + |> (fun (a, b) _ -> TyparConstraint.IsDelegate(a, b, range0)) + | 10 -> (fun _ -> TyparConstraint.SupportsComparison range0) + | 11 -> (fun _ -> TyparConstraint.SupportsEquality range0) + | 12 -> (fun _ -> TyparConstraint.IsUnmanaged range0) | _ -> ufailwith st "u_tyar_constraint" // Some extra F#9+ constraints are stored in stream B, these will be ignored by earlier F# compilers -let u_tyar_constraintB st = +let u_tyar_constraintB st = let tag = u_byteB st + match tag with | 1 -> TyparConstraint.NotSupportsNull range0 | 2 -> TyparConstraint.AllowsRefStruct range0 - | _ -> ufailwith st "u_tyar_constraintB - unexpected constraint in streamB" + | _ -> ufailwith st "u_tyar_constraintB - unexpected constraint in streamB" let u_tyar_constraints st = let cxs1 = u_list_revi u_tyar_constraint st @@ -1658,211 +2340,237 @@ let u_tyar_constraints st = // // If the B stream is not present (e.g. reading F# 4.5 components) then this list will be empty // via the implementation of u_listB. - let cxs2 = u_listB u_tyar_constraintB st + let cxs2 = u_listB u_tyar_constraintB st cxs1 @ cxs2 let p_tyar_spec_data (x: Typar) st = p_tup5 - p_ident - p_attribs - p_int64 - p_tyar_constraints - p_xmldoc - (x.typar_id, x.Attribs, int64 x.typar_flags.PickledBits, x.Constraints, x.XmlDoc) st + p_ident + p_attribs + p_int64 + p_tyar_constraints + p_xmldoc + (x.typar_id, x.Attribs, int64 x.typar_flags.PickledBits, x.Constraints, x.XmlDoc) + st let p_tyar_spec (x: Typar) st = //Disabled, workaround for bug 2721: if x.Rigidity <> TyparRigidity.Rigid then warning(Error(sprintf "p_tyar_spec: typar#%d is not rigid" x.Stamp, x.Range)) - if x.IsFromError then warning(Error((0, "p_tyar_spec: from error"), x.Range)) + if x.IsFromError then + warning (Error((0, "p_tyar_spec: from error"), x.Range)) + p_osgn_decl st.otypars p_tyar_spec_data x st let p_tyar_specs = (p_list p_tyar_spec) let u_tyar_spec_data st = let a, c, d, e, g = u_tup5 u_ident u_attribs u_int64 u_tyar_constraints u_xmldoc st - { typar_id=a - typar_stamp=newStamp() - typar_flags=TyparFlags(int32 d) - typar_solution=None - typar_astype= Unchecked.defaultof<_> - typar_opt_data= - match g, e, c with - | doc, [], [] when doc.IsEmpty -> None - | _ -> Some { typar_il_name = None; typar_xmldoc = g; typar_constraints = e; typar_attribs = c;typar_is_contravariant = false } } + + { + typar_id = a + typar_stamp = newStamp () + typar_flags = TyparFlags(int32 d) + typar_solution = None + typar_astype = Unchecked.defaultof<_> + typar_opt_data = + match g, e, c with + | doc, [], [] when doc.IsEmpty -> None + | _ -> + Some + { + typar_il_name = None + typar_xmldoc = g + typar_constraints = e + typar_attribs = c + typar_is_contravariant = false + } + } let u_tyar_spec st = u_osgn_decl st.itypars u_tyar_spec_data st let u_tyar_specs = (u_list u_tyar_spec) -let _ = fill_p_ty2 (fun isStructThisArgPos ty st -> - let ty = stripTyparEqns ty - - // See comment on 'checkForInRefStructThisArg' - let ty = - if isInByrefTy st.oglobals ty && isStructThisArgPos then - // Convert the inref to a byref - mkByrefTy st.oglobals (destByrefTy st.oglobals ty) - else - ty - - match ty with - | TType_tuple (tupInfo, l) -> - if evalTupInfoIsStruct tupInfo then - p_byte 8 st; p_tys l st - else - p_byte 0 st; p_tys l st - - | TType_app(ERefNonLocal nleref, [], nullness) -> - if st.oglobals.langFeatureNullness then - match nullness.Evaluate() with - | NullnessInfo.WithNull -> p_byteB 9 st - | NullnessInfo.WithoutNull -> p_byteB 10 st - | NullnessInfo.AmbivalentToNull -> p_byteB 11 st - p_byte 1 st; p_simpletyp nleref st - - | TType_app (tc, tinst, nullness) -> - if st.oglobals.langFeatureNullness then - match nullness.Evaluate() with - | NullnessInfo.WithNull -> p_byteB 12 st - | NullnessInfo.WithoutNull -> p_byteB 13 st - | NullnessInfo.AmbivalentToNull -> p_byteB 14 st - p_byte 2 st; p_tcref "typ" tc st; p_tys tinst st - - | TType_fun (d,r,nullness) -> - if st.oglobals.langFeatureNullness then - match nullness.Evaluate() with - | NullnessInfo.WithNull -> p_byteB 15 st - | NullnessInfo.WithoutNull -> p_byteB 16 st - | NullnessInfo.AmbivalentToNull -> p_byteB 17 st - p_byte 3 st - // Note, the "this" argument may be found in the domain position of a function type, so propagate the isStructThisArgPos value - p_ty2 isStructThisArgPos d st - p_ty r st - - | TType_var (r, nullness) -> - if st.oglobals.langFeatureNullness then - match nullness.Evaluate() with - | NullnessInfo.WithNull -> p_byteB 18 st - | NullnessInfo.WithoutNull -> p_byteB 19 st - | NullnessInfo.AmbivalentToNull -> p_byteB 20 st - p_byte 4 st - p_tpref r st - - | TType_forall (tps, r) -> - p_byte 5 st - p_tyar_specs tps st - // Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value - p_ty2 isStructThisArgPos r st - - | TType_measure unt -> - p_byte 6 st - p_measure_expr unt st +let _ = + fill_p_ty2 (fun isStructThisArgPos ty st -> + let ty = stripTyparEqns ty + + // See comment on 'checkForInRefStructThisArg' + let ty = + if isInByrefTy st.oglobals ty && isStructThisArgPos then + // Convert the inref to a byref + mkByrefTy st.oglobals (destByrefTy st.oglobals ty) + else + ty + + match ty with + | TType_tuple(tupInfo, l) -> + if evalTupInfoIsStruct tupInfo then + p_byte 8 st + p_tys l st + else + p_byte 0 st + p_tys l st + + | TType_app(ERefNonLocal nleref, [], nullness) -> + if st.oglobals.langFeatureNullness then + match nullness.Evaluate() with + | NullnessInfo.WithNull -> p_byteB 9 st + | NullnessInfo.WithoutNull -> p_byteB 10 st + | NullnessInfo.AmbivalentToNull -> p_byteB 11 st - | TType_ucase (uc, tinst) -> - p_byte 7 st - p_ucref uc st - p_tys tinst st + p_byte 1 st + p_simpletyp nleref st - // p_byte 8 taken by TType_tuple above - | TType_anon (anonInfo, l) -> - p_byte 9 st - p_anonInfo anonInfo st - p_tys l st - ) + | TType_app(tc, tinst, nullness) -> + if st.oglobals.langFeatureNullness then + match nullness.Evaluate() with + | NullnessInfo.WithNull -> p_byteB 12 st + | NullnessInfo.WithoutNull -> p_byteB 13 st + | NullnessInfo.AmbivalentToNull -> p_byteB 14 st -let _ = fill_u_ty (fun st -> - let tag = u_byte st + p_byte 2 st + p_tcref "typ" tc st + p_tys tinst st + + | TType_fun(d, r, nullness) -> + if st.oglobals.langFeatureNullness then + match nullness.Evaluate() with + | NullnessInfo.WithNull -> p_byteB 15 st + | NullnessInfo.WithoutNull -> p_byteB 16 st + | NullnessInfo.AmbivalentToNull -> p_byteB 17 st + + p_byte 3 st + // Note, the "this" argument may be found in the domain position of a function type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos d st + p_ty r st + + | TType_var(r, nullness) -> + if st.oglobals.langFeatureNullness then + match nullness.Evaluate() with + | NullnessInfo.WithNull -> p_byteB 18 st + | NullnessInfo.WithoutNull -> p_byteB 19 st + | NullnessInfo.AmbivalentToNull -> p_byteB 20 st + + p_byte 4 st + p_tpref r st + + | TType_forall(tps, r) -> + p_byte 5 st + p_tyar_specs tps st + // Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value + p_ty2 isStructThisArgPos r st + + | TType_measure unt -> + p_byte 6 st + p_measure_expr unt st + + | TType_ucase(uc, tinst) -> + p_byte 7 st + p_ucref uc st + p_tys tinst st + + // p_byte 8 taken by TType_tuple above + | TType_anon(anonInfo, l) -> + p_byte 9 st + p_anonInfo anonInfo st + p_tys l st) + +let _ = + fill_u_ty (fun st -> + let tag = u_byte st - match tag with - | 0 -> - let l = u_tys st - TType_tuple (tupInfoRef, l) - | 1 -> - let tagB = u_byteB st - let sty = u_simpletyp st - match tagB with + match tag with | 0 -> - sty - | 9 -> - match sty with - | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownWithNull) - | _ -> ufailwith st "u_ty 9a" - | 10 -> - match sty with - | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownWithoutNull) - | _ -> ufailwith st "u_ty 9b" - | 11 -> - match sty with - | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownAmbivalentToNull) - | _ -> ufailwith st "u_ty 9c" - | b -> ufailwith st (sprintf "u_ty - 1/B, byte = %A" b) - | 2 -> - let tagB = u_byteB st - let tcref = u_tcref st - let tinst = u_tys st - match tagB with - | 0 -> TType_app (tcref, tinst, KnownAmbivalentToNull) - | 12 -> TType_app (tcref, tinst, KnownWithNull) - | 13 -> TType_app (tcref, tinst, KnownWithoutNull) - | 14 -> TType_app (tcref, tinst, KnownAmbivalentToNull) - | _ -> ufailwith st "u_ty - 2/B" - | 3 -> - let tagB = u_byteB st - let d = u_ty st - let r = u_ty st - match tagB with - | 0 -> TType_fun (d, r, KnownAmbivalentToNull) - | 15 -> TType_fun (d, r, KnownWithNull) - | 16 -> TType_fun (d, r, KnownWithoutNull) - | 17 -> TType_fun (d, r, KnownAmbivalentToNull) - | _ -> ufailwith st "u_ty - 3/B" - | 4 -> - let tagB = u_byteB st - let r = u_tpref st - match tagB with - | 0 -> r.AsType KnownAmbivalentToNull - | 18 -> r.AsType KnownWithNull - | 19 -> r.AsType KnownWithoutNull - | 20 -> r.AsType KnownAmbivalentToNull - | _ -> ufailwith st "u_ty - 4/B" - - | 5 -> - let tps = u_tyar_specs st - let r = u_ty st - TType_forall (tps, r) - - | 6 -> - let unt = u_measure_expr st - TType_measure unt - - | 7 -> - let uc = u_ucref st - let tinst = u_tys st - TType_ucase (uc, tinst) - - | 8 -> - let l = u_tys st - TType_tuple (tupInfoStruct, l) - - | 9 -> - let anonInfo = u_anonInfo st - let l = u_tys st - TType_anon (anonInfo, l) - - | _ -> - ufailwith st "u_typ") - -let fill_p_binds, p_binds = p_hole() -let fill_p_targets, p_targets = p_hole() -let fill_p_Exprs, p_Exprs = p_hole() -let fill_p_constraints, p_constraints = p_hole() -let fill_p_Vals, p_Vals = p_hole() - -let fill_u_binds, u_binds = u_hole() -let fill_u_targets, u_targets = u_hole() -let fill_u_Exprs, u_Exprs = u_hole() -let fill_u_constraints, u_constraints = u_hole() -let fill_u_Vals, u_Vals = u_hole() + let l = u_tys st + TType_tuple(tupInfoRef, l) + | 1 -> + let tagB = u_byteB st + let sty = u_simpletyp st + + match tagB with + | 0 -> sty + | 9 -> + match sty with + | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownWithNull) + | _ -> ufailwith st "u_ty 9a" + | 10 -> + match sty with + | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownWithoutNull) + | _ -> ufailwith st "u_ty 9b" + | 11 -> + match sty with + | TType_app(tcref, _, _) -> TType_app(tcref, [], KnownAmbivalentToNull) + | _ -> ufailwith st "u_ty 9c" + | b -> ufailwith st (sprintf "u_ty - 1/B, byte = %A" b) + | 2 -> + let tagB = u_byteB st + let tcref = u_tcref st + let tinst = u_tys st + + match tagB with + | 0 -> TType_app(tcref, tinst, KnownAmbivalentToNull) + | 12 -> TType_app(tcref, tinst, KnownWithNull) + | 13 -> TType_app(tcref, tinst, KnownWithoutNull) + | 14 -> TType_app(tcref, tinst, KnownAmbivalentToNull) + | _ -> ufailwith st "u_ty - 2/B" + | 3 -> + let tagB = u_byteB st + let d = u_ty st + let r = u_ty st + + match tagB with + | 0 -> TType_fun(d, r, KnownAmbivalentToNull) + | 15 -> TType_fun(d, r, KnownWithNull) + | 16 -> TType_fun(d, r, KnownWithoutNull) + | 17 -> TType_fun(d, r, KnownAmbivalentToNull) + | _ -> ufailwith st "u_ty - 3/B" + | 4 -> + let tagB = u_byteB st + let r = u_tpref st + + match tagB with + | 0 -> r.AsType KnownAmbivalentToNull + | 18 -> r.AsType KnownWithNull + | 19 -> r.AsType KnownWithoutNull + | 20 -> r.AsType KnownAmbivalentToNull + | _ -> ufailwith st "u_ty - 4/B" + + | 5 -> + let tps = u_tyar_specs st + let r = u_ty st + TType_forall(tps, r) + + | 6 -> + let unt = u_measure_expr st + TType_measure unt + + | 7 -> + let uc = u_ucref st + let tinst = u_tys st + TType_ucase(uc, tinst) + + | 8 -> + let l = u_tys st + TType_tuple(tupInfoStruct, l) + + | 9 -> + let anonInfo = u_anonInfo st + let l = u_tys st + TType_anon(anonInfo, l) + + | _ -> ufailwith st "u_typ") + +let fill_p_binds, p_binds = p_hole () +let fill_p_targets, p_targets = p_hole () +let fill_p_Exprs, p_Exprs = p_hole () +let fill_p_constraints, p_constraints = p_hole () +let fill_p_Vals, p_Vals = p_hole () + +let fill_u_binds, u_binds = u_hole () +let fill_u_targets, u_targets = u_hole () +let fill_u_Exprs, u_Exprs = u_hole () +let fill_u_constraints, u_constraints = u_hole () +let fill_u_Vals, u_Vals = u_hole () let p_ArgReprInfo (x: ArgReprInfo) st = p_attribs x.Attribs st @@ -1872,7 +2580,7 @@ let p_TyparReprInfo (TyparReprInfo(a, b)) st = p_ident a st p_kind b st -let p_ValReprInfo (ValReprInfo (a, args, ret)) st = +let p_ValReprInfo (ValReprInfo(a, args, ret)) st = p_list p_TyparReprInfo a st p_list (p_list p_ArgReprInfo) args st p_ArgReprInfo ret st @@ -1880,9 +2588,15 @@ let p_ValReprInfo (ValReprInfo (a, args, ret)) st = let u_ArgReprInfo st = let a = u_attribs st let b = u_option u_ident st + match a, b with | [], None -> ValReprInfo.unnamedTopArg1 - | _ -> { Attribs = a; Name = b; OtherRange = None } + | _ -> + { + Attribs = a + Name = b + OtherRange = None + } let u_TyparReprInfo st = let a = u_ident st @@ -1893,16 +2607,15 @@ let u_ValReprInfo st = let a = u_list u_TyparReprInfo st let b = u_list (u_list u_ArgReprInfo) st let c = u_ArgReprInfo st - ValReprInfo (a, b, c) + ValReprInfo(a, b, c) -let p_ranges x st = - p_option (p_tup2 p_range p_range) x st +let p_ranges x st = p_option (p_tup2 p_range p_range) x st let p_istype x st = match x with | FSharpModuleWithSuffix -> p_byte 0 st - | ModuleOrType -> p_byte 1 st - | Namespace _ -> p_byte 2 st + | ModuleOrType -> p_byte 1 st + | Namespace _ -> p_byte 2 st let p_cpath (CompPath(a, _, b)) st = p_tup2 p_ILScopeRef (p_list (p_tup2 p_string p_istype)) (a, b) st @@ -1911,6 +2624,7 @@ let u_ranges st = u_option (u_tup2 u_range u_range) st let u_istype st = let tag = u_byte st + match tag with | 0 -> FSharpModuleWithSuffix | 1 -> ModuleOrType @@ -1918,7 +2632,7 @@ let u_istype st = | _ -> ufailwith st "u_istype" let u_cpath st = - let a, b = u_tup2 u_ILScopeRef (u_list (u_tup2 u_string u_istype)) st + let a, b = u_tup2 u_ILScopeRef (u_list (u_tup2 u_string u_istype)) st CompPath(a, SyntaxAccess.Unknown, b) let rec p_tycon_repr x st = @@ -1926,27 +2640,42 @@ let rec p_tycon_repr x st = match x with // Records - | TFSharpTyconRepr { fsobjmodel_rfields = fs; fsobjmodel_kind = TFSharpRecord } -> + | TFSharpTyconRepr { + fsobjmodel_rfields = fs + fsobjmodel_kind = TFSharpRecord + } -> p_byte 1 st p_byte 0 st p_rfield_table fs st false // Unions without static fields - | TFSharpTyconRepr { fsobjmodel_cases = x; fsobjmodel_kind = TFSharpUnion; fsobjmodel_rfields = fs } when fs.FieldsByIndex.Length = 0 -> + | TFSharpTyconRepr { + fsobjmodel_cases = x + fsobjmodel_kind = TFSharpUnion + fsobjmodel_rfields = fs + } when fs.FieldsByIndex.Length = 0 -> p_byte 1 st p_byte 1 st p_array p_unioncase_spec x.CasesTable.CasesByIndex st false // Unions with static fields, added to format - | TFSharpTyconRepr ({ fsobjmodel_cases = cases; fsobjmodel_kind = TFSharpUnion } as r) -> + | TFSharpTyconRepr({ + fsobjmodel_cases = cases + fsobjmodel_kind = TFSharpUnion + } as r) -> if st.oglobals.compilingFSharpCore then let fields = r.fsobjmodel_rfields.FieldsByIndex let firstFieldRange = fields[0].DefinitionRange - let allFieldsText = fields |> Array.map (fun f -> f.LogicalName) |> String.concat System.Environment.NewLine - raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible("fields in union",allFieldsText), firstFieldRange)) - + + let allFieldsText = + fields + |> Array.map (fun f -> f.LogicalName) + |> String.concat System.Environment.NewLine + + raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible ("fields in union", allFieldsText), firstFieldRange)) + p_byte 2 st p_array p_unioncase_spec cases.CasesTable.CasesByIndex st p_tycon_objmodel_data r st @@ -1958,13 +2687,13 @@ let rec p_tycon_repr x st = p_ILType ilTy st false - | TFSharpTyconRepr r -> + | TFSharpTyconRepr r -> p_byte 1 st p_byte 3 st p_tycon_objmodel_data r st false - | TMeasureableRepr ty -> + | TMeasureableRepr ty -> p_byte 1 st p_byte 4 st p_ty ty st @@ -1984,7 +2713,7 @@ let rec p_tycon_repr x st = // Pickle generated type definitions as a TAsmRepr p_byte 1 st p_byte 2 st - p_ILType (mkILBoxedType(ILTypeSpec.Create(TypeProviders.GetILTypeRefOfProvidedType(info.ProvidedType, range0), []))) st + p_ILType (mkILBoxedType (ILTypeSpec.Create(TypeProviders.GetILTypeRefOfProvidedType(info.ProvidedType, range0), []))) st true | TProvidedNamespaceRepr _ -> @@ -1992,13 +2721,12 @@ let rec p_tycon_repr x st = false #endif - | TILObjectRepr (TILObjectReprData (_, _, td)) -> - error (Failure("Unexpected IL type definition"+td.Name)) + | TILObjectRepr(TILObjectReprData(_, _, td)) -> error (Failure("Unexpected IL type definition" + td.Name)) and p_tycon_objmodel_data x st = - p_tycon_objmodel_kind x.fsobjmodel_kind st - p_vrefs "vslots" x.fsobjmodel_vslots st - p_rfield_table x.fsobjmodel_rfields st + p_tycon_objmodel_kind x.fsobjmodel_kind st + p_vrefs "vslots" x.fsobjmodel_vslots st + p_rfield_table x.fsobjmodel_rfields st and p_attribs_ext f x st = p_list_ext f p_attrib x st @@ -2010,16 +2738,22 @@ and p_unioncase_spec x st = p_string x.CompiledName st p_ident x.Id st // The XmlDoc are only written for the extended in-memory format. We encode their presence using a marker bit here - p_attribs_ext (if st.oInMem then Some (p_xmldoc x.XmlDoc) else None) x.Attribs st + p_attribs_ext (if st.oInMem then Some(p_xmldoc x.XmlDoc) else None) x.Attribs st p_string x.XmlDocSig st p_access x.Accessibility st and p_exnc_repr x st = match x with - | TExnAbbrevRepr x -> p_byte 0 st; (p_tcref "exn abbrev") x st - | TExnAsmRepr x -> p_byte 1 st; p_ILTypeRef x st - | TExnFresh x -> p_byte 2 st; p_rfield_table x st - | TExnNone -> p_byte 3 st + | TExnAbbrevRepr x -> + p_byte 0 st + (p_tcref "exn abbrev") x st + | TExnAsmRepr x -> + p_byte 1 st + p_ILTypeRef x st + | TExnFresh x -> + p_byte 2 st + p_rfield_table x st + | TExnNone -> p_byte 3 st and p_access (TAccess n) st = p_list p_cpath n st @@ -2031,7 +2765,7 @@ and p_recdfield_spec x st = p_bool x.rfield_secret st p_option p_const x.rfield_const st p_ident x.rfield_id st - p_attribs_ext (if st.oInMem then Some (p_xmldoc x.XmlDoc) else None) x.rfield_pattribs st + p_attribs_ext (if st.oInMem then Some(p_xmldoc x.XmlDoc) else None) x.rfield_pattribs st p_attribs x.rfield_fattribs st p_string x.rfield_xmldocsig st p_access x.rfield_access st @@ -2043,101 +2777,128 @@ and p_entity_spec_data (x: Entity) st = p_tyar_specs (x.entity_typars.Force(x.entity_range)) st p_string x.entity_logical_name st p_option p_string x.EntityCompiledName st - p_range x.entity_range st + p_range x.entity_range st p_option p_pubpath x.entity_pubpath st p_access x.Accessibility st - p_access x.TypeReprAccessibility st + p_access x.TypeReprAccessibility st p_attribs x.entity_attribs st let flagBit = p_tycon_repr x.entity_tycon_repr st p_option p_ty x.TypeAbbrev st p_tcaug x.entity_tycon_tcaug st p_string System.String.Empty st p_kind x.TypeOrMeasureKind st - p_int64 (x.entity_flags.PickledBits ||| (if flagBit then EntityFlags.ReservedBitForPickleFormatTyconReprFlag else 0L)) st + + p_int64 + (x.entity_flags.PickledBits + ||| (if flagBit then + EntityFlags.ReservedBitForPickleFormatTyconReprFlag + else + 0L)) + st + p_option p_cpath x.entity_cpath st p_maybe_lazy p_modul_typ x.entity_modul_type st p_exnc_repr x.ExceptionInfo st + if st.oInMem then p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st - and p_tcaug p st = p_tup9 - (p_option (p_tup2 (p_vref "compare_obj") (p_vref "compare"))) - (p_option (p_vref "compare_withc")) - (p_option (p_tup3 (p_vref "hash_obj") (p_vref "hash_withc") (p_vref "equals_withc"))) - (p_option (p_tup2 (p_vref "hash") (p_vref "equals"))) - (p_list (p_tup2 p_string (p_vref "adhoc"))) - (p_list (p_tup3 p_ty p_bool p_dummy_range)) - (p_option p_ty) - p_bool - (p_space 1) - (p.tcaug_compare, - p.tcaug_compare_withc, - p.tcaug_hash_and_equals_withc |> Option.map (fun (v1, v2, v3, _) -> (v1, v2, v3)), - p.tcaug_equals, - (p.tcaug_adhoc_list - |> ResizeArray.toList - // Explicit impls of interfaces only get kept in the adhoc list - // in order to get check the well-formedness of an interface. - // Keeping them across assembly boundaries is not valid, because relinking their ValRefs - // does not work correctly (they may get incorrectly relinked to a default member) - |> List.filter (fun (isExplicitImpl, _) -> not isExplicitImpl) - |> List.map (fun (_, vref) -> vref.LogicalName, vref)), - p.tcaug_interfaces, - p.tcaug_super, - p.tcaug_abstract, - space) st - -and p_entity_spec x st = p_osgn_decl st.oentities p_entity_spec_data x st + (p_option (p_tup2 (p_vref "compare_obj") (p_vref "compare"))) + (p_option (p_vref "compare_withc")) + (p_option (p_tup3 (p_vref "hash_obj") (p_vref "hash_withc") (p_vref "equals_withc"))) + (p_option (p_tup2 (p_vref "hash") (p_vref "equals"))) + (p_list (p_tup2 p_string (p_vref "adhoc"))) + (p_list (p_tup3 p_ty p_bool p_dummy_range)) + (p_option p_ty) + p_bool + (p_space 1) + (p.tcaug_compare, + p.tcaug_compare_withc, + p.tcaug_hash_and_equals_withc + |> Option.map (fun (v1, v2, v3, _) -> (v1, v2, v3)), + p.tcaug_equals, + (p.tcaug_adhoc_list + |> ResizeArray.toList + // Explicit impls of interfaces only get kept in the adhoc list + // in order to get check the well-formedness of an interface. + // Keeping them across assembly boundaries is not valid, because relinking their ValRefs + // does not work correctly (they may get incorrectly relinked to a default member) + |> List.filter (fun (isExplicitImpl, _) -> not isExplicitImpl) + |> List.map (fun (_, vref) -> vref.LogicalName, vref)), + p.tcaug_interfaces, + p.tcaug_super, + p.tcaug_abstract, + space) + st + +and p_entity_spec x st = + p_osgn_decl st.oentities p_entity_spec_data x st and p_parentref x st = match x with | ParentNone -> p_byte 0 st - | Parent x -> p_byte 1 st; p_tcref "parent tycon" x st + | Parent x -> + p_byte 1 st + p_tcref "parent tycon" x st and p_attribkind x st = match x with - | ILAttrib x -> p_byte 0 st; p_ILMethodRef x st - | FSAttrib x -> p_byte 1 st; p_vref "attrib" x st + | ILAttrib x -> + p_byte 0 st + p_ILMethodRef x st + | FSAttrib x -> + p_byte 1 st + p_vref "attrib" x st -and p_attrib (Attrib (a, b, c, d, e, _targets, f)) st = // AttributeTargets are not preserved +and p_attrib (Attrib(a, b, c, d, e, _targets, f)) st = // AttributeTargets are not preserved p_tup6 (p_tcref "attrib") p_attribkind (p_list p_attrib_expr) (p_list p_attrib_arg) p_bool p_dummy_range (a, b, c, d, e, f) st -and p_attrib_expr (AttribExpr(e1, e2)) st = - p_tup2 p_expr p_expr (e1, e2) st +and p_attrib_expr (AttribExpr(e1, e2)) st = p_tup2 p_expr p_expr (e1, e2) st and p_attrib_arg (AttribNamedArg(a, b, c, d)) st = p_tup4 p_string p_ty p_bool p_attrib_expr (a, b, c, d) st and p_member_info (x: ValMemberInfo) st = - p_tup4 (p_tcref "member_info") p_MemberFlags (p_list p_slotsig) p_bool - (x.ApparentEnclosingEntity, x.MemberFlags, x.ImplementedSlotSigs, x.IsImplemented) st + p_tup4 + (p_tcref "member_info") + p_MemberFlags + (p_list p_slotsig) + p_bool + (x.ApparentEnclosingEntity, x.MemberFlags, x.ImplementedSlotSigs, x.IsImplemented) + st and p_tycon_objmodel_kind x st = match x with - | TFSharpClass -> p_byte 0 st - | TFSharpInterface -> p_byte 1 st - | TFSharpStruct -> p_byte 2 st - | TFSharpDelegate ss -> p_byte 3 st; p_slotsig ss st - | TFSharpEnum -> p_byte 4 st - | TFSharpUnion -> + | TFSharpClass -> p_byte 0 st + | TFSharpInterface -> p_byte 1 st + | TFSharpStruct -> p_byte 2 st + | TFSharpDelegate ss -> + p_byte 3 st + p_slotsig ss st + | TFSharpEnum -> p_byte 4 st + | TFSharpUnion -> if st.oglobals.compilingFSharpCore then - raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible("union as FSharpTyconKind ",st.ofile), range.Zero)) + raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible ("union as FSharpTyconKind ", st.ofile), range.Zero)) + p_byte 5 st - | TFSharpRecord -> + | TFSharpRecord -> if st.oglobals.compilingFSharpCore then - raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible("record as FSharpTyconKind ",st.ofile), range.Zero)) + raise (Error(FSComp.SR.pickleFsharpCoreBackwardsCompatible ("record as FSharpTyconKind ", st.ofile), range.Zero)) + p_byte 6 st and p_vrefFlags x st = match x with | NormalValUse -> p_byte 0 st - | CtorValUsedAsSuperInit -> p_byte 1 st - | CtorValUsedAsSelfInit -> p_byte 2 st - | PossibleConstrainedCall ty -> p_byte 3 st; p_ty ty st + | CtorValUsedAsSuperInit -> p_byte 1 st + | CtorValUsedAsSelfInit -> p_byte 2 st + | PossibleConstrainedCall ty -> + p_byte 3 st + p_ty ty st | VSlotDirectCall -> p_byte 4 st and p_ValData x st = @@ -2157,44 +2918,42 @@ and p_ValData x st = p_access x.Accessibility st p_parentref x.TryDeclaringEntity st p_option p_const x.LiteralValue st + if st.oInMem then p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st -and p_Val x st = - p_osgn_decl st.ovals p_ValData x st +and p_Val x st = p_osgn_decl st.ovals p_ValData x st and p_modul_typ (x: ModuleOrNamespaceType) st = - p_tup3 - p_istype - (p_qlist p_Val) - (p_qlist p_entity_spec) - (x.ModuleOrNamespaceKind, x.AllValsAndMembers, x.AllEntities) - st + p_tup3 p_istype (p_qlist p_Val) (p_qlist p_entity_spec) (x.ModuleOrNamespaceKind, x.AllValsAndMembers, x.AllEntities) st and u_tycon_repr st = let tag1 = u_byte st + match tag1 with | 0 -> (fun _flagBit -> TNoRepr) | 1 -> let tag2 = u_byte st + match tag2 with // Records historically use a different format to other FSharpTyconRepr | 0 -> let v = u_rfield_table st + (fun _flagBit -> TFSharpTyconRepr { fsobjmodel_cases = Construct.MakeUnionCases [] - fsobjmodel_kind=TFSharpRecord - fsobjmodel_vslots=[] - fsobjmodel_rfields=v + fsobjmodel_kind = TFSharpRecord + fsobjmodel_vslots = [] + fsobjmodel_rfields = v }) // Unions without static fields historically use a different format to other FSharpTyconRepr | 1 -> - let v = u_list u_unioncase_spec st + let v = u_list u_unioncase_spec st (fun _flagBit -> Construct.MakeUnionRepr v) | 2 -> @@ -2205,26 +2964,32 @@ and u_tycon_repr st = (fun flagBit -> if flagBit then let iltref = v.TypeRef + match st.iILModule with | None -> TNoRepr | Some iILModule -> - try - let rec find acc enclosingTypeNames (tdefs: ILTypeDefs) = - match enclosingTypeNames with - | [] -> List.rev acc, tdefs.FindByName iltref.Name - | h :: t -> - let nestedTypeDef = tdefs.FindByName h - find (nestedTypeDef :: acc) t nestedTypeDef.NestedTypes - let nestedILTypeDefs, ilTypeDef = find [] iltref.Enclosing iILModule.TypeDefs - TILObjectRepr(TILObjectReprData(st.iilscope, nestedILTypeDefs, ilTypeDef)) - with _ -> - System.Diagnostics.Debug.Assert(false, sprintf "failed to find IL backing metadata for cross-assembly generated type %s" iltref.FullName) - TNoRepr + try + let rec find acc enclosingTypeNames (tdefs: ILTypeDefs) = + match enclosingTypeNames with + | [] -> List.rev acc, tdefs.FindByName iltref.Name + | h :: t -> + let nestedTypeDef = tdefs.FindByName h + find (nestedTypeDef :: acc) t nestedTypeDef.NestedTypes + + let nestedILTypeDefs, ilTypeDef = find [] iltref.Enclosing iILModule.TypeDefs + TILObjectRepr(TILObjectReprData(st.iilscope, nestedILTypeDefs, ilTypeDef)) + with _ -> + System.Diagnostics.Debug.Assert( + false, + sprintf "failed to find IL backing metadata for cross-assembly generated type %s" iltref.FullName + ) + + TNoRepr else TAsmRepr v) | 3 -> - let v = u_tycon_objmodel_data st + let v = u_tycon_objmodel_data st (fun _flagBit -> TFSharpTyconRepr v) | 4 -> @@ -2237,45 +3002,56 @@ and u_tycon_repr st = | 2 -> let cases = u_array u_unioncase_spec st let data = u_tycon_objmodel_data st - fun _flagBit -> TFSharpTyconRepr { data with fsobjmodel_cases = Construct.MakeUnionCases (Array.toList cases) } + + fun _flagBit -> + TFSharpTyconRepr + { data with + fsobjmodel_cases = Construct.MakeUnionCases(Array.toList cases) + } | _ -> ufailwith st "u_tycon_repr" and u_tycon_objmodel_data st = let x1, x2, x3 = u_tup3 u_tycon_objmodel_kind u_vrefs u_rfield_table st + { fsobjmodel_cases = Construct.MakeUnionCases [] - fsobjmodel_kind=x1 - fsobjmodel_vslots=x2 - fsobjmodel_rfields=x3 + fsobjmodel_kind = x1 + fsobjmodel_vslots = x2 + fsobjmodel_rfields = x3 } and u_attribs_ext extraf st = u_list_ext extraf u_attrib st + and u_unioncase_spec st = - let a = u_rfield_table st + let a = u_rfield_table st let b = u_ty st // The union case compiled name is now computed from Id field when needed and is not stored in UnionCase record. let _c = u_string st - let d = u_ident st + let d = u_ident st // The XmlDoc is only present in the extended in-memory format. We detect its presence using a marker bit here let xmldoc, e = u_attribs_ext u_xmldoc st let f = u_string st let i = u_access st - { FieldTable=a - ReturnType=b - Id=d - Attribs=e - OwnXmlDoc= defaultArg xmldoc XmlDoc.Empty - OtherXmlDoc = XmlDoc.Empty - XmlDocSig=f - Accessibility=i - OtherRangeOpt=None } + + { + FieldTable = a + ReturnType = b + Id = d + Attribs = e + OwnXmlDoc = defaultArg xmldoc XmlDoc.Empty + OtherXmlDoc = XmlDoc.Empty + XmlDocSig = f + Accessibility = i + OtherRangeOpt = None + } and u_exnc_repr st = let tag = u_byte st + match tag with - | 0 -> u_tcref st |> TExnAbbrevRepr - | 1 -> u_ILTypeRef st |> TExnAsmRepr + | 0 -> u_tcref st |> TExnAbbrevRepr + | 1 -> u_ILTypeRef st |> TExnAsmRepr | 2 -> u_rfield_table st |> TExnFresh | 3 -> TExnNone | _ -> ufailwith st "u_exnc_repr" @@ -2298,108 +3074,119 @@ and u_recdfield_spec st = let e2 = u_attribs st let f = u_string st let g = u_access st - { rfield_mutable=a - rfield_volatile=b - rfield_type=c1 - rfield_static=c2 - rfield_secret=c2b - rfield_const=c3 - rfield_id=d - rfield_pattribs=e1 - rfield_fattribs=e2 - rfield_xmldoc= defaultArg xmldoc XmlDoc.Empty - rfield_otherxmldoc = XmlDoc.Empty - rfield_xmldocsig=f - rfield_access=g - rfield_name_generated = d.idRange.IsSynthetic - rfield_other_range = None } - -and u_rfield_table st = Construct.MakeRecdFieldsTable (u_list u_recdfield_spec st) + + { + rfield_mutable = a + rfield_volatile = b + rfield_type = c1 + rfield_static = c2 + rfield_secret = c2b + rfield_const = c3 + rfield_id = d + rfield_pattribs = e1 + rfield_fattribs = e2 + rfield_xmldoc = defaultArg xmldoc XmlDoc.Empty + rfield_otherxmldoc = XmlDoc.Empty + rfield_xmldocsig = f + rfield_access = g + rfield_name_generated = d.idRange.IsSynthetic + rfield_other_range = None + } + +and u_rfield_table st = + Construct.MakeRecdFieldsTable(u_list u_recdfield_spec st) and u_entity_spec_data st : Entity = let x1, x2a, x2b, x2c, x3, (x4a, x4b), x6, x7f, x8, x9, _x10, x10b, x11, x12, x13, x14, x15 = - u_tup17 - u_tyar_specs - u_string - (u_option u_string) - u_range - (u_option u_pubpath) - (u_tup2 u_access u_access) - u_attribs - u_tycon_repr - (u_option u_ty) - u_tcaug - u_string - u_kind - u_int64 - (u_option u_cpath ) - (u_lazy u_modul_typ) - u_exnc_repr - (u_used_space1 u_xmldoc) - st + u_tup17 + u_tyar_specs + u_string + (u_option u_string) + u_range + (u_option u_pubpath) + (u_tup2 u_access u_access) + u_attribs + u_tycon_repr + (u_option u_ty) + u_tcaug + u_string + u_kind + u_int64 + (u_option u_cpath) + (u_lazy u_modul_typ) + u_exnc_repr + (u_used_space1 u_xmldoc) + st // We use a bit that was unused in the F# 2.0 format to indicate two possible representations in the F# 3.0 tycon_repr format let x7 = x7f (x11 &&& EntityFlags.ReservedBitForPickleFormatTyconReprFlag <> 0L) let x11 = x11 &&& ~~~EntityFlags.ReservedBitForPickleFormatTyconReprFlag - { entity_typars=LazyWithContext.NotLazy x1 - entity_stamp=newStamp() - entity_logical_name=x2a - entity_range=x2c - entity_pubpath=x3 - entity_attribs=x6 - entity_tycon_repr=x7 - entity_tycon_tcaug=x9 - entity_flags=EntityFlags x11 - entity_cpath=x12 - entity_modul_type=MaybeLazy.Lazy x13 - entity_il_repr_cache=newCache() - entity_opt_data= - match x2b, x10b, x15, x8, x4a, x4b, x14 with - | None, TyparKind.Type, None, None, TAccess [], TAccess [], TExnNone -> None - | _ -> - Some { Entity.NewEmptyEntityOptData() with - entity_compiled_name = x2b - entity_kind = x10b - entity_xmldoc= defaultArg x15 XmlDoc.Empty - entity_xmldocsig = System.String.Empty - entity_tycon_abbrev = x8 - entity_accessibility = x4a - entity_tycon_repr_accessibility = x4b - entity_exn_info = x14 } + { + entity_typars = LazyWithContext.NotLazy x1 + entity_stamp = newStamp () + entity_logical_name = x2a + entity_range = x2c + entity_pubpath = x3 + entity_attribs = x6 + entity_tycon_repr = x7 + entity_tycon_tcaug = x9 + entity_flags = EntityFlags x11 + entity_cpath = x12 + entity_modul_type = MaybeLazy.Lazy x13 + entity_il_repr_cache = newCache () + entity_opt_data = + match x2b, x10b, x15, x8, x4a, x4b, x14 with + | None, TyparKind.Type, None, None, TAccess [], TAccess [], TExnNone -> None + | _ -> + Some + { Entity.NewEmptyEntityOptData() with + entity_compiled_name = x2b + entity_kind = x10b + entity_xmldoc = defaultArg x15 XmlDoc.Empty + entity_xmldocsig = System.String.Empty + entity_tycon_abbrev = x8 + entity_accessibility = x4a + entity_tycon_repr_accessibility = x4b + entity_exn_info = x14 + } } and u_tcaug st = let a1, a2, a3, b2, c, d, e, g, _space = - u_tup9 - (u_option (u_tup2 u_vref u_vref)) - (u_option u_vref) - (u_option (u_tup3 u_vref u_vref u_vref)) - (u_option (u_tup2 u_vref u_vref)) - (u_list (u_tup2 u_string u_vref)) - (u_list (u_tup3 u_ty u_bool u_dummy_range)) - (u_option u_ty) - u_bool - (u_space 1) - st - {tcaug_compare=a1 - tcaug_compare_withc=a2 - tcaug_hash_and_equals_withc=a3 |> Option.map (fun (v1, v2, v3) -> (v1, v2, v3, None)) - tcaug_equals=b2 - // only used for code generation and checking - hence don't care about the values when reading back in - tcaug_hasObjectGetHashCode=false - tcaug_adhoc_list= ResizeArray<_>(c |> List.map (fun (_, vref) -> (false, vref))) - tcaug_adhoc=NameMultiMap.ofList c - tcaug_interfaces=d - tcaug_super=e - // pickled type definitions are always closed (i.e. no more intrinsic members allowed) - tcaug_closed=true - tcaug_abstract=g} + u_tup9 + (u_option (u_tup2 u_vref u_vref)) + (u_option u_vref) + (u_option (u_tup3 u_vref u_vref u_vref)) + (u_option (u_tup2 u_vref u_vref)) + (u_list (u_tup2 u_string u_vref)) + (u_list (u_tup3 u_ty u_bool u_dummy_range)) + (u_option u_ty) + u_bool + (u_space 1) + st + + { + tcaug_compare = a1 + tcaug_compare_withc = a2 + tcaug_hash_and_equals_withc = a3 |> Option.map (fun (v1, v2, v3) -> (v1, v2, v3, None)) + tcaug_equals = b2 + // only used for code generation and checking - hence don't care about the values when reading back in + tcaug_hasObjectGetHashCode = false + tcaug_adhoc_list = ResizeArray<_>(c |> List.map (fun (_, vref) -> (false, vref))) + tcaug_adhoc = NameMultiMap.ofList c + tcaug_interfaces = d + tcaug_super = e + // pickled type definitions are always closed (i.e. no more intrinsic members allowed) + tcaug_closed = true + tcaug_abstract = g + } and u_entity_spec st = u_osgn_decl st.ientities u_entity_spec_data st and u_parentref st = let tag = u_byte st + match tag with | 0 -> ParentNone | 1 -> u_tcref st |> Parent @@ -2407,32 +3194,39 @@ and u_parentref st = and u_attribkind st = let tag = u_byte st + match tag with | 0 -> u_ILMethodRef st |> ILAttrib - | 1 -> u_vref st |> FSAttrib + | 1 -> u_vref st |> FSAttrib | _ -> ufailwith st "u_attribkind" and u_attrib st : Attrib = - let a, b, c, d, e, f = u_tup6 u_tcref u_attribkind (u_list u_attrib_expr) (u_list u_attrib_arg) u_bool u_dummy_range st - Attrib(a, b, c, d, e, None, f) // AttributeTargets are not preserved + let a, b, c, d, e, f = + u_tup6 u_tcref u_attribkind (u_list u_attrib_expr) (u_list u_attrib_arg) u_bool u_dummy_range st + + Attrib(a, b, c, d, e, None, f) // AttributeTargets are not preserved and u_attrib_expr st = let a, b = u_tup2 u_expr u_expr st AttribExpr(a, b) -and u_attrib_arg st = +and u_attrib_arg st = let a, b, c, d = u_tup4 u_string u_ty u_bool u_attrib_expr st AttribNamedArg(a, b, c, d) and u_member_info st : ValMemberInfo = let x2, x3, x4, x5 = u_tup4 u_tcref u_MemberFlags (u_list u_slotsig) u_bool st - { ApparentEnclosingEntity=x2 - MemberFlags=x3 - ImplementedSlotSigs=x4 - IsImplemented=x5 } + + { + ApparentEnclosingEntity = x2 + MemberFlags = x3 + ImplementedSlotSigs = x4 + IsImplemented = x5 + } and u_tycon_objmodel_kind st = let tag = u_byte st + match tag with | 0 -> TFSharpClass | 1 -> TFSharpInterface @@ -2448,129 +3242,181 @@ and u_vrefFlags st = | 0 -> NormalValUse | 1 -> CtorValUsedAsSuperInit | 2 -> CtorValUsedAsSelfInit - | 3 -> PossibleConstrainedCall (u_ty st) + | 3 -> PossibleConstrainedCall(u_ty st) | 4 -> VSlotDirectCall | _ -> ufailwith st "u_vrefFlags" and u_ValData st = let x1, x1z, x1a, x2, x4, x8, x9, x10, x12, x13, x13b, x14, x15 = - u_tup13 - u_string - (u_option u_string) - u_ranges - u_ty - u_int64 - (u_option u_member_info) - u_attribs - (u_option u_ValReprInfo) - u_string - u_access - u_parentref - (u_option u_const) - (u_used_space1 u_xmldoc) - st + u_tup13 + u_string + (u_option u_string) + u_ranges + u_ty + u_int64 + (u_option u_member_info) + u_attribs + (u_option u_ValReprInfo) + u_string + u_access + u_parentref + (u_option u_const) + (u_used_space1 u_xmldoc) + st - { val_logical_name = x1 - val_range = (match x1a with None -> range0 | Some(a, _) -> a) - val_type = x2 - val_stamp = newStamp() - val_flags = ValFlags x4 - val_opt_data = - match x1z, x1a, x10, x14, x13, x15, x8, x13b, x12, x9 with - | None, None, None, None, TAccess [], None, None, ParentNone, "", [] -> None - | _ -> - Some { val_compiled_name = x1z - val_other_range = (match x1a with None -> None | Some(_, b) -> Some(b, true)) - val_defn = None - val_repr_info = x10 - val_repr_info_for_display = None - arg_repr_info_for_display = None - val_const = x14 - val_access = x13 - val_xmldoc = defaultArg x15 XmlDoc.Empty - val_other_xmldoc = None - val_member_info = x8 - val_declaring_entity = x13b - val_xmldocsig = x12 - val_attribs = x9 } + { + val_logical_name = x1 + val_range = + (match x1a with + | None -> range0 + | Some(a, _) -> a) + val_type = x2 + val_stamp = newStamp () + val_flags = ValFlags x4 + val_opt_data = + match x1z, x1a, x10, x14, x13, x15, x8, x13b, x12, x9 with + | None, None, None, None, TAccess [], None, None, ParentNone, "", [] -> None + | _ -> + Some + { + val_compiled_name = x1z + val_other_range = + (match x1a with + | None -> None + | Some(_, b) -> Some(b, true)) + val_defn = None + val_repr_info = x10 + val_repr_info_for_display = None + arg_repr_info_for_display = None + val_const = x14 + val_access = x13 + val_xmldoc = defaultArg x15 XmlDoc.Empty + val_other_xmldoc = None + val_member_info = x8 + val_declaring_entity = x13b + val_xmldocsig = x12 + val_attribs = x9 + } } and u_Val st = u_osgn_decl st.ivals u_ValData st - and u_modul_typ st = - let x1, x3, x5 = - u_tup3 - u_istype - (u_qlist u_Val) - (u_qlist u_entity_spec) st + let x1, x3, x5 = u_tup3 u_istype (u_qlist u_Val) (u_qlist u_entity_spec) st ModuleOrNamespaceType(x1, x3, x5) - //--------------------------------------------------------------------------- // Pickle/unpickle for F# expressions (for optimization data) //--------------------------------------------------------------------------- and p_const x st = match x with - | Const.Bool x -> p_byte 0 st; p_bool x st - | Const.SByte x -> p_byte 1 st; p_int8 x st - | Const.Byte x -> p_byte 2 st; p_uint8 x st - | Const.Int16 x -> p_byte 3 st; p_int16 x st - | Const.UInt16 x -> p_byte 4 st; p_uint16 x st - | Const.Int32 x -> p_byte 5 st; p_int32 x st - | Const.UInt32 x -> p_byte 6 st; p_uint32 x st - | Const.Int64 x -> p_byte 7 st; p_int64 x st - | Const.UInt64 x -> p_byte 8 st; p_uint64 x st - | Const.IntPtr x -> p_byte 9 st; p_int64 x st - | Const.UIntPtr x -> p_byte 10 st; p_uint64 x st - | Const.Single x -> p_byte 11 st; p_single x st - | Const.Double x -> p_byte 12 st; p_int64 (bits_of_float x) st - | Const.Char c -> p_byte 13 st; p_char c st - | Const.String s -> p_byte 14 st; p_string s st - | Const.Unit -> p_byte 15 st - | Const.Zero -> p_byte 16 st - | Const.Decimal s -> p_byte 17 st; p_array p_int32 (System.Decimal.GetBits s) st + | Const.Bool x -> + p_byte 0 st + p_bool x st + | Const.SByte x -> + p_byte 1 st + p_int8 x st + | Const.Byte x -> + p_byte 2 st + p_uint8 x st + | Const.Int16 x -> + p_byte 3 st + p_int16 x st + | Const.UInt16 x -> + p_byte 4 st + p_uint16 x st + | Const.Int32 x -> + p_byte 5 st + p_int32 x st + | Const.UInt32 x -> + p_byte 6 st + p_uint32 x st + | Const.Int64 x -> + p_byte 7 st + p_int64 x st + | Const.UInt64 x -> + p_byte 8 st + p_uint64 x st + | Const.IntPtr x -> + p_byte 9 st + p_int64 x st + | Const.UIntPtr x -> + p_byte 10 st + p_uint64 x st + | Const.Single x -> + p_byte 11 st + p_single x st + | Const.Double x -> + p_byte 12 st + p_int64 (bits_of_float x) st + | Const.Char c -> + p_byte 13 st + p_char c st + | Const.String s -> + p_byte 14 st + p_string s st + | Const.Unit -> p_byte 15 st + | Const.Zero -> p_byte 16 st + | Const.Decimal s -> + p_byte 17 st + p_array p_int32 (System.Decimal.GetBits s) st and u_const st = let tag = u_byte st + match tag with - | 0 -> u_bool st |> Const.Bool - | 1 -> u_int8 st |> Const.SByte - | 2 -> u_uint8 st |> Const.Byte - | 3 -> u_int16 st |> Const.Int16 - | 4 -> u_uint16 st |> Const.UInt16 - | 5 -> u_int32 st |> Const.Int32 - | 6 -> u_uint32 st |> Const.UInt32 - | 7 -> u_int64 st |> Const.Int64 - | 8 -> u_uint64 st |> Const.UInt64 - | 9 -> u_int64 st |> Const.IntPtr - | 10 -> u_uint64 st |> Const.UIntPtr - | 11 -> u_single st |> Const.Single - | 12 -> u_int64 st |> float_of_bits |> Const.Double - | 13 -> u_char st |> Const.Char - | 14 -> u_string st |> Const.String + | 0 -> u_bool st |> Const.Bool + | 1 -> u_int8 st |> Const.SByte + | 2 -> u_uint8 st |> Const.Byte + | 3 -> u_int16 st |> Const.Int16 + | 4 -> u_uint16 st |> Const.UInt16 + | 5 -> u_int32 st |> Const.Int32 + | 6 -> u_uint32 st |> Const.UInt32 + | 7 -> u_int64 st |> Const.Int64 + | 8 -> u_uint64 st |> Const.UInt64 + | 9 -> u_int64 st |> Const.IntPtr + | 10 -> u_uint64 st |> Const.UIntPtr + | 11 -> u_single st |> Const.Single + | 12 -> u_int64 st |> float_of_bits |> Const.Double + | 13 -> u_char st |> Const.Char + | 14 -> u_string st |> Const.String | 15 -> Const.Unit | 16 -> Const.Zero | 17 -> u_array u_int32 st |> (System.Decimal >> Const.Decimal) | _ -> ufailwith st "u_const" - and p_dtree x st = match x with - | TDSwitch (a, b, c, d) -> p_byte 0 st; p_tup4 p_expr (p_list p_dtree_case) (p_option p_dtree) p_dummy_range (a, b, c, d) st - | TDSuccess (a, b) -> p_byte 1 st; p_tup2 p_Exprs p_int (a, b) st - | TDBind (a, b) -> p_byte 2 st; p_tup2 p_bind p_dtree (a, b) st + | TDSwitch(a, b, c, d) -> + p_byte 0 st + p_tup4 p_expr (p_list p_dtree_case) (p_option p_dtree) p_dummy_range (a, b, c, d) st + | TDSuccess(a, b) -> + p_byte 1 st + p_tup2 p_Exprs p_int (a, b) st + | TDBind(a, b) -> + p_byte 2 st + p_tup2 p_bind p_dtree (a, b) st -and p_dtree_case (TCase(a, b)) st = p_tup2 p_dtree_discrim p_dtree (a, b) st +and p_dtree_case (TCase(a, b)) st = + p_tup2 p_dtree_discrim p_dtree (a, b) st and p_dtree_discrim x st = match x with - | DecisionTreeTest.UnionCase (ucref, tinst) -> p_byte 0 st; p_tup2 p_ucref p_tys (ucref, tinst) st - | DecisionTreeTest.Const c -> p_byte 1 st; p_const c st - | DecisionTreeTest.IsNull -> p_byte 2 st - | DecisionTreeTest.IsInst (srcTy, tgtTy) -> p_byte 3 st; p_ty srcTy st; p_ty tgtTy st - | DecisionTreeTest.ArrayLength (n, ty) -> p_byte 4 st; p_tup2 p_int p_ty (n, ty) st + | DecisionTreeTest.UnionCase(ucref, tinst) -> + p_byte 0 st + p_tup2 p_ucref p_tys (ucref, tinst) st + | DecisionTreeTest.Const c -> + p_byte 1 st + p_const c st + | DecisionTreeTest.IsNull -> p_byte 2 st + | DecisionTreeTest.IsInst(srcTy, tgtTy) -> + p_byte 3 st + p_ty srcTy st + p_ty tgtTy st + | DecisionTreeTest.ArrayLength(n, ty) -> + p_byte 4 st + p_tup2 p_int p_ty (n, ty) st | DecisionTreeTest.ActivePatternCase _ -> pfailwith st "DecisionTreeTest.ActivePatternCase: only used during pattern match compilation" | DecisionTreeTest.Error _ -> pfailwith st "DecisionTreeTest.Error: only used during pattern match compilation" @@ -2578,7 +3424,13 @@ and p_target (TTarget(a, b, _)) st = p_tup2 p_Vals p_expr (a, b) st and p_bind (TBind(a, b, _)) st = p_tup2 p_Val p_expr (a, b) st and p_lval_op_kind x st = - p_byte (match x with LAddrOf _ -> 0 | LByrefGet -> 1 | LSet -> 2 | LByrefSet -> 3) st + p_byte + (match x with + | LAddrOf _ -> 0 + | LByrefGet -> 1 + | LSet -> 2 + | LByrefSet -> 3) + st and p_recdInfo x st = match x with @@ -2587,29 +3439,38 @@ and p_recdInfo x st = and u_dtree st = let tag = u_byte st + match tag with | 0 -> - let a,b,c,d = u_tup4 u_expr (u_list u_dtree_case) (u_option u_dtree) u_dummy_range st + let a, b, c, d = + u_tup4 u_expr (u_list u_dtree_case) (u_option u_dtree) u_dummy_range st + TDSwitch(a, b, c, d) | 1 -> u_tup2 u_Exprs u_int st |> TDSuccess | 2 -> u_tup2 u_bind u_dtree st |> TDBind | _ -> ufailwith st "u_dtree" -and u_dtree_case st = let a, b = u_tup2 u_dtree_discrim u_dtree st in (TCase(a, b)) +and u_dtree_case st = + let a, b = u_tup2 u_dtree_discrim u_dtree st in (TCase(a, b)) and u_dtree_discrim st = let tag = u_byte st + match tag with | 0 -> u_tup2 u_ucref u_tys st |> DecisionTreeTest.UnionCase - | 1 -> u_const st |> DecisionTreeTest.Const - | 2 -> DecisionTreeTest.IsNull - | 3 -> u_tup2 u_ty u_ty st |> DecisionTreeTest.IsInst - | 4 -> u_tup2 u_int u_ty st |> DecisionTreeTest.ArrayLength + | 1 -> u_const st |> DecisionTreeTest.Const + | 2 -> DecisionTreeTest.IsNull + | 3 -> u_tup2 u_ty u_ty st |> DecisionTreeTest.IsInst + | 4 -> u_tup2 u_int u_ty st |> DecisionTreeTest.ArrayLength | _ -> ufailwith st "u_dtree_discrim" -and u_target st = let a, b = u_tup2 u_Vals u_expr st in (TTarget(a, b, None)) +and u_target st = + let a, b = u_tup2 u_Vals u_expr st in (TTarget(a, b, None)) -and u_bind st = let a = u_Val st in let b = u_expr st in TBind(a, b, DebugPointAtBinding.NoneAtSticky) +and u_bind st = + let a = u_Val st in + let b = u_expr st in + TBind(a, b, DebugPointAtBinding.NoneAtSticky) and u_lval_op_kind st = match u_byte st with @@ -2619,255 +3480,434 @@ and u_lval_op_kind st = | 3 -> LByrefSet | _ -> ufailwith st "uval_op_kind" - and p_op x st = match x with - | TOp.UnionCase c -> p_byte 0 st; p_ucref c st - | TOp.ExnConstr c -> p_byte 1 st; p_tcref "op" c st - | TOp.Tuple tupInfo -> - if evalTupInfoIsStruct tupInfo then - p_byte 29 st - else - p_byte 2 st - | TOp.Recd (a, b) -> p_byte 3 st; p_tup2 p_recdInfo (p_tcref "recd op") (a, b) st - | TOp.ValFieldSet a -> p_byte 4 st; p_rfref a st - | TOp.ValFieldGet a -> p_byte 5 st; p_rfref a st - | TOp.UnionCaseTagGet a -> p_byte 6 st; p_tcref "cnstr op" a st - | TOp.UnionCaseFieldGet (a, b) -> p_byte 7 st; p_tup2 p_ucref p_int (a, b) st - | TOp.UnionCaseFieldSet (a, b) -> p_byte 8 st; p_tup2 p_ucref p_int (a, b) st - | TOp.ExnFieldGet (a, b) -> p_byte 9 st; p_tup2 (p_tcref "exn op") p_int (a, b) st - | TOp.ExnFieldSet (a, b) -> p_byte 10 st; p_tup2 (p_tcref "exn op") p_int (a, b) st - | TOp.TupleFieldGet (tupInfo, a) -> - if evalTupInfoIsStruct tupInfo then - p_byte 30 st; p_int a st - else - p_byte 11 st; p_int a st - | TOp.ILAsm (a, b) -> p_byte 12 st; p_tup2 (p_list p_ILInstr) p_tys (a, b) st - | TOp.RefAddrGet _ -> p_byte 13 st - | TOp.UnionCaseProof a -> p_byte 14 st; p_ucref a st - | TOp.Coerce -> p_byte 15 st - | TOp.TraitCall b -> p_byte 16 st; p_trait b st - | TOp.LValueOp (a, b) -> p_byte 17 st; p_tup2 p_lval_op_kind (p_vref "lval") (a, b) st - | TOp.ILCall (a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) - -> p_byte 18 st; p_tup11 p_bool p_bool p_bool p_bool p_vrefFlags p_bool p_bool p_ILMethodRef p_tys p_tys p_tys (a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) st - | TOp.Array -> p_byte 19 st - | TOp.While _ -> p_byte 20 st - | TOp.IntegerForLoop (_, _, dir) -> p_byte 21 st; p_int (match dir with FSharpForLoopUp -> 0 | CSharpForLoopUp -> 1 | FSharpForLoopDown -> 2) st - | TOp.Bytes bytes -> p_byte 22 st; p_bytes bytes st - | TOp.TryWith _ -> p_byte 23 st - | TOp.TryFinally _ -> p_byte 24 st - | TOp.ValFieldGetAddr (a, _) -> p_byte 25 st; p_rfref a st - | TOp.UInt16s arr -> p_byte 26 st; p_array p_uint16 arr st - | TOp.Reraise -> p_byte 27 st - | TOp.UnionCaseFieldGetAddr (a, b, _) -> p_byte 28 st; p_tup2 p_ucref p_int (a, b) st - // Note tag byte 29 is taken for struct tuples, see above - // Note tag byte 30 is taken for struct tuples, see above + | TOp.UnionCase c -> + p_byte 0 st + p_ucref c st + | TOp.ExnConstr c -> + p_byte 1 st + p_tcref "op" c st + | TOp.Tuple tupInfo -> + if evalTupInfoIsStruct tupInfo then + p_byte 29 st + else + p_byte 2 st + | TOp.Recd(a, b) -> + p_byte 3 st + p_tup2 p_recdInfo (p_tcref "recd op") (a, b) st + | TOp.ValFieldSet a -> + p_byte 4 st + p_rfref a st + | TOp.ValFieldGet a -> + p_byte 5 st + p_rfref a st + | TOp.UnionCaseTagGet a -> + p_byte 6 st + p_tcref "cnstr op" a st + | TOp.UnionCaseFieldGet(a, b) -> + p_byte 7 st + p_tup2 p_ucref p_int (a, b) st + | TOp.UnionCaseFieldSet(a, b) -> + p_byte 8 st + p_tup2 p_ucref p_int (a, b) st + | TOp.ExnFieldGet(a, b) -> + p_byte 9 st + p_tup2 (p_tcref "exn op") p_int (a, b) st + | TOp.ExnFieldSet(a, b) -> + p_byte 10 st + p_tup2 (p_tcref "exn op") p_int (a, b) st + | TOp.TupleFieldGet(tupInfo, a) -> + if evalTupInfoIsStruct tupInfo then + p_byte 30 st + p_int a st + else + p_byte 11 st + p_int a st + | TOp.ILAsm(a, b) -> + p_byte 12 st + p_tup2 (p_list p_ILInstr) p_tys (a, b) st + | TOp.RefAddrGet _ -> p_byte 13 st + | TOp.UnionCaseProof a -> + p_byte 14 st + p_ucref a st + | TOp.Coerce -> p_byte 15 st + | TOp.TraitCall b -> + p_byte 16 st + p_trait b st + | TOp.LValueOp(a, b) -> + p_byte 17 st + p_tup2 p_lval_op_kind (p_vref "lval") (a, b) st + | TOp.ILCall(a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) -> + p_byte 18 st + + p_tup11 + p_bool + p_bool + p_bool + p_bool + p_vrefFlags + p_bool + p_bool + p_ILMethodRef + p_tys + p_tys + p_tys + (a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) + st + | TOp.Array -> p_byte 19 st + | TOp.While _ -> p_byte 20 st + | TOp.IntegerForLoop(_, _, dir) -> + p_byte 21 st + + p_int + (match dir with + | FSharpForLoopUp -> 0 + | CSharpForLoopUp -> 1 + | FSharpForLoopDown -> 2) + st + | TOp.Bytes bytes -> + p_byte 22 st + p_bytes bytes st + | TOp.TryWith _ -> p_byte 23 st + | TOp.TryFinally _ -> p_byte 24 st + | TOp.ValFieldGetAddr(a, _) -> + p_byte 25 st + p_rfref a st + | TOp.UInt16s arr -> + p_byte 26 st + p_array p_uint16 arr st + | TOp.Reraise -> p_byte 27 st + | TOp.UnionCaseFieldGetAddr(a, b, _) -> + p_byte 28 st + p_tup2 p_ucref p_int (a, b) st + // Note tag byte 29 is taken for struct tuples, see above + // Note tag byte 30 is taken for struct tuples, see above (* 29: TOp.Tuple when evalTupInfoIsStruct tupInfo = true *) (* 30: TOp.TupleFieldGet when evalTupInfoIsStruct tupInfo = true *) - | TOp.AnonRecd info -> p_byte 31 st; p_anonInfo info st - | TOp.AnonRecdGet (info, n) -> p_byte 32 st; p_anonInfo info st; p_int n st - | TOp.Goto _ | TOp.Label _ | TOp.Return -> failwith "unexpected backend construct in pickled TAST" + | TOp.AnonRecd info -> + p_byte 31 st + p_anonInfo info st + | TOp.AnonRecdGet(info, n) -> + p_byte 32 st + p_anonInfo info st + p_int n st + | TOp.Goto _ + | TOp.Label _ + | TOp.Return -> failwith "unexpected backend construct in pickled TAST" and u_op st = let tag = u_byte st + match tag with - | 0 -> let a = u_ucref st - TOp.UnionCase a - | 1 -> let a = u_tcref st - TOp.ExnConstr a + | 0 -> + let a = u_ucref st + TOp.UnionCase a + | 1 -> + let a = u_tcref st + TOp.ExnConstr a | 2 -> TOp.Tuple tupInfoRef - | 3 -> let b = u_tcref st - TOp.Recd (RecdExpr, b) - | 4 -> let a = u_rfref st - TOp.ValFieldSet a - | 5 -> let a = u_rfref st - TOp.ValFieldGet a - | 6 -> let a = u_tcref st - TOp.UnionCaseTagGet a - | 7 -> let a = u_ucref st - let b = u_int st - TOp.UnionCaseFieldGet (a, b) - | 8 -> let a = u_ucref st - let b = u_int st - TOp.UnionCaseFieldSet (a, b) - | 9 -> let a = u_tcref st - let b = u_int st - TOp.ExnFieldGet (a, b) - | 10 -> let a = u_tcref st - let b = u_int st - TOp.ExnFieldSet (a, b) - | 11 -> let a = u_int st - TOp.TupleFieldGet (tupInfoRef, a) - | 12 -> let a = (u_list u_ILInstr) st - let b = u_tys st - TOp.ILAsm (a, b) + | 3 -> + let b = u_tcref st + TOp.Recd(RecdExpr, b) + | 4 -> + let a = u_rfref st + TOp.ValFieldSet a + | 5 -> + let a = u_rfref st + TOp.ValFieldGet a + | 6 -> + let a = u_tcref st + TOp.UnionCaseTagGet a + | 7 -> + let a = u_ucref st + let b = u_int st + TOp.UnionCaseFieldGet(a, b) + | 8 -> + let a = u_ucref st + let b = u_int st + TOp.UnionCaseFieldSet(a, b) + | 9 -> + let a = u_tcref st + let b = u_int st + TOp.ExnFieldGet(a, b) + | 10 -> + let a = u_tcref st + let b = u_int st + TOp.ExnFieldSet(a, b) + | 11 -> + let a = u_int st + TOp.TupleFieldGet(tupInfoRef, a) + | 12 -> + let a = (u_list u_ILInstr) st + let b = u_tys st + TOp.ILAsm(a, b) | 13 -> TOp.RefAddrGet false // ok to set the 'readonly' flag on these operands to false on re-read since the flag is only used for typechecking purposes - | 14 -> let a = u_ucref st - TOp.UnionCaseProof a + | 14 -> + let a = u_ucref st + TOp.UnionCaseProof a | 15 -> TOp.Coerce - | 16 -> let a = u_trait st - TOp.TraitCall a - | 17 -> let a = u_lval_op_kind st - let b = u_vref st - TOp.LValueOp (a, b) - | 18 -> let a1, a2, a3, a4, a5, a7, a8, a9 = (u_tup8 u_bool u_bool u_bool u_bool u_vrefFlags u_bool u_bool u_ILMethodRef) st - let b = u_tys st - let c = u_tys st - let d = u_tys st - TOp.ILCall (a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) + | 16 -> + let a = u_trait st + TOp.TraitCall a + | 17 -> + let a = u_lval_op_kind st + let b = u_vref st + TOp.LValueOp(a, b) + | 18 -> + let a1, a2, a3, a4, a5, a7, a8, a9 = + (u_tup8 u_bool u_bool u_bool u_bool u_vrefFlags u_bool u_bool u_ILMethodRef) st + + let b = u_tys st + let c = u_tys st + let d = u_tys st + TOp.ILCall(a1, a2, a3, a4, a5, a7, a8, a9, b, c, d) | 19 -> TOp.Array - | 20 -> TOp.While (DebugPointAtWhile.No, NoSpecialWhileLoopMarker) - | 21 -> let dir = match u_int st with 0 -> FSharpForLoopUp | 1 -> CSharpForLoopUp | 2 -> FSharpForLoopDown | _ -> failwith "unknown for loop" - TOp.IntegerForLoop (DebugPointAtFor.No, DebugPointAtInOrTo.No, dir) - | 22 -> TOp.Bytes (u_bytes st) - | 23 -> TOp.TryWith (DebugPointAtTry.No, DebugPointAtWith.No) - | 24 -> TOp.TryFinally (DebugPointAtTry.No, DebugPointAtFinally.No) - | 25 -> let a = u_rfref st - TOp.ValFieldGetAddr (a, false) - | 26 -> TOp.UInt16s (u_array u_uint16 st) + | 20 -> TOp.While(DebugPointAtWhile.No, NoSpecialWhileLoopMarker) + | 21 -> + let dir = + match u_int st with + | 0 -> FSharpForLoopUp + | 1 -> CSharpForLoopUp + | 2 -> FSharpForLoopDown + | _ -> failwith "unknown for loop" + + TOp.IntegerForLoop(DebugPointAtFor.No, DebugPointAtInOrTo.No, dir) + | 22 -> TOp.Bytes(u_bytes st) + | 23 -> TOp.TryWith(DebugPointAtTry.No, DebugPointAtWith.No) + | 24 -> TOp.TryFinally(DebugPointAtTry.No, DebugPointAtFinally.No) + | 25 -> + let a = u_rfref st + TOp.ValFieldGetAddr(a, false) + | 26 -> TOp.UInt16s(u_array u_uint16 st) | 27 -> TOp.Reraise - | 28 -> let a = u_ucref st - let b = u_int st - TOp.UnionCaseFieldGetAddr (a, b, false) + | 28 -> + let a = u_ucref st + let b = u_int st + TOp.UnionCaseFieldGetAddr(a, b, false) | 29 -> TOp.Tuple tupInfoStruct - | 30 -> let a = u_int st - TOp.TupleFieldGet (tupInfoStruct, a) - | 31 -> let info = u_anonInfo st - TOp.AnonRecd info - | 32 -> let info = u_anonInfo st - let n = u_int st - TOp.AnonRecdGet (info, n) + | 30 -> + let a = u_int st + TOp.TupleFieldGet(tupInfoStruct, a) + | 31 -> + let info = u_anonInfo st + TOp.AnonRecd info + | 32 -> + let info = u_anonInfo st + let n = u_int st + TOp.AnonRecdGet(info, n) | _ -> ufailwith st "u_op" and p_expr expr st = match expr with | Expr.Link e -> p_expr e.Value st - | Expr.Const (x, m, ty) -> p_byte 0 st; p_tup3 p_const p_dummy_range p_ty (x, m, ty) st - | Expr.Val (a, b, m) -> p_byte 1 st; p_tup3 (p_vref "val") p_vrefFlags p_dummy_range (a, b, m) st - | Expr.Op (a, b, c, d) -> p_byte 2 st; p_tup4 p_op p_tys p_Exprs p_dummy_range (a, b, c, d) st - | Expr.Sequential (a, b, c, d) -> p_byte 3 st; p_tup4 p_expr p_expr p_int p_dummy_range (a, b, (match c with NormalSeq -> 0 | ThenDoSeq -> 1), d) st - | Expr.Lambda (_, a1, b0, b1, c, d, e) -> p_byte 4 st; p_tup6 (p_option p_Val) (p_option p_Val) p_Vals p_expr p_dummy_range p_ty (a1, b0, b1, c, d, e) st - | Expr.TyLambda (_, b, c, d, e) -> p_byte 5 st; p_tup4 p_tyar_specs p_expr p_dummy_range p_ty (b, c, d, e) st - | Expr.App (a1, a2, b, c, d) -> p_byte 6 st; p_tup5 p_expr p_ty p_tys p_Exprs p_dummy_range (a1, a2, b, c, d) st - | Expr.LetRec (a, b, c, _) -> p_byte 7 st; p_tup3 p_binds p_expr p_dummy_range (a, b, c) st - | Expr.Let (a, b, c, _) -> p_byte 8 st; p_tup3 p_bind p_expr p_dummy_range (a, b, c) st - | Expr.Match (_, a, b, c, d, e) -> p_byte 9 st; p_tup5 p_dummy_range p_dtree p_targets p_dummy_range p_ty (a, b, c, d, e) st - | Expr.Obj (_, b, c, d, e, f, g) -> p_byte 10 st; p_tup6 p_ty (p_option p_Val) p_expr p_methods p_intfs p_dummy_range (b, c, d, e, f, g) st - | Expr.StaticOptimization (a, b, c, d) -> p_byte 11 st; p_tup4 p_constraints p_expr p_expr p_dummy_range (a, b, c, d) st - | Expr.TyChoose (a, b, c) -> p_byte 12 st; p_tup3 p_tyar_specs p_expr p_dummy_range (a, b, c) st - | Expr.Quote (ast, _, _, m, ty) -> p_byte 13 st; p_tup3 p_expr p_dummy_range p_ty (ast, m, ty) st - | Expr.WitnessArg (traitInfo, m) -> p_byte 14 st; p_trait traitInfo st; p_dummy_range m st - | Expr.DebugPoint (_, innerExpr) -> p_expr innerExpr st + | Expr.Const(x, m, ty) -> + p_byte 0 st + p_tup3 p_const p_dummy_range p_ty (x, m, ty) st + | Expr.Val(a, b, m) -> + p_byte 1 st + p_tup3 (p_vref "val") p_vrefFlags p_dummy_range (a, b, m) st + | Expr.Op(a, b, c, d) -> + p_byte 2 st + p_tup4 p_op p_tys p_Exprs p_dummy_range (a, b, c, d) st + | Expr.Sequential(a, b, c, d) -> + p_byte 3 st + + p_tup4 + p_expr + p_expr + p_int + p_dummy_range + (a, + b, + (match c with + | NormalSeq -> 0 + | ThenDoSeq -> 1), + d) + st + | Expr.Lambda(_, a1, b0, b1, c, d, e) -> + p_byte 4 st + p_tup6 (p_option p_Val) (p_option p_Val) p_Vals p_expr p_dummy_range p_ty (a1, b0, b1, c, d, e) st + | Expr.TyLambda(_, b, c, d, e) -> + p_byte 5 st + p_tup4 p_tyar_specs p_expr p_dummy_range p_ty (b, c, d, e) st + | Expr.App(a1, a2, b, c, d) -> + p_byte 6 st + p_tup5 p_expr p_ty p_tys p_Exprs p_dummy_range (a1, a2, b, c, d) st + | Expr.LetRec(a, b, c, _) -> + p_byte 7 st + p_tup3 p_binds p_expr p_dummy_range (a, b, c) st + | Expr.Let(a, b, c, _) -> + p_byte 8 st + p_tup3 p_bind p_expr p_dummy_range (a, b, c) st + | Expr.Match(_, a, b, c, d, e) -> + p_byte 9 st + p_tup5 p_dummy_range p_dtree p_targets p_dummy_range p_ty (a, b, c, d, e) st + | Expr.Obj(_, b, c, d, e, f, g) -> + p_byte 10 st + p_tup6 p_ty (p_option p_Val) p_expr p_methods p_intfs p_dummy_range (b, c, d, e, f, g) st + | Expr.StaticOptimization(a, b, c, d) -> + p_byte 11 st + p_tup4 p_constraints p_expr p_expr p_dummy_range (a, b, c, d) st + | Expr.TyChoose(a, b, c) -> + p_byte 12 st + p_tup3 p_tyar_specs p_expr p_dummy_range (a, b, c) st + | Expr.Quote(ast, _, _, m, ty) -> + p_byte 13 st + p_tup3 p_expr p_dummy_range p_ty (ast, m, ty) st + | Expr.WitnessArg(traitInfo, m) -> + p_byte 14 st + p_trait traitInfo st + p_dummy_range m st + | Expr.DebugPoint(_, innerExpr) -> p_expr innerExpr st and u_expr st = let tag = u_byte st + match tag with - | 0 -> let a = u_const st - let b = u_dummy_range st - let c = u_ty st - Expr.Const (a, b, c) - | 1 -> let a = u_vref st - let b = u_vrefFlags st - let c = u_dummy_range st - Expr.Val (a, b, c) - | 2 -> let a = u_op st - let b = u_tys st - let c = u_Exprs st - let d = u_dummy_range st - Expr.Op (a, b, c, d) - | 3 -> let a = u_expr st - let b = u_expr st - let c = u_int st - let d = u_dummy_range st - let dir = match c with 0 -> NormalSeq | 1 -> ThenDoSeq | _ -> ufailwith st "specialSeqFlag" - Expr.Sequential (a, b, dir, d) - | 4 -> let a0 = u_option u_Val st - let b0 = u_option u_Val st - let b1 = u_Vals st - let c = u_expr st - let d = u_dummy_range st - let e = u_ty st - Expr.Lambda (newUnique(), a0, b0, b1, c, d, e) - | 5 -> let b = u_tyar_specs st - let c = u_expr st - let d = u_dummy_range st - let e = u_ty st - Expr.TyLambda (newUnique(), b, c, d, e) - | 6 -> let a1 = u_expr st - let a2 = u_ty st - let b = u_tys st - let c = u_Exprs st - let d = u_dummy_range st - Expr.App (a1, a2, b, c, d) - | 7 -> let a = u_binds st - let b = u_expr st - let c = u_dummy_range st - Expr.LetRec (a, b, c, Construct.NewFreeVarsCache()) - | 8 -> let a = u_bind st - let b = u_expr st - let c = u_dummy_range st - Expr.Let (a, b, c, Construct.NewFreeVarsCache()) - | 9 -> let a = u_dummy_range st - let b = u_dtree st - let c = u_targets st - let d = u_dummy_range st - let e = u_ty st - Expr.Match (DebugPointAtBinding.NoneAtSticky, a, b, c, d, e) - | 10 -> let b = u_ty st - let c = (u_option u_Val) st - let d = u_expr st - let e = u_methods st - let f = u_intfs st - let g = u_dummy_range st - Expr.Obj (newUnique(), b, c, d, e, f, g) - | 11 -> let a = u_constraints st - let b = u_expr st - let c = u_expr st - let d = u_dummy_range st - Expr.StaticOptimization (a, b, c, d) - | 12 -> let a = u_tyar_specs st - let b = u_expr st - let c = u_dummy_range st - Expr.TyChoose (a, b, c) - | 13 -> let b = u_expr st - let c = u_dummy_range st - let d = u_ty st - Expr.Quote (b, ref None, false, c, d) // isFromQueryExpression=false + | 0 -> + let a = u_const st + let b = u_dummy_range st + let c = u_ty st + Expr.Const(a, b, c) + | 1 -> + let a = u_vref st + let b = u_vrefFlags st + let c = u_dummy_range st + Expr.Val(a, b, c) + | 2 -> + let a = u_op st + let b = u_tys st + let c = u_Exprs st + let d = u_dummy_range st + Expr.Op(a, b, c, d) + | 3 -> + let a = u_expr st + let b = u_expr st + let c = u_int st + let d = u_dummy_range st + + let dir = + match c with + | 0 -> NormalSeq + | 1 -> ThenDoSeq + | _ -> ufailwith st "specialSeqFlag" + + Expr.Sequential(a, b, dir, d) + | 4 -> + let a0 = u_option u_Val st + let b0 = u_option u_Val st + let b1 = u_Vals st + let c = u_expr st + let d = u_dummy_range st + let e = u_ty st + Expr.Lambda(newUnique (), a0, b0, b1, c, d, e) + | 5 -> + let b = u_tyar_specs st + let c = u_expr st + let d = u_dummy_range st + let e = u_ty st + Expr.TyLambda(newUnique (), b, c, d, e) + | 6 -> + let a1 = u_expr st + let a2 = u_ty st + let b = u_tys st + let c = u_Exprs st + let d = u_dummy_range st + Expr.App(a1, a2, b, c, d) + | 7 -> + let a = u_binds st + let b = u_expr st + let c = u_dummy_range st + Expr.LetRec(a, b, c, Construct.NewFreeVarsCache()) + | 8 -> + let a = u_bind st + let b = u_expr st + let c = u_dummy_range st + Expr.Let(a, b, c, Construct.NewFreeVarsCache()) + | 9 -> + let a = u_dummy_range st + let b = u_dtree st + let c = u_targets st + let d = u_dummy_range st + let e = u_ty st + Expr.Match(DebugPointAtBinding.NoneAtSticky, a, b, c, d, e) + | 10 -> + let b = u_ty st + let c = (u_option u_Val) st + let d = u_expr st + let e = u_methods st + let f = u_intfs st + let g = u_dummy_range st + Expr.Obj(newUnique (), b, c, d, e, f, g) + | 11 -> + let a = u_constraints st + let b = u_expr st + let c = u_expr st + let d = u_dummy_range st + Expr.StaticOptimization(a, b, c, d) + | 12 -> + let a = u_tyar_specs st + let b = u_expr st + let c = u_dummy_range st + Expr.TyChoose(a, b, c) + | 13 -> + let b = u_expr st + let c = u_dummy_range st + let d = u_ty st + Expr.Quote(b, ref None, false, c, d) // isFromQueryExpression=false | 14 -> let traitInfo = u_trait st let m = u_dummy_range st - Expr.WitnessArg (traitInfo, m) + Expr.WitnessArg(traitInfo, m) | _ -> ufailwith st "u_expr" and p_static_optimization_constraint x st = match x with - | TTyconEqualsTycon (a, b) -> p_byte 0 st; p_tup2 p_ty p_ty (a, b) st - | TTyconIsStruct a -> p_byte 1 st; p_ty a st + | TTyconEqualsTycon(a, b) -> + p_byte 0 st + p_tup2 p_ty p_ty (a, b) st + | TTyconIsStruct a -> + p_byte 1 st + p_ty a st + +and p_slotparam (TSlotParam(a, b, c, d, e, f)) st = + p_tup6 (p_option p_string) p_ty p_bool p_bool p_bool p_attribs (a, b, c, d, e, f) st + +and p_slotsig (TSlotSig(a, b, c, d, e, f)) st = + p_tup6 p_string p_ty p_tyar_specs p_tyar_specs (p_list (p_list p_slotparam)) (p_option p_ty) (a, b, c, d, e, f) st + +and p_method (TObjExprMethod(a, b, c, d, e, f)) st = + p_tup6 p_slotsig p_attribs p_tyar_specs (p_list p_Vals) p_expr p_dummy_range (a, b, c, d, e, f) st -and p_slotparam (TSlotParam (a, b, c, d, e, f)) st = p_tup6 (p_option p_string) p_ty p_bool p_bool p_bool p_attribs (a, b, c, d, e, f) st -and p_slotsig (TSlotSig (a, b, c, d, e, f)) st = p_tup6 p_string p_ty p_tyar_specs p_tyar_specs (p_list (p_list p_slotparam)) (p_option p_ty) (a, b, c, d, e, f) st -and p_method (TObjExprMethod (a, b, c, d, e, f)) st = p_tup6 p_slotsig p_attribs p_tyar_specs (p_list p_Vals) p_expr p_dummy_range (a, b, c, d, e, f) st and p_methods x st = p_list p_method x st and p_intf x st = p_tup2 p_ty p_methods x st and p_intfs x st = p_list p_intf x st and u_static_optimization_constraint st = let tag = u_byte st + match tag with | 0 -> u_tup2 u_ty u_ty st |> TTyconEqualsTycon - | 1 -> u_ty st |> TTyconIsStruct + | 1 -> u_ty st |> TTyconIsStruct | _ -> ufailwith st "u_static_optimization_constraint" and u_slotparam st = - let a, b, c, d, e, f = u_tup6 (u_option u_string) u_ty u_bool u_bool u_bool u_attribs st + let a, b, c, d, e, f = + u_tup6 (u_option u_string) u_ty u_bool u_bool u_bool u_attribs st + TSlotParam(a, b, c, d, e, f) and u_slotsig st = - let a, b, c, d, e, f = u_tup6 u_string u_ty u_tyar_specs u_tyar_specs (u_list (u_list u_slotparam)) (u_option u_ty) st + let a, b, c, d, e, f = + u_tup6 u_string u_ty u_tyar_specs u_tyar_specs (u_list (u_list u_slotparam)) (u_option u_ty) st + TSlotSig(a, b, c, d, e, f) and u_method st = - let a, b, c, d, e, f = u_tup6 u_slotsig u_attribs u_tyar_specs (u_list u_Vals) u_expr u_dummy_range st + let a, b, c, d, e, f = + u_tup6 u_slotsig u_attribs u_tyar_specs (u_list u_Vals) u_expr u_dummy_range st + TObjExprMethod(a, b, c, d, e, f) and u_methods st = u_list u_method st @@ -2905,5 +3945,11 @@ let pickleCcuInfo (minfo: PickledCcuInfo) st = let unpickleModuleOrNamespace st = u_entity_spec st let unpickleCcuInfo st = - let a, b, c, _space = u_tup4 unpickleModuleOrNamespace u_string u_bool (u_space 3) st - { mspec=a; compileTimeWorkingDir=b; usesQuotations=c } + let a, b, c, _space = + u_tup4 unpickleModuleOrNamespace u_string u_bool (u_space 3) st + + { + mspec = a + compileTimeWorkingDir = b + usesQuotations = c + } From b99cd60a05dae3cc243260405472688b54989540 Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Mon, 10 Mar 2025 12:26:16 +0100 Subject: [PATCH 006/134] Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject (#18366) * added test that fails with transparent compiler only * fix for missing parse diagnostics in TransparentCompiler.ComputeParseAndCheckProject * Fantomas * release notes * ilverify baseline updated --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Service/TransparentCompiler.fs | 24 ++++++++++++------- .../ExprTests.fs | 17 +++++++++++++ ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 7 files changed, 38 insertions(+), 12 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 491273fa561..d406d513e96 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -13,6 +13,7 @@ * Fix NRE when accessing nullable fields of types within their equals/hash/compare methods ([PR #18296](https://github.com/dotnet/fsharp/pull/18296)) * Fix nullness warning for overrides of generic code with nullable type instance ([Issue #17988](https://github.com/dotnet/fsharp/issues/17988), [PR #18337](https://github.com/dotnet/fsharp/pull/18337)) * Unsafe downcast from `obj` to generic `T` no longer requires `not null` constraint on `T`([Issue #18275](https://github.com/dotnet/fsharp/issues/18275), [PR #18343](https://github.com/dotnet/fsharp/pull/18343)) +* Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 9007a111e7d..3b411028328 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -1733,13 +1733,20 @@ type internal TransparentCompiler let! projectSnapshot = parseSourceFiles projectSnapshot bootstrapInfo.TcConfig + let parseDiagnostics = + projectSnapshot.SourceFiles + |> Seq.collect (fun f -> f.ParseDiagnostics) + |> Seq.toArray + let! graph, dependencyFiles = ComputeDependencyGraphForProject bootstrapInfo.TcConfig projectSnapshot - return! + let! results, tcInfo = processTypeCheckingGraph graph (processGraphNode projectSnapshot bootstrapInfo dependencyFiles true) bootstrapInfo.InitialTcInfo + + return results, tcInfo, parseDiagnostics } ) @@ -1771,7 +1778,7 @@ type internal TransparentCompiler projectSnapshot.SignatureKey, async { - let! results, finalInfo = ComputeParseAndCheckAllFilesInProject bootstrapInfo projectSnapshot + let! results, finalInfo, parseDiagnostics = ComputeParseAndCheckAllFilesInProject bootstrapInfo projectSnapshot let assemblyName = bootstrapInfo.AssemblyName let tcConfig = bootstrapInfo.TcConfig @@ -1855,7 +1862,7 @@ type internal TransparentCompiler errorRecoveryNoRange exn ProjectAssemblyDataResult.Unavailable true - return finalInfo, ilAssemRef, assemblyDataResult, checkedImplFiles + return finalInfo, ilAssemRef, assemblyDataResult, checkedImplFiles, parseDiagnostics } ) @@ -1897,7 +1904,7 @@ type internal TransparentCompiler let! snapshotWithSources = LoadSources bootstrapInfo projectSnapshot - let! _, _, assemblyDataResult, _ = ComputeProjectExtras bootstrapInfo snapshotWithSources + let! _, _, assemblyDataResult, _, _ = ComputeProjectExtras bootstrapInfo snapshotWithSources Trace.TraceInformation($"Using in-memory project reference: {name}") return assemblyDataResult @@ -1919,7 +1926,8 @@ type internal TransparentCompiler | Some bootstrapInfo, creationDiags -> let! snapshotWithSources = LoadSources bootstrapInfo projectSnapshot - let! tcInfo, ilAssemRef, assemblyDataResult, checkedImplFiles = ComputeProjectExtras bootstrapInfo snapshotWithSources + let! tcInfo, ilAssemRef, assemblyDataResult, checkedImplFiles, parseDiagnostics = + ComputeProjectExtras bootstrapInfo snapshotWithSources let diagnosticsOptions = bootstrapInfo.TcConfig.diagnosticsOptions let fileName = DummyFileNameForRangesWithoutASpecificLocation @@ -1934,18 +1942,18 @@ type internal TransparentCompiler SymbolEnv(bootstrapInfo.TcGlobals, tcInfo.tcState.Ccu, Some tcInfo.tcState.CcuSig, bootstrapInfo.TcImports) |> Some - let tcDiagnostics = + let diagnostics = DiagnosticHelpers.CreateDiagnostics( diagnosticsOptions, true, fileName, - tcDiagnostics, + Array.concat [| parseDiagnostics; tcDiagnostics |], suggestNamesForErrors, bootstrapInfo.TcConfig.flatErrors, symbolEnv ) - let diagnostics = [| yield! creationDiags; yield! tcDiagnostics |] + let diagnostics = [| yield! creationDiags; yield! diagnostics |] let getAssemblyData () = match assemblyDataResult with diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index 7a594db1e38..465aac7c4d5 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -3525,3 +3525,20 @@ let ``Test NoWarn HashDirective`` () = printfn "ProjectForNoWarnHashDirective error: <<<%s>>>" e.Message wholeProjectResults.Diagnostics.Length |> shouldEqual 0 + +module internal SourceForTrcParseErrors = + + let fileSource1 = """ +module N.M +#nowarn 0xy +() +""" + +[] +let ``TrcParseErrors`` () = + let options = createProjectOptions [SourceForTrcParseErrors.fileSource1] [] + let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate + wholeProjectResults.Diagnostics.Length |> shouldEqual 1 + wholeProjectResults.Diagnostics.[0].ErrorNumber |> shouldEqual 1156 + wholeProjectResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 4f429d04961..ad200989d8c 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-802::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 2ec0116a1af..c23aae09751 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-802::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 48210dddd5c..853566a3c47 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-846::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 2df2cf0fbd9..356b98ede2b 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-846::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. From 7cb2cea2bc17334fa035de4e919f8cc409cbfb59 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 10 Mar 2025 21:58:58 +0800 Subject: [PATCH 007/134] Bugfix for Array.insertManyAt returns original array for empty insertion (#18352) (#18353) - Update test, release note and comment for Array.InsertManyAt Co-authored-by: Kevin Ransom (msft) --- docs/release-notes/.FSharp.Core/9.0.300.md | 1 + src/FSharp.Core/array.fs | 2 +- src/FSharp.Core/array.fsi | 2 +- .../Microsoft.FSharp.Collections/ArrayModule2.fs | 8 +++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/.FSharp.Core/9.0.300.md b/docs/release-notes/.FSharp.Core/9.0.300.md index 5e6903f3fa4..3b2fdab5cfe 100644 --- a/docs/release-notes/.FSharp.Core/9.0.300.md +++ b/docs/release-notes/.FSharp.Core/9.0.300.md @@ -1,4 +1,5 @@ ### Fixed +* Modified the behavior of `Array.insertManyAt` to return a copy of the original array when inserting an empty array. ([PR #18353](https://github.com/dotnet/fsharp/pull/18353)) ### Added * Added nullability annotations to `.Using` builder method for `async` and `task` builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292)) diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 63df73e5014..27c6d6426b6 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -1934,7 +1934,7 @@ module Array = let valuesArray = Seq.toArray values if valuesArray.Length = 0 then - source + source.Clone() :?> 'T array else let length = source.Length + valuesArray.Length let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked length diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 6e76dbc32c6..151081c300c 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -3080,7 +3080,7 @@ module Array = /// The values to insert. /// The input array. /// - /// The result array. + /// A new array (even if values is empty). /// /// Thrown when index is below 0 or greater than source.Length. /// diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs index 5c5afc3c234..b0532b8929f 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs @@ -1679,4 +1679,10 @@ type ArrayModule2() = // empty list & out of bounds Assert.AreEqual([0; 0], Array.insertManyAt 0 [0; 0] [||]) CheckThrowsArgumentException (fun () -> Array.insertManyAt -1 [0; 0] [|1|] |> ignore) - CheckThrowsArgumentException (fun () -> Array.insertManyAt 2 [0; 0] [|1|] |> ignore) \ No newline at end of file + CheckThrowsArgumentException (fun () -> Array.insertManyAt 2 [0; 0] [|1|] |> ignore) + + // Do not return the original array when inserting an empty array + let originalArr = [| 1; 2; 3 |] + let insertionEmptyResultArr = Array.insertManyAt 3 [| |] originalArr + insertionEmptyResultArr[0] <- 3 + Assert.AreEqual([| 1; 2; 3 |], originalArr) \ No newline at end of file From e4950e6c3f4f7e9829dd86f127a0e7cf54d9220e Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:44:38 +0100 Subject: [PATCH 008/134] add extraArgs in the end so they override the defaults (#18360) --- tests/FSharp.Compiler.Service.Tests/Common.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index 8ccb19b0f85..b9f780fd506 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -484,5 +484,5 @@ let createProjectOptions fileSources extraArgs = let fileName = changeExtension (getTemporaryFileNameInDirectory tempDir) ".fs" FileSystem.OpenFileForWriteShim(fileName).Write(fileSource) fileName |] - let args = [| yield! extraArgs; yield! mkProjectCommandLineArgs (dllName, []) |] + let args = [| yield! mkProjectCommandLineArgs (dllName, []); yield! extraArgs |] { checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) with SourceFiles = sourceFiles } From a9003e8b32d11fed4085c6b7ea5158abcaff88bd Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 10 Mar 2025 11:50:32 -0400 Subject: [PATCH 009/134] More misc parens fixes (#18350) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Service/SynExpr.fs | 38 ++++++++++--------- .../RemoveUnnecessaryParenthesesTests.fs | 5 ++- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index d406d513e96..4cf0b78629c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -14,6 +14,7 @@ * Fix nullness warning for overrides of generic code with nullable type instance ([Issue #17988](https://github.com/dotnet/fsharp/issues/17988), [PR #18337](https://github.com/dotnet/fsharp/pull/18337)) * Unsafe downcast from `obj` to generic `T` no longer requires `not null` constraint on `T`([Issue #18275](https://github.com/dotnet/fsharp/issues/18275), [PR #18343](https://github.com/dotnet/fsharp/pull/18343)) * Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) +* Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Service/SynExpr.fs b/src/Compiler/Service/SynExpr.fs index e9605582514..5981dd5b286 100644 --- a/src/Compiler/Service/SynExpr.fs +++ b/src/Compiler/Service/SynExpr.fs @@ -343,6 +343,7 @@ module SynExpr = | PrefixApp prec -> ValueSome(prec, Non) | InfixApp(prec, side) -> ValueSome(prec, side) | SynExpr.App(argExpr = SynExpr.ComputationExpr _) -> ValueSome(UnaryPrefix, Left) + | SynExpr.App(argExpr = SynExpr.Paren(expr = SynExpr.App _ & Is inner)) -> ValueSome(Apply, Right) | SynExpr.App(funcExpr = SynExpr.Paren(expr = SynExpr.App _)) -> ValueSome(Apply, Left) | SynExpr.App(flag = ExprAtomicFlag.Atomic) -> ValueSome(Dot, Non) | SynExpr.App _ -> ValueSome(Apply, Non) @@ -396,6 +397,7 @@ module SynExpr = | SynExpr.DotIndexedSet _ | SynExpr.DotNamedIndexedPropertySet _ | SynExpr.DotSet _ -> ValueSome Set + | SynExpr.TypeTest _ -> ValueSome TypeTest | _ -> ValueNone module Dangling = @@ -540,7 +542,7 @@ module SynExpr = if i >= 0 && i < offsidesCol then let slice = line.AsSpan(i, min (offsidesCol - i) (line.Length - i)) - let j = slice.IndexOfAnyExcept("*/%-+:^@><=!|0$.?".AsSpan()) + let j = slice.IndexOfAnyExcept("*/%-+:^@><=!|$.?".AsSpan()) let lo = i + (if j >= 0 && slice[j] = ' ' then j else 0) @@ -845,22 +847,6 @@ module SynExpr = // precedence than regular function application. | _, SyntaxNode.SynExpr(SynExpr.App _) :: SyntaxNode.SynExpr(PrefixApp High) :: _ -> true - // Parens are never required around suffixed or infixed numeric literals, e.g., - // - // (1l).ToString() - // (1uy).ToString() - // (0b1).ToString() - // (1e10).ToString() - // (1.0).ToString() - | DotSafeNumericLiteral, _ -> false - - // Parens are required around bare decimal ints or doubles ending - // in dots when being dotted into, e.g., - // - // (1).ToString() - // (1.).ToString() - | SynExpr.Const(constant = SynConst.Int32 _ | SynConst.Double _), SyntaxNode.SynExpr(SynExpr.DotGet _) :: _ -> true - // Parens are required around join conditions: // // join … on (… = …) @@ -907,6 +893,22 @@ module SynExpr = -> true + // Parens are never required around suffixed or infixed numeric literals, e.g., + // + // (1l).ToString() + // (1uy).ToString() + // (0b1).ToString() + // (1e10).ToString() + // (1.0).ToString() + | DotSafeNumericLiteral, _ -> false + + // Parens are required around bare decimal ints or doubles ending + // in dots when being dotted into, e.g., + // + // (1).ToString() + // (1.).ToString() + | SynExpr.Const(constant = SynConst.Int32 _ | SynConst.Double _), SyntaxNode.SynExpr(SynExpr.DotGet _) :: _ -> true + // The :: operator is parsed differently from other symbolic infix operators, // so we need to give it special treatment. @@ -952,6 +954,7 @@ module SynExpr = let rec loop = function | [] -> false + | SynMatchClause(whenExpr = Some(SynExpr.Paren(expr = Dangling.ArrowSensitive _ & Is inner))) :: _ -> true | SynMatchClause(trivia = trivia) :: clauses -> trivia.BarRange |> Option.exists (problematic matchOrTryRange) || trivia.ArrowRange |> Option.exists (problematic matchOrTryRange) @@ -1148,6 +1151,7 @@ module SynExpr = | _, MulDivMod(Mod, _) | _, AddSub(Sub, _) -> true | Relational _, Relational _ -> true + | Apply, Apply -> true | _ -> false | c -> c > 0 diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs index b9b95bc44ac..224849a59e2 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs @@ -398,7 +398,7 @@ let _ = ", " match () with - | () when box x :? int + | () when (box x :? int) -> () | _ -> () " @@ -1830,6 +1830,8 @@ in x f ((+) x y) z " + "(Gen.map f << Gen.map g) (Gen.constant x)", "(Gen.map f << Gen.map g) (Gen.constant x)" + // TypeApp "id (id)", "id id" @@ -1890,6 +1892,7 @@ in x """(id "x").Length""", """(id "x").Length""" """(3L.ToString("x")).Length""", """(3L.ToString "x").Length""" "~~TypedResults.Ok(maybe.Value)", "~~TypedResults.Ok(maybe.Value)" + "bg.lighten(0.2).hexa ()", "bg.lighten(0.2).hexa ()" // DotLambda "[{| A = x |}] |> List.map (_.A)", "[{| A = x |}] |> List.map _.A" From 88f804130ee9744b0c6dba529664bc4e3c7fb3ad Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 11 Mar 2025 15:09:17 +0100 Subject: [PATCH 010/134] Bugfix :: Fix 'Type inference problem too complicated' for SRTP with "T:null and T:struct" dummy constraint (#18345) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../Checking/AugmentWithHashCompare.fs | 8 +-- src/Compiler/Checking/CheckDeclarations.fs | 19 +++---- src/Compiler/Checking/ConstraintSolver.fs | 38 +++++++------- .../Checking/Expressions/CheckExpressions.fs | 2 +- src/Compiler/CodeGen/IlxGen.fs | 36 +++---------- src/Compiler/FSComp.txt | 2 + src/Compiler/TypedTree/TypedTreeOps.fs | 50 ++++++++----------- src/Compiler/TypedTree/TypedTreeOps.fsi | 9 +++- src/Compiler/xlf/FSComp.txt.cs.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.de.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.es.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.fr.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.it.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.ja.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.ko.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.pl.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.ru.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.tr.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 10 ++++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 10 ++++ .../Nullness/NullableRegressionTests.fs | 27 +++++++++- .../inference-problem-size-explosion.fs | 42 ++++++++++++++++ 24 files changed, 264 insertions(+), 100 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Language/Nullness/inference-problem-size-explosion.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 4cf0b78629c..12f4074a4a0 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -13,6 +13,7 @@ * Fix NRE when accessing nullable fields of types within their equals/hash/compare methods ([PR #18296](https://github.com/dotnet/fsharp/pull/18296)) * Fix nullness warning for overrides of generic code with nullable type instance ([Issue #17988](https://github.com/dotnet/fsharp/issues/17988), [PR #18337](https://github.com/dotnet/fsharp/pull/18337)) * Unsafe downcast from `obj` to generic `T` no longer requires `not null` constraint on `T`([Issue #18275](https://github.com/dotnet/fsharp/issues/18275), [PR #18343](https://github.com/dotnet/fsharp/pull/18343)) +* Fix "type inference problem too complicated" for SRTP with T:null and T:struct dummy constraint([Issue #18288](https://github.com/dotnet/fsharp/issues/18288), [PR #18345](https://github.com/dotnet/fsharp/pull/18345)) * Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) * Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) diff --git a/src/Compiler/Checking/AugmentWithHashCompare.fs b/src/Compiler/Checking/AugmentWithHashCompare.fs index 7efb505c9f3..b2e2eaf9be7 100644 --- a/src/Compiler/Checking/AugmentWithHashCompare.fs +++ b/src/Compiler/Checking/AugmentWithHashCompare.fs @@ -1647,13 +1647,7 @@ let rec TypeDefinitelyHasEquality g ty = match appTy with | ValueSome(tcref, _) when HasFSharpAttribute g g.attrib_NoEqualityAttribute tcref.Attribs -> false | _ -> - if - isTyparTy g ty - && (destTyparTy g ty).Constraints - |> List.exists (function - | TyparConstraint.SupportsEquality _ -> true - | _ -> false) - then + if ty |> IsTyparTyWithConstraint g _.IsSupportsEquality then true else match ty with diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index f6b405bf1d6..8422bd40833 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -2138,17 +2138,13 @@ module TyconConstraintInference = // Is the field type a type parameter? match tryDestTyparTy g ty with - | ValueSome tp -> - // Look for an explicit 'comparison' constraint - if tp.Constraints |> List.exists (function TyparConstraint.SupportsComparison _ -> true | _ -> false) then - true - + | ValueSome tp when tp |> HasConstraint _.IsSupportsComparison -> true + | ValueSome tp -> // Within structural types, type parameters can be optimistically assumed to have comparison // We record the ones for which we have made this assumption. - elif tycon.TyparsNoRange |> List.exists (fun tp2 -> typarRefEq tp tp2) then + if tycon.TyparsNoRange |> List.exists (fun tp2 -> typarRefEq tp tp2) then assumedTyparsAcc <- assumedTyparsAcc.Add(tp.Stamp) - true - + true else false | _ -> @@ -2267,14 +2263,11 @@ module TyconConstraintInference = // and type parameters. let rec checkIfFieldTypeSupportsEquality (tycon: Tycon) (ty: TType) = match tryDestTyparTy g ty with + | ValueSome tp when tp |> HasConstraint _.IsSupportsEquality -> true | ValueSome tp -> - // Look for an explicit 'equality' constraint - if tp.Constraints |> List.exists (function TyparConstraint.SupportsEquality _ -> true | _ -> false) then - true - // Within structural types, type parameters can be optimistically assumed to have equality // We record the ones for which we have made this assumption. - elif tycon.Typars(tycon.Range) |> List.exists (fun tp2 -> typarRefEq tp tp2) then + if tycon.Typars(tycon.Range) |> List.exists (fun tp2 -> typarRefEq tp tp2) then assumedTyparsAcc <- assumedTyparsAcc.Add(tp.Stamp) true else diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index a45bb37234f..02829f564ad 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -958,13 +958,6 @@ let rec SolveTyparEqualsTypePart1 (csenv: ConstraintSolverEnv) m2 (trace: Option // Record the solution before we solve the constraints, since // We may need to make use of the equation when solving the constraints. // Record a entry in the undo trace if one is provided - - //let ty1AllowsNull = r.Constraints |> List.exists (function | TyparConstraint.SupportsNull _ -> true | _ -> false ) - //let tyAllowsNull() = TypeNullIsExtraValueNew csenv.g m2 ty - //if ty1AllowsNull && not (tyAllowsNull()) then - // trace.Exec (fun () -> r.typar_solution <- Some (ty |> replaceNullnessOfTy csenv.g.knownWithNull)) (fun () -> r.typar_solution <- None) - //else - // trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None) trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None) } @@ -1295,8 +1288,9 @@ and SolveTypeEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: OptionalTr SolveTyparEqualsType csenv ndeep m2 trace sty1 (replaceNullnessOfTy g.knownWithoutNull sty2) | ValueSome NullnessInfo.WithoutNull, ValueSome NullnessInfo.WithoutNull when csenv.IsSupportsNullFlex && - isAppTy g sty2 && - tp1.Constraints |> List.exists (function TyparConstraint.SupportsNull _ -> true | _ -> false) -> + isAppTy g sty2 && + tp1 |> HasConstraint _.IsSupportsNull && + not(tp1 |> HasConstraint _.IsIsNonNullableStruct)-> let tpNew = NewCompGenTypar(TyparKind.Type, TyparRigidity.Flexible, TyparStaticReq.None, TyparDynamicReq.No, false) trackErrors { do! SolveTypeEqualsType csenv ndeep m2 trace cxsln (TType_var(tpNew, g.knownWithoutNull)) sty2 @@ -1614,10 +1608,10 @@ and SolveTyparSubtypeOfType (csenv: ConstraintSolverEnv) ndeep m2 trace tp ty1 = else AddConstraint csenv ndeep m2 trace tp (TyparConstraint.CoercesTo(ty1, csenv.m)) -and DepthCheck ndeep m = - if ndeep > 300 then - error(Error(FSComp.SR.csTypeInferenceMaxDepth(), m)) - else +and DepthCheck ndeep m = + if ndeep > 300 then + error(Error(FSComp.SR.csTypeInferenceMaxDepth(), m)) + else CompleteD // If this is a type that's parameterized on a unit-of-measure (expected to be numeric), unify its measure with 1 @@ -2426,7 +2420,9 @@ and EnforceConstraintConsistency (csenv: ConstraintSolverEnv) ndeep m2 trace ret return! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace retTy1 retTy2 | TyparConstraint.SupportsComparison _, TyparConstraint.IsDelegate _ - | TyparConstraint.IsDelegate _, TyparConstraint.SupportsComparison _ + | TyparConstraint.IsDelegate _, TyparConstraint.SupportsComparison _ -> + return! ErrorD (Error(FSComp.SR.csComparisonDelegateConstraintInconsistent(), m)) + | TyparConstraint.IsNonNullableStruct _, TyparConstraint.IsReferenceType _ | TyparConstraint.IsReferenceType _, TyparConstraint.IsNonNullableStruct _ -> return! ErrorD (Error(FSComp.SR.csStructConstraintInconsistent(), m)) @@ -2434,6 +2430,11 @@ and EnforceConstraintConsistency (csenv: ConstraintSolverEnv) ndeep m2 trace ret | TyparConstraint.SupportsNull _, TyparConstraint.NotSupportsNull _ | TyparConstraint.NotSupportsNull _, TyparConstraint.SupportsNull _ -> return! ErrorD (Error(FSComp.SR.csNullNotNullConstraintInconsistent(), m)) + + | TyparConstraint.SupportsNull _, TyparConstraint.IsNonNullableStruct _ + | TyparConstraint.IsNonNullableStruct _, TyparConstraint.SupportsNull _ -> + () + //return! WarnD (Error(FSComp.SR.csNullStructConstraintInconsistent(), m)) | TyparConstraint.IsUnmanaged _, TyparConstraint.IsReferenceType _ | TyparConstraint.IsReferenceType _, TyparConstraint.IsUnmanaged _ -> @@ -2640,7 +2641,7 @@ and SolveTypeUseSupportsNull (csenv: ConstraintSolverEnv) ndeep m2 trace ty = | ValueSome NullnessInfo.WithoutNull -> return! AddConstraint csenv ndeep m2 trace tp (TyparConstraint.SupportsNull m) | _ -> - if tp.Constraints |> List.exists (function | TyparConstraint.IsReferenceType _ -> true | _ -> false) |> not then + if not (tp |> HasConstraint _.IsIsReferenceType) then do! AddConstraint csenv ndeep m2 trace tp (TyparConstraint.IsReferenceType m) return! SolveNullnessSupportsNull csenv ndeep m2 trace ty nullness | _ -> @@ -2737,7 +2738,7 @@ and SolveTypeCanCarryNullness (csenv: ConstraintSolverEnv) ty nullness = let strippedTy = stripTyEqnsA g true ty match tryAddNullnessToTy nullness strippedTy with | Some _ -> - if isTyparTy g strippedTy && not (isReferenceTyparTy g strippedTy) then + if isTyparTy g strippedTy && not (IsReferenceTyparTy g strippedTy) then return! AddConstraint csenv 0 m NoTrace (destTyparTy g strippedTy) (TyparConstraint.IsReferenceType m) | None -> let tyString = NicePrint.minimalStringOfType csenv.DisplayEnv strippedTy @@ -2978,10 +2979,11 @@ and SolveTypeRequiresDefaultValue (csenv: ConstraintSolverEnv) ndeep m2 trace or let g = csenv.g let m = csenv.m let ty = stripTyEqnsAndMeasureEqns g origTy + if isTyparTy g ty then - if isNonNullableStructTyparTy g ty then + if IsNonNullableStructTyparTy g ty then SolveTypeRequiresDefaultConstructor csenv ndeep m2 trace ty - elif isReferenceTyparTy g ty then + elif IsReferenceTyparTy g ty then SolveTypeUseSupportsNull csenv ndeep m2 trace ty else ErrorD (ConstraintSolverError(FSComp.SR.csGenericConstructRequiresStructOrReferenceConstraint(), m, m2)) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index e873ba12f17..9dba2586e0f 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -2194,7 +2194,7 @@ module GeneralizationHelpers = let relevantUniqueSubtypeConstraint (tp: Typar) = // Find a single subtype constraint - match tp.Constraints |> List.partition (function TyparConstraint.CoercesTo _ -> true | _ -> false) with + match tp.Constraints |> List.partition _.IsCoercesTo with | [TyparConstraint.CoercesTo(tgtTy, _)], others -> // Throw away null constraints if they are implied if others |> List.exists (function TyparConstraint.SupportsNull _ -> not (TypeNullIsExtraValue g m tgtTy) | _ -> true) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 1faeaddf82f..791fed38a3d 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -5676,32 +5676,14 @@ and GenGenericParam cenv eenv (tp: Typar) = |> List.map (GenTypeAux cenv tp.Range eenv.tyenv VoidNotOK PtrTypesNotOK) let refTypeConstraint = - tp.Constraints - |> List.exists (function - | TyparConstraint.IsReferenceType _ - // 'null' automatically implies 'not struct' - | TyparConstraint.SupportsNull _ -> true - | _ -> false) + tp |> HasConstraint(fun tc -> tc.IsIsReferenceType || tc.IsSupportsNull) // `null` implies not struct - let notNullableValueTypeConstraint = - tp.Constraints - |> List.exists (function - | TyparConstraint.IsNonNullableStruct _ -> true - | _ -> false) + let notNullableValueTypeConstraint = tp |> HasConstraint _.IsIsNonNullableStruct let nullnessOfTypar = if g.langFeatureNullness && g.checkNullness then - let hasNotSupportsNull = - tp.Constraints - |> List.exists (function - | TyparConstraint.NotSupportsNull _ -> true - | _ -> false) - - let hasSupportsNull () = - tp.Constraints - |> List.exists (function - | TyparConstraint.SupportsNull _ -> true - | _ -> false) + let hasNotSupportsNull = tp |> HasConstraint _.IsNotSupportsNull + let hasSupportsNull () = tp |> HasConstraint _.IsSupportsNull if hasNotSupportsNull || notNullableValueTypeConstraint then NullnessInfo.WithoutNull @@ -5714,17 +5696,11 @@ and GenGenericParam cenv eenv (tp: Typar) = None let defaultConstructorConstraint = - tp.Constraints - |> List.exists (function - | TyparConstraint.RequiresDefaultConstructor _ -> true - | _ -> false) + tp |> HasConstraint _.IsRequiresDefaultConstructor let emitUnmanagedInIlOutput = cenv.g.langVersion.SupportsFeature(LanguageFeature.UnmanagedConstraintCsharpInterop) - && tp.Constraints - |> List.exists (function - | TyparConstraint.IsUnmanaged _ -> true - | _ -> false) + && tp |> HasConstraint _.IsIsUnmanaged let tpName = // use the CompiledName if given diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index eedaecbb9be..9bfa12ce963 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -324,6 +324,8 @@ csMethodFoundButIsStatic,"The type '%s' has a method '%s' (full name '%s'), but csMethodFoundButIsNotStatic,"The type '%s' has a method '%s' (full name '%s'), but the method is not static" 472,csStructConstraintInconsistent,"The constraints 'struct' and 'not struct' are inconsistent" 473,csUnmanagedConstraintInconsistent,"The constraints 'unmanaged' and 'not struct' are inconsistent" +474,csComparisonDelegateConstraintInconsistent,"The constraints 'comparison' and 'delegate' are inconsistent" +475,csNullStructConstraintInconsistent,"The constraints 'struct' and 'null' are inconsistent" csTypeDoesNotHaveNull,"The type '%s' does not have 'null' as a proper value" csNullableTypeDoesNotHaveNull,"The type '%s' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'." csTypeDoesNotSupportComparison1,"The type '%s' does not support the 'comparison' constraint because it has the 'NoComparison' attribute" diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 4cabe94d952..e5e330759dc 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -9150,41 +9150,34 @@ let IsUnionTypeWithNullAsTrueValue (g: TcGlobals) (tycon: Tycon) = let TyconCompilesInstanceMembersAsStatic g tycon = IsUnionTypeWithNullAsTrueValue g tycon let TcrefCompilesInstanceMembersAsStatic g (tcref: TyconRef) = TyconCompilesInstanceMembersAsStatic g tcref.Deref +let inline HasConstraint ([] predicate) (tp:Typar) = + tp.Constraints |> List.exists predicate + +let inline tryGetTyparTyWithConstraint g ([] predicate) ty = + match tryDestTyparTy g ty with + | ValueSome tp as x when HasConstraint predicate tp -> x + | _ -> ValueNone + +let inline IsTyparTyWithConstraint g ([] predicate) ty = + match tryDestTyparTy g ty with + | ValueSome tp -> HasConstraint predicate tp + | ValueNone -> false + // Note, isStructTy does not include type parameters with the ': struct' constraint // This predicate is used to detect those type parameters. -let isNonNullableStructTyparTy g ty = - match tryDestTyparTy g ty with - | ValueSome tp -> - tp.Constraints |> List.exists (function TyparConstraint.IsNonNullableStruct _ -> true | _ -> false) - | ValueNone -> - false +let IsNonNullableStructTyparTy g ty = ty |> IsTyparTyWithConstraint g _.IsIsNonNullableStruct // Note, isRefTy does not include type parameters with the ': not struct' or ': null' constraints // This predicate is used to detect those type parameters. -let isReferenceTyparTy g ty = - match tryDestTyparTy g ty with - | ValueSome tp -> - tp.Constraints |> List.exists (function - | TyparConstraint.IsReferenceType _ -> true - | TyparConstraint.SupportsNull _ -> true - | _ -> false) - | ValueNone -> - false +let IsReferenceTyparTy g ty = ty |> IsTyparTyWithConstraint g (fun tc -> tc.IsIsReferenceType || tc.IsSupportsNull) -let GetTyparTyIfSupportsNull g ty = - if isReferenceTyparTy g ty then - let tp = destTyparTy g ty - if tp.Constraints |> List.exists (function TyparConstraint.SupportsNull _ -> true | _ -> false) then - ValueSome tp - else ValueNone - else - ValueNone +let GetTyparTyIfSupportsNull g ty = ty |> tryGetTyparTyWithConstraint g _.IsSupportsNull let TypeNullNever g ty = let underlyingTy = stripTyEqnsAndMeasureEqns g ty isStructTy g underlyingTy || isByrefTy g underlyingTy || - isNonNullableStructTyparTy g ty + IsNonNullableStructTyparTy g ty /// The pre-nullness logic about whether a type admits the use of 'null' as a value. let TypeNullIsExtraValue g m ty = @@ -9244,7 +9237,7 @@ let changeWithNullReqTyToVariable g reqTy = let reqTyForArgumentNullnessInference g actualTy reqTy = // Only change reqd nullness if actualTy is an inference variable match tryDestTyparTy g actualTy with - | ValueSome t when t.IsCompilerGenerated && not(t.Constraints |> List.exists(function | TyparConstraint.SupportsNull _ -> true | _ -> false))-> + | ValueSome t when t.IsCompilerGenerated && not(t |> HasConstraint _.IsSupportsNull) -> changeWithNullReqTyToVariable g reqTy | _ -> reqTy @@ -9366,8 +9359,9 @@ let rec TypeHasDefaultValueAux isNew g m ty = true)) || // Check for type variables with the ":struct" and "(new : unit -> 'T)" constraints - (isNonNullableStructTyparTy g ty && - (destTyparTy g ty).Constraints |> List.exists (function TyparConstraint.RequiresDefaultConstructor _ -> true | _ -> false)) + ( match ty |> tryGetTyparTyWithConstraint g _.IsIsNonNullableStruct with + | ValueSome tp -> tp |> HasConstraint _.IsRequiresDefaultConstructor + | ValueNone -> false) let TypeHasDefaultValue (g: TcGlobals) m ty = TypeHasDefaultValueAux false g m ty @@ -9984,7 +9978,7 @@ let isCompiledOrWitnessPassingConstraint (g: TcGlobals) cx = // FSharpTypeFunc, but rather bake a "local type function" for each TyLambda abstraction. let IsGenericValWithGenericConstraints g (v: Val) = isForallTy g v.Type && - v.Type |> destForallTy g |> fst |> List.exists (fun tp -> List.exists (isCompiledOrWitnessPassingConstraint g) tp.Constraints) + v.Type |> destForallTy g |> fst |> List.exists (fun tp -> HasConstraint (isCompiledOrWitnessPassingConstraint g) tp) // Does a type support a given interface? type Entity with diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 7e98ce5bc78..c67ccb30800 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1734,13 +1734,18 @@ val isStructOrEnumTyconTy: TcGlobals -> TType -> bool /// /// Note, isStructTy does not include type parameters with the ': struct' constraint /// This predicate is used to detect those type parameters. -val isNonNullableStructTyparTy: TcGlobals -> TType -> bool +val IsNonNullableStructTyparTy: TcGlobals -> TType -> bool + +val inline HasConstraint: [] predicate: (TyparConstraint -> bool) -> Typar -> bool + +val inline IsTyparTyWithConstraint: + TcGlobals -> [] predicate: (TyparConstraint -> bool) -> TType -> bool /// Determine if a type is a variable type with the ': not struct' constraint. /// /// Note, isRefTy does not include type parameters with the ': not struct' constraint /// This predicate is used to detect those type parameters. -val isReferenceTyparTy: TcGlobals -> TType -> bool +val IsReferenceTyparTy: TcGlobals -> TType -> bool /// Determine if a type is an unmanaged type val isUnmanagedTy: TcGlobals -> TType -> bool diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 74894da5d02..7d64601c303 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -172,6 +172,11 @@ Dostupná přetížení:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' {0} nepodporuje typ {1}, protože tento typ postrádá požadovaný (skutečný nebo vestavěný) člen {2} @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match Argument na indexu {0} neodpovídá diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 77409615867..67f4270377e 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -172,6 +172,11 @@ Verfügbare Überladungen:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' "{0}" unterstützt den Typ "{1}" nicht, da letzteres nicht das erforderliche (echte oder integrierte) Element "{2}" aufweist. @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match Das Argument bei Index {0} stimmt nicht überein. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 9f042384d39..9478e3d2c55 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -172,6 +172,11 @@ Sobrecargas disponibles:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}' no admite el tipo '{1}', porque a este último le falta el '{2}' de miembro necesario (real o integrado) @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match El argumento del índice {0} no coincide. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 621286a8e21..57fade5d250 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -172,6 +172,11 @@ Surcharges disponibles :\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}' ne prend pas en charge le type '{1}', car ce dernier n'a pas le membre requis (réel ou intégré) '{2}' @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match L'argument à l'index {0} ne correspond pas diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 1d7bdf56aa0..14d670e8455 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -172,6 +172,11 @@ Overload disponibili:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}' non supporta il tipo '{1}', perché in quest'ultimo manca il membro '{2}' richiesto (reale o predefinito) @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match L'argomento alla posizione di indice {0} non corrisponde diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index c928a51da3e..78acb0fd944 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -172,6 +172,11 @@ 使用可能なオーバーロード:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' 型 '{1}' には必要な (実数または組み込み) メンバー '{2}' がないため、'{0}' ではサポートされません @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match インデックス {0} の引数が一致しません diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index aaff373fcda..604ac431e4a 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -172,6 +172,11 @@ 사용 가능한 오버로드:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{1}' 형식에는 필수(실제 또는 기본 제공) 멤버 '{2}'이(가) 없기 때문에 '{0}'이(가) 이 형식을 지원하지 않습니다. @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match 인덱스 {0}의 인수가 일치하지 않습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index f886e72e8f8..fdee3d82f7d 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -172,6 +172,11 @@ Dostępne przeciążenia:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' Element „{0}” nie obsługuje typu „{1}”, ponieważ ten drugi nie ma wymaganej (rzeczywistej lub wbudowanej) składowej „{2}” @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match Argument pod indeksem {0} nie jest zgodny diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 69082574676..2f86c57d960 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -172,6 +172,11 @@ Sobrecargas disponíveis:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' "{0}" não dá suporte ao tipo "{1}", pois o último não tem o membro necessário (real ou interno) "{2}: @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match O argumento no índice {0} não corresponde diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index df0d5f9770a..fefd5255a0b 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -172,6 +172,11 @@ Доступные перегрузки:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}' не поддерживает тип '{1}', поскольку у последнего отсутствует необходимый (реальный или встроенный) член '{2}' @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match Аргумент в индексе {0} не соответствует diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 77568593137..5325f0ab09f 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -172,6 +172,11 @@ Kullanılabilir aşırı yüklemeler:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}', gerekli (gerçek veya yerleşik) '{2}' üyesine sahip olmadığından '{1}' türünü desteklemiyor @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match {0} dizinindeki bağımsız değişken eşleşmiyor diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 59532dc06d8..2e8b957d810 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -172,6 +172,11 @@ 可用重载:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' “{0}”不支持类型“{1}”,因为后者缺少所需的(实际或内置)成员“{2}” @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match 索引 {0} 处的参数不匹配 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 2274eb373c8..f0924b3d30f 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -172,6 +172,11 @@ 可用的多載:\n{0} + + The constraints 'comparison' and 'delegate' are inconsistent + The constraints 'comparison' and 'delegate' are inconsistent + + '{0}' does not support the type '{1}', because the latter lacks the required (real or built-in) member '{2}' '{0}' 不支援類型 '{1}',因為後者缺少必要的 (實際或內建) 成員 '{2}' @@ -212,6 +217,11 @@ The constraints 'null' and 'not null' are inconsistent + + The constraints 'struct' and 'null' are inconsistent + The constraints 'struct' and 'null' are inconsistent + + Argument at index {0} doesn't match 位於索引 {0} 的引數不相符 diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs index c549cc09aa2..486b68c7d2b 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/NullableRegressionTests.fs @@ -132,9 +132,34 @@ let ``DefaultValueBug when checknulls is disabled`` compilation = [] let ``With new nullness syntax nullness enabled`` compilation = compilation - |> withVersionAndCheckNulls ("preview",true) + |> withVersionAndCheckNulls ("preview",true) |> verifyBaseline +// https://github.com/dotnet/fsharp/issues/18288 +[] +let ``Inference problem limit regression previewNullness`` compilation = + compilation + |> withVersionAndCheckNulls ("preview",true) + |> withNoWarn 475 // The constraints 'struct' and 'null' are inconsistent + |> typecheck + |> shouldSucceed + +[] +let ``Inference problem limit regression previewNoNullness`` compilation = + compilation + |> withVersionAndCheckNulls ("preview",false) + |> withNoWarn 475 // The constraints 'struct' and 'null' are inconsistent + |> typecheck + |> shouldSucceed + +[] +let ``Inference problem limit regression v8`` compilation = + compilation + |> withVersionAndCheckNulls ("8.0",false) + |> withNoWarn 475 // The constraints 'struct' and 'null' are inconsistent + |> typecheck + |> shouldSucceed + [] diff --git a/tests/FSharp.Compiler.ComponentTests/Language/Nullness/inference-problem-size-explosion.fs b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/inference-problem-size-explosion.fs new file mode 100644 index 00000000000..e40f8177094 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/Nullness/inference-problem-size-explosion.fs @@ -0,0 +1,42 @@ +module M + +type ToSeq = + static member inline Invoke (source: 'FldT) : seq<'T> = + let inline call (mthd: ^M, input1: ^I) = ((^M or ^I) : (static member ToSeq : _*_ -> _) input1, mthd) + call (Unchecked.defaultof, source) + + static member inline ToSeq (x: 'Foldable , _: ToSeq) = (^Foldable: (static member ToSeq : _ -> _) x) + static member inline ToSeq (_: 'T when 'T: null and 'T: struct, _: ToSeq) = () + +type Append = + static member inline Append (x: 'AltT , y: 'AltT , _: obj ) = (^AltT : (static member Append : _*_ -> _) x, y) : 'AltT + static member inline Append (_: ^t when ^t: null and ^t: struct, _, _: obj ) = () + static member inline Append (x: Result<_,_> , y , _: Append) = match x, y with Ok _, _ -> x | Error x, Error y -> Error (x + y) | _, _ -> y + + static member inline Invoke (x: 'AltT) (y: 'AltT) : 'AltT = + let inline call (mthd: ^M, input1: ^I, input2: ^I) = ((^M or ^I) : (static member Append : _*_*_ -> _) input1, input2, mthd) + call (Unchecked.defaultof, x, y) + + static member inline Append (x: 'R -> 'AltT , y , _: Append) = fun r -> Append.Invoke (x r) (y r) + +type Choice = + static member inline Choice (x: ref<'RAltT>, _: obj) = + let t = ToSeq.Invoke x.Value + use e = t.GetEnumerator () + e.MoveNext() |> ignore + let mutable res = e.Current + while e.MoveNext() do res <- Append.Invoke res e.Current + res + + static member inline Choice (x: ref<'FAltT> , _: Choice) = (^FAltT : (static member Choice : _ -> _) x.Value) : 'AltT + static member inline Choice (_: ref< ^t> when ^t: null and ^t: struct, _: Choice) = () + + static member inline Invoke (x: 'FAltT) : 'AltT = + let inline call (mthd: ^M, input1: ^I) = ((^M or ^I) : (static member Choice : _*_ -> _) (ref input1, mthd)) + call (Unchecked.defaultof, x) + +[] +type WrappedSeqE<'s> = WrappedSeqE of 's seq with static member ToSeq (WrappedSeqE x) = x + +let v1 = [Ok 1; Error "a" ] +let v2 = Choice.Invoke (WrappedSeqE v1) \ No newline at end of file From 1b5e389d641819e867f317fccaf3ecf1f7ece634 Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 12 Mar 2025 12:35:04 +0100 Subject: [PATCH 011/134] Remove verbose syntax in pickling code (#18372) --- src/Compiler/TypedTree/TypedTreePickle.fs | 190 ++++++++++++---------- 1 file changed, 104 insertions(+), 86 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index b55b784f8f5..ba09c7a6029 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -364,7 +364,9 @@ let u_byteB st = type unpickler<'T> = ReaderState -> 'T -let u_bool st = let b = u_byte st in (b = 1) +let u_bool st = + let b = u_byte st + b = 1 /// Unpickle an uncompressed integer from the main stream let prim_u_int32 st = @@ -465,21 +467,21 @@ let u_used_space1 f st = None let inline u_tup2 p1 p2 (st: ReaderState) = - let a = p1 st in - let b = p2 st in + let a = p1 st + let b = p2 st (a, b) let inline u_tup3 p1 p2 p3 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in + let a = p1 st + let b = p2 st + let c = p3 st (a, b, c) let inline u_tup4 p1 p2 p3 p4 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st (a, b, c, d) let inline u_tup5 p1 p2 p3 p4 p5 (st: ReaderState) = @@ -491,71 +493,71 @@ let inline u_tup5 p1 p2 p3 p4 p5 (st: ReaderState) = (a, b, c, d, e) let inline u_tup6 p1 p2 p3 p4 p5 p6 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in - let e = p5 st in - let f = p6 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + let f = p6 st (a, b, c, d, e, f) let inline u_tup8 p1 p2 p3 p4 p5 p6 p7 p8 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in - let e = p5 st in - let f = p6 st in - let x7 = p7 st in - let x8 = p8 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + let f = p6 st + let x7 = p7 st + let x8 = p8 st (a, b, c, d, e, f, x7, x8) let inline u_tup9 p1 p2 p3 p4 p5 p6 p7 p8 p9 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in - let e = p5 st in - let f = p6 st in - let x7 = p7 st in - let x8 = p8 st in - let x9 = p9 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + let f = p6 st + let x7 = p7 st + let x8 = p8 st + let x9 = p9 st (a, b, c, d, e, f, x7, x8, x9) let inline u_tup13 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in - let e = p5 st in - let f = p6 st in - let x7 = p7 st in - let x8 = p8 st in - let x9 = p9 st in - let x10 = p10 st in - let x11 = p11 st in - let x12 = p12 st in - let x13 = p13 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + let f = p6 st + let x7 = p7 st + let x8 = p8 st + let x9 = p9 st + let x10 = p10 st + let x11 = p11 st + let x12 = p12 st + let x13 = p13 st (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13) let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (st: ReaderState) = - let a = p1 st in - let b = p2 st in - let c = p3 st in - let d = p4 st in - let e = p5 st in - let f = p6 st in - let x7 = p7 st in - let x8 = p8 st in - let x9 = p9 st in - let x10 = p10 st in - let x11 = p11 st in - let x12 = p12 st in - let x13 = p13 st in - let x14 = p14 st in - let x15 = p15 st in - let x16 = p16 st in - let x17 = p17 st in + let a = p1 st + let b = p2 st + let c = p3 st + let d = p4 st + let e = p5 st + let f = p6 st + let x7 = p7 st + let x8 = p8 st + let x9 = p9 st + let x10 = p10 st + let x11 = p11 st + let x12 = p12 st + let x13 = p13 st + let x14 = p14 st + let x15 = p15 st + let x16 = p16 st + let x17 = p17 st (a, b, c, d, e, f, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) //--------------------------------------------------------------------------- @@ -1305,10 +1307,12 @@ let u_ILHasThis st = | _ -> ufailwith st "u_ILHasThis" let u_ILCallConv st = - let a, b = u_tup2 u_ILHasThis u_ILBasicCallConv st in Callconv(a, b) + let a, b = u_tup2 u_ILHasThis u_ILBasicCallConv st + Callconv(a, b) let u_ILTypeRef st = - let a, b, c = u_tup3 u_ILScopeRef u_strings u_string st in ILTypeRef.Create(a, b, c) + let a, b, c = u_tup3 u_ILScopeRef u_strings u_string st + ILTypeRef.Create(a, b, c) let u_ILArrayShape = u_wrap (ILArrayShape) (u_list (u_tup2 (u_option u_int32) (u_option u_int32))) @@ -1341,7 +1345,8 @@ and u_ILCallSig = (u_tup3 u_ILCallConv u_ILTypes u_ILType) and u_ILTypeSpec st = - let a, b = u_tup2 u_ILTypeRef u_ILTypes st in ILTypeSpec.Create(a, b) + let a, b = u_tup2 u_ILTypeRef u_ILTypes st + ILTypeSpec.Create(a, b) let p_ILMethodRef (x: ILMethodRef) st = p_tup6 @@ -1884,22 +1889,22 @@ let p_xmldoc (doc: XmlDoc) st = p_array p_string doc.UnprocessedLines st let u_pos st = - let a = u_int st in - let b = u_int st in + let a = u_int st + let b = u_int st mkPos a b let u_range st = - let a = u_string st in - let b = u_pos st in - let c = u_pos st in + let a = u_string st + let b = u_pos st + let c = u_pos st mkRange a b c // Most ranges (e.g. on optimization expressions) can be elided from stored data let u_dummy_range: range unpickler = fun _st -> range0 let u_ident st = - let a = u_string st in - let b = u_range st in + let a = u_string st + let b = u_range st ident (a, b) let u_xmldoc st = XmlDoc(u_array u_string st, range0) @@ -1935,10 +1940,12 @@ let u_tcref st = | _ -> ufailwith st "u_item_ref" let u_ucref st = - let a, b = u_tup2 u_tcref u_string st in UnionCaseRef(a, b) + let a, b = u_tup2 u_tcref u_string st + UnionCaseRef(a, b) let u_rfref st = - let a, b = u_tup2 u_tcref u_string st in RecdFieldRef(a, b) + let a, b = u_tup2 u_tcref u_string st + RecdFieldRef(a, b) let u_tpref st = u_local_item_ref st.itypars st @@ -2236,20 +2243,29 @@ let p_measure_expr unt st = p_normalized_measure (normalizeMeasure st.oglobals unt) st let u_rational st = - let a, b = u_tup2 u_int32 u_int32 st in DivRational (intToRational a) (intToRational b) + let a, b = u_tup2 u_int32 u_int32 st + DivRational (intToRational a) (intToRational b) let rec u_measure_expr st = let tag = u_byte st match tag with - | 0 -> let a = u_tcref st in Measure.Const(a, range0) - | 1 -> let a = u_measure_expr st in Measure.Inv a - | 2 -> let a, b = u_tup2 u_measure_expr u_measure_expr st in Measure.Prod(a, b, range0) - | 3 -> let a = u_tpref st in Measure.Var(a) + | 0 -> + let a = u_tcref st + Measure.Const(a, range0) + | 1 -> + let a = u_measure_expr st + Measure.Inv a + | 2 -> + let a, b = u_tup2 u_measure_expr u_measure_expr st + Measure.Prod(a, b, range0) + | 3 -> + let a = u_tpref st + Measure.Var(a) | 4 -> Measure.One(range0) | 5 -> - let a = u_measure_expr st in - let b = u_rational st in + let a = u_measure_expr st + let b = u_rational st Measure.RationalPower(a, b) | _ -> ufailwith st "u_measure_expr" @@ -3451,7 +3467,8 @@ and u_dtree st = | _ -> ufailwith st "u_dtree" and u_dtree_case st = - let a, b = u_tup2 u_dtree_discrim u_dtree st in (TCase(a, b)) + let a, b = u_tup2 u_dtree_discrim u_dtree st + TCase(a, b) and u_dtree_discrim st = let tag = u_byte st @@ -3465,11 +3482,12 @@ and u_dtree_discrim st = | _ -> ufailwith st "u_dtree_discrim" and u_target st = - let a, b = u_tup2 u_Vals u_expr st in (TTarget(a, b, None)) + let a, b = u_tup2 u_Vals u_expr st + TTarget(a, b, None) and u_bind st = - let a = u_Val st in - let b = u_expr st in + let a = u_Val st + let b = u_expr st TBind(a, b, DebugPointAtBinding.NoneAtSticky) and u_lval_op_kind st = From 76b83e62bded3b6ce447cc5e92cda9ddeff462ec Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Wed, 12 Mar 2025 12:06:12 +0000 Subject: [PATCH 012/134] Reference assembly loading fixes: 1) don't try to load assemblies already loaded, 2) Use ConcurrentDictionary in thread-safe way (#18377) --- tests/service/data/TestTP/ProvidedTypes.fs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/service/data/TestTP/ProvidedTypes.fs b/tests/service/data/TestTP/ProvidedTypes.fs index 50dd53a55a4..1df9d3139d1 100644 --- a/tests/service/data/TestTP/ProvidedTypes.fs +++ b/tests/service/data/TestTP/ProvidedTypes.fs @@ -8907,6 +8907,7 @@ namespace ProviderImplementation.ProvidedTypes let enqueueReferencedAssemblies(asm: Assembly) = do sourceAssembliesQueue.Add (fun () -> [| for referencedAssemblyName in asm.GetReferencedAssemblies() do + if not (sourceAssembliesTable_.ContainsKey referencedAssemblyName.Name) then let referencedAssembly = try Assembly.Load(referencedAssemblyName) with _ -> null if not (isNull referencedAssembly) then yield referencedAssembly |]) @@ -8920,12 +8921,12 @@ namespace ProviderImplementation.ProvidedTypes for q in qs do for asm in q() do let simpleName = asm.GetName().Name - if not (sourceAssembliesTable_.ContainsKey(simpleName)) then - sourceAssembliesTable_[simpleName] <- asm + sourceAssembliesTable_.GetOrAdd(simpleName, fun k -> sourceAssemblies_.Add asm // Find the transitive closure of all referenced assemblies enqueueReferencedAssemblies asm - + asm + ) |> ignore sourceAssemblies_ /// When translating quotations, Expr.Var's are translated to new variable respecting reference equality. From d21aa8a041074be4daaf0ec3e88a8b5f9f716b3d Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 13 Mar 2025 08:13:26 -0700 Subject: [PATCH 013/134] cherrypick 18355 (#18367) * cherrypick 18355 * revert attributes feature (#18355) * revert attributes * release notes --- .../FSharp.Core_notshipped.fsproj | 2 +- .../.FSharp.Compiler.Service/9.0.202.md | 59 +++++++++++++++++++ docs/release-notes/.Language/9.0.md | 1 + src/Compiler/Facilities/LanguageFeatures.fs | 2 +- .../AttributeUsage/AttributeUsage.fs | 28 ++++----- 5 files changed, 76 insertions(+), 16 deletions(-) create mode 100644 docs/release-notes/.FSharp.Compiler.Service/9.0.202.md diff --git a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj index f104ff30fe7..7301910fba3 100644 --- a/buildtools/checkpackages/FSharp.Core_notshipped.fsproj +++ b/buildtools/checkpackages/FSharp.Core_notshipped.fsproj @@ -3,7 +3,7 @@ - ne87.0 + net9.0 diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.202.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.202.md new file mode 100644 index 00000000000..54ee092c09b --- /dev/null +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.202.md @@ -0,0 +1,59 @@ +### Fixed + +* Fix missing TailCall warning in Sequential in use scope ([PR #17927](https://github.com/dotnet/fsharp/pull/17927)) +* Fix false negatives for passing null to "obj" arguments. Only "obj | null" can now subsume any type ([PR #17757](https://github.com/dotnet/fsharp/pull/17757)) +* Fix internal error when calling 'AddSingleton' and other overloads only differing in generic arity ([PR #17804](https://github.com/dotnet/fsharp/pull/17804)) +* Fix extension methods support for non-reference system assemblies ([PR #17799](https://github.com/dotnet/fsharp/pull/17799)) +* Ensure `frameworkTcImportsCache` mutations are threadsafe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795)) +* Disallow abstract member with access modifiers in sig file. ([PR #17802](https://github.com/dotnet/fsharp/pull/17802)) +* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812)) +* Fix nullness inference for member val and other OO scenarios ([PR #17845](https://github.com/dotnet/fsharp/pull/17845)) +* Fix internal error when analyzing incomplete inherit member ([PR #17905](https://github.com/dotnet/fsharp/pull/17905)) +* Add warning when downcasting from nullable type to non-nullable ([PR #17965](https://github.com/dotnet/fsharp/pull/17965)) +* Fix missing nullness warning in case of method resolution multiple candidates ([PR #17917](https://github.com/dotnet/fsharp/pull/17918)) +* Fix failure to use bound values in `when` clauses of `try-with` in `seq` expressions ([PR #17990](https://github.com/dotnet/fsharp/pull/17990)) +* Fix locals allocating for the special `copyOfStruct` defensive copy ([PR #18025](https://github.com/dotnet/fsharp/pull/18025)) +* Fix lowering of computed array expressions when the expression consists of a simple mapping from a `uint64` or `unativeint` array. [PR #18081](https://github.com/dotnet/fsharp/pull/18081) +* Add missing nullable-metadata for C# consumers of records,exceptions and DU subtypes generated from F# code. [PR #18079](https://github.com/dotnet/fsharp/pull/18079) +* Reduce excess memory usage in TransparentCompiler. [PR #17543](https://github.com/dotnet/fsharp/pull/17543) +* Fix a race condition in file book keeping in the compiler service ([#18008](https://github.com/dotnet/fsharp/pull/18008)) +* Fix trimming '%' characters when lowering interpolated string to a concat call [PR #18123](https://github.com/dotnet/fsharp/pull/18123) +* Completion: fix qualified completion in sequence expressions [PR #18111](https://github.com/dotnet/fsharp/pull/18111) +* Symbols: try to use ValReprInfoForDisplay in Mfv.CurriedParameterGroups ([PR #18124](https://github.com/dotnet/fsharp/pull/18124)) +* Shim/file system: fix leaks of the shim [PR #18144](https://github.com/dotnet/fsharp/pull/18144) + +### Added + +* Let `dotnet fsi --help` print a link to the documentation website. ([PR #18006](https://github.com/dotnet/fsharp/pull/18006)) +* Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772)) +* Support literal attribute on decimals ([PR #17769](https://github.com/dotnet/fsharp/pull/17769)) +* Added type conversions cache, only enabled for compiler runs, guarded by language version preview ([PR #17668](https://github.com/dotnet/fsharp/pull/17668)) +* Added project property ParallelCompilation which turns on graph based type checking, parallel ILXGen and parallel optimization. By default on for users of langversion=preview ([PR #17948](https://github.com/dotnet/fsharp/pull/17948)) +* Adding warning when consuming generic method returning T|null for types not supporting nullness (structs,anons,tuples) ([PR #18057](https://github.com/dotnet/fsharp/pull/18057)) +* Sink: report SynPat.ArrayOrList type ([PR #18127](https://github.com/dotnet/fsharp/pull/18127)) +* Show the default value of compiler options ([PR #18054](https://github.com/dotnet/fsharp/pull/18054)) +* Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) +* Cancellable: add safer APIs to check the token ([PR #18175](https://github.com/dotnet/fsharp/pull/18175)) + +### Changed + +* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392)) +* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768)) +* Better ranges for CE `let!` and `use!` error reporting. ([PR #17712](https://github.com/dotnet/fsharp/pull/17712)) +* Better ranges for CE `do!` error reporting. ([PR #17779](https://github.com/dotnet/fsharp/pull/17779)) +* Better ranges for CE `return, yield, return! and yield!` error reporting. ([PR #17792](https://github.com/dotnet/fsharp/pull/17792)) +* Better ranges for CE `match!`. ([PR #17789](https://github.com/dotnet/fsharp/pull/17789)) +* Better ranges for CE `use` error reporting. ([PR #17811](https://github.com/dotnet/fsharp/pull/17811)) +* Better ranges for `inherit` error reporting. ([PR #17879](https://github.com/dotnet/fsharp/pull/17879)) +* Better ranges for `inherit` `struct` error reporting. ([PR #17886](https://github.com/dotnet/fsharp/pull/17886)) +* Warn on uppercase identifiers in patterns. ([PR #15816](https://github.com/dotnet/fsharp/pull/15816)) +* Better ranges for `inherit` objects error reporting. ([PR #17893](https://github.com/dotnet/fsharp/pull/17893)) +* Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871)) +* Better ranges for #nowarn error reporting; bring back #nowarn warnings for --langVersion:80; add warnings under feature flag ([PR #17871](https://github.com/dotnet/fsharp/pull/17871)) +* CheckAndThrow can be invoked only from within Cancellable context ([PR #18037](https://github.com/dotnet/fsharp/pull/18037)) +* Make ILTypeDef base type calculation lazy. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) +* Revert EnforceAttributeTargets Feature. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) + +### Breaking Changes + +* Aliasing `StructAttribute` will now produce a warning (part of [Language suggestion #18298](https://github.com/fsharp/fslang-suggestions/issues/18298), [PR #18355](https://github.com/dotnet/fsharp/pull/18355)) \ No newline at end of file diff --git a/docs/release-notes/.Language/9.0.md b/docs/release-notes/.Language/9.0.md index 2785a646e56..d2247aa35c4 100644 --- a/docs/release-notes/.Language/9.0.md +++ b/docs/release-notes/.Language/9.0.md @@ -21,6 +21,7 @@ * Enforce AttributeTargets on implicit constructors. ([PR #16845](https://github.com/dotnet/fsharp/pull/16845/)) * Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) * Ensure consistent interaction between ``#line` and `#nowarn` directives ([PR #17649](https://github.com/dotnet/fsharp/pull/17649)) +* Revert EnforceAttributeTargets Feature. ([PR #18005](https://github.com/dotnet/fsharp/pull/18005)) ### Changed diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 9ee90f98bb4..7a9a14b8602 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -217,9 +217,9 @@ type LanguageVersion(versionText) = LanguageFeature.LowerSimpleMappingsInComprehensionsToFastLoops, languageVersion90 LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90 LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90 - LanguageFeature.EnforceAttributeTargets, languageVersion90 // F# preview + LanguageFeature.EnforceAttributeTargets, previewVersion // Not enabled due to a number of external library dependencies on unenforced attributes LanguageFeature.UseTypeSubsumptionCache, previewVersion LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index a28d6175642..c7c2cf72eca 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -100,7 +100,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargets01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -136,7 +136,7 @@ module CustomAttributes_AttributeUsage = let ``E_AttributeTargetIsField01_fs`` compilation = compilation |> withOptions ["--nowarn:25"] - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -189,7 +189,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsMethod02_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> withOptions ["--nowarn:25"] |> verifyCompile |> shouldFail @@ -220,7 +220,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsMethod03_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> withOptions ["--nowarn:25"] |> verifyCompile |> shouldFail @@ -338,7 +338,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsStruct_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -368,7 +368,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsClass_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -389,7 +389,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsClass01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -487,7 +487,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsField03_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -507,7 +507,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsProperty01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -527,7 +527,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsCtor01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -564,7 +564,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetIsEnum01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -601,7 +601,7 @@ module CustomAttributes_AttributeUsage = [] let ``E_AttributeTargetsIsDelegate01_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -650,7 +650,7 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = [] let ``E_AttributeTargetIsInterface_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ @@ -672,7 +672,7 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = [] let ``E_AttributeTargetIsClass02_fs`` compilation = compilation - |> withLangVersion90 + |> withLangVersionPreview |> verifyCompile |> shouldFail |> withDiagnostics [ From 52843f7ac6ade62a29d1949300c32631b7de121f Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 17 Mar 2025 12:08:28 +0100 Subject: [PATCH 014/134] Revive E2E tests, rescue CI (#18384) * Revive E2E tests * up * try this * Revert "try this" This reverts commit fea7c9157ff38aa0e65db8eab21575a5f5f12622. * Revert "up" This reverts commit 39ffc4c8de8a823c011b330cf08c877dc528bdb4. * Revert "Revive E2E tests" This reverts commit 7056cb8cde2fb06165f2cd9bf143f60950b8aee3. * up --- tests/EndToEndBuildTests/Directory.Build.props | 1 + tests/EndToEndBuildTests/EndToEndBuildTests.cmd | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/EndToEndBuildTests/Directory.Build.props b/tests/EndToEndBuildTests/Directory.Build.props index 7537d3adc6e..4a8f0153de0 100644 --- a/tests/EndToEndBuildTests/Directory.Build.props +++ b/tests/EndToEndBuildTests/Directory.Build.props @@ -5,6 +5,7 @@ LatestMajor + diff --git a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd index eba1498af91..7613f487e35 100644 --- a/tests/EndToEndBuildTests/EndToEndBuildTests.cmd +++ b/tests/EndToEndBuildTests/EndToEndBuildTests.cmd @@ -27,9 +27,9 @@ echo %__scriptpath%BasicProvider\TestBasicProvider.cmd -c %configuration% call %__scriptpath%BasicProvider\TestBasicProvider.cmd -c %configuration% if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -rem echo %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% -rem call %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% -rem if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure +echo %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% +call %__scriptpath%ComboProvider\TestComboProvider.cmd -c %configuration% +if ERRORLEVEL 1 echo Error: TestComboProvider failed && goto :failure :success endlocal From a58a47ea6e1b5bc4d61d46a0745f77b454a3f397 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+ijklam@users.noreply.github.com> Date: Mon, 17 Mar 2025 20:37:53 +0800 Subject: [PATCH 015/134] Fix delegate with option parameter (#18385) * fix delegate with option parameter * release note * typo * fix struct optional parameter * fix test * fix test --------- Co-authored-by: ijklam <43789618+Tangent-90@users.noreply.github.com> Co-authored-by: Petr --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/CheckDeclarations.fs | 15 ++++++++++++- src/Compiler/Checking/CheckPatterns.fs | 8 ------- .../Checking/Expressions/CheckExpressions.fs | 4 ++-- .../Expressions/CheckExpressionsOps.fs | 9 ++++++++ .../DelegateTypes/DelegateDefinition.fs | 22 +++++++++++++++++++ 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 12f4074a4a0..73c5e1d47de 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -16,6 +16,7 @@ * Fix "type inference problem too complicated" for SRTP with T:null and T:struct dummy constraint([Issue #18288](https://github.com/dotnet/fsharp/issues/18288), [PR #18345](https://github.com/dotnet/fsharp/pull/18345)) * Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) * Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) +* Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 8422bd40833..78acf62bb98 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -3697,7 +3697,20 @@ module EstablishTypeDefinitionCores = if curriedArgInfos.Length < 1 then error(Error(FSComp.SR.tcInvalidDelegateSpecification(), m)) if curriedArgInfos.Length > 1 then error(Error(FSComp.SR.tcDelegatesCannotBeCurried(), m)) let ttps = thisTyconRef.Typars m - let fparams = curriedArgInfos.Head |> List.map MakeSlotParam + let fparams = + curriedArgInfos.Head + |> List.map (fun (ty, argInfo: ArgReprInfo) -> + let ty = + if HasFSharpAttribute g g.attrib_OptionalArgumentAttribute argInfo.Attribs then + match TryFindFSharpAttribute g g.attrib_StructAttribute argInfo.Attribs with + | Some (Attrib(range=m)) -> + checkLanguageFeatureAndRecover g.langVersion LanguageFeature.SupportValueOptionsAsOptionalParameters m + mkValueOptionTy g ty + | _ -> + mkOptionTy g ty + else ty + + MakeSlotParam(ty, argInfo)) TFSharpDelegate (MakeSlotSig("Invoke", thisTy, ttps, [], [fparams], returnTy)) | _ -> error(InternalError("should have inferred tycon kind", m)) diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index cdffd9acb7f..9587c3b5e9f 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -58,14 +58,6 @@ let UnifyRefTupleType contextInfo (cenv: cenv) denv m ty ps = AddCxTypeEqualsType contextInfo denv cenv.css m ty (TType_tuple (tupInfoRef, ptys)) ptys -let inline mkOptionalParamTyBasedOnAttribute (g: TcGlobals) tyarg attribs = - if g.langVersion.SupportsFeature(LanguageFeature.SupportValueOptionsAsOptionalParameters) - && findSynAttribute "StructAttribute" attribs - then - mkValueOptionTy g tyarg - else - mkOptionTy g tyarg - let rec TryAdjustHiddenVarNameToCompGenName (cenv: cenv) env (id: Ident) altNameRefCellOpt = match altNameRefCellOpt with | Some ({contents = SynSimplePatAlternativeIdInfo.Undecided altId } as altNameRefCell) -> diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 9dba2586e0f..f1e6960cc21 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -4307,8 +4307,8 @@ and TcValSpec (cenv: cenv) env declKind newOk containerInfo memFlagsOpt thisTyOp ((List.mapSquared fst curriedArgTys), valSynInfo.CurriedArgInfos) ||> List.map2 (fun argTys argInfos -> (argTys, argInfos) - ||> List.map2 (fun argTy argInfo -> - if SynInfo.IsOptionalArg argInfo then mkOptionTy g argTy + ||> List.map2 (fun argTy (SynArgInfo(attribs, _, _) as argInfo) -> + if SynInfo.IsOptionalArg argInfo then mkOptionalParamTyBasedOnAttribute g argTy attribs else argTy)) mkIteratedFunTy g (List.map (mkRefTupledTy g) curriedArgTys) returnTy else tyR diff --git a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs index 4b9de82d758..7f5ff2f9f64 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs @@ -384,3 +384,12 @@ let compileSeqExprMatchClauses (cenv: TcFileState) env inputExprMark (pat: Patte bindPatTy genInnerTy tclauses + +let inline mkOptionalParamTyBasedOnAttribute (g: TcGlobals.TcGlobals) tyarg attribs = + if + g.langVersion.SupportsFeature(LanguageFeature.SupportValueOptionsAsOptionalParameters) + && findSynAttribute "StructAttribute" attribs + then + mkValueOptionTy g tyarg + else + mkOptionTy g tyarg diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs index b14bc83ce3f..1f4462fa6d3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/DelegateTypes/DelegateDefinition.fs @@ -46,3 +46,25 @@ namespace FSharpTest """ |> compile |> shouldSucceed + + [] + let ``Delegate with optional parameter`` () = + FSharp """open System.Runtime.CompilerServices +type A = delegate of [] ?a: int -> unit +let f = fun (a: int option) -> defaultArg a 100 |> printf "line: %d" +let a = A f +a.Invoke()""" + |> compileExeAndRun + |> shouldSucceed + |> verifyOutput "line: 5" + + [] + let ``Delegate with struct optional parameter`` () = + FSharp """type A = delegate of [] ?a: int -> unit +let f = fun (a: int voption) -> defaultValueArg a 100 |> printf "line: %d" +let a = A f +a.Invoke(5)""" + |> withLangVersionPreview + |> compileExeAndRun + |> shouldSucceed + |> verifyOutput "line: 5" From d382d4a98e588a0bf78ebef7b2a4137c03bea0df Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 13:55:01 +0000 Subject: [PATCH 016/134] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250313.3 (#18383) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25081.6 -> To Version 9.0.0-alpha.1.25163.3 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Petr --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 983446e2b7b..dbfa9448bcc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 1cec3b4a8fb07138136a1ca1e04763bfcf7841db + 27dfbb8d8a0344d845948109a5a1f0d9c7f17fa9 From d43a46b42fc80266283ca90e4f51812ab8b1d800 Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Mon, 17 Mar 2025 15:22:35 +0100 Subject: [PATCH 017/134] Fix duplicate parse errors for GetBackgroundCheckResultsForFileInProject (#18380) * fix duplicate parse errors for GetBackgroundCheckResultsForFileInProject * added release notes --------- Co-authored-by: Petr --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Service/BackgroundCompiler.fs | 2 +- .../ExprTests.fs | 20 ++++++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 73c5e1d47de..dcaad6579a9 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -16,6 +16,7 @@ * Fix "type inference problem too complicated" for SRTP with T:null and T:struct dummy constraint([Issue #18288](https://github.com/dotnet/fsharp/issues/18288), [PR #18345](https://github.com/dotnet/fsharp/pull/18345)) * Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) * Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) +* Fix duplicate parse error reporting for GetBackgroundCheckResultsForFileInProject ([Issue #18379](https://github.com/dotnet/fsharp/issues/18379) [PR #18380](https://github.com/dotnet/fsharp/pull/18380)) * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) ### Added diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index a55aaa490be..329fd21c63d 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -1071,7 +1071,7 @@ type internal BackgroundCompiler Some options, Array.ofList tcDependencyFiles, creationDiags, - parseResults.Diagnostics, + [||], tcDiagnostics, keepAssemblyContents, Option.get latestCcuSigForFile, diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index 465aac7c4d5..71de89dfd42 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -3526,19 +3526,29 @@ let ``Test NoWarn HashDirective`` () = wholeProjectResults.Diagnostics.Length |> shouldEqual 0 -module internal SourceForTrcParseErrors = - - let fileSource1 = """ +let private sourceForParseError = """ module N.M #nowarn 0xy () """ [] -let ``TrcParseErrors`` () = - let options = createProjectOptions [SourceForTrcParseErrors.fileSource1] [] +let ``RegressionTestForMissingParseError(TransparentCompiler)`` () = + let options = createProjectOptions [sourceForParseError] [] let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate wholeProjectResults.Diagnostics.Length |> shouldEqual 1 wholeProjectResults.Diagnostics.[0].ErrorNumber |> shouldEqual 1156 wholeProjectResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 + +[] +let ``RegressionTestForDuplicateParseError(BackgroundCompiler)`` () = + let options = createProjectOptions [sourceForParseError] [] + let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let sourceName = options.SourceFiles[0] + let _wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate + let _, checkResults = exprChecker.GetBackgroundCheckResultsForFileInProject(sourceName, options) |> Async.RunImmediate + checkResults.Diagnostics.Length |> shouldEqual 1 + checkResults.Diagnostics.[0].ErrorNumber |> shouldEqual 1156 + checkResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 + From 4dc458c6c78d5f784c3b85d91c24fa2c4e26b824 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 14:24:54 +0000 Subject: [PATCH 018/134] [main] Update dependencies from dotnet/msbuild (#18363) * Update dependencies from https://github.com/dotnet/msbuild build 20250306.7 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.14.0-preview-25156-07 * Update other deps * Update Versions.props * up * Update SourceBuildPrebuiltBaseline.xml * Update dependencies from https://github.com/dotnet/msbuild build 20250307.7 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.14.0-preview-25157-07 * Update Version.Details.xml * Update dependencies from https://github.com/dotnet/msbuild build 20250310.8 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.14.0-preview-25160-08 * Update dependencies from https://github.com/dotnet/msbuild build 20250311.14 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.14.0-preview-25161-14 * Update dependencies from https://github.com/dotnet/msbuild build 20250228.1 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.13.19-preview-25128-01 * Update * up * Update dependencies from https://github.com/dotnet/msbuild build 20250312.14 Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.11.0-preview-24178-03 -> To Version 17.13.20-preview-25162-14 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Petr --- NuGet.config | 5 +++++ eng/SourceBuildPrebuiltBaseline.xml | 4 ---- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/NuGet.config b/NuGet.config index e348c8b6abe..d30d1402844 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,6 +6,11 @@ + + + + + diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml index cc63b5594e3..a3c0b4e6619 100644 --- a/eng/SourceBuildPrebuiltBaseline.xml +++ b/eng/SourceBuildPrebuiltBaseline.xml @@ -28,10 +28,6 @@ - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dbfa9448bcc..c8052b4f6ff 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - 2d02daa886f279e2ee749cad03db4b1b75bb9adb + a4ef1e90fef9b56473708b7d308f982c7c9f46d9 - + https://github.com/dotnet/msbuild - 2d02daa886f279e2ee749cad03db4b1b75bb9adb + a4ef1e90fef9b56473708b7d308f982c7c9f46d9 - + https://github.com/dotnet/msbuild - 2d02daa886f279e2ee749cad03db4b1b75bb9adb + a4ef1e90fef9b56473708b7d308f982c7c9f46d9 - + https://github.com/dotnet/msbuild - 2d02daa886f279e2ee749cad03db4b1b75bb9adb + a4ef1e90fef9b56473708b7d308f982c7c9f46d9 - + https://github.com/dotnet/msbuild - 2d02daa886f279e2ee749cad03db4b1b75bb9adb + a4ef1e90fef9b56473708b7d308f982c7c9f46d9 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 97afcbb5f76..f4b5ae88140 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -94,7 +94,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.12.6 + 17.13.20 $(RoslynVersion) $(RoslynVersion) @@ -130,9 +130,9 @@ 15.0.25123-Dev15Preview - $(MicrosoftBuildVersion) - $(MicrosoftBuildVersion) - $(MicrosoftBuildVersion) + 17.13.20 + 17.13.20 + 17.13.20 $(VisualStudioEditorPackagesVersion) From 977c757b258c37bee002895078858e118af39803 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:59:08 +0100 Subject: [PATCH 019/134] xUnit tests - improve assembly fixture (#18381) * xUnit - move custom initialization from test framework constructor to executor * Update tests/FSharp.Test.Utilities/XunitHelpers.fs Co-authored-by: Tomas Grosup --------- Co-authored-by: Petr Co-authored-by: Tomas Grosup --- tests/FSharp.Test.Utilities/XunitHelpers.fs | 91 +++++++++------------ 1 file changed, 39 insertions(+), 52 deletions(-) diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index ac23217c1ed..cf7ecf3b2cf 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -21,29 +21,7 @@ open OpenTelemetry.Trace [] type RunTestCasesInSequenceAttribute() = inherit Attribute() -#if !XUNIT_EXTRAS -/// Installs console support for parallel test runs and conditionally enables optional xUnit customizations. -type FSharpXunitFramework(sink: IMessageSink) = - inherit XunitTestFramework(sink) - do - // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called - // right at the start of the test run is here in the constructor. - // This gets executed once per test assembly. - logConfig initialConfig - log "FSharpXunitFramework installing TestConsole redirection" - TestConsole.install() -#if !NETCOREAPP - AssemblyResolver.addResolver () -#endif - - interface IDisposable with - member _.Dispose() = - match Environment.GetEnvironmentVariable("FSHARP_RETAIN_TESTBUILDS") with - | null -> cleanUpTemporaryDirectoryOfThisTestRun () - | _ -> () - base.Dispose() - -#else +#if XUNIT_EXTRAS // To use xUnit means to customize it. The following abomination adds 2 features: // - Capturing full console output individually for each test case, viewable in Test Explorer as test stdout. @@ -57,7 +35,7 @@ type ConsoleCapturingTestRunner(test, messageBus, testClass, constructorArgument override this.InvokeTestAsync (aggregator: ExceptionAggregator) = task { use capture = new TestConsole.ExecutionCapture() - use _ = Activity.start test.DisplayName [ ] + use _ = Activity.startNoTags test.DisplayName let! executionTime = this.BaseInvokeTestMethodAsync aggregator let output = seq { @@ -142,46 +120,55 @@ type CustomTheoryTestCase = base.Initialize() testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase +#endif + /// `XunitTestFramework` providing parallel console support and conditionally enabling optional xUnit customizations. type FSharpXunitFramework(sink: IMessageSink) = inherit XunitTestFramework(sink) - - let traceProvider = - Sdk.CreateTracerProviderBuilder() - .AddSource(ActivityNames.FscSourceName) - .SetResourceBuilder( - ResourceBuilder.CreateDefault().AddService(serviceName="F#", serviceVersion = "1.0.0")) - .AddOtlpExporter() - .Build() - - interface IDisposable with - member _.Dispose() = - cleanUpTemporaryDirectoryOfThisTestRun () - traceProvider.ForceFlush() |> ignore - traceProvider.Dispose() - base.Dispose() - // Group test run under single activity, to make traces more readable. - // Otherwise this overriden method is not necessary and can be removed. - override this.CreateExecutor (assemblyName) = + override this.CreateExecutor (assemblyName) = { new XunitTestFrameworkExecutor(assemblyName, this.SourceInformationProvider, this.DiagnosticMessageSink) with - override _.RunTestCases(testCases, executionMessageSink, executionOptions) = - use _ = Activity.start $"{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" [] + + // Because xUnit v2 lacks assembly fixture, this is a good place to ensure things get called right at the start of the test run. + // This gets executed once per test assembly. + override x.RunTestCases(testCases, executionMessageSink, executionOptions) = + + #if !NETCOREAPP + // We need AssemblyResolver already here, because OpenTelemetry loads some assemblies dynamically. + AssemblyResolver.addResolver () + #endif + + // Configure OpenTelemetry export. Traces can be viewed in Jaeger or other compatible tools. + use tracerProvider = + OpenTelemetry.Sdk.CreateTracerProviderBuilder() + .AddSource(ActivityNames.FscSourceName) + .ConfigureResource(fun r -> r.AddService("F#") |> ignore) + .AddOtlpExporter(fun o -> + // Empirical values to ensure no traces are lost and no significant delay at the end of test run. + o.TimeoutMilliseconds <- 200 + o.BatchExportProcessorOptions.MaxQueueSize <- 16384 + o.BatchExportProcessorOptions.ScheduledDelayMilliseconds <- 100 + ) + .Build() - // Because xUnit v2 lacks assembly fixture, the next best place to ensure things get called - // right at the start of the test run is here or in the FSharpXunitFramework constructor. - // This gets executed once per test assembly. - printfn $"Running tests in {assemblyName.Name} with XUNIT_EXTRAS" logConfig initialConfig log "Installing TestConsole redirection" TestConsole.install() + + begin + use _ = Activity.startNoTags $"RunTests_{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" + // We can't just call base.RunTestCases here, because it's implementation is async void. + use runner = new XunitTestAssemblyRunner (x.TestAssembly, testCases, x.DiagnosticMessageSink, executionMessageSink, executionOptions) + runner.RunAsync().Wait() + end -#if !NETCOREAPP - AssemblyResolver.addResolver () -#endif - base.RunTestCases(testCases, executionMessageSink, executionOptions) + tracerProvider.ForceFlush() |> ignore + + cleanUpTemporaryDirectoryOfThisTestRun () } +#if XUNIT_EXTRAS + // Rewrites discovered test cases to support extra parallelization and capturing console as test output. override this.CreateDiscoverer (assemblyInfo) = { new XunitTestFrameworkDiscoverer(assemblyInfo, this.SourceInformationProvider, this.DiagnosticMessageSink) with override _.FindTestsForType (testClass, includeSourceInformation, messageBus, options) = From 5dd06998a29f9778bf71290fde79bef88e2223f3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:03:57 +0100 Subject: [PATCH 020/134] [main] Update dependencies from dotnet/arcade (#18378) * Update dependencies from https://github.com/dotnet/arcade build 20250311.4 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25111.5 -> To Version 9.0.0-beta.25161.4 * Update dependencies from https://github.com/dotnet/arcade build 20250314.2 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25111.5 -> To Version 9.0.0-beta.25164.2 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Petr --- eng/Version.Details.xml | 8 ++++---- .../core-templates/steps/generate-sbom.yml | 2 +- eng/common/generate-sbom-prep.ps1 | 20 +++++++++++++------ eng/common/generate-sbom-prep.sh | 17 ++++++++++------ eng/common/templates-official/job/job.yml | 1 + eng/common/tools.ps1 | 4 ++-- eng/common/tools.sh | 4 ++-- global.json | 2 +- 8 files changed, 36 insertions(+), 22 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c8052b4f6ff..d01cf73cceb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - 5da211e1c42254cb35e7ef3d5a8428fb24853169 + 5ba9ca776c1d0bb72b2791591e54cf51fc52dfee - + https://github.com/dotnet/arcade - 5da211e1c42254cb35e7ef3d5a8428fb24853169 + 5ba9ca776c1d0bb72b2791591e54cf51fc52dfee diff --git a/eng/common/core-templates/steps/generate-sbom.yml b/eng/common/core-templates/steps/generate-sbom.yml index d938b60e1bb..56a09009482 100644 --- a/eng/common/core-templates/steps/generate-sbom.yml +++ b/eng/common/core-templates/steps/generate-sbom.yml @@ -38,7 +38,7 @@ steps: PackageName: ${{ parameters.packageName }} BuildDropPath: ${{ parameters.buildDropPath }} PackageVersion: ${{ parameters.packageVersion }} - ManifestDirPath: ${{ parameters.manifestDirPath }} + ManifestDirPath: ${{ parameters.manifestDirPath }}/$(ARTIFACT_NAME) ${{ if ne(parameters.IgnoreDirectories, '') }}: AdditionalComponentDetectorArgs: '--IgnoreDirectories ${{ parameters.IgnoreDirectories }}' diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 index 3e5c1c74a1c..a0c7d792a76 100644 --- a/eng/common/generate-sbom-prep.ps1 +++ b/eng/common/generate-sbom-prep.ps1 @@ -4,18 +4,26 @@ Param( . $PSScriptRoot\pipeline-logging-functions.ps1 +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" +$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' +$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName + +Write-Host "Artifact name before : $ArtifactName" +Write-Host "Artifact name after : $SafeArtifactName" + Write-Host "Creating dir $ManifestDirPath" + # create directory for sbom manifest to be placed -if (!(Test-Path -path $ManifestDirPath)) +if (!(Test-Path -path $SbomGenerationDir)) { - New-Item -ItemType Directory -path $ManifestDirPath - Write-Host "Successfully created directory $ManifestDirPath" + New-Item -ItemType Directory -path $SbomGenerationDir + Write-Host "Successfully created directory $SbomGenerationDir" } else{ Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." } Write-Host "Updating artifact name" -$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_' -Write-Host "Artifact name $artifact_name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh index d5c76dc827b..b8ecca72bbf 100755 --- a/eng/common/generate-sbom-prep.sh +++ b/eng/common/generate-sbom-prep.sh @@ -14,19 +14,24 @@ done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" . $scriptroot/pipeline-logging-functions.sh + +# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. +artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" +safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" manifest_dir=$1 -if [ ! -d "$manifest_dir" ] ; then - mkdir -p "$manifest_dir" - echo "Sbom directory created." $manifest_dir +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +sbom_generation_dir="$manifest_dir/$safe_artifact_name" + +if [ ! -d "$sbom_generation_dir" ] ; then + mkdir -p "$sbom_generation_dir" + echo "Sbom directory created." $sbom_generation_dir else Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." fi -artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" echo "Artifact name before : "$artifact_name -# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. -safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" echo "Artifact name after : "$safe_artifact_name export ARTIFACT_NAME=$safe_artifact_name echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 605692d2fb7..817555505aa 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -16,6 +16,7 @@ jobs: parameters: PackageVersion: ${{ parameters.packageVersion }} BuildDropPath: ${{ parameters.buildDropPath }} + ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom publishArtifacts: false # publish artifacts diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index a46b6deb759..22b49e09d09 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -42,7 +42,7 @@ [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1 [string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' } # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -262,7 +262,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot $ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit - $uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" + $uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1" Retry({ Write-Host "GET $uri" diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 1159726a10f..01b09b65796 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true} use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} # Enable repos to use a particular version of the on-line dotnet-install scripts. -# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh +# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. @@ -295,7 +295,7 @@ function with_retries { function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" - local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" + local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh" if [[ ! -a "$install_script" ]]; then mkdir -p "$root" diff --git a/global.json b/global.json index c4d9f0a9ee5..3883eb9db41 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25111.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From 27aa9be1d50c1cf7f7d5afc6371c57a3c32f37a8 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+ijklam@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:08:31 +0800 Subject: [PATCH 021/134] Adjust caller info attribute error message range (#18388) * improve caller info attribute error message range * release note --------- Co-authored-by: ijklam <43789618+Tangent-90@users.noreply.github.com> Co-authored-by: Petr --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/PostInferenceChecks.fs | 31 +++++++++++-------- .../Imported/CallerInfo/E_CallerFilePath.fs | 6 ++-- .../Imported/CallerInfo/E_CallerLineNumber.fs | 6 ++-- .../Imported/CallerInfo/E_CallerMemberName.fs | 6 ++-- .../Imported/CallerInfo/E_MultipleAttrs.fs | 8 ++--- 6 files changed, 32 insertions(+), 26 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index dcaad6579a9..26346c6b264 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -35,6 +35,7 @@ * Added nullability annotations to `.Using` builder method for `async`, `task` and compiler-internal builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) * Warning for "useless null handling" works with piped syntax constructs now ([PR #18331](https://github.com/dotnet/fsharp/pull/18331)) +* Adjust caller info attribute error message range ([PR #18388](https://github.com/dotnet/fsharp/pull/18388)) ### Breaking Changes * Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877)) diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 3a4fe0e65ed..4df0185a2e5 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2398,9 +2398,23 @@ let CheckEntityDefn cenv env (tycon: Entity) = errorR(Error(FSComp.SR.chkCurriedMethodsCantHaveOutParams(), m)) if numCurriedArgSets = 1 then + let errorIfNotStringTy m ty callerInfo = + if not (typeEquiv g g.string_ty ty) then + errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m)) + + let errorIfNotStringOptionTy m ty callerInfo = + if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then + errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) + minfo.GetParamDatas(cenv.amap, m, minfo.FormalMethodInst) - |> List.iterSquared (fun (ParamData(_, isInArg, _, optArgInfo, callerInfo, _, _, ty)) -> + |> List.iterSquared (fun (ParamData(_, isInArg, _, optArgInfo, callerInfo, nameOpt, _, ty)) -> ignore isInArg + + let m = + match nameOpt with + | Some name -> name.idRange + | None -> m + match (optArgInfo, callerInfo) with | _, NoCallerInfo -> () | NotOptional, _ -> errorR(Error(FSComp.SR.tcCallerInfoNotOptional(callerInfo |> string), m)) @@ -2410,18 +2424,9 @@ let CheckEntityDefn cenv env (tycon: Entity) = | CalleeSide, CallerLineNumber -> if not ((isOptionTy g ty) && (typeEquiv g g.int32_ty (destOptionTy g ty))) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "int", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) - | CallerSide _, CallerFilePath -> - if not (typeEquiv g g.string_ty ty) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m)) - | CalleeSide, CallerFilePath -> - if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) - | CallerSide _, CallerMemberName -> - if not (typeEquiv g g.string_ty ty) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m)) - | CalleeSide, CallerMemberName -> - if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m))) + | CallerSide _, (CallerFilePath | CallerMemberName) -> errorIfNotStringTy m ty callerInfo + | CalleeSide, (CallerFilePath | CallerMemberName) -> errorIfNotStringOptionTy m ty callerInfo + ) for pinfo in immediateProps do let nm = pinfo.PropertyName diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerFilePath.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerFilePath.fs index d6e160d39af..05277194dae 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerFilePath.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerFilePath.fs @@ -1,6 +1,6 @@ -//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' -//'CallerFilePath' can only be applied to optional arguments -//'CallerFilePath' can only be applied to optional arguments +//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' +//'CallerFilePath' can only be applied to optional arguments +//'CallerFilePath' can only be applied to optional arguments namespace Test open System.Runtime.CompilerServices diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerLineNumber.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerLineNumber.fs index 1d66da69961..0ea6504f070 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerLineNumber.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerLineNumber.fs @@ -1,6 +1,6 @@ -//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' -//'CallerLineNumber' can only be applied to optional arguments -//'CallerLineNumber' can only be applied to optional arguments +//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' +//'CallerLineNumber' can only be applied to optional arguments +//'CallerLineNumber' can only be applied to optional arguments namespace Test open System.Runtime.CompilerServices diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerMemberName.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerMemberName.fs index 9749e1e1508..c25f4bbd229 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerMemberName.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_CallerMemberName.fs @@ -1,6 +1,6 @@ -//'CallerMemberName' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' -//'CallerMemberName' can only be applied to optional arguments -//'CallerMemberName' can only be applied to optional arguments +//'CallerMemberName' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' +//'CallerMemberName' can only be applied to optional arguments +//'CallerMemberName' can only be applied to optional arguments namespace Test open System.Runtime.CompilerServices diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_MultipleAttrs.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_MultipleAttrs.fs index fda49ca239f..96bd7ee575f 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_MultipleAttrs.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/E_MultipleAttrs.fs @@ -1,7 +1,7 @@ -//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' -//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' -//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' -//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' +//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' +//'CallerFilePath' must be applied to an argument of type 'string', but has been applied to an argument of type 'int' +//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' +//'CallerLineNumber' must be applied to an argument of type 'int', but has been applied to an argument of type 'string' namespace Test From f0074055e6532127d46bf0953d55062f1ff6bff7 Mon Sep 17 00:00:00 2001 From: ijklam <43789618+ijklam@users.noreply.github.com> Date: Tue, 18 Mar 2025 02:38:11 +0800 Subject: [PATCH 022/134] More improve completion after method/property override (#18341) --- .../.FSharp.Compiler.Service/9.0.300.md | 3 + docs/release-notes/.VisualStudio/17.14.md | 9 + src/Compiler/Service/FSharpCheckerResults.fs | 110 +++++++++--- src/Compiler/Service/FSharpCheckerResults.fsi | 12 +- src/Compiler/Service/ServiceParsedInputOps.fs | 28 +-- .../Service/ServiceParsedInputOps.fsi | 3 +- ...vice.SurfaceArea.netstandard20.release.bsl | 27 +-- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 4 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 4 +- .../Completion/CompletionProvider.fs | 16 +- .../FSharp.Editor/Options/EditorOptions.fs | 2 + .../IntelliSenseOptionControl.xaml | 53 +++--- .../FSharp.UIResources/Strings.Designer.cs | 163 +++++++++--------- .../src/FSharp.UIResources/Strings.resx | 3 + .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.de.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.es.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.it.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 5 + .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 5 + .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 5 + .../xlf/Strings.zh-Hans.xlf | 5 + .../xlf/Strings.zh-Hant.xlf | 5 + .../CompletionProviderTests.fs | 85 ++++++++- .../FsxCompletionProviderTests.fs | 2 +- 31 files changed, 429 insertions(+), 164 deletions(-) create mode 100644 docs/release-notes/.VisualStudio/17.14.md diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 26346c6b264..5f722b11a12 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -26,6 +26,8 @@ * Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186)) * Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290)) * Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323)) +* Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) + ### Changed @@ -35,6 +37,7 @@ * Added nullability annotations to `.Using` builder method for `async`, `task` and compiler-internal builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) * Warning for "useless null handling" works with piped syntax constructs now ([PR #18331](https://github.com/dotnet/fsharp/pull/18331)) +* Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341)) * Adjust caller info attribute error message range ([PR #18388](https://github.com/dotnet/fsharp/pull/18388)) ### Breaking Changes diff --git a/docs/release-notes/.VisualStudio/17.14.md b/docs/release-notes/.VisualStudio/17.14.md new file mode 100644 index 00000000000..db5d628bb0c --- /dev/null +++ b/docs/release-notes/.VisualStudio/17.14.md @@ -0,0 +1,9 @@ +### Fixed + +### Added +* Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) + +### Changed +* Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341)) + +### Breaking Changes diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 771ab536ff8..8cb27875075 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -1063,7 +1063,7 @@ type internal TypeCheckInfo |> Option.defaultValue completions /// Gets all methods that a type can override, but has not yet done so. - let GetOverridableMethods pos ctx (typeNameRange: range) spacesBeforeOverrideKeyword hasThis isStatic = + let GetOverridableMethods pos ctx (typeNameRange: range) newlineIndentCount hasThis isStatic genBodyForOverriddenMeth = let checkImplementedSlotDeclareType ty slots = slots |> Option.map (List.exists (fun (TSlotSig(declaringType = ty2)) -> typeEquiv g ty ty2)) @@ -1111,8 +1111,11 @@ type internal TypeCheckInfo let (nenv, ad), m = GetBestEnvForPos pos let denv = nenv.DisplayEnv + /// Check if the method is abstract, return "raise (NotImplementedException())" if it is abstract, otherwise return the given body let checkMethAbstractAndGetImplementBody (meth: MethInfo) implementBody = - if meth.IsAbstract then + if not genBodyForOverriddenMeth then + String.Empty + elif meth.IsAbstract then if nenv.DisplayEnv.openTopPathsSorted.Force() |> List.contains [ "System" ] then "raise (NotImplementedException())" else @@ -1120,8 +1123,8 @@ type internal TypeCheckInfo else implementBody - let newlineIndent = - Environment.NewLine + String.make (spacesBeforeOverrideKeyword + 4) ' ' + let newlineIndentCount = max 1 newlineIndentCount + let newlineIndent = Environment.NewLine + String.make newlineIndentCount ' ' let getOverridableMethods superTy (overriddenMethods: MethInfo list) overriddenProperties = // Do not check a method with same name twice @@ -1197,12 +1200,6 @@ type internal TypeCheckInfo let this = if hasThis || prop.IsStatic then String.Empty else "this." - let getterWithBody = - if String.IsNullOrWhiteSpace getterWithBody then - String.Empty - else - getterWithBody + newlineIndent - let name = $"{prop.DisplayName} with {getter}{keywordAnd}{setter}" let textInCode = @@ -1211,6 +1208,10 @@ type internal TypeCheckInfo + newlineIndent + "with " + getterWithBody + + (if String.IsNullOrEmpty keywordAnd then + String.Empty + else + newlineIndent) + keywordAnd + setterWithBody @@ -1721,7 +1722,8 @@ type internal TypeCheckInfo filterCtors, resolveOverloads, completionContextAtPos: (pos * CompletionContext option) option, - getAllSymbols: unit -> AssemblySymbol list + getAllSymbols: unit -> AssemblySymbol list, + genBodyForOverriddenMeth ) : (CompletionItem list * DisplayEnv * CompletionContext option * range) option = let loc = @@ -1957,8 +1959,22 @@ type internal TypeCheckInfo getDeclaredItemsNotInRangeOpWithAllSymbols () |> Option.bind (FilterRelevantItemsBy getItem2 None IsPatternCandidate) - | Some(CompletionContext.MethodOverride(ctx, enclosingTypeNameRange, spacesBeforeOverrideKeyword, hasThis, isStatic)) -> - GetOverridableMethods pos ctx enclosingTypeNameRange spacesBeforeOverrideKeyword hasThis isStatic + | Some(CompletionContext.MethodOverride(ctx, + enclosingTypeNameRange, + spacesBeforeOverrideKeyword, + hasThis, + isStatic, + spacesBeforeEnclosingDefinition)) -> + let indent = max 1 (spacesBeforeOverrideKeyword - spacesBeforeEnclosingDefinition) + + GetOverridableMethods + pos + ctx + enclosingTypeNameRange + (spacesBeforeOverrideKeyword + indent) + hasThis + isStatic + genBodyForOverriddenMeth // Other completions | cc -> @@ -2025,7 +2041,16 @@ type internal TypeCheckInfo scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item) /// Get the auto-complete items at a location - member _.GetDeclarations(parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities) = + member _.GetDeclarations + ( + parseResultsOpt, + line, + lineStr, + partialName, + completionContextAtPos, + getAllEntities, + genBodyForOverriddenMeth + ) = let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect @@ -2044,7 +2069,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, completionContextAtPos, - getAllEntities + getAllEntities, + genBodyForOverriddenMeth ) match declItemsOpt with @@ -2085,7 +2111,7 @@ type internal TypeCheckInfo DeclarationListInfo.Error msg) /// Get the symbols for auto-complete items at a location - member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities) = + member _.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, getAllEntities, genBodyForOverriddenMeth) = let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect @@ -2104,7 +2130,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - getAllEntities + getAllEntities, + genBodyForOverriddenMeth ) match declItemsOpt with @@ -2285,7 +2312,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2347,7 +2375,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2393,7 +2422,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2434,7 +2464,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.No, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2470,7 +2501,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2618,7 +2650,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -2647,7 +2680,8 @@ type internal TypeCheckInfo ResolveTypeNamesToCtors, ResolveOverloads.Yes, None, - (fun () -> []) + (fun () -> []), + false ) match declItemsOpt with @@ -3348,20 +3382,40 @@ type FSharpCheckFileResults | Some(scope, _builderOpt) -> Some scope.TcImports /// Intellisense autocompletions - member _.GetDeclarationListInfo(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?completionContextAtPos) = + member _.GetDeclarationListInfo + ( + parsedFileResults, + line, + lineText, + partialName, + ?getAllEntities, + ?completionContextAtPos, + ?genBodyForOverriddenMeth + ) = let getAllEntities = defaultArg getAllEntities (fun () -> []) + let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth true match details with | None -> DeclarationListInfo.Empty | Some(scope, _builderOpt) -> - scope.GetDeclarations(parsedFileResults, line, lineText, partialName, completionContextAtPos, getAllEntities) + scope.GetDeclarations( + parsedFileResults, + line, + lineText, + partialName, + completionContextAtPos, + getAllEntities, + genBodyForOverriddenMeth + ) - member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities) = + member _.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, ?getAllEntities, ?genBodyForOverriddenMeth) = let getAllEntities = defaultArg getAllEntities (fun () -> []) + let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth true match details with | None -> [] - | Some(scope, _builderOpt) -> scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities) + | Some(scope, _builderOpt) -> + scope.GetDeclarationListSymbols(parsedFileResults, line, lineText, partialName, getAllEntities, genBodyForOverriddenMeth) member _.GetKeywordTooltip(names: string list) = ToolTipText.ToolTipText diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 607232f3c92..cbc5ecc5f1b 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -290,13 +290,17 @@ type public FSharpCheckFileResults = /// /// Completion context for a particular position computed in advance. /// + /// + /// A switch to determine whether to generate a default implementation body for overridden method when completing. + /// member GetDeclarationListInfo: parsedFileResults: FSharpParseFileResults option * line: int * lineText: string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * - ?completionContextAtPos: (pos * CompletionContext option) -> + ?completionContextAtPos: (pos * CompletionContext option) * + ?genBodyForOverriddenMeth: bool -> DeclarationListInfo /// Get the items for a declaration list in FSharpSymbol format @@ -317,12 +321,16 @@ type public FSharpCheckFileResults = /// /// Function that returns all entities from current and referenced assemblies. /// + /// + /// A switch to determine whether to generate a default implementation body for overridden method when completing. + /// member GetDeclarationListSymbols: parsedFileResults: FSharpParseFileResults option * line: int * lineText: string * partialName: PartialLongName * - ?getAllEntities: (unit -> AssemblySymbol list) -> + ?getAllEntities: (unit -> AssemblySymbol list) * + ?genBodyForOverriddenMeth: bool -> FSharpSymbolUse list list /// Compute a formatted tooltip for the given keywords diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 2ed457116b6..374f648947a 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -118,7 +118,8 @@ type CompletionContext = enclosingTypeNameRange: range * spacesBeforeOverrideKeyword: int * hasThis: bool * - isStatic: bool + isStatic: bool * + spacesBeforeEnclosingDefinition: int type ShortIdent = string @@ -1543,7 +1544,8 @@ module ParsedInput = let overrideContext path (mOverride: range) hasThis isStatic isMember = match path with - | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn(typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ when + | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn( + typeInfo = SynComponentInfo(longId = [ enclosingType ]); trivia = { LeadingKeyword = keyword })) :: _ when not isMember -> Some( @@ -1552,12 +1554,13 @@ module ParsedInput = enclosingType.idRange, mOverride.StartColumn, hasThis, - isStatic + isStatic, + keyword.Range.StartColumn ) ) - | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: SyntaxNode.SynTypeDefn(SynTypeDefn( + | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn( typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ - | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: SyntaxNode.SynTypeDefn(SynTypeDefn( + | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn( typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ -> let ty = match ty with @@ -1570,11 +1573,12 @@ module ParsedInput = enclosingType.idRange, mOverride.StartColumn, hasThis, - isStatic + isStatic, + enclosingDefn.Range.StartColumn ) ) - | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ - | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty)) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ -> + | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ + | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: (SyntaxNode.SynExpr(SynExpr.ObjExpr _) as expr) :: _ -> let ty = match ty with | SynType.App(typeName = ty) -> ty @@ -1586,10 +1590,11 @@ module ParsedInput = ty.Range, mOverride.StartColumn, hasThis, - isStatic + isStatic, + enclosingDefn.Range.StartColumn ) ) - | SyntaxNode.SynExpr(SynExpr.ObjExpr(objType = ty)) as expr :: _ -> + | SyntaxNode.SynExpr(SynExpr.ObjExpr(objType = ty; newExprRange = newExprRange)) as expr :: _ -> let ty = match ty with | SynType.App(typeName = ty) -> ty @@ -1601,7 +1606,8 @@ module ParsedInput = ty.Range, mOverride.StartColumn, hasThis, - isStatic + isStatic, + newExprRange.StartColumn ) ) | _ -> Some CompletionContext.Invalid diff --git a/src/Compiler/Service/ServiceParsedInputOps.fsi b/src/Compiler/Service/ServiceParsedInputOps.fsi index 427ffda43aa..d99277893d4 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fsi +++ b/src/Compiler/Service/ServiceParsedInputOps.fsi @@ -90,7 +90,8 @@ type public CompletionContext = enclosingTypeNameRange: range * spacesBeforeOverrideKeyword: int * hasThis: bool * - isStatic: bool + isStatic: bool * + spacesBeforeEnclosingDefinition: int type public ModuleKind = { IsAutoOpen: bool diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index fabaa710607..8e92f93f0e1 100755 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2066,7 +2066,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysi FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysis.FSharpSymbolUse[] GetUsesOfSymbolInFile(FSharp.Compiler.Symbols.FSharpSymbol, Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] Diagnostics FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] get_Diagnostics() -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]]) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.FindDeclResult GetDeclarationLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.MethodGroup GetMethods(Int32, Int32, System.String, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.SemanticClassificationItem[] GetSemanticClassification(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) @@ -2079,7 +2079,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSh FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSharpOpenDeclaration[] get_OpenDeclarations() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Text.Range[] GetFormatSpecifierLocations() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUsesAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]]) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUseAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile @@ -2830,12 +2830,20 @@ FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 GetHashCod FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 Tag FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 get_Tag() FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: System.String ToString() +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType ActualType FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType get_ActualType() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField ImplementationField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField SignatureField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_ImplementationField() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_SignatureField() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext @@ -2851,22 +2859,13 @@ FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() @@ -3048,7 +3047,9 @@ FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.EditorServices.MethodOverrideCompletionContext get_ctx() FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range enclosingTypeNameRange FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range get_enclosingTypeNameRange() +FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeEnclosingDefinition() FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeOverrideKeyword() +FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeEnclosingDefinition FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeOverrideKeyword FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean get_isOpenType() FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean isOpenType @@ -3103,7 +3104,7 @@ FSharp.Compiler.EditorServices.CompletionContext: Boolean get_IsUnionCaseFieldsD FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext AttributeApplication FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext Invalid FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewInherit(FSharp.Compiler.EditorServices.InheritanceContext, System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.String],Microsoft.FSharp.Core.FSharpOption`1[System.String]]) -FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean) +FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean, Int32) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewOpenDeclaration(Boolean) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewParameterList(FSharp.Compiler.Text.Position, System.Collections.Generic.HashSet`1[System.String]) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewPattern(FSharp.Compiler.EditorServices.PatternContext) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index ad200989d8c..4af8105d488 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -23,7 +23,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index c23aae09751..b1d1c8b57d8 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -31,10 +31,10 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 853566a3c47..6a9770727aa 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -22,7 +22,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 356b98ede2b..1e77ef2af8b 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -30,10 +30,10 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2205::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1423-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index f43c53b2c0e..2c583555cb3 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -150,7 +150,8 @@ type internal FSharpCompletionProvider ( document: Document, caretPosition: int, - getAllSymbols: FSharpCheckFileResults -> AssemblySymbol array + getAllSymbols: FSharpCheckFileResults -> AssemblySymbol array, + genBodyForOverriddenMeth: bool ) = cancellableTask { @@ -189,7 +190,8 @@ type internal FSharpCompletionProvider line, partialName, getAllSymbols, - (completionContextPos, completionContext) + (completionContextPos, completionContext), + genBodyForOverriddenMeth ) let results = List() @@ -353,7 +355,15 @@ type internal FSharpCompletionProvider else Array.empty - let! results = FSharpCompletionProvider.ProvideCompletionsAsyncAux(context.Document, context.Position, getAllSymbols) + let genBodyForOverriddenMeth = settings.IntelliSense.GenerateBodyForOverriddenMethod + + let! results = + FSharpCompletionProvider.ProvideCompletionsAsyncAux( + context.Document, + context.Position, + getAllSymbols, + genBodyForOverriddenMeth + ) context.AddItems results diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index ef67e6482ba..efc068386ca 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -24,6 +24,7 @@ type IntelliSenseOptions = ShowAfterCharIsDeleted: bool IncludeSymbolsFromUnopenedNamespacesOrModules: bool EnterKeySetting: EnterKeySetting + GenerateBodyForOverriddenMethod: bool } static member Default = @@ -32,6 +33,7 @@ type IntelliSenseOptions = ShowAfterCharIsDeleted = false IncludeSymbolsFromUnopenedNamespacesOrModules = false EnterKeySetting = EnterKeySetting.NeverNewline + GenerateBodyForOverriddenMethod = true } [] diff --git a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml index dbb7b6bb8fc..ecd097b2941 100644 --- a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml @@ -1,16 +1,18 @@ - + - + @@ -19,21 +21,32 @@ - - - + + + - + + - - - + + + diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index e0244a62086..b6087aa8952 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace Microsoft.VisualStudio.FSharp.UIResources { /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// 一个强类型的资源类,用于查找本地化的字符串等。 /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Strings() { } /// - /// Returns the cached ResourceManager instance used by this class. + /// 返回此类使用的缓存的 ResourceManager 实例。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Strings() { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Strings() { } /// - /// Looks up a localized string similar to Additional performance telemetry (experimental). + /// 查找类似 Additional performance telemetry (experimental) 的本地化字符串。 /// public static string AdditionalTelemetry { get { @@ -70,7 +70,7 @@ public static string AdditionalTelemetry { } /// - /// Looks up a localized string similar to Always place open statements at the top level. + /// 查找类似 Always place open statements at the top level 的本地化字符串。 /// public static string Always_place_opens_at_top_level { get { @@ -79,7 +79,7 @@ public static string Always_place_opens_at_top_level { } /// - /// Looks up a localized string similar to Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart). + /// 查找类似 Keep analyzing the entire solution for diagnostics as a low priority background task (requires restart) 的本地化字符串。 /// public static string Analyze_full_solution_on_background { get { @@ -88,7 +88,7 @@ public static string Analyze_full_solution_on_background { } /// - /// Looks up a localized string similar to Background analysis. + /// 查找类似 Background analysis 的本地化字符串。 /// public static string Background_analysis { get { @@ -97,7 +97,7 @@ public static string Background_analysis { } /// - /// Looks up a localized string similar to Block Structure Guides. + /// 查找类似 Block Structure Guides 的本地化字符串。 /// public static string Block_Structure { get { @@ -106,7 +106,7 @@ public static string Block_Structure { } /// - /// Looks up a localized string similar to Code Fixes. + /// 查找类似 Code Fixes 的本地化字符串。 /// public static string Code_Fixes { get { @@ -115,7 +115,7 @@ public static string Code_Fixes { } /// - /// Looks up a localized string similar to Completion Lists. + /// 查找类似 Completion Lists 的本地化字符串。 /// public static string Completion_Lists { get { @@ -124,7 +124,7 @@ public static string Completion_Lists { } /// - /// Looks up a localized string similar to D_ash underline. + /// 查找类似 D_ash underline 的本地化字符串。 /// public static string Dash_underline { get { @@ -133,7 +133,7 @@ public static string Dash_underline { } /// - /// Looks up a localized string similar to Diagnostics. + /// 查找类似 Diagnostics 的本地化字符串。 /// public static string Diagnostics { get { @@ -142,7 +142,7 @@ public static string Diagnostics { } /// - /// Looks up a localized string similar to D_ot underline. + /// 查找类似 D_ot underline 的本地化字符串。 /// public static string Dot_underline { get { @@ -151,7 +151,7 @@ public static string Dot_underline { } /// - /// Looks up a localized string similar to Keep background symbol keys. + /// 查找类似 Keep background symbol keys 的本地化字符串。 /// public static string Enable_Background_ItemKeyStore_And_Semantic_Classification { get { @@ -160,7 +160,7 @@ public static string Enable_Background_ItemKeyStore_And_Semantic_Classification } /// - /// Looks up a localized string similar to Enable fast find references & rename (experimental). + /// 查找类似 Enable fast find references & rename (experimental) 的本地化字符串。 /// public static string Enable_Fast_Find_References { get { @@ -169,7 +169,7 @@ public static string Enable_Fast_Find_References { } /// - /// Looks up a localized string similar to _Enable in-memory cross project references. + /// 查找类似 _Enable in-memory cross project references 的本地化字符串。 /// public static string Enable_in_memory_cross_project_references { get { @@ -178,7 +178,7 @@ public static string Enable_in_memory_cross_project_references { } /// - /// Looks up a localized string similar to Use live (unsaved) buffers for analysis (restart required). + /// 查找类似 Use live (unsaved) buffers for analysis (restart required) 的本地化字符串。 /// public static string Enable_Live_Buffers { get { @@ -187,7 +187,7 @@ public static string Enable_Live_Buffers { } /// - /// Looks up a localized string similar to Enable parallel reference resolution. + /// 查找类似 Enable parallel reference resolution 的本地化字符串。 /// public static string Enable_Parallel_Reference_Resolution { get { @@ -196,7 +196,7 @@ public static string Enable_Parallel_Reference_Resolution { } /// - /// Looks up a localized string similar to Enable partial type checking. + /// 查找类似 Enable partial type checking 的本地化字符串。 /// public static string Enable_partial_type_checking { get { @@ -205,7 +205,7 @@ public static string Enable_partial_type_checking { } /// - /// Looks up a localized string similar to Enable stale data for IntelliSense features. + /// 查找类似 Enable stale data for IntelliSense features 的本地化字符串。 /// public static string Enable_Stale_IntelliSense_Results { get { @@ -214,7 +214,7 @@ public static string Enable_Stale_IntelliSense_Results { } /// - /// Looks up a localized string similar to Always add new line on enter. + /// 查找类似 Always add new line on enter 的本地化字符串。 /// public static string Enter_key_always { get { @@ -223,7 +223,7 @@ public static string Enter_key_always { } /// - /// Looks up a localized string similar to Never add new line on enter. + /// 查找类似 Never add new line on enter 的本地化字符串。 /// public static string Enter_key_never { get { @@ -232,7 +232,7 @@ public static string Enter_key_never { } /// - /// Looks up a localized string similar to Only add new line on enter after end of fully typed word. + /// 查找类似 Only add new line on enter after end of fully typed word 的本地化字符串。 /// public static string Enter_key_only { get { @@ -241,7 +241,7 @@ public static string Enter_key_only { } /// - /// Looks up a localized string similar to Enter key behavior. + /// 查找类似 Enter key behavior 的本地化字符串。 /// public static string Enter_Key_Rule { get { @@ -250,7 +250,7 @@ public static string Enter_Key_Rule { } /// - /// Looks up a localized string similar to Find References Performance Options. + /// 查找类似 Find References Performance Options 的本地化字符串。 /// public static string Find_References_Performance { get { @@ -259,7 +259,7 @@ public static string Find_References_Performance { } /// - /// Looks up a localized string similar to Re-format indentation on paste (Experimental). + /// 查找类似 Re-format indentation on paste (Experimental) 的本地化字符串。 /// public static string Format_on_paste { get { @@ -268,7 +268,7 @@ public static string Format_on_paste { } /// - /// Looks up a localized string similar to Formatting. + /// 查找类似 Formatting 的本地化字符串。 /// public static string Formatting { get { @@ -277,7 +277,16 @@ public static string Formatting { } /// - /// Looks up a localized string similar to Inline Hints. + /// 查找类似 Generate default implementation body for overrided method 的本地化字符串。 + /// + public static string Generate_Body_For_Overridden_Method { + get { + return ResourceManager.GetString("Generate_Body_For_Overridden_Method", resourceCulture); + } + } + + /// + /// 查找类似 Inline Hints 的本地化字符串。 /// public static string Inline_Hints { get { @@ -286,7 +295,7 @@ public static string Inline_Hints { } /// - /// Looks up a localized string similar to IntelliSense Performance Options. + /// 查找类似 IntelliSense Performance Options 的本地化字符串。 /// public static string IntelliSense_Performance { get { @@ -295,7 +304,7 @@ public static string IntelliSense_Performance { } /// - /// Looks up a localized string similar to Keep all background intermediate resolutions (increases memory usage). + /// 查找类似 Keep all background intermediate resolutions (increases memory usage) 的本地化字符串。 /// public static string Keep_All_Background_Resolutions { get { @@ -304,7 +313,7 @@ public static string Keep_All_Background_Resolutions { } /// - /// Looks up a localized string similar to Keep all background symbol uses (increases memory usage). + /// 查找类似 Keep all background symbol uses (increases memory usage) 的本地化字符串。 /// public static string Keep_All_Background_Symbol_Uses { get { @@ -313,7 +322,7 @@ public static string Keep_All_Background_Symbol_Uses { } /// - /// Looks up a localized string similar to Performance. + /// 查找类似 Performance 的本地化字符串。 /// public static string Language_Service_Performance { get { @@ -322,7 +331,7 @@ public static string Language_Service_Performance { } /// - /// Looks up a localized string similar to Language service settings (advanced). + /// 查找类似 Language service settings (advanced) 的本地化字符串。 /// public static string Language_Service_Settings { get { @@ -331,7 +340,7 @@ public static string Language_Service_Settings { } /// - /// Looks up a localized string similar to Live Buffers. + /// 查找类似 Live Buffers 的本地化字符串。 /// public static string LiveBuffers { get { @@ -340,7 +349,7 @@ public static string LiveBuffers { } /// - /// Looks up a localized string similar to Navigation links. + /// 查找类似 Navigation links 的本地化字符串。 /// public static string Navigation_links { get { @@ -349,7 +358,7 @@ public static string Navigation_links { } /// - /// Looks up a localized string similar to Outlining. + /// 查找类似 Outlining 的本地化字符串。 /// public static string Outlining { get { @@ -358,7 +367,7 @@ public static string Outlining { } /// - /// Looks up a localized string similar to Parallelization (requires restart). + /// 查找类似 Parallelization (requires restart) 的本地化字符串。 /// public static string Parallelization { get { @@ -367,7 +376,7 @@ public static string Parallelization { } /// - /// Looks up a localized string similar to Preferred description width in characters. + /// 查找类似 Preferred description width in characters 的本地化字符串。 /// public static string Preferred_description_width_in_characters { get { @@ -376,7 +385,7 @@ public static string Preferred_description_width_in_characters { } /// - /// Looks up a localized string similar to F# Project and Caching Performance Options. + /// 查找类似 F# Project and Caching Performance Options 的本地化字符串。 /// public static string Project_Performance { get { @@ -385,7 +394,7 @@ public static string Project_Performance { } /// - /// Looks up a localized string similar to Remove unnecessary parentheses (experimental, might affect typing performance). + /// 查找类似 Remove unnecessary parentheses (experimental, might affect typing performance) 的本地化字符串。 /// public static string Remove_parens_code_fix { get { @@ -394,7 +403,7 @@ public static string Remove_parens_code_fix { } /// - /// Looks up a localized string similar to Send additional performance telemetry. + /// 查找类似 Send additional performance telemetry 的本地化字符串。 /// public static string Send_Additional_Telemetry { get { @@ -403,7 +412,7 @@ public static string Send_Additional_Telemetry { } /// - /// Looks up a localized string similar to Show s_ymbols in unopened namespaces. + /// 查找类似 Show s_ymbols in unopened namespaces 的本地化字符串。 /// public static string Show_all_symbols { get { @@ -412,7 +421,7 @@ public static string Show_all_symbols { } /// - /// Looks up a localized string similar to Show completion list after a character is _deleted. + /// 查找类似 Show completion list after a character is _deleted 的本地化字符串。 /// public static string Show_completion_list_after_a_character_is_deleted { get { @@ -421,7 +430,7 @@ public static string Show_completion_list_after_a_character_is_deleted { } /// - /// Looks up a localized string similar to _Show completion list after a character is typed. + /// 查找类似 _Show completion list after a character is typed 的本地化字符串。 /// public static string Show_completion_list_after_a_character_is_typed { get { @@ -430,7 +439,7 @@ public static string Show_completion_list_after_a_character_is_typed { } /// - /// Looks up a localized string similar to Show structure guidelines for F# code. + /// 查找类似 Show structure guidelines for F# code 的本地化字符串。 /// public static string Show_guides { get { @@ -439,7 +448,7 @@ public static string Show_guides { } /// - /// Looks up a localized string similar to Display inline parameter name hints (preview). + /// 查找类似 Display inline parameter name hints (preview) 的本地化字符串。 /// public static string Show_Inline_Parameter_Name_Hints { get { @@ -448,7 +457,7 @@ public static string Show_Inline_Parameter_Name_Hints { } /// - /// Looks up a localized string similar to Display inline type hints (preview). + /// 查找类似 Display inline type hints (preview) 的本地化字符串。 /// public static string Show_Inline_Type_Hints { get { @@ -457,7 +466,7 @@ public static string Show_Inline_Type_Hints { } /// - /// Looks up a localized string similar to S_how navigation links as. + /// 查找类似 S_how navigation links as 的本地化字符串。 /// public static string Show_navigation_links_as { get { @@ -466,7 +475,7 @@ public static string Show_navigation_links_as { } /// - /// Looks up a localized string similar to Show outlining and collapsible nodes for F# code. + /// 查找类似 Show outlining and collapsible nodes for F# code 的本地化字符串。 /// public static string Show_Outlining { get { @@ -475,7 +484,7 @@ public static string Show_Outlining { } /// - /// Looks up a localized string similar to Show remarks in Quick Info. + /// 查找类似 Show remarks in Quick Info 的本地化字符串。 /// public static string Show_remarks_in_Quick_Info { get { @@ -484,7 +493,7 @@ public static string Show_remarks_in_Quick_Info { } /// - /// Looks up a localized string similar to Display return type hints (preview). + /// 查找类似 Display return type hints (preview) 的本地化字符串。 /// public static string Show_Return_Type_Hints { get { @@ -493,7 +502,7 @@ public static string Show_Return_Type_Hints { } /// - /// Looks up a localized string similar to Simplify names (remove unnecessary qualifiers). + /// 查找类似 Simplify names (remove unnecessary qualifiers) 的本地化字符串。 /// public static string Simplify_name_code_fix { get { @@ -502,7 +511,7 @@ public static string Simplify_name_code_fix { } /// - /// Looks up a localized string similar to _Solid underline. + /// 查找类似 _Solid underline 的本地化字符串。 /// public static string Solid_underline { get { @@ -511,7 +520,7 @@ public static string Solid_underline { } /// - /// Looks up a localized string similar to Suggest names for unresolved identifiers. + /// 查找类似 Suggest names for unresolved identifiers 的本地化字符串。 /// public static string Suggest_names_for_errors_code_fix { get { @@ -520,7 +529,7 @@ public static string Suggest_names_for_errors_code_fix { } /// - /// Looks up a localized string similar to Text hover. + /// 查找类似 Text hover 的本地化字符串。 /// public static string Text_hover { get { @@ -529,7 +538,7 @@ public static string Text_hover { } /// - /// Looks up a localized string similar to Time until stale results are used (in milliseconds). + /// 查找类似 Time until stale results are used (in milliseconds) 的本地化字符串。 /// public static string Time_until_stale_completion { get { @@ -538,7 +547,7 @@ public static string Time_until_stale_completion { } /// - /// Looks up a localized string similar to In-memory cross-project references store project-level data in memory to allow IDE features to work across projects.. + /// 查找类似 In-memory cross-project references store project-level data in memory to allow IDE features to work across projects. 的本地化字符串。 /// public static string Tooltip_in_memory_cross_project_references { get { @@ -547,7 +556,7 @@ public static string Tooltip_in_memory_cross_project_references { } /// - /// Looks up a localized string similar to Format signature to the given width by adding line breaks conforming with F# syntax rules. . + /// 查找类似 Format signature to the given width by adding line breaks conforming with F# syntax rules. 的本地化字符串。 /// public static string Tooltip_preferred_description_width_in_characters { get { @@ -556,7 +565,7 @@ public static string Tooltip_preferred_description_width_in_characters { } /// - /// Looks up a localized string similar to Transparent Compiler Cache Factor. + /// 查找类似 Transparent Compiler Cache Factor 的本地化字符串。 /// public static string Transparent_Compiler_Cache_Factor { get { @@ -565,7 +574,7 @@ public static string Transparent_Compiler_Cache_Factor { } /// - /// Looks up a localized string similar to Higher number means more memory will be used for caching. Changing the value wipes cache.. + /// 查找类似 Higher number means more memory will be used for caching. Changing the value wipes cache. 的本地化字符串。 /// public static string Transparent_Compiler_Cache_Factor_Tooltip { get { @@ -574,7 +583,7 @@ public static string Transparent_Compiler_Cache_Factor_Tooltip { } /// - /// Looks up a localized string similar to Create new project snapshots from existing ones. + /// 查找类似 Create new project snapshots from existing ones 的本地化字符串。 /// public static string Transparent_Compiler_Snapshot_Reuse { get { @@ -583,7 +592,7 @@ public static string Transparent_Compiler_Snapshot_Reuse { } /// - /// Looks up a localized string similar to Transparent Compiler (experimental). + /// 查找类似 Transparent Compiler (experimental) 的本地化字符串。 /// public static string TransparentCompiler { get { @@ -592,7 +601,7 @@ public static string TransparentCompiler { } /// - /// Looks up a localized string similar to WARNING! Transparent Compiler does not yet support all features and can cause crashes or give incorrect results.. + /// 查找类似 WARNING! Transparent Compiler does not yet support all features and can cause crashes or give incorrect results. 的本地化字符串。 /// public static string TransparentCompiler_Disclaimer1 { get { @@ -601,7 +610,7 @@ public static string TransparentCompiler_Disclaimer1 { } /// - /// Looks up a localized string similar to Use at your own risk!. + /// 查找类似 Use at your own risk! 的本地化字符串。 /// public static string TransparentCompiler_Disclaimer2 { get { @@ -610,7 +619,7 @@ public static string TransparentCompiler_Disclaimer2 { } /// - /// Looks up a localized string similar to By checking this you also opt-in for additional performance telemetry. + /// 查找类似 By checking this you also opt-in for additional performance telemetry 的本地化字符串。 /// public static string TransparentCompiler_Disclaimer3 { get { @@ -619,7 +628,7 @@ public static string TransparentCompiler_Disclaimer3 { } /// - /// Looks up a localized string similar to Analyze and suggest fixes for unused values. + /// 查找类似 Analyze and suggest fixes for unused values 的本地化字符串。 /// public static string Unused_declaration_code_fix { get { @@ -628,7 +637,7 @@ public static string Unused_declaration_code_fix { } /// - /// Looks up a localized string similar to Remove unused open statements. + /// 查找类似 Remove unused open statements 的本地化字符串。 /// public static string Unused_opens_code_fix { get { @@ -637,7 +646,7 @@ public static string Unused_opens_code_fix { } /// - /// Looks up a localized string similar to Use Transparent Compiler (restart required). + /// 查找类似 Use Transparent Compiler (restart required) 的本地化字符串。 /// public static string Use_Transparent_Compiler { get { diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 61b3bab1750..00c8cb82360 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -312,4 +312,7 @@ By checking this you also opt-in for additional performance telemetry + + Generate default implementation body for overridden method + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 0c938e3f447..9d7aae398d5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -52,6 +52,11 @@ Formátování + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Vložené nápovědy diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 99bac691cac..fc8fa182849 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -52,6 +52,11 @@ Formatierung + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Inlinehinweise diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 5ae03505500..2d0d091cfad 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -52,6 +52,11 @@ Formato + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Sugerencias insertadas diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 283e9d5d0f8..e1f1ecca5c1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -52,6 +52,11 @@ Mise en forme + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Indicateurs inline diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 9c534e8f8dd..816c3395e06 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -52,6 +52,11 @@ Formattazione + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Suggerimenti inline diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 0e0bb91c628..5247c0cc870 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -52,6 +52,11 @@ 書式設定 + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints インラインのヒント diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 0d92ba2bb3a..421c91f4c38 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -52,6 +52,11 @@ 서식 + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints 인라인 힌트 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 16ab9bfc3a1..9e31b9d72e6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -52,6 +52,11 @@ Formatowanie + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Wskazówki w tekście diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 82976646315..28c59366359 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -52,6 +52,11 @@ Formatação + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Dicas Embutidas diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 737584669c1..143cd4e4bed 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -52,6 +52,11 @@ Форматирование + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Встроенные подсказки diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index d6763de0ed5..cf9ba4b6834 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -52,6 +52,11 @@ Biçimlendirme + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints Satır İçi İpuçları diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 917893a6b9c..2a43ae60eb2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -52,6 +52,11 @@ 格式设置 + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints 内联提示 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 0eeef704704..9b1459d5e43 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -52,6 +52,11 @@ 格式化 + + Generate default implementation body for overridden method + Generate default implementation body for overridden method + + Inline Hints 內嵌提示 diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs index d8e92581f10..4377253d1ad 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs @@ -34,7 +34,7 @@ module CompletionProviderTests = let results = let task = - FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||])) + FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false) |> CancellableTask.start CancellationToken.None task.Result |> Seq.map (fun result -> result.DisplayText) @@ -82,7 +82,7 @@ module CompletionProviderTests = let actual = let task = - FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||])) + FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false) |> CancellableTask.start CancellationToken.None task.Result @@ -102,6 +102,40 @@ module CompletionProviderTests = let VerifyCompletionListExactly (fileContents: string, marker: string, expected: string list) = VerifyCompletionListExactlyWithOptions(fileContents, marker, expected, [||]) + /// Verify completion code. Only verify the expected completion items + let VerifyCompletionCode (genBodyForOverriddenMeth, fileContents: string, marker: string, expected: Map) = + let getNameInCode (item: CompletionItem) = + match item.Properties.TryGetValue "NameInCode" with + | true, x -> x + | _ -> item.DisplayText + + let caretPosition = fileContents.IndexOf(marker) + marker.Length + + let document = + RoslynTestHelpers.CreateSolution(fileContents, extraFSharpProjectOtherOptions = [||]) + |> RoslynTestHelpers.GetSingleDocument + + let actual = + let task = + FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), genBodyForOverriddenMeth) + |> CancellableTask.start CancellationToken.None + + task.Result + |> Seq.toList + |> List.choose (fun x -> + if expected.ContainsKey x.DisplayText then + Some(x.DisplayText, getNameInCode x) + else + None) + |> Map.ofList + + if actual <> expected then + failwithf + "Expected:\n%s,\nbut was:\n%s\nactual with DisplayText:\n%s" + (String.Join("\n", expected.Values |> Seq.map (sprintf "\"%s\""))) + (String.Join("\n", actual.Values |> Seq.map (sprintf "\"%s\""))) + (String.Join("\n", actual |> Seq.map (fun (KeyValue(fst, snd)) -> sprintf "%s => %s" fst snd))) + let VerifyNoCompletionList (fileContents: string, marker: string) = VerifyCompletionListExactly(fileContents, marker, []) @@ -2095,3 +2129,50 @@ Ops.() VerifyCompletionList(fileContents, "Ops.Foo.(", [], [ "|>>"; "(|>>)" ]) VerifyCompletionList(fileContents, "Ops.(", [], [ "|>>"; "(|>>)" ]) + + [] + let ``Check code generation for completion to overridable slots`` () = + let fileContents = + """ +let _ = + { new System.IO.Stream() with + member x. + } +""" + + let nl = Environment.NewLine + + let toCheckCompletionItems = + [ + "CanRead with get (): bool" + "Position with get (): int64 and set (value: int64)" + "ToString (): string" + ] + + VerifyCompletionCode( + true, + fileContents, + "member x.", + List.zip + toCheckCompletionItems + [ + $"CanRead{nl} with get (): bool = raise (System.NotImplementedException())" + $"Position{nl} with get (): int64 = raise (System.NotImplementedException()){nl} and set (value: int64) = raise (System.NotImplementedException())" + $"ToString (): string = {nl} base.ToString()" + ] + |> Map.ofList + ) + + VerifyCompletionCode( + false, + fileContents, + "member x.", + List.zip + toCheckCompletionItems + [ + $"CanRead{nl} with get (): bool = " + $"Position{nl} with get (): int64 = {nl} and set (value: int64) = " + $"ToString (): string = {nl} " + ] + |> Map.ofList + ) diff --git a/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs index 1b633c973d0..eac0c3f6e52 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/FsxCompletionProviderTests.fs @@ -32,7 +32,7 @@ type Worker() = let actual = let x = - FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||])) + FSharpCompletionProvider.ProvideCompletionsAsyncAux(document, caretPosition, (fun _ -> [||]), false) |> CancellableTask.start CancellationToken.None x.Result From 3259edf831b702e3c10bd169143e805b03895c2b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 10:02:29 +0100 Subject: [PATCH 023/134] Update dependencies from https://github.com/dotnet/msbuild build 20250319.6 (#18396) Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.20-preview-25162-14 -> To Version 17.13.21-preview-25169-06 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NuGet.config b/NuGet.config index d30d1402844..129a1d964be 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d01cf73cceb..61e4ad5b07b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - a4ef1e90fef9b56473708b7d308f982c7c9f46d9 + 0586a3f904d83c5f77f8407661429caadcbdc5f9 - + https://github.com/dotnet/msbuild - a4ef1e90fef9b56473708b7d308f982c7c9f46d9 + 0586a3f904d83c5f77f8407661429caadcbdc5f9 - + https://github.com/dotnet/msbuild - a4ef1e90fef9b56473708b7d308f982c7c9f46d9 + 0586a3f904d83c5f77f8407661429caadcbdc5f9 - + https://github.com/dotnet/msbuild - a4ef1e90fef9b56473708b7d308f982c7c9f46d9 + 0586a3f904d83c5f77f8407661429caadcbdc5f9 - + https://github.com/dotnet/msbuild - a4ef1e90fef9b56473708b7d308f982c7c9f46d9 + 0586a3f904d83c5f77f8407661429caadcbdc5f9 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index f4b5ae88140..5fff590d01b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -94,7 +94,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.20 + 17.13.21 $(RoslynVersion) $(RoslynVersion) @@ -130,9 +130,9 @@ 15.0.25123-Dev15Preview - 17.13.20 - 17.13.20 - 17.13.20 + 17.13.21 + 17.13.21 + 17.13.21 $(VisualStudioEditorPackagesVersion) From 4e1fd37bddaeef8ebed2d8a941c51bb19d715c55 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Mon, 24 Mar 2025 16:08:01 -0700 Subject: [PATCH 024/134] more code flow --- .config/service-branch-merge.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/service-branch-merge.json b/.config/service-branch-merge.json index 0c9d996e850..49561874be8 100644 --- a/.config/service-branch-merge.json +++ b/.config/service-branch-merge.json @@ -5,6 +5,10 @@ "MergeToBranch": "main", "ExtraSwitches": "-QuietComments" }, + "release/dev17.14": { + "MergeToBranch": "release/dev18.0", + "ExtraSwitches": "-QuietComments" + }, "main": { "MergeToBranch": "release/dev17.14", "ExtraSwitches": "-QuietComments" From e92bb80d7eb1c312159f077141ce9293e784032a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 24 Mar 2025 16:50:47 -0700 Subject: [PATCH 025/134] Update fantomas to 7.0.1 (#18400) * Update fantomas * Update fantomas - vsintegration --- .config/dotnet-tools.json | 4 +- src/Compiler/AbstractIL/ilnativeres.fs | 56 +++--- src/Compiler/AbstractIL/ilread.fs | 12 +- src/Compiler/AbstractIL/ilreflect.fs | 13 +- src/Compiler/AbstractIL/ilsupp.fs | 6 +- .../CheckComputationExpressions.fs | 4 +- src/Compiler/CodeGen/EraseUnions.fs | 28 +-- src/Compiler/CodeGen/IlxGen.fs | 162 +++++++----------- src/Compiler/CodeGen/IlxGenSupport.fs | 15 +- .../AssemblyResolveHandler.fs | 13 +- .../NativeDllResolveHandler.fs | 11 +- src/Compiler/Driver/CompilerConfig.fs | 8 +- src/Compiler/Driver/CompilerDiagnostics.fs | 10 +- src/Compiler/Driver/CompilerOptions.fs | 4 +- src/Compiler/Driver/CreateILModule.fs | 2 +- src/Compiler/Driver/FxResolver.fs | 15 +- src/Compiler/Driver/OptimizeInputs.fs | 27 +-- src/Compiler/Driver/ParseAndCheckInputs.fs | 102 +++++------ src/Compiler/Driver/ScriptClosure.fs | 21 +-- src/Compiler/Driver/StaticLinking.fs | 9 +- src/Compiler/Driver/fsc.fs | 24 +-- src/Compiler/Facilities/CompilerLocation.fs | 28 ++- src/Compiler/Facilities/DiagnosticsLogger.fs | 3 +- .../SimulatedMSBuildReferenceResolver.fs | 6 +- src/Compiler/Facilities/prim-lexing.fs | 13 +- src/Compiler/Interactive/fsi.fs | 54 ++---- src/Compiler/Service/BackgroundCompiler.fs | 149 ++++------------ src/Compiler/Service/FSharpCheckerResults.fs | 45 ++--- src/Compiler/Service/FSharpProjectSnapshot.fs | 32 ++-- src/Compiler/Service/FSharpWorkspaceState.fs | 20 +-- .../Service/SemanticClassification.fs | 8 +- .../Service/ServiceInterfaceStubGenerator.fs | 2 +- src/Compiler/Service/ServiceLexing.fs | 13 +- src/Compiler/Service/ServiceParseTreeWalk.fs | 8 +- src/Compiler/Service/ServiceParsedInputOps.fs | 7 +- src/Compiler/Service/TransparentCompiler.fs | 100 +++-------- src/Compiler/Service/TransparentCompiler.fsi | 7 +- src/Compiler/Service/service.fs | 29 +--- src/Compiler/Symbols/FSharpDiagnostic.fsi | 4 +- src/Compiler/SyntaxTree/LexHelpers.fs | 13 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 20 +-- src/Compiler/SyntaxTree/UnicodeLexing.fs | 9 +- src/Compiler/TypedTree/TcGlobals.fsi | 5 +- src/Compiler/Utilities/FileSystem.fs | 11 +- src/Compiler/Utilities/sr.fs | 4 +- src/FSharp.Build/FSharpEmbedResXSource.fs | 7 +- src/FSharp.Build/Fsi.fs | 4 +- src/FSharp.Core/async.fs | 28 +-- src/FSharp.Core/map.fs | 8 +- src/FSharp.Core/quotations.fs | 9 +- src/FSharp.Core/reflect.fs | 21 +-- src/FSharp.Core/seq.fs | 5 +- src/FSharp.Core/set.fs | 8 +- .../FSharp.DependencyManager.Utilities.fs | 4 +- .../FSharp.DependencyManager.fs | 8 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 10 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 12 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 18 +- ...ompiler.Service_Release_netstandard2.0.bsl | 20 +-- .../ClassificationDefinitions.fs | 5 +- .../Classification/ClassificationService.fs | 16 +- .../CodeFixes/ImplementInterface.fs | 10 +- .../CodeFixes/MakeOuterBindingRecursive.fs | 4 +- .../Commands/XmlDocCommandService.fs | 5 +- .../src/FSharp.Editor/Common/AssemblyInfo.fs | 4 +- .../Common/CodeAnalysisExtensions.fs | 10 +- .../src/FSharp.Editor/Common/Extensions.fs | 6 +- .../src/FSharp.Editor/Common/Logging.fs | 6 +- .../Completion/CompletionProvider.fs | 19 +- .../Completion/CompletionService.fs | 9 +- .../Completion/CompletionUtils.fs | 12 +- .../Debugging/BreakpointResolutionService.fs | 7 +- .../Debugging/LanguageDebugInfoService.fs | 7 +- .../DocComments/XMLDocumentation.fs | 23 +-- .../DocumentHighlightsService.fs | 8 +- .../Formatting/IndentationService.fs | 9 +- .../Hints/InlineParameterNameHints.fs | 3 +- .../LanguageService/LanguageService.fs | 12 +- .../LanguageService/SingleFileWorkspaceMap.fs | 4 +- .../LanguageService/Tokenizer.fs | 8 +- .../LanguageService/WorkspaceExtensions.fs | 23 +-- .../Navigation/FindUsagesService.fs | 9 +- .../Navigation/GoToDefinition.fs | 18 +- .../Navigation/NavigateToSearchService.fs | 9 +- .../src/FSharp.Editor/QuickInfo/Views.fs | 9 +- .../BreakpointResolutionServiceTests.fs | 4 +- .../DocumentDiagnosticAnalyzerTests.fs | 21 +-- .../FindReferencesTests.fs | 16 +- .../GoToDefinitionServiceTests.fs | 9 +- .../Helpers/RoslynHelpers.fs | 4 +- .../NavigateToSearchServiceTests.fs | 4 +- .../SignatureHelpProviderTests.fs | 4 +- .../SyntacticColorizationServiceTests.fs | 29 +--- 93 files changed, 513 insertions(+), 1131 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 34ccbbf8056..3b266c03b4c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -45,7 +45,7 @@ "rollForward": true }, "fantomas": { - "version": "6.2.3", + "version": "7.0.1", "commands": [ "fantomas" ], @@ -59,4 +59,4 @@ "rollForward": false } } -} +} \ No newline at end of file diff --git a/src/Compiler/AbstractIL/ilnativeres.fs b/src/Compiler/AbstractIL/ilnativeres.fs index 62961613b3f..2eb03ab674e 100644 --- a/src/Compiler/AbstractIL/ilnativeres.fs +++ b/src/Compiler/AbstractIL/ilnativeres.fs @@ -83,7 +83,7 @@ type CvtResFile() = pAdditional.DataSize <- cbData pAdditional.pstringType <- CvtResFile.ReadStringOrID reader pAdditional.pstringName <- CvtResFile.ReadStringOrID reader - stream.Position <- stream.Position + 3L &&& ~~~ 3L + stream.Position <- stream.Position + 3L &&& ~~~3L pAdditional.DataVersion <- reader.ReadUInt32() pAdditional.MemoryFlags <- reader.ReadUInt16() pAdditional.LanguageId <- reader.ReadUInt16() @@ -91,7 +91,7 @@ type CvtResFile() = pAdditional.Characteristics <- reader.ReadUInt32() pAdditional.data <- Array.zeroCreate (int pAdditional.DataSize) reader.Read(pAdditional.data, 0, pAdditional.data.Length) |> ignore - stream.Position <- stream.Position + 3L &&& ~~~ 3L + stream.Position <- stream.Position + 3L &&& ~~~3L if pAdditional.pstringType.theString = Unchecked.defaultof<_> @@ -174,6 +174,7 @@ type SectionCharacteristics = type ResourceSection() = new(sectionBytes: byte[], relocations: uint32[]) as this = (ResourceSection()) + then Debug.Assert(sectionBytes :> obj <> Unchecked.defaultof<_>) Debug.Assert(relocations :> obj <> Unchecked.defaultof<_>) @@ -374,13 +375,8 @@ type VersionHelper() = /// /// True when parsing succeeds completely (i.e. every character in the string was consumed), false otherwise. static member private TryParse - ( - s: string, - allowWildcard: bool, - maxValue: uint16, - allowPartialParse: bool, - [] version: byref - ) = + (s: string, allowWildcard: bool, maxValue: uint16, allowPartialParse: bool, [] version: byref) + = Debug.Assert(not allowWildcard || maxValue < UInt16.MaxValue) if String.IsNullOrWhiteSpace s then @@ -520,20 +516,24 @@ type VersionResourceSerializer() = member val private _isDll = Unchecked.defaultof with get, set - new(isDll: bool, - comments: string, - companyName: string, - fileDescription: string, - fileVersion: string, - internalName: string, - legalCopyright: string, - legalTrademark: string, - originalFileName: string, - productName: string, - productVersion: string, - assemblyVersion: Version) as this = + new + ( + isDll: bool, + comments: string, + companyName: string, + fileDescription: string, + fileVersion: string, + internalName: string, + legalCopyright: string, + legalTrademark: string, + originalFileName: string, + productName: string, + productVersion: string, + assemblyVersion: Version + ) as this = VersionResourceSerializer() + then this._isDll <- isDll this._commentsContents <- comments @@ -620,7 +620,7 @@ type VersionResourceSerializer() = static member private PadKeyLen(cb: int) = VersionResourceSerializer.PadToDword(cb + 3 * sizeof) - 3 * sizeof - static member private PadToDword(cb: int) = cb + 3 &&& ~~~ 3 + static member private PadToDword(cb: int) = cb + 3 &&& ~~~3 static member val private HDRSIZE = (int (3 * sizeof)) with get, set @@ -667,7 +667,7 @@ type VersionResourceSerializer() = let mutable (sum: int) = 0 for verString in this.GetVerStrings() do - sum <- sum + 3 &&& ~~~ 3 + sum <- sum + 3 &&& ~~~3 sum <- sum + VersionResourceSerializer.SizeofVerString(verString.Key, verString.Value) sum @@ -801,7 +801,7 @@ type VersionResourceSerializer() = for entry in this.GetVerStrings() do let mutable writerPos = writer.BaseStream.Position - writer.Write(Array.zeroCreate (int ((writerPos + 3L) &&& ~~~ 3L - writerPos)): byte[]) + writer.Write(Array.zeroCreate (int ((writerPos + 3L) &&& ~~~3L - writerPos)): byte[]) Debug.Assert(entry.Value <> Unchecked.defaultof<_>) VersionResourceSerializer.WriteVersionString(entry, writer) @@ -861,7 +861,7 @@ type Win32ResourceConversions() = let mutable (i: uint16) = 0us while (i < count) do - resStream.Position <- resStream.Position + 3L &&& ~~~ 3L + resStream.Position <- resStream.Position + 3L &&& ~~~3L resWriter.Write iconDirEntries[(int i)].dwBytesInRes resWriter.Write 0x00000020u resWriter.Write 0xFFFFus @@ -878,7 +878,7 @@ type Win32ResourceConversions() = i <- i + 1us let mutable (RT_GROUP_ICON: WORD) = (RT_ICON + 11us) - resStream.Position <- resStream.Position + 3L &&& ~~~ 3L + resStream.Position <- resStream.Position + 3L &&& ~~~3L resWriter.Write(uint32 (3 * sizeof + int count * 14)) resWriter.Write 0x00000020u resWriter.Write 0xFFFFus @@ -933,7 +933,7 @@ type Win32ResourceConversions() = let comments = (defaultArg comments) Unchecked.defaultof<_> let companyName = (defaultArg companyName) Unchecked.defaultof<_> let mutable resWriter = new BinaryWriter(resStream, Encoding.Unicode) - resStream.Position <- resStream.Position + 3L &&& ~~~ 3L + resStream.Position <- resStream.Position + 3L &&& ~~~3L let mutable (RT_VERSION: DWORD) = 16u let mutable ver = @@ -970,7 +970,7 @@ type Win32ResourceConversions() = Debug.Assert(resStream.Position - startPos = int64 dataSize + int64 headerSize) static member AppendManifestToResourceStream(resStream: Stream, manifestStream: Stream, isDll: bool) = - resStream.Position <- resStream.Position + 3L &&& ~~~ 3L (* ERROR UnknownPrefixOperator "~" *) + resStream.Position <- resStream.Position + 3L &&& ~~~3L (* ERROR UnknownPrefixOperator "~" *) let mutable (RT_MANIFEST: WORD) = 24us let mutable resWriter = new BinaryWriter(resStream) resWriter.Write(uint32 manifestStream.Length) diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 14af625419b..4f280f8ad29 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -4180,16 +4180,8 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) = // Note, pectxtEager and pevEager must not be captured by the results of this function let openMetadataReader - ( - fileName, - mdfile: BinaryFile, - metadataPhysLoc, - peinfo, - pectxtEager: PEReader, - pevEager, - pectxtCaptured, - reduceMemoryUsage - ) = + (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, pectxtEager: PEReader, pevEager, pectxtCaptured, reduceMemoryUsage) + = let mdv = mdfile.GetView() let magic = seekReadUInt16AsInt32 mdv metadataPhysLoc diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 45c0652c59d..6151c28b8f0 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -290,10 +290,7 @@ type OpCode with member opcode.RefEmitName = match opcode.Name with | null -> "" - | name -> - (string (Char.ToUpper(name[0])) + name[1..]) - .Replace(".", "_") - .Replace("_i4", "_I4") + | name -> (string (Char.ToUpper(name[0])) + name[1..]).Replace(".", "_").Replace("_i4", "_I4") type ILGenerator with @@ -713,7 +710,7 @@ let rec convTypeSpec cenv emEnv preferCreated (tspec: ILTypeSpec) = and convTypeAux cenv emEnv preferCreated ty = match ty with - | ILType.Void -> !! Type.GetType("System.Void") + | ILType.Void -> !!Type.GetType("System.Void") | ILType.Array(shape, eltType) -> let baseT = convTypeAux cenv emEnv preferCreated eltType let nDims = shape.Rank @@ -1491,7 +1488,7 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = ilG.EmitAndLog(OpCodes.Ldelema, convType cenv emEnv ty) else let arrayTy = convType cenv emEnv (ILType.Array(shape, ty)) - let elemTy = !! arrayTy.GetElementType() + let elemTy = !!arrayTy.GetElementType() let argTys = Array.create shape.Rank typeof let retTy = elemTy.MakeByRefType() @@ -1517,7 +1514,7 @@ let rec emitInstr cenv (modB: ModuleBuilder) emEnv (ilG: ILGenerator) instr = ilG.EmitAndLog(OpCodes.Stelem, convType cenv emEnv ty) else let arrayTy = convType cenv emEnv (ILType.Array(shape, ty)) - let elemTy = !! arrayTy.GetElementType() + let elemTy = !!arrayTy.GetElementType() let meth = modB.GetArrayMethodAndLog( @@ -2497,7 +2494,7 @@ let mkDynamicAssemblyAndModule (assemblyName: string, optimize, collectible) = let daType = typeof let daCtor = - !! daType.GetConstructor([| typeof |]) + !!daType.GetConstructor([| typeof |]) let daBuilder = CustomAttributeBuilder( diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index 513d14d9f51..cd30137faaf 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -653,8 +653,7 @@ let unlinkResource (ulLinkedResourceBaseRVA: int32) (pbLinkedResource: byte[]) = for i = 0 to (nResNodes - 1) do size <- size - + pResNodes[i] - .Save(ulLinkedResourceBaseRVA, pbLinkedResource, Unchecked.defaultof, 0) + + pResNodes[i].Save(ulLinkedResourceBaseRVA, pbLinkedResource, Unchecked.defaultof, 0) let pResBuffer = Bytes.zeroCreate size @@ -670,7 +669,6 @@ let unlinkResource (ulLinkedResourceBaseRVA: int32) (pbLinkedResource: byte[]) = for i = 0 to (nResNodes - 1) do resBufferOffset <- resBufferOffset - + pResNodes[i] - .Save(ulLinkedResourceBaseRVA, pbLinkedResource, pResBuffer, resBufferOffset) + + pResNodes[i].Save(ulLinkedResourceBaseRVA, pbLinkedResource, pResBuffer, resBufferOffset) pResBuffer diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 22b603d211a..52cb3c0d61a 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -3083,9 +3083,7 @@ let TcComputationExpression (cenv: TcFileState) env (overallTy: OverallTy) tpenv TranslateComputationExpression ceenv CompExprTranslationPass.Initial hasCustomOperations (LazyWithContext.NotLazy([], env)) comp id let mDelayOrQuoteOrRun = - mBuilderVal - .NoteSourceConstruct(NotedSourceConstruct.DelayOrQuoteOrRun) - .MakeSynthetic() + mBuilderVal.NoteSourceConstruct(NotedSourceConstruct.DelayOrQuoteOrRun).MakeSynthetic() // Add a call to 'Delay' if the method is present let delayedExpr = diff --git a/src/Compiler/CodeGen/EraseUnions.fs b/src/Compiler/CodeGen/EraseUnions.fs index e841010c837..18eaed4be6f 100644 --- a/src/Compiler/CodeGen/EraseUnions.fs +++ b/src/Compiler/CodeGen/EraseUnions.fs @@ -742,12 +742,14 @@ let mkMethodsAndPropertiesForFields basicProps, basicMethods let convAlternativeDef - (addMethodGeneratedAttrs, - addPropertyGeneratedAttrs, - addPropertyNeverAttrs, - addFieldGeneratedAttrs, - addFieldNeverAttrs, - mkDebuggerTypeProxyAttribute) + ( + addMethodGeneratedAttrs, + addPropertyGeneratedAttrs, + addPropertyNeverAttrs, + addFieldGeneratedAttrs, + addFieldNeverAttrs, + mkDebuggerTypeProxyAttribute + ) (g: TcGlobals) num (td: ILTypeDef) @@ -1255,12 +1257,14 @@ let convAlternativeDef baseMakerMeths, baseMakerProps, altUniqObjMeths, typeDefs, altDebugTypeDefs, altNullaryFields let mkClassUnionDef - (addMethodGeneratedAttrs, - addPropertyGeneratedAttrs, - addPropertyNeverAttrs, - addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef, - addFieldNeverAttrs: ILFieldDef -> ILFieldDef, - mkDebuggerTypeProxyAttribute) + ( + addMethodGeneratedAttrs, + addPropertyGeneratedAttrs, + addPropertyNeverAttrs, + addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef, + addFieldNeverAttrs: ILFieldDef -> ILFieldDef, + mkDebuggerTypeProxyAttribute + ) (g: TcGlobals) tref (td: ILTypeDef) diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 791fed38a3d..1be3b7be3a2 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1510,18 +1510,7 @@ let GetMethodSpecForMemberVal cenv (memberInfo: ValMemberInfo) (vref: ValRef) = /// Determine how a top-level value is represented, when representing as a field, by computing an ILFieldSpec let ComputeFieldSpecForVal - ( - optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option, - isInteractive, - g, - ilTyForProperty, - vspec: Val, - nm, - m, - cloc, - ilTy, - ilGetterMethRef - ) = + (optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option, isInteractive, g, ilTyForProperty, vspec: Val, nm, m, cloc, ilTy, ilGetterMethRef) = assert vspec.IsCompiledAsTopLevel let generate () = @@ -1615,14 +1604,8 @@ let IsFSharpValCompiledAsMethod g (v: Val) = /// method (possibly and instance method). Otherwise it gets represented as a /// static field and property. let ComputeStorageForValWithValReprInfo - ( - cenv, - optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option, - isInteractive, - optShadowLocal, - vref: ValRef, - cloc - ) = + (cenv, optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option, isInteractive, optShadowLocal, vref: ValRef, cloc) + = if isUnitTy cenv.g vref.Type @@ -2420,9 +2403,7 @@ and AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbuf anonTypeTable.GrabExtraBindingsToGenerate() member _.AddTypeDef(tref: ILTypeRef, tdef, eliminateIfEmpty, addAtEnd, tdefDiscards) = - gtdefs - .FindNestedTypeDefsBuilder(tref.Enclosing) - .AddTypeDef(tdef, eliminateIfEmpty, addAtEnd, tdefDiscards) + gtdefs.FindNestedTypeDefsBuilder(tref.Enclosing).AddTypeDef(tdef, eliminateIfEmpty, addAtEnd, tdefDiscards) member _.FindNestedTypeDefBuilder(tref: ILTypeRef) = gtdefs.FindNestedTypeDefBuilder(tref) @@ -5936,11 +5917,7 @@ and renameMethodDef nameOfOverridingMethod (mdef: ILMethodDef) = mdef.With(name = nameOfOverridingMethod) and fixupMethodImplFlags (mdef: ILMethodDef) = - mdef - .WithAccess(ILMemberAccess.Private) - .WithHideBySig() - .WithFinal(true) - .WithNewSlot + mdef.WithAccess(ILMemberAccess.Private).WithHideBySig().WithFinal(true).WithNewSlot and fixupStaticAbstractSlotFlags (mdef: ILMethodDef) = mdef.WithHideBySig(true) @@ -6464,15 +6441,17 @@ and GenSequenceExpr cenv (cgbuf: CodeGenBuffer) eenvouter - (nextEnumeratorValRef: ValRef, - pcvref: ValRef, - currvref: ValRef, - stateVars, - generateNextExpr, - closeExpr, - checkCloseExpr: Expr, - seqElemTy, - m) + ( + nextEnumeratorValRef: ValRef, + pcvref: ValRef, + currvref: ValRef, + stateVars, + generateNextExpr, + closeExpr, + checkCloseExpr: Expr, + seqElemTy, + m + ) sequel = @@ -6613,8 +6592,7 @@ and GenSequenceExpr |> AddNonUserCompilerGeneratedAttribs g let ilCtorBody = - mkILSimpleStorageCtor(Some ilCloBaseTy.TypeSpec, ilCloTyInner, [], [], ILMemberAccess.Assembly, None, eenvouter.imports) - .MethodBody + mkILSimpleStorageCtor(Some ilCloBaseTy.TypeSpec, ilCloTyInner, [], [], ILMemberAccess.Assembly, None, eenvouter.imports).MethodBody let cloMethods = [ @@ -6660,18 +6638,19 @@ and GenSequenceExpr /// Generate the class for a closure type definition and GenClosureTypeDefs cenv - (tref: ILTypeRef, - ilGenParams, - attrs, - ilCloAllFreeVars, - ilCloLambdas, - ilCtorBody, - mdefs, - mimpls, - ext, - ilIntfTys, - cloSpec: IlxClosureSpec option) - = + ( + tref: ILTypeRef, + ilGenParams, + attrs, + ilCloAllFreeVars, + ilCloLambdas, + ilCtorBody, + mdefs, + mimpls, + ext, + ilIntfTys, + cloSpec: IlxClosureSpec option + ) = let g = cenv.g let cloInfo = @@ -6699,8 +6678,7 @@ and GenClosureTypeDefs let cctor = mkILClassCtor (MethodBody.IL(notlazy ilCode)) let ilFieldDef = - mkILStaticField(fspec.Name, fspec.FormalType, None, None, ILMemberAccess.Assembly) - .WithInitOnly(true) + mkILStaticField(fspec.Name, fspec.FormalType, None, None, ILMemberAccess.Assembly).WithInitOnly(true) (cctor :: mdefs), [ ilFieldDef ] else @@ -6754,9 +6732,7 @@ and GenStaticDelegateClosureTypeDefs // Remove the redundant constructor. tdefs |> List.map (fun td -> - td - .WithAbstract(true) - .With(methods = mkILMethodsFromArray (td.Methods.AsArray() |> Array.filter (fun m -> not m.IsConstructor)))) + td.WithAbstract(true).With(methods = mkILMethodsFromArray (td.Methods.AsArray() |> Array.filter (fun m -> not m.IsConstructor)))) and GenGenericParams cenv eenv tps = tps |> DropErasedTypars |> List.map (GenGenericParam cenv eenv) @@ -8564,8 +8540,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = let ilMethodBody = MethodBody.IL(ilLazyCode) - (mkILStaticMethod ([], ilGetterMethSpec.Name, access, [], mkILReturn ilTy, ilMethodBody)) - .WithSpecialName + (mkILStaticMethod ([], ilGetterMethSpec.Name, access, [], mkILReturn ilTy, ilMethodBody)).WithSpecialName |> AddNonUserCompilerGeneratedAttribs g CountMethodDef() @@ -8742,8 +8717,7 @@ and GenBindingAfterDebugPoint cenv cgbuf eenv bind isStateVar startMarkOpt = let body = mkMethodBody (true, [], 2, nonBranchingInstrsToCode [ mkNormalLdsfld fspec ], None, eenv.imports) - mkILStaticMethod([], ilGetterMethRef.Name, access, [], mkILReturn fty, body) - .WithSpecialName + mkILStaticMethod([], ilGetterMethRef.Name, access, [], mkILReturn fty, body).WithSpecialName cgbuf.mgbuf.AddMethodDef(ilTypeRefForProperty, getterMethod) @@ -9173,26 +9147,27 @@ and GenMethodForBinding cenv mgbuf eenv - (v: Val, - mspec, - hasWitnessEntry, - generateWitnessArgs, - access, - ctps, - mtps, - witnessInfos, - curriedArgInfos, - paramInfos, - argTys, - retInfo, - valReprInfo, - ctorThisValOpt, - baseValOpt, - methLambdaTypars, - methLambdaVars, - methLambdaBody, - returnTy) - = + ( + v: Val, + mspec, + hasWitnessEntry, + generateWitnessArgs, + access, + ctps, + mtps, + witnessInfos, + curriedArgInfos, + paramInfos, + argTys, + retInfo, + valReprInfo, + ctorThisValOpt, + baseValOpt, + methLambdaTypars, + methLambdaVars, + methLambdaBody, + returnTy + ) = let g = cenv.g let m = v.Range @@ -10181,18 +10156,8 @@ and CreatePermissionSets cenv eenv (securityAttributes: Attrib list) = /// Generate a static class at the given cloc and GenTypeDefForCompLoc - ( - cenv, - eenv, - mgbuf: AssemblyBuilder, - cloc, - hidden, - accessibility: Accessibility, - attribs, - initTrigger, - eliminateIfEmpty, - addAtEnd - ) = + (cenv, eenv, mgbuf: AssemblyBuilder, cloc, hidden, accessibility: Accessibility, attribs, initTrigger, eliminateIfEmpty, addAtEnd) + = let g = cenv.g let tref = TypeRefForCompLoc cloc @@ -10274,8 +10239,7 @@ and CodeGenInitMethod cenv (cgbuf: CodeGenBuffer) eenv tref (codeGenInitFunc: Co let ilReturn = mkILReturn ILType.Void let method = - (mkILNonGenericStaticMethod (eenv.staticInitializationName, access, [], ilReturn, ilBody)) - .WithSpecialName + (mkILNonGenericStaticMethod (eenv.staticInitializationName, access, [], ilReturn, ilBody)).WithSpecialName cgbuf.mgbuf.AddMethodDef(tref, method) CountMethodDef() @@ -12208,14 +12172,14 @@ let LookupGeneratedValue (cenv: cenv) (ctxt: ExecutionContext) eenv (v: Val) = if hasLiteralAttr then let staticTy = ctxt.LookupTypeRef fspec.DeclaringTypeRef // Checked: This FieldInfo (FieldBuilder) supports GetValue(). - (!! staticTy.GetField(fspec.Name)).GetValue(null: obj MaybeNull) + (!!staticTy.GetField(fspec.Name)).GetValue(null: obj MaybeNull) else let staticTy = ctxt.LookupTypeRef ilContainerTy.TypeRef // We can't call .Invoke on the ILMethodRef's MethodInfo, // because it is the MethodBuilder and that does not support Invoke. // Rather, we look for the getter MethodInfo from the built type and .Invoke on that. let methInfo = - !! staticTy.GetMethod(ilGetterMethRef.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) + !!staticTy.GetMethod(ilGetterMethRef.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) methInfo.Invoke(null, null) @@ -12228,7 +12192,7 @@ let LookupGeneratedValue (cenv: cenv) (ctxt: ExecutionContext) eenv (v: Val) = // because it is the MethodBuilder and that does not support Invoke. // Rather, we look for the getter MethodInfo from the built type and .Invoke on that. let methInfo = - !! staticTy.GetMethod(ilGetterMethSpec.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) + !!staticTy.GetMethod(ilGetterMethSpec.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) methInfo.Invoke(null, null) @@ -12255,14 +12219,14 @@ let SetGeneratedValue (ctxt: ExecutionContext) eenv isForced (v: Val) (value: ob let staticTy = ctxt.LookupTypeRef fspec.DeclaringTypeRef let fieldInfo = - !! staticTy.GetField(fspec.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) + !!staticTy.GetField(fspec.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) fieldInfo.SetValue(null, value) else let staticTy = ctxt.LookupTypeRef ilSetterMethRef.DeclaringTypeRef let methInfo = - !! staticTy.GetMethod(ilSetterMethRef.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) + !!staticTy.GetMethod(ilSetterMethRef.Name, BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.NonPublic) methInfo.Invoke(null, [| value |]) |> ignore | _ -> () diff --git a/src/Compiler/CodeGen/IlxGenSupport.fs b/src/Compiler/CodeGen/IlxGenSupport.fs index 2583e93fe79..0799dbde60a 100644 --- a/src/Compiler/CodeGen/IlxGenSupport.fs +++ b/src/Compiler/CodeGen/IlxGenSupport.fs @@ -83,12 +83,8 @@ let getFieldMemberAccess = | EncapsulatedProperties -> ILMemberAccess.Private let mkLocalPrivateAttributeWithPropertyConstructors - ( - g: TcGlobals, - name: string, - attrProperties: (string * ILType) list option, - codegenStyle: AttrDataGenerationStyle - ) = + (g: TcGlobals, name: string, attrProperties: (string * ILType) list option, codegenStyle: AttrDataGenerationStyle) + = let ilTypeRef = mkILTyRef (ILScopeRef.Local, name) let ilTy = mkILFormalNamedTy ILBoxity.AsObject ilTypeRef [] @@ -227,8 +223,7 @@ let mkLocalPrivateInt32Enum (g: TcGlobals, tref: ILTypeRef, values: (string * in |> Array.map (fun (name, value) -> mkILStaticLiteralField (name, ilType, ILFieldInit.Int32 value, None, ILMemberAccess.Public)) |> Array.append [| - (mkILInstanceField ("value__", g.ilg.typ_Int32, None, ILMemberAccess.Public)) - .WithSpecialName(true) + (mkILInstanceField ("value__", g.ilg.typ_Int32, None, ILMemberAccess.Public)).WithSpecialName(true) |] |> Array.toList @@ -290,9 +285,7 @@ let GetDynamicallyAccessedMemberTypes (g: TcGlobals) = ("Interfaces", 8192) |] - (mkLocalPrivateInt32Enum (g, tref, values)) - .WithSerializable(true) - .WithSealed(true)) + (mkLocalPrivateInt32Enum (g, tref, values)).WithSerializable(true).WithSealed(true)) ) ILType.Value(mkILNonGenericTySpec (tref)) diff --git a/src/Compiler/DependencyManager/AssemblyResolveHandler.fs b/src/Compiler/DependencyManager/AssemblyResolveHandler.fs index 1f20caa392e..75f8797341d 100644 --- a/src/Compiler/DependencyManager/AssemblyResolveHandler.fs +++ b/src/Compiler/DependencyManager/AssemblyResolveHandler.fs @@ -15,25 +15,24 @@ type AssemblyResolutionProbe = delegate of Unit -> seq /// Type that encapsulates AssemblyResolveHandler for managed packages type AssemblyResolveHandlerCoreclr(assemblyProbingPaths: AssemblyResolutionProbe option) as this = let loadContextType = - !! Type.GetType("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader", false) + !!Type.GetType("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader", false) let loadFromAssemblyPathMethod = - !! loadContextType.GetMethod("LoadFromAssemblyPath", [| typeof |]) + !!loadContextType.GetMethod("LoadFromAssemblyPath", [| typeof |]) - let eventInfo = !! loadContextType.GetEvent("Resolving") + let eventInfo = !!loadContextType.GetEvent("Resolving") let handler, defaultAssemblyLoadContext = let ti = typeof let gmi = - !! ti.GetMethod("ResolveAssemblyNetStandard", BindingFlags.Instance ||| BindingFlags.NonPublic) + !!ti.GetMethod("ResolveAssemblyNetStandard", BindingFlags.Instance ||| BindingFlags.NonPublic) let mi = gmi.MakeGenericMethod(loadContextType) let del = Delegate.CreateDelegate(!!eventInfo.EventHandlerType, this, mi) let prop = - (!! loadContextType.GetProperty("Default", BindingFlags.Static ||| BindingFlags.Public)) - .GetValue(null, null) + (!!loadContextType.GetProperty("Default", BindingFlags.Static ||| BindingFlags.Public)).GetValue(null, null) del, prop @@ -41,7 +40,7 @@ type AssemblyResolveHandlerCoreclr(assemblyProbingPaths: AssemblyResolutionProbe member _.ResolveAssemblyNetStandard (ctxt: 'T) (assemblyName: AssemblyName) : Assembly = let loadAssembly path = - !! loadFromAssemblyPathMethod.Invoke(ctxt, [| path |]) :?> Assembly + !!loadFromAssemblyPathMethod.Invoke(ctxt, [| path |]) :?> Assembly let assemblyPaths = match assemblyProbingPaths with diff --git a/src/Compiler/DependencyManager/NativeDllResolveHandler.fs b/src/Compiler/DependencyManager/NativeDllResolveHandler.fs index 3c6bbe0a900..058dbedd0b7 100644 --- a/src/Compiler/DependencyManager/NativeDllResolveHandler.fs +++ b/src/Compiler/DependencyManager/NativeDllResolveHandler.fs @@ -72,9 +72,9 @@ type internal NativeDllResolveHandlerCoreClr(nativeProbingRoots: NativeResolutio let nativeLibraryTryLoad = let nativeLibraryType: Type = - !! Type.GetType("System.Runtime.InteropServices.NativeLibrary, System.Runtime.InteropServices", false) + !!Type.GetType("System.Runtime.InteropServices.NativeLibrary, System.Runtime.InteropServices", false) - !! nativeLibraryType.GetMethod("TryLoad", [| typeof; typeof.MakeByRefType() |]) + !!nativeLibraryType.GetMethod("TryLoad", [| typeof; typeof.MakeByRefType() |]) let loadNativeLibrary path = let arguments = [| path :> obj; IntPtr.Zero :> obj |] @@ -157,13 +157,12 @@ type internal NativeDllResolveHandlerCoreClr(nativeProbingRoots: NativeResolutio // netstandard 2.1 has this property, unfortunately we don't build with that yet //public event Func ResolvingUnmanagedDll let assemblyLoadContextType: Type = - !! Type.GetType("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader", false) + !!Type.GetType("System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader", false) let eventInfo, handler, defaultAssemblyLoadContext = - !! assemblyLoadContextType.GetEvent("ResolvingUnmanagedDll"), + !!assemblyLoadContextType.GetEvent("ResolvingUnmanagedDll"), Func resolveUnmanagedDll, - (!! assemblyLoadContextType.GetProperty("Default", BindingFlags.Static ||| BindingFlags.Public)) - .GetValue(null, null) + (!!assemblyLoadContextType.GetProperty("Default", BindingFlags.Static ||| BindingFlags.Public)).GetValue(null, null) do eventInfo.AddEventHandler(defaultAssemblyLoadContext, handler) diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index cf875be4959..cccbcb15810 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -218,7 +218,7 @@ type VersionFlag = else use fs = FileSystem.OpenFileForReadShim(s) use is = new StreamReader(fs) - !! is.ReadLine() + !!is.ReadLine() | VersionNone -> "0.0.0.0" /// Represents a reference to an assembly. May be backed by a real assembly on disk, or a cross-project @@ -680,7 +680,7 @@ type TcConfigBuilder = yield! (tcConfigB.referencedDLLs - |> Seq.map (fun ref -> !! Path.GetDirectoryName(ref.Text))) + |> Seq.map (fun ref -> !!Path.GetDirectoryName(ref.Text))) tcConfigB.implicitIncludeDir } @@ -1203,7 +1203,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = ComputeMakePathAbsolute data.implicitIncludeDir primaryAssemblyFilename try - let clrRoot = Some(!! Path.GetDirectoryName(FileSystem.GetFullPathShim fileName)) + let clrRoot = Some(!!Path.GetDirectoryName(FileSystem.GetFullPathShim fileName)) clrRoot, data.legacyReferenceResolver.Impl.HighestInstalledNetFrameworkVersion() with e -> // We no longer expect the above to fail but leaving this just in case @@ -1504,7 +1504,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = /// 'framework' reference set that is potentially shared across multiple compilations. member tcConfig.IsSystemAssembly(fileName: string) = try - let dirName = !! Path.GetDirectoryName(fileName) + let dirName = !!Path.GetDirectoryName(fileName) let baseName = FileSystemUtils.fileNameWithoutExtension fileName FileSystem.FileExistsShim fileName diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 7124c5ce1ac..9eb56d1cc54 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -721,10 +721,7 @@ type Exception with os.AppendString(SeeAlsoE().Format(stringOfRange m2)) | ConstraintSolverMissingConstraint(denv, tpr, tpc, m, m2) -> - os.AppendString( - ConstraintSolverMissingConstraintE() - .Format(NicePrint.stringOfTyparConstraint denv (tpr, tpc)) - ) + os.AppendString(ConstraintSolverMissingConstraintE().Format(NicePrint.stringOfTyparConstraint denv (tpr, tpc))) if m.StartLine <> m2.StartLine then os.AppendString(SeeAlsoE().Format(stringOfRange m)) @@ -1525,10 +1522,7 @@ type Exception with foundInContext |> ignore // suppress unused variable warning in RELEASE #endif let fix (s: string) = - s - .Replace(SR.GetString("FixKeyword"), "") - .Replace(SR.GetString("FixSymbol"), "") - .Replace(SR.GetString("FixReplace"), "") + s.Replace(SR.GetString("FixKeyword"), "").Replace(SR.GetString("FixSymbol"), "").Replace(SR.GetString("FixReplace"), "") let tokenNames = ctxt.ShiftTokens diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 7c4c81efd40..cdeda6b6566 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -248,7 +248,7 @@ module ResponseFile = let data = seq { while not reader.EndOfStream do - !! reader.ReadLine() + !!reader.ReadLine() } |> Seq.choose parseLine |> List.ofSeq @@ -701,7 +701,7 @@ let SetEmbedAllSourceSwitch (tcConfigB: TcConfigBuilder) switch = tcConfigB.embedAllSource <- false let setOutFileName tcConfigB (path: string) = - let outputDir = !! Path.GetDirectoryName(path) + let outputDir = !!Path.GetDirectoryName(path) tcConfigB.outputDir <- Some outputDir tcConfigB.outputFile <- Some path diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 5ed836631d7..6c7dfeb31b6 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -523,7 +523,7 @@ module MainModuleBuilder = $"%d{fileVersionInfo.Major}.%d{fileVersionInfo.Minor}.%d{fileVersionInfo.Build}.%d{fileVersionInfo.Revision}") ("ProductVersion", productVersionString) match tcConfig.outputFile with - | Some f -> ("OriginalFilename", !! Path.GetFileName(f)) + | Some f -> ("OriginalFilename", !!Path.GetFileName(f)) | None -> () yield! FindAttribute "Comments" "System.Reflection.AssemblyDescriptionAttribute" yield! FindAttribute "FileDescription" "System.Reflection.AssemblyTitleAttribute" diff --git a/src/Compiler/Driver/FxResolver.fs b/src/Compiler/Driver/FxResolver.fs index dfeff2cabf3..5f55f6abe97 100644 --- a/src/Compiler/Driver/FxResolver.fs +++ b/src/Compiler/Driver/FxResolver.fs @@ -98,13 +98,9 @@ type internal FxResolver p.WaitForExit() #if DEBUG if workingDir.IsSome then - FileSystem - .OpenFileForWriteShim(Path.Combine(workingDir.Value, "StandardOutput.txt")) - .WriteAllLines(outputList) + FileSystem.OpenFileForWriteShim(Path.Combine(workingDir.Value, "StandardOutput.txt")).WriteAllLines(outputList) - FileSystem - .OpenFileForWriteShim(Path.Combine(workingDir.Value, "StandardError.txt")) - .WriteAllLines(errorsList) + FileSystem.OpenFileForWriteShim(Path.Combine(workingDir.Value, "StandardError.txt")).WriteAllLines(errorsList) #endif p.ExitCode, outputList.ToArray(), errorsList.ToArray() else @@ -284,10 +280,7 @@ type internal FxResolver try let asm = typeof>.Assembly - if - (!!asm.FullName) - .StartsWith("System.ValueTuple", StringComparison.OrdinalIgnoreCase) - then + if (!!asm.FullName).StartsWith("System.ValueTuple", StringComparison.OrdinalIgnoreCase) then Some asm.Location else let valueTuplePath = @@ -498,7 +491,7 @@ type internal FxResolver try if FileSystem.FileExistsShim(reference) then // Reference is a path to a file on disk - !! Path.GetFileNameWithoutExtension(reference), reference + !!Path.GetFileNameWithoutExtension(reference), reference else // Reference is a SimpleAssembly name reference, frameworkPathFromSimpleName reference diff --git a/src/Compiler/Driver/OptimizeInputs.fs b/src/Compiler/Driver/OptimizeInputs.fs index 36eae5734ce..c79af5b33bc 100644 --- a/src/Compiler/Driver/OptimizeInputs.fs +++ b/src/Compiler/Driver/OptimizeInputs.fs @@ -28,9 +28,7 @@ let PrintWholeAssemblyImplementation (tcConfig: TcConfig) outfile header expr = let fileName = outfile + ".terms" use f = - FileSystem - .OpenFileForWriteShim(fileName + "-" + string showTermFileCount + "-" + header, FileMode.Create) - .GetWriter() + FileSystem.OpenFileForWriteShim(fileName + "-" + string showTermFileCount + "-" + header, FileMode.Create).GetWriter() showTermFileCount <- showTermFileCount + 1 LayoutRender.outL f (Display.squashTo 192 (DebugPrint.implFilesL expr)) @@ -306,17 +304,8 @@ let optimizeFilesSequentially optEnv (phases: PhaseInfo[]) implFiles = results, optEnvFirstLoop let ApplyAllOptimizations - ( - tcConfig: TcConfig, - tcGlobals, - tcVal, - outfile, - importMap, - isIncrementalFragment, - optEnv, - ccu: CcuThunk, - implFiles - ) = + (tcConfig: TcConfig, tcGlobals, tcVal, outfile, importMap, isIncrementalFragment, optEnv, ccu: CcuThunk, implFiles) + = // NOTE: optEnv - threads through // // Always optimize once - the results of this step give the x-module optimization @@ -562,15 +551,7 @@ let CreateIlxAssemblyGenerator (_tcConfig: TcConfig, tcImports: TcImports, tcGlo ilxGenerator let GenerateIlxCode - ( - ilxBackend, - isInteractiveItExpr, - tcConfig: TcConfig, - topAttrs: TopAttribs, - optimizedImpls, - fragName, - ilxGenerator: IlxAssemblyGenerator - ) = + (ilxBackend, isInteractiveItExpr, tcConfig: TcConfig, topAttrs: TopAttribs, optimizedImpls, fragName, ilxGenerator: IlxAssemblyGenerator) = let mainMethodInfo = if diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 975bfeef66f..6b7171b5697 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -352,7 +352,7 @@ type ModuleNamesDict = Map> /// Checks if a module name is already given and deduplicates the name if needed. let DeduplicateModuleName (moduleNamesDict: ModuleNamesDict) (fileName: string) (qualNameOfFile: QualifiedNameOfFile) = - let path = !! Path.GetDirectoryName(fileName) + let path = !!Path.GetDirectoryName(fileName) let path = if FileSystem.IsPathRootedShim path then @@ -433,7 +433,7 @@ let ParseInput "ParseAndCheckFile.parseFile" [| Activity.Tags.fileName, fileName - Activity.Tags.buildPhase, !! BuildPhase.Parse.ToString() + Activity.Tags.buildPhase, !!BuildPhase.Parse.ToString() Activity.Tags.userOpName, userOpName |> Option.defaultValue "" |] @@ -703,15 +703,8 @@ let checkInputFile (tcConfig: TcConfig) fileName = error (Error(FSComp.SR.buildInvalidSourceFileExtension (SanitizeFileName fileName tcConfig.implicitIncludeDir), rangeStartup)) let parseInputStreamAux - ( - tcConfig: TcConfig, - lexResourceManager, - fileName, - isLastCompiland, - diagnosticsLogger, - retryLocked, - stream: Stream - ) = + (tcConfig: TcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, retryLocked, stream: Stream) + = use reader = stream.GetReader(tcConfig.inputCodePage, retryLocked) // Set up the LexBuffer for the file @@ -722,14 +715,8 @@ let parseInputStreamAux ParseOneInputLexbuf(tcConfig, lexResourceManager, lexbuf, fileName, isLastCompiland, diagnosticsLogger) let parseInputSourceTextAux - ( - tcConfig: TcConfig, - lexResourceManager, - fileName, - isLastCompiland, - diagnosticsLogger, - sourceText: ISourceText - ) = + (tcConfig: TcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, sourceText: ISourceText) + = // Set up the LexBuffer for the file let lexbuf = UnicodeLexing.SourceTextAsLexbuf(not tcConfig.compilingFSharpCore, tcConfig.langVersion, tcConfig.strictIndentation, sourceText) @@ -751,15 +738,8 @@ let parseInputFileAux (tcConfig: TcConfig, lexResourceManager, fileName, isLastC /// Parse an input from stream let ParseOneInputStream - ( - tcConfig: TcConfig, - lexResourceManager, - fileName, - isLastCompiland, - diagnosticsLogger, - retryLocked, - stream: Stream - ) = + (tcConfig: TcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, retryLocked, stream: Stream) + = try parseInputStreamAux (tcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, retryLocked, stream) with RecoverableException exn -> @@ -768,14 +748,8 @@ let ParseOneInputStream /// Parse an input from source text let ParseOneInputSourceText - ( - tcConfig: TcConfig, - lexResourceManager, - fileName, - isLastCompiland, - diagnosticsLogger, - sourceText: ISourceText - ) = + (tcConfig: TcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, sourceText: ISourceText) + = try parseInputSourceTextAux (tcConfig, lexResourceManager, fileName, isLastCompiland, diagnosticsLogger, sourceText) with RecoverableException exn -> @@ -862,9 +836,11 @@ let ParseInputFiles (tcConfig: TcConfig, lexResourceManager, sourceFiles, diagno tcConfig.exiter.Exit 1 let ProcessMetaCommandsFromInput - (nowarnF: 'state -> range * string -> 'state, - hashReferenceF: 'state -> range * string * Directive -> 'state, - loadSourceF: 'state -> range * string -> unit) + ( + nowarnF: 'state -> range * string -> 'state, + hashReferenceF: 'state -> range * string * Directive -> 'state, + loadSourceF: 'state -> range * string -> unit + ) (tcConfig: TcConfigBuilder, inp: ParsedInput, pathOfMetaCommandSource, state0) = @@ -1520,16 +1496,18 @@ type NodeToTypeCheck = /// a callback functions that takes a `TcState` and will add the checked result to it. let CheckOneInputWithCallback (node: NodeToTypeCheck) - ((checkForErrors, - tcConfig: TcConfig, - tcImports: TcImports, - tcGlobals, - prefixPathOpt, - tcSink, - tcState: TcState, - input: ParsedInput, - _skipImplIfSigExists: bool): - (unit -> bool) * TcConfig * TcImports * TcGlobals * LongIdent option * TcResultsSink * TcState * ParsedInput * bool) + ( + (checkForErrors, + tcConfig: TcConfig, + tcImports: TcImports, + tcGlobals, + prefixPathOpt, + tcSink, + tcState: TcState, + input: ParsedInput, + _skipImplIfSigExists: bool): + (unit -> bool) * TcConfig * TcImports * TcGlobals * LongIdent option * TcResultsSink * TcState * ParsedInput * bool + ) : Cancellable> = cancellable { try @@ -1823,16 +1801,18 @@ let TransformDependencyGraph (graph: Graph, filePairs: FilePairMap) = /// Constructs a file dependency graph and type-checks the files in parallel where possible. let CheckMultipleInputsUsingGraphMode - ((ctok, checkForErrors, tcConfig: TcConfig, tcImports: TcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs): - 'a * - (unit -> bool) * - TcConfig * - TcImports * - TcGlobals * - LongIdent option * - TcState * - (PhasedDiagnostic -> PhasedDiagnostic) * - ParsedInput list) + ( + (ctok, checkForErrors, tcConfig: TcConfig, tcImports: TcImports, tcGlobals, prefixPathOpt, tcState, eagerFormat, inputs): + 'a * + (unit -> bool) * + TcConfig * + TcImports * + TcGlobals * + LongIdent option * + TcState * + (PhasedDiagnostic -> PhasedDiagnostic) * + ParsedInput list + ) : FinalFileResult list * TcState = use cts = new CancellationTokenSource() @@ -1864,9 +1844,7 @@ let CheckMultipleInputsUsingGraphMode graph |> Graph.map (fun idx -> let friendlyFileName = - sourceFiles[idx] - .FileName.Replace(tcConfig.implicitIncludeDir, "") - .TrimStart([| '\\'; '/' |]) + sourceFiles[idx].FileName.Replace(tcConfig.implicitIncludeDir, "").TrimStart([| '\\'; '/' |]) (idx, friendlyFileName)) |> Graph.writeMermaidToFile graphFile) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index 0e22231abb8..b8acfe76441 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -159,7 +159,7 @@ module ScriptPreprocessClosure = reduceMemoryUsage ) = - let projectDir = !! Path.GetDirectoryName(fileName) + let projectDir = !!Path.GetDirectoryName(fileName) let isInteractive = (codeContext = CodeContext.CompilationAndEvaluation) let isInvalidationSupported = (codeContext = CodeContext.Editing) @@ -259,12 +259,8 @@ module ScriptPreprocessClosure = [] let ApplyMetaCommandsFromInputToTcConfigAndGatherNoWarn - ( - tcConfig: TcConfig, - inp: ParsedInput, - pathOfMetaCommandSource, - dependencyProvider - ) = + (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource, dependencyProvider) + = let tcConfigB = tcConfig.CloneToBuilder() let mutable nowarns = [] @@ -460,7 +456,7 @@ module ScriptPreprocessClosure = let diagnosticsLogger = CapturingDiagnosticsLogger("FindClosureMetaCommands") use _ = UseDiagnosticsLogger diagnosticsLogger - let pathOfMetaCommandSource = !! Path.GetDirectoryName(fileName) + let pathOfMetaCommandSource = !!Path.GetDirectoryName(fileName) let preSources = tcConfig.GetAvailableLoadedSources() let tcConfigResult, noWarns = @@ -710,13 +706,8 @@ module ScriptPreprocessClosure = /// Given source file fileName, find the full load closure /// Used from fsi.fs and fsc.fs, for #load and command line let GetFullClosureOfScriptFiles - ( - tcConfig: TcConfig, - files: (string * range) list, - codeContext, - lexResourceManager: Lexhelp.LexResourceManager, - dependencyProvider - ) = + (tcConfig: TcConfig, files: (string * range) list, codeContext, lexResourceManager: Lexhelp.LexResourceManager, dependencyProvider) + = let mainFile, _mainFileRange = List.last files diff --git a/src/Compiler/Driver/StaticLinking.fs b/src/Compiler/Driver/StaticLinking.fs index 53916744622..3624ecef9b2 100644 --- a/src/Compiler/Driver/StaticLinking.fs +++ b/src/Compiler/Driver/StaticLinking.fs @@ -104,13 +104,8 @@ let debugStaticLinking = isEnvVarSet "FSHARP_DEBUG_STATIC_LINKING" #endif let StaticLinkILModules - ( - tcConfig: TcConfig, - ilGlobals, - tcImports, - ilxMainModule, - dependentILModules: (CcuThunk option * ILModuleDef) list - ) = + (tcConfig: TcConfig, ilGlobals, tcImports, ilxMainModule, dependentILModules: (CcuThunk option * ILModuleDef) list) + = if isNil dependentILModules then ilxMainModule, id else diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 0e26f2db4ac..3518d9d4884 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -139,18 +139,8 @@ let AbortOnError (diagnosticsLogger: DiagnosticsLogger, exiter: Exiter) = exiter.Exit 1 let TypeCheck - ( - ctok, - tcConfig, - tcImports, - tcGlobals, - diagnosticsLogger: DiagnosticsLogger, - assemblyName, - tcEnv0, - openDecls0, - inputs, - exiter: Exiter - ) = + (ctok, tcConfig, tcImports, tcGlobals, diagnosticsLogger: DiagnosticsLogger, assemblyName, tcEnv0, openDecls0, inputs, exiter: Exiter) + = try if isNil inputs then error (Error(FSComp.SR.fscNoImplementationFiles (), rangeStartup)) @@ -346,9 +336,7 @@ module InterfaceFileWriter = if String.IsNullOrEmpty(tcConfig.printSignatureFile) then Console.Out else - FileSystem - .OpenFileForWriteShim(tcConfig.printSignatureFile, FileMode.Create) - .GetWriter() + FileSystem.OpenFileForWriteShim(tcConfig.printSignatureFile, FileMode.Create).GetWriter() writeHeader tcConfig.printSignatureFile os @@ -367,7 +355,7 @@ module InterfaceFileWriter = let writeToSeparateFiles (declaredImpls: CheckedImplFile list) = for CheckedImplFile(qualifiedNameOfFile = name) as impl in declaredImpls do let fileName = - !! Path.ChangeExtension(name.Range.FileName, extensionForFile name.Range.FileName) + !!Path.ChangeExtension(name.Range.FileName, extensionForFile name.Range.FileName) printfn "writing impl file to %s" fileName use os = FileSystem.OpenFileForWriteShim(fileName, FileMode.Create).GetWriter() @@ -388,7 +376,7 @@ module InterfaceFileWriter = // 2) If not, but FSharp.Core.dll exists beside the compiler binaries, it will copy it to output directory. // 3) If not, it will produce an error. let CopyFSharpCore (outFile: string, referencedDlls: AssemblyReference list) = - let outDir = !! Path.GetDirectoryName(outFile) + let outDir = !!Path.GetDirectoryName(outFile) let fsharpCoreAssemblyName = GetFSharpCoreLibraryName() + ".dll" let fsharpCoreDestinationPath = Path.Combine(outDir, fsharpCoreAssemblyName) @@ -408,7 +396,7 @@ let CopyFSharpCore (outFile: string, referencedDlls: AssemblyReference list) = | Some referencedFsharpCoreDll -> copyFileIfDifferent referencedFsharpCoreDll.Text fsharpCoreDestinationPath | None -> let executionLocation = Assembly.GetExecutingAssembly().Location - let compilerLocation = !! Path.GetDirectoryName(executionLocation) + let compilerLocation = !!Path.GetDirectoryName(executionLocation) let compilerFsharpCoreDllPath = Path.Combine(compilerLocation, fsharpCoreAssemblyName) diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 2e9137fc75d..7d902aefc27 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -14,9 +14,7 @@ open Internal.Utilities.Library module internal FSharpEnvironment = - type private TypeInThisAssembly = - class - end + type private TypeInThisAssembly = class end /// The F# version reported in the banner let FSharpBannerVersion = @@ -90,7 +88,7 @@ module internal FSharpEnvironment = let fallback () = let d = Assembly.GetExecutingAssembly() - Some(!! Path.GetDirectoryName(d.Location)) + Some(!!Path.GetDirectoryName(d.Location)) match tryCurrentDomain () with | None -> fallback () @@ -171,12 +169,8 @@ module internal FSharpEnvironment = } let getTypeProviderAssembly - ( - runTimeAssemblyFileName: string, - designTimeAssemblyName: string, - compilerToolPaths: string list, - raiseError - ) = + (runTimeAssemblyFileName: string, designTimeAssemblyName: string, compilerToolPaths: string list, raiseError) + = // Find and load the designer assembly for the type provider component. // We look in the directories stepping up from the location of the runtime assembly. let loadFromLocation designTimeAssemblyPath = @@ -213,7 +207,7 @@ module internal FSharpEnvironment = | Some res -> loadFromLocation res | None -> // The search failed, just load from the first location and report an error - let runTimeAssemblyPath = !! Path.GetDirectoryName(runTimeAssemblyFileName) + let runTimeAssemblyPath = !!Path.GetDirectoryName(runTimeAssemblyFileName) loadFromLocation (Path.Combine(runTimeAssemblyPath, designTimeAssemblyName)) if designTimeAssemblyName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) then @@ -224,7 +218,7 @@ module internal FSharpEnvironment = // design-time DLLs specified using "x.DesignTIme, Version= ..." long assembly names and GAC loads. // These kind of design-time assembly specifications are no longer used to our knowledge so that comparison is basically legacy // and will always succeed. - let name = AssemblyName(!! Path.GetFileNameWithoutExtension(designTimeAssemblyName)) + let name = AssemblyName(!!Path.GetFileNameWithoutExtension(designTimeAssemblyName)) if name.FullName.Equals(name.Name, StringComparison.OrdinalIgnoreCase) then let designTimeFileName = designTimeAssemblyName + ".dll" @@ -276,7 +270,7 @@ module internal FSharpEnvironment = // Must be alongside the location of FSharp.CompilerService.dll let getDefaultFsiLibraryLocation () = - Path.Combine(!! Path.GetDirectoryName(getFSharpCompilerLocation ()), fsiLibraryName + ".dll") + Path.Combine(!!Path.GetDirectoryName(getFSharpCompilerLocation ()), fsiLibraryName + ".dll") let isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) @@ -355,12 +349,12 @@ module internal FSharpEnvironment = [| match getDotnetHostPath (), getDotnetGlobalHostPath () with | Some hostPath, Some globalHostPath -> - yield !! Path.GetDirectoryName(hostPath) + yield !!Path.GetDirectoryName(hostPath) if isDotnetMultilevelLookup && hostPath <> globalHostPath then - yield !! Path.GetDirectoryName(globalHostPath) - | Some hostPath, None -> yield !! Path.GetDirectoryName(hostPath) - | None, Some globalHostPath -> yield !! Path.GetDirectoryName(globalHostPath) + yield !!Path.GetDirectoryName(globalHostPath) + | Some hostPath, None -> yield !!Path.GetDirectoryName(hostPath) + | None, Some globalHostPath -> yield !!Path.GetDirectoryName(globalHostPath) | None, None -> () |] diff --git a/src/Compiler/Facilities/DiagnosticsLogger.fs b/src/Compiler/Facilities/DiagnosticsLogger.fs index e5869fe04b2..eb96a5f6e0b 100644 --- a/src/Compiler/Facilities/DiagnosticsLogger.fs +++ b/src/Compiler/Facilities/DiagnosticsLogger.fs @@ -435,8 +435,7 @@ module DiagnosticsLoggerExtensions = try if not tryAndDetectDev15 then let preserveStackTrace = - !!typeof - .GetMethod("InternalPreserveStackTrace", BindingFlags.Instance ||| BindingFlags.NonPublic) + !!typeof.GetMethod("InternalPreserveStackTrace", BindingFlags.Instance ||| BindingFlags.NonPublic) preserveStackTrace.Invoke(exn, null) |> ignore with _ -> diff --git a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs index c9f84390367..dc0e30cac72 100644 --- a/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs +++ b/src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs @@ -82,7 +82,7 @@ let private SimulatedMSBuildResolver = if Environment.OSVersion.Platform = PlatformID.Win32NT then let PF = match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with - | null -> !! Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF + | null -> !!Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF | s -> s PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework" @@ -150,7 +150,7 @@ let private SimulatedMSBuildResolver = let fscoreDir0 = let PF = match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with - | null -> !! Environment.GetEnvironmentVariable("ProgramFiles") + | null -> !!Environment.GetEnvironmentVariable("ProgramFiles") | s -> s PF @@ -198,7 +198,7 @@ let private SimulatedMSBuildResolver = let netFx = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() let gac = - Path.Combine(!! Path.GetDirectoryName(Path.GetDirectoryName(netFx.TrimEnd('\\'))), "assembly") + Path.Combine(!!Path.GetDirectoryName(Path.GetDirectoryName(netFx.TrimEnd('\\'))), "assembly") match n.Version, n.GetPublicKeyToken() with | null, _ diff --git a/src/Compiler/Facilities/prim-lexing.fs b/src/Compiler/Facilities/prim-lexing.fs index c305052587c..381e11eaa3a 100644 --- a/src/Compiler/Facilities/prim-lexing.fs +++ b/src/Compiler/Facilities/prim-lexing.fs @@ -192,7 +192,7 @@ module SourceTextNew = member _.GetChecksum() = // TODO: something better... - !! sourceText.ToString() + !!sourceText.ToString() |> Md5Hasher.hashString |> fun byteArray -> ImmutableArray.Create(byteArray, 0, byteArray.Length) } @@ -356,12 +356,8 @@ and [] internal LexBuffer<'Char> FSharp.Compiler.DiagnosticsLogger.checkLanguageFeatureAndRecover langVersion featureId range static member FromFunction - ( - reportLibraryOnlyFeatures, - langVersion, - strictIndentation, - f: 'Char[] * int * int -> int - ) : LexBuffer<'Char> = + (reportLibraryOnlyFeatures, langVersion, strictIndentation, f: 'Char[] * int * int -> int) + : LexBuffer<'Char> = let extension = Array.zeroCreate 4096 let filler (lexBuffer: LexBuffer<'Char>) = @@ -385,8 +381,7 @@ and [] internal LexBuffer<'Char> static member FromArray(reportLibraryOnlyFeatures, langVersion, strictIndentation, s: 'Char[]) : LexBuffer<'Char> = let buffer = Array.copy s - LexBuffer<'Char> - .FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, strictIndentation, buffer) + LexBuffer<'Char>.FromArrayNoCopy(reportLibraryOnlyFeatures, langVersion, strictIndentation, buffer) // Important: This method takes ownership of the array static member FromChars(reportLibraryOnlyFeatures, langVersion, strictIndentation, arr: char[]) = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index eaba5aa6582..78d5cb94dcd 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -128,7 +128,7 @@ module internal Utilities = } else let specialized = typedefof>.MakeGenericType [| ty |] - !! Activator.CreateInstance(specialized) :?> IAnyToLayoutCall + !!Activator.CreateInstance(specialized) :?> IAnyToLayoutCall let callStaticMethod (ty: Type) name args = ty.InvokeMember( @@ -395,7 +395,7 @@ type ILMultiInMemoryAssemblyEmitEnv and convTypeAux ty = match ty with - | ILType.Void -> !! Type.GetType("System.Void") + | ILType.Void -> !!Type.GetType("System.Void") | ILType.Array(shape, eltType) -> let baseT = convTypeAux eltType @@ -442,7 +442,7 @@ type ILMultiInMemoryAssemblyEmitEnv let ltref = mkRefForNestedILTypeDef ILScopeRef.Local (enc, tdef) let tref = mkRefForNestedILTypeDef ilScopeRef (enc, tdef) let key = tref.BasicQualifiedName - let typ = !! asm.GetType(key) + let typ = !!asm.GetType(key) //printfn "Adding %s --> %s" key typ.FullName let rtref = rescopeILTypeRef dynamicCcuScopeRef tref typeMap.Add(ltref, (typ, tref)) @@ -1581,7 +1581,7 @@ let rec ConvReflectionTypeToILType (reflectionTy: Type) = let elementOrItemTref = if reflectionTy.HasElementType then - !! reflectionTy.GetElementType() + !!reflectionTy.GetElementType() else reflectionTy |> ConvReflectionTypeToILTypeRef @@ -1904,7 +1904,7 @@ type internal FsiDynamicCompiler if edef.ArgCount = 0 then yield (fun () -> - let typ = !! asm.GetType(edef.DeclaringTypeRef.BasicQualifiedName) + let typ = !!asm.GetType(edef.DeclaringTypeRef.BasicQualifiedName) try ignore ( @@ -2438,14 +2438,8 @@ type internal FsiDynamicCompiler /// Evaluate the given definitions and produce a new interactive state. member _.EvalParsedDefinitions - ( - ctok, - diagnosticsLogger: DiagnosticsLogger, - istate, - showTypes, - isInteractiveItExpr, - defs: SynModuleDecl list - ) = + (ctok, diagnosticsLogger: DiagnosticsLogger, istate, showTypes, isInteractiveItExpr, defs: SynModuleDecl list) + = let fileName = stdinMockFileName let m = @@ -2681,12 +2675,8 @@ type internal FsiDynamicCompiler member _.HasDelayedDependencyManagerText = hasDelayedDependencyManagerText member fsiDynamicCompiler.ProcessDelayedDependencyManagerText - ( - ctok, - istate: FsiDynamicCompilerState, - lexResourceManager, - diagnosticsLogger - ) = + (ctok, istate: FsiDynamicCompilerState, lexResourceManager, diagnosticsLogger) + = if not hasDelayedDependencyManagerText then istate else @@ -2828,12 +2818,8 @@ type internal FsiDynamicCompiler /// Scrape #r, #I and package manager commands from a #load member fsiDynamicCompiler.ProcessMetaCommandsFromParsedInputAsInteractiveCommands - ( - ctok, - istate: FsiDynamicCompilerState, - sourceFile, - input - ) = + (ctok, istate: FsiDynamicCompilerState, sourceFile, input) + = WithImplicitHome (tcConfigB, directoryName sourceFile) (fun () -> ProcessMetaCommandsFromInput ((fun st (m, nm) -> @@ -2845,7 +2831,7 @@ type internal FsiDynamicCompiler st), (fun _ _ -> ())) - (tcConfigB, input, !! Path.GetDirectoryName(sourceFile), istate)) + (tcConfigB, input, !!Path.GetDirectoryName(sourceFile), istate)) member fsiDynamicCompiler.EvalSourceFiles(ctok, istate, m, sourceFiles, lexResourceManager, diagnosticsLogger: DiagnosticsLogger) = let tcConfig = TcConfig.Create(tcConfigB, validate = false) @@ -4468,11 +4454,8 @@ let internal SpawnThread name f = th.Start() let internal SpawnInteractiveServer - ( - fsi: FsiEvaluationSessionHostConfig, - fsiOptions: FsiCommandLineOptions, - fsiConsoleOutput: FsiConsoleOutput - ) = + (fsi: FsiEvaluationSessionHostConfig, fsiOptions: FsiCommandLineOptions, fsiConsoleOutput: FsiConsoleOutput) + = //printf "Spawning fsi server on channel '%s'" !fsiServerName; SpawnThread "ServerThread" (fun () -> use _scope = SetCurrentUICultureForThread fsiOptions.FsiLCID @@ -4486,11 +4469,8 @@ let internal SpawnInteractiveServer /// /// This gives us a last chance to catch an abort on the main execution thread. let internal DriveFsiEventLoop - ( - fsi: FsiEvaluationSessionHostConfig, - fsiInterruptController: FsiInterruptController, - fsiConsoleOutput: FsiConsoleOutput - ) = + (fsi: FsiEvaluationSessionHostConfig, fsiInterruptController: FsiInterruptController, fsiConsoleOutput: FsiConsoleOutput) + = if progress then fprintfn fsiConsoleOutput.Out "GUI thread runLoop" @@ -4770,7 +4750,7 @@ type FsiEvaluationSession let makeNestedException (userExn: #Exception) = // clone userExn -- make userExn the inner exception, to retain the stacktrace on raise let arguments = [| userExn.Message :> obj; userExn :> obj |] - !! Activator.CreateInstance(userExn.GetType(), arguments) :?> Exception + !!Activator.CreateInstance(userExn.GetType(), arguments) :?> Exception let commitResult res = match res with diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 329fd21c63d..c55da121cdc 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -578,14 +578,8 @@ type internal BackgroundCompiler res) member _.ParseFile - ( - fileName: string, - sourceText: ISourceText, - options: FSharpParsingOptions, - cache: bool, - flatErrors: bool, - userOpName: string - ) = + (fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, flatErrors: bool, userOpName: string) + = async { use _ = Activity.start @@ -781,14 +775,8 @@ type internal BackgroundCompiler /// Type-check the result obtained by parsing, but only if the antecedent type checking context is available. member bc.CheckFileInProjectAllowingStaleCachedResults - ( - parseResults: FSharpParseFileResults, - fileName, - fileVersion, - sourceText: ISourceText, - options, - userOpName - ) = + (parseResults: FSharpParseFileResults, fileName, fileVersion, sourceText: ISourceText, options, userOpName) + = async { use _ = Activity.start @@ -841,14 +829,8 @@ type internal BackgroundCompiler /// Type-check the result obtained by parsing. Force the evaluation of the antecedent type checking context if needed. member bc.CheckFileInProject - ( - parseResults: FSharpParseFileResults, - fileName, - fileVersion, - sourceText: ISourceText, - options, - userOpName - ) = + (parseResults: FSharpParseFileResults, fileName, fileVersion, sourceText: ISourceText, options, userOpName) + = async { use _ = Activity.start @@ -890,13 +872,8 @@ type internal BackgroundCompiler /// Parses and checks the source file and returns untyped AST and check results. member bc.ParseAndCheckFileInProject - ( - fileName: string, - fileVersion, - sourceText: ISourceText, - options: FSharpProjectOptions, - userOpName - ) = + (fileName: string, fileVersion, sourceText: ISourceText, options: FSharpProjectOptions, userOpName) + = async { use _ = Activity.start @@ -1090,13 +1067,8 @@ type internal BackgroundCompiler } member _.FindReferencesInFile - ( - fileName: string, - options: FSharpProjectOptions, - symbol: FSharpSymbol, - canInvalidateProject: bool, - userOpName: string - ) = + (fileName: string, options: FSharpProjectOptions, symbol: FSharpSymbol, canInvalidateProject: bool, userOpName: string) + = async { use _ = Activity.start @@ -1150,12 +1122,8 @@ type internal BackgroundCompiler /// Try to get recent approximate type check results for a file. member _.TryGetRecentCheckResultsForFile - ( - fileName: string, - options: FSharpProjectOptions, - sourceText: ISourceText option, - _userOpName: string - ) = + (fileName: string, options: FSharpProjectOptions, sourceText: ISourceText option, _userOpName: string) + = use _ = Activity.start "BackgroundCompiler.GetSemanticClassificationForFile" @@ -1539,13 +1507,8 @@ type internal BackgroundCompiler member _.FileParsed: IEvent = self.FileParsed member _.FindReferencesInFile - ( - fileName: string, - options: FSharpProjectOptions, - symbol: FSharpSymbol, - canInvalidateProject: bool, - userOpName: string - ) : Async> = + (fileName: string, options: FSharpProjectOptions, symbol: FSharpSymbol, canInvalidateProject: bool, userOpName: string) + : Async> = self.FindReferencesInFile(fileName, options, symbol, canInvalidateProject, userOpName) member this.FindReferencesInFile(fileName, projectSnapshot, symbol, userOpName) = @@ -1557,36 +1520,23 @@ type internal BackgroundCompiler self.GetAssemblyData(options, userOpName) member _.GetAssemblyData - ( - projectSnapshot: FSharpProjectSnapshot, - _fileName: string, - userOpName: string - ) : Async = + (projectSnapshot: FSharpProjectSnapshot, _fileName: string, userOpName: string) + : Async = self.GetAssemblyData(projectSnapshot.ToOptions(), userOpName) member _.GetBackgroundCheckResultsForFileInProject - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = self.GetBackgroundCheckResultsForFileInProject(fileName, options, userOpName) member _.GetBackgroundParseResultsForFileInProject - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = self.GetBackgroundParseResultsForFileInProject(fileName, options, userOpName) member _.GetCachedCheckFileResult - ( - builder: IncrementalBuilder, - fileName: string, - sourceText: ISourceText, - options: FSharpProjectOptions - ) : Async<(FSharpParseFileResults * FSharpCheckFileResults) option> = + (builder: IncrementalBuilder, fileName: string, sourceText: ISourceText, options: FSharpProjectOptions) + : Async<(FSharpParseFileResults * FSharpCheckFileResults) option> = self.GetCachedCheckFileResult(builder, fileName, sourceText, options) member _.GetProjectOptionsFromScript @@ -1653,19 +1603,13 @@ type internal BackgroundCompiler } member _.GetSemanticClassificationForFile - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = self.GetSemanticClassificationForFile(fileName, options, userOpName) member _.GetSemanticClassificationForFile - ( - fileName: string, - snapshot: FSharpProjectSnapshot, - userOpName: string - ) : Async = + (fileName: string, snapshot: FSharpProjectSnapshot, userOpName: string) + : Async = self.GetSemanticClassificationForFile(fileName, snapshot.ToOptions(), userOpName) member _.InvalidateConfiguration(options: FSharpProjectOptions, userOpName: string) : unit = @@ -1682,21 +1626,13 @@ type internal BackgroundCompiler self.NotifyProjectCleaned(options, userOpName) member _.ParseAndCheckFileInProject - ( - fileName: string, - fileVersion: int, - sourceText: ISourceText, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, fileVersion: int, sourceText: ISourceText, options: FSharpProjectOptions, userOpName: string) + : Async = self.ParseAndCheckFileInProject(fileName, fileVersion, sourceText, options, userOpName) member _.ParseAndCheckFileInProject - ( - fileName: string, - projectSnapshot: FSharpProjectSnapshot, - userOpName: string - ) : Async = + (fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) + : Async = async { let fileSnapshot = projectSnapshot.ProjectSnapshot.SourceFiles @@ -1715,14 +1651,8 @@ type internal BackgroundCompiler self.ParseAndCheckProject(projectSnapshot.ToOptions(), userOpName) member _.ParseFile - ( - fileName: string, - sourceText: ISourceText, - options: FSharpParsingOptions, - cache: bool, - flatErrors: bool, - userOpName: string - ) = + (fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, flatErrors: bool, userOpName: string) + = self.ParseFile(fileName, sourceText, options, cache, flatErrors, userOpName) member _.ParseFile(fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) = @@ -1733,18 +1663,11 @@ type internal BackgroundCompiler member _.ProjectChecked: IEvent = self.ProjectChecked member _.TryGetRecentCheckResultsForFile - ( - fileName: string, - options: FSharpProjectOptions, - sourceText: ISourceText option, - userOpName: string - ) : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option = + (fileName: string, options: FSharpProjectOptions, sourceText: ISourceText option, userOpName: string) + : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option = self.TryGetRecentCheckResultsForFile(fileName, options, sourceText, userOpName) member _.TryGetRecentCheckResultsForFile - ( - fileName: string, - projectSnapshot: FSharpProjectSnapshot, - userOpName: string - ) : (FSharpParseFileResults * FSharpCheckFileResults) option = + (fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) + : (FSharpParseFileResults * FSharpCheckFileResults) option = self.TryGetRecentCheckResultsForFile(fileName, projectSnapshot, userOpName) diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 8cb27875075..c4b65045b6b 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -188,7 +188,7 @@ and FSharpProjectOptions = && options1.ReferencedProjects = options2.ReferencedProjects && options1.LoadTime = options2.LoadTime - member po.ProjectDirectory = !! Path.GetDirectoryName(po.ProjectFileName) + member po.ProjectDirectory = !!Path.GetDirectoryName(po.ProjectFileName) override this.ToString() = "FSharpProjectOptions(" + this.ProjectFileName + ")" @@ -2042,15 +2042,8 @@ type internal TypeCheckInfo /// Get the auto-complete items at a location member _.GetDeclarations - ( - parseResultsOpt, - line, - lineStr, - partialName, - completionContextAtPos, - getAllEntities, - genBodyForOverriddenMeth - ) = + (parseResultsOpt, line, lineStr, partialName, completionContextAtPos, getAllEntities, genBodyForOverriddenMeth) + = let isSigFile = SourceFileImpl.IsSignatureFile mainInputFileName DiagnosticsScope.Protect @@ -3109,14 +3102,8 @@ module internal ParseAndCheckFile = errHandler.CollectedDiagnostics(None), parseResult, errHandler.AnyErrors let ApplyLoadClosure - ( - tcConfig, - parsedMainInput, - mainInputFileName: string, - loadClosure: LoadClosure option, - tcImports: TcImports, - backgroundDiagnostics - ) = + (tcConfig, parsedMainInput, mainInputFileName: string, loadClosure: LoadClosure option, tcImports: TcImports, backgroundDiagnostics) + = // If additional references were brought in by the preprocessor then we need to process them match loadClosure with @@ -3204,7 +3191,7 @@ module internal ParseAndCheckFile = ApplyMetaCommandsFromInputToTcConfig( tcConfig, parsedMainInput, - !! Path.GetDirectoryName(mainInputFileName), + !!Path.GetDirectoryName(mainInputFileName), tcImports.DependencyProvider ) |> ignore @@ -3255,7 +3242,7 @@ module internal ParseAndCheckFile = // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) let tcConfig = - ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !! Path.GetDirectoryName(mainInputFileName)) + ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !!Path.GetDirectoryName(mainInputFileName)) // update the error handler with the modified tcConfig errHandler.DiagnosticOptions <- tcConfig.diagnosticsOptions @@ -3383,15 +3370,8 @@ type FSharpCheckFileResults /// Intellisense autocompletions member _.GetDeclarationListInfo - ( - parsedFileResults, - line, - lineText, - partialName, - ?getAllEntities, - ?completionContextAtPos, - ?genBodyForOverriddenMeth - ) = + (parsedFileResults, line, lineText, partialName, ?getAllEntities, ?completionContextAtPos, ?genBodyForOverriddenMeth) + = let getAllEntities = defaultArg getAllEntities (fun () -> []) let genBodyForOverriddenMeth = defaultArg genBodyForOverriddenMeth true @@ -3638,12 +3618,7 @@ type FSharpCheckFileResults FSharpCheckFileResults(fileName, creationErrors, None, [||], None, keepAssemblyContents) static member JoinErrors - ( - isIncompleteTypeCheckEnvironment, - creationErrors: FSharpDiagnostic[], - parseErrors: FSharpDiagnostic[], - tcErrors: FSharpDiagnostic[] - ) = + (isIncompleteTypeCheckEnvironment, creationErrors: FSharpDiagnostic[], parseErrors: FSharpDiagnostic[], tcErrors: FSharpDiagnostic[]) = [| yield! creationErrors yield! parseErrors diff --git a/src/Compiler/Service/FSharpProjectSnapshot.fs b/src/Compiler/Service/FSharpProjectSnapshot.fs index 030d070a375..8ca44143037 100644 --- a/src/Compiler/Service/FSharpProjectSnapshot.fs +++ b/src/Compiler/Service/FSharpProjectSnapshot.fs @@ -436,15 +436,18 @@ and [] Proj ((projectFileName, outputFileNameValue.Value |> Option.defaultValue "") |> FSharpProjectIdentifier) - new(projectFileName: string, - outputFileName: string option, - referencesOnDisk: string seq, - otherOptions: string seq, - ?isIncompleteTypeCheckEnvironment: bool, - ?useScriptResolutionRules: bool, - ?loadTime: DateTime, - ?stamp: int64, - ?projectId: string) = + new + ( + projectFileName: string, + outputFileName: string option, + referencesOnDisk: string seq, + otherOptions: string seq, + ?isIncompleteTypeCheckEnvironment: bool, + ?useScriptResolutionRules: bool, + ?loadTime: DateTime, + ?stamp: int64, + ?projectId: string + ) = let referencesOnDisk = referencesOnDisk @@ -469,7 +472,7 @@ and [] Proj projectId = projectId ) - member val ProjectDirectory = !! Path.GetDirectoryName(projectFileName) + member val ProjectDirectory = !!Path.GetDirectoryName(projectFileName) member _.OutputFileName = outputFileNameValue.Value member _.Identifier = identifier.Value member _.Version = fullHash.Value @@ -726,13 +729,8 @@ and [] FSha ) static member FromOptions - ( - options: FSharpProjectOptions, - fileName: string, - fileVersion: int, - sourceText: ISourceText, - documentSource: DocumentSource - ) = + (options: FSharpProjectOptions, fileName: string, fileVersion: int, sourceText: ISourceText, documentSource: DocumentSource) + = let getFileSnapshot _ fName = if fName = fileName then diff --git a/src/Compiler/Service/FSharpWorkspaceState.fs b/src/Compiler/Service/FSharpWorkspaceState.fs index cc3d3d8524d..b7a3a70dd89 100644 --- a/src/Compiler/Service/FSharpWorkspaceState.fs +++ b/src/Compiler/Service/FSharpWorkspaceState.fs @@ -148,10 +148,8 @@ module internal WorkspaceDependencyGraphExtensions = [] static member AddProjectWithoutFiles - ( - this: GraphBuilder<_, _, (ProjectConfig * FSharpProjectSnapshot seq), _>, - computeProjectWithoutFiles - ) = + (this: GraphBuilder<_, _, (ProjectConfig * FSharpProjectSnapshot seq), _>, computeProjectWithoutFiles) + = this.AddDependentNode( WorkspaceNodeKey.ProjectWithoutFiles this.State, computeProjectWithoutFiles >> WorkspaceNodeValue.ProjectWithoutFiles, @@ -174,10 +172,8 @@ module internal WorkspaceDependencyGraphExtensions = [] static member AddProjectSnapshot - ( - this: GraphBuilder<_, _, (ProjectWithoutFiles * FSharpFileSnapshot seq), _>, - computeProjectSnapshot - ) = + (this: GraphBuilder<_, _, (ProjectWithoutFiles * FSharpFileSnapshot seq), _>, computeProjectSnapshot) + = this.AddDependentNode( WorkspaceNodeKey.ProjectSnapshot this.State, @@ -199,9 +195,7 @@ module internal WorkspaceDependencyGraphExtensions = [] static member GetProjectSnapshot(this: IDependencyGraph<_, _>, project) = - this - .GetValue(WorkspaceNodeKey.ProjectSnapshot project) - .Unpack(WorkspaceNode.projectSnapshot) + this.GetValue(WorkspaceNodeKey.ProjectSnapshot project).Unpack(WorkspaceNode.projectSnapshot) [] static member GetProjectReferencesOf(this: IDependencyGraph<_, _>, project) = @@ -212,9 +206,7 @@ module internal WorkspaceDependencyGraphExtensions = [] static member GetProjectsThatReference(this: IDependencyGraph<_, _>, dllPath) = - this - .GetDependentsOf(WorkspaceNodeKey.ReferenceOnDisk dllPath) - .UnpackMany(WorkspaceNode.projectConfigKey) + this.GetDependentsOf(WorkspaceNodeKey.ReferenceOnDisk dllPath).UnpackMany(WorkspaceNode.projectConfigKey) [] static member GetProjectsContaining(this: IDependencyGraph<_, _>, file) = diff --git a/src/Compiler/Service/SemanticClassification.fs b/src/Compiler/Service/SemanticClassification.fs index 3de24222311..f384cabebdc 100644 --- a/src/Compiler/Service/SemanticClassification.fs +++ b/src/Compiler/Service/SemanticClassification.fs @@ -135,12 +135,8 @@ module TcResolutionsExtensions = type TcResolutions with member sResolutions.GetSemanticClassification - ( - g: TcGlobals, - amap: ImportMap, - formatSpecifierLocations: (range * int)[], - range: range option - ) : SemanticClassificationItem[] = + (g: TcGlobals, amap: ImportMap, formatSpecifierLocations: (range * int)[], range: range option) + : SemanticClassificationItem[] = DiagnosticsScope.Protect range0 (fun () -> diff --git a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs index fb3e8dfbecc..94051957876 100644 --- a/src/Compiler/Service/ServiceInterfaceStubGenerator.fs +++ b/src/Compiler/Service/ServiceInterfaceStubGenerator.fs @@ -41,7 +41,7 @@ module internal CodeGenerationUtils = member _.Unindent i = indentWriter.Indent <- max 0 (indentWriter.Indent - i) - member _.Dump() = !! indentWriter.InnerWriter.ToString() + member _.Dump() = !!indentWriter.InnerWriter.ToString() interface IDisposable with member _.Dispose() = diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 083bae1d6d8..8e97816290f 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -1920,17 +1920,8 @@ module FSharpLexerImpl = type FSharpLexer = static member Tokenize - ( - text: ISourceText, - tokenCallback, - ?langVersion, - ?strictIndentation, - ?filePath: string, - ?conditionalDefines, - ?flags, - ?pathMap, - ?ct - ) = + (text: ISourceText, tokenCallback, ?langVersion, ?strictIndentation, ?filePath: string, ?conditionalDefines, ?flags, ?pathMap, ?ct) + = let langVersion = defaultArg langVersion "latestmajor" |> LanguageVersion let flags = defaultArg flags FSharpLexerFlags.Default ignore filePath // can be removed at later point diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index b55844e51ae..659f4c4bc60 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -56,12 +56,8 @@ type SyntaxVisitorBase<'T>() = 'T option default _.VisitExpr - ( - path: SyntaxVisitorPath, - traverseSynExpr: SynExpr -> 'T option, - defaultTraverse: SynExpr -> 'T option, - synExpr: SynExpr - ) = + (path: SyntaxVisitorPath, traverseSynExpr: SynExpr -> 'T option, defaultTraverse: SynExpr -> 'T option, synExpr: SynExpr) + = ignore (path, traverseSynExpr, defaultTraverse, synExpr) None diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 374f648947a..f5b15936902 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -1520,11 +1520,8 @@ module ParsedInput = | _ -> None member _.VisitBinding - ( - path, - defaultTraverse, - (SynBinding(headPat = headPat; trivia = trivia; returnInfo = returnInfo) as synBinding) - ) = + (path, defaultTraverse, (SynBinding(headPat = headPat; trivia = trivia; returnInfo = returnInfo) as synBinding)) + = let isOverrideOrMember leadingKeyword = match leadingKeyword with diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 3b411028328..9c16357d2d7 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -907,7 +907,7 @@ type internal TransparentCompiler { new IXmlDocumentationInfoLoader with /// Try to load xml documentation associated with an assembly by the same file path with the extension ".xml". member _.TryLoad(assemblyFileName) = - let xmlFileName = !! Path.ChangeExtension(assemblyFileName, ".xml") + let xmlFileName = !!Path.ChangeExtension(assemblyFileName, ".xml") // REVIEW: File IO - Will eventually need to change this to use a file system interface of some sort. XmlDocumentationInfo.TryCreateFromFile(xmlFileName) @@ -1393,7 +1393,7 @@ type internal TransparentCompiler // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) let tcConfig = - ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !! Path.GetDirectoryName(mainInputFileName)) + ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !!Path.GetDirectoryName(mainInputFileName)) let diagnosticsLogger = errHandler.DiagnosticsLogger @@ -1751,11 +1751,8 @@ type internal TransparentCompiler ) let TryGetRecentCheckResultsForFile - ( - fileName: string, - projectSnapshot: FSharpProjectSnapshot, - userOpName: string - ) : (FSharpParseFileResults * FSharpCheckFileResults) option = + (fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) + : (FSharpParseFileResults * FSharpCheckFileResults) option = ignore userOpName let cacheKey = @@ -2098,14 +2095,8 @@ type internal TransparentCompiler } member _.ParseFileWithoutProject - ( - fileName: string, - sourceText: ISourceText, - options: FSharpParsingOptions, - cache: bool, - flatErrors: bool, - userOpName: string - ) : Async = + (fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, flatErrors: bool, userOpName: string) + : Async = let parseFileAsync = async { let! ct = Async.CancellationToken @@ -2259,13 +2250,8 @@ type internal TransparentCompiler member _.ProjectChecked = projectChecked.Publish member this.FindReferencesInFile - ( - fileName: string, - options: FSharpProjectOptions, - symbol: FSharpSymbol, - canInvalidateProject: bool, - userOpName: string - ) : Async> = + (fileName: string, options: FSharpProjectOptions, symbol: FSharpSymbol, canInvalidateProject: bool, userOpName: string) + : Async> = async { ignore canInvalidateProject @@ -2288,19 +2274,13 @@ type internal TransparentCompiler } member this.GetAssemblyData - ( - projectSnapshot: FSharpProjectSnapshot, - fileName, - userOpName: string - ) : Async = + (projectSnapshot: FSharpProjectSnapshot, fileName, userOpName: string) + : Async = this.GetAssemblyData(projectSnapshot.ProjectSnapshot, fileName, userOpName) member this.GetBackgroundCheckResultsForFileInProject - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = async { let! snapshot = FSharpProjectSnapshot.FromOptions(options, documentSource) @@ -2310,11 +2290,8 @@ type internal TransparentCompiler } member this.GetBackgroundParseResultsForFileInProject - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = async { let! snapshot = FSharpProjectSnapshot.FromOptions(options, documentSource) @@ -2322,12 +2299,8 @@ type internal TransparentCompiler } member this.GetCachedCheckFileResult - ( - builder: IncrementalBuilder, - fileName: string, - sourceText: ISourceText, - options: FSharpProjectOptions - ) : Async<(FSharpParseFileResults * FSharpCheckFileResults) option> = + (builder: IncrementalBuilder, fileName: string, sourceText: ISourceText, options: FSharpProjectOptions) + : Async<(FSharpParseFileResults * FSharpCheckFileResults) option> = async { ignore builder @@ -2522,11 +2495,8 @@ type internal TransparentCompiler } member this.GetSemanticClassificationForFile - ( - fileName: string, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, options: FSharpProjectOptions, userOpName: string) + : Async = async { ignore userOpName @@ -2548,13 +2518,8 @@ type internal TransparentCompiler backgroundCompiler.NotifyProjectCleaned(options, userOpName) member this.ParseAndCheckFileInProject - ( - fileName: string, - fileVersion: int, - sourceText: ISourceText, - options: FSharpProjectOptions, - userOpName: string - ) : Async = + (fileName: string, fileVersion: int, sourceText: ISourceText, options: FSharpProjectOptions, userOpName: string) + : Async = async { let! snapshot = FSharpProjectSnapshot.FromOptions(options, fileName, fileVersion, sourceText, documentSource) @@ -2583,29 +2548,16 @@ type internal TransparentCompiler this.ParseFile(fileName, projectSnapshot.ProjectSnapshot, userOpName) member this.ParseFile - ( - fileName: string, - sourceText: ISourceText, - options: FSharpParsingOptions, - cache: bool, - flatErrors: bool, - userOpName: string - ) : Async = + (fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, flatErrors: bool, userOpName: string) + : Async = this.ParseFileWithoutProject(fileName, sourceText, options, cache, flatErrors, userOpName) member this.TryGetRecentCheckResultsForFile - ( - fileName: string, - options: FSharpProjectOptions, - sourceText: ISourceText option, - userOpName: string - ) : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option = + (fileName: string, options: FSharpProjectOptions, sourceText: ISourceText option, userOpName: string) + : (FSharpParseFileResults * FSharpCheckFileResults * SourceTextHash) option = backgroundCompiler.TryGetRecentCheckResultsForFile(fileName, options, sourceText, userOpName) member this.TryGetRecentCheckResultsForFile - ( - fileName: string, - projectSnapshot: FSharpProjectSnapshot, - userOpName: string - ) : (FSharpParseFileResults * FSharpCheckFileResults) option = + (fileName: string, projectSnapshot: FSharpProjectSnapshot, userOpName: string) + : (FSharpParseFileResults * FSharpCheckFileResults) option = TryGetRecentCheckResultsForFile(fileName, projectSnapshot, userOpName) diff --git a/src/Compiler/Service/TransparentCompiler.fsi b/src/Compiler/Service/TransparentCompiler.fsi index 93df10b29e2..8703df0fe7f 100644 --- a/src/Compiler/Service/TransparentCompiler.fsi +++ b/src/Compiler/Service/TransparentCompiler.fsi @@ -156,8 +156,11 @@ type internal CompilerCaches = member ParseAndCheckAllFilesInProject: AsyncMemoizeDisabled member ParseAndCheckFileInProject: - AsyncMemoize<(string * FSharpProjectIdentifier), string * string, (FSharpParseFileResults * - FSharpCheckFileAnswer)> + AsyncMemoize< + (string * FSharpProjectIdentifier), + string * string, + (FSharpParseFileResults * FSharpCheckFileAnswer) + > member ParseAndCheckProject: AsyncMemoize diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 4835b784bf8..7c499e41f0c 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -389,14 +389,8 @@ type FSharpChecker /// Typecheck a source code file, returning a handle to the results of the /// parse including the reconstructed types in the file. member _.CheckFileInProjectAllowingStaleCachedResults - ( - parseResults: FSharpParseFileResults, - fileName: string, - fileVersion: int, - source: string, - options: FSharpProjectOptions, - ?userOpName: string - ) = + (parseResults: FSharpParseFileResults, fileName: string, fileVersion: int, source: string, options: FSharpProjectOptions, ?userOpName: string) + = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.CheckFileInProjectAllowingStaleCachedResults( @@ -426,13 +420,8 @@ type FSharpChecker /// Typecheck a source code file, returning a handle to the results of the /// parse including the reconstructed types in the file. member _.ParseAndCheckFileInProject - ( - fileName: string, - fileVersion: int, - sourceText: ISourceText, - options: FSharpProjectOptions, - ?userOpName: string - ) = + (fileName: string, fileVersion: int, sourceText: ISourceText, options: FSharpProjectOptions, ?userOpName: string) + = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.ParseAndCheckFileInProject(fileName, fileVersion, sourceText, options, userOpName) @@ -453,14 +442,8 @@ type FSharpChecker backgroundCompiler.ParseAndCheckProject(projectSnapshot, userOpName) member _.FindBackgroundReferencesInFile - ( - fileName: string, - options: FSharpProjectOptions, - symbol: FSharpSymbol, - ?canInvalidateProject: bool, - ?fastCheck: bool, - ?userOpName: string - ) = + (fileName: string, options: FSharpProjectOptions, symbol: FSharpSymbol, ?canInvalidateProject: bool, ?fastCheck: bool, ?userOpName: string) + = let canInvalidateProject = defaultArg canInvalidateProject true let userOpName = defaultArg userOpName "Unknown" diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi index 8c79ee95232..0118cc41cf3 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fsi +++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi @@ -46,9 +46,7 @@ module public ExtendedData = /// Contextually-relevant data to each particular diagnostic [] - type public IFSharpDiagnosticExtendedData = - interface - end + type public IFSharpDiagnosticExtendedData = interface end /// Additional data for diagnostics about obsolete attributes. [] diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index f7f090a6b00..faf85ad811d 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -77,15 +77,8 @@ type LongUnicodeLexResult = | Invalid let mkLexargs - ( - conditionalDefines, - indentationSyntaxStatus, - resourceManager, - ifdefStack, - diagnosticsLogger, - pathMap: PathMap, - applyLineDirectives - ) = + (conditionalDefines, indentationSyntaxStatus, resourceManager, ifdefStack, diagnosticsLogger, pathMap: PathMap, applyLineDirectives) + = { conditionalDefines = conditionalDefines ifdefStack = ifdefStack @@ -499,7 +492,7 @@ module Keywords = else PathMap.applyDir args.pathMap dirname |> fun dir -> KEYWORD_STRING(s, dir) - | "__SOURCE_FILE__" -> KEYWORD_STRING(s, !! System.IO.Path.GetFileName(FileIndex.fileOfFileIndex lexbuf.StartPos.FileIndex)) + | "__SOURCE_FILE__" -> KEYWORD_STRING(s, !!System.IO.Path.GetFileName(FileIndex.fileOfFileIndex lexbuf.StartPos.FileIndex)) | "__LINE__" -> KEYWORD_STRING(s, string lexbuf.StartPos.Line) | _ -> IdentifierToken args lexbuf s diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 1c0428eb835..a8a8724f58b 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -275,15 +275,8 @@ let mkSynMemberDefnGetSet let xmlDoc = grabXmlDocAtRangeStart (parseState, attrs, rangeStart) let tryMkSynMemberDefnMember - ( - mOptInline: range option, - optAttrs: SynAttributeList list, - (bindingPat, mBindLhs), - optReturnType, - mEquals, - expr, - mExpr - ) : (SynMemberDefn * Ident option) option = + (mOptInline: range option, optAttrs: SynAttributeList list, (bindingPat, mBindLhs), optReturnType, mEquals, expr, mExpr) + : (SynMemberDefn * Ident option) option = let optInline = Option.isSome opt_inline || Option.isSome mOptInline // optional attributes are only applied to getters and setters // the "top level" attrs will be applied to both @@ -810,13 +803,8 @@ let checkEndOfFileError t = type BindingSet = BindingSetPreAttrs of range * bool * bool * (SynAttributes -> SynAccess option -> SynAttributes * SynBinding list) * range let mkClassMemberLocalBindings - ( - isStatic, - initialRangeOpt, - attrs, - vis, - BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, bindingSetRange) - ) = + (isStatic, initialRangeOpt, attrs, vis, BindingSetPreAttrs(_, isRec, isUse, declsPreAttrs, bindingSetRange)) + = let ignoredFreeAttrs, decls = declsPreAttrs attrs vis let mWhole = diff --git a/src/Compiler/SyntaxTree/UnicodeLexing.fs b/src/Compiler/SyntaxTree/UnicodeLexing.fs index 5a2d4393ee7..abb3d0e3d83 100644 --- a/src/Compiler/SyntaxTree/UnicodeLexing.fs +++ b/src/Compiler/SyntaxTree/UnicodeLexing.fs @@ -9,16 +9,13 @@ open Internal.Utilities.Text.Lexing type Lexbuf = LexBuffer let StringAsLexbuf (reportLibraryOnlyFeatures, langVersion, strictIndentation, s: string) = - LexBuffer - .FromChars(reportLibraryOnlyFeatures, langVersion, strictIndentation, s.ToCharArray()) + LexBuffer.FromChars(reportLibraryOnlyFeatures, langVersion, strictIndentation, s.ToCharArray()) let FunctionAsLexbuf (reportLibraryOnlyFeatures, langVersion, strictIndentation, bufferFiller) = - LexBuffer - .FromFunction(reportLibraryOnlyFeatures, langVersion, strictIndentation, bufferFiller) + LexBuffer.FromFunction(reportLibraryOnlyFeatures, langVersion, strictIndentation, bufferFiller) let SourceTextAsLexbuf (reportLibraryOnlyFeatures, langVersion, strictIndentation, sourceText) = - LexBuffer - .FromSourceText(reportLibraryOnlyFeatures, langVersion, strictIndentation, sourceText) + LexBuffer.FromSourceText(reportLibraryOnlyFeatures, langVersion, strictIndentation, sourceText) let StreamReaderAsLexbuf (reportLibraryOnlyFeatures, langVersion, strictIndentation, reader: StreamReader) = let mutable isFinished = false diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index b172536d4f0..b8c3610ef91 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -835,7 +835,10 @@ type internal TcGlobals = member knownFSharpCoreModules: System.Collections.Generic.IDictionary member knownIntrinsics: - System.Collections.Concurrent.ConcurrentDictionary<(string * string option * string * int), FSharp.Compiler.TypedTree.ValRef> + System.Collections.Concurrent.ConcurrentDictionary< + (string * string option * string * int), + FSharp.Compiler.TypedTree.ValRef + > member knownWithNull: FSharp.Compiler.TypedTree.Nullness diff --git a/src/Compiler/Utilities/FileSystem.fs b/src/Compiler/Utilities/FileSystem.fs index 81d6113cc18..ce2488cd0aa 100644 --- a/src/Compiler/Utilities/FileSystem.fs +++ b/src/Compiler/Utilities/FileSystem.fs @@ -427,17 +427,17 @@ module internal FileSystemUtils = if not (hasExtensionWithValidate false path) then raise (ArgumentException("chopExtension")) // message has to be precisely this, for OCaml compatibility, and no argument name can be set - Path.Combine(!! Path.GetDirectoryName(path), !! Path.GetFileNameWithoutExtension(path)) + Path.Combine(!!Path.GetDirectoryName(path), !!Path.GetFileNameWithoutExtension(path)) let fileNameOfPath path = checkPathForIllegalChars path - !! Path.GetFileName(path) + !!Path.GetFileName(path) let fileNameWithoutExtensionWithValidate (validate: bool) path = if validate then checkPathForIllegalChars path - !! Path.GetFileNameWithoutExtension(path) + !!Path.GetFileNameWithoutExtension(path) let fileNameWithoutExtension path = !! fileNameWithoutExtensionWithValidate true path @@ -705,8 +705,7 @@ type DefaultFileSystem() as this = abstract ChangeExtensionShim: path: string * extension: string -> string - default _.ChangeExtensionShim(path: string, extension: string) : string = - !! Path.ChangeExtension(path, extension) + default _.ChangeExtensionShim(path: string, extension: string) : string = !!Path.ChangeExtension(path, extension) interface IFileSystem with member _.AssemblyLoader = this.AssemblyLoader @@ -824,7 +823,7 @@ module public StreamExtensions = use sr = new StreamReader(s, encoding, true) while not <| sr.EndOfStream do - yield !! sr.ReadLine() + yield !!sr.ReadLine() } member s.ReadAllLines(?encoding: Encoding) : string array = diff --git a/src/Compiler/Utilities/sr.fs b/src/Compiler/Utilities/sr.fs index 10a615846e3..968525e931e 100644 --- a/src/Compiler/Utilities/sr.fs +++ b/src/Compiler/Utilities/sr.fs @@ -14,9 +14,7 @@ module internal SR = let GetString (name: string) = let s = - resources - .Force() - .GetString(name, System.Globalization.CultureInfo.CurrentUICulture) + resources.Force().GetString(name, System.Globalization.CultureInfo.CurrentUICulture) #if DEBUG if isNull s then System.Diagnostics.Debug.Assert(false, sprintf "**RESOURCE ERROR**: Resource token %s does not exist!" name) diff --git a/src/FSharp.Build/FSharpEmbedResXSource.fs b/src/FSharp.Build/FSharpEmbedResXSource.fs index 8a26386cf47..219ae5a4f2c 100644 --- a/src/FSharp.Build/FSharpEmbedResXSource.fs +++ b/src/FSharp.Build/FSharpEmbedResXSource.fs @@ -72,8 +72,7 @@ module internal {1} = printMessage "Generating code for target framework %s" _targetFramework let sb = - StringBuilder() - .AppendLine(String.Format(boilerplate, namespaceName, moduleName, justFileName)) + StringBuilder().AppendLine(String.Format(boilerplate, namespaceName, moduleName, justFileName)) if generateGetObject then sb.AppendLine(boilerplateGetObject) |> ignore @@ -103,9 +102,7 @@ module internal {1} = "_" + name let commentBody = - XElement(xname "summary", docComment) - .ToString() - .Split([| "\r\n"; "\r"; "\n" |], StringSplitOptions.None) + XElement(xname "summary", docComment).ToString().Split([| "\r\n"; "\r"; "\n" |], StringSplitOptions.None) |> Array.fold (fun (sb: StringBuilder) line -> sb.AppendLine(" /// " + line)) (StringBuilder()) // add the resource let accessorBody = diff --git a/src/FSharp.Build/Fsi.fs b/src/FSharp.Build/Fsi.fs index dc362420db0..a8ad12d1b2c 100644 --- a/src/FSharp.Build/Fsi.fs +++ b/src/FSharp.Build/Fsi.fs @@ -112,9 +112,7 @@ type public Fsi() as this = let warningsAsErrorsArray = match warningsAsErrors with | Null -> [| "76" |] - | NonNull warningsAsErrors -> - (warningsAsErrors + " 76 ") - .Split([| ' '; ';'; ',' |], StringSplitOptions.RemoveEmptyEntries) + | NonNull warningsAsErrors -> (warningsAsErrors + " 76 ").Split([| ' '; ';'; ',' |], StringSplitOptions.RemoveEmptyEntries) builder.AppendSwitchesIfNotNull("--warnaserror:", warningsAsErrorsArray, ",") diff --git a/src/FSharp.Core/async.fs b/src/FSharp.Core/async.fs index 2b117be0b16..170b30cce0f 100644 --- a/src/FSharp.Core/async.fs +++ b/src/FSharp.Core/async.fs @@ -235,8 +235,7 @@ type TrampolineHolder() = // This should be the only call to Thread.Start in this library. We must always install a trampoline. member this.StartThreadWithTrampoline(f: unit -> AsyncReturn) = - Thread(getThreadStartCallbackForStartThreadWithTrampoline (this), IsBackground = true) - .Start(f |> box) + Thread(getThreadStartCallbackForStartThreadWithTrampoline (this), IsBackground = true).Start(f |> box) AsyncReturn.Fake() @@ -1741,13 +1740,8 @@ type Async = /// StartWithContinuations, except the exception continuation is given an ExceptionDispatchInfo static member StartWithContinuationsUsingDispatchInfo - ( - computation: Async<'T>, - continuation, - exceptionContinuation, - cancellationContinuation, - ?cancellationToken - ) : unit = + (computation: Async<'T>, continuation, exceptionContinuation, cancellationContinuation, ?cancellationToken) + : unit = let cancellationToken = defaultArg cancellationToken defaultCancellationTokenSource.Token @@ -1759,13 +1753,8 @@ type Async = cancellationContinuation static member StartWithContinuations - ( - computation: Async<'T>, - continuation, - exceptionContinuation, - cancellationContinuation, - ?cancellationToken - ) : unit = + (computation: Async<'T>, continuation, exceptionContinuation, cancellationContinuation, ?cancellationToken) + : unit = Async.StartWithContinuationsUsingDispatchInfo( computation, continuation, @@ -1939,11 +1928,8 @@ type Async = /// it happens the child computation will be cancelled. The resulting async doesn't support cancellation /// directly, rather the underlying computation must fill the result if cancellation occurs. static member AwaitAndBindChildResult - ( - innerCTS: CancellationTokenSource, - resultCell: ResultCell>, - millisecondsTimeout - ) : Async<'T> = + (innerCTS: CancellationTokenSource, resultCell: ResultCell>, millisecondsTimeout) + : Async<'T> = match millisecondsTimeout with | None | Some -1 -> resultCell |> Async.AwaitAndBindResult_NoDirectCancelOrTimeout diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index b46bd9d357d..4eeed1465a1 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -1001,13 +1001,7 @@ type Map<[] 'Key, [ let txt1 = LanguagePrimitives.anyToStringShowingNull h1 let txt2 = LanguagePrimitives.anyToStringShowingNull h2 diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 2f90f7a48ee..ea8b17d6f26 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -2531,13 +2531,8 @@ type Expr with mkStaticMethodCallW (methodInfo, methodInfoWithWitnesses, List.length witnesses, witnesses @ arguments) static member CallWithWitnesses - ( - obj: Expr, - methodInfo: MethodInfo, - methodInfoWithWitnesses: MethodInfo, - witnesses, - arguments - ) = + (obj: Expr, methodInfo: MethodInfo, methodInfoWithWitnesses: MethodInfo, witnesses, arguments) + = checkNonNull "methodInfo" methodInfo checkNonNull "methodInfoWithWitnesses" methodInfoWithWitnesses mkInstanceMethodCallW (obj, methodInfo, methodInfoWithWitnesses, List.length witnesses, witnesses @ arguments) diff --git a/src/FSharp.Core/reflect.fs b/src/FSharp.Core/reflect.fs index 32811ae604c..e0742b3dd06 100644 --- a/src/FSharp.Core/reflect.fs +++ b/src/FSharp.Core/reflect.fs @@ -1336,8 +1336,7 @@ type FSharpValue = static member PreComputeTupleConstructor(tupleType: Type) = checkTupleType ("tupleType", tupleType) - (compileTupleConstructor tupleEncField getTupleConstructorMethod tupleType) - .Invoke + (compileTupleConstructor tupleEncField getTupleConstructorMethod tupleType).Invoke static member PreComputeTupleConstructorInfo(tupleType: Type) = checkTupleType ("tupleType", tupleType) @@ -1445,10 +1444,8 @@ module FSharpReflectionExtensions = FSharpValue.GetRecordFields(record, bindingFlags) static member PreComputeRecordReader - ( - recordType: Type, - ?allowAccessToPrivateRepresentation - ) : (obj -> objnull array) = + (recordType: Type, ?allowAccessToPrivateRepresentation) + : (obj -> objnull array) = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeRecordReader(recordType, bindingFlags) @@ -1481,18 +1478,14 @@ module FSharpReflectionExtensions = FSharpValue.GetUnionFields(value, unionType, bindingFlags) static member PreComputeUnionTagReader - ( - unionType: Type, - ?allowAccessToPrivateRepresentation - ) : (objnull -> int) = + (unionType: Type, ?allowAccessToPrivateRepresentation) + : (objnull -> int) = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeUnionTagReader(unionType, bindingFlags) static member PreComputeUnionReader - ( - unionCase: UnionCaseInfo, - ?allowAccessToPrivateRepresentation - ) : (objnull -> objnull array) = + (unionCase: UnionCaseInfo, ?allowAccessToPrivateRepresentation) + : (objnull -> objnull array) = let bindingFlags = getBindingFlags allowAccessToPrivateRepresentation FSharpValue.PreComputeUnionReader(unionCase, bindingFlags) diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index 35adcdda557..20fcdefb159 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -478,8 +478,7 @@ module Internal = static member Bind(g: Generator<'T>, cont) = match g with | :? GenerateThen<'T> as g -> - GenerateThen<_> - .Bind(g.Generator, (fun () -> GenerateThen<_>.Bind(g.Cont(), cont))) + GenerateThen<_>.Bind(g.Generator, (fun () -> GenerateThen<_>.Bind(g.Cont(), cont))) | g -> (new GenerateThen<'T>(g, cont) :> Generator<'T>) let bindG g cont = @@ -854,7 +853,7 @@ module Seq = seq { use e = source.GetEnumerator() - for x in count .. - 1 .. 1 do + for x in count .. -1 .. 1 do if not (e.MoveNext()) then invalidOpFmt "{0}: tried to take {1} {2} past the end of the seq. Use Seq.truncate to get {3} or less elements" diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index 85fc718c461..f6ac7f99490 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -990,13 +990,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' let txt1 = LanguagePrimitives.anyToStringShowingNull h1 let txt2 = LanguagePrimitives.anyToStringShowingNull h2 - StringBuilder() - .Append("set [") - .Append(txt1) - .Append("; ") - .Append(txt2) - .Append("]") - .ToString() + StringBuilder().Append("set [").Append(txt1).Append("; ").Append(txt2).Append("]").ToString() | [ h1; h2; h3 ] -> let txt1 = LanguagePrimitives.anyToStringShowingNull h1 let txt2 = LanguagePrimitives.anyToStringShowingNull h2 diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs index 6b9d33ff663..ecfe86109aa 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Utilities.fs @@ -95,9 +95,7 @@ module internal Utilities = let getResolutionsFromFile resolutionsFile = let lines = try - File - .ReadAllText(resolutionsFile) - .Split([| '\r'; '\n' |], StringSplitOptions.None) + File.ReadAllText(resolutionsFile).Split([| '\r'; '\n' |], StringSplitOptions.None) |> Array.filter (String.IsNullOrEmpty >> not) with _ -> [||] diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs index fe0433f71cf..f900c87fb84 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs @@ -199,12 +199,8 @@ module FSharpDependencyManager = |> (fun l -> l, binLogPath, timeout) let computeHashForResolutionInputs - ( - scriptExt: string, - directiveLines: (string * string) seq, - targetFrameworkMoniker: string, - runtimeIdentifier: string - ) : string option = + (scriptExt: string, directiveLines: (string * string) seq, targetFrameworkMoniker: string, runtimeIdentifier: string) + : string option = let packageReferences, _, _ = directiveLines |> List.ofSeq |> parsePackageDirective scriptExt diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 4af8105d488..4466d718308 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,9 +21,9 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. @@ -37,8 +37,8 @@ [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+getSwitch@325::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000E9F][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1865@1865::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1865@1865::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. [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. [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000065][found Byte] Unexpected type on the stack. @@ -55,7 +55,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x00000799][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4453::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4445::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000CD][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index b1d1c8b57d8..d5617f6de03 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,10 +28,10 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. @@ -53,8 +53,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000E9F][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+processArg@333::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x0000004D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1865@1865::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1865@1865::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+line@560-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [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. [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. @@ -75,13 +75,13 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x00000799][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4453::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4445::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.NativeRes+VersionHelper::TryParse(string, bool, uint16, bool, [S.P.CoreLib]System.Version&)][offset 0x0000003D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL+parseNamed@5291::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x00000087][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@322::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@316::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+Pipe #6 input at line 68@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x0000034D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000CD][found Char] Unexpected type on the stack. [IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@558::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 6a9770727aa..9e78cdedccd 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,15 +21,15 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::parseOption@266(string)][offset 0x0000000B][found Char] Unexpected type on the stack. @@ -39,12 +39,12 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::attempt@372([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000A99][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000005E] Stack underflow. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [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. [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. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.TypeProviders::ValidateExpectedName([FSharp.Compiler.Service]FSharp.Compiler.Text.Range, string[], string, [FSharp.Compiler.Service]FSharp.Compiler.Tainted`1)][offset 0x000000A8][found Char] Unexpected type on the stack. @@ -74,7 +74,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000038][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000058][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadGenericParamConstraintIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32)][offset 0x00000025][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4454(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4446(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006BF][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadInterfaceImpls@2263-3::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadGenericParamConstraints@2328-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 1e77ef2af8b..87b09e193a5 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,9 +28,9 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3516-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2232::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. @@ -40,8 +40,8 @@ [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@301-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A7][found Char] Unexpected type on the stack. @@ -55,14 +55,14 @@ [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. [IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000005E] Stack underflow. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000026][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1865::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000003B][found Char] Unexpected type on the stack. [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. [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. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1890'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000012][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,T0>'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000040][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.PatternMatchCompilation::.cctor()][offset 0x0000000B][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.NicePrint+TastDefinitionPrinting+meths@2092-3::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Infos+MethInfo)][offset 0x000000B3][found Char] Unexpected type on the stack. @@ -95,7 +95,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000038][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000058][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadGenericParamConstraintIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32)][offset 0x00000025][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4454(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4446(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006BF][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadInterfaceImpls@2263-3::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadGenericParamConstraints@2328-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. @@ -108,7 +108,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseNamed@5290(uint8[], [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x0000007E][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000016][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@321([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@315([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+SimulatedMSBuildResolver@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x000002F5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000B6][found Char] Unexpected type on the stack. [IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@558::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. diff --git a/vsintegration/src/FSharp.Editor/Classification/ClassificationDefinitions.fs b/vsintegration/src/FSharp.Editor/Classification/ClassificationDefinitions.fs index 2b194fe27fd..c39e608a4d1 100644 --- a/vsintegration/src/FSharp.Editor/Classification/ClassificationDefinitions.fs +++ b/vsintegration/src/FSharp.Editor/Classification/ClassificationDefinitions.fs @@ -128,10 +128,7 @@ module internal ClassificationDefinitions = ] let setIsDarkBackground () = - isDarkBackground <- - VSColorTheme - .GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey) - .GetBrightness() < 0.5f + isDarkBackground <- VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey).GetBrightness() < 0.5f let setColors _ = diff --git a/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs b/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs index afdb990489b..fa17d938f10 100644 --- a/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs +++ b/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs @@ -149,12 +149,8 @@ type internal FSharpClassificationService [] () = member _.AddLexicalClassifications(_: SourceText, _: TextSpan, _: List, _: CancellationToken) = () member _.AddSyntacticClassificationsAsync - ( - document: Document, - textSpan: TextSpan, - result: List, - cancellationToken: CancellationToken - ) = + (document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) + = cancellableTask { use _logBlock = Logger.LogBlock(LogEditorFunctionId.Classification_Syntactic) @@ -201,12 +197,8 @@ type internal FSharpClassificationService [] () = |> CancellableTask.startAsTask cancellationToken member _.AddSemanticClassificationsAsync - ( - document: Document, - textSpan: TextSpan, - result: List, - cancellationToken: CancellationToken - ) = + (document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) + = cancellableTask { use _logBlock = Logger.LogBlock(LogEditorFunctionId.Classification_Semantic) diff --git a/vsintegration/src/FSharp.Editor/CodeFixes/ImplementInterface.fs b/vsintegration/src/FSharp.Editor/CodeFixes/ImplementInterface.fs index ca85c9621fe..1805428b8d7 100644 --- a/vsintegration/src/FSharp.Editor/CodeFixes/ImplementInterface.fs +++ b/vsintegration/src/FSharp.Editor/CodeFixes/ImplementInterface.fs @@ -123,14 +123,8 @@ type internal ImplementInterfaceCodeFixProvider [] () = | None -> [ stubChange ] let getSuggestions - ( - sourceText: SourceText, - results: FSharpCheckFileResults, - state: InterfaceState, - displayContext, - entity, - indentSize - ) = + (sourceText: SourceText, results: FSharpCheckFileResults, state: InterfaceState, displayContext, entity, indentSize) + = if InterfaceStubGenerator.HasNoInterfaceMember entity then CancellableTask.singleton Seq.empty else diff --git a/vsintegration/src/FSharp.Editor/CodeFixes/MakeOuterBindingRecursive.fs b/vsintegration/src/FSharp.Editor/CodeFixes/MakeOuterBindingRecursive.fs index 0d52dbdfa86..267832a1aff 100644 --- a/vsintegration/src/FSharp.Editor/CodeFixes/MakeOuterBindingRecursive.fs +++ b/vsintegration/src/FSharp.Editor/CodeFixes/MakeOuterBindingRecursive.fs @@ -34,9 +34,7 @@ type internal MakeOuterBindingRecursiveCodeFixProvider [] |> ValueOption.ofOption |> ValueOption.map (fun bindingRange -> RoslynHelpers.FSharpRangeToTextSpan(sourceText, bindingRange)) |> ValueOption.filter (fun bindingSpan -> - sourceText - .GetSubText(bindingSpan) - .ContentEquals(sourceText.GetSubText context.Span)) + sourceText.GetSubText(bindingSpan).ContentEquals(sourceText.GetSubText context.Span)) |> ValueOption.map (fun bindingSpan -> let title = String.Format(SR.MakeOuterBindingRecursive(), sourceText.GetSubText(bindingSpan).ToString()) diff --git a/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs b/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs index 7fb2e008368..e87fda21539 100644 --- a/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs +++ b/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs @@ -108,10 +108,7 @@ type internal XmlDocCommandFilter(wpfTextView: IWpfTextView, filePath: string, w paramNames |> List.iter (fun p -> - toInsert - .AppendLine() - .Append(' ', indent) - .Append(sprintf "/// " p) + toInsert.AppendLine().Append(' ', indent).Append(sprintf "/// " p) |> ignore) let _newSS = diff --git a/vsintegration/src/FSharp.Editor/Common/AssemblyInfo.fs b/vsintegration/src/FSharp.Editor/Common/AssemblyInfo.fs index 73e984f934f..124f3de404c 100644 --- a/vsintegration/src/FSharp.Editor/Common/AssemblyInfo.fs +++ b/vsintegration/src/FSharp.Editor/Common/AssemblyInfo.fs @@ -8,6 +8,4 @@ open Microsoft.VisualStudio.Shell // This adds $PackageFolder$ to the directories probed for assemblies to load. // The attribute is inexplicably class-targeted, hence the dummy class. [] -type private BindingPathForUIResources = - class - end +type private BindingPathForUIResources = class end diff --git a/vsintegration/src/FSharp.Editor/Common/CodeAnalysisExtensions.fs b/vsintegration/src/FSharp.Editor/Common/CodeAnalysisExtensions.fs index 4776a963a5c..e0b29c8f9f1 100644 --- a/vsintegration/src/FSharp.Editor/Common/CodeAnalysisExtensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/CodeAnalysisExtensions.fs @@ -9,17 +9,11 @@ type Project with /// Returns the projectIds of all projects within the same solution that directly reference this project member this.GetDependentProjectIds() = - this.Solution - .GetProjectDependencyGraph() - .GetProjectsThatDirectlyDependOnThisProject - this.Id + this.Solution.GetProjectDependencyGraph().GetProjectsThatDirectlyDependOnThisProject this.Id /// Returns all projects within the same solution that directly reference this project. member this.GetDependentProjects() = - this.Solution - .GetProjectDependencyGraph() - .GetProjectsThatDirectlyDependOnThisProject - this.Id + this.Solution.GetProjectDependencyGraph().GetProjectsThatDirectlyDependOnThisProject this.Id |> Seq.map this.Solution.GetProject /// Returns the ProjectIds of all of the projects that this project directly or transitively depends on diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 5b154deab73..23012fa64e2 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -208,11 +208,7 @@ module private SourceText = type SourceText with member this.ToFSharpSourceText() = - SourceText.weakTable.GetValue( - this, - Runtime.CompilerServices.ConditionalWeakTable<_, _> - .CreateValueCallback(SourceText.create) - ) + SourceText.weakTable.GetValue(this, Runtime.CompilerServices.ConditionalWeakTable<_, _>.CreateValueCallback(SourceText.create)) type NavigationItem with diff --git a/vsintegration/src/FSharp.Editor/Common/Logging.fs b/vsintegration/src/FSharp.Editor/Common/Logging.fs index cf531c65384..b0f56df3234 100644 --- a/vsintegration/src/FSharp.Editor/Common/Logging.fs +++ b/vsintegration/src/FSharp.Editor/Common/Logging.fs @@ -156,11 +156,7 @@ module Activity = OpenTelemetry.Sdk .CreateTracerProviderBuilder() .AddSource(ActivityNames.FscSourceName) - .SetResourceBuilder( - ResourceBuilder - .CreateDefault() - .AddService(serviceName = "F#", serviceVersion = "1.0.0") - ) + .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName = "F#", serviceVersion = "1.0.0")) .AddOtlpExporter() .Build() diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 2c583555cb3..de1ed80a03c 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -71,8 +71,7 @@ type internal FSharpCompletionProvider // * let xs = [1..10] <<---- Don't commit autocomplete! (same for arrays) static let noCommitOnSpaceRules = let noCommitChars = - [| ' '; '='; ','; '.'; '<'; '>'; '('; ')'; '!'; ':'; '['; ']'; '|' |] - .ToImmutableArray() + [| ' '; '='; ','; '.'; '<'; '>'; '('; ')'; '!'; ':'; '['; ']'; '|' |].ToImmutableArray() CompletionItemRules.Default.WithCommitCharacterRules( ImmutableArray.Create(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars)) @@ -203,9 +202,7 @@ type internal FSharpCompletionProvider if n <> 0 then n else - n <- - (CompletionUtils.getKindPriority x.Kind) - .CompareTo(CompletionUtils.getKindPriority y.Kind) + n <- (CompletionUtils.getKindPriority x.Kind).CompareTo(CompletionUtils.getKindPriority y.Kind) if n <> 0 then n @@ -371,11 +368,8 @@ type internal FSharpCompletionProvider |> CancellableTask.startAsTask context.CancellationToken override _.GetDescriptionAsync - ( - document: Document, - completionItem: Completion.CompletionItem, - _cancellationToken: CancellationToken - ) : Task = + (document: Document, completionItem: Completion.CompletionItem, _cancellationToken: CancellationToken) + : Task = match completionItem.Properties.TryGetValue IndexPropName with | true, completionItemIndexStr when int completionItemIndexStr >= declarationItems.Length -> @@ -495,9 +489,6 @@ type internal FSharpCompletionProvider let changedText = finalSourceText.ToString(changedSpan) - return - CompletionChange - .Create(TextChange(fullChangingSpan, changedText)) - .WithNewPosition(Nullable(changedSpan.End)) + return CompletionChange.Create(TextChange(fullChangingSpan, changedText)).WithNewPosition(Nullable(changedSpan.End)) } |> CancellableTask.start cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs index 13f7e3d3b30..450d8ed67ac 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs @@ -18,9 +18,7 @@ type internal FSharpCompletionService inherit FSharpCompletionServiceWithProviders(workspace) let projectInfoManager = - workspace.Services - .GetRequiredService() - .FSharpProjectOptionsManager + workspace.Services.GetRequiredService().FSharpProjectOptionsManager let builtInProviders = ImmutableArray.Create( @@ -38,10 +36,7 @@ type internal FSharpCompletionService | NewlineOnCompleteWord -> EnterKeyRule.AfterFullyTypedWord | AlwaysNewline -> EnterKeyRule.Always - CompletionRules.Default - .WithDismissIfEmpty(true) - .WithDismissIfLastCharacterDeleted(true) - .WithDefaultEnterKeyRule(enterKeyRule) + CompletionRules.Default.WithDismissIfEmpty(true).WithDismissIfLastCharacterDeleted(true).WithDefaultEnterKeyRule(enterKeyRule) /// Indicates the text span to be replaced by a committed completion list item. override _.GetDefaultCompletionListSpan(sourceText, caretIndex) = diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs index 679caede1fd..1bb5958418c 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs @@ -148,16 +148,8 @@ module internal CompletionUtils = /// Indicates the text span to be replaced by a committed completion list item. let getDefaultCompletionListSpan - ( - sourceText: SourceText, - caretIndex, - documentId, - filePath, - defines, - langVersion, - strictIndentation, - ct: CancellationToken - ) = + (sourceText: SourceText, caretIndex, documentId, filePath, defines, langVersion, strictIndentation, ct: CancellationToken) + = // Gets connected identifier-part characters backward and forward from caret. let getIdentifierChars () = diff --git a/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs b/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs index 56ad5a26518..425dba181b4 100644 --- a/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs +++ b/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs @@ -48,11 +48,8 @@ type internal FSharpBreakpointResolutionService [] () = interface IFSharpBreakpointResolutionService with member _.ResolveBreakpointAsync - ( - document: Document, - textSpan: TextSpan, - cancellationToken: CancellationToken - ) : Task = + (document: Document, textSpan: TextSpan, cancellationToken: CancellationToken) + : Task = cancellableTask { let! range = FSharpBreakpointResolutionService.GetBreakpointLocation(document, textSpan) diff --git a/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs b/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs index 493750c06ec..3d815f92343 100644 --- a/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs +++ b/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs @@ -50,11 +50,8 @@ type internal FSharpLanguageDebugInfoService [] () = Task.FromResult(Unchecked.defaultof) member _.GetDataTipInfoAsync - ( - document: Document, - position: int, - cancellationToken: CancellationToken - ) : Task = + (document: Document, position: int, cancellationToken: CancellationToken) + : Task = cancellableTask { let defines, langVersion, strictIndentation = document.GetFsharpParsingOptions() diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index 3c708b8ab17..10db9697b56 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -281,9 +281,7 @@ module internal XmlDocumentation = collector.Add TaggedText.space WriteNodes collector (p.Nodes()) - type VsThreadToken() = - class - end + type VsThreadToken() = class end let vsToken = VsThreadToken() @@ -334,15 +332,8 @@ module internal XmlDocumentation = interface IDocumentationBuilder with /// Append the given processed XML formatted into the string builder override _.AppendDocumentationFromProcessedXML - ( - xmlCollector, - exnCollector, - processedXml, - showExceptions, - showParameters, - showRemarks, - paramName - ) = + (xmlCollector, exnCollector, processedXml, showExceptions, showParameters, showRemarks, paramName) + = match XmlDocReader.TryCreate processedXml with | Some xmlDocReader -> match paramName with @@ -449,12 +440,8 @@ module internal XmlDocumentation = } let BuildSingleTipText - ( - documentationProvider: IDocumentationBuilder, - dataTipElement: ToolTipElement, - limits: LineLimits, - showRemarks: bool - ) = + (documentationProvider: IDocumentationBuilder, dataTipElement: ToolTipElement, limits: LineLimits, showRemarks: bool) + = let { LineLimit = lineLimit diff --git a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs index 7947b2dec99..972f64ad6b3 100644 --- a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs +++ b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs @@ -110,12 +110,8 @@ type internal FSharpDocumentHighlightsService [] () = interface IFSharpDocumentHighlightsService with member _.GetDocumentHighlightsAsync - ( - document, - position, - _documentsToSearch, - cancellationToken - ) : Task> = + (document, position, _documentsToSearch, cancellationToken) + : Task> = cancellableTask { let! spans = FSharpDocumentHighlightsService.GetDocumentHighlights(document, position) diff --git a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs index bab1460f14a..d874656c176 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs @@ -23,13 +23,8 @@ open FSharp.Compiler.Tokenization type internal FSharpIndentationService [] () = static member IndentShouldFollow - ( - documentId: DocumentId, - sourceText: SourceText, - filePath: string, - position: int, - parsingOptions: FSharpParsingOptions - ) = + (documentId: DocumentId, sourceText: SourceText, filePath: string, position: int, parsingOptions: FSharpParsingOptions) + = let lastTokenOpt = let defines = CompilerEnvironment.GetConditionalDefinesForEditing parsingOptions diff --git a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs index 867377cc335..f0712cb8e21 100644 --- a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs +++ b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs @@ -88,8 +88,7 @@ type InlineParameterNameHints(parseResults: FSharpParseFileResults) = symbol.HasAttribute() let getSourceTextAtRange (sourceText: SourceText) (range: range) = - (RoslynHelpers.FSharpRangeToTextSpan(sourceText, range) |> sourceText.GetSubText) - .ToString() + (RoslynHelpers.FSharpRangeToTextSpan(sourceText, range) |> sourceText.GetSubText).ToString() let isMemberOrFunctionOrValueValidForHint (symbol: FSharpMemberOrFunctionOrValue) (symbolUse: FSharpSymbolUse) = diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 55cd1b622b3..5cc9cec2943 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -375,14 +375,10 @@ type internal FSharpPackage() as this = this.ComponentModel.DefaultExportProvider.GetExport() let optionsManager = - workspace.Services - .GetService() - .FSharpProjectOptionsManager + workspace.Services.GetService().FSharpProjectOptionsManager let metadataAsSource = - this.ComponentModel.DefaultExportProvider - .GetExport() - .Value + this.ComponentModel.DefaultExportProvider.GetExport().Value let! solution = this.GetServiceAsync(typeof) let solution = solution :?> IVsSolution @@ -440,9 +436,7 @@ type internal FSharpLanguageService(package: FSharpPackage) = let workspace = package.ComponentModel.GetService() let solutionAnalysis = - workspace.Services - .GetService() - .Advanced.SolutionBackgroundAnalysis + workspace.Services.GetService().Advanced.SolutionBackgroundAnalysis globalOptions.SetBackgroundAnalysisScope(openFilesOnly = not solutionAnalysis) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs index af619dad278..bf04e9a8a2d 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/SingleFileWorkspaceMap.fs @@ -18,9 +18,7 @@ type internal FSharpMiscellaneousFileService ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase) let optionsManager = - workspace.Services - .GetRequiredService() - .FSharpProjectOptionsManager + workspace.Services.GetRequiredService().FSharpProjectOptionsManager static let createSourceCodeKind (filePath: string) = if isScriptFile filePath then diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index bc025402485..83f6532b8ad 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -508,12 +508,8 @@ module internal Tokenizer = | _ -> ClassificationTypeNames.Text let private scanSourceLine - ( - sourceTokenizer: FSharpSourceTokenizer, - textLine: TextLine, - lineContents: string, - lexState: FSharpTokenizerLexState - ) : SourceLineData = + (sourceTokenizer: FSharpSourceTokenizer, textLine: TextLine, lineContents: string, lexState: FSharpTokenizerLexState) + : SourceLineData = let colorMap = Array.create textLine.Span.Length ClassificationTypeNames.Text let lineTokenizer = sourceTokenizer.CreateLineTokenizer(lineContents) let tokens = ResizeArray() diff --git a/vsintegration/src/FSharp.Editor/LanguageService/WorkspaceExtensions.fs b/vsintegration/src/FSharp.Editor/LanguageService/WorkspaceExtensions.fs index 6c3b04f1844..1c09806d0ca 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/WorkspaceExtensions.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/WorkspaceExtensions.fs @@ -347,11 +347,8 @@ module private CheckerExtensions = } member checker.ParseAndCheckDocumentUsingTransparentCompiler - ( - document: Document, - options: FSharpProjectOptions, - userOpName: string - ) = + (document: Document, options: FSharpProjectOptions, userOpName: string) + = cancellableTask { checker.TransparentCompiler.SetCacheSizeFactor(document.Project.TransparentCompilerCacheFactor) @@ -368,12 +365,8 @@ module private CheckerExtensions = /// Parse and check the source text from the Roslyn document with possible stale results. member checker.ParseAndCheckDocumentWithPossibleStaleResults - ( - document: Document, - options: FSharpProjectOptions, - allowStaleResults: bool, - userOpName: string - ) = + (document: Document, options: FSharpProjectOptions, allowStaleResults: bool, userOpName: string) + = cancellableTask { let! ct = CancellableTask.getCancellationToken () @@ -439,12 +432,8 @@ module private CheckerExtensions = /// Parse and check the source text from the Roslyn document. member checker.ParseAndCheckDocument - ( - document: Document, - options: FSharpProjectOptions, - userOpName: string, - ?allowStaleResults: bool - ) = + (document: Document, options: FSharpProjectOptions, userOpName: string, ?allowStaleResults: bool) + = cancellableTask { if checker.UsesTransparentCompiler then diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 429b21ce64a..921d82650f1 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -83,13 +83,8 @@ module FSharpFindUsagesService = } let findReferencedSymbolsAsync - ( - document: Document, - position: int, - context: IFSharpFindUsagesContext, - allReferences: bool, - userOp: string - ) : CancellableTask = + (document: Document, position: int, context: IFSharpFindUsagesContext, allReferences: bool, userOp: string) + : CancellableTask = cancellableTask { let! cancellationToken = CancellableTask.getCancellationToken () let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 69a97e9732f..94615461dc1 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -645,11 +645,8 @@ type internal GoToDefinition(metadataAsSource: FSharpMetadataAsSourceService) = } member this.NavigateToExternalDeclaration - ( - targetSymbolUse: FSharpSymbolUse, - metadataReferences: seq, - cancellationToken: CancellationToken - ) = + (targetSymbolUse: FSharpSymbolUse, metadataReferences: seq, cancellationToken: CancellationToken) + = let textOpt = match targetSymbolUse.Symbol with @@ -892,9 +889,7 @@ type FSharpCrossLanguageSymbolNavigationService() = let workspace = componentModel.GetService() let metadataAsSource = - componentModel.DefaultExportProvider - .GetExport() - .Value + componentModel.DefaultExportProvider.GetExport().Value let tryFindFieldByName (name: string) (e: FSharpEntity) = let fields = @@ -1060,11 +1055,8 @@ type FSharpCrossLanguageSymbolNavigationService() = interface IFSharpCrossLanguageSymbolNavigationService with member _.TryGetNavigableLocationAsync - ( - assemblyName: string, - documentationCommentId: string, - cancellationToken: CancellationToken - ) : Task = + (assemblyName: string, documentationCommentId: string, cancellationToken: CancellationToken) + : Task = let path = FSharpCrossLanguageSymbolNavigationService.DocCommentIdToPath documentationCommentId diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs index 60ca208a2a0..546b00e1b16 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs @@ -189,13 +189,8 @@ type internal FSharpNavigateToSearchService interface IFSharpNavigateToSearchService with member _.SearchProjectAsync - ( - project, - _priorityDocuments, - searchPattern, - kinds, - cancellationToken - ) : Task> = + (project, _priorityDocuments, searchPattern, kinds, cancellationToken) + : Task> = cancellableTask { let tryMatch = createMatcherFor searchPattern diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs index ec42d190c15..146c7d7dfcb 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs @@ -64,13 +64,8 @@ module internal QuickInfoViewProvider = let encloseRuns runs : obj = ClassifiedTextElement(runs |> List.rev) let provideContent - ( - imageId: ImageId option, - description: TaggedText list, - documentation: TaggedText list, - navigation: FSharpNavigation, - getTooltip - ) = + (imageId: ImageId option, description: TaggedText list, documentation: TaggedText list, navigation: FSharpNavigation, getTooltip) + = let encloseText text = let rec loop text runs stack = diff --git a/vsintegration/tests/FSharp.Editor.Tests/BreakpointResolutionServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/BreakpointResolutionServiceTests.fs index 403b342ff5b..de8b3c28ccd 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/BreakpointResolutionServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/BreakpointResolutionServiceTests.fs @@ -69,9 +69,7 @@ let main argv = | ValueNone -> Assert.True(expectedResolution.IsNone, "BreakpointResolutionService failed to resolve breakpoint position") | ValueSome(actualResolutionRange) -> let actualResolution = - sourceText - .GetSubText(RoslynHelpers.FSharpRangeToTextSpan(sourceText, actualResolutionRange)) - .ToString() + sourceText.GetSubText(RoslynHelpers.FSharpRangeToTextSpan(sourceText, actualResolutionRange)).ToString() Assert.True( expectedResolution.IsSome, diff --git a/vsintegration/tests/FSharp.Editor.Tests/DocumentDiagnosticAnalyzerTests.fs b/vsintegration/tests/FSharp.Editor.Tests/DocumentDiagnosticAnalyzerTests.fs index 27db356ec4b..51efbb4fcf2 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/DocumentDiagnosticAnalyzerTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/DocumentDiagnosticAnalyzerTests.fs @@ -62,11 +62,8 @@ type DocumentDiagnosticAnalyzerTests() = |> Assert.shouldBeEqualWith expectedEnd "Error end positions should match" member private this.VerifyDiagnosticBetweenMarkers - ( - fileContents: string, - expectedMessage: string, - expectedSeverity: DiagnosticSeverity - ) = + (fileContents: string, expectedMessage: string, expectedSeverity: DiagnosticSeverity) + = let errors = this.getDiagnostics fileContents |> Seq.filter (fun e -> e.Severity = expectedSeverity) @@ -92,11 +89,8 @@ type DocumentDiagnosticAnalyzerTests() = |> Assert.shouldBeEqualWith expectedEnd "Error end positions should match" member private this.VerifyDiagnosticBetweenMarkers_HACK_PLEASE_REFER_TO_COMMENT_INSIDE - ( - fileContents: string, - expectedMessage: string, - expectedSeverity: DiagnosticSeverity - ) = + (fileContents: string, expectedMessage: string, expectedSeverity: DiagnosticSeverity) + = // TODO: once workaround (https://github.com/dotnet/fsharp/pull/15982) will not be needed, this should be reverted back to normal method (see PR) let errors = this.getDiagnostics fileContents @@ -127,11 +121,8 @@ type DocumentDiagnosticAnalyzerTests() = this.VerifyDiagnosticBetweenMarkers_HACK_PLEASE_REFER_TO_COMMENT_INSIDE(fileContents, expectedMessage, DiagnosticSeverity.Error) member private this.VerifyErrorAtMarker_HACK_PLEASE_REFER_TO_COMMENT_INSIDE - ( - fileContents: string, - expectedMarker: string, - ?expectedMessage: string - ) = + (fileContents: string, expectedMarker: string, ?expectedMessage: string) + = let errors = this.getDiagnostics fileContents |> Seq.filter (fun e -> e.Severity = DiagnosticSeverity.Error) diff --git a/vsintegration/tests/FSharp.Editor.Tests/FindReferencesTests.fs b/vsintegration/tests/FSharp.Editor.Tests/FindReferencesTests.fs index 4a10dacc6c6..1fc73fe81aa 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/FindReferencesTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/FindReferencesTests.fs @@ -73,9 +73,7 @@ module FindReferences = solution.TryGetDocumentFromPath documentPath |> ValueOption.defaultWith (fun _ -> failwith "Document not found") - findUsagesService - .FindReferencesAsync(document, getPositionOf "funcParam" documentPath, context) - .Wait() + findUsagesService.FindReferencesAsync(document, getPositionOf "funcParam" documentPath, context).Wait() // We cannot easily inspect what exactly was found here, but that should be verified // in FSharp.Compiler.ComponentTests.FSharpChecker.FindReferences @@ -96,9 +94,7 @@ module FindReferences = solution.TryGetDocumentFromPath documentPath |> ValueOption.defaultWith (fun _ -> failwith "Document not found") - findUsagesService - .FindReferencesAsync(document, getPositionOf "funcParam" documentPath, context) - .Wait() + findUsagesService.FindReferencesAsync(document, getPositionOf "funcParam" documentPath, context).Wait() if foundDefinitions.Count <> 1 then failwith $"Expected 1 definition but found {foundDefinitions.Count}" @@ -118,9 +114,7 @@ module FindReferences = solution.TryGetDocumentFromPath documentPath |> ValueOption.defaultWith (fun _ -> failwith "Document not found") - findUsagesService - .FindReferencesAsync(document, getPositionOf "sharedFunc" documentPath, context) - .Wait() + findUsagesService.FindReferencesAsync(document, getPositionOf "sharedFunc" documentPath, context).Wait() if foundDefinitions.Count <> 1 then failwith $"Expected 1 definition but found {foundDefinitions.Count}" @@ -159,9 +153,7 @@ module FindReferences = solution2.TryGetDocumentFromPath documentPath |> ValueOption.defaultWith (fun _ -> failwith "Document not found") - findUsagesService - .FindReferencesAsync(document, getPositionOf operator documentPath, context) - .Wait() + findUsagesService.FindReferencesAsync(document, getPositionOf operator documentPath, context).Wait() // We cannot easily inspect what exactly was found here, but that should be verified // in FSharp.Compiler.ComponentTests.FSharpChecker.FindReferences diff --git a/vsintegration/tests/FSharp.Editor.Tests/GoToDefinitionServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/GoToDefinitionServiceTests.fs index cc6bdbae43c..d0e4b5efad1 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/GoToDefinitionServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/GoToDefinitionServiceTests.fs @@ -17,13 +17,8 @@ module GoToDefinitionServiceTests = let userOpName = "GoToDefinitionServiceTests" let private findDefinition - ( - document: Document, - sourceText: SourceText, - position: int, - defines: string list, - langVersion: string option - ) : range option = + (document: Document, sourceText: SourceText, position: int, defines: string list, langVersion: string option) + : range option = maybe { let textLine = sourceText.Lines.GetLineFromPosition position let textLinePos = sourceText.Lines.GetLinePosition position diff --git a/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs b/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs index ca113f72bf3..85ad11c6e2e 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs @@ -67,9 +67,7 @@ module MefHelpers = let configuration = CompositionConfiguration.Create(catalog) - RuntimeComposition - .CreateRuntimeComposition(configuration) - .CreateExportProviderFactory() + RuntimeComposition.CreateRuntimeComposition(configuration).CreateExportProviderFactory() let createExportProvider () = exportProviderFactory.CreateExportProvider() diff --git a/vsintegration/tests/FSharp.Editor.Tests/NavigateToSearchServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/NavigateToSearchServiceTests.fs index 549441d8bb3..08816ea6191 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/NavigateToSearchServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/NavigateToSearchServiceTests.fs @@ -41,9 +41,7 @@ module HeyHo = let navigateToSearch pattern = let service: IFSharpNavigateToSearchService = provider.GetExportedValue() - service - .SearchProjectAsync(project, [] |> Seq.toImmutableArray, pattern, service.KindsProvided, CancellationToken.None) - .Result + service.SearchProjectAsync(project, [] |> Seq.toImmutableArray, pattern, service.KindsProvided, CancellationToken.None).Result let assertResultsContain pattern expected = navigateToSearch pattern diff --git a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs index f85ee51a6c8..398ece88fa3 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/SignatureHelpProviderTests.fs @@ -45,9 +45,7 @@ module SignatureHelpProvider = |> CancellableTask.runSynchronously ct let paramInfoLocations = - parseResults - .FindParameterLocations(Position.fromZ caretLinePos.Line caretLineColumn) - .Value + parseResults.FindParameterLocations(Position.fromZ caretLinePos.Line caretLineColumn).Value let triggered = FSharpSignatureHelpProvider.ProvideMethodsAsyncAux( diff --git a/vsintegration/tests/FSharp.Editor.Tests/SyntacticColorizationServiceTests.fs b/vsintegration/tests/FSharp.Editor.Tests/SyntacticColorizationServiceTests.fs index 35c5306d8ff..04ab8dd2448 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/SyntacticColorizationServiceTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/SyntacticColorizationServiceTests.fs @@ -13,13 +13,8 @@ open FSharp.Test type SyntacticClassificationServiceTests() = member private this.ExtractMarkerData - ( - fileContents: string, - marker: string, - defines: string list, - langVersion: string option, - isScriptFile: Option - ) = + (fileContents: string, marker: string, defines: string list, langVersion: string option, isScriptFile: Option) + = let textSpan = TextSpan(0, fileContents.Length) let fileName = @@ -49,14 +44,8 @@ type SyntacticClassificationServiceTests() = (tokens, markerPosition) member private this.VerifyColorizerAtStartOfMarker - ( - fileContents: string, - marker: string, - defines: string list, - classificationType: string, - ?isScriptFile: bool, - ?langVersion: string - ) = + (fileContents: string, marker: string, defines: string list, classificationType: string, ?isScriptFile: bool, ?langVersion: string) + = let langVersion = langVersion |> Option.orElse (Some "preview") let (tokens, markerPosition) = @@ -69,14 +58,8 @@ type SyntacticClassificationServiceTests() = |> Assert.shouldBeEqualWith classificationType "Classification data doesn't match for start of marker" member private this.VerifyColorizerAtEndOfMarker - ( - fileContents: string, - marker: string, - defines: string list, - classificationType: string, - ?isScriptFile: bool, - ?langVersion: string - ) = + (fileContents: string, marker: string, defines: string list, classificationType: string, ?isScriptFile: bool, ?langVersion: string) + = let langVersion = langVersion |> Option.orElse (Some "preview") let (tokens, markerPosition) = From 734e8a5db17cd74ae05dd7d54e7183776ee79f41 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 24 Mar 2025 16:51:15 -0700 Subject: [PATCH 026/134] Investigate.nuget (#18393) * initial * testing * temp * Fantomas, readme * temp * nowarn quotes for fantomas * tests --- .gitignore | 4 +- .../.FSharp.Compiler.Service/9.0.300.md | 2 +- docs/release-notes/.VisualStudio/17.14.md | 1 + src/Compiler/Driver/ScriptClosure.fs | 69 ++++++++------ src/Compiler/Driver/ScriptClosure.fsi | 4 + src/Compiler/Service/BackgroundCompiler.fs | 8 ++ src/Compiler/Service/BackgroundCompiler.fsi | 2 + src/Compiler/Service/FSharpCheckerResults.fs | 1 + src/Compiler/Service/TransparentCompiler.fs | 4 + src/Compiler/Service/service.fs | 4 + src/Compiler/Service/service.fsi | 4 + .../FSDependencyManager.txt | 3 +- .../FSharp.DependencyManager.ProjectFile.fs | 1 + .../FSharp.DependencyManager.fs | 34 ++++++- .../xlf/FSDependencyManager.txt.cs.xlf | 5 + .../xlf/FSDependencyManager.txt.de.xlf | 5 + .../xlf/FSDependencyManager.txt.es.xlf | 5 + .../xlf/FSDependencyManager.txt.fr.xlf | 5 + .../xlf/FSDependencyManager.txt.it.xlf | 5 + .../xlf/FSDependencyManager.txt.ja.xlf | 5 + .../xlf/FSDependencyManager.txt.ko.xlf | 5 + .../xlf/FSDependencyManager.txt.pl.xlf | 5 + .../xlf/FSDependencyManager.txt.pt-BR.xlf | 5 + .../xlf/FSDependencyManager.txt.ru.xlf | 5 + .../xlf/FSDependencyManager.txt.tr.xlf | 5 + .../xlf/FSDependencyManager.txt.zh-Hans.xlf | 5 + .../xlf/FSDependencyManager.txt.zh-Hant.xlf | 5 + .../FSharpScriptTests.fs | 18 ++++ ...ervice.SurfaceArea.netstandard20.debug.bsl | 30 +++--- ...vice.SurfaceArea.netstandard20.release.bsl | 4 +- .../core/printing/output.1000.stdout.bsl | 2 +- .../core/printing/output.200.stdout.bsl | 2 +- .../core/printing/output.multiemit.stdout.bsl | 2 +- .../core/printing/output.off.stdout.bsl | 2 +- tests/fsharp/core/printing/output.stdout.bsl | 2 +- .../src/FSharp.Editor/Common/Extensions.fs | 92 +++++++++++++++++++ .../FSharpProjectOptionsManager.fs | 81 +++++++++++++--- .../BackgroundRequests.fs | 2 +- vsintegration/tests/Salsa/salsa.fs | 2 +- 39 files changed, 373 insertions(+), 72 deletions(-) diff --git a/.gitignore b/.gitignore index 33c9666c14b..6ca107a5779 100644 --- a/.gitignore +++ b/.gitignore @@ -134,4 +134,6 @@ positive.exe /tests/FSharp.Compiler.ComponentTests/FSharpChecker/StandardOutput.txt # ilverify baseline result files -*.bsl.actual \ No newline at end of file +*.bsl.actual +/src/FSharp.DependencyManager.Nuget/StandardError.txt +/src/FSharp.DependencyManager.Nuget/StandardOutput.txt diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 5f722b11a12..b9772f3f5ac 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -18,6 +18,7 @@ * Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) * Fix duplicate parse error reporting for GetBackgroundCheckResultsForFileInProject ([Issue #18379](https://github.com/dotnet/fsharp/issues/18379) [PR #18380](https://github.com/dotnet/fsharp/pull/18380)) * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) +* Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) @@ -30,7 +31,6 @@ ### Changed - * FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205)) * Update `Obsolete` attribute checking to account for `DiagnosticId` and `UrlFormat` properties. ([PR #18224](https://github.com/dotnet/fsharp/pull/18224)) * Remove `Cancellable.UsingToken` from tests ([PR #18276](https://github.com/dotnet/fsharp/pull/18276)) diff --git a/docs/release-notes/.VisualStudio/17.14.md b/docs/release-notes/.VisualStudio/17.14.md index db5d628bb0c..f9b710ea122 100644 --- a/docs/release-notes/.VisualStudio/17.14.md +++ b/docs/release-notes/.VisualStudio/17.14.md @@ -1,4 +1,5 @@ ### Fixed +* Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) ### Added * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index b8acfe76441..b97b11a8054 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -45,6 +45,9 @@ type LoadClosure = /// The resolved package references along with the ranges of the #r positions in each file. PackageReferences: (range * string list)[] + /// The raw package manager lines in the script + PackageManagerLines: Map + /// Whether we're decided to use .NET Framework analysis for this script UseDesktopFramework: bool @@ -82,7 +85,8 @@ type CodeContext = module ScriptPreprocessClosure = /// Represents an input to the closure finding process - type ClosureSource = ClosureSource of fileName: string * referenceRange: range * sourceText: ISourceText * parseRequired: bool + type ClosureSource = + | ClosureSource of fileName: string * referenceRange: range * sourceText: ISourceText * Position option * parseRequired: bool /// Represents an output of the closure finding process type ClosureFile = @@ -253,7 +257,7 @@ module ScriptPreprocessClosure = | Some(n: int) -> new StreamReader(stream, Encoding.GetEncoding n) let source = reader.ReadToEnd() - [ ClosureSource(fileName, m, SourceText.ofString source, parseRequired) ] + [ ClosureSource(fileName, m, SourceText.ofString source, None, parseRequired) ] with RecoverableException exn -> errorRecovery exn m [] @@ -309,16 +313,25 @@ module ScriptPreprocessClosure = let packageReferences = Dictionary(HashIdentity.Structural) // Resolve the packages - let rec resolveDependencyManagerSources scriptName = + let rec resolveDependencyManagerSources scriptName (caret: Position option) = + let caretLine = + match caret with + | None -> Int32.MinValue + | Some pos -> pos.Line + + let isEditorCursorInPackageLines (line: PackageManagerLine) = + caretLine >= line.Range.StartLine && caretLine <= line.Range.EndLine + [ if not (loadScripts.Contains scriptName) then for kv in tcConfig.packageManagerLines do let packageManagerKey, packageManagerLines = kv.Key, kv.Value - match packageManagerLines with + match packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) with | [] -> () | packageManagerLine :: _ -> let m = packageManagerLine.Range + let packageManagerLines = packageManagerLines yield! processPackageManagerLines m packageManagerLines scriptName packageManagerKey ] @@ -422,7 +435,7 @@ module ScriptPreprocessClosure = let scriptText = stream.ReadAllText() loadScripts.Add script |> ignore let iSourceText = SourceText.ofString scriptText - yield! processClosureSource (ClosureSource(script, m, iSourceText, true)) + yield! processClosureSource (ClosureSource(script, m, iSourceText, None, true)) else // Send outputs via diagnostics @@ -439,7 +452,7 @@ module ScriptPreprocessClosure = tcConfig <- TcConfig.Create(tcConfigB, validate = false) ] - and processClosureSource (ClosureSource(fileName, m, sourceText, parseRequired)) = + and processClosureSource (ClosureSource(fileName, m, sourceText, caret, parseRequired)) = [ if not (observedSources.HaveSeen(fileName)) then observedSources.SetSeen(fileName) @@ -469,7 +482,7 @@ module ScriptPreprocessClosure = tcConfig <- tcConfigResult // We accumulate the tcConfig in order to collect assembly references - yield! resolveDependencyManagerSources fileName + yield! resolveDependencyManagerSources fileName caret let postSources = tcConfig.GetAvailableLoadedSources() @@ -479,7 +492,7 @@ module ScriptPreprocessClosure = else [] - yield! resolveDependencyManagerSources fileName + yield! resolveDependencyManagerSources fileName caret for m, subFile in sources do if IsScript subFile then @@ -536,7 +549,7 @@ module ScriptPreprocessClosure = | _ -> lastClosureFile /// Reduce the full directive closure into LoadClosure - let GetLoadClosure (rootFilename, closureFiles, tcConfig: TcConfig, codeContext, packageReferences, earlierDiagnostics) = + let GetLoadClosure (rootFilename, closureFiles, tcConfig: TcConfig, codeContext, packageReferences, earlierDiagnostics) : LoadClosure = // Mark the last file as isLastCompiland. let closureFiles = @@ -608,23 +621,21 @@ module ScriptPreprocessClosure = // Filter out non-root errors and warnings let allRootDiagnostics = allRootDiagnostics |> List.filter (fst >> isRootRange) - let result: LoadClosure = - { - SourceFiles = List.groupBy fst sourceFiles |> List.map (map2Of2 (List.map snd)) - References = List.groupBy fst references |> List.map (map2Of2 (List.map snd)) - PackageReferences = packageReferences - UseDesktopFramework = (tcConfig.primaryAssembly = PrimaryAssembly.Mscorlib) - SdkDirOverride = tcConfig.sdkDirOverride - UnresolvedReferences = unresolvedReferences - Inputs = sourceInputs - NoWarns = List.groupBy fst globalNoWarns |> List.map (map2Of2 (List.map snd)) - OriginalLoadReferences = tcConfig.loadedSources - ResolutionDiagnostics = resolutionDiagnostics - AllRootFileDiagnostics = allRootDiagnostics - LoadClosureRootFileDiagnostics = loadClosureRootDiagnostics - } - - result + { + SourceFiles = List.groupBy fst sourceFiles |> List.map (map2Of2 (List.map snd)) + References = List.groupBy fst references |> List.map (map2Of2 (List.map snd)) + PackageReferences = packageReferences + PackageManagerLines = tcConfig.packageManagerLines + UseDesktopFramework = (tcConfig.primaryAssembly = PrimaryAssembly.Mscorlib) + SdkDirOverride = tcConfig.sdkDirOverride + UnresolvedReferences = unresolvedReferences + Inputs = sourceInputs + NoWarns = List.groupBy fst globalNoWarns |> List.map (map2Of2 (List.map snd)) + OriginalLoadReferences = tcConfig.loadedSources + ResolutionDiagnostics = resolutionDiagnostics + AllRootFileDiagnostics = allRootDiagnostics + LoadClosureRootFileDiagnostics = loadClosureRootDiagnostics + } /// Given source text, find the full load closure. Used from service.fs, when editing a script file let GetFullClosureOfScriptText @@ -633,6 +644,7 @@ module ScriptPreprocessClosure = defaultFSharpBinariesDir, fileName, sourceText, + caret, codeContext, useSimpleResolution, useFsiAuxLib, @@ -645,7 +657,6 @@ module ScriptPreprocessClosure = reduceMemoryUsage, dependencyProvider ) = - // Resolve the basic references such as FSharp.Core.dll first, before processing any #I directives in the script // // This is tries to mimic the action of running the script in F# Interactive - the initial context for scripting is created @@ -696,7 +707,7 @@ module ScriptPreprocessClosure = reduceMemoryUsage ) - let closureSources = [ ClosureSource(fileName, range0, sourceText, true) ] + let closureSources = [ ClosureSource(fileName, range0, sourceText, caret, true) ] let closureFiles, tcConfig, packageReferences = FindClosureFiles(fileName, closureSources, tcConfig, codeContext, lexResourceManager, dependencyProvider) @@ -733,6 +744,7 @@ type LoadClosure with defaultFSharpBinariesDir, fileName: string, sourceText: ISourceText, + caret: Position option, implicitDefines, useSimpleResolution: bool, useFsiAuxLib, @@ -753,6 +765,7 @@ type LoadClosure with defaultFSharpBinariesDir, fileName, sourceText, + caret, implicitDefines, useSimpleResolution, useFsiAuxLib, diff --git a/src/Compiler/Driver/ScriptClosure.fsi b/src/Compiler/Driver/ScriptClosure.fsi index 6f764b299a9..249885036cd 100644 --- a/src/Compiler/Driver/ScriptClosure.fsi +++ b/src/Compiler/Driver/ScriptClosure.fsi @@ -42,6 +42,9 @@ type LoadClosure = /// The resolved package references along with the ranges of the #r positions in each file. PackageReferences: (range * string list)[] + /// The raw package manager lines in the script + PackageManagerLines: Map + /// Whether we're decided to use .NET Framework analysis for this script UseDesktopFramework: bool @@ -80,6 +83,7 @@ type LoadClosure = defaultFSharpBinariesDir: string * fileName: string * sourceText: ISourceText * + caret: Position option * implicitDefines: CodeContext * useSimpleResolution: bool * useFsiAuxLib: bool * diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index c55da121cdc..5eb8bd35f99 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -112,6 +112,7 @@ type internal IBackgroundCompiler = abstract member GetProjectOptionsFromScript: fileName: string * sourceText: ISourceText * + caret: Position option * previewEnabled: bool option * loadedTimeStamp: System.DateTime option * otherFlags: string array option * @@ -126,6 +127,7 @@ type internal IBackgroundCompiler = abstract GetProjectSnapshotFromScript: fileName: string * sourceText: ISourceTextNew * + caret: Position option * documentSource: DocumentSource * previewEnabled: bool option * loadedTimeStamp: System.DateTime option * @@ -1276,6 +1278,7 @@ type internal BackgroundCompiler ( fileName, sourceText, + caret, previewEnabled, loadedTimeStamp, otherFlags, @@ -1326,6 +1329,7 @@ type internal BackgroundCompiler FSharpCheckerResultsSettings.defaultFSharpBinariesDir, fileName, sourceText, + caret, CodeContext.Editing, useSimpleResolution, useFsiAuxLib, @@ -1543,6 +1547,7 @@ type internal BackgroundCompiler ( fileName: string, sourceText: ISourceText, + caret: Position option, previewEnabled: bool option, loadedTimeStamp: DateTime option, otherFlags: string array option, @@ -1556,6 +1561,7 @@ type internal BackgroundCompiler self.GetProjectOptionsFromScript( fileName, sourceText, + caret, previewEnabled, loadedTimeStamp, otherFlags, @@ -1571,6 +1577,7 @@ type internal BackgroundCompiler ( fileName: string, sourceText: ISourceTextNew, + caret: Position option, documentSource: DocumentSource, previewEnabled: bool option, loadedTimeStamp: DateTime option, @@ -1587,6 +1594,7 @@ type internal BackgroundCompiler self.GetProjectOptionsFromScript( fileName, sourceText, + caret, previewEnabled, loadedTimeStamp, otherFlags, diff --git a/src/Compiler/Service/BackgroundCompiler.fsi b/src/Compiler/Service/BackgroundCompiler.fsi index d93ece6217b..6192b23e3f9 100644 --- a/src/Compiler/Service/BackgroundCompiler.fsi +++ b/src/Compiler/Service/BackgroundCompiler.fsi @@ -90,6 +90,7 @@ type internal IBackgroundCompiler = abstract GetProjectOptionsFromScript: fileName: string * sourceText: ISourceText * + caret: Position option * previewEnabled: bool option * loadedTimeStamp: System.DateTime option * otherFlags: string array option * @@ -104,6 +105,7 @@ type internal IBackgroundCompiler = abstract GetProjectSnapshotFromScript: fileName: string * sourceText: ISourceTextNew * + caret: Position option * documentSource: DocumentSource * previewEnabled: bool option * loadedTimeStamp: System.DateTime option * diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index c4b65045b6b..57d322c81a8 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -3981,6 +3981,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, tcConfig: TcConfig, tcGlobal defaultFSharpBinariesDir, fileName, sourceText, + None, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 9c16357d2d7..39560cb3b6b 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -496,6 +496,7 @@ type internal TransparentCompiler defaultFSharpBinariesDir, fileName, source, + None, CodeContext.Editing, useSimpleResolution, useFsiAuxLib, @@ -2315,6 +2316,7 @@ type internal TransparentCompiler ( fileName: string, sourceText: ISourceText, + caret: Position option, previewEnabled: bool option, loadedTimeStamp: DateTime option, otherFlags: string array option, @@ -2332,6 +2334,7 @@ type internal TransparentCompiler bc.GetProjectSnapshotFromScript( fileName, SourceTextNew.ofISourceText sourceText, + caret, DocumentSource.FileSystem, previewEnabled, loadedTimeStamp, @@ -2352,6 +2355,7 @@ type internal TransparentCompiler ( fileName: string, sourceText: ISourceTextNew, + caret: Position option, documentSource: DocumentSource, previewEnabled: bool option, loadedTimeStamp: DateTime option, diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 7c499e41f0c..1e053fde7ff 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -492,6 +492,7 @@ type FSharpChecker ( fileName, source, + ?caret, ?previewEnabled, ?loadedTimeStamp, ?otherFlags, @@ -507,6 +508,7 @@ type FSharpChecker backgroundCompiler.GetProjectOptionsFromScript( fileName, source, + caret, previewEnabled, loadedTimeStamp, otherFlags, @@ -523,6 +525,7 @@ type FSharpChecker ( fileName, source, + ?caret, ?documentSource, ?previewEnabled, ?loadedTimeStamp, @@ -540,6 +543,7 @@ type FSharpChecker backgroundCompiler.GetProjectSnapshotFromScript( fileName, source, + caret, documentSource, previewEnabled, loadedTimeStamp, diff --git a/src/Compiler/Service/service.fsi b/src/Compiler/Service/service.fsi index 58c4a8c1dfb..69ae46b16b5 100644 --- a/src/Compiler/Service/service.fsi +++ b/src/Compiler/Service/service.fsi @@ -226,6 +226,7 @@ type public FSharpChecker = /// /// Used to differentiate between scripts, to consider each script a separate project. Also used in formatted error messages. /// The source for the file. + /// The editor location for the cursor if available. /// Is the preview compiler enabled. /// Indicates when the script was loaded into the editing environment, /// so that an 'unload' and 'reload' action will cause the script to be considered as a new project, @@ -240,6 +241,7 @@ type public FSharpChecker = member GetProjectOptionsFromScript: fileName: string * source: ISourceText * + ?caret: Position * ?previewEnabled: bool * ?loadedTimeStamp: DateTime * ?otherFlags: string[] * @@ -253,6 +255,7 @@ type public FSharpChecker = /// Used to differentiate between scripts, to consider each script a separate project. Also used in formatted error messages. /// The source for the file. + /// The editor location for the cursor if available. /// DocumentSource to load any additional files. /// Is the preview compiler enabled. /// Indicates when the script was loaded into the editing environment, @@ -269,6 +272,7 @@ type public FSharpChecker = member GetProjectSnapshotFromScript: fileName: string * source: ISourceTextNew * + ?caret: Position * ?documentSource: DocumentSource * ?previewEnabled: bool * ?loadedTimeStamp: DateTime * diff --git a/src/FSharp.DependencyManager.Nuget/FSDependencyManager.txt b/src/FSharp.DependencyManager.Nuget/FSDependencyManager.txt index e70d2691151..6eb22c00f7a 100644 --- a/src/FSharp.DependencyManager.Nuget/FSDependencyManager.txt +++ b/src/FSharp.DependencyManager.Nuget/FSDependencyManager.txt @@ -9,4 +9,5 @@ highestVersion,"with the highest version" sourceDirectoryDoesntExist,"The source directory '%s' not found" timedoutResolvingPackages,"Timed out resolving packages, process: '%s' '%s'" invalidTimeoutValue,"Invalid value for timeout '%s', valid values: none, -1 and integer milliseconds to wait" -missingTimeoutValue,"Missing value for timeout" \ No newline at end of file +missingTimeoutValue,"Missing value for timeout" +invalidBooleanValue,"Invalid value for boolean '%s', valid values: true or false" \ No newline at end of file diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs index 553c97dc60f..f25d31a1ba7 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs @@ -11,6 +11,7 @@ type PackageReference = Version: string RestoreSources: string Script: string + UsePackageTargets: bool } module internal ProjectFile = diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs index f900c87fb84..a1ff3c900bb 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.fs @@ -55,16 +55,30 @@ module FSharpDependencyManager = Version = ver RestoreSources = src Script = script + UsePackageTargets = usePackageTargets } = p + let usePackageTargets = + match usePackageTargets with + | false -> "ExcludeAssets='build;buildTransitive;buildMultitargeting'" + | true -> "" + seq { match not (String.IsNullOrEmpty(inc)), not (String.IsNullOrEmpty(ver)), not (String.IsNullOrEmpty(script)) with - | true, true, false -> yield sprintf @" " inc ver + | true, true, false -> + yield sprintf @" " inc ver usePackageTargets | true, true, true -> - yield sprintf @" " inc ver script - | true, false, false -> yield sprintf @" " inc - | true, false, true -> yield sprintf @" " inc script + yield + sprintf + @" " + inc + ver + script + usePackageTargets + | true, false, false -> yield sprintf @" " inc usePackageTargets + | true, false, true -> + yield sprintf @" " inc script usePackageTargets | _ -> () match not (String.IsNullOrEmpty(src)) with @@ -96,6 +110,7 @@ module FSharpDependencyManager = Version = "*" RestoreSources = "" Script = "" + UsePackageTargets = false } match options with @@ -114,11 +129,20 @@ module FSharpDependencyManager = let setVersion v = Some { current with Version = v } + let setUsePackageTargets v = + Some { current with UsePackageTargets = v } + match opt with | Some "include", Some v -> addInclude v |> parsePackageReferenceOption' rest implicitArgumentCount | Some "include", None -> raise (ArgumentException(SR.requiresAValue ("Include"))) | Some "version", Some v -> setVersion v |> parsePackageReferenceOption' rest implicitArgumentCount | Some "version", None -> setVersion "*" |> parsePackageReferenceOption' rest implicitArgumentCount + | Some "usepackagetargets", v -> + match v with + | Some v when v.ToLowerInvariant() = "true" -> setUsePackageTargets true + | Some v when v.ToLowerInvariant() = "false" -> setUsePackageTargets false + | _ -> raise (ArgumentException(SR.invalidBooleanValue ("usepackagetargets"))) + |> parsePackageReferenceOption' rest implicitArgumentCount | Some "restoresources", Some v -> Some { current with @@ -208,12 +232,12 @@ module FSharpDependencyManager = let referencesHaveWildCardVersion = // Verify to see if the developer specified a wildcard version. If they did then caching is not possible let hasWildCardVersion p = - // Todo: named record please let { Include = package Version = ver RestoreSources = _ Script = _ + UsePackageTargets = _ } = p diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.cs.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.cs.xlf index 800c2e40248..1df52699df6 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.cs.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.cs.xlf @@ -12,6 +12,11 @@ s nejvyšší verzí + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Neplatná hodnota pro časový limit {0}. Platné hodnoty: none, -1 a celočíselný počet milisekund, po které se má počkat diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.de.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.de.xlf index f3762130515..bb2ec8665b4 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.de.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.de.xlf @@ -12,6 +12,11 @@ mit der höchsten Version + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Ungültiger Wert für Timeout "{0}", gültige Werte: keine, -1 und ganzzahlige Millisekundenwerte für die Wartezeit diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.es.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.es.xlf index 2851c230dab..e9ee6650268 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.es.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.es.xlf @@ -12,6 +12,11 @@ con la última versión + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Valor de tiempo de espera "{0}" no válido. Valores válidos: ninguno, -1 y un número entero de milisegundos de espera diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.fr.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.fr.xlf index 8ab1dccc35f..60c4bb10953 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.fr.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.fr.xlf @@ -12,6 +12,11 @@ avec la version la plus récente + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Valeur non valide pour le délai d'expiration : '{0}'. Valeurs valides : aucune valeur, -1 ou un nombre entier pour le délai d'attente en millisecondes diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.it.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.it.xlf index c605c4af3ba..260e4879994 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.it.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.it.xlf @@ -12,6 +12,11 @@ con la versione massima + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Valore non valido per il timeout '{0}'. I valori validi sono: nessuno, -1 e numeri interi per i millisecondi di attesa diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ja.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ja.xlf index 2e19d06a10f..63bb78e5411 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ja.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ja.xlf @@ -12,6 +12,11 @@ 最新バージョン + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait タイムアウト '{0}' の値が無効です。有効な値: なし、-1、および整数 (待機するミリ秒) diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ko.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ko.xlf index 01d252b6243..2390149fd84 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ko.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ko.xlf @@ -12,6 +12,11 @@ 최상위 버전으로 + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait 시간 제한 '{0}'의 값이 잘못되었습니다. 유효한 값: 없음, -1 및 정수 대기 시간(밀리초) diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pl.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pl.xlf index 4ae0d2e448e..19b971eb1eb 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pl.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pl.xlf @@ -12,6 +12,11 @@ z najwyższą wersją + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Nieprawidłowa wartość limitu czasu „{0}”; prawidłowe wartości: none, -1 i liczba całkowita określająca liczbę milisekund oczekiwania diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pt-BR.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pt-BR.xlf index 7e8409fd8d7..fe73e35d112 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pt-BR.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.pt-BR.xlf @@ -12,6 +12,11 @@ com a versão mais recente + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Valor inválido para o tempo limite '{0}'. Valores válidos: none,-1 e milissegundos inteiros de espera diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ru.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ru.xlf index dafbfb8243d..c7f602855d5 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ru.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.ru.xlf @@ -12,6 +12,11 @@ с наивысшей версией + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Недопустимое значение времени ожидания "{0}". Допустимые значения: none, –1 и integer, мс ожидания. diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.tr.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.tr.xlf index 312793af714..585ac4950e4 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.tr.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.tr.xlf @@ -12,6 +12,11 @@ en yüksek sürümle + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait Zaman aşımı için '{0}' değeri geçersiz, geçerli değerler: none, -1 ve tamsayı milisaniye cinsinden bekleme süresi diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hans.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hans.xlf index 7e04d921b0a..2192ad1c9df 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hans.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hans.xlf @@ -12,6 +12,11 @@ 具有最高版本 + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait 超时 "{0}" 的值无效,有效值: none、-1 和要等待的毫秒数(整数) diff --git a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hant.xlf b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hant.xlf index d82293b0cf2..f7911a29659 100644 --- a/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hant.xlf +++ b/src/FSharp.DependencyManager.Nuget/xlf/FSDependencyManager.txt.zh-Hant.xlf @@ -12,6 +12,11 @@ 具有最高版本 + + Invalid value for boolean '{0}', valid values: true or false + Invalid value for boolean '{0}', valid values: true or false + + Invalid value for timeout '{0}', valid values: none, -1 and integer milliseconds to wait 逾時 '{0}' 值無效,有效的值: 無、-1 和要等候的整數毫秒 diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs index d085005d9ac..ecf5b81d97b 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs @@ -513,3 +513,21 @@ let add (col:IServiceCollection) = let _value,diag = script.Eval(code) Assert.Empty(diag) + [] + [] + [] + [] + [] + member _.``Eval script with usepackagetargets options``(code, shouldSucceed, error) = + use script = new FSharpScript() + let result, errors = script.Eval(code) + match shouldSucceed with + | true -> + Assert.Empty(errors) + match result with + | Ok(_) -> () + | Error(ex) -> Assert.True(false, "expected no failures") + | false -> + Assert.NotEmpty(errors) + Assert.Equal(1, errors.Length) + Assert.Equal(error, errors.[0].ToString()) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 1836a6673c1..f89f7a406be 100755 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2066,7 +2066,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysi FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.CodeAnalysis.FSharpSymbolUse[] GetUsesOfSymbolInFile(FSharp.Compiler.Symbols.FSharpSymbol, Microsoft.FSharp.Core.FSharpOption`1[System.Threading.CancellationToken]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] Diagnostics FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Diagnostics.FSharpDiagnostic[] get_Diagnostics() -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]]) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.DeclarationListInfo GetDeclarationListInfo(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Position,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.EditorServices.CompletionContext]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.FindDeclResult GetDeclarationLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.MethodGroup GetMethods(Int32, Int32, System.String, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[System.String]]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.EditorServices.SemanticClassificationItem[] GetSemanticClassification(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) @@ -2079,7 +2079,7 @@ FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSh FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Symbols.FSharpOpenDeclaration[] get_OpenDeclarations() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: FSharp.Compiler.Text.Range[] GetFormatSpecifierLocations() FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUsesAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]]) +FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse]] GetDeclarationListSymbols(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults], Int32, System.String, FSharp.Compiler.EditorServices.PartialLongName, Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.EditorServices.AssemblySymbol]]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.FSharpSymbolUse] GetSymbolUseAtLocation(Int32, Int32, System.String, Microsoft.FSharp.Collections.FSharpList`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpDisplayContext] GetDisplayContextForPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Symbols.FSharpImplementationFileContents] ImplementationFile @@ -2136,8 +2136,8 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],Microsoft.FSharp.Core.FSharpOption`1[System.Exception]]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) @@ -2830,12 +2830,20 @@ FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 GetHashCod FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 Tag FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: Int32 get_Tag() FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo: System.String ToString() +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType ActualType FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData: FSharp.Compiler.Symbols.FSharpType get_ActualType() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField ImplementationField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField SignatureField FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_ImplementationField() FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpField get_SignatureField() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() +FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo() FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext @@ -2851,21 +2859,13 @@ FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ArgumentsInSigAndImplMismatchExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+DiagnosticContextInfo +FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExpressionIsAFunctionExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] DiagnosticId -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId() -FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat() -FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ExperimentalExtendedData FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity Severity FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity get_Severity() @@ -3047,7 +3047,9 @@ FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.EditorServices.MethodOverrideCompletionContext get_ctx() FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range enclosingTypeNameRange FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: FSharp.Compiler.Text.Range get_enclosingTypeNameRange() +FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeEnclosingDefinition() FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 get_spacesBeforeOverrideKeyword() +FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeEnclosingDefinition FSharp.Compiler.EditorServices.CompletionContext+MethodOverride: Int32 spacesBeforeOverrideKeyword FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean get_isOpenType() FSharp.Compiler.EditorServices.CompletionContext+OpenDeclaration: Boolean isOpenType @@ -3102,7 +3104,7 @@ FSharp.Compiler.EditorServices.CompletionContext: Boolean get_IsUnionCaseFieldsD FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext AttributeApplication FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext Invalid FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewInherit(FSharp.Compiler.EditorServices.InheritanceContext, System.Tuple`2[Microsoft.FSharp.Collections.FSharpList`1[System.String],Microsoft.FSharp.Core.FSharpOption`1[System.String]]) -FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean) +FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewMethodOverride(FSharp.Compiler.EditorServices.MethodOverrideCompletionContext, FSharp.Compiler.Text.Range, Int32, Boolean, Boolean, Int32) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewOpenDeclaration(Boolean) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewParameterList(FSharp.Compiler.Text.Position, System.Collections.Generic.HashSet`1[System.String]) FSharp.Compiler.EditorServices.CompletionContext: FSharp.Compiler.EditorServices.CompletionContext NewPattern(FSharp.Compiler.EditorServices.PatternContext) diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 8e92f93f0e1..f89f7a406be 100755 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2136,8 +2136,8 @@ FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, FSharpProjectSnapshot, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer]] ParseAndCheckFileInProject(System.String, Int32, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpParseFileResults,FSharp.Compiler.CodeAnalysis.FSharpCheckFileResults]] GetBackgroundCheckResultsForFileInProject(System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) -FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.FSharpProjectOptions,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectOptionsFromScript(System.String, FSharp.Compiler.Text.ISourceText, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) +FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.CodeAnalysis.ProjectSnapshot+FSharpProjectSnapshot,Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Diagnostics.FSharpDiagnostic]]] GetProjectSnapshotFromScript(System.String, FSharp.Compiler.Text.ISourceTextNew, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.CodeAnalysis.DocumentSource], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.DateTime], Microsoft.FSharp.Core.FSharpOption`1[System.String[]], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.Int64], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Diagnostics.FSharpDiagnostic[],Microsoft.FSharp.Core.FSharpOption`1[System.Exception]]] Compile(System.String[], Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, FSharp.Compiler.Text.ISourceText, FSharp.Compiler.CodeAnalysis.FSharpParsingOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) FSharp.Compiler.CodeAnalysis.FSharpChecker: Microsoft.FSharp.Control.FSharpAsync`1[System.Tuple`2[FSharp.Compiler.Text.Range,FSharp.Compiler.Text.Range][]] MatchBraces(System.String, System.String, FSharp.Compiler.CodeAnalysis.FSharpProjectOptions, Microsoft.FSharp.Core.FSharpOption`1[System.String]) diff --git a/tests/fsharp/core/printing/output.1000.stdout.bsl b/tests/fsharp/core/printing/output.1000.stdout.bsl index 1d5c0fcbae2..e2f3a8d57c8 100644 --- a/tests/fsharp/core/printing/output.1000.stdout.bsl +++ b/tests/fsharp/core/printing/output.1000.stdout.bsl @@ -2787,7 +2787,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0319. - A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 + Ee54a783c1b4e3fe8e3c42c5a10c384669fed24c7ffbdacfc9698816f925f337 {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.200.stdout.bsl b/tests/fsharp/core/printing/output.200.stdout.bsl index 52926a6c17a..a707919336b 100644 --- a/tests/fsharp/core/printing/output.200.stdout.bsl +++ b/tests/fsharp/core/printing/output.200.stdout.bsl @@ -2032,7 +2032,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0319. - A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 + Ee54a783c1b4e3fe8e3c42c5a10c384669fed24c7ffbdacfc9698816f925f337 {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.multiemit.stdout.bsl b/tests/fsharp/core/printing/output.multiemit.stdout.bsl index 2933f92f8b5..9cdf63bcc36 100644 --- a/tests/fsharp/core/printing/output.multiemit.stdout.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stdout.bsl @@ -6334,7 +6334,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0318. - A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 + Ee54a783c1b4e3fe8e3c42c5a10c384669fed24c7ffbdacfc9698816f925f337 {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.off.stdout.bsl b/tests/fsharp/core/printing/output.off.stdout.bsl index 66ff18c8fb9..5806de4d312 100644 --- a/tests/fsharp/core/printing/output.off.stdout.bsl +++ b/tests/fsharp/core/printing/output.off.stdout.bsl @@ -1801,7 +1801,7 @@ val ShortName: string = "hi" > val list2: int list module FSI_0319. - A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 + Ee54a783c1b4e3fe8e3c42c5a10c384669fed24c7ffbdacfc9698816f925f337 {"ImmutableField0":6} type R1 = diff --git a/tests/fsharp/core/printing/output.stdout.bsl b/tests/fsharp/core/printing/output.stdout.bsl index 2933f92f8b5..9cdf63bcc36 100644 --- a/tests/fsharp/core/printing/output.stdout.bsl +++ b/tests/fsharp/core/printing/output.stdout.bsl @@ -6334,7 +6334,7 @@ val ShortName: string = "hi" > val list2: int list = [1] module FSI_0318. - A8a951db8294f99e95ae1d276a7ddaefd93d1548e6bf749bdeae55d2649682b3 + Ee54a783c1b4e3fe8e3c42c5a10c384669fed24c7ffbdacfc9698816f925f337 {"ImmutableField0":6} type R1 = diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 23012fa64e2..8cc271d4928 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -7,9 +7,15 @@ open System open System.IO open System.Collections.Immutable open System.Collections.Generic +open System.Runtime.InteropServices open System.Threading open System.Threading.Tasks +open Microsoft.VisualStudio +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Interop +open Microsoft.VisualStudio.TextManager.Interop + open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Host @@ -19,6 +25,10 @@ open FSharp.Compiler.Syntax open FSharp.Compiler.Text open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.Editor +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio +open Microsoft.VisualStudio.OLE.Interop type private FSharpGlyph = FSharp.Compiler.EditorServices.FSharpGlyph type private FSharpRoslynGlyph = Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyph @@ -59,6 +69,62 @@ type Project with member this.IsFSharp = this.Language = LanguageNames.FSharp +type TextViewEventsHandler + ( + onChangeCaretHandler: (IVsTextView * int * int -> unit) option, + onKillFocus: (IVsTextView -> unit) option, + onSetFocus: (IVsTextView -> unit) option + ) = + interface IVsTextViewEvents with + member this.OnChangeCaretLine(view: IVsTextView, newline: int, oldline: int) = + onChangeCaretHandler + |> Option.iter (fun handler -> handler (view, newline, oldline)) + + member this.OnChangeScrollInfo + ( + _view: IVsTextView, + _iBar: int, + _iMinUnit: int, + _iMaxUnits: int, + _iVisibleUnits: int, + _iFirstVisibleUnit: int + ) = + () + + member this.OnKillFocus(view: IVsTextView) = + onKillFocus |> Option.iter (fun handler -> handler (view)) + + member this.OnSetBuffer(_view: IVsTextView, _buffer: IVsTextLines) = () + + member this.OnSetFocus(view: IVsTextView) = + onSetFocus |> Option.iter (fun handler -> handler (view)) + +type ConnectionPointSubscription = System.IDisposable option + +// Usage example: +// If a handler is None, to not handle that event +// let subscription = subscribeToTextViewEvents (textView, onChangeCaretHandler, onKillFocus, OnSetFocus) +// Unsubscribe using subscription.Dispose() +let subscribeToTextViewEvents (textView: IVsTextView, onChangeCaretHandler, onKillFocus, OnSetFocus) : ConnectionPointSubscription = + let handler = TextViewEventsHandler(onChangeCaretHandler, onKillFocus, OnSetFocus) + + match textView with + | :? IConnectionPointContainer as cpContainer -> + let riid = typeof.GUID + let mutable cookie = 0u + + match cpContainer.FindConnectionPoint(ref riid) with + | null -> None + | cp -> + Some( + cp.Advise(handler, &cookie) + + { new IDisposable with + member _.Dispose() = cp.Unadvise(cookie) + } + ) + | _ -> None + type Document with member this.TryGetLanguageService<'T when 'T :> ILanguageService>() = @@ -69,6 +135,32 @@ type Document with | null -> None | languageServices -> languageServices.GetService<'T>() |> Some + member this.TryGetIVsTextView() : IVsTextView option = + match ServiceProvider.GlobalProvider.GetService(typeof) with + | :? IVsTextManager as textManager -> + // Grab IVsRunningDocumentTable + match ServiceProvider.GlobalProvider.GetService(typeof) with + | :? IVsRunningDocumentTable as rdt -> + match rdt.FindAndLockDocument(uint32 _VSRDTFLAGS.RDT_NoLock, this.FilePath) with + | hr, _, _, docData, _ when ErrorHandler.Succeeded(hr) && docData <> IntPtr.Zero -> + match Marshal.GetObjectForIUnknown docData with + | :? IVsTextBuffer as ivsTextBuffer -> + match textManager.GetActiveView(1, ivsTextBuffer) with + | hr, vsTextView when ErrorHandler.Succeeded(hr) -> Some vsTextView + | _ -> None + | _ -> None + | _ -> None + | _ -> None + | _ -> None + + member this.TryGetTextViewAndCaretPos() : (IVsTextView * Position) option = + match this.TryGetIVsTextView() with + | Some textView -> + match textView.GetCaretPos() with + | hr, line, column when ErrorHandler.Succeeded(hr) -> Some(textView, Position.fromZ line column) + | _ -> None + | None -> None + member this.IsFSharpScript = isScriptFile this.FilePath member this.IsFSharpSignatureFile = isSignatureFile this.FilePath diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index c51db3021cf..edf31e68a57 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -16,6 +16,13 @@ open System.Threading open Microsoft.VisualStudio.FSharp.Interactive.Session open System.Runtime.CompilerServices open CancellableTasks +open Microsoft.VisualStudio.FSharp.Editor.Extensions +open System.Windows +open Microsoft.VisualStudio +open FSharp.Compiler.Text +open Microsoft.VisualStudio.TextManager.Interop + +#nowarn "57" [] module private FSharpProjectOptionsHelpers = @@ -118,7 +125,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = ConcurrentDictionary() let singleFileCache = - ConcurrentDictionary() + ConcurrentDictionary() // This is used to not constantly emit the same compilation. let weakPEReferences = ConditionalWeakTable() @@ -198,15 +205,29 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = | false, _ -> let! sourceText = document.GetTextAsync(ct) - let! scriptProjectOptions, _ = - checker.GetProjectOptionsFromScript( - document.FilePath, - sourceText.ToFSharpSourceText(), - previewEnabled = SessionsProperties.fsiPreview, - assumeDotNetFramework = not SessionsProperties.fsiUseNetCore, - userOpName = userOpName - ) + let getProjectOptionsFromScript textViewAndCaret = + match textViewAndCaret with + | None -> + checker.GetProjectOptionsFromScript( + document.FilePath, + sourceText.ToFSharpSourceText(), + previewEnabled = SessionsProperties.fsiPreview, + assumeDotNetFramework = not SessionsProperties.fsiUseNetCore, + userOpName = userOpName + ) + + | Some(_, caret) -> + checker.GetProjectOptionsFromScript( + document.FilePath, + sourceText.ToFSharpSourceText(), + caret, + previewEnabled = SessionsProperties.fsiPreview, + assumeDotNetFramework = not SessionsProperties.fsiUseNetCore, + userOpName = userOpName + ) + let textViewAndCaret = document.TryGetTextViewAndCaretPos() + let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret let project = document.Project let otherOptions = @@ -243,13 +264,46 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions(projectOptions) - singleFileCache.[document.Id] <- (document.Project, fileStamp, parsingOptions, projectOptions) + let updateProjectOptions () = + async { + let! scriptProjectOptions, _ = getProjectOptionsFromScript None + + checker.NotifyFileChanged(document.FilePath, scriptProjectOptions) + |> Async.Start + } + |> Async.Start + + let onChangeCaretHandler (_, _newline: int, _oldline: int) = updateProjectOptions () + let onKillFocus (_) = updateProjectOptions () + let onSetFocus (_) = updateProjectOptions () + + let addToCacheAndSubscribe value = + match value with + | projectId, fileStamp, parsingOptions, projectOptions, _ -> + let subscription = + match textViewAndCaret with + | Some(textView, _) -> + subscribeToTextViewEvents (textView, (Some onChangeCaretHandler), (Some onKillFocus), (Some onSetFocus)) + | None -> None + + (projectId, fileStamp, parsingOptions, projectOptions, subscription) + + singleFileCache.AddOrUpdate( + document.Id, // The key to the cache + (fun _ value -> addToCacheAndSubscribe value), // Function to add the cached value if the key does not exist + (fun _ _ value -> value), // Function to update the value if the key exists + (document.Project, fileStamp, parsingOptions, projectOptions, None) // The value to add or update + ) + |> ignore return ValueSome(parsingOptions, projectOptions) - | true, (oldProject, oldFileStamp, parsingOptions, projectOptions) -> + | true, (oldProject, oldFileStamp, parsingOptions, projectOptions, _) -> if fileStamp <> oldFileStamp || isProjectInvalidated document.Project oldProject ct then - singleFileCache.TryRemove(document.Id) |> ignore + match singleFileCache.TryRemove(document.Id) with + | true, (_, _, _, _, Some subscription) -> subscription.Dispose() + | _ -> () + return! tryComputeOptionsBySingleScriptOrFile document userOpName else return ValueSome(parsingOptions, projectOptions) @@ -460,9 +514,10 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = legacyProjectSites.TryRemove(projectId) |> ignore | FSharpProjectOptionsMessage.ClearSingleFileOptionsCache(documentId) -> match singleFileCache.TryRemove(documentId) with - | true, (_, _, _, projectOptions) -> + | true, (_, _, _, projectOptions, subscription) -> lastSuccessfulCompilations.TryRemove(documentId.ProjectId) |> ignore checker.ClearCache([ projectOptions ]) + subscription |> Option.iter (fun handler -> handler.Dispose()) | _ -> () } diff --git a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs index 4f6a3922118..c92e4e99586 100644 --- a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs +++ b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs @@ -98,7 +98,7 @@ type internal FSharpLanguageServiceBackgroundRequests_DEPRECATED lazy // This portion is executed on the language service thread let timestamp = if source=null then System.DateTime(2000,1,1) else source.OpenedTime // source is null in unit tests let checker = getInteractiveChecker() - let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(fileName, FSharp.Compiler.Text.SourceText.ofString sourceText, SessionsProperties.fsiPreview, timestamp, [| |]) |> Async.RunImmediate + let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(fileName, FSharp.Compiler.Text.SourceText.ofString sourceText, previewEnabled=SessionsProperties.fsiPreview, loadedTimeStamp=timestamp, otherFlags=[| |]) |> Async.RunImmediate let referencedProjectFileNames = [| |] let projectSite = ProjectSitesAndFiles.CreateProjectSiteForScript(fileName, referencedProjectFileNames, checkOptions) { ProjectSite = projectSite diff --git a/vsintegration/tests/Salsa/salsa.fs b/vsintegration/tests/Salsa/salsa.fs index 6ac626f9fcb..1730bd7ec93 100644 --- a/vsintegration/tests/Salsa/salsa.fs +++ b/vsintegration/tests/Salsa/salsa.fs @@ -1110,7 +1110,7 @@ module internal Salsa = member file.GetFileName() = fileName member file.GetProjectOptionsOfScript() = - project.Solution.Vs.LanguageService.FSharpChecker.GetProjectOptionsFromScript(fileName, FSharp.Compiler.Text.SourceText.ofString file.CombinedLines, false, System.DateTime(2000,1,1), [| |]) + project.Solution.Vs.LanguageService.FSharpChecker.GetProjectOptionsFromScript(fileName, FSharp.Compiler.Text.SourceText.ofString file.CombinedLines, previewEnabled=false, loadedTimeStamp=System.DateTime(2000,1,1), otherFlags=[| |]) |> Async.RunImmediate |> fst // drop diagnostics From f8a550b64d4586b2de306ff93b77dd9e91965be3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 19:38:41 -0700 Subject: [PATCH 027/134] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250320.3 (#18398) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25163.3 -> To Version 9.0.0-alpha.1.25170.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 61e4ad5b07b..f4ec28da107 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 27dfbb8d8a0344d845948109a5a1f0d9c7f17fa9 + 6968f7059f4418e985febe704a3b1320f9e5887d From 8359ec6bd854f9641427ec5a234a7cbdaa895ee6 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 25 Mar 2025 00:30:12 -0700 Subject: [PATCH 028/134] Fantomas (#18404) --- vsintegration/src/FSharp.Editor/Common/Extensions.fs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 8cc271d4928..3483c9c583e 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -81,14 +81,8 @@ type TextViewEventsHandler |> Option.iter (fun handler -> handler (view, newline, oldline)) member this.OnChangeScrollInfo - ( - _view: IVsTextView, - _iBar: int, - _iMinUnit: int, - _iMaxUnits: int, - _iVisibleUnits: int, - _iFirstVisibleUnit: int - ) = + (_view: IVsTextView, _iBar: int, _iMinUnit: int, _iMaxUnits: int, _iVisibleUnits: int, _iFirstVisibleUnit: int) + = () member this.OnKillFocus(view: IVsTextView) = From 561a5eb188591f5c06b1750550ffb3f5f8ec3ad2 Mon Sep 17 00:00:00 2001 From: dawe Date: Tue, 25 Mar 2025 10:05:37 +0100 Subject: [PATCH 029/134] Fix false negative [] warning (#18399) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/TailCallChecks.fs | 7 +- .../ErrorMessages/TailCallAttribute.fs | 83 +++++++++++++++++-- 3 files changed, 83 insertions(+), 8 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index b9772f3f5ac..c4e4a6a1403 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,4 +1,5 @@ ### Fixed +* Fix missing TailCall warning in TOp.IntegerForLoop ([PR #18399](https://github.com/dotnet/fsharp/pull/18399)) * Fix classification of `nameof` in `nameof<'T>`, `match … with nameof ident -> …`. ([Issue #10026](https://github.com/dotnet/fsharp/issues/10026), [PR #18300](https://github.com/dotnet/fsharp/pull/18300)) * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280)) diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index a7ea9ad802a..20e9bec8945 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -792,7 +792,12 @@ let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) = // warn for recursive calls in TryWith/TryFinally operations exprs |> Seq.iter (checkTailCall true) | Expr.Op(args = exprs) -> exprs |> Seq.iter (checkTailCall insideSubBindingOrTry) - | Expr.Sequential(expr2 = expr2) -> checkTailCall insideSubBindingOrTry expr2 + | Expr.Sequential(expr1 = expr1; expr2 = expr2) -> + match expr1 with + | Expr.Op(args = exprs; op = TOp.IntegerForLoop _) -> checkTailCall insideSubBindingOrTry expr1 + | _ -> () + + checkTailCall insideSubBindingOrTry expr2 | _ -> () checkTailCall false bodyExpr diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs index 693833ef4b8..1b68505ab1e 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs @@ -773,13 +773,6 @@ namespace N |> compile |> shouldFail |> withResults [ - { Error = Warning 3569 - Range = { StartLine = 21 - StartColumn = 27 - EndLine = 21 - EndColumn = 35 } - Message = - "The member or function 'instType' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } { Error = Warning 3569 Range = { StartLine = 17 StartColumn = 32 @@ -787,6 +780,13 @@ namespace N EndColumn = 77 } Message = "The member or function 'instType' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } + { Error = Warning 3569 + Range = { StartLine = 21 + StartColumn = 27 + EndLine = 21 + EndColumn = 35 } + Message = + "The member or function 'instType' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } ] [] @@ -1769,3 +1769,72 @@ module M = |> withLangVersion80 |> compile |> shouldSucceed + + [] + let ``Warn successfully in Array-mapped recursive call`` () = + """ +namespace N + +module M = + + type Value = + { Code: string } + + [] + let rec fooArray (values: Value[], code: string) = + match values with + | [||] -> seq { code } + | values -> + let replicatedValues = + values + |> Array.map (fun value -> fooArray (values, value.Code)) + replicatedValues |> Seq.concat + """ + |> FSharp + |> withLangVersion80 + |> compile + |> shouldFail + |> withResults [ + { Error = Warning 3569 + Range = { StartLine = 16 + StartColumn = 20 + EndLine = 16 + EndColumn = 74 } + Message = + "The member or function 'fooArray' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } + ] + + [] + let ``Warn successfully in Seq-mapped recursive call`` () = + """ +namespace N + +module M = + + type Value = + { Code: string } + + [] + let rec fooSeq (values: Value[], code: string) = + match values with + | [||] -> seq { code } + | values -> + let replicatedValues = + values + |> Seq.map (fun value -> fooSeq (values, value.Code)) + |> Seq.toArray + replicatedValues |> Seq.concat + """ + |> FSharp + |> withLangVersion80 + |> compile + |> shouldFail + |> withResults [ + { Error = Warning 3569 + Range = { StartLine = 16 + StartColumn = 42 + EndLine = 16 + EndColumn = 48 } + Message = + "The member or function 'fooSeq' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } + ] From a305ccdd26183d0c6a5b36c2ebe974bd2172530c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:06:23 +0100 Subject: [PATCH 030/134] Update dependencies from https://github.com/dotnet/msbuild build 20250324.8 (#18405) Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.21-preview-25169-06 -> To Version 17.13.22-preview-25174-08 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) --- .config/dotnet-tools.json | 2 +- NuGet.config | 2 +- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3b266c03b4c..871b8f40a13 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -59,4 +59,4 @@ "rollForward": false } } -} \ No newline at end of file +} diff --git a/NuGet.config b/NuGet.config index 129a1d964be..944ae5b686e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f4ec28da107..a3b61734d48 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - 0586a3f904d83c5f77f8407661429caadcbdc5f9 + 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 - + https://github.com/dotnet/msbuild - 0586a3f904d83c5f77f8407661429caadcbdc5f9 + 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 - + https://github.com/dotnet/msbuild - 0586a3f904d83c5f77f8407661429caadcbdc5f9 + 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 - + https://github.com/dotnet/msbuild - 0586a3f904d83c5f77f8407661429caadcbdc5f9 + 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 - + https://github.com/dotnet/msbuild - 0586a3f904d83c5f77f8407661429caadcbdc5f9 + 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 5fff590d01b..5993821c9ea 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -94,7 +94,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.21 + 17.13.22 $(RoslynVersion) $(RoslynVersion) @@ -130,9 +130,9 @@ 15.0.25123-Dev15Preview - 17.13.21 - 17.13.21 - 17.13.21 + 17.13.22 + 17.13.22 + 17.13.22 $(VisualStudioEditorPackagesVersion) From 31fdf7b64be6184abb9a7e54aded7a1d181bba35 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 25 Mar 2025 13:14:38 +0100 Subject: [PATCH 031/134] Fix GC test that is flaky on Linux (#18408) --- .../ProjectAnalysisTests.fs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index 71bffac7974..0e12a33fe2f 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -1,5 +1,7 @@ module FSharp.Compiler.Service.Tests.ProjectAnalysisTests +open System.Threading.Tasks + #nowarn "57" // Experimental stuff let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e -> false @@ -128,8 +130,20 @@ module ClearLanguageServiceRootCachesTest = let weakTcImports = test () checker.InvalidateConfiguration Project1.options checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - GC.Collect() - System.Threading.SpinWait.SpinUntil(fun () -> not weakTcImports.IsAlive) + + task { + GC.Collect() + GC.WaitForPendingFinalizers() + // Try collecting many times, because GC has some problems, especially on Linux. + // See for example: https://github.com/dotnet/runtime/discussions/108081 + let mutable attempt = 1 + while weakTcImports.IsAlive && attempt < 10 do + GC.Collect() + GC.WaitForPendingFinalizers() + attempt <- attempt + 1 + do! Task.Delay(attempt * 1000) + Assert.False weakTcImports.IsAlive + } [] let ``Test Project1 should have protected FullName and TryFullName return same results`` () = From c549ebf6cf88911f51a273c5a855cbcee61ff88c Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Tue, 25 Mar 2025 14:29:58 +0100 Subject: [PATCH 032/134] update runtime to 9.0.3 (#18406) --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 3883eb9db41..eca327e814a 100644 --- a/global.json +++ b/global.json @@ -1,10 +1,10 @@ { "sdk": { - "version": "9.0.200", + "version": "9.0.202", "allowPrerelease": true }, "tools": { - "dotnet": "9.0.200", + "dotnet": "9.0.202", "vs": { "version": "17.8", "components": [ From fc6c4c99414e35b13a4c5292a38b8165b2a1aff0 Mon Sep 17 00:00:00 2001 From: Matt Thalman Date: Tue, 25 Mar 2025 13:24:03 -0500 Subject: [PATCH 033/134] Use correct TFM for source build when OfficialBuildId isn't set (#18397) --- src/Compiler/FSharp.Compiler.Service.fsproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 493248a11d3..ca08c3f63d9 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -23,7 +23,7 @@ OSX and Linux has problems with Xliff targets for net9, skipping via SKIP_NETCURRENT_FSC_BUILD until resolved ( The target "UpdateXlf" does not exist in the project.) --> - $(FSharpNetCoreProductDefaultTargetFramework);$(TargetFrameworks) + $(FSharpNetCoreProductTargetFramework);$(TargetFrameworks) $(DefineConstants);FSHARPCORE_USE_PACKAGE $(OtherFlags) --extraoptimizationloops:1 From d4a9f1356b119fa810cb32e56e0f90ab8698d82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Tue, 25 Mar 2025 15:37:38 -0700 Subject: [PATCH 034/134] Update dependencies coming from maintenance-packages (#18329) * Update dependencies coming from maintenance-packages * Remove temp feed * Sort * Push for real the changes this time * Update to latest in nuget.org * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250320.3 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25163.3 -> To Version 9.0.0-alpha.1.25170.3 * Bring back conditions * missing space --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) Co-authored-by: Tomas Grosup --- eng/Versions.props | 16 ++++++++++++---- src/FSharp.Build/Microsoft.FSharp.NetSdk.props | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 5993821c9ea..5ce287e802b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -71,21 +71,29 @@ $(VersionPrefix).0 + + + 4.6.1 + 4.6.2 + 6.1.1 + + + + 4.6.0 + 4.5.5 + 6.1.0 + 8.0.0 - 4.6.0 $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) - 4.5.5 - 4.6.0 4.7.0 $(SystemPackageVersionVersion) - 6.1.0 $(SystemPackageVersionVersion) 1.6.0 diff --git a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props index 38d83cd8ab4..e45f864ce22 100644 --- a/src/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -94,7 +94,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - 4.4.0 + 4.6.1 From 2408d66391b7d6717e9e11c178d9c1f45fdeb1c8 Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:04:39 +0100 Subject: [PATCH 035/134] update devcontainer sdk (#18412) --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8f6f1eee176..47927f1f370 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: { "name": "F#", - "image": "mcr.microsoft.com/dotnet/sdk:9.0.200", + "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", "features": { "ghcr.io/devcontainers/features/common-utils:2.5.2": {}, "ghcr.io/devcontainers/features/git:1.3.2": {}, From f4b677e0462ebd27df8813fbbab2a5d1ecec4284 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 26 Mar 2025 09:05:07 +0100 Subject: [PATCH 036/134] deal with hanging test (#18411) --- .../CompilerService/AsyncMemoize.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs index 3e940c51ea6..f37b64eb0f5 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs @@ -430,7 +430,7 @@ let ``Cancel running jobs with the same key`` () = let current = eventsWhen events (received Requested) Assert.Equal(0, current |> countOf Canceled) - waitUntil events (countOf Canceled >> (=) 10) + // waitUntil events (countOf Canceled >> (=) 10) waitUntil events (received Started) @@ -442,6 +442,7 @@ let ``Cancel running jobs with the same key`` () = Assert.Equal(0, events |> countOf Failed) + // All outdated jobs should have been canceled by now. Assert.Equal(10, events |> countOf Canceled) Assert.Equal(1, events |> countOf Finished) From e37ef75d1ef70a3e0ba87b506666fd15a3d951af Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 26 Mar 2025 01:05:28 -0700 Subject: [PATCH 037/134] typo (#18413) --- vsintegration/src/FSharp.Editor/Common/Extensions.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 3483c9c583e..2ed87e5ec82 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -97,10 +97,10 @@ type ConnectionPointSubscription = System.IDisposable option // Usage example: // If a handler is None, to not handle that event -// let subscription = subscribeToTextViewEvents (textView, onChangeCaretHandler, onKillFocus, OnSetFocus) +// let subscription = subscribeToTextViewEvents (textView, onChangeCaretHandler, onKillFocus, onSetFocus) // Unsubscribe using subscription.Dispose() -let subscribeToTextViewEvents (textView: IVsTextView, onChangeCaretHandler, onKillFocus, OnSetFocus) : ConnectionPointSubscription = - let handler = TextViewEventsHandler(onChangeCaretHandler, onKillFocus, OnSetFocus) +let subscribeToTextViewEvents (textView: IVsTextView, onChangeCaretHandler, onKillFocus, onSetFocus) : ConnectionPointSubscription = + let handler = TextViewEventsHandler(onChangeCaretHandler, onKillFocus, onSetFocus) match textView with | :? IConnectionPointContainer as cpContainer -> From 55d736b7b42e8bae16b9a15ea7755fbcfaed2910 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 27 Mar 2025 09:30:09 +0100 Subject: [PATCH 038/134] Remove a bunch of files from fantomas ignore (#18407) * Remove a bunch of files from fantomas ignore * see what happens - bunch of IFDEFs related to nullness removed to enable more fantomas * nowarn specific nullness when proto builds f.c.s and fsharpbuild --- .fantomasignore | 51 ----- Directory.Build.props | 2 +- FSharp.Profiles.props | 28 +-- src/Compiler/AbstractIL/il.fs | 144 ++++++++------ src/Compiler/AbstractIL/ilreflect.fs | 2 +- src/Compiler/AbstractIL/ilwrite.fs | 6 +- .../AssemblyResolveHandler.fsi | 2 +- .../DependencyManager/DependencyProvider.fs | 63 ++---- .../DependencyManager/DependencyProvider.fsi | 7 +- .../NativeDllResolveHandler.fsi | 2 +- src/Compiler/Driver/CompilerImports.fs | 181 ++++++++---------- src/Compiler/FSharp.Compiler.Service.fsproj | 5 +- src/Compiler/Facilities/AsyncMemoize.fs | 181 +++++++++++------- src/Compiler/Facilities/AsyncMemoize.fsi | 9 +- src/Compiler/Symbols/SymbolHelpers.fs | 2 - src/Compiler/TypedTree/QuotationPickler.fs | 6 +- src/Compiler/TypedTree/TypeProviders.fs | 63 +----- src/Compiler/TypedTree/TypeProviders.fsi | 94 +++------ src/Compiler/TypedTree/TypedTreeOps.fs | 13 +- src/Compiler/TypedTree/tainted.fs | 5 - src/Compiler/TypedTree/tainted.fsi | 8 +- src/Compiler/Utilities/Activity.fs | 19 +- src/Compiler/Utilities/Activity.fsi | 6 +- src/Compiler/Utilities/Cancellable.fsi | 9 +- src/Compiler/Utilities/HashMultiMap.fs | 6 +- src/Compiler/Utilities/HashMultiMap.fsi | 10 +- src/Compiler/Utilities/LruCache.fs | 12 +- src/Compiler/Utilities/LruCache.fsi | 9 +- src/Compiler/Utilities/NullnessShims.fs | 57 ++---- src/Compiler/Utilities/illib.fs | 80 ++++---- src/Compiler/Utilities/illib.fsi | 61 ++---- src/Compiler/Utilities/lib.fsi | 7 +- src/Compiler/Utilities/sformat.fs | 21 +- src/FSharp.Build/FSharp.Build.fsproj | 6 +- src/FSharp.Build/FSharpCommandLineBuilder.fs | 13 +- src/FSharp.Build/FSharpEmbedResourceText.fs | 7 +- src/FSharp.Core/array.fs | 35 ++-- src/FSharp.Core/fslib-extra-pervasives.fs | 14 +- src/FSharp.Core/local.fs | 5 +- src/FSharp.Core/option.fs | 40 +--- src/FSharp.Core/option.fsi | 32 +--- src/FSharp.Core/prim-types-prelude.fs | 4 - src/FSharp.Core/prim-types-prelude.fsi | 4 - src/FSharp.Core/prim-types.fs | 28 +-- src/FSharp.Core/prim-types.fsi | 32 +--- src/FSharp.Core/resumable.fs | 45 ++--- src/FSharp.Core/tasks.fs | 78 +++----- src/FSharp.Core/tasks.fsi | 2 +- src/fsi/console.fs | 8 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 4 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 8 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 8 +- ...erify_FSharp.Core_Debug_netstandard2.0.bsl | 4 +- ...erify_FSharp.Core_Debug_netstandard2.1.bsl | 4 +- ...ify_FSharp.Core_Release_netstandard2.0.bsl | 4 +- ...ify_FSharp.Core_Release_netstandard2.1.bsl | 4 +- 57 files changed, 567 insertions(+), 995 deletions(-) diff --git a/.fantomasignore b/.fantomasignore index f5798fbdf00..c2677d44fa4 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -40,19 +40,6 @@ src/Compiler/Checking/SignatureConformance.fs src/Compiler/Checking/TypeHierarchy.fs src/Compiler/Checking/TypeRelations.fs -# nullness-related problems -src/Compiler/Utilities/lib.fsi -src/Compiler/Utilities/Cancellable.fsi -src/FSharp.Core/tasks.fsi -src/FSharp.Core/tasks.fs -src/FSharp.Core/resumable.fs -src/Compiler/DependencyManager/DependencyProvider.fs -src/FSharp.Core/fslib-extra-pervasives.fs -src/FSharp.Core/fslib-extra-pervasives.fsi - -# Incorrectly formatted: https://github.com/dotnet/fsharp/pull/14645/commits/49443a67ea8a17670c8a7c80c8bdf91f82231e91 or https://github.com/fsprojects/fantomas/issues/2733 -# This CompilerImports.fs behavior is not fixed yet, following up in https://github.com/fsprojects/fantomas/issues/2733 -src/Compiler/Driver/CompilerImports.fs # The following files were formatted, but the "format, --check" loop is not stable. # Fantomas formats them, but still thinks they need formatting src/Compiler/Optimize/DetupleArgs.fs @@ -96,44 +83,6 @@ src/FSharp.Core/printf.fs src/FSharp.Core/Query.fs src/FSharp.Core/seqcore.fs - -# fsharp (to investigate) - -**/TypeProviders.fsi -**/tainted.fsi - -# uses nullness features - -**/DependencyProvider.fsi -src/FSharp.Core/array.fs -src/FSharp.Core/option.fsi -src/FSharp.Core/option.fs -src/fsi/console.fs -src/FSharp.Build/FSharpCommandLineBuilder.fs - -src/Compiler/Utilities/Activity.fs -src/Compiler/Utilities/sformat.fs -src/Compiler/Utilities/illib.fsi -src/Compiler/Utilities/illib.fs - - -src/Compiler/Utilities/NullnessShims.fs -src/Compiler/Utilities/DependencyGraph.fs -src/Compiler/Utilities/LruCache.fsi -src/Compiler/Utilities/LruCache.fs -src/Compiler/Utilities/HashMultiMap.fsi -src/Compiler/Utilities/HashMultiMap.fs -src/Compiler/Facilities/AsyncMemoize.fsi -src/Compiler/Facilities/AsyncMemoize.fs -src/Compiler/AbstractIL/il.fs -src/Compiler/SyntaxTree/LexerStore.fs - -src/Compiler/Driver/GraphChecking/Graph.fsi -src/Compiler/Driver/GraphChecking/Graph.fs - -src/Compiler/DependencyManager/NativeDllResolveHandler.fsi -src/Compiler/DependencyManager/AssemblyResolveHandler.fsi - # Fantomas limitations on implementation files (to investigate) src/Compiler/AbstractIL/ilwrite.fs diff --git a/Directory.Build.props b/Directory.Build.props index c4f2bff9287..fbb9c8332c7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -62,7 +62,7 @@ since it's a non-arcade and non-sourcebuild scenario --> $(ArtifactsDir)/bin/fslex/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fslex.dll $(ArtifactsDir)/bin/fsyacc/$(Configuration)/$(FSharpNetCoreProductDefaultTargetFramework)/$(RuntimeIdentifier)/fsyacc.dll - NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants) + BUILDING_WITH_LKG;$(DefineConstants) diff --git a/FSharp.Profiles.props b/FSharp.Profiles.props index 186875ad357..35a907b2e6f 100644 --- a/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -1,41 +1,15 @@ - - - - false - - - - - false - - false - NO_CHECKNULLS;BUILDING_WITH_LKG;NO_NULLCHECKING_LIB_SUPPORT;$(DefineConstants) - false + BUILDING_WITH_LKG;$(DefineConstants) preview - - false - - - - enable - - - - - $(NoWarn);3271 - NO_CHECKNULLS;$(DefineConstants) - - diff --git a/src/Compiler/AbstractIL/il.fs b/src/Compiler/AbstractIL/il.fs index 33a46ff0a23..d0770b414ed 100644 --- a/src/Compiler/AbstractIL/il.fs +++ b/src/Compiler/AbstractIL/il.fs @@ -170,11 +170,8 @@ let splitTypeNameRight nm = // -------------------------------------------------------------------- /// This is used to store event, property and field maps. -type LazyOrderedMultiMap<'Key, 'Data when 'Key: equality -#if !NO_CHECKNULLS - and 'Key:not null -#endif - >(keyf: 'Data -> 'Key, lazyItems: InterruptibleLazy<'Data list>) = +type LazyOrderedMultiMap<'Key, 'Data when 'Key: equality and 'Key: not null>(keyf: 'Data -> 'Key, lazyItems: InterruptibleLazy<'Data list>) + = let quickMap = lazyItems @@ -519,7 +516,11 @@ type ILAssemblyRef(data) = let retargetable = aname.Flags = AssemblyNameFlags.Retargetable - let name = match aname.Name with | null -> aname.FullName | name -> name + let name = + match aname.Name with + | null -> aname.FullName + | name -> name + ILAssemblyRef.Create(name, None, publicKey, retargetable, version, locale) member aref.QualifiedName = @@ -1862,7 +1863,7 @@ type ILGenericParameterDef = Name: string Constraints: ILTypes Variance: ILGenericVariance - HasReferenceTypeConstraint: bool + HasReferenceTypeConstraint: bool HasNotNullableValueTypeConstraint: bool HasDefaultConstructorConstraint: bool HasAllowsRefStruct: bool @@ -1910,7 +1911,11 @@ let inline conditionalAdd condition flagToAdd source = let NoMetadataIdx = -1 type InterfaceImpl = - { Idx: int; Type: ILType; mutable CustomAttrsStored: ILAttributesStored } + { + Idx: int + Type: ILType + mutable CustomAttrsStored: ILAttributesStored + } member x.CustomAttrs = match x.CustomAttrsStored with @@ -1919,12 +1924,16 @@ type InterfaceImpl = x.CustomAttrsStored <- ILAttributesStored.Given res res | ILAttributesStored.Given attrs -> attrs - - static member Create(ilType: ILType, customAttrsStored: ILAttributesStored) = - { Idx = NoMetadataIdx; Type = ilType; CustomAttrsStored = customAttrsStored } - static member Create(ilType: ILType) = InterfaceImpl.Create(ilType, emptyILCustomAttrsStored) + static member Create(ilType: ILType, customAttrsStored: ILAttributesStored) = + { + Idx = NoMetadataIdx + Type = ilType + CustomAttrsStored = customAttrsStored + } + static member Create(ilType: ILType) = + InterfaceImpl.Create(ilType, emptyILCustomAttrsStored) [] type ILMethodDef @@ -2575,17 +2584,15 @@ type ILTypeDefAdditionalFlags = | CanContainExtensionMethods = 1024 let internal typeKindFlags = - ILTypeDefAdditionalFlags.Class ||| - ILTypeDefAdditionalFlags.ValueType ||| - ILTypeDefAdditionalFlags.Interface ||| - ILTypeDefAdditionalFlags.Enum ||| - ILTypeDefAdditionalFlags.Delegate + ILTypeDefAdditionalFlags.Class + ||| ILTypeDefAdditionalFlags.ValueType + ||| ILTypeDefAdditionalFlags.Interface + ||| ILTypeDefAdditionalFlags.Enum + ||| ILTypeDefAdditionalFlags.Delegate -let inline internal resetTypeKind flags = - flags &&& ~~~typeKindFlags +let inline internal resetTypeKind flags = flags &&& ~~~typeKindFlags -let (|HasFlag|_|) (flag: ILTypeDefAdditionalFlags) flags = - flags &&& flag = flag +let (|HasFlag|_|) (flag: ILTypeDefAdditionalFlags) flags = flags &&& flag = flag let inline typeKindByNames extendsName typeName = match extendsName with @@ -2676,21 +2683,24 @@ type ILTypeDef let hasFlag flag = additionalFlags &&& flag = flag - new(name, - attributes, - layout, - implements, - genericParams, - extends, - methods, - nestedTypes, - fields, - methodImpls, - events, - properties, - additionalFlags, - securityDecls, - customAttrs) = + new + ( + name, + attributes, + layout, + implements, + genericParams, + extends, + methods, + nestedTypes, + fields, + methodImpls, + events, + properties, + additionalFlags, + securityDecls, + customAttrs + ) = ILTypeDef( name, attributes, @@ -2710,23 +2720,27 @@ type ILTypeDef NoMetadataIdx ) - new(name, - attributes, - layout, - implements, - genericParams, - extends, - methods, - nestedTypes, - fields, - methodImpls, - events, - properties, - securityDecls, - customAttrs) = + new + ( + name, + attributes, + layout, + implements, + genericParams, + extends, + methods, + nestedTypes, + fields, + methodImpls, + events, + properties, + securityDecls, + customAttrs + ) = let additionalFlags = - ILTypeDefAdditionalFlags.CanContainExtensionMethods ||| - typeKindOfFlags name extends (int attributes) + ILTypeDefAdditionalFlags.CanContainExtensionMethods + ||| typeKindOfFlags name extends (int attributes) + ILTypeDef( name, attributes, @@ -2955,10 +2969,10 @@ and [] ILPreTypeDef = and [] ILPreTypeDefImpl(nameSpace: string list, name: string, metadataIndex: int32, storage: ILTypeDefStored) = let stored = lazy - match storage with - | ILTypeDefStored.Given td -> td - | ILTypeDefStored.Computed f -> f () - | ILTypeDefStored.Reader f -> f metadataIndex + match storage with + | ILTypeDefStored.Given td -> td + | ILTypeDefStored.Computed f -> f () + | ILTypeDefStored.Reader f -> f metadataIndex interface ILPreTypeDef with member _.Namespace = nameSpace @@ -4248,25 +4262,31 @@ let mkILStorageCtorWithParamNames (preblock: ILInstr list, ty, extraParams, flds | Some x -> I_seqpoint x | None -> () yield! preblock - for (n, (_pnm, nm, fieldTy,_attrs)) in List.indexed flds do + for (n, (_pnm, nm, fieldTy, _attrs)) in List.indexed flds do mkLdarg0 mkLdarg (uint16 (n + 1)) mkNormalStfld (mkILFieldSpecInTy (ty, nm, fieldTy)) ] let body = mkMethodBody (false, [], 2, nonBranchingInstrsToCode code, tag, imports) - let fieldParams = + + let fieldParams = [ - for (pnm,_,ty,attrs) in flds do + for (pnm, _, ty, attrs) in flds do let ilParam = mkILParamNamed (pnm, ty) + let ilParam = match attrs with | [] -> ilParam - | attrs -> {ilParam with CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs attrs ) } + | attrs -> + { ilParam with + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs attrs) + } + yield ilParam - ] + ] - mkILCtor (access, fieldParams @ extraParams , body) + mkILCtor (access, fieldParams @ extraParams, body) let mkILSimpleStorageCtorWithParamNames (baseTySpec, ty, extraParams, flds, access, tag, imports) = let preblock = diff --git a/src/Compiler/AbstractIL/ilreflect.fs b/src/Compiler/AbstractIL/ilreflect.fs index 6151c28b8f0..ca309e95875 100644 --- a/src/Compiler/AbstractIL/ilreflect.fs +++ b/src/Compiler/AbstractIL/ilreflect.fs @@ -164,7 +164,7 @@ type TypeBuilder with printfn "typeBuilder%d.CreateType()" (abs <| hash typB) //Buggy annotation in ns20, will not be fixed. -#if NETSTANDARD && !NO_CHECKNULLS +#if NETSTANDARD !!(typB.CreateTypeInfo()) :> Type #else typB.CreateTypeInfo() :> Type diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index 2cb9bb01a1b..1d5111daa50 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -362,11 +362,7 @@ let envForOverrideSpec (ospec: ILOverridesSpec) = { EnclosingTyparCount=ospec.De //--------------------------------------------------------------------- [] -type MetadataTable<'T -#if !NO_CHECKNULLS - when 'T:not null -#endif - > = +type MetadataTable<'T when 'T:not null> = { name: string dict: Dictionary<'T, int> // given a row, find its entry number mutable rows: ResizeArray<'T> } diff --git a/src/Compiler/DependencyManager/AssemblyResolveHandler.fsi b/src/Compiler/DependencyManager/AssemblyResolveHandler.fsi index e1c0b2574e3..354eb07efd6 100644 --- a/src/Compiler/DependencyManager/AssemblyResolveHandler.fsi +++ b/src/Compiler/DependencyManager/AssemblyResolveHandler.fsi @@ -12,7 +12,7 @@ type AssemblyResolutionProbe = delegate of Unit -> seq type AssemblyResolveHandler = /// Construct a new DependencyProvider - new: assemblyProbingPaths: AssemblyResolutionProbe|null -> AssemblyResolveHandler + new: assemblyProbingPaths: AssemblyResolutionProbe | null -> AssemblyResolveHandler /// Construct a new DependencyProvider internal new: assemblyProbingPaths: AssemblyResolutionProbe option -> AssemblyResolveHandler diff --git a/src/Compiler/DependencyManager/DependencyProvider.fs b/src/Compiler/DependencyManager/DependencyProvider.fs index 6e641af607b..a94e296d465 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fs +++ b/src/Compiler/DependencyManager/DependencyProvider.fs @@ -123,9 +123,6 @@ type IResolveDependenciesResult = /// #I @"c:\somepath\to\packages\1.1.1\ResolvedPackage" abstract Roots: seq -#if NO_CHECKNULLS -[] -#endif type IDependencyManagerProvider = abstract Name: string abstract Key: string @@ -334,42 +331,36 @@ type ReflectionDependencyManagerProvider member _.StdOut = match getInstanceProperty (result.GetType()) "StdOut" with | None -> [||] - | Some p -> !! p.GetValue(result) :?> string[] + | Some p -> !!p.GetValue(result) :?> string[] /// The resolution error log (* process stderror *) member _.StdError = match getInstanceProperty (result.GetType()) "StdError" with | None -> [||] - | Some p -> !! p.GetValue(result) :?> string[] + | Some p -> !!p.GetValue(result) :?> string[] /// The resolution paths member _.Resolutions = match getInstanceProperty> (result.GetType()) "Resolutions" with | None -> Seq.empty - | Some p -> !! p.GetValue(result) :?> seq + | Some p -> !!p.GetValue(result) :?> seq /// The source code file paths member _.SourceFiles = match getInstanceProperty> (result.GetType()) "SourceFiles" with | None -> Seq.empty - | Some p -> !! p.GetValue(result) :?> seq + | Some p -> !!p.GetValue(result) :?> seq /// The roots to package directories member _.Roots = match getInstanceProperty> (result.GetType()) "Roots" with | None -> Seq.empty - | Some p -> !! p.GetValue(result) :?> seq + | Some p -> !!p.GetValue(result) :?> seq } static member MakeResultFromFields - ( - success: bool, - stdOut: string[], - stdError: string[], - resolutions: seq, - sourceFiles: seq, - roots: seq - ) = + (success: bool, stdOut: string[], stdError: string[], resolutions: seq, sourceFiles: seq, roots: seq) + = { new IResolveDependenciesResult with /// Succeeded? member _.Success = success @@ -409,16 +400,8 @@ type ReflectionDependencyManagerProvider /// Resolve the dependencies for the given arguments member _.ResolveDependencies - ( - scriptDir, - mainScriptName, - scriptName, - scriptExt, - packageManagerTextLines, - tfm, - rid, - timeout - ) : IResolveDependenciesResult = + (scriptDir, mainScriptName, scriptName, scriptExt, packageManagerTextLines, tfm, rid, timeout) + : IResolveDependenciesResult = // The ResolveDependencies method, has two signatures, the original signature in the variable resolveDeps and the updated signature resolveDepsEx // the resolve method can return values in two different tuples: // (bool * string list * string list * string list) @@ -564,7 +547,7 @@ type DependencyProvider new() = new DependencyProvider(None, None, true) /// Returns a formatted help messages for registered dependencymanagers for the host to present - member _.GetRegisteredDependencyManagerHelpText(compilerTools, outputDir : string | null, errorReport) = + member _.GetRegisteredDependencyManagerHelpText(compilerTools, outputDir: string | null, errorReport) = [| let managers = RegisteredDependencyManagers compilerTools (Option.ofString outputDir) errorReport @@ -575,7 +558,7 @@ type DependencyProvider |] /// Clear the DependencyManager results caches - member _.ClearResultsCache(compilerTools, outputDir : string | null, errorReport) = + member _.ClearResultsCache(compilerTools, outputDir: string | null, errorReport) = let managers = RegisteredDependencyManagers compilerTools (Option.ofString outputDir) errorReport @@ -584,12 +567,8 @@ type DependencyProvider /// Returns a formatted error message for the host to present member _.CreatePackageManagerUnknownError - ( - compilerTools: seq, - outputDir: string, - packageManagerKey: string, - reportError: ResolvingErrorReport - ) = + (compilerTools: seq, outputDir: string, packageManagerKey: string, reportError: ResolvingErrorReport) + = let registeredKeys = String.Join( ", ", @@ -602,12 +581,8 @@ type DependencyProvider /// Fetch a dependencymanager that supports a specific key member this.TryFindDependencyManagerInPath - ( - compilerTools: seq, - outputDir: string, - reportError: ResolvingErrorReport, - path: string - ) : string | null * IDependencyManagerProvider | null = + (compilerTools: seq, outputDir: string, reportError: ResolvingErrorReport, path: string) + : string | null * IDependencyManagerProvider | null = try if path.Contains ":" && not (Path.IsPathRooted path) then let managers = @@ -632,12 +607,8 @@ type DependencyProvider /// Fetch a dependencymanager that supports a specific key member _.TryFindDependencyManagerByKey - ( - compilerTools: seq, - outputDir: string, - reportError: ResolvingErrorReport, - key: string - ) : IDependencyManagerProvider | null = + (compilerTools: seq, outputDir: string, reportError: ResolvingErrorReport, key: string) + : IDependencyManagerProvider | null = try RegisteredDependencyManagers compilerTools (Option.ofString outputDir) reportError |> Map.tryFind key diff --git a/src/Compiler/DependencyManager/DependencyProvider.fsi b/src/Compiler/DependencyManager/DependencyProvider.fsi index aa1bd27d5b7..1fe1c400525 100644 --- a/src/Compiler/DependencyManager/DependencyProvider.fsi +++ b/src/Compiler/DependencyManager/DependencyProvider.fsi @@ -39,9 +39,6 @@ type IResolveDependenciesResult = abstract Roots: seq /// Wraps access to a DependencyManager implementation -#if NO_CHECKNULLS -[] -#endif type IDependencyManagerProvider = /// Name of the dependency manager @@ -123,7 +120,7 @@ type DependencyProvider = packageManagerTextLines: (string * string) seq * reportError: ResolvingErrorReport * executionTfm: string * - [] executionRid: string MaybeNull* + [] executionRid: string MaybeNull * [] implicitIncludeDir: string * [] mainScriptName: string * [] fileName: string * @@ -138,4 +135,4 @@ type DependencyProvider = /// TryFindDependencyManagerInPath - given a #r "key:sometext" go and find a DependencyManager that satisfies the key member TryFindDependencyManagerInPath: compilerTools: string seq * outputDir: string * reportError: ResolvingErrorReport * path: string -> - string | null * IDependencyManagerProvider | null \ No newline at end of file + string | null * IDependencyManagerProvider | null diff --git a/src/Compiler/DependencyManager/NativeDllResolveHandler.fsi b/src/Compiler/DependencyManager/NativeDllResolveHandler.fsi index 9d2961aa94e..e9d623df7bd 100644 --- a/src/Compiler/DependencyManager/NativeDllResolveHandler.fsi +++ b/src/Compiler/DependencyManager/NativeDllResolveHandler.fsi @@ -12,7 +12,7 @@ type NativeResolutionProbe = delegate of Unit -> seq type NativeDllResolveHandler = /// Construct a new NativeDllResolveHandler - new: nativeProbingRoots: NativeResolutionProbe|null -> NativeDllResolveHandler + new: nativeProbingRoots: NativeResolutionProbe | null -> NativeDllResolveHandler /// Construct a new NativeDllResolveHandler internal new: nativeProbingRoots: NativeResolutionProbe option -> NativeDllResolveHandler diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index ae14ee51157..4ab1ca3d7e4 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -94,20 +94,22 @@ let GetSignatureDataResourceName (r: ILResource) = failwith "unreachable" let GetResourceNameAndSignatureDataFuncs (resources: ILResource list) = - [ for r in resources do - if IsSignatureDataResource r then - let readerA, ccuName = GetSignatureDataResourceName r - - let readerB = - resources |> List.tryPick (fun rB -> - if IsSignatureDataResourceB rB then - let readerB, ccuNameB = GetSignatureDataResourceName rB - if ccuName = ccuNameB then - Some readerB - else None - else None) + [ + for r in resources do + if IsSignatureDataResource r then + let readerA, ccuName = GetSignatureDataResourceName r + + let readerB = + resources + |> List.tryPick (fun rB -> + if IsSignatureDataResourceB rB then + let readerB, ccuNameB = GetSignatureDataResourceName rB + if ccuName = ccuNameB then Some readerB else None + else + None) - ccuName, (readerA, readerB) ] + ccuName, (readerA, readerB) + ] let GetOptimizationDataResourceName (r: ILResource) = if r.Name.StartsWithOrdinal FSharpOptimizationDataResourceName then @@ -124,19 +126,22 @@ let GetOptimizationDataResourceName (r: ILResource) = failwith $"GetOptimizationDataResourceName - {r.Name}" let GetResourceNameAndOptimizationDataFuncs (resources: ILResource list) = - [ for r in resources do - if IsOptimizationDataResource r then - let readerA, ccuName = GetOptimizationDataResourceName r - - let readerB = - resources |> List.tryPick (fun rB -> - if IsOptimizationDataResourceB rB then - let readerB, ccuNameB = GetOptimizationDataResourceName rB - if ccuName = ccuNameB then - Some readerB - else None - else None) - ccuName, (readerA, readerB) ] + [ + for r in resources do + if IsOptimizationDataResource r then + let readerA, ccuName = GetOptimizationDataResourceName r + + let readerB = + resources + |> List.tryPick (fun rB -> + if IsOptimizationDataResourceB rB then + let readerB, ccuNameB = GetOptimizationDataResourceName rB + if ccuName = ccuNameB then Some readerB else None + else + None) + + ccuName, (readerA, readerB) + ] let IsReflectedDefinitionsResource (r: ILResource) = r.Name.StartsWithOrdinal(QuotationPickler.SerializedReflectedDefinitionsResourceNameBase) @@ -163,7 +168,7 @@ let PickleToResource inMem file (g: TcGlobals) compress scope rName rNameB p x = let byteStorage = ByteStorage.FromByteArray(bytes) let byteStorageB = - if inMem then + if inMem then ByteStorage.FromMemoryAndCopy(bytesB.AsMemory(), useBackingMemoryMappedFile = true) else ByteStorage.FromByteArray(bytesB.AsMemory().ToArray()) @@ -478,27 +483,28 @@ let isHashRReference (r: range) = && not (equals r rangeCmdArgs) && FileSystem.IsPathRootedShim r.FileName -let IsNetModule (fileName:string) = +let IsNetModule (fileName: string) = let ext = Path.GetExtension fileName String.Compare(ext, ".netmodule", StringComparison.OrdinalIgnoreCase) = 0 -let IsDLL (fileName:string) = +let IsDLL (fileName: string) = let ext = Path.GetExtension fileName String.Compare(ext, ".dll", StringComparison.OrdinalIgnoreCase) = 0 -let IsExe (fileName:string) = +let IsExe (fileName: string) = let ext = Path.GetExtension fileName String.Compare(ext, ".exe", StringComparison.OrdinalIgnoreCase) = 0 -let addConstraintSources(ia: ImportedAssembly) = +let addConstraintSources (ia: ImportedAssembly) = let contents = ia.FSharpViewOfMetadata.Contents + let addCxsToMember name (v: Val) = for typar in fst v.GeneralizedType do for cx in typar.Constraints do match cx with - | TyparConstraint.MayResolveMember(TTrait(source=source), _) -> - source.Value <- Some name + | TyparConstraint.MayResolveMember(TTrait(source = source), _) -> source.Value <- Some name | _ -> () + let rec addCxsToModule name (m: ModuleOrNamespaceType) = for e in m.ModuleAndNamespaceDefinitions do if e.IsModuleOrNamespace then @@ -506,8 +512,12 @@ let addConstraintSources(ia: ImportedAssembly) = if String.length name > 0 then name + "." + e.DisplayName elif e.IsModule then e.DisplayName else "" + addCxsToModule mname e.ModuleOrNamespaceType - for memb in m.AllValsAndMembers do addCxsToMember (name + "." + memb.LogicalName) memb + + for memb in m.AllValsAndMembers do + addCxsToMember (name + "." + memb.LogicalName) memb + addCxsToModule "" contents.ModuleOrNamespaceType type TcConfig with @@ -541,7 +551,7 @@ type TcConfig with yield! tcConfig.GetSearchPathsForLibraryFiles() if isHashRReference m then - !! Path.GetDirectoryName(m.FileName) + !!Path.GetDirectoryName(m.FileName) } let resolved = TryResolveFileUsingPaths(searchPaths, m, nm) @@ -629,12 +639,8 @@ type TcConfig with // // NOTE!! if mode=ReportErrors then this method must not raise exceptions. It must just report the errors and recover static member TryResolveLibsUsingMSBuildRules - ( - tcConfig: TcConfig, - originalReferences: AssemblyReference list, - errorAndWarningRange: range, - mode: ResolveAssemblyReferenceMode - ) : AssemblyResolution list * UnresolvedAssemblyReference list = + (tcConfig: TcConfig, originalReferences: AssemblyReference list, errorAndWarningRange: range, mode: ResolveAssemblyReferenceMode) + : AssemblyResolution list * UnresolvedAssemblyReference list = use _ = UseBuildPhase BuildPhase.Parameter @@ -798,11 +804,8 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, originalReferenceToResolution.TryFind nm static member ResolveAssemblyReferences - ( - tcConfig: TcConfig, - assemblyList: AssemblyReference list, - knownUnresolved: UnresolvedAssemblyReference list - ) : TcAssemblyResolutions = + (tcConfig: TcConfig, assemblyList: AssemblyReference list, knownUnresolved: UnresolvedAssemblyReference list) + : TcAssemblyResolutions = let resolved, unresolved = if tcConfig.useSimpleResolution then let resolutions = @@ -899,7 +902,7 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, let addedText = "\nIf you want to debug this right now, attach a debugger, and put a breakpoint in 'CompileOps.fs' near the text '!itFailed', and you can re-step through the assembly resolution logic." - for UnresolvedAssemblyReference (referenceText, _ranges) in unresolved do + for UnresolvedAssemblyReference(referenceText, _ranges) in unresolved do if referenceText.Contains("mscorlib") then Debug.Assert(false, sprintf "whoops, did not resolve mscorlib: '%s'%s" referenceText addedText) itFailed <- true @@ -989,7 +992,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe let sigDataReaders = if sigDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then - let sigFileName = !! Path.ChangeExtension(fileName, "sigdata") + let sigFileName = !!Path.ChangeExtension(fileName, "sigdata") if not (FileSystem.FileExistsShim sigFileName) then error (Error(FSComp.SR.buildExpectedSigdataFile (FileSystem.GetFullPathShim sigFileName), m)) @@ -1014,7 +1017,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk(ilModule: ILModuleDef, ilAssemblyRe // Look for optimization data in a file let optDataReaders = if optDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then - let optDataFile = !! Path.ChangeExtension(fileName, "optdata") + let optDataFile = !!Path.ChangeExtension(fileName, "optdata") if not (FileSystem.FileExistsShim optDataFile) then error ( @@ -1097,11 +1100,7 @@ type RawFSharpAssemblyData(ilModule: ILModuleDef, ilAssemblyRefs) = [] type TcImportsSafeDisposal - ( - tciLock: TcImportsLock, - disposeActions: ResizeArray unit>, - disposeTypeProviderActions: ResizeArray unit> - ) = + (tciLock: TcImportsLock, disposeActions: ResizeArray unit>, disposeTypeProviderActions: ResizeArray unit>) = let mutable isDisposed = false @@ -1194,7 +1193,7 @@ type TcImportsWeakFacade(tciLock: TcImportsLock, tcImportsWeak: WeakReference match tcImports.Base with - | Some (baseTcImports: TcImports) -> Some baseTcImports.Weak + | Some(baseTcImports: TcImports) -> Some baseTcImports.Weak | _ -> None | _ -> None @@ -1218,11 +1217,11 @@ and [] TcImports initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, dependencyProviderOpt: DependencyProvider option - ) + ) #if !NO_TYPEPROVIDERS as this #endif - = + = let tciLock = TcImportsLock() @@ -1298,7 +1297,7 @@ and [] TcImports if publicOnly then match e.TypeReprInfo with | TILObjectRepr data -> - let (TILObjectReprData (_, _, tyDef)) = data + let (TILObjectReprData(_, _, tyDef)) = data tyDef.Access = ILTypeDefAccess.Public | _ -> false else @@ -1433,14 +1432,14 @@ and [] TcImports CheckDisposed() match tcImports.FindCcuInfo(ctok, m, assemblyName, lookupOnly) with - | ResolvedImportedAssembly (importedAssembly, _) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) - | UnresolvedImportedAssembly (assemblyName, _) -> UnresolvedCcu assemblyName + | ResolvedImportedAssembly(importedAssembly, _) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) + | UnresolvedImportedAssembly(assemblyName, _) -> UnresolvedCcu assemblyName member tcImports.FindCcuFromAssemblyRef(ctok, m, assemblyRef: ILAssemblyRef) = CheckDisposed() match tcImports.FindCcuInfo(ctok, m, assemblyRef.Name, lookupOnly = false) with - | ResolvedImportedAssembly (importedAssembly, _) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) + | ResolvedImportedAssembly(importedAssembly, _) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) | UnresolvedImportedAssembly _ -> UnresolvedCcu(assemblyRef.QualifiedName) member tcImports.TryFindXmlDocumentationInfo(assemblyName: string) = @@ -1562,7 +1561,7 @@ and [] TcImports member _.RecordGeneratedTypeRoot root = tciLock.AcquireLock(fun tcitok -> // checking if given ProviderGeneratedType was already recorded before (probably for another set of static parameters) - let (ProviderGeneratedType (_, ilTyRef, _)) = root + let (ProviderGeneratedType(_, ilTyRef, _)) = root let index = RequireTcImportsLock(tcitok, generatedTypeRoots) @@ -1810,7 +1809,7 @@ and [] TcImports | TNoRepr -> TProvidedNamespaceRepr(typeProviderEnvironment, [ provider ]) // Add to the existing list of extensions - | TProvidedNamespaceRepr (resolutionFolder, prior) as repr -> + | TProvidedNamespaceRepr(resolutionFolder, prior) as repr -> if not (prior |> List.exists (fun r -> Tainted.EqTainted r provider)) then TProvidedNamespaceRepr(resolutionFolder, provider :: prior) else @@ -1860,7 +1859,7 @@ and [] TcImports |> Option.get // MSDN: this method causes the file to be opened and closed, but the assembly is not added to this domain let name = AssemblyName.GetAssemblyName(resolution.resolvedPath) - !! name.Version + !!name.Version // Note, this only captures systemRuntimeContainsTypeRef (which captures tcImportsWeak, using name tcImports) let systemRuntimeContainsType = @@ -1869,8 +1868,7 @@ and [] TcImports // The name of this captured value must not change, see comments on TcImportsWeakFacade above assert (nameof (tcImports) = "tcImports") - let mutable systemRuntimeContainsTypeRef = - tcImports.SystemRuntimeContainsType + let mutable systemRuntimeContainsTypeRef = tcImports.SystemRuntimeContainsType // When the tcImports is disposed the systemRuntimeContainsTypeRef thunk is replaced // with one raising an exception. @@ -1961,7 +1959,7 @@ and [] TcImports match providers with | [] -> - let typeName = !! typeof.FullName + let typeName = !!typeof.FullName warning (Error(FSComp.SR.etHostingAssemblyFoundWithoutHosts (fileNameOfRuntimeAssembly, typeName), m)) | _ -> @@ -2122,7 +2120,7 @@ and [] TcImports let minfo: PickledCcuInfo = data.RawData let mspec = minfo.mspec - + if mspec.DisplayName = "FSharp.Core" then updateSeqTypeIsPrefix mspec @@ -2167,7 +2165,7 @@ and [] TcImports InterruptibleLazy(fun _ -> match Map.tryFind ccuName optDatas with | None -> None - | Some (readerA, readerB) -> + | Some(readerA, readerB) -> let data = GetOptimizationData(fileName, ilScopeRef, ilModule.TryGetILModuleDef(), readerA, readerB) @@ -2182,8 +2180,8 @@ and [] TcImports if ccuThunk.IsUnresolvedReference then ccuThunks.Add(ccuThunk, (fun () -> fixupThunk () |> ignore))) - Some(fixupThunk ()) - ) + Some(fixupThunk ())) + let ccuinfo = { FSharpViewOfMetadata = ccu @@ -2250,10 +2248,8 @@ and [] TcImports // NOTE: When used in the Language Service this can cause the transitive checking of projects. Hence it must be cancellable. member tcImports.TryRegisterAndPrepareToImportReferencedDll - ( - ctok, - r: AssemblyResolution - ) : Async<(_ * (unit -> AvailableImportedAssembly list)) option> = + (ctok, r: AssemblyResolution) + : Async<(_ * (unit -> AvailableImportedAssembly list)) option> = async { CheckDisposed() let m = r.originalReference.Range @@ -2349,9 +2345,11 @@ and [] TcImports let _dllinfos, phase2s = results |> Array.choose id |> List.ofArray |> List.unzip fixupOrphanCcus () let ccuinfos = List.collect (fun phase2 -> phase2 ()) phase2s + if importsBase.IsSome then importsBase.Value.CcuTable.Values |> Seq.iter addConstraintSources ccuTable.Values |> Seq.iter addConstraintSources + return ccuinfos } @@ -2374,7 +2372,7 @@ and [] TcImports ) match foundFile with - | OkResult (warns, res) -> + | OkResult(warns, res) -> ReportWarnings warns tcImports.RegisterAndImportReferencedAssemblies(ctok, res) @@ -2382,7 +2380,7 @@ and [] TcImports |> ignore true - | ErrorResult (_warns, _err) -> + | ErrorResult(_warns, _err) -> // Throw away warnings and errors - this is speculative loading false @@ -2418,11 +2416,8 @@ and [] TcImports |> Option.map (fun r -> r.resolvedPath)) member _.TryResolveAssemblyReference - ( - ctok, - assemblyReference: AssemblyReference, - mode: ResolveAssemblyReferenceMode - ) : OperationResult = + (ctok, assemblyReference: AssemblyReference, mode: ResolveAssemblyReferenceMode) + : OperationResult = tciLock.AcquireLock(fun tcitok -> let tcConfig = tcConfigP.Get ctok @@ -2462,8 +2457,7 @@ and [] TcImports | [], [] -> // Note, if mode=ResolveAssemblyReferenceMode.Speculative and the resolution failed then TryResolveLibsUsingMSBuildRules returns // the empty list and we convert the failure into an AssemblyNotResolved here. - ErrorD(AssemblyNotResolved(assemblyReference.Text, assemblyReference.Range)) - ) + ErrorD(AssemblyNotResolved(assemblyReference.Text, assemblyReference.Range))) member tcImports.ResolveAssemblyReference(ctok, assemblyReference, mode) : AssemblyResolution list = CommitOperationResult(tcImports.TryResolveAssemblyReference(ctok, assemblyReference, mode)) @@ -2507,7 +2501,7 @@ and [] TcImports let primaryScopeRef = match primaryAssem with - | [ ResolvedImportedAssembly (ccu, _) ] -> ccu.FSharpViewOfMetadata.ILScopeRef + | [ ResolvedImportedAssembly(ccu, _) ] -> ccu.FSharpViewOfMetadata.ILScopeRef | _ -> failwith "primaryScopeRef - unexpected" let resolvedAssemblies = tcResolutions.GetAssemblyResolutions() @@ -2568,7 +2562,7 @@ and [] TcImports match resolvedAssemblyRef with | Some coreLibraryResolution -> match! frameworkTcImports.RegisterAndImportReferencedAssemblies(ctok, [ coreLibraryResolution ]) with - | [ ResolvedImportedAssembly (fslibCcuInfo, _) ] -> + | [ ResolvedImportedAssembly(fslibCcuInfo, _) ] -> return fslibCcuInfo.FSharpViewOfMetadata, fslibCcuInfo.ILScopeRef | _ -> return @@ -2633,17 +2627,12 @@ and [] TcImports knownUnresolved |> List.map (function - | UnresolvedAssemblyReference (file, originalReferences) -> file, originalReferences) + | UnresolvedAssemblyReference(file, originalReferences) -> file, originalReferences) |> List.iter reportAssemblyNotResolved static member BuildNonFrameworkTcImports - ( - tcConfigP: TcConfigProvider, - baseTcImports, - nonFrameworkReferences, - knownUnresolved, - dependencyProvider - ) = + (tcConfigP: TcConfigProvider, baseTcImports, nonFrameworkReferences, knownUnresolved, dependencyProvider) + = async { let ctok = CompilationThreadToken() @@ -2700,8 +2689,8 @@ let RequireReferences (ctok, tcImports: TcImports, tcEnv, thisAssemblyName, reso let asms = ccuinfos |> List.map (function - | ResolvedImportedAssembly (asm, m) -> asm, m - | UnresolvedImportedAssembly (assemblyName, m) -> error (Error(FSComp.SR.buildCouldNotResolveAssembly (assemblyName), m))) + | ResolvedImportedAssembly(asm, m) -> asm, m + | UnresolvedImportedAssembly(assemblyName, m) -> error (Error(FSComp.SR.buildCouldNotResolveAssembly (assemblyName), m))) let g = tcImports.GetTcGlobals() let amap = tcImports.GetImportMap() diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index ca08c3f63d9..75c03890c7d 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -15,7 +15,7 @@ FSharp.Compiler.Service true $(DefineConstants);COMPILER - true + enable $(OtherFlags) --warnon:3390 + + $(OtherFlags) --nowarn:3261 + $(OtherFlags) --generate-filter-blocks true diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index 991c8359312..a8a4d5b143f 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -21,17 +21,21 @@ type AsyncLazyState<'t> = /// When cacheException is false, subsequent requests will restart the computation after an exceptional result. type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, cacheException: bool) = - let stateUpdateSync = obj() + let stateUpdateSync = obj () let mutable state = initial // This should remain the only function that mutates the state. let withStateUpdate f = - lock stateUpdateSync <| fun () -> + lock stateUpdateSync + <| fun () -> let next, result = f state state <- next result - let updateState f = withStateUpdate <| fun prev -> f prev, () - let cancelIfUnawaited cancelUnawaited = function + let updateState f = + withStateUpdate <| fun prev -> f prev, () + + let cancelIfUnawaited cancelUnawaited = + function | Running(computation, _, cts, 0) when cancelUnawaited -> // To keep state updates fast we don't actually wait for the work to cancel. // This means single execution is not strictly enforced. @@ -39,7 +43,8 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, Initial computation | state -> state - let afterRequest = function + let afterRequest = + function | Running(c, work, cts, count) -> Running(c, work, cts, count - 1) |> cancelIfUnawaited cancelUnawaited | state -> state // Nothing more to do if state already transitioned. @@ -49,37 +54,42 @@ type AsyncLazy<'t> private (initial: AsyncLazyState<'t>, cancelUnawaited: bool, let! ct = Async.CancellationToken // Using ContinueWith with a CancellationToken allows detaching from the running 'work' task. // If the current async workflow is canceled, the 'work' task will continue running independently. - do! work.ContinueWith(ignore>, ct) |> Async.AwaitTask - with :? TaskCanceledException -> () + do! work.ContinueWith(ignore>, ct) |> Async.AwaitTask + with :? TaskCanceledException -> + () // If we're here it means there was no cancellation and the 'work' task has completed. return! work |> Async.AwaitTask } let onComplete (t: Task<'t>) = - updateState <| function - | Running (computation, _, _, _) -> - try Completed t.Result with exn -> if cacheException then Faulted exn else Initial computation + updateState + <| function + | Running(computation, _, _, _) -> + try + Completed t.Result + with exn -> + if cacheException then Faulted exn else Initial computation | state -> state + t.Result - let request = function + let request = + function | Initial computation -> let cts = new CancellationTokenSource() + let work = - Async.StartAsTask(computation, cancellationToken = cts.Token) + Async + .StartAsTask(computation, cancellationToken = cts.Token) .ContinueWith(onComplete, TaskContinuationOptions.NotOnCanceled) - Running (computation, work, cts, 1), - detachable work - | Running (c, work, cts, count) -> - Running (c, work, cts, count + 1), - detachable work - | Completed result as state -> - state, async { return result } - | Faulted exn as state -> - state, async { return raise exn } + + Running(computation, work, cts, 1), detachable work + | Running(c, work, cts, count) -> Running(c, work, cts, count + 1), detachable work + | Completed result as state -> state, async { return result } + | Faulted exn as state -> state, async { return raise exn } // computation will deallocate after state transition to Completed ot Faulted. - new (computation, ?cancelUnawaited: bool, ?cacheException) = + new(computation, ?cancelUnawaited: bool, ?cacheException) = AsyncLazy(Initial computation, defaultArg cancelUnawaited true, defaultArg cacheException true) member _.Request() = @@ -104,7 +114,7 @@ module internal Utils = /// Return file name with one directory above it let shortPath (path: string) = - let dirPath = !! Path.GetDirectoryName(path) + let dirPath = !!Path.GetDirectoryName(path) let dir = dirPath.Split Path.DirectorySeparatorChar @@ -126,7 +136,21 @@ type internal JobEvent = | Strengthened | Failed | Cleared - static member AllEvents = [Requested; Started; Restarted; Finished; Canceled; Evicted; Collected; Weakened; Strengthened; Failed; Cleared] + + static member AllEvents = + [ + Requested + Started + Restarted + Finished + Canceled + Evicted + Collected + Weakened + Strengthened + Failed + Cleared + ] type internal ICacheKey<'TKey, 'TVersion> = // TODO Key should probably be renamed to Identifier @@ -155,7 +179,8 @@ type private KeyData<'TKey, 'TVersion> = type Job<'t> = AsyncLazy * CapturingDiagnosticsLogger> [] -type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TKey:not null and 'TVersion:not null> +type internal AsyncMemoize<'TKey, 'TVersion, 'TValue + when 'TKey: equality and 'TVersion: equality and 'TKey: not null and 'TVersion: not null> (?keepStrongly, ?keepWeakly, ?name: string, ?cancelUnawaitedJobs: bool, ?cancelDuplicateRunningJobs: bool) = let name = defaultArg name "N/A" @@ -164,11 +189,12 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T let event = Event<_>() - let eventCounts = [for j in JobEvent.AllEvents -> j, ref 0] |> dict + let eventCounts = [ for j in JobEvent.AllEvents -> j, ref 0 ] |> dict let mutable hits = 0 let mutable duration = 0L - let keyTuple (keyData: KeyData<_, _>) = keyData.Label, keyData.Key, keyData.Version + let keyTuple (keyData: KeyData<_, _>) = + keyData.Label, keyData.Key, keyData.Version let logK (eventType: JobEvent) key = Interlocked.Increment(eventCounts[eventType]) |> ignore @@ -186,7 +212,8 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T | CacheEvent.Collected -> logK JobEvent.Collected | CacheEvent.Weakened -> logK JobEvent.Weakened | CacheEvent.Strengthened -> logK JobEvent.Strengthened - | CacheEvent.Cleared -> logK JobEvent.Cleared)) + | CacheEvent.Cleared -> logK JobEvent.Cleared) + ) member _.Get(key: ICacheKey<_, _>, computation) = let key = @@ -197,38 +224,44 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T } let wrappedComputation = - Async.TryCancelled( async { - let sw = Stopwatch.StartNew() - log Started key - let logger = CapturingDiagnosticsLogger "cache" - SetThreadDiagnosticsLoggerNoUnwind logger - - match! computation |> Async.Catch with - | Choice1Of2 result -> - log Finished key - Interlocked.Add(&duration, sw.ElapsedMilliseconds) |> ignore - return Result.Ok result, logger - | Choice2Of2 exn -> - log Failed key - return Result.Error exn, logger - }, fun _ -> log Canceled key) + Async.TryCancelled( + async { + let sw = Stopwatch.StartNew() + log Started key + let logger = CapturingDiagnosticsLogger "cache" + SetThreadDiagnosticsLoggerNoUnwind logger + + match! computation |> Async.Catch with + | Choice1Of2 result -> + log Finished key + Interlocked.Add(&duration, sw.ElapsedMilliseconds) |> ignore + return Result.Ok result, logger + | Choice2Of2 exn -> + log Failed key + return Result.Error exn, logger + }, + fun _ -> log Canceled key + ) let getOrAdd () = let cached, otherVersions = cache.GetAll(key.Key, key.Version) - let countHit v = Interlocked.Increment &hits |> ignore; v + let countHit v = + Interlocked.Increment &hits |> ignore + v + let cacheSetNewJob () = - let job = Job(wrappedComputation, cancelUnawaited = cancelUnawaitedJobs, cacheException = false) + let job = + Job(wrappedComputation, cancelUnawaited = cancelUnawaitedJobs, cacheException = false) + cache.Set(key.Key, key.Version, key.Label, job) job otherVersions, - cached - |> Option.map countHit - |> Option.defaultWith cacheSetNewJob + cached |> Option.map countHit |> Option.defaultWith cacheSetNewJob - async { + async { let otherVersions, job = lock cache getOrAdd log Requested key @@ -240,15 +273,15 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T let! result, logger = job.Request() logger.CommitDelayedDiagnostics DiagnosticsThreadStatics.DiagnosticsLogger + match result with - | Ok result -> - return result - | Error exn -> - return raise exn + | Ok result -> return result + | Error exn -> return raise exn } member _.TryGet(key: 'TKey, predicate: 'TVersion -> bool) : 'TValue option = - lock cache <| fun () -> + lock cache + <| fun () -> cache.GetAll(key) |> Seq.tryPick (fun (version, job) -> match predicate version, job.TryResult with @@ -257,7 +290,8 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T member _.Clear() = lock cache cache.Clear - member _.Clear predicate = lock cache <| fun () -> cache.Clear predicate + member _.Clear predicate = + lock cache <| fun () -> cache.Clear predicate member val Event = event.Publish @@ -267,26 +301,39 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T member this.DebuggerDisplay = - let cachedJobs = cache.GetValues() |> Seq.map (fun (_,_,job) -> job) + let cachedJobs = cache.GetValues() |> Seq.map (fun (_, _, job) -> job) - let jobStateName = function - | Initial _ -> nameof Initial - | Running _ -> nameof Running - | Completed _ -> nameof Completed - | Faulted _ -> nameof Faulted + let jobStateName = + function + | Initial _ -> nameof Initial + | Running _ -> nameof Running + | Completed _ -> nameof Completed + | Faulted _ -> nameof Faulted let valueStats = cachedJobs |> Seq.countBy (_.State >> jobStateName) |> Map - let getStat key = valueStats.TryFind key |> Option.defaultValue 0 + + let getStat key = + valueStats.TryFind key |> Option.defaultValue 0 let running = let count = getStat "Running" - if count > 0 then $" Running {count}" else "" + if count > 0 then $" Running {count}" else "" let finished = eventCounts[Finished].Value - let avgDuration = if finished = 0 then "" else $"| Avg: %.0f{float duration / float finished} ms" + + let avgDuration = + if finished = 0 then + "" + else + $"| Avg: %.0f{float duration / float finished} ms" let requests = eventCounts[Requested].Value - let hitRatio = if requests = 0 then "" else $" (%.0f{float hits / (float (requests)) * 100.0} %%)" + + let hitRatio = + if requests = 0 then + "" + else + $" (%.0f{float hits / (float (requests)) * 100.0} %%)" let faulted = getStat "Faulted" let failed = eventCounts[Failed].Value @@ -295,9 +342,11 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T seq { if faulted + failed > 0 then " (_!_) " + for j in eventCounts.Keys do let count = eventCounts[j].Value if count > 0 then $"| {j}: {count}" else "" + $"| hits: {hits}{hitRatio} " } |> String.concat "" @@ -317,4 +366,4 @@ type internal AsyncMemoizeDisabled<'TKey, 'TVersion, 'TValue when 'TKey: equalit Interlocked.Increment &requests |> ignore computation - member _.DebuggerDisplay = $"(disabled) requests: {requests}" \ No newline at end of file + member _.DebuggerDisplay = $"(disabled) requests: {requests}" diff --git a/src/Compiler/Facilities/AsyncMemoize.fsi b/src/Compiler/Facilities/AsyncMemoize.fsi index 6b9ffb4f433..1014dfc6874 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fsi +++ b/src/Compiler/Facilities/AsyncMemoize.fsi @@ -42,7 +42,8 @@ type Extensions = /// /// Strongly holds at most one result per key. /// -type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TKey:not null and 'TVersion:not null> = +type internal AsyncMemoize<'TKey, 'TVersion, 'TValue + when 'TKey: equality and 'TVersion: equality and 'TKey: not null and 'TVersion: not null> = /// Maximum number of strongly held results to keep in the cache /// Maximum number of weakly held results to keep in the cache @@ -50,7 +51,11 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'T /// Cancels a job when all the awaiting requests are canceled. If set to false, unawaited job will run to completion and it's result will be cached. /// If true, when a job is started, all other jobs with the same key will be canceled. new: - ?keepStrongly: int * ?keepWeakly: int * ?name: string * ?cancelUnawaitedJobs: bool * ?cancelDuplicateRunningJobs: bool -> + ?keepStrongly: int * + ?keepWeakly: int * + ?name: string * + ?cancelUnawaitedJobs: bool * + ?cancelDuplicateRunningJobs: bool -> AsyncMemoize<'TKey, 'TVersion, 'TValue> member Clear: unit -> unit diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index 1fedee2968a..116e9ba95b7 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -406,12 +406,10 @@ module internal SymbolHelpers = //| _ -> false member x.Equals(item1, item2) = -#if !NO_CHECKNULLS match item1,item2 with | null,null -> true | null,_ | _,null -> false | item1,item2 -> -#endif // This may explore assemblies that are not in the reference set. // In this case just bail out and assume items are not equal protectAssemblyExploration false (fun () -> diff --git a/src/Compiler/TypedTree/QuotationPickler.fs b/src/Compiler/TypedTree/QuotationPickler.fs index f2a58203ec6..de18b73e5c0 100644 --- a/src/Compiler/TypedTree/QuotationPickler.fs +++ b/src/Compiler/TypedTree/QuotationPickler.fs @@ -249,11 +249,7 @@ let PickleBufferCapacity = 100000 module SimplePickle = - type Table<'T -#if !NO_CHECKNULLS - when 'T:not null -#endif - > = + type Table<'T when 'T:not null> = { tbl: HashMultiMap<'T, int> // This should be "Dictionary" mutable rows: 'T list mutable count: int } diff --git a/src/Compiler/TypedTree/TypeProviders.fs b/src/Compiler/TypedTree/TypeProviders.fs index 42caa723619..425e31ea453 100644 --- a/src/Compiler/TypedTree/TypeProviders.fs +++ b/src/Compiler/TypedTree/TypeProviders.fs @@ -220,13 +220,8 @@ let TryTypeMemberArray (st: Tainted<_>, fullName, memberName, m, f) = [||] /// Try to access a member on a provided type, catching and reporting errors and checking the result is non-null, -#if NO_CHECKNULLS -let TryTypeMemberNonNull<'T, 'U when 'U : null and 'U : not struct>(st: Tainted<'T>, fullName, memberName, m, recover: 'U, (f: 'T -> 'U)) : Tainted<'U> = - match TryTypeMember(st, fullName, memberName, m, recover, f) with -#else let TryTypeMemberNonNull<'T, 'U when 'U : not null and 'U : not struct>(st: Tainted<'T>, fullName, memberName, m, recover: 'U, (f: 'T -> 'U | null)) : Tainted<'U> = match TryTypeMember<'T, 'U | null>(st, fullName, memberName, m, withNull recover, f) with -#endif | Tainted.Null -> errorR(Error(FSComp.SR.etUnexpectedNullFromProvidedTypeMember(fullName, memberName), m)) st.PApplyNoFailure(fun _ -> recover) @@ -339,9 +334,6 @@ type ProvidedTypeContext = )) [] -#if NO_CHECKNULLS -[] -#endif type ProvidedType (x: Type, ctxt: ProvidedTypeContext) = inherit ProvidedMemberInfo(x, ctxt) @@ -506,9 +498,6 @@ type ProvidedType (x: Type, ctxt: ProvidedTypeContext) = static member TaintedEquals (pt1: Tainted, pt2: Tainted) = Tainted.EqTainted (pt1.PApplyNoFailure(fun st -> st.Handle)) (pt2.PApplyNoFailure(fun st -> st.Handle)) -#if NO_CHECKNULLS -[] -#endif type IProvidedCustomAttributeProvider = abstract GetDefinitionLocationAttribute : provider: ITypeProvider -> (string MaybeNull * int * int) option @@ -569,9 +558,6 @@ type ProvidedCustomAttributeProvider (attributes :ITypeProvider -> seq Seq.toArray [] -#if NO_CHECKNULLS -[] -#endif type ProvidedMemberInfo (x: MemberInfo, ctxt) = let provide () = ProvidedCustomAttributeProvider (fun _ -> x.CustomAttributes) :> IProvidedCustomAttributeProvider @@ -594,9 +580,6 @@ type ProvidedMemberInfo (x: MemberInfo, ctxt) = provide().GetAttributeConstructorArgs (provider, attribName) [] -#if NO_CHECKNULLS -[] -#endif type ProvidedParameterInfo (x: ParameterInfo, ctxt) = let provide () = ProvidedCustomAttributeProvider (fun _ -> x.CustomAttributes) :> IProvidedCustomAttributeProvider @@ -645,9 +628,6 @@ type ProvidedParameterInfo (x: ParameterInfo, ctxt) = override _.GetHashCode() = assert false; x.GetHashCode() [] -#if NO_CHECKNULLS -[] -#endif type ProvidedAssembly (x: Assembly) = member _.GetName() = x.GetName() @@ -665,9 +645,6 @@ type ProvidedAssembly (x: Assembly) = override _.GetHashCode() = assert false; x.GetHashCode() [] -#if NO_CHECKNULLS -[] -#endif type ProvidedMethodBase (x: MethodBase, ctxt) = inherit ProvidedMemberInfo(x, ctxt) @@ -762,9 +739,6 @@ type ProvidedMethodBase (x: MethodBase, ctxt) = [] -#if NO_CHECKNULLS -[] -#endif type ProvidedFieldInfo (x: FieldInfo, ctxt) = inherit ProvidedMemberInfo(x, ctxt) @@ -812,9 +786,6 @@ type ProvidedFieldInfo (x: FieldInfo, ctxt) = Tainted.EqTainted (pt1.PApplyNoFailure(fun st -> st.Handle)) (pt2.PApplyNoFailure(fun st -> st.Handle)) [] -#if NO_CHECKNULLS -[] -#endif type ProvidedMethodInfo (x: MethodInfo, ctxt) = inherit ProvidedMethodBase(x, ctxt) @@ -841,9 +812,6 @@ type ProvidedMethodInfo (x: MethodInfo, ctxt) = override _.GetHashCode() = assert false; x.GetHashCode() [] -#if NO_CHECKNULLS -[] -#endif type ProvidedPropertyInfo (x: PropertyInfo, ctxt) = inherit ProvidedMemberInfo(x, ctxt) @@ -885,9 +853,6 @@ type ProvidedPropertyInfo (x: PropertyInfo, ctxt) = Tainted.EqTainted (pt1.PApplyNoFailure(fun st -> st.Handle)) (pt2.PApplyNoFailure(fun st -> st.Handle)) [] -#if NO_CHECKNULLS -[] -#endif type ProvidedEventInfo (x: EventInfo, ctxt) = inherit ProvidedMemberInfo(x, ctxt) @@ -923,9 +888,6 @@ type ProvidedEventInfo (x: EventInfo, ctxt) = Tainted.EqTainted (pt1.PApplyNoFailure(fun st -> st.Handle)) (pt2.PApplyNoFailure(fun st -> st.Handle)) [] -#if NO_CHECKNULLS -[] -#endif type ProvidedConstructorInfo (x: ConstructorInfo, ctxt) = inherit ProvidedMethodBase(x, ctxt) @@ -967,11 +929,8 @@ type ProvidedExprType = | ProvidedIfThenElseExpr of ProvidedExpr * ProvidedExpr * ProvidedExpr | ProvidedVarExpr of ProvidedVar -#if NO_CHECKNULLS -[] -#else + [] -#endif type ProvidedExpr (x: Expr, ctxt) = member _.Type = x.Type |> ProvidedType.CreateNonNull ctxt @@ -1043,11 +1002,7 @@ type ProvidedExpr (x: Expr, ctxt) = override _.GetHashCode() = x.GetHashCode() -#if NO_CHECKNULLS -[] -#else [] -#endif type ProvidedVar (x: Var, ctxt) = member _.Type = x.Type |> ProvidedType.CreateNonNull ctxt member _.Name = x.Name @@ -1097,11 +1052,9 @@ let ValidateExpectedName m expectedPath expectedName (st: Tainted) if name <> expectedName then raise (TypeProviderError(FSComp.SR.etProvidedTypeHasUnexpectedName(expectedName, name), st.TypeProviderDesignation, m)) -#if NO_CHECKNULLS - let namespaceName = TryTypeMember(st, name, "Namespace", m, "", fun st -> st.Namespace) |> unmarshal -#else - let namespaceName = TryTypeMember<_, string | null>(st, name, "Namespace", m, "", fun st -> st.Namespace) |> unmarshal // TODO NULLNESS: why is this explicit instantiation needed? -#endif + + let namespaceName = TryTypeMember(st, name, "Namespace", m, ("":_|null), fun st -> st.Namespace) |> unmarshal + let rec declaringTypes (st: Tainted) accu = match TryTypeMember(st, name, "DeclaringType", m, null, fun st -> st.DeclaringType) with @@ -1124,11 +1077,7 @@ let ValidateProvidedTypeAfterStaticInstantiation(m, st: Tainted, e // Do all the calling into st up front with recovery let fullName, namespaceName, usedMembers = let name = CheckAndComputeProvidedNameProperty(m, st, (fun st -> st.Name), "Name") -#if NO_CHECKNULLS - let namespaceName = TryTypeMember(st, name, "Namespace", m, FSComp.SR.invalidNamespaceForProvidedType(), fun st -> st.Namespace) |> unmarshal -#else let namespaceName = TryTypeMember<_, string | null>(st, name, "Namespace", m, FSComp.SR.invalidNamespaceForProvidedType(), fun st -> st.Namespace) |> unmarshal -#endif let fullName = TryTypeMemberNonNull(st, name, "FullName", m, FSComp.SR.invalidFullNameForProvidedType(), fun st -> st.FullName) |> unmarshal ValidateExpectedName m expectedPath expectedName st // Must be able to call (GetMethods|GetEvents|GetProperties|GetNestedTypes|GetConstructors)(bindingFlags). @@ -1233,11 +1182,7 @@ let ValidateProvidedTypeDefinition(m, st: Tainted, expectedPath: s // Validate the Name, Namespace and FullName properties let name = CheckAndComputeProvidedNameProperty(m, st, (fun st -> st.Name), "Name") -#if NO_CHECKNULLS - let _namespaceName = TryTypeMember(st, name, "Namespace", m, FSComp.SR.invalidNamespaceForProvidedType(), fun st -> st.Namespace) |> unmarshal -#else let _namespaceName = TryTypeMember<_, string | null>(st, name, "Namespace", m, FSComp.SR.invalidNamespaceForProvidedType(), fun st -> st.Namespace) |> unmarshal -#endif let _fullname = TryTypeMemberNonNull(st, name, "FullName", m, FSComp.SR.invalidFullNameForProvidedType(), fun st -> st.FullName) |> unmarshal ValidateExpectedName m expectedPath expectedName st diff --git a/src/Compiler/TypedTree/TypeProviders.fsi b/src/Compiler/TypedTree/TypeProviders.fsi index b8ec2158ea4..c29f091be78 100755 --- a/src/Compiler/TypedTree/TypeProviders.fsi +++ b/src/Compiler/TypedTree/TypeProviders.fsi @@ -15,7 +15,7 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.Text type TypeProviderDesignation = TypeProviderDesignation of string -type 'a ProvidedArray= ('a[]) MaybeNull +type 'a ProvidedArray = ('a[]) MaybeNull /// Raised when a type provider has thrown an exception. exception ProvidedTypeResolution of range * exn @@ -92,10 +92,7 @@ type ProvidedTypeContext = /// Map the TyconRef objects, if any member RemapTyconRefs: (obj -> obj) -> ProvidedTypeContext -[] -#if NO_CHECKNULLS -[] -#endif +[] type ProvidedType = inherit ProvidedMemberInfo @@ -209,9 +206,6 @@ type ProvidedType = static member TaintedEquals: Tainted * Tainted -> bool -#if NO_CHECKNULLS -[] -#endif type IProvidedCustomAttributeProvider = abstract GetHasTypeProviderEditorHideMethodsAttribute: provider: ITypeProvider -> bool @@ -221,12 +215,9 @@ type IProvidedCustomAttributeProvider = abstract GetAttributeConstructorArgs: provider: ITypeProvider * attribName: string -> (obj option list * (string * obj option) list) option - -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedAssembly = + +[] +type ProvidedAssembly = member GetName: unit -> System.Reflection.AssemblyName member FullName: string @@ -235,23 +226,17 @@ type ProvidedAssembly = member Handle: System.Reflection.Assembly -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedMemberInfo = +[] +type ProvidedMemberInfo = member Name: string member DeclaringType: ProvidedType MaybeNull - interface IProvidedCustomAttributeProvider + interface IProvidedCustomAttributeProvider -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedMethodBase = +[] +type ProvidedMethodBase = inherit ProvidedMemberInfo member IsGenericMethod: bool @@ -286,11 +271,8 @@ type ProvidedMethodBase = static member TaintedEquals: Tainted * Tainted -> bool -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedMethodInfo = +[] +type ProvidedMethodInfo = inherit ProvidedMethodBase @@ -298,11 +280,8 @@ type ProvidedMethodInfo = member MetadataToken: int -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedParameterInfo = +[] +type ProvidedParameterInfo = member Name: string @@ -320,11 +299,8 @@ type ProvidedParameterInfo = interface IProvidedCustomAttributeProvider -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedFieldInfo = +[] +type ProvidedFieldInfo = inherit ProvidedMemberInfo @@ -352,11 +328,8 @@ type ProvidedFieldInfo = static member TaintedEquals: Tainted * Tainted -> bool -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedPropertyInfo = +[] +type ProvidedPropertyInfo = inherit ProvidedMemberInfo @@ -376,11 +349,8 @@ type ProvidedPropertyInfo = static member TaintedEquals: Tainted * Tainted -> bool -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedEventInfo = +[] +type ProvidedEventInfo = inherit ProvidedMemberInfo @@ -394,11 +364,8 @@ type ProvidedEventInfo = static member TaintedEquals: Tainted * Tainted -> bool -[] -#if NO_CHECKNULLS -[] -#endif -type ProvidedConstructorInfo = +[] +type ProvidedConstructorInfo = inherit ProvidedMethodBase type ProvidedExprType = @@ -442,11 +409,8 @@ type ProvidedExprType = | ProvidedIfThenElseExpr of ProvidedExpr * ProvidedExpr * ProvidedExpr | ProvidedVarExpr of ProvidedVar - -[] -#if NO_CHECKNULLS -[] -#endif + +[] type ProvidedExpr = member Type: ProvidedType @@ -456,10 +420,7 @@ type ProvidedExpr = member GetExprType: unit -> ProvidedExprType option -[] -#if NO_CHECKNULLS -[] -#endif +[] type ProvidedVar = member Type: ProvidedType @@ -481,7 +442,10 @@ val ValidateProvidedTypeAfterStaticInstantiation: /// to check the type name is as expected (this function is called by the caller of TryApplyProvidedType /// after other checks are made). val TryApplyProvidedType: - typeBeforeArguments: Tainted * optGeneratedTypePath: string list option * staticArgs: objnull[] * range -> + typeBeforeArguments: Tainted * + optGeneratedTypePath: string list option * + staticArgs: objnull[] * + range -> (Tainted * (unit -> unit)) option /// Try to apply a provided method to the given static arguments. diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index e5e330759dc..33dd6c2757c 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -39,17 +39,11 @@ let RemapExprStackGuardDepth = GetEnvInteger "FSHARP_RemapExpr" 50 let FoldExprStackGuardDepth = GetEnvInteger "FSHARP_FoldExpr" 50 let inline compareBy (x: 'T MaybeNull) (y: 'T MaybeNull) ([]func: 'T -> 'K) = -#if NO_CHECKNULLS - compare (func x) (func y) -#else match x,y with | null,null -> 0 | null,_ -> -1 | _,null -> 1 | x,y -> compare (func !!x) (func !!y) -#endif - - //--------------------------------------------------------------------------- // Basic data structures @@ -3576,12 +3570,7 @@ let TryFindLocalizedFSharpStringAttribute g nm attrs = match TryFindFSharpAttribute g nm attrs with | Some(Attrib(_, _, [ AttribStringArg b ], namedArgs, _, _, _)) -> match namedArgs with - | ExtractAttribNamedArg "Localize" (AttribBoolArg true) -> - #if PROTO || BUILDING_WITH_LKG - Some b - #else - FSComp.SR.GetTextOpt(b) - #endif + | ExtractAttribNamedArg "Localize" (AttribBoolArg true) -> FSComp.SR.GetTextOpt(b) | _ -> Some b | _ -> None diff --git a/src/Compiler/TypedTree/tainted.fs b/src/Compiler/TypedTree/tainted.fs index 76a0ba131e4..8b3561aaaa3 100644 --- a/src/Compiler/TypedTree/tainted.fs +++ b/src/Compiler/TypedTree/tainted.fs @@ -171,13 +171,8 @@ type internal Tainted<'T> (context: TaintedContext, value: 'T) = module internal Tainted = -#if NO_CHECKNULLS - let (|Null|NonNull|) (p:Tainted<'T>) : Choice> when 'T : null and 'T : not struct = - if p.PUntaintNoFailure isNull then Null else NonNull (p.PApplyNoFailure id) -#else let (|Null|NonNull|) (p:Tainted<'T | null>) : Choice> when 'T : not null and 'T : not struct = if p.PUntaintNoFailure isNull then Null else NonNull (p.PApplyNoFailure nonNull) -#endif let Eq (p:Tainted<'T>) (v:'T) = p.PUntaintNoFailure (fun pv -> pv = v) diff --git a/src/Compiler/TypedTree/tainted.fsi b/src/Compiler/TypedTree/tainted.fsi index d066eefd3b2..b75c8c43a5b 100644 --- a/src/Compiler/TypedTree/tainted.fsi +++ b/src/Compiler/TypedTree/tainted.fsi @@ -81,7 +81,7 @@ type internal Tainted<'T> = member PApplyArray: ('T -> 'U[] MaybeNull) * string * range: range -> Tainted<'U>[] /// Apply an operation that returns an array. Filter the array. Unwrap array. Any exception will be attributed to the type provider with an error located at the given range. String is method name of thing-returning-array, to diagnostically attribute if it is null - member PApplyFilteredArray: ('T -> 'U[] MaybeNull) * ('U -> bool) *string * range: range -> Tainted<'U>[] + member PApplyFilteredArray: ('T -> 'U[] MaybeNull) * ('U -> bool) * string * range: range -> Tainted<'U>[] /// Apply an operation that returns an option. Unwrap option. Any exception will be attributed to the type provider with an error located at the given range member PApplyOption: ('T -> 'U option) * range: range -> Tainted<'U> option @@ -104,11 +104,7 @@ type internal Tainted<'T> = module internal Tainted = /// Test whether the tainted value is null -#if NO_CHECKNULLS - val (|Null|NonNull|) : Tainted<'T MaybeNull> -> Choice> when 'T : null and 'T : not struct -#else - val (|Null|NonNull|) : Tainted<'T MaybeNull> -> Choice> when 'T : not null and 'T : not struct -#endif + val (|Null|NonNull|): Tainted<'T MaybeNull> -> Choice> when 'T: not null and 'T: not struct /// Test whether the tainted value equals given value. /// Failure in call to equality operation will be blamed on type provider of first operand diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 2d204864f69..121b52cf07f 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -9,7 +9,6 @@ open System.Text open Internal.Utilities.Library open System.Collections.Generic - module ActivityNames = [] let FscSourceName = "fsc" @@ -90,18 +89,18 @@ module internal Activity = let private activitySource = new ActivitySource(ActivityNames.FscSourceName) - let start (name: string) (tags: (string * string) seq) : IDisposable MaybeNull = + let start (name: string) (tags: (string * string) seq) : ActivityDisposable = let activity = activitySource.CreateActivity(name, ActivityKind.Internal) match activity with - | null -> activity + | null -> activity | activity -> for key, value in tags do activity.AddTag(key, value) |> ignore activity.Start() - let startNoTags (name: string) : IDisposable MaybeNull = activitySource.StartActivity name + let startNoTags (name: string) : ActivityDisposable = activitySource.StartActivity name let addEventWithTags name (tags: (string * objnull) seq) = match Activity.Current with @@ -128,7 +127,7 @@ module internal Activity = let private profiledSource = new ActivitySource(ActivityNames.ProfiledSourceName) - let startAndMeasureEnvironmentStats (name: string) : IDisposable MaybeNull = profiledSource.StartActivity(name) + let startAndMeasureEnvironmentStats (name: string) : ActivityDisposable = profiledSource.StartActivity(name) type private GCStats = int[] @@ -210,7 +209,11 @@ module internal Activity = match o with | null -> "" | o -> - let mutable txtVal = match o.ToString() with | null -> "" | s -> s + let mutable txtVal = + match o.ToString() with + | null -> "" + | s -> s + let hasComma = txtVal.IndexOf(',') > -1 let hasQuote = txtVal.IndexOf('"') > -1 @@ -243,7 +246,7 @@ module internal Activity = sb.ToString() - let addCsvFileListener (pathToFile:string) = + let addCsvFileListener (pathToFile: string) = if pathToFile |> File.Exists |> not then File.WriteAllLines( pathToFile, @@ -265,7 +268,7 @@ module internal Activity = let l = new ActivityListener( - ShouldListenTo = (fun a ->ActivityNames.AllRelevantNames |> Array.contains a.Name), + ShouldListenTo = (fun a -> ActivityNames.AllRelevantNames |> Array.contains a.Name), Sample = (fun _ -> ActivitySamplingResult.AllData), ActivityStopped = (fun a -> msgQueue.Post(createCsvRow a)) ) diff --git a/src/Compiler/Utilities/Activity.fsi b/src/Compiler/Utilities/Activity.fsi index 041b2998765..773c7528869 100644 --- a/src/Compiler/Utilities/Activity.fsi +++ b/src/Compiler/Utilities/Activity.fsi @@ -40,16 +40,16 @@ module internal Activity = module Events = val cacheHit: string - val startNoTags: name: string -> IDisposable MaybeNull + val startNoTags: name: string -> ActivityDisposable - val start: name: string -> tags: (string * string) seq -> IDisposable MaybeNull + val start: name: string -> tags: (string * string) seq -> ActivityDisposable val addEvent: name: string -> unit val addEventWithTags: name: string -> tags: (string * objnull) seq -> unit module Profiling = - val startAndMeasureEnvironmentStats: name: string -> IDisposable MaybeNull + val startAndMeasureEnvironmentStats: name: string -> ActivityDisposable val addConsoleListener: unit -> IDisposable module CsvExport = diff --git a/src/Compiler/Utilities/Cancellable.fsi b/src/Compiler/Utilities/Cancellable.fsi index e74404c7eec..0d82faa68cb 100644 --- a/src/Compiler/Utilities/Cancellable.fsi +++ b/src/Compiler/Utilities/Cancellable.fsi @@ -68,12 +68,9 @@ type internal CancellableBuilder = comp: Cancellable<'T> * [] handler: (exn -> Cancellable<'T>) -> Cancellable<'T> member inline Using: - resource: 'Resource MaybeNull * [] comp: ('Resource MaybeNull -> Cancellable<'T>) -> Cancellable<'T> - when 'Resource :> IDisposable - and 'Resource:not struct -#if !(NO_CHECKNULLS || BUILDING_WITH_LKG) - and 'Resource:not null -#endif + resource: 'Resource MaybeNull * [] comp: ('Resource MaybeNull -> Cancellable<'T>) -> + Cancellable<'T> + when 'Resource :> IDisposable and 'Resource: not struct and 'Resource: not null member inline Zero: unit -> Cancellable diff --git a/src/Compiler/Utilities/HashMultiMap.fs b/src/Compiler/Utilities/HashMultiMap.fs index c0fc897121d..2688869136e 100644 --- a/src/Compiler/Utilities/HashMultiMap.fs +++ b/src/Compiler/Utilities/HashMultiMap.fs @@ -8,11 +8,7 @@ open System.Collections.Concurrent // Each entry in the HashMultiMap dictionary has at least one entry. Under normal usage each entry has _only_ // one entry. So use two hash tables: one for the main entries and one for the overflow. [] -type internal HashMultiMap<'Key, 'Value -#if !NO_CHECKNULLS - when 'Key:not null -#endif - >(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = +type internal HashMultiMap<'Key, 'Value when 'Key: not null>(size: int, comparer: IEqualityComparer<'Key>, ?useConcurrentDictionary: bool) = let comparer = comparer diff --git a/src/Compiler/Utilities/HashMultiMap.fsi b/src/Compiler/Utilities/HashMultiMap.fsi index 6a4ba2ce119..475f9db558d 100644 --- a/src/Compiler/Utilities/HashMultiMap.fsi +++ b/src/Compiler/Utilities/HashMultiMap.fsi @@ -7,11 +7,7 @@ open System.Collections.Generic /// Hash tables, by default based on F# structural "hash" and (=) functions. /// The table may map a single key to multiple bindings. [] -type internal HashMultiMap<'Key, 'Value -#if !NO_CHECKNULLS - when 'Key:not null -#endif - > = +type internal HashMultiMap<'Key, 'Value when 'Key: not null> = /// Create a new empty mutable HashMultiMap with the given key hash/equality functions. new: comparer: IEqualityComparer<'Key> * ?useConcurrentDictionary: bool -> HashMultiMap<'Key, 'Value> @@ -20,7 +16,9 @@ type internal HashMultiMap<'Key, 'Value new: size: int * comparer: IEqualityComparer<'Key> * ?useConcurrentDictionary: bool -> HashMultiMap<'Key, 'Value> /// Build a map that contains the bindings of the given IEnumerable. - new: entries: seq<'Key * 'Value> * comparer: IEqualityComparer<'Key> * ?useConcurrentDictionary: bool -> HashMultiMap<'Key, 'Value> + new: + entries: seq<'Key * 'Value> * comparer: IEqualityComparer<'Key> * ?useConcurrentDictionary: bool -> + HashMultiMap<'Key, 'Value> /// Make a shallow copy of the collection. member Copy: unit -> HashMultiMap<'Key, 'Value> diff --git a/src/Compiler/Utilities/LruCache.fs b/src/Compiler/Utilities/LruCache.fs index 92f73885eb7..942b9acfc34 100644 --- a/src/Compiler/Utilities/LruCache.fs +++ b/src/Compiler/Utilities/LruCache.fs @@ -23,12 +23,8 @@ type internal ValueLink<'T when 'T: not struct> = | Weak of WeakReference<'T> [] -type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TValue: not struct -#if !NO_CHECKNULLS - and 'TKey:not null - and 'TVersion:not null -#endif - > +type internal LruCache<'TKey, 'TVersion, 'TValue + when 'TKey: equality and 'TVersion: equality and 'TValue: not struct and 'TKey: not null and 'TVersion: not null> (keepStrongly, ?keepWeakly, ?requiredToKeep, ?event) = let keepWeakly = defaultArg keepWeakly 100 @@ -72,7 +68,7 @@ type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVers let mutable node = weakList.Last while weakList.Count > keepWeakly && node <> null do - let notNullNode = !! node + let notNullNode = !!node let previous = notNullNode.Previous let key, version, label, _ = notNullNode.Value weakList.Remove notNullNode @@ -90,7 +86,7 @@ type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVers let mutable anythingWeakened = false while strongList.Count > keepStrongly && node <> null do - let notNullNode = !! node + let notNullNode = !!node let previous = notNullNode.Previous match notNullNode.Value with diff --git a/src/Compiler/Utilities/LruCache.fsi b/src/Compiler/Utilities/LruCache.fsi index 5979304f163..0d6b9c2e750 100644 --- a/src/Compiler/Utilities/LruCache.fsi +++ b/src/Compiler/Utilities/LruCache.fsi @@ -12,13 +12,8 @@ type internal CacheEvent = /// /// It's also versioned, meaning each key can have multiple versions and only the latest one is kept strongly. /// Older versions are kept weakly and can be collected by GC. -type internal LruCache<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TValue: not struct -#if !NO_CHECKNULLS - and 'TKey:not null - and 'TVersion:not null -#endif - > = - +type internal LruCache<'TKey, 'TVersion, 'TValue + when 'TKey: equality and 'TVersion: equality and 'TValue: not struct and 'TKey: not null and 'TVersion: not null> = /// Maximum number of strongly held results to keep in the cache /// Maximum number of weakly held results to keep in the cache /// A predicate that determines if a value should be kept strongly (no matter what) diff --git a/src/Compiler/Utilities/NullnessShims.fs b/src/Compiler/Utilities/NullnessShims.fs index ee801610255..848bf650e98 100644 --- a/src/Compiler/Utilities/NullnessShims.fs +++ b/src/Compiler/Utilities/NullnessShims.fs @@ -7,44 +7,6 @@ module internal NullnessShims = let inline isNotNull (x: 'T) = not (isNull x) -#if NO_CHECKNULLS || BUILDING_WITH_LKG - type 'T MaybeNull when 'T: not struct = 'T - type objnull = obj - - let inline (^) (a: 'a) ([] b: 'a -> 'b) : 'b = - match a with - | null -> Unchecked.defaultof<'b> - | _ -> b a - - let inline (|NonNullQuick|) (x: 'T MaybeNull) = - match x with - | null -> raise (NullReferenceException()) - | v -> v - - let inline nonNull<'T when 'T:not struct and 'T:null> (x: 'T MaybeNull ) = - match x with - | null -> raise (NullReferenceException()) - | v -> v - - let inline (|Null|NonNull|) (x: 'T MaybeNull) : Choice = - match x with - | null -> Null - | v -> NonNull v - - let inline nullArgCheck paramName (x: 'T MaybeNull) = - if isNull (box x) then raise (ArgumentNullException(paramName)) - else x - - let inline (!!) x = x - - let inline defaultIfNull defaultValue arg = match arg with | null -> defaultValue | _ -> arg - - let inline nullSafeEquality (x: MaybeNull<'T>) (y: MaybeNull<'T>) ([]nonNullEqualityFunc:'T->'T->bool) = - match box x, box y with - | null, null -> true - | null,_ | _, null -> false - | _,_ -> nonNullEqualityFunc x y -#else type 'T MaybeNull when 'T: not null and 'T: not struct = 'T | null let inline (^) (a: 'a | null) ([] b: 'a -> 'b) : ('b | null) = @@ -52,16 +14,20 @@ module internal NullnessShims = | Null -> null | NonNull v -> b v - let inline (!!) (x:'T | null) = Unchecked.nonNull x + let inline (!!) (x: 'T | null) = Unchecked.nonNull x - let inline nullSafeEquality (x: MaybeNull<'T>) (y: MaybeNull<'T>) ([]nonNullEqualityFunc:'T->'T->bool) = + let inline nullSafeEquality (x: MaybeNull<'T>) (y: MaybeNull<'T>) ([] nonNullEqualityFunc: 'T -> 'T -> bool) = match x, y with | null, null -> true - | null,_ | _, null -> false + | null, _ + | _, null -> false | x, y -> nonNullEqualityFunc !!x !!y -#endif - +#if BUILDING_WITH_LKG + type ActivityDisposable = System.IDisposable +#else + type ActivityDisposable = System.IDisposable | null +#endif #if NET5_0_OR_GREATER // Argument type for overriding System.Object.Equals(arg) @@ -71,10 +37,9 @@ module internal NullnessShims = type objEqualsArg = obj #endif - - [] + [] let inline (|NonEmptyString|_|) (x: string MaybeNull) = match x with | null -> ValueNone | "" -> ValueNone - | v -> ValueSome v \ No newline at end of file + | v -> ValueSome v diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index 0f68d92a429..470d7402e07 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -17,8 +17,7 @@ type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) = [] // TODO nullness - this is boxed to obj because of an attribute targets bug fixed in main, but not yet shipped (needs shipped 8.0.400) - let mutable valueFactory : objnull = valueFactory - + let mutable valueFactory: objnull = valueFactory let mutable value = value @@ -104,7 +103,7 @@ module internal PervasiveAutoOpens = member inline x.EndsWithOrdinalIgnoreCase value = x.EndsWith(value, StringComparison.OrdinalIgnoreCase) - member inline x.IndexOfOrdinal (value:string) = + member inline x.IndexOfOrdinal(value: string) = x.IndexOf(value, StringComparison.Ordinal) member inline x.IndexOfOrdinal(value, startIndex) = @@ -154,8 +153,8 @@ module internal PervasiveAutoOpens = type DelayInitArrayMap<'T, 'TDictKey, 'TDictValue>(f: unit -> 'T[]) = let syncObj = obj () - let mutable arrayStore : _ array MaybeNull = null - let mutable dictStore : _ MaybeNull = null + let mutable arrayStore: _ array MaybeNull = null + let mutable dictStore: _ MaybeNull = null let mutable func = f @@ -206,12 +205,12 @@ module Order = member _.Compare(x, xx) = compare (p !!x) (p !!xx) } - let orderOn (p:'T->'U) (pxOrder: IComparer<'U>) = + let orderOn (p: 'T -> 'U) (pxOrder: IComparer<'U>) = { new IComparer<'T> with member _.Compare(x, xx) = pxOrder.Compare(p !!x, p !!xx) } - let toFunction (pxOrder: IComparer<'U>) (x:'U) (y:'U) = pxOrder.Compare(x, y) + let toFunction (pxOrder: IComparer<'U>) (x: 'U) (y: 'U) = pxOrder.Compare(x, y) //------------------------------------------------------------------------- // Library: arrays, lists, options, resizearrays @@ -242,7 +241,7 @@ module Array = let order (eltOrder: IComparer<'T>) = { new IComparer<'T array> with member _.Compare(xs, ys) = - let xs,ys = nullArgCheck "xs" xs, nullArgCheck "ys" ys + let xs, ys = nullArgCheck "xs" xs, nullArgCheck "ys" ys let c = compare xs.Length ys.Length if c <> 0 then @@ -412,8 +411,8 @@ module Option = with _ -> None -module internal ValueTuple = - let inline map1Of2 ([]f) struct(a1, a2) = struct(f a1, a2) +module internal ValueTuple = + let inline map1Of2 ([] f) struct (a1, a2) = struct (f a1, a2) module List = @@ -539,7 +538,8 @@ module List = let order (eltOrder: IComparer<'T>) = { new IComparer<'T list> with member _.Compare(xs, ys) = - let xs,ys = nullArgCheck "xs" xs, nullArgCheck "ys" ys + let xs, ys = nullArgCheck "xs" xs, nullArgCheck "ys" ys + let rec loop xs ys = match xs, ys with | [], [] -> 0 @@ -642,21 +642,22 @@ module List = | Some x -> x :: l | _ -> l - [] - let rec private vMapFoldWithAcc<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list acc : struct('Result list * 'State) = + let rec private vMapFoldWithAcc<'T, 'State, 'Result> + (mapping: 'State -> 'T -> struct ('Result * 'State)) + state + list + acc + : struct ('Result list * 'State) = match list with | [] -> acc, state - | [h] -> - mapping state h - |> ValueTuple.map1Of2 (fun x -> x::acc) + | [ h ] -> mapping state h |> ValueTuple.map1Of2 (fun x -> x :: acc) | h :: t -> - let struct(mappedHead, stateHead) = mapping state h + let struct (mappedHead, stateHead) = mapping state h vMapFoldWithAcc mapping stateHead t (mappedHead :: acc) - let vMapFold<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct('Result * 'State)) state list : struct('Result list * 'State) = - vMapFoldWithAcc mapping state list [] - |> ValueTuple.map1Of2 List.rev + let vMapFold<'T, 'State, 'Result> (mapping: 'State -> 'T -> struct ('Result * 'State)) state list : struct ('Result list * 'State) = + vMapFoldWithAcc mapping state list [] |> ValueTuple.map1Of2 List.rev module ResizeArray = @@ -796,13 +797,11 @@ module String = elif (!!value).StartsWithOrdinal pattern then Some() else None - let (|Contains|_|) (pattern:string) (value:string|null) = - match value with + let (|Contains|_|) (pattern: string) (value: string | null) = + match value with | null -> None | value when String.IsNullOrWhiteSpace value -> None - | value -> - if value.Contains pattern then Some() - else None + | value -> if value.Contains pattern then Some() else None let getLines (str: string) = use reader = new StringReader(str) @@ -854,9 +853,7 @@ module Lazy = // Single threaded execution and mutual exclusion /// Represents a permission active at this point in execution -type ExecutionToken = - interface - end +type ExecutionToken = interface end /// Represents a token that indicates execution on the compilation thread, i.e. /// - we have full access to the (partially mutable) TAST and TcImports data structures @@ -941,11 +938,7 @@ module ResultOrException = | Exception _err -> f () /// Generates unique stamps -type UniqueStampGenerator<'T when 'T: equality -#if !NO_CHECKNULLS - and 'T:not null -#endif - >() = +type UniqueStampGenerator<'T when 'T: equality and 'T: not null>() = let encodeTable = ConcurrentDictionary<'T, Lazy>(HashIdentity.Structural) let mutable nItems = -1 @@ -957,11 +950,7 @@ type UniqueStampGenerator<'T when 'T: equality member _.Table = encodeTable.Keys /// memoize tables (all entries cached, never collected) -type MemoizationTable<'T, 'U -#if !NO_CHECKNULLS - when 'T:not null -#endif - >(compute: 'T -> 'U, keyComparer: IEqualityComparer<'T>, ?canMemoize) = +type MemoizationTable<'T, 'U when 'T: not null>(compute: 'T -> 'U, keyComparer: IEqualityComparer<'T>, ?canMemoize) = let table = new ConcurrentDictionary<'T, Lazy<'U>>(keyComparer) let computeFunc = Func<_, _>(fun key -> lazy (compute key)) @@ -977,11 +966,7 @@ type MemoizationTable<'T, 'U compute x /// A thread-safe lookup table which is assigning an auto-increment stamp with each insert -type internal StampedDictionary<'T, 'U -#if !NO_CHECKNULLS - when 'T:not null -#endif - >(keyComparer: IEqualityComparer<'T>) = +type internal StampedDictionary<'T, 'U when 'T: not null>(keyComparer: IEqualityComparer<'T>) = let table = new ConcurrentDictionary<'T, Lazy>(keyComparer) let mutable count = -1 @@ -1307,12 +1292,13 @@ module MultiMap = let initBy f xs : MultiMap<_, _> = xs |> Seq.groupBy f |> Seq.map (fun (k, v) -> (k, List.ofSeq v)) |> Map.ofSeq - let ofList (xs: ('a * 'b) list) : MultiMap<'a,'b> = + let ofList (xs: ('a * 'b) list) : MultiMap<'a, 'b> = (Map.empty, xs) ||> List.fold (fun m (k, v) -> - m |> Map.change k (function - | None -> Some [v] - | Some vs -> Some (v :: vs))) + m + |> Map.change k (function + | None -> Some [ v ] + | Some vs -> Some(v :: vs))) |> Map.map (fun _ values -> List.rev values) type LayeredMap<'Key, 'Value when 'Key: comparison> = Map<'Key, 'Value> diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index bd9d330cfe4..e2fba355366 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -86,18 +86,9 @@ type DelayInitArrayMap<'T, 'TDictKey, 'TDictValue> = module internal Order = - val orderBy: p: ('T -> 'U) -> IComparer<'T> - when 'U: comparison -#if !NO_CHECKNULLS - and 'T:not null - and 'T:not struct -#endif + val orderBy: p: ('T -> 'U) -> IComparer<'T> when 'U: comparison and 'T: not null and 'T: not struct - val orderOn: p: ('T -> 'U) -> pxOrder: IComparer<'U> -> IComparer<'T> -#if !NO_CHECKNULLS - when 'T:not null - and 'T:not struct -#endif + val orderOn: p: ('T -> 'U) -> pxOrder: IComparer<'U> -> IComparer<'T> when 'T: not null and 'T: not struct val toFunction: pxOrder: IComparer<'U> -> x: 'U -> y: 'U -> int @@ -230,7 +221,11 @@ module internal List = val prependIfSome: x: 'a option -> l: 'a list -> 'a list - val vMapFold<'T,'State,'Result> : mapping:('State -> 'T -> struct('Result * 'State)) -> state:'State -> list:'T list -> struct('Result list * 'State) + val vMapFold<'T, 'State, 'Result> : + mapping: ('State -> 'T -> struct ('Result * 'State)) -> + state: 'State -> + list: 'T list -> + struct ('Result list * 'State) module internal ResizeArray = @@ -284,7 +279,7 @@ module internal String = val (|StartsWith|_|): pattern: string -> value: string -> unit option - val (|Contains|_|): pattern: string -> value: string|null -> unit option + val (|Contains|_|): pattern: string -> value: string | null -> unit option val getLines: str: string -> string[] @@ -306,9 +301,7 @@ module internal Lazy = val force: x: Lazy<'T> -> 'T /// Represents a permission active at this point in execution -type internal ExecutionToken = - interface - end +type internal ExecutionToken = interface end /// Represents a token that indicates execution on the compilation thread, i.e. /// - we have full access to the (partially mutable) TAST and TcImports data structures @@ -381,11 +374,7 @@ module internal ResultOrException = val otherwise: f: (unit -> ResultOrException<'a>) -> x: ResultOrException<'a> -> ResultOrException<'a> /// Generates unique stamps -type internal UniqueStampGenerator<'T when 'T: equality -#if !NO_CHECKNULLS - and 'T:not null -#endif - > = +type internal UniqueStampGenerator<'T when 'T: equality and 'T: not null> = new: unit -> UniqueStampGenerator<'T> @@ -394,11 +383,7 @@ type internal UniqueStampGenerator<'T when 'T: equality member Table: ICollection<'T> /// Memoize tables (all entries cached, never collected unless whole table is collected) -type internal MemoizationTable<'T, 'U -#if !NO_CHECKNULLS - when 'T:not null -#endif - > = +type internal MemoizationTable<'T, 'U when 'T: not null> = new: compute: ('T -> 'U) * keyComparer: IEqualityComparer<'T> * ?canMemoize: ('T -> bool) -> MemoizationTable<'T, 'U> @@ -406,11 +391,7 @@ type internal MemoizationTable<'T, 'U member Apply: x: 'T -> 'U /// A thread-safe lookup table which is assigning an auto-increment stamp with each insert -type internal StampedDictionary<'T, 'U -#if !NO_CHECKNULLS - when 'T:not null -#endif - > = +type internal StampedDictionary<'T, 'U when 'T: not null> = new: keyComparer: IEqualityComparer<'T> -> StampedDictionary<'T, 'U> @@ -443,10 +424,10 @@ type internal LazyWithContext<'T, 'ctxt> = /// Intern tables to save space. module internal Tables = - val memoize: f: ('a -> 'b) -> ('a -> 'b) - when 'a: equality -#if !NO_CHECKNULLS && NET8_0_OR_GREATER - and 'a:not null +#if NET8_0_OR_GREATER + val memoize: f: ('a -> 'b) -> ('a -> 'b) when 'a: equality and 'a: not null +#else + val memoize: f: ('a -> 'b) -> ('a -> 'b) when 'a: equality #endif /// Interface that defines methods for comparing objects using partial equality relation @@ -456,11 +437,9 @@ type internal IPartialEqualityComparer<'T> = /// Interface that defines methods for comparing objects using partial equality relation module internal IPartialEqualityComparer = - val On: f: ('a -> 'b) -> c: IPartialEqualityComparer<'b> -> IPartialEqualityComparer<'a> -#if !NO_CHECKNULLS - when 'a:not null - and 'a:not struct -#endif + val On: + f: ('a -> 'b) -> c: IPartialEqualityComparer<'b> -> IPartialEqualityComparer<'a> + when 'a: not null and 'a: not struct /// Like Seq.distinctBy but only filters out duplicates for some of the elements val partialDistinctBy: per: IPartialEqualityComparer<'T> -> seq: 'T list -> 'T list @@ -574,7 +553,7 @@ module internal MultiMap = val initBy: f: ('a -> 'b) -> xs: seq<'a> -> MultiMap<'b, 'a> when 'b: comparison - val ofList: xs: ('a * 'b) list -> MultiMap<'a,'b> when 'a: comparison + val ofList: xs: ('a * 'b) list -> MultiMap<'a, 'b> when 'a: comparison type internal LayeredMap<'Key, 'Value when 'Key: comparison> = Map<'Key, 'Value> diff --git a/src/Compiler/Utilities/lib.fsi b/src/Compiler/Utilities/lib.fsi index ea0669bdf4a..1dfd610d55a 100644 --- a/src/Compiler/Utilities/lib.fsi +++ b/src/Compiler/Utilities/lib.fsi @@ -263,12 +263,7 @@ type DisposablesTracker = new: unit -> DisposablesTracker /// Register some items to dispose - member Register: i:'a MaybeNull -> unit - when 'a:>System.IDisposable -#if !(NO_CHECKNULLS || BUILDING_WITH_LKG) - and 'a:not null -#endif - and 'a:not struct + member Register: i: 'a MaybeNull -> unit when 'a :> System.IDisposable and 'a: not struct and 'a: not null interface System.IDisposable diff --git a/src/Compiler/Utilities/sformat.fs b/src/Compiler/Utilities/sformat.fs index f6fc27b1e51..6ba5b68c462 100644 --- a/src/Compiler/Utilities/sformat.fs +++ b/src/Compiler/Utilities/sformat.fs @@ -122,13 +122,6 @@ type IEnvironment = abstract MaxColumns: int abstract MaxRows: int -#if NO_CHECKNULLS -[] -module NullShim = - // Shim to match nullness checking library support in preview - let inline (|Null|NonNull|) (x: 'T) : Choice = match x with null -> Null | v -> NonNull v -#endif - [] module TaggedText = let mkTag tag text = TaggedText(tag, text) @@ -575,6 +568,7 @@ module ReflectUtils = let GetValueInfo bindingFlags (x: 'a, ty: Type) (* x could be null *) = let obj = (box x) + match obj with | Null -> let isNullaryUnion = @@ -594,8 +588,7 @@ module ReflectUtils = UnitValue else NullValue - | NonNull obj -> - GetValueInfoOfObject bindingFlags obj + | NonNull obj -> GetValueInfoOfObject bindingFlags obj module Display = open ReflectUtils @@ -1014,6 +1007,7 @@ module Display = and objL showMode depthLim prec (x: objnull, ty: Type) = let info = Value.GetValueInfo bindingFlags (x, ty) + try if depthLim <= 0 || exceededPrintSize () then wordL (tagPunctuation "...") @@ -1034,9 +1028,11 @@ module Display = Some(wordL (tagText (x.ToString()))) else // Try the StructuredFormatDisplayAttribute extensibility attribute - match ty.GetCustomAttributes (typeof, true) with - | Null | [| |] -> None - | NonNull res -> structuredFormatObjectL showMode ty depthLim (res[0] :?> StructuredFormatDisplayAttribute) x + match ty.GetCustomAttributes(typeof, true) with + | Null + | [||] -> None + | NonNull res -> + structuredFormatObjectL showMode ty depthLim (res[0] :?> StructuredFormatDisplayAttribute) x #if COMPILER // This is the PrintIntercepts extensibility point currently revealed by fsi.exe's AddPrinter @@ -1069,6 +1065,7 @@ module Display = // Format an object that has a layout specified by StructuredFormatAttribute and structuredFormatObjectL showMode ty depthLim (attr: StructuredFormatDisplayAttribute) (obj: obj) = let txt = attr.Value + if isNull (box txt) || txt.Length <= 1 then None else diff --git a/src/FSharp.Build/FSharp.Build.fsproj b/src/FSharp.Build/FSharp.Build.fsproj index 3c392ef1158..8f2fd4f5951 100644 --- a/src/FSharp.Build/FSharp.Build.fsproj +++ b/src/FSharp.Build/FSharp.Build.fsproj @@ -9,11 +9,13 @@ FSharp.Build $(NoWarn);75 true - true + enable $(DefineConstants);LOCALIZATION_FSBUILD $(NoWarn);NU1701;FS0075 + + $(OtherFlags) --nowarn:3261 true - 7.0 + 9 Debug;Release;Proto diff --git a/src/FSharp.Build/FSharpCommandLineBuilder.fs b/src/FSharp.Build/FSharpCommandLineBuilder.fs index 51d7b12f1b7..a708f94fe87 100644 --- a/src/FSharp.Build/FSharpCommandLineBuilder.fs +++ b/src/FSharp.Build/FSharpCommandLineBuilder.fs @@ -15,21 +15,10 @@ do () // Shim to match nullness checking library support in preview [] module Utils = -#if NO_CHECKNULLS - /// Match on the nullness of an argument. - let inline (|Null|NonNull|) (x: 'T) : Choice = - match x with - | null -> Null - | v -> NonNull v /// Indicates that a type may be null. 'MaybeNull' used internally in the F# compiler as unchecked /// replacement for 'string?' for example for future FS-1060. - type MaybeNull<'T when 'T : null> = 'T -#else - /// Indicates that a type may be null. 'MaybeNull' used internally in the F# compiler as unchecked - /// replacement for 'string?' for example for future FS-1060. - type MaybeNull<'T when 'T : not null and 'T : not struct> = 'T | null -#endif + type MaybeNull<'T when 'T: not null and 'T: not struct> = 'T | null type FSharpCommandLineBuilder() = diff --git a/src/FSharp.Build/FSharpEmbedResourceText.fs b/src/FSharp.Build/FSharpEmbedResourceText.fs index 3e3c79f82ee..d8f4a46eb25 100644 --- a/src/FSharp.Build/FSharpEmbedResourceText.fs +++ b/src/FSharp.Build/FSharpEmbedResourceText.fs @@ -270,6 +270,9 @@ open Microsoft.FSharp.Collections open Printf #nowarn ""3262"" // The call to Option.ofObj below is applied in multiple compilation modes for GetString, sometimes the value is typed as a non-nullable string +#if BUILDING_WITH_LKG +#nowarn ""3261"" // Nullness warnings can happen due to LKG not having latest fixes +#endif " let StringBoilerPlate fileName = @@ -319,7 +322,7 @@ open Printf // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf ""%x""') mkFunctionValue tys (fun inp -> impl rty inp) - #if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT + #if !NULLABLE static let capture1 (fmt:string) i args ty (go: obj list -> System.Type -> int -> obj) : obj = #else static let capture1 (fmt:string) i args ty (go: objnull list -> System.Type -> int -> obj) : obj = @@ -345,7 +348,7 @@ open Printf if i >= len || (fmt.[i] = '%' && i+1 >= len) then let b = new System.Text.StringBuilder() b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - #if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT + #if !NULLABLE box(b.ToString()) #else box(b.ToString()) |> Unchecked.nonNull diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 27c6d6426b6..ca88e22465d 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -836,21 +836,13 @@ module Array = count -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - let private createMask<'a> - (f: 'a -> bool) - (src: 'a array) - (maskArrayOut: byref) - (leftoverMaskOut: byref) - = -#else let private createMask<'a> (f: 'a -> bool) (src: array<'a>) (maskArrayOut: byref | null>) (leftoverMaskOut: byref) = -#endif + let maskArrayLength = src.Length / 0x20 // null when there are less than 32 items in src array. @@ -1040,11 +1032,8 @@ module Array = dstIdx -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - let private filterViaMask (maskArray: uint32 array) (leftoverMask: uint32) (count: int) (src: _ array) = -#else let private filterViaMask (maskArray: uint32 array | null) (leftoverMask: uint32) (count: int) (src: _ array) = -#endif + let dst = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count let mutable dstIdx = 0 @@ -2196,14 +2185,20 @@ module Array = [] let tryFindIndex predicate (array: _ array) = let i = tryFindIndexAux predicate array - if i.HasValue then Some (int (i.GetValueOrDefault())) - else None + + if i.HasValue then + Some(int (i.GetValueOrDefault())) + else + None [] let tryFind predicate (array: _ array) = let i = tryFindIndexAux predicate array - if i.HasValue then Some array[int (i.GetValueOrDefault())] - else None + + if i.HasValue then + Some array[int (i.GetValueOrDefault())] + else + None [] let tryPick chooser (array: _ array) = @@ -2222,8 +2217,10 @@ module Array = pState.Break()) ) - if pResult.LowestBreakIteration.HasValue then allChosen[int (pResult.LowestBreakIteration.GetValueOrDefault())] - else None + if pResult.LowestBreakIteration.HasValue then + allChosen[int (pResult.LowestBreakIteration.GetValueOrDefault())] + else + None [] let choose chooser (array: 'T array) = diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index c0b0bc05a04..07a03675937 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -347,21 +347,15 @@ open Microsoft.FSharp.Quotations /// Represents the product of two measure expressions when returned as a generic argument of a provided type. [] -type MeasureProduct<'Measure1, 'Measure2>() = - class - end +type MeasureProduct<'Measure1, 'Measure2>() = class end /// Represents the inverse of a measure expressions when returned as a generic argument of a provided type. [] -type MeasureInverse<'Measure> = - class - end +type MeasureInverse<'Measure> = class end /// Represents the '1' measure expression when returned as a generic argument of a provided type. [] -type MeasureOne = - class - end +type MeasureOne = class end [] type TypeProviderAttribute() = @@ -473,7 +467,7 @@ type IProvidedNamespace = abstract GetTypes: unit -> Type array - abstract ResolveTypeName: typeName: string -> (Type|null) + abstract ResolveTypeName: typeName: string -> (Type | null) type ITypeProvider = inherit System.IDisposable diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index 206ccf4ee3d..a1c9c2fa644 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -1090,11 +1090,8 @@ module internal Array = if array.Length > 1 then Array.Sort<_>(array, fastComparerForArraySort()) -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - let stableSortWithKeysAndComparer (cFast:IComparer<'Key>) (c:IComparer<'Key>) (array:'T array) (keys: 'Key array) = -#else let stableSortWithKeysAndComparer (cFast:IComparer<'Key> | null) (c:IComparer<'Key>) (array:array<'T>) (keys:array<'Key>) = -#endif + // 'places' is an array or integers storing the permutation performed by the sort let len = array.Length let places = zeroCreateUnchecked len diff --git a/src/FSharp.Core/option.fs b/src/FSharp.Core/option.fs index 1b29141df64..ea5da774d87 100644 --- a/src/FSharp.Core/option.fs +++ b/src/FSharp.Core/option.fs @@ -148,35 +148,21 @@ module Option = [] let inline ofNullable (value: System.Nullable<'T>) = if value.HasValue then - Some (value.GetValueOrDefault()) + Some(value.GetValueOrDefault()) else None -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT [] - let inline ofObj value = + let inline ofObj (value: 'T | null) : 'T option when 'T: not struct and 'T: not null = match value with | null -> None | _ -> Some value [] - let inline toObj value = + let inline toObj (value: 'T option) : 'T | null when 'T: not struct = match value with | None -> null | Some x -> x -#else - [] - let inline ofObj (value: 'T | null) : 'T option when 'T: not struct and 'T : not null = - match value with - | null -> None - | _ -> Some value - - [] - let inline toObj (value: 'T option) : 'T | null when 'T: not struct (* and 'T : not null *) = - match value with - | None -> null - | Some x -> x -#endif [] let inline ofValueOption (voption: 'T voption) = @@ -338,35 +324,21 @@ module ValueOption = [] let inline ofNullable (value: System.Nullable<'T>) = if value.HasValue then - ValueSome (value.GetValueOrDefault()) + ValueSome(value.GetValueOrDefault()) else ValueNone -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT [] - let inline ofObj value = - match value with - | null -> ValueNone - | _ -> ValueSome value - - [] - let inline toObj value = - match value with - | ValueNone -> null - | ValueSome x -> x -#else - [] - let inline ofObj (value: 'T | null) : 'T voption when 'T: not struct and 'T : not null = + let inline ofObj (value: 'T | null) : 'T voption when 'T: not struct and 'T: not null = match value with | null -> ValueNone | _ -> ValueSome value [] - let inline toObj (value : 'T voption) : 'T | null when 'T: not struct (* and 'T : not null *) = + let inline toObj (value: 'T voption) : 'T | null when 'T: not struct = match value with | ValueNone -> null | ValueSome x -> x -#endif [] let inline ofOption (option: 'T option) = diff --git a/src/FSharp.Core/option.fsi b/src/FSharp.Core/option.fsi index 57adb485cb4..db381aec8ad 100644 --- a/src/FSharp.Core/option.fsi +++ b/src/FSharp.Core/option.fsi @@ -440,13 +440,8 @@ module Option = /// /// [] -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - val inline ofObj: value: 'T -> 'T option when 'T : null -#else - // TODO NULLNESS: assess this change - is it a breaking change? - [] - val inline ofObj: value: 'T | null -> 'T option when 'T : not null and 'T : not struct -#endif + [] + val inline ofObj: value: 'T | null -> 'T option when 'T: not null and 'T: not struct /// Convert an option to a potentially null value. /// @@ -461,12 +456,7 @@ module Option = /// /// [] -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - val inline toObj: value: 'T option -> 'T when 'T : null -#else - // TODO NULLNESS: assess this change - is it a breaking change? - val inline toObj: value: 'T option -> 'T | null when 'T : not struct (* and 'T : not null *) -#endif + val inline toObj: value: 'T option -> 'T | null when 'T: not struct /// Convert a value option to an option. /// @@ -929,13 +919,8 @@ module ValueOption = /// /// [] -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - val inline ofObj: value: 'T -> 'T voption when 'T : null -#else - // TODO NULLNESS: assess this change - is it a breaking change? - [] - val inline ofObj: value: 'T | null -> 'T voption when 'T : not struct and 'T : not null -#endif + [] + val inline ofObj: value: 'T | null -> 'T voption when 'T: not struct and 'T: not null /// Convert an option to a potentially null value. /// @@ -950,12 +935,7 @@ module ValueOption = /// /// [] -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - val inline toObj: value: 'T voption -> 'T when 'T : null -#else - // TODO NULLNESS: assess this change - is it a breaking change? - val inline toObj: value: 'T voption -> 'T | null when 'T : not struct (* and 'T : not null *) -#endif + val inline toObj: value: 'T voption -> 'T | null when 'T: not struct /// Convert an option to a value option. /// diff --git a/src/FSharp.Core/prim-types-prelude.fs b/src/FSharp.Core/prim-types-prelude.fs index 12ed91cfba2..f8797339628 100644 --- a/src/FSharp.Core/prim-types-prelude.fs +++ b/src/FSharp.Core/prim-types-prelude.fs @@ -6,11 +6,7 @@ namespace Microsoft.FSharp.Core // Basic type abbreviations type obj = System.Object -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - type objnull = obj -#else type objnull = obj | null -#endif type exn = System.Exception type nativeint = System.IntPtr type unativeint = System.UIntPtr diff --git a/src/FSharp.Core/prim-types-prelude.fsi b/src/FSharp.Core/prim-types-prelude.fsi index 8cc0515350d..a32ccdbf105 100644 --- a/src/FSharp.Core/prim-types-prelude.fsi +++ b/src/FSharp.Core/prim-types-prelude.fsi @@ -22,11 +22,7 @@ namespace Microsoft.FSharp.Core /// With the 'nullable reference types' feature, this is an alias to 'obj | null'. /// /// Basic Types -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - type objnull = obj -#else type objnull = obj | null -#endif /// An abbreviation for the CLI type . /// diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 4f4849eb849..d9a7e41bf55 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -739,11 +739,8 @@ namespace Microsoft.FSharp.Core let inline TypeTestFast<'T>(source: objnull) = //assert not(TypeInfo<'T>.TypeInfo = TypeNullnessSemantics_NullTrueValue) notnullPrim(isinstPrim<'T>(source)) -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT + let Dispose<'T when 'T :> IDisposable >(resource:'T|null) = -#else - let Dispose<'T when 'T :> IDisposable >(resource:'T) = -#endif match box resource with | null -> () | _ -> resource.Dispose() @@ -4419,8 +4416,6 @@ namespace Microsoft.FSharp.Core | null -> false | _ -> true -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT - [] let inline isNullV (value : Nullable<'T>) = not value.HasValue @@ -4473,13 +4468,6 @@ namespace Microsoft.FSharp.Core match value with | null -> raise (new ArgumentNullException(argumentName)) | _ -> (# "" value : 'T #) -#else - [] - let inline (|Null|NonNull|) (value : 'T) : Choice when 'T : null and 'T : not struct = - match value with - | null -> Null () - | _ -> NonNull (# "" value : 'T #) -#endif [] let inline raise (exn: exn) = @@ -4573,7 +4561,6 @@ namespace Microsoft.FSharp.Core [] let defaultValueArg arg defaultValue = match arg with ValueNone -> defaultValue | ValueSome v -> v -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT [] let inline defaultIfNull defaultValue (arg: 'T | null when 'T : not null and 'T : not struct) = match arg with null -> defaultValue | _ -> (# "" arg : 'T #) @@ -4581,7 +4568,6 @@ namespace Microsoft.FSharp.Core [] let inline defaultIfNullV defaultValue (arg: Nullable<'T>) = if arg.HasValue then arg.Value else defaultValue -#endif [] let inline (~-) (n: ^T) : ^T = @@ -5527,24 +5513,12 @@ namespace Microsoft.FSharp.Core [] let inline hash x = GenericHash x - #if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT - [] let inline nonNull (x: 'T | null when 'T : not null and 'T : not struct) : 'T = (# "" x : 'T #) [] let inline (|NonNullQuick|) (value : 'T | null when 'T : not null and 'T : not struct) = nonNull value - #else - - [] - let inline nonNull (x: 'T ) : 'T = x - - [] - let inline (|NonNullQuick|) (value) = nonNull value - - #endif - module Checked = let inline (+) (x: ^T) (y: ^U) : ^V = diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index c56fe5375e4..7c2f171a600 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -1391,11 +1391,8 @@ namespace Microsoft.FSharp.Core val inline FastGenericComparer<'T> : System.Collections.Generic.IComparer<'T> when 'T: comparison /// Make an F# comparer object for the given type, where it can be null if System.Collections.Generic.Comparer<'T>.Default -#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT - val internal FastGenericComparerCanBeNull<'T> : System.Collections.Generic.IComparer<'T> when 'T : comparison -#else val internal FastGenericComparerCanBeNull<'T> : System.Collections.Generic.IComparer<'T> | null when 'T : comparison -#endif + /// Make an F# hash/equality object for the given type val inline FastGenericEqualityComparer<'T> : System.Collections.Generic.IEqualityComparer<'T> when 'T: equality @@ -1796,11 +1793,8 @@ namespace Microsoft.FSharp.Core /// A compiler intrinsic for the efficient compilation of sequence expressions [] -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT val Dispose<'T when 'T :> System.IDisposable> : resource: 'T|null -> unit -#else - val Dispose<'T when 'T :> System.IDisposable> : resource: 'T -> unit -#endif + /// A compiler intrinsic for checking initialization soundness of recursive bindings [] @@ -3206,7 +3200,6 @@ namespace Microsoft.FSharp.Core /// val inline (<|||): func: ('T1 -> 'T2 -> 'T3 -> 'U) -> arg1: 'T1 * arg2: 'T2 * arg3: 'T3 -> 'U -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT /// Used to specify a default value for a nullable reference argument in the implementation of a function /// The default value of the argument. /// A nullable value representing the argument. @@ -3220,7 +3213,6 @@ namespace Microsoft.FSharp.Core /// The argument value. If it is null, the defaultValue is returned. [] val inline defaultIfNullV : defaultValue:'T -> arg:Nullable<'T> -> 'T -#endif /// Used to specify a default value for an optional argument in the implementation of a function /// @@ -3519,7 +3511,6 @@ namespace Microsoft.FSharp.Core [] val inline isNull: value: 'T -> bool when 'T: null -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT /// Determines whether the given value is null. /// The value to check. /// A choice indicating whether the value is null or not-null. @@ -3554,13 +3545,6 @@ namespace Microsoft.FSharp.Core /// True when value is null, false otherwise. [] val inline isNullV : value:Nullable<'T> -> bool -#else - /// Determines whether the given value is null. - /// The value to check. - /// A choice indicating whether the value is null or not-null. - [] - val inline (|Null|NonNull|) : value: 'T -> Choice when 'T : null and 'T : not struct -#endif /// Determines whether the given value is not null. /// @@ -3570,7 +3554,6 @@ namespace Microsoft.FSharp.Core [] val inline internal isNotNull: value:'T -> bool when 'T : null -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT /// Get the null value for a value type. /// In a future revision of nullness support this may be unified with 'null'. /// The null value for a value type. @@ -3603,7 +3586,6 @@ namespace Microsoft.FSharp.Core /// System.Nullable wrapper of the input argument. [] val inline withNullV : value:'T -> Nullable<'T> -#endif /// Throw a exception. /// @@ -3669,7 +3651,6 @@ namespace Microsoft.FSharp.Core [] val inline nullArg: argumentName: string -> 'T -#if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT /// Throw a System.ArgumentNullException if the given value is null exception /// /// The argument name. @@ -3677,7 +3658,6 @@ namespace Microsoft.FSharp.Core /// The result value. [] val inline nullArgCheck : argumentName:string -> 'T | null -> 'T when 'T : not null and 'T : not struct -#endif /// Throw a exception /// @@ -5812,21 +5792,13 @@ namespace Microsoft.FSharp.Core /// The possibly nullable value. /// The same value as in the input. [] - #if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT val inline nonNull : value: 'T | null -> 'T when 'T : not null and 'T : not struct - #else - val inline nonNull : value: 'T -> 'T - #endif /// When used in a pattern forgets 'nullness' of the value without any runtime check. This is an unsafe operation, as null check is being skipped and null value can be returned. /// The value to retype from ('T | null) to 'T . /// The non-null value. [] - #if !BUILDING_WITH_LKG && !NO_NULLCHECKING_LIB_SUPPORT val inline (|NonNullQuick|) : value: 'T | null -> 'T when 'T : not null and 'T : not struct - #else - val inline (|NonNullQuick|) : value: 'T -> 'T - #endif /// A module of comparison and equality operators that are statically resolved, but which are not fully generic and do not make structural comparison. Opening this /// module may make code that relies on structural or generic comparison no longer compile. diff --git a/src/FSharp.Core/resumable.fs b/src/FSharp.Core/resumable.fs index 1488ab220cf..9e24b64bffc 100644 --- a/src/FSharp.Core/resumable.fs +++ b/src/FSharp.Core/resumable.fs @@ -131,11 +131,8 @@ module ResumableCode = /// Note that this requires that the first step has no result. /// This prevents constructs like `task { return 1; return 2; }`. let CombineDynamic - ( - sm: byref>, - code1: ResumableCode<'Data, unit>, - code2: ResumableCode<'Data, 'T> - ) : bool = + (sm: byref>, code1: ResumableCode<'Data, unit>, code2: ResumableCode<'Data, 'T>) + : bool = if code1.Invoke(&sm) then code2.Invoke(&sm) else @@ -170,11 +167,8 @@ module ResumableCode = CombineDynamic(&sm, code1, code2)) let rec WhileDynamic - ( - sm: byref>, - condition: unit -> bool, - body: ResumableCode<'Data, unit> - ) : bool = + (sm: byref>, condition: unit -> bool, body: ResumableCode<'Data, unit>) + : bool = if condition () then if body.Invoke(&sm) then WhileDynamic(&sm, condition, body) @@ -207,10 +201,8 @@ module ResumableCode = /// Builds a step that executes the body while the condition predicate is true. let inline While - ( - [] condition: unit -> bool, - body: ResumableCode<'Data, unit> - ) : ResumableCode<'Data, unit> = + ([] condition: unit -> bool, body: ResumableCode<'Data, unit>) + : ResumableCode<'Data, unit> = ResumableCode<'Data, unit>(fun sm -> if __useResumableCode then //-- RESUMABLE CODE START @@ -252,10 +244,8 @@ module ResumableCode = /// Wraps a step in a try/with. This catches exceptions both in the evaluation of the function /// to retrieve the step, and in the continuation of the step (if any). let inline TryWith - ( - body: ResumableCode<'Data, 'T>, - catch: exn -> ResumableCode<'Data, 'T> - ) : ResumableCode<'Data, 'T> = + (body: ResumableCode<'Data, 'T>, catch: exn -> ResumableCode<'Data, 'T>) + : ResumableCode<'Data, 'T> = ResumableCode<'Data, 'T>(fun sm -> if __useResumableCode then //-- RESUMABLE CODE START @@ -283,11 +273,8 @@ module ResumableCode = TryWithDynamic(&sm, body, catch)) let rec TryFinallyCompensateDynamic - ( - sm: byref>, - mf: ResumptionFunc<'Data>, - savedExn: exn option - ) : bool = + (sm: byref>, mf: ResumptionFunc<'Data>, savedExn: exn option) + : bool = let mutable fin = false fin <- mf.Invoke(&sm) @@ -362,10 +349,8 @@ module ResumableCode = /// Wraps a step in a try/finally. This catches exceptions both in the evaluation of the function /// to retrieve the step, and in the continuation of the step (if any). let inline TryFinallyAsync - ( - body: ResumableCode<'Data, 'T>, - compensation: ResumableCode<'Data, unit> - ) : ResumableCode<'Data, 'T> = + (body: ResumableCode<'Data, 'T>, compensation: ResumableCode<'Data, unit>) + : ResumableCode<'Data, 'T> = ResumableCode<'Data, 'T>(fun sm -> if __useResumableCode then //-- RESUMABLE CODE START @@ -396,10 +381,8 @@ module ResumableCode = TryFinallyAsyncDynamic(&sm, body, compensation)) let inline Using - ( - resource: 'Resource, - body: 'Resource -> ResumableCode<'Data, 'T> - ) : ResumableCode<'Data, 'T> when 'Resource :> IDisposable|null = + (resource: 'Resource, body: 'Resource -> ResumableCode<'Data, 'T>) + : ResumableCode<'Data, 'T> when 'Resource :> IDisposable | null = // A using statement is just a try/finally with the finally block disposing if non-null. TryFinally( ResumableCode<'Data, 'T>(fun sm -> (body resource).Invoke(&sm)), diff --git a/src/FSharp.Core/tasks.fs b/src/FSharp.Core/tasks.fs index dfe7f4ba624..687bae5af85 100644 --- a/src/FSharp.Core/tasks.fs +++ b/src/FSharp.Core/tasks.fs @@ -58,36 +58,28 @@ type TaskBuilderBase() = /// Note that this requires that the first step has no result. /// This prevents constructs like `task { return 1; return 2; }`. member inline _.Combine - ( - task1: TaskCode<'TOverall, unit>, - task2: TaskCode<'TOverall, 'T> - ) : TaskCode<'TOverall, 'T> = + (task1: TaskCode<'TOverall, unit>, task2: TaskCode<'TOverall, 'T>) + : TaskCode<'TOverall, 'T> = ResumableCode.Combine(task1, task2) /// Builds a step that executes the body while the condition predicate is true. member inline _.While - ( - [] condition: unit -> bool, - body: TaskCode<'TOverall, unit> - ) : TaskCode<'TOverall, unit> = + ([] condition: unit -> bool, body: TaskCode<'TOverall, unit>) + : TaskCode<'TOverall, unit> = ResumableCode.While(condition, body) /// Wraps a step in a try/with. This catches exceptions both in the evaluation of the function /// to retrieve the step, and in the continuation of the step (if any). member inline _.TryWith - ( - body: TaskCode<'TOverall, 'T>, - catch: exn -> TaskCode<'TOverall, 'T> - ) : TaskCode<'TOverall, 'T> = + (body: TaskCode<'TOverall, 'T>, catch: exn -> TaskCode<'TOverall, 'T>) + : TaskCode<'TOverall, 'T> = ResumableCode.TryWith(body, catch) /// Wraps a step in a try/finally. This catches exceptions both in the evaluation of the function /// to retrieve the step, and in the continuation of the step (if any). member inline _.TryFinally - ( - body: TaskCode<'TOverall, 'T>, - [] compensation: unit -> unit - ) : TaskCode<'TOverall, 'T> = + (body: TaskCode<'TOverall, 'T>, [] compensation: unit -> unit) + : TaskCode<'TOverall, 'T> = ResumableCode.TryFinally( body, ResumableCode<_, _>(fun _sm -> @@ -100,10 +92,8 @@ type TaskBuilderBase() = #if NETSTANDARD2_1 member inline internal this.TryFinallyAsync - ( - body: TaskCode<'TOverall, 'T>, - compensation: unit -> ValueTask - ) : TaskCode<'TOverall, 'T> = + (body: TaskCode<'TOverall, 'T>, compensation: unit -> ValueTask) + : TaskCode<'TOverall, 'T> = ResumableCode.TryFinallyAsync( body, ResumableCode<_, _>(fun sm -> @@ -138,11 +128,9 @@ type TaskBuilderBase() = false) ) - member inline this.Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable|null> - ( - resource: 'Resource, - body: 'Resource -> TaskCode<'TOverall, 'T> - ) : TaskCode<'TOverall, 'T> = + member inline this.Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable | null> + (resource: 'Resource, body: 'Resource -> TaskCode<'TOverall, 'T>) + : TaskCode<'TOverall, 'T> = this.TryFinallyAsync( (fun sm -> (body resource).Invoke(&sm)), (fun () -> @@ -310,11 +298,8 @@ module LowPriority = and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)> - ( - sm: byref<_>, - task: ^TaskLike, - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - ) : bool = + (sm: byref<_>, task: ^TaskLike, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + : bool = let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task)) @@ -337,10 +322,8 @@ module LowPriority = and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted: unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)> - ( - task: ^TaskLike, - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - ) : TaskCode<'TOverall, 'TResult2> = + (task: ^TaskLike, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + : TaskCode<'TOverall, 'TResult2> = TaskCode<'TOverall, _>(fun sm -> if __useResumableCode then @@ -382,11 +365,9 @@ module LowPriority = this.Bind(task, this.Return) - member inline _.Using<'Resource, 'TOverall, 'T when 'Resource :> IDisposable|null> - ( - resource: 'Resource, - body: 'Resource -> TaskCode<'TOverall, 'T> - ) = + member inline _.Using<'Resource, 'TOverall, 'T when 'Resource :> IDisposable | null> + (resource: 'Resource, body: 'Resource -> TaskCode<'TOverall, 'T>) + = ResumableCode.Using(resource, body) module HighPriority = @@ -394,11 +375,8 @@ module HighPriority = type TaskBuilderBase with static member BindDynamic - ( - sm: byref<_>, - task: Task<'TResult1>, - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - ) : bool = + (sm: byref<_>, task: Task<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + : bool = let mutable awaiter = task.GetAwaiter() let cont = @@ -415,10 +393,8 @@ module HighPriority = false member inline _.Bind - ( - task: Task<'TResult1>, - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - ) : TaskCode<'TOverall, 'TResult2> = + (task: Task<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + : TaskCode<'TOverall, 'TResult2> = TaskCode<'TOverall, _>(fun sm -> if __useResumableCode then @@ -455,10 +431,8 @@ module MediumPriority = type TaskBuilderBase with member inline this.Bind - ( - computation: Async<'TResult1>, - continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) - ) : TaskCode<'TOverall, 'TResult2> = + (computation: Async<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)) + : TaskCode<'TOverall, 'TResult2> = this.Bind(Async.StartImmediateAsTask computation, continuation) member inline this.ReturnFrom(computation: Async<'T>) : TaskCode<'T, 'T> = diff --git a/src/FSharp.Core/tasks.fsi b/src/FSharp.Core/tasks.fsi index c626cb4bb7b..e6c801351a1 100644 --- a/src/FSharp.Core/tasks.fsi +++ b/src/FSharp.Core/tasks.fsi @@ -237,7 +237,7 @@ module LowPriority = /// member inline Using: resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> - when 'Resource :> IDisposable|null + when 'Resource :> IDisposable | null /// /// Contains medium-priority overloads for the `task` computation expression builder. diff --git a/src/fsi/console.fs b/src/fsi/console.fs index d644180d384..1d495d0cd48 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -30,14 +30,14 @@ type internal History() = list.Clear() current <- -1 - member _.Add (line: string | null) = - match line with + member _.Add(line: string | null) = + match line with | null | "" -> () | _ -> list.Add(line) - member _.AddLast (line: string | null) = - match line with + member _.AddLast(line: string | null) = + match line with | null | "" -> () | _ -> diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 4466d718308..69842b9e059 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -50,7 +50,7 @@ [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.Syntax.PrettyNaming::.cctor()][offset 0x00001220][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.Syntax.PrettyNaming::.cctor()][offset 0x00001229][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter::writeILMetadataAndCode(bool, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILVersionInfo, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILGlobals, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [S.P.CoreLib]System.Collections.Generic.IEnumerable`1, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILModuleDef, int32, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000063F][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter+bigness@3406::Invoke(int32)][offset 0x00000007][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter+bigness@3402::Invoke(int32)][offset 0x00000007][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+PortablePdbGenerator::serializeDocumentName(string)][offset 0x00000090][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. @@ -70,4 +70,4 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003F][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@276-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@275-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index d5617f6de03..6e41547cd11 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -55,7 +55,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+line@560-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+line@570-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [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. [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000065][found Byte] Unexpected type on the stack. @@ -70,7 +70,7 @@ [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.Syntax.PrettyNaming::.cctor()][offset 0x00001220][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.Syntax.PrettyNaming::.cctor()][offset 0x00001229][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter::writeILMetadataAndCode(bool, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILVersionInfo, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILGlobals, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, [S.P.CoreLib]System.Collections.Generic.IEnumerable`1, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILModuleDef, int32, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000063F][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter+bigness@3406::Invoke(int32)][offset 0x00000007][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryWriter+bigness@3402::Invoke(int32)][offset 0x00000007][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+PortablePdbGenerator::serializeDocumentName(string)][offset 0x00000090][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. @@ -79,7 +79,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.NativeRes+VersionHelper::TryParse(string, bool, uint16, bool, [S.P.CoreLib]System.Version&)][offset 0x0000003D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL+parseNamed@5291::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x00000087][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL+parseNamed@5311::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x00000087][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@316::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+Pipe #6 input at line 68@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x0000034D][found Char] Unexpected type on the stack. @@ -95,4 +95,4 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003F][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@276-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array+loop@275-4::Invoke(int32)][offset 0x00000012][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 9e78cdedccd..4e7b5396676 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -96,4 +96,4 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003A][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@275-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@274-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 87b09e193a5..431d4e5512a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -57,8 +57,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000026][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000021][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+TcConfig-TryResolveLibWithDirectories@558-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000003B][found Char] Unexpected type on the stack. +[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. +[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. [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. [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. @@ -106,7 +106,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.NativeRes+VersionHelper::TryParse(string, bool, uint16, bool, [S.P.CoreLib]System.Version&)][offset 0x00000026][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseNamed@5290(uint8[], [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x0000007E][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseNamed@5310(uint8[], [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x0000007E][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000016][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@315([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+SimulatedMSBuildResolver@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x000002F5][found Char] Unexpected type on the stack. @@ -122,4 +122,4 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IO.FileSystemUtils::trimQuotes(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Library.String::lowerCaseFirstChar(string)][offset 0x0000003A][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@275-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.Library.Array::loop@274-3(bool[], int32)][offset 0x00000008][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl index 2e94b26033c..4e6bca186fd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl @@ -1,8 +1,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2241@2245-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2571@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2238@2242-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2568@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl index 2e94b26033c..4e6bca186fd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl @@ -1,8 +1,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2241@2245-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2571@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2238@2242-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2568@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl index 4bc36bdc008..6ab50914fdd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl @@ -1,8 +1,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2245-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2242-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl index 4bc36bdc008..6ab50914fdd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl @@ -1,8 +1,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2245-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2575-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2242-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. From a3181c4c8e5a286a38f986a79024a74bfc650fb5 Mon Sep 17 00:00:00 2001 From: Maxime Mangel Date: Thu, 27 Mar 2025 12:06:05 +0100 Subject: [PATCH 039/134] Fix `fcs.fs` link (#18419) --- docs/reusing-typechecking-results.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reusing-typechecking-results.md b/docs/reusing-typechecking-results.md index 247e26f21dd..9eedc036ab0 100644 --- a/docs/reusing-typechecking-results.md +++ b/docs/reusing-typechecking-results.md @@ -25,7 +25,7 @@ Here are some assumptions I am coming with after tinkering with the topic and in ### Premise 1: current compiler design -The heart of the compiler, [fsc.fs](src\Compiler\Driver\fsc.fs), is split into 6 phases (`main1` - `main6`). The code is designed to pass minimum information between phases, using the `Args` structure, which is essentially a data bag. The first phase takes info from the program arguments. +The heart of the compiler, [fsc.fs](../src/Compiler/Driver/fsc.fs), is split into 6 phases (`main1` - `main6`). The code is designed to pass minimum information between phases, using the `Args` structure, which is essentially a data bag. The first phase takes info from the program arguments. ```fsharp main1 (...args...) From af2ebfa79eb026c92dc28974608ddfa06cba3964 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 27 Mar 2025 15:02:40 +0100 Subject: [PATCH 040/134] Re-enable unused bindings detection (#18420) * reenable unused binding detection * fantomas * vsintegration/tests - ignored unused bindings in selected test projects --- Directory.Build.props | 5 ----- FSharp.sln | 1 + FSharpBuild.Directory.Build.props | 3 ++- .../Checking/Expressions/CheckExpressions.fs | 4 ++-- .../Expressions/CheckSequenceExpressions.fs | 4 ++-- src/Compiler/Checking/TailCallChecks.fs | 2 +- src/Compiler/Checking/infos.fs | 4 ++-- src/Compiler/CodeGen/EraseUnions.fs | 1 - src/Compiler/Driver/CompilerDiagnostics.fs | 2 +- src/Compiler/FSharp.Compiler.Service.fsproj | 8 +------ src/Compiler/Facilities/AsyncMemoize.fs | 2 +- src/Compiler/Service/TransparentCompiler.fs | 2 +- src/Compiler/SyntaxTree/LexerStore.fs | 2 -- src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 6 ++--- src/Compiler/TypedTree/TypedTreeOps.fs | 4 ++-- .../CreateFSharpManifestResourceName.fs | 2 +- src/FSharp.Build/FSharpEmbedResourceText.fs | 8 +++---- src/FSharp.Build/Fsc.fs | 5 +---- src/FSharp.Build/Fsi.fs | 3 --- src/FSharp.Build/MapSourceRoots.fs | 2 +- .../FSharp.DependencyManager.Nuget.fsproj | 1 - .../MapSourceRootsTests.fs | 2 ++ .../DependencyManagerInteractiveTests.fs | 21 ++++-------------- .../FSharpScriptTests.fs | 22 +++++++++---------- .../AssemblyReaderShim.fs | 2 +- tests/FSharp.Compiler.Service.Tests/Common.fs | 8 +++---- .../FSharp.Compiler.Service.Tests.fsproj | 1 + .../FSharpExprPatternsTests.fs | 4 ++-- .../GeneratedCodeSymbolsTests.fs | 12 +++++----- .../ModuleReaderCancellationTests.fs | 17 +++++--------- .../ProjectAnalysisTests.fs | 11 +++++----- .../FSharp.Compiler.Service.Tests/Symbols.fs | 10 ++++----- .../TooltipTests.fs | 7 +++--- .../FSharp.Core.UnitTests.fsproj | 1 + tests/service/data/TestTP/TestTP.fs | 2 ++ .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 2 +- ...myProviderForLanguageServiceTesting.fsproj | 2 +- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 2 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 2 +- 39 files changed, 83 insertions(+), 116 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index fbb9c8332c7..141c85ff4d2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,11 +10,6 @@ $(DotNetBuildSourceOnly) - - - $(NoWarn);FS0064;FS1182 - - $(NoWarn);1204 $(NoWarn);NU5125 - $(NoWarn);64;1182;1204 - $(OtherFlags) --warnaserror-:1182 + $(NoWarn);64;1204 FSharp.Compiler.Service true $(DefineConstants);COMPILER @@ -26,11 +25,6 @@ $(FSharpNetCoreProductTargetFramework);$(TargetFrameworks) $(DefineConstants);FSHARPCORE_USE_PACKAGE $(OtherFlags) --extraoptimizationloops:1 - - - - $(OtherFlags) --nowarn:1182 - $(OtherFlags) --warnon:3218 diff --git a/src/Compiler/Facilities/AsyncMemoize.fs b/src/Compiler/Facilities/AsyncMemoize.fs index a8a4d5b143f..ac52eaf8607 100644 --- a/src/Compiler/Facilities/AsyncMemoize.fs +++ b/src/Compiler/Facilities/AsyncMemoize.fs @@ -183,7 +183,7 @@ type internal AsyncMemoize<'TKey, 'TVersion, 'TValue when 'TKey: equality and 'TVersion: equality and 'TKey: not null and 'TVersion: not null> (?keepStrongly, ?keepWeakly, ?name: string, ?cancelUnawaitedJobs: bool, ?cancelDuplicateRunningJobs: bool) = - let name = defaultArg name "N/A" + let _name = defaultArg name "N/A" let cancelUnawaitedJobs = defaultArg cancelUnawaitedJobs true let cancelDuplicateRunningJobs = defaultArg cancelDuplicateRunningJobs false diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 39560cb3b6b..4385ca4f1e3 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -2355,7 +2355,7 @@ type internal TransparentCompiler ( fileName: string, sourceText: ISourceTextNew, - caret: Position option, + _caret: Position option, documentSource: DocumentSource, previewEnabled: bool option, loadedTimeStamp: DateTime option, diff --git a/src/Compiler/SyntaxTree/LexerStore.fs b/src/Compiler/SyntaxTree/LexerStore.fs index 711e9530cd9..2914d944c20 100644 --- a/src/Compiler/SyntaxTree/LexerStore.fs +++ b/src/Compiler/SyntaxTree/LexerStore.fs @@ -32,8 +32,6 @@ let private tryGetStoreData<'T when 'T: not null> (lexbuf: Lexbuf) key = | true, data -> Some(data :?> 'T) | _ -> None -let private setStoreData (lexbuf: Lexbuf) key data = lexbuf.BufferLocalStore[key] <- data - //------------------------------------------------------------------------ // A SynArgNameGenerator for the current file, used by the parser //------------------------------------------------------------------------ diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index ffb9bd65647..6633dab2408 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -1024,9 +1024,9 @@ let parsedHashDirectiveArgumentsNoCheck (input: ParsedHashDirectiveArgument list (function | ParsedHashDirectiveArgument.String(s, _, _) -> s | ParsedHashDirectiveArgument.SourceIdentifier(_, v, _) -> v - | ParsedHashDirectiveArgument.Int32(n, m) -> string n - | ParsedHashDirectiveArgument.Ident(ident, m) -> ident.idText - | ParsedHashDirectiveArgument.LongIdent(ident, m) -> longIdentToString ident) + | ParsedHashDirectiveArgument.Int32(n, _) -> string n + | ParsedHashDirectiveArgument.Ident(ident, _) -> ident.idText + | ParsedHashDirectiveArgument.LongIdent(ident, _) -> longIdentToString ident) input let parsedHashDirectiveStringArguments (input: ParsedHashDirectiveArgument list) (_langVersion: LanguageVersion) = diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 33dd6c2757c..21c9783713e 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -9241,7 +9241,7 @@ let GetDisallowedNullness (g:TcGlobals) (ty:TType) = | None -> [] | Some t -> hasWithNullAnyWhere t withNull - | TType_app (tcr, tinst, nullnessOrig) -> + | TType_app (tcr, tinst, _) -> let tyArgs = tinst |> List.collect (fun t -> hasWithNullAnyWhere t false) match alreadyWrappedInOuterWithNull, tcr.TypeAbbrev with @@ -9260,7 +9260,7 @@ let GetDisallowedNullness (g:TcGlobals) (ty:TType) = let inner = tupTypes |> List.collect (fun t -> hasWithNullAnyWhere t false) if alreadyWrappedInOuterWithNull then ty :: inner else inner - | TType_anon (anon,tys) -> + | TType_anon (tys=tys) -> let inner = tys |> List.collect (fun t -> hasWithNullAnyWhere t false) if alreadyWrappedInOuterWithNull then ty :: inner else inner | TType_fun (d, r, _) -> diff --git a/src/FSharp.Build/CreateFSharpManifestResourceName.fs b/src/FSharp.Build/CreateFSharpManifestResourceName.fs index a19c9fada32..c39f7ae3da0 100644 --- a/src/FSharp.Build/CreateFSharpManifestResourceName.fs +++ b/src/FSharp.Build/CreateFSharpManifestResourceName.fs @@ -18,7 +18,7 @@ type CreateFSharpManifestResourceName public () = linkFileName: string, rootNamespace: string, // may be null dependentUponFileName: string, // may be null - binaryStream: Stream // may be null + _binaryStream: Stream // may be null ) : string = // The Visual CSharp and XBuild CSharp toolchains transform resource names like this: diff --git a/src/FSharp.Build/FSharpEmbedResourceText.fs b/src/FSharp.Build/FSharpEmbedResourceText.fs index d8f4a46eb25..1c5ffbfb68b 100644 --- a/src/FSharp.Build/FSharpEmbedResourceText.fs +++ b/src/FSharp.Build/FSharpEmbedResourceText.fs @@ -447,7 +447,7 @@ open Printf let lines = File.ReadAllLines(fileName) |> Array.mapi (fun i s -> i, s) // keep line numbers - |> Array.filter (fun (i, s) -> not (s.StartsWith "#")) // filter out comments + |> Array.filter (fun (_i, s) -> not (s.StartsWith "#")) // filter out comments printMessage "Parsing %s" fileName let stringInfos = lines |> Array.map (fun (i, s) -> ParseLine fileName i s) @@ -511,7 +511,7 @@ open Printf printMessage "Generating resource methods for %s" outFileName // gen each resource method stringInfos - |> Seq.iter (fun (lineNum, (optErrNum, ident), str, holes, netFormatString) -> + |> Seq.iter (fun (lineNum, (optErrNum, ident), str, holes, _netFormatString) -> let formalArgs = new System.Text.StringBuilder() let actualArgs = new System.Text.StringBuilder() let mutable firstTime = true @@ -589,7 +589,7 @@ open Printf fprintfn outSignature " static member RunStartupValidation: unit -> unit" stringInfos - |> Seq.iter (fun (lineNum, (optErrNum, ident), str, holes, netFormatString) -> + |> Seq.iter (fun (_lineNum, (_optErrNum, ident), _str, _holes, _netFormatString) -> fprintfn out " ignore(GetString(\"%s\"))" ident) fprintfn out " ()" // in case there are 0 strings, we need the generated code to parse @@ -598,7 +598,7 @@ open Printf xd.LoadXml(xmlBoilerPlateString) stringInfos - |> Seq.iter (fun (lineNum, (optErrNum, ident), str, holes, netFormatString) -> + |> Seq.iter (fun (_lineNum, (_optErrNum, ident), _str, _holes, netFormatString) -> let xn = xd.CreateElement("data") xn.SetAttribute("name", ident) |> ignore xn.SetAttribute("xml:space", "preserve") |> ignore diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index ccbece545d5..3cce873e722 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -69,7 +69,6 @@ type public Fsc() as this = let mutable tailcalls: bool = true let mutable targetProfile: string MaybeNull = null let mutable targetType: string MaybeNull = null - let mutable toolExe: string = "fsc.exe" let defaultToolPath = let locationOfThisDll = @@ -733,8 +732,6 @@ type public Fsc() as this = match host with | null -> base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) | _ -> - let sources = sources |> Array.map (fun i -> i.ItemSpec) - let invokeCompiler baseCallDelegate = try let ret = @@ -765,7 +762,7 @@ type public Fsc() as this = -> fsc.Log.LogError(tie.InnerException.Message, [||]) -1 - | e -> reraise () + | _ -> reraise () let baseCallDelegate = Func(fun () -> fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands)) diff --git a/src/FSharp.Build/Fsi.fs b/src/FSharp.Build/Fsi.fs index a8ad12d1b2c..88a6dbf3adb 100644 --- a/src/FSharp.Build/Fsi.fs +++ b/src/FSharp.Build/Fsi.fs @@ -37,15 +37,12 @@ type public Fsi() as this = let mutable provideCommandLineArgs = false let mutable references: ITaskItem[] = [||] let mutable referencePath: string MaybeNull = null - let mutable resources: ITaskItem[] = [||] let mutable skipCompilerExecution = false let mutable sources: ITaskItem[] = [||] let mutable loadSources: ITaskItem[] = [||] let mutable useSources: ITaskItem[] = [||] let mutable tailcalls: bool = true let mutable targetProfile: string MaybeNull = null - let mutable targetType: string MaybeNull = null - let mutable toolExe: string = "fsi.exe" let mutable toolPath: string = let locationOfThisDll = diff --git a/src/FSharp.Build/MapSourceRoots.fs b/src/FSharp.Build/MapSourceRoots.fs index c2131209dad..8ea92c02197 100644 --- a/src/FSharp.Build/MapSourceRoots.fs +++ b/src/FSharp.Build/MapSourceRoots.fs @@ -130,7 +130,7 @@ type MapSourceRoots() = for root in mappedSourceRoots do match root.GetMetadata SourceControl with - | HasValue v when isSourceControlled -> mapNestedRootIfEmpty root + | HasValue _ when isSourceControlled -> mapNestedRootIfEmpty root | NullOrEmpty when not isSourceControlled -> mapNestedRootIfEmpty root | _ -> () diff --git a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj index 4700c172f52..96e318d282c 100644 --- a/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj +++ b/src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.Nuget.fsproj @@ -8,7 +8,6 @@ FSharp.DependencyManager.Nuget true $(DefineConstants);COMPILER - $(OtherFlags) --warnon:1182 true Debug;Release diff --git a/tests/FSharp.Build.UnitTests/MapSourceRootsTests.fs b/tests/FSharp.Build.UnitTests/MapSourceRootsTests.fs index bdefa03d96a..ec590e52e42 100644 --- a/tests/FSharp.Build.UnitTests/MapSourceRootsTests.fs +++ b/tests/FSharp.Build.UnitTests/MapSourceRootsTests.fs @@ -9,6 +9,8 @@ open Xunit open System.Collections.Generic open FSharp.Test +#nowarn "1182" //Unused arguments + type MockEngine() = member val Errors = ResizeArray() with get member val Warnings = ResizeArray() with get diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs index 7f320fea23f..3e6b7b27e43 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/DependencyManagerInteractiveTests.fs @@ -39,8 +39,6 @@ type DependencyManagerInteractiveTests() = let getErrors ((_value: Result), (errors: FSharpDiagnostic[])) = errors - let ignoreValue = getValue >> ignore - [] member _.``SmokeTest - #r nuget``() = let text = """ @@ -58,7 +56,7 @@ type DependencyManagerInteractiveTests() = #r @"nuget:System.Collections.Immutable.DoesNotExist, version=1.5.0" 0""" use script = new scriptHost() - let opt, errors = script.Eval(text) + let _opt, errors = script.Eval(text) Assert.Equal(errors.Length, 1) (* @@ -152,8 +150,6 @@ type DependencyManagerInteractiveTests() = [] member _.``Multiple Instances of DependencyProvider should be isolated``() = - - let assemblyProbingPaths () = Seq.empty let nativeProbingRoots () = Seq.empty use dp1 = new DependencyProvider(NativeResolutionProbe(nativeProbingRoots), false) @@ -282,7 +278,6 @@ TorchSharp.Tensor.LongTensor.From([| 0L .. 100L |]).Device | ErrorReportType.Warning -> printfn "PackageManagementWarning %d : %s" code message ResolvingErrorReport (report) - let mutable resolverPackageRoots = Seq.empty let mutable resolverPackageRoots = Seq.empty let mutable resolverReferences = Seq.empty @@ -383,11 +378,9 @@ printfn ""%A"" result ResolvingErrorReport (report) let mutable resolverPackageRoots = Seq.empty - let mutable resolverPackageRoots = Seq.empty let mutable resolverReferences = Seq.empty let nativeProbingRoots () = resolverPackageRoots - let assemblyPaths () = resolverReferences // Restore packages, Get Reference dll paths and package roots let result = @@ -526,10 +519,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let mutable resolverPackageRoots = Seq.empty - let mutable resolverReferences = Seq.empty - let nativeProbingRoots () = resolverPackageRoots - let assemblyProbingPaths () = resolverReferences // Restore packages, Get Reference dll paths and package roots let result = @@ -552,10 +542,7 @@ x |> Seq.iter(fun r -> ResolvingErrorReport (report) let mutable resolverPackageRoots = Seq.empty - let mutable resolverReferences = Seq.empty - let nativeProbingRoots () = resolverPackageRoots - let assemblyProbingPaths () = resolverReferences // Restore packages, Get Reference dll paths and package roots let result = @@ -740,7 +727,7 @@ x |> Seq.iter(fun r -> use script = new FSharpScript(quiet = false, langVersion = LangVersion.V47) use capture = new TestConsole.ExecutionCapture() - let opt = script.Eval("#help") |> getValue + let _opt = script.Eval("#help") |> getValue let output = capture.OutText @@ -772,7 +759,7 @@ x |> Seq.iter(fun r -> use script = new FSharpScript(quiet = false, langVersion = LangVersion.Preview) use capture = new TestConsole.ExecutionCapture() - let opt = script.Eval("#help") |> getValue + let _opt = script.Eval("#help") |> getValue let output = capture.OutText @@ -871,7 +858,7 @@ x |> Seq.iter(fun r -> let idm = dp.TryFindDependencyManagerByKey(Seq.empty, "", reportError, "nuget") // Resolve and cache the results won't time out - let result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever + let _result = dp.Resolve(idm, ".fsx", [|"r", "FSharp.Data,3.3.3"; "r", "timeout=10000"|], reportError, "net9.0", null, "", "", "", -1) // Wait forever // Clear the results foundCorrectError <- false diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs index ecf5b81d97b..207cde1074f 100644 --- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs +++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs @@ -71,7 +71,7 @@ x let ce = new ControlledExecution(true) ce.Run(fun () -> use script = new FSharpScript() - let result, errors = + let result, _errors = script.Eval(""" open System let x = 1 + 2 @@ -178,7 +178,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC Assert.Empty(errors) match result with | Ok(_) -> () - | Error(ex) -> Assert.True(true, "expected no failures") + | Error _ -> Assert.True(true, "expected no failures") [] [] // No argument @@ -186,7 +186,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC [] // whitespace only argument member _.``Script with #i syntax errors fail``(code, error0) = use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.NotEmpty(errors) Assert.Equal(errors.[0].ToString(), error0) @@ -196,7 +196,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC "input.fsx (1,1)-(1,3) interactive warning Invalid directive '#i '")>] member _.``Script with more #i syntax errors fail``(code, error0, error1) = use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.NotEmpty(errors) Assert.Equal(errors.Length, 2) Assert.Equal(error0, errors.[0].ToString()) @@ -207,7 +207,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC "input.fsx (1,1)-(1,42) interactive error #i is not supported by the registered PackageManagers")>] member _.``Script with #i and no package manager specified``(code, error0) = use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.NotEmpty(errors) Assert.Equal(errors.Length, 1) Assert.Equal(errors.[0].ToString(), error0) @@ -217,7 +217,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC "input.fsx (1,1)-(1,15) interactive error Invalid URI: The format of the URI could not be determined.")>] member _.``Script with #i and forgot to add quotes``(code, error) = use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.NotEmpty(errors) Assert.Equal(1, errors.Length) Assert.Equal(error, errors.[0].ToString()) @@ -227,7 +227,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC let path = Path.GetTempPath() let code = sprintf "#i @\"nuget:%s\" " path use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.Empty(errors) Assert.Equal(0, errors.Length) @@ -239,7 +239,7 @@ System.Configuration.ConfigurationManager.AppSettings.Item "Environment" <- "LOC let code = sprintf "#i @\"nuget:%s\"" path let error = sprintf "interactive error The source directory '%s' not found" path use script = new FSharpScript() - let result, errors = script.Eval(code) + let _result, errors = script.Eval(code) Assert.NotEmpty(errors) Assert.Equal(1, errors.Length) Assert.True(errors.[0].ToString().EndsWith(error)) @@ -308,7 +308,7 @@ printfn "{@"%A"}" result member _.``Eval script with invalid PackageName should fail immediately``() = use capture = new TestConsole.ExecutionCapture() use script = new FSharpScript(additionalArgs=[| |]) - let result, errors = script.Eval("""#r "nuget:FSharp.Really.Not.A.Package" """) + let _result, errors = script.Eval("""#r "nuget:FSharp.Really.Not.A.Package" """) let lines = capture.OutText.Split([| Environment.NewLine |], StringSplitOptions.None) let found = lines |> Seq.exists (fun line -> line.Contains("error NU1101:") && line.Contains("FSharp.Really.Not.A.Package")) @@ -320,7 +320,7 @@ printfn "{@"%A"}" result member _.``Eval script with invalid PackageName should fail immediately and resolve one time only``() = use capture = new TestConsole.ExecutionCapture() use script = new FSharpScript(additionalArgs=[| |]) - let result, errors = + let _result, errors = script.Eval(""" #r "nuget:FSharp.Really.Not.A.Package" #r "nuget:FSharp.Really.Not.Another.Package" @@ -526,7 +526,7 @@ let add (col:IServiceCollection) = Assert.Empty(errors) match result with | Ok(_) -> () - | Error(ex) -> Assert.True(false, "expected no failures") + | Error _ -> Assert.True(false, "expected no failures") | false -> Assert.NotEmpty(errors) Assert.Equal(1, errors.Length) diff --git a/tests/FSharp.Compiler.Service.Tests/AssemblyReaderShim.fs b/tests/FSharp.Compiler.Service.Tests/AssemblyReaderShim.fs index 9e19b32834f..63d8ee1c284 100644 --- a/tests/FSharp.Compiler.Service.Tests/AssemblyReaderShim.fs +++ b/tests/FSharp.Compiler.Service.Tests/AssemblyReaderShim.fs @@ -20,6 +20,6 @@ module M let x = 123 """ - let fileName, options = mkTestFileAndOptions source [| |] + let fileName, options = mkTestFileAndOptions [| |] checker.ParseAndCheckFileInProject(fileName, 0, SourceText.ofString source, options) |> Async.RunImmediate |> ignore gotRequest |> Assert.True diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index b9f780fd506..5ad61b29ef9 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -129,7 +129,7 @@ let mkProjectCommandLineArgsForScript (dllName, fileNames) = |] #endif -let mkTestFileAndOptions source additionalArgs = +let mkTestFileAndOptions additionalArgs = let fileName = Path.ChangeExtension(getTemporaryFileName (), ".fs") let project = getTemporaryFileName () let dllName = Path.ChangeExtension(project, ".dll") @@ -193,7 +193,7 @@ let parseSourceCode (name: string, code: string) = let filePath = Path.Combine(location, name) let dllPath = Path.Combine(location, name + ".dll") let args = mkProjectCommandLineArgs(dllPath, [filePath]) - let options, errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) + let options, _errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) let parseResults = checker.ParseFile(filePath, SourceText.ofString code, options) |> Async.RunImmediate parseResults.ParseTree @@ -203,7 +203,7 @@ let matchBraces (name: string, code: string) = let filePath = Path.Combine(location, name + ".fs") let dllPath = Path.Combine(location, name + ".dll") let args = mkProjectCommandLineArgs(dllPath, [filePath]) - let options, errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) + let options, _errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) let braces = checker.MatchBraces(filePath, SourceText.ofString code, options) |> Async.RunImmediate braces @@ -265,7 +265,7 @@ let attribsOfSymbol (symbol: FSharpSymbol) = if v.IsStatic then yield "static" if v.IsLiteral then yield sprintf "%A" v.LiteralValue.Value if v.IsAnonRecordField then - let info, tys, i = v.AnonRecordFieldDetails + let info, _tys, i = v.AnonRecordFieldDetails yield "anon(" + string i + ", [" + info.Assembly.QualifiedName + "/" + String.concat "+" info.EnclosingCompiledTypeNames + "/" + info.CompiledName + "]" + String.concat "," info.SortedFieldNames + ")" diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 57ce88d8f02..16e9df837ee 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -5,6 +5,7 @@ net472;$(FSharpNetCoreProductTargetFramework) $(FSharpNetCoreProductTargetFramework) true + $(NoWarn);1182 true xunit diff --git a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs index abc6bbc9de4..0c5c9fc3305 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/FSharpExprPatternsTests.fs @@ -25,7 +25,7 @@ module TASTCollecting = | Application (funcExpr, _typeArgs, argExprs) -> visitExpr handler funcExpr visitExprs handler argExprs - | Call (objExprOpt, memberOrFunc, _typeArgs1, _typeArgs2, argExprs) -> + | Call (objExprOpt, _memberOrFunc, _typeArgs1, _typeArgs2, argExprs) -> visitObjArg handler objExprOpt visitExprs handler argExprs | Coerce (_targetType, inpExpr) -> visitExpr handler inpExpr @@ -132,7 +132,7 @@ let testPatterns handler source = Map.tryFind fileName files |> async.Return let projectOptions = - let _, projectOptions = mkTestFileAndOptions "" Array.empty + let _, projectOptions = mkTestFileAndOptions Array.empty { projectOptions with SourceFiles = [| "A.fs" |] diff --git a/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs b/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs index 5fac752952c..6e9a64d0191 100644 --- a/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/GeneratedCodeSymbolsTests.fs @@ -22,10 +22,10 @@ type T () = for implFile in wholeProjectResults.AssemblyContents.ImplementationFiles do for decl in implFile.Declarations do match decl with - | FSharpImplementationFileDeclaration.Entity(e,ds) -> + | FSharpImplementationFileDeclaration.Entity(_e,ds) -> for d in ds do match d with - | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, args, body) -> + | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, _args, _body) -> yield mfv | _ -> () | _ -> () @@ -51,10 +51,10 @@ type T = A | B for implFile in wholeProjectResults.AssemblyContents.ImplementationFiles do for decl in implFile.Declarations do match decl with - | FSharpImplementationFileDeclaration.Entity(e,ds) -> + | FSharpImplementationFileDeclaration.Entity(_e,ds) -> for d in ds do match d with - | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, args, body) -> + | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, _args, _body) -> yield mfv | _ -> () | _ -> () @@ -84,10 +84,10 @@ type T = for implFile in wholeProjectResults.AssemblyContents.ImplementationFiles do for decl in implFile.Declarations do match decl with - | FSharpImplementationFileDeclaration.Entity(e,ds) -> + | FSharpImplementationFileDeclaration.Entity(_e,ds) -> for d in ds do match d with - | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, args, body) -> + | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (mfv, _args, _body) -> yield mfv | _ -> () | _ -> () diff --git a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs index 981c4dda14b..f307586cd5c 100644 --- a/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ModuleReaderCancellationTests.fs @@ -102,13 +102,6 @@ type PreTypeDefData = CancelOnImport: bool } member this.TypeDef = - let name = - match this.Namespace with - | [] -> this.Name - | ns -> - let ns = ns |> String.concat "." - $"{ns}.{this.Name}" - let methodsDefs = if this.HasCtor then let mkCtor = runCancelFirstTime (fun _ -> [| ModuleReader.mkCtor () |]) @@ -191,7 +184,7 @@ let ``Type defs 01 - assembly import`` () = let getPreTypeDefs typeData = runCancelFirstTime (fun _ -> createPreTypeDefs typeData) let typeDefs = getPreTypeDefs [ { Name = "T"; Namespace = []; HasCtor = false; CancelOnImport = false } ] - let path, options = mkTestFileAndOptions source [||] + let path, options = mkTestFileAndOptions [||] let options = referenceReaderProject typeDefs false options // First request, should be cancelled inside getPreTypeDefs @@ -217,7 +210,7 @@ let ``Type defs 02 - assembly import`` () = let source = source1 let typeDefs = fun _ -> createPreTypeDefs [ { Name = "T"; Namespace = ["Ns"]; HasCtor = false; CancelOnImport = true } ] - let path, options = mkTestFileAndOptions source [||] + let path, options = mkTestFileAndOptions [||] let options = referenceReaderProject typeDefs false options parseAndCheck path source options |> ignore @@ -235,7 +228,7 @@ let ``Type defs 03 - type import`` () = let source = source2 let typeDefs = fun _ -> createPreTypeDefs [ { Name = "T"; Namespace = ["Ns1"; "Ns2"]; HasCtor = false; CancelOnImport = true } ] - let path, options = mkTestFileAndOptions source [||] + let path, options = mkTestFileAndOptions [||] let options = referenceReaderProject typeDefs false options // First request, should be cancelled inside GetTypeDef @@ -260,7 +253,7 @@ let ``Type defs 04 - ctor import`` () = let source = source1 let typeDefs = fun _ -> createPreTypeDefs [ { Name = "T"; Namespace = []; HasCtor = true; CancelOnImport = false } ] - let path, options = mkTestFileAndOptions source [||] + let path, options = mkTestFileAndOptions [||] let options = referenceReaderProject typeDefs false options // First request, should be cancelled inside ILMethodDefs @@ -282,7 +275,7 @@ let ``Module def 01 - assembly import`` () = let getPreTypeDefs typeData = fun _ -> createPreTypeDefs typeData let typeDefs = getPreTypeDefs [ { Name = "T"; Namespace = []; HasCtor = false; CancelOnImport = false } ] - let path, options = mkTestFileAndOptions source [||] + let path, options = mkTestFileAndOptions [||] let options = referenceReaderProject typeDefs true options // First request, should be cancelled inside getPreTypeDefs diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index 0e12a33fe2f..cef9b119c77 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -3,6 +3,7 @@ open System.Threading.Tasks #nowarn "57" // Experimental stuff +#nowarn "1182" //Lot of unused results are stored in a binding, since those tests are checking how internal caching works when changes are being applied let runningOnMono = try System.Type.GetType("Mono.Runtime") <> null with e -> false @@ -5460,7 +5461,7 @@ type A(i:int) = [] let ``#4030, Incremental builder creation warnings 1`` () = let source = "module M" - let fileName, options = mkTestFileAndOptions source [||] + let fileName, options = mkTestFileAndOptions [||] let _, checkResults = parseAndCheckFile fileName source options checkResults.Diagnostics |> Array.map (fun e -> e.Severity = FSharpDiagnosticSeverity.Error) |> shouldEqual [||] @@ -5468,7 +5469,7 @@ let ``#4030, Incremental builder creation warnings 1`` () = [] let ``#4030, Incremental builder creation warnings 2`` () = let source = "module M" - let fileName, options = mkTestFileAndOptions source [| "--times" |] + let fileName, options = mkTestFileAndOptions [| "--times" |] let _, checkResults = parseAndCheckFile fileName source options checkResults.Diagnostics |> Array.map (fun e -> e.Severity = FSharpDiagnosticSeverity.Error) |> shouldEqual [| false |] @@ -5476,7 +5477,7 @@ let ``#4030, Incremental builder creation warnings 2`` () = [] let ``#4030, Incremental builder creation warnings 3`` () = let source = "module M" - let fileName, options = mkTestFileAndOptions source [| "--times"; "--nowarn:75" |] + let fileName, options = mkTestFileAndOptions [| "--times"; "--nowarn:75" |] let _, checkResults = parseAndCheckFile fileName source options checkResults.Diagnostics |> Array.map (fun e -> e.Severity = FSharpDiagnosticSeverity.Error) |> shouldEqual [||] @@ -5484,7 +5485,7 @@ let ``#4030, Incremental builder creation warnings 3`` () = [] let ``#4030, Incremental builder creation warnings 4`` () = let source = "module M" - let fileName, options = mkTestFileAndOptions source [| "--times"; "--warnaserror:75" |] + let fileName, options = mkTestFileAndOptions [| "--times"; "--warnaserror:75" |] let _, checkResults = parseAndCheckFile fileName source options checkResults.Diagnostics |> Array.map (fun e -> e.Severity = FSharpDiagnosticSeverity.Error) |> shouldEqual [| true |] @@ -5492,7 +5493,7 @@ let ``#4030, Incremental builder creation warnings 4`` () = [] let ``#4030, Incremental builder creation warnings 5`` () = let source = "module M" - let fileName, options = mkTestFileAndOptions source [| "--times"; "--warnaserror-:75"; "--warnaserror" |] + let fileName, options = mkTestFileAndOptions [| "--times"; "--warnaserror-:75"; "--warnaserror" |] let _, checkResults = parseAndCheckFile fileName source options checkResults.Diagnostics |> Array.map (fun e -> e.Severity = FSharpDiagnosticSeverity.Error) |> shouldEqual [| false |] diff --git a/tests/FSharp.Compiler.Service.Tests/Symbols.fs b/tests/FSharp.Compiler.Service.Tests/Symbols.fs index 25617ca1235..181cbfe40af 100644 --- a/tests/FSharp.Compiler.Service.Tests/Symbols.fs +++ b/tests/FSharp.Compiler.Service.Tests/Symbols.fs @@ -30,7 +30,7 @@ match "foo" with """ let getCaseUsages source line = - let fileName, options = mkTestFileAndOptions source [| |] + let fileName, options = mkTestFileAndOptions [| |] let _, checkResults = parseAndCheckFile fileName source options checkResults.GetAllUsesOfAllSymbolsInFile() @@ -201,7 +201,7 @@ module Mod1 = module Mod2 = let func2 () = () """ - let fileName, options = mkTestFileAndOptions source [| |] + let fileName, options = mkTestFileAndOptions [| |] let _, checkResults = parseAndCheckFile fileName source options let mod1 = checkResults.PartialAssemblySignature.FindEntityByPath ["Ns1"; "Mod1"] |> Option.get @@ -221,7 +221,7 @@ let val1 = 1 module Mod2 = let func2 () = () """ - let fileName, options = mkTestFileAndOptions source [| |] + let fileName, options = mkTestFileAndOptions [| |] let _, checkResults = parseAndCheckFile fileName source options let mod1 = checkResults.PartialAssemblySignature.FindEntityByPath ["Mod1"] |> Option.get @@ -247,7 +247,7 @@ type FooAttribute() = [] let x = 123 """ - let fileName, options = mkTestFileAndOptions source [| "--noconditionalerasure" |] + let fileName, options = mkTestFileAndOptions [| "--noconditionalerasure" |] let _, checkResults = parseAndCheckFile fileName source options checkResults.GetAllUsesOfAllSymbolsInFile() @@ -370,7 +370,7 @@ type I<'T> = let _, checkResults = getParseAndCheckResults """ [1] |> ignore """ - let symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() + let _symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() () [] diff --git a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs index 0b30a5a61e8..cbc82c6922e 100644 --- a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs @@ -26,7 +26,7 @@ let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEn let documentSource fileName = Map.tryFind fileName files |> async.Return let projectOptions = - let _, projectOptions = mkTestFileAndOptions "" Array.empty + let _, projectOptions = mkTestFileAndOptions Array.empty { projectOptions with SourceFiles = [| "A.fsi"; "A.fs" |] } @@ -274,7 +274,7 @@ let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag = let documentSource fileName = Map.tryFind fileName files |> async.Return let projectOptions = - let _, projectOptions = mkTestFileAndOptions "" Array.empty + let _, projectOptions = mkTestFileAndOptions Array.empty { projectOptions with SourceFiles = [| "A.fs" |] } @@ -394,7 +394,6 @@ c.Abc let getCheckResults source options = let fileName, options = mkTestFileAndOptions - source options let _, checkResults = parseAndCheckFile fileName source options checkResults @@ -455,7 +454,7 @@ let exists() = System.IO.Path.Exists(null:string) let checkResults = getCheckResults source [|"--checknulls+";"--langversion:preview"|] checkResults.GetToolTip(2, 36, "let exists() = System.IO.Path.Exists(null:string)", [ "Exists" ], FSharpTokenTag.Identifier) |> assertAndExtractTooltip - |> fun (text,xml,remarks) -> + |> fun (text,xml,_remarks) -> text |> Assert.shouldBeEquivalentTo "System.IO.Path.Exists([] path: string | null) : bool" match xml with | FSharpXmlDoc.FromXmlFile (_dll,sigPath) -> sigPath |> Assert.shouldBeEquivalentTo "M:System.IO.Path.Exists(System.String)" diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 3e6bbbd282d..f5737066162 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -12,6 +12,7 @@ $(FSCoreUnitTestsPackageVersion) true preview + $(NoWarn);1182 true xunit diff --git a/tests/service/data/TestTP/TestTP.fs b/tests/service/data/TestTP/TestTP.fs index 4e7bf9dd092..062e1b8510d 100644 --- a/tests/service/data/TestTP/TestTP.fs +++ b/tests/service/data/TestTP/TestTP.fs @@ -5,6 +5,8 @@ open Microsoft.FSharp.Core.CompilerServices open System.Reflection open FSharp.Quotations +#nowarn "1182" // Lot of unused "args","x","y","c" around this test file + module Helper = let doNothing() = () let doNothingOneArg(x:int) = () diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 68cc5c4de2e..21305e52a5d 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -4,7 +4,7 @@ Library - $(NoWarn);47;75 + $(NoWarn);47;75;1182 true $(OtherFlags) --subsystemversion:6.00 false diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index edf4b8a41e5..ae81965ef4c 100644 --- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -5,7 +5,7 @@ net472 true - $(OtherFlags) --nowarn:3390 --nowarn:3218 + $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182 diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 353e08336a6..4e556083776 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -4,7 +4,7 @@ Library - $(NoWarn);44;45;47;52;58;75 + $(NoWarn);44;45;47;52;58;75;1182 true true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 2a764378864..4020cfd750d 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -6,7 +6,7 @@ net472 x86 Library - $(NoWarn);44;58;75;3005 + $(NoWarn);44;58;75;3005;1182 true true true From c01bc471ec95865b71b4a7f535bd6e2884e094f7 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 31 Mar 2025 09:51:31 +0100 Subject: [PATCH 041/134] Use a more accurate range for CE Combine methods (#18394) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../CheckComputationExpressions.fs | 11 +- .../Language/ComputationExpressionTests.fs | 532 ++++++++++++++++++ .../E_MissingCombine.fs | 2 +- 4 files changed, 543 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index c4e4a6a1403..f40ab0428ed 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -29,6 +29,7 @@ * Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290)) * Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323)) * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) +* Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394) ### Changed diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 52cb3c0d61a..fc804ab5e34 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -1612,6 +1612,12 @@ let rec TryTranslateComputationExpression // "cexpr; cexpr" is treated as builder.Combine(cexpr1, cexpr1) let m1 = rangeForCombine innerComp1 + let combineDelayRange = + match innerComp2 with + | SynExpr.YieldOrReturn(trivia = yieldOrReturn) -> yieldOrReturn.YieldOrReturnKeyword + | SynExpr.YieldOrReturnFrom(trivia = yieldOrReturnFrom) -> yieldOrReturnFrom.YieldOrReturnFromKeyword + | expr -> expr.Range + if isNil ( TryFindIntrinsicOrExtensionMethInfo @@ -1624,7 +1630,8 @@ let rec TryTranslateComputationExpression ceenv.builderTy ) then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Combine"), m)) + + error (Error(FSComp.SR.tcRequireBuilderMethod "Combine", combineDelayRange)) if isNil ( @@ -1638,7 +1645,7 @@ let rec TryTranslateComputationExpression ceenv.builderTy ) then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Delay"), m)) + error (Error(FSComp.SR.tcRequireBuilderMethod "Delay", combineDelayRange)) let combineCall = mkSynCall diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 3555e97fd2d..55d49dbebc7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -605,6 +605,538 @@ let run r2 r3 = (Error 708, Line 24, Col 19, Line 24, Col 26, "This control construct may only be used if the computation expression builder defines a 'ReturnFrom' method") ] + [] + let ``This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + +let result = ResultBuilder() + +let run r2 r3 = + result { + let! r2 = r2 + let! r3 = r3 + if r2 = Ok 1 then + do! r2 + return r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 27, Col 9, Line 27, Col 15, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence2 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + for i in [ 1] do + do! r2 + return r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 32, Col 9, Line 32, Col 15, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 5 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + for i in [ 1] do + do! r2 + return! r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 32, Col 9, Line 32, Col 16, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 7 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + match r2 with + | 0 -> do! r2 + | _ -> do! r2 + return! r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 33, Col 9, Line 33, Col 16, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 8 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + match! r2 with + | 0 -> do! r2 + | _ -> do! r2 + return! r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 33, Col 9, Line 33, Col 16, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 9 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + match! r2 with + | 0 -> do! r2 + | _ -> do! r2 + return r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 33, Col 9, Line 33, Col 15, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence3 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.Yield(x: 'T) = Ok x + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + for i in [ 1] do + yield r2 + return r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 34, Col 9, Line 34, Col 15, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 4 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.Yield(x: 'T) = Ok x + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + for i in [ 1] do + yield r2 + yield r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 34, Col 9, Line 34, Col 14, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + [] + let ``Sequence 6 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Result = + let zip x1 x2 = + match x1,x2 with + | Ok x1res, Ok x2res -> Ok (x1res, x2res) + | Error e, _ -> Error e + | _, Error e -> Error e + +type ResultBuilder() = + member _.MergeSources(t1: Result<'T,'U>, t2: Result<'T1,'U>) = Result.zip t1 t2 + member _.BindReturn(x: Result<'T,'U>, f) = Result.map f x + member _.Bind(x: Result<'T,'U>, f) = + match x with + | Ok x -> f x + | Error e -> Error e + + member _.Zero() = Ok () + + member _.Yield(x: 'T) = Ok x + + member _.YieldFrom(x: Result<'T,'U>) = x + + member _.For(sequence: #seq<'T>, binder: 'T -> Result<_, _>) = + sequence + |> Seq.map binder + |> Seq.fold (fun acc x -> Result.bind (fun () -> x) acc) (Ok ()) + +let result = ResultBuilder() + +let run (r2: Result) (r3: Result) = + result { + let! r2 = r2 + let! r3 = r3 + for i in [ 1] do + yield! r2 + yield! r3 + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 36, Col 9, Line 36, Col 15, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 10 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Test = + type R = S of string + + type T() = + member x.Bind(p: R, rest: (string -> R)) = + match p with + | S(s) -> rest s + member x.Zero() = S("l") + member x.For(s : seq, rest: (int -> unit)) = S("") + + let t = new T() + + let t' = t { + let a = 10 + for x in [1] do () + 0 |> ignore + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 17, Col 7, Line 17, Col 18, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 11 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Test = + type R = S of string + + type T() = + member x.Bind(p: R, rest: string -> R) = + match p with + | S(s) -> rest s + member x.Zero() = S("l") + member x.For(s: seq, rest: (int -> R)) = + let folder state item = + match state with + | S(str) -> + match rest item with + | S(itemStr) -> S(str + itemStr) + Seq.fold folder (S("")) s + + let t = new T() + + let t' = t { + let a = 10 + for x in [1] do + () + for x in [1] do + () + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 24, Col 7, Line 25, Col 13, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 12 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Test = + type R = S of string + + type T() = + member x.Bind(p: R, rest: string -> R) = + match p with + | S(s) -> rest s + member x.Zero() = S("l") + member x.Yield(value: 'a) = S(string value) + member x.For(s: seq, rest: (int -> R)) = + let folder state item = + match state with + | S(str) -> + match rest item with + | S(itemStr) -> S(str + itemStr) + Seq.fold folder (S("")) s + + let t = new T() + + let t' = t { + let a = 10 + for x in [1] -> + () + for x in [1] -> + () + } + + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 25, Col 7, Line 26, Col 13, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] + let ``Sequence 13 This control construct may only be used if the computation expression builder defines a 'Combine' method`` () = + Fsx """ +module Test = + type R = S of string + + type T() = + member x.Bind(p: R, rest: string -> R) = + match p with + | S(s) -> rest s + member x.Zero() = S("l") + member x.For(s: seq, rest: (int -> R)) = + let folder state item = + match state with + | S(str) -> + match rest item with + | S(itemStr) -> S(str + itemStr) + Seq.fold folder (S("")) s + + let t = new T() + + let t' = t { + let a = 10 + for x in [1] do () + if true then + () + else + () + } + """ + |> ignoreWarnings + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 708, Line 23, Col 7, Line 26, Col 13, "This control construct may only be used if the computation expression builder defines a 'Combine' method") + ] + + [] let ``Type constraint mismatch when using return!`` () = Fsx """ diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/E_MissingCombine.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/E_MissingCombine.fs index 5a8e82d4074..b06d74f93e9 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/E_MissingCombine.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ComputationExpressions/E_MissingCombine.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #ComputationExpressions // Regression test for FSHARP1.0:6149 -//This control construct may only be used if the computation expression builder defines a 'Combine' method$ +//This control construct may only be used if the computation expression builder defines a 'Combine' method$ type R = S of string From 1595946abbb814148b4a9d52e9546df3e80c966e Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 31 Mar 2025 15:21:09 +0200 Subject: [PATCH 042/134] Make unused bindings an error (#18421) --- FSharpBuild.Directory.Build.props | 2 +- buildtools/fslex/fslex.fsproj | 3 ++- buildtools/fsyacc/fsyacc.fsproj | 3 ++- tests/FSharp.Compiler.Service.Tests/EditorTests.fs | 2 ++ .../FSharp.Compiler.Service.Tests.fsproj | 1 + .../MultiProjectAnalysisTests.fs | 2 ++ tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj | 2 +- vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 2 +- vsintegration/src/FSharp.VS.FSI/sessions.fs | 6 +++--- .../DummyProviderForLanguageServiceTesting.fsproj | 2 +- vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 1 + vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 12 files changed, 18 insertions(+), 9 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 1b7ecd6fa27..33772456e28 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -28,7 +28,7 @@ $(ArtifactsDir)\Bootstrap 4.4.0 $(WarnOn);1182 - 0025;$(WarningsAsErrors) + 1182;0025;$(WarningsAsErrors) $(OtherFlags) --nowarn:3384 $(OtherFlags) --times --nowarn:75 $(OtherFlags) $(AdditionalFscCmdFlags) diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index b450de1668d..684fecb11da 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -5,7 +5,8 @@ $(FSharpNetCoreProductTargetFramework) true LatestMajor - $(NoWarn);64;1182;1204 + $(NoWarn);64;1204;1182 + $(OtherFlags) --warnaserror-:1182 diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index 5f97b762e03..38280006de3 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -5,7 +5,8 @@ $(FSharpNetCoreProductTargetFramework) true LatestMajor - $(NoWarn);64;1182;1204 + $(NoWarn);64;1204;1182 + $(OtherFlags) --warnaserror-:1182 diff --git a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs index bc6ad3d3e88..6ac0789cd9c 100644 --- a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs @@ -9,6 +9,8 @@ open FSharp.Compiler.Symbols open FSharp.Compiler.Text open FSharp.Compiler.Tokenization +#nowarn "1182" // Unused bindings when ignored parsed results etc. + let stringMethods = [ "Chars"; "Clone"; "CompareTo"; "Contains"; "CopyTo"; "EndsWith"; diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 16e9df837ee..1cf8d9c720b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -6,6 +6,7 @@ $(FSharpNetCoreProductTargetFramework) true $(NoWarn);1182 + $(OtherFlags) --warnaserror-:1182 true xunit diff --git a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs index ee6b23794b1..b553d676cb3 100644 --- a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs @@ -13,6 +13,8 @@ open FSharp.Compiler.Text open FSharp.Compiler.Service.Tests.Common open TestFramework +#nowarn "1182" // Unused bindings when ignored parsed results etc. + let toIList (x: _ array) = x :> IList<_> let numProjectsForStressTest = 100 let internal checker = FSharpChecker.Create(projectCacheSize=numProjectsForStressTest + 10, useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index f5737066162..d4dbfdd4348 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -13,7 +13,7 @@ true preview $(NoWarn);1182 - + $(OtherFlags) --warnaserror-:1182 true xunit true diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 21305e52a5d..cc40ac675c7 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -6,7 +6,7 @@ Library $(NoWarn);47;75;1182 true - $(OtherFlags) --subsystemversion:6.00 + $(OtherFlags) --subsystemversion:6.00 --warnaserror-:1182 false diff --git a/vsintegration/src/FSharp.VS.FSI/sessions.fs b/vsintegration/src/FSharp.VS.FSI/sessions.fs index d46e963015e..ca2c980f553 100644 --- a/vsintegration/src/FSharp.VS.FSI/sessions.fs +++ b/vsintegration/src/FSharp.VS.FSI/sessions.fs @@ -41,7 +41,7 @@ type internal EventWrapper() = /// Run function application return Some (f x) or None if execution exceeds timeout (in ms). /// Exceptions raised by f x are caught and reported in DEBUG mode. -let timeoutApp descr timeoutMS (f : 'a -> 'b) (arg:'a) = +let timeoutApp _descr timeoutMS (f : 'a -> 'b) (arg:'a) = use ev = new EventWrapper() let mutable r = None ThreadPool.QueueUserWorkItem(fun _ -> @@ -57,7 +57,7 @@ let timeoutApp descr timeoutMS (f : 'a -> 'b) (arg:'a) = "fsi.exe starts the remoting server at the end of it's initialisation sequence.\n" + "The initialisation sequence takes an observable time (e.g. 2 seconds).\n" + "Remoting exceptions are to be expected on interrupt/intellisense calls made before that point.\n" + - "Context: " + descr + "\n" + + "Context: " + _descr + "\n" + "Exception: " + e.ToString()) |> ignore #endif None @@ -285,7 +285,7 @@ let fsiStartInfo channelName sourceFile = procInfo -let nonNull = function null -> false | (s:string) -> true +let nonNull = function null -> false | (_:string) -> true /// Represents an active F# Interactive process to which Visual Studio is connected via stdin/stdout/stderr and a remoting channel type FsiSession(sourceFile) = diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index ae81965ef4c..faca7cb840b 100644 --- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -5,7 +5,7 @@ net472 true - $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182 + $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182 --warnaserror-:1182 diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 4e556083776..7f24444a6e5 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -5,6 +5,7 @@ Library $(NoWarn);44;45;47;52;58;75;1182 + $(OtherFlags) --warnaserror-:1182 true true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 4020cfd750d..77c7d12e017 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -7,6 +7,7 @@ x86 Library $(NoWarn);44;58;75;3005;1182 + $(OtherFlags) --warnaserror-:1182 true true true From dc01094ebe2c04a7f466b5ac74c63dd6d9df2eb0 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 31 Mar 2025 11:37:51 -0400 Subject: [PATCH 043/134] =?UTF-8?q?Reenable=20=CE=B2-reduction=20of=20imme?= =?UTF-8?q?diately-invoked=20F#-defined=20generic=20delegates=20(#18401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Optimize/Optimizer.fs | 14 +- src/Compiler/TypedTree/TypedTreeOps.fs | 12 +- src/Compiler/TypedTree/TypedTreeOps.fsi | 6 +- .../ComputationExpressions.fs | 13 + .../CustomCollectionBuilderComputationExpr.fs | 14 + ...nBuilderComputationExpr.fs.Optimize.il.bsl | 228 +++++++ ...ilderComputationExpr.fs.OptimizeOff.il.bsl | 593 ++++++++++++++++++ ...CollectionBuilderComputationExprLibrary.fs | 59 ++ .../Inlining/FSharpDelegateBetaReduction.fs | 25 + ...n.fs.RealInternalSignature.Optimize.il.bsl | 247 ++++++++ ...s.RealInternalSignature.OptimizeOff.il.bsl | 277 ++++++++ .../EmittedIL/Inlining/Inlining.fs | 11 + tests/FSharp.Test.Utilities/ILChecker.fs | 3 +- 14 files changed, 1487 insertions(+), 16 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.Optimize.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.OptimizeOff.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExprLibrary.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.Optimize.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.OptimizeOff.il.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index f40ab0428ed..86672567838 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -20,6 +20,7 @@ * Fix duplicate parse error reporting for GetBackgroundCheckResultsForFileInProject ([Issue #18379](https://github.com/dotnet/fsharp/issues/18379) [PR #18380](https://github.com/dotnet/fsharp/pull/18380)) * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) * Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) +* Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 69fb9b45974..2840331f54b 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -1734,9 +1734,9 @@ let TryEliminateBinding cenv _env bind e2 _m = // Immediate consumption of delegate via an application in a sequential, e.g. 'let part1 = e in part1.Invoke(args); rest' // See https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1034-lambda-optimizations.md - | Expr.Sequential(DebugPoints(DelegateInvokeExpr g (delInvokeRef, delInvokeTy, DebugPoints (Expr.Val (VRefLocal vspec2, _, _), recreate2), delInvokeArg, _), recreate1), rest, NormalSeq, m) + | Expr.Sequential(DebugPoints(DelegateInvokeExpr g (delInvokeRef, delInvokeTy, tyargs, DebugPoints (Expr.Val (VRefLocal vspec2, _, _), recreate2), delInvokeArg, _), recreate1), rest, NormalSeq, m) when IsUniqueUse vspec2 [rest;delInvokeArg] -> - let invoke = MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, recreate2 e1, delInvokeTy, delInvokeArg, m) + let invoke = MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, recreate2 e1, delInvokeTy, tyargs, delInvokeArg, m) Some (Expr.Sequential(recreate1 invoke, rest, NormalSeq, m) |> recreate0) // Immediate consumption of value by a pattern match 'let x = e in match x with ...' @@ -2397,8 +2397,8 @@ let rec OptimizeExpr cenv (env: IncrementalOptimizationEnv) expr = | Expr.App (f, fty, tyargs, argsl, m) -> match expr with - | DelegateInvokeExpr g (delInvokeRef, delInvokeTy, delExpr, delInvokeArg, m) -> - OptimizeFSharpDelegateInvoke cenv env (delInvokeRef, delExpr, delInvokeTy, delInvokeArg, m) + | DelegateInvokeExpr g (delInvokeRef, delInvokeTy, tyargs, delExpr, delInvokeArg, m) -> + OptimizeFSharpDelegateInvoke cenv env (delInvokeRef, delExpr, delInvokeTy, tyargs, delInvokeArg, m) | _ -> let attempt = if IsDebugPipeRightExpr cenv expr then @@ -3799,18 +3799,18 @@ and OptimizeDebugPipeRights cenv env expr = pipesExprR expr, { pipesInfo with HasEffect=true} -and OptimizeFSharpDelegateInvoke cenv env (delInvokeRef, delExpr, delInvokeTy, delInvokeArg, m) = +and OptimizeFSharpDelegateInvoke cenv env (delInvokeRef, delExpr, delInvokeTy, tyargs, delInvokeArg, m) = let g = cenv.g let optf0, finfo = OptimizeExpr cenv env delExpr - match StripPreComputationsFromComputedFunction g optf0 [delInvokeArg] (fun f delInvokeArgsR -> MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, f, delInvokeTy, List.head delInvokeArgsR, m)) with + match StripPreComputationsFromComputedFunction g optf0 [delInvokeArg] (fun f delInvokeArgsR -> MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, f, delInvokeTy, tyargs, List.head delInvokeArgsR, m)) with | Choice1Of2 remade -> OptimizeExpr cenv env remade | Choice2Of2 (newf0, remake) -> let newDelInvokeArgs, arginfos = OptimizeExprsThenConsiderSplits cenv env [delInvokeArg] let newDelInvokeArg = List.head newDelInvokeArgs - let reducedExpr = MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, newf0, delInvokeTy, newDelInvokeArg, m) + let reducedExpr = MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, newf0, delInvokeTy, tyargs, newDelInvokeArg, m) let newExpr = reducedExpr |> remake match newf0, reducedExpr with | Expr.Obj _, Expr.Let _ -> diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 21c9783713e..4b41db72349 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -8465,9 +8465,9 @@ let (|NewDelegateExpr|_|) g expr = [] let (|DelegateInvokeExpr|_|) g expr = match expr with - | Expr.App ((Expr.Val (invokeRef, _, _)) as delInvokeRef, delInvokeTy, [], [delExpr;delInvokeArg], m) + | Expr.App ((Expr.Val (invokeRef, _, _)) as delInvokeRef, delInvokeTy, tyargs, [delExpr;delInvokeArg], m) when invokeRef.LogicalName = "Invoke" && isFSharpDelegateTy g (tyOfExpr g delExpr) -> - ValueSome(delInvokeRef, delInvokeTy, delExpr, delInvokeArg, m) + ValueSome(delInvokeRef, delInvokeTy, tyargs, delExpr, delInvokeArg, m) | _ -> ValueNone [] @@ -8494,17 +8494,17 @@ let (|OpPipeRight3|_|) g expr = ValueSome(resType, arg1, arg2, arg3, fExpr, m) | _ -> ValueNone -let rec MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, delExpr, delInvokeTy, delInvokeArg, m) = +let rec MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, delExpr, delInvokeTy, tyargs, delInvokeArg, m) = match delExpr with | Expr.Let (bind, body, mLet, _) -> - mkLetBind mLet bind (MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, body, delInvokeTy, delInvokeArg, m)) - | NewDelegateExpr g (_, argvs, body, m, _) when argvs.Length > 0 -> + mkLetBind mLet bind (MakeFSharpDelegateInvokeAndTryBetaReduce g (delInvokeRef, body, delInvokeTy, tyargs, delInvokeArg, m)) + | NewDelegateExpr g (_, argvs & _ :: _, body, m, _) -> let pairs, body = MultiLambdaToTupledLambdaIfNeeded g (argvs, delInvokeArg) body let argvs2, args2 = List.unzip pairs mkLetsBind m (mkCompGenBinds argvs2 args2) body | _ -> // Remake the delegate invoke - Expr.App (delInvokeRef, delInvokeTy, [], [delExpr; delInvokeArg], m) + Expr.App (delInvokeRef, delInvokeTy, tyargs, [delExpr; delInvokeArg], m) //--------------------------------------------------------------------------- // Adjust for expected usage diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index c67ccb30800..06200be47f7 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -1438,7 +1438,9 @@ val MakeApplicationAndBetaReduce: TcGlobals -> Expr * TType * TypeInst list * Ex /// Make a delegate invoke expression for an F# delegate type, doing beta reduction by introducing let-bindings /// if the delegate expression is a construction of a delegate. val MakeFSharpDelegateInvokeAndTryBetaReduce: - TcGlobals -> delInvokeRef: Expr * delExpr: Expr * delInvokeTy: TType * delInvokeArg: Expr * m: range -> Expr + TcGlobals -> + delInvokeRef: Expr * delExpr: Expr * delInvokeTy: TType * tyargs: TypeInst * delInvokeArg: Expr * m: range -> + Expr /// Combine two static-resolution requirements on a type parameter val JoinTyparStaticReq: TyparStaticReq -> TyparStaticReq -> TyparStaticReq @@ -2751,7 +2753,7 @@ val (|NewDelegateExpr|_|): TcGlobals -> Expr -> (Unique * Val list * Expr * rang /// Match a .Invoke on a delegate [] -val (|DelegateInvokeExpr|_|): TcGlobals -> Expr -> (Expr * TType * Expr * Expr * range) voption +val (|DelegateInvokeExpr|_|): TcGlobals -> Expr -> (Expr * TType * TypeInst * Expr * Expr * range) voption /// Match 'if __useResumableCode then ... else ...' expressions [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs index b6520a2f363..3fe71d27ac6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs @@ -73,3 +73,16 @@ module ComputationExpressions = compilation |> getCompilation |> verifyCompilation + + [] + let ``CustomCollectionBuilderComputationExpr_fs_OptimizeOff`` compilation = + compilation + |> getCompilation + |> asExe + |> withReferences [ + FsFromPath (Path.Combine (__SOURCE_DIRECTORY__, "CustomCollectionBuilderComputationExprLibrary.fs")) + |> withName "CustomCollectionBuilderComputationExprLibrary" + ] + |> withEmbeddedPdb + |> withEmbedAllSource + |> verifyILBaseline diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs new file mode 100644 index 00000000000..fd0522f6538 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs @@ -0,0 +1,14 @@ +module ComputationExpressions.Program + +let f0 () = + let xs = ResizeArray () + xs.Add 1 + xs.Add 2 + xs.Add 3 + xs + +let xs = f0 () + +let f1 () = resizeArray { 1; 2; 3 } +let f2 () = resizeArray { yield! xs } +let f3 () = resizeArray { for x in xs -> x * x } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.Optimize.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.Optimize.il.bsl new file mode 100644 index 00000000000..706081806c7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.Optimize.il.bsl @@ -0,0 +1,228 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern assemblyLibrary +{ + .ver 0:0:0:0 +} +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed ComputationExpressions.Program + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .field static assembly class [runtime]System.Collections.Generic.List`1 xs@10 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static class [runtime]System.Collections.Generic.List`1 f0() cil managed + { + + .maxstack 4 + .locals init (class [runtime]System.Collections.Generic.List`1 V_0) + IL_0000: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldloc.0 + IL_000e: ldc.i4.2 + IL_000f: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0014: ldloc.0 + IL_0015: ldc.i4.3 + IL_0016: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_001b: ldloc.0 + IL_001c: ret + } + + .method public specialname static class [runtime]System.Collections.Generic.List`1 get_xs() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::xs@10 + IL_0005: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f1() cil managed + { + + .maxstack 4 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [runtime]System.Collections.Generic.List`1 V_1, + class [runtime]System.Collections.Generic.List`1& V_2) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1::get_Instance() + IL_0005: stloc.0 + IL_0006: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_000b: stloc.1 + IL_000c: ldloca.s V_1 + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0015: ldc.i4.1 + IL_0016: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_001b: ldloca.s V_1 + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0024: ldc.i4.2 + IL_0025: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_002a: ldloca.s V_1 + IL_002c: stloc.2 + IL_002d: ldloc.2 + IL_002e: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0033: ldc.i4.3 + IL_0034: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0039: ldloc.1 + IL_003a: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f2() cil managed + { + + .maxstack 4 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [runtime]System.Collections.Generic.List`1 V_1, + class [runtime]System.Collections.Generic.List`1& V_2) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1::get_Instance() + IL_0005: stloc.0 + IL_0006: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_000b: stloc.1 + IL_000c: ldloca.s V_1 + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0015: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + IL_001a: callvirt instance void class [runtime]System.Collections.Generic.List`1::AddRange(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_001f: ldloc.1 + IL_0020: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f3() cil managed + { + + .maxstack 5 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [runtime]System.Collections.Generic.List`1 V_1, + int32 V_2, + int32 V_3, + int32 V_4, + int32 V_5, + class [runtime]System.Collections.Generic.List`1& V_6) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1::get_Instance() + IL_0005: stloc.0 + IL_0006: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_000b: stloc.1 + IL_000c: ldc.i4.0 + IL_000d: stloc.3 + IL_000e: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + IL_0013: callvirt instance int32 class [runtime]System.Collections.Generic.List`1::get_Count() + IL_0018: ldc.i4.1 + IL_0019: sub + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldloc.3 + IL_001d: blt.s IL_004f + + IL_001f: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + IL_0024: ldloc.3 + IL_0025: callvirt instance !0 class [runtime]System.Collections.Generic.List`1::get_Item(int32) + IL_002a: stloc.s V_4 + IL_002c: ldloc.s V_4 + IL_002e: ldloc.s V_4 + IL_0030: mul + IL_0031: stloc.s V_5 + IL_0033: ldloca.s V_1 + IL_0035: stloc.s V_6 + IL_0037: ldloc.s V_6 + IL_0039: ldobj class [runtime]System.Collections.Generic.List`1 + IL_003e: ldloc.s V_5 + IL_0040: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0045: ldloc.3 + IL_0046: ldc.i4.1 + IL_0047: add + IL_0048: stloc.3 + IL_0049: ldloc.3 + IL_004a: ldloc.2 + IL_004b: ldc.i4.1 + IL_004c: add + IL_004d: bne.un.s IL_001f + + IL_004f: ldloc.1 + IL_0050: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 '.$ComputationExpressions'.Program::init@ + IL_0006: ldsfld int32 '.$ComputationExpressions'.Program::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::f0() + IL_0005: stsfld class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::xs@10 + IL_000a: ret + } + + .property class [runtime]System.Collections.Generic.List`1 + xs() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + } +} + +.class private abstract auto ansi sealed '.$ComputationExpressions'.Program + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void ComputationExpressions.Program::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.OptimizeOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.OptimizeOff.il.bsl new file mode 100644 index 00000000000..cd7c9b8430b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExpr.fs.OptimizeOff.il.bsl @@ -0,0 +1,593 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern assemblyLibrary +{ + .ver 0:0:0:0 +} +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed ComputationExpressions.Program + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto autochar serializable sealed nested assembly beforefieldinit specialname 'f1@12-1' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public int32 x + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 ComputationExpressions.Program/'f1@12-1'::x + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0006: ldarg.0 + IL_0007: ldfld int32 ComputationExpressions.Program/'f1@12-1'::x + IL_000c: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0011: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname 'f1@12-3' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public int32 x + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(int32 x) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld int32 ComputationExpressions.Program/'f1@12-3'::x + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0006: ldarg.0 + IL_0007: ldfld int32 ComputationExpressions.Program/'f1@12-3'::x + IL_000c: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0011: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname 'f1@12-4' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-4'::builder@ + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 6 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_0, + int32 V_1, + class [runtime]System.Collections.Generic.List`1& V_2) + IL_0000: ldarg.0 + IL_0001: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-4'::builder@ + IL_0006: stloc.0 + IL_0007: ldc.i4.3 + IL_0008: stloc.1 + IL_0009: ldarg.1 + IL_000a: stloc.2 + IL_000b: ldloc.2 + IL_000c: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0011: ldloc.1 + IL_0012: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0017: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname 'f1@12-2' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-2'::builder@ + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 6 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_0, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_1, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_2, + int32 V_3, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_4, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_5, + class [runtime]System.Collections.Generic.List`1& V_6) + IL_0000: ldarg.0 + IL_0001: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-2'::builder@ + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-2'::builder@ + IL_000d: stloc.2 + IL_000e: ldc.i4.2 + IL_000f: stloc.3 + IL_0010: ldloc.3 + IL_0011: newobj instance void ComputationExpressions.Program/'f1@12-3'::.ctor(int32) + IL_0016: ldftn instance void ComputationExpressions.Program/'f1@12-3'::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_001c: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_0021: stloc.1 + IL_0022: ldarg.0 + IL_0023: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-2'::builder@ + IL_0028: stloc.s V_5 + IL_002a: ldarg.0 + IL_002b: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/'f1@12-2'::builder@ + IL_0030: newobj instance void ComputationExpressions.Program/'f1@12-4'::.ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1) + IL_0035: ldftn instance void ComputationExpressions.Program/'f1@12-4'::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_003b: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_0040: stloc.s V_4 + IL_0042: ldarg.1 + IL_0043: stloc.s V_6 + IL_0045: ldloc.1 + IL_0046: ldloc.s V_6 + IL_0048: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_004d: nop + IL_004e: ldloc.s V_4 + IL_0050: ldloc.s V_6 + IL_0052: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_0057: nop + IL_0058: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname f1@12 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f1@12::builder@ + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 6 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_0, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_1, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_2, + int32 V_3, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_4, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_5, + class [runtime]System.Collections.Generic.List`1& V_6) + IL_0000: ldarg.0 + IL_0001: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f1@12::builder@ + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f1@12::builder@ + IL_000d: stloc.2 + IL_000e: ldc.i4.1 + IL_000f: stloc.3 + IL_0010: ldloc.3 + IL_0011: newobj instance void ComputationExpressions.Program/'f1@12-1'::.ctor(int32) + IL_0016: ldftn instance void ComputationExpressions.Program/'f1@12-1'::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_001c: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_0021: stloc.1 + IL_0022: ldarg.0 + IL_0023: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f1@12::builder@ + IL_0028: stloc.s V_5 + IL_002a: ldarg.0 + IL_002b: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f1@12::builder@ + IL_0030: newobj instance void ComputationExpressions.Program/'f1@12-2'::.ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1) + IL_0035: ldftn instance void ComputationExpressions.Program/'f1@12-2'::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_003b: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_0040: stloc.s V_4 + IL_0042: ldarg.1 + IL_0043: stloc.s V_6 + IL_0045: ldloc.1 + IL_0046: ldloc.s V_6 + IL_0048: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_004d: nop + IL_004e: ldloc.s V_4 + IL_0050: ldloc.s V_6 + IL_0052: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_0057: nop + IL_0058: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname f2@13 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f2@13::builder@ + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 6 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_0, + class [runtime]System.Collections.Generic.List`1 V_1, + class [runtime]System.Collections.Generic.List`1& V_2) + IL_0000: ldarg.0 + IL_0001: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f2@13::builder@ + IL_0006: stloc.0 + IL_0007: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + IL_000c: stloc.1 + IL_000d: ldarg.1 + IL_000e: stloc.2 + IL_000f: ldloc.2 + IL_0010: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0015: ldloc.1 + IL_0016: callvirt instance void class [runtime]System.Collections.Generic.List`1::AddRange(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_001b: ret + } + + } + + .class auto autochar serializable sealed nested assembly beforefieldinit specialname f3@14 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .field public class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname instance void .ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 builder@) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: stfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f3@14::builder@ + IL_0007: ldarg.0 + IL_0008: call instance void [runtime]System.Object::.ctor() + IL_000d: ret + } + + .method assembly hidebysig instance void Invoke(class [runtime]System.Collections.Generic.List`1& sm) cil managed + { + + .maxstack 7 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_0, + class [runtime]System.Collections.Generic.List`1 V_1, + class [runtime]System.Collections.Generic.List`1& V_2, + int32 V_3, + int32 V_4, + int32 V_5, + int32 V_6, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_7, + int32 V_8, + class [runtime]System.Collections.Generic.List`1& V_9) + IL_0000: ldarg.0 + IL_0001: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f3@14::builder@ + IL_0006: stloc.0 + IL_0007: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + IL_000c: stloc.1 + IL_000d: ldarg.1 + IL_000e: stloc.2 + IL_000f: ldc.i4.0 + IL_0010: stloc.s V_4 + IL_0012: ldloc.1 + IL_0013: callvirt instance int32 class [runtime]System.Collections.Generic.List`1::get_Count() + IL_0018: ldc.i4.1 + IL_0019: sub + IL_001a: stloc.3 + IL_001b: ldloc.3 + IL_001c: ldloc.s V_4 + IL_001e: blt.s IL_005b + + IL_0020: ldloc.1 + IL_0021: ldloc.s V_4 + IL_0023: callvirt instance !0 class [runtime]System.Collections.Generic.List`1::get_Item(int32) + IL_0028: stloc.s V_5 + IL_002a: ldloc.s V_5 + IL_002c: stloc.s V_6 + IL_002e: ldarg.0 + IL_002f: ldfld class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 ComputationExpressions.Program/f3@14::builder@ + IL_0034: stloc.s V_7 + IL_0036: ldloc.s V_6 + IL_0038: ldloc.s V_6 + IL_003a: mul + IL_003b: stloc.s V_8 + IL_003d: ldloc.2 + IL_003e: stloc.s V_9 + IL_0040: ldloc.s V_9 + IL_0042: ldobj class [runtime]System.Collections.Generic.List`1 + IL_0047: ldloc.s V_8 + IL_0049: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_004e: ldloc.s V_4 + IL_0050: ldc.i4.1 + IL_0051: add + IL_0052: stloc.s V_4 + IL_0054: ldloc.s V_4 + IL_0056: ldloc.3 + IL_0057: ldc.i4.1 + IL_0058: add + IL_0059: bne.un.s IL_0020 + + IL_005b: ret + } + + } + + .field static assembly class [runtime]System.Collections.Generic.List`1 xs@10 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static class [runtime]System.Collections.Generic.List`1 f0() cil managed + { + + .maxstack 4 + .locals init (class [runtime]System.Collections.Generic.List`1 V_0) + IL_0000: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldloc.0 + IL_000e: ldc.i4.2 + IL_000f: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_0014: ldloc.0 + IL_0015: ldc.i4.3 + IL_0016: callvirt instance void class [runtime]System.Collections.Generic.List`1::Add(!0) + IL_001b: ldloc.0 + IL_001c: ret + } + + .method public specialname static class [runtime]System.Collections.Generic.List`1 get_xs() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::xs@10 + IL_0005: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f1() cil managed + { + + .maxstack 4 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_1, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_2, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_3, + class [runtime]System.Collections.Generic.List`1 V_4) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 [assemblyLibrary]ComputationExpressions.Library::resizeArray() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.1 + IL_0008: ldloc.0 + IL_0009: stloc.3 + IL_000a: ldloc.0 + IL_000b: newobj instance void ComputationExpressions.Program/f1@12::.ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1) + IL_0010: ldftn instance void ComputationExpressions.Program/f1@12::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_0016: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_001b: stloc.2 + IL_001c: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0021: stloc.s V_4 + IL_0023: ldloc.2 + IL_0024: ldloca.s V_4 + IL_0026: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f2() cil managed + { + + .maxstack 4 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_1, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_2, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_3, + class [runtime]System.Collections.Generic.List`1 V_4) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 [assemblyLibrary]ComputationExpressions.Library::resizeArray() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.1 + IL_0008: ldloc.0 + IL_0009: stloc.3 + IL_000a: ldloc.0 + IL_000b: newobj instance void ComputationExpressions.Program/f2@13::.ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1) + IL_0010: ldftn instance void ComputationExpressions.Program/f2@13::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_0016: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_001b: stloc.2 + IL_001c: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0021: stloc.s V_4 + IL_0023: ldloc.2 + IL_0024: ldloca.s V_4 + IL_0026: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ret + } + + .method public static class [runtime]System.Collections.Generic.List`1 f3() cil managed + { + + .maxstack 4 + .locals init (class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_0, + class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 V_1, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1> V_2, + class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilder V_3, + class [runtime]System.Collections.Generic.List`1 V_4) + IL_0000: call class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1 [assemblyLibrary]ComputationExpressions.Library::resizeArray() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stloc.1 + IL_0008: ldloc.0 + IL_0009: stloc.3 + IL_000a: ldloc.0 + IL_000b: newobj instance void ComputationExpressions.Program/f3@14::.ctor(class [assemblyLibrary]ComputationExpressions.Library/ResizeArrayBuilder`1) + IL_0010: ldftn instance void ComputationExpressions.Program/f3@14::Invoke(class [runtime]System.Collections.Generic.List`1&) + IL_0016: newobj instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::.ctor(object, + native int) + IL_001b: stloc.2 + IL_001c: newobj instance void class [runtime]System.Collections.Generic.List`1::.ctor() + IL_0021: stloc.s V_4 + IL_0023: ldloc.2 + IL_0024: ldloca.s V_4 + IL_0026: callvirt instance void class [assemblyLibrary]ComputationExpressions.Library/CollectionBuilderCode`1>::Invoke(!0&) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 '.$ComputationExpressions'.Program::init@ + IL_0006: ldsfld int32 '.$ComputationExpressions'.Program::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::f0() + IL_0005: stsfld class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::xs@10 + IL_000a: ret + } + + .property class [runtime]System.Collections.Generic.List`1 + xs() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [runtime]System.Collections.Generic.List`1 ComputationExpressions.Program::get_xs() + } +} + +.class private abstract auto ansi sealed '.$ComputationExpressions'.Program + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void ComputationExpressions.Program::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExprLibrary.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExprLibrary.fs new file mode 100644 index 00000000000..5fa93736fb7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/CustomCollectionBuilderComputationExprLibrary.fs @@ -0,0 +1,59 @@ +namespace ComputationExpressions + +#nowarn 77 + +open System + +[] +module Library = + type CollectionBuilderCode<'T> = delegate of byref<'T> -> unit + + type CollectionBuilder () = + member inline _.Combine ([] f1 : CollectionBuilderCode<_>, [] f2 : CollectionBuilderCode<_>) = + CollectionBuilderCode (fun sm -> f1.Invoke &sm; f2.Invoke &sm) + + member inline _.Delay ([] f : unit -> CollectionBuilderCode<_>) = + CollectionBuilderCode (fun sm -> (f ()).Invoke &sm) + + member inline _.Zero () = CollectionBuilderCode (fun _ -> ()) + + member inline _.While ([] condition : unit -> bool, [] body : CollectionBuilderCode<_>) = + CollectionBuilderCode (fun sm -> + while condition () do + body.Invoke &sm) + + member inline _.TryWith ([] body : CollectionBuilderCode<_>, [] handle : exn -> CollectionBuilderCode<_>) = + CollectionBuilderCode (fun sm -> + try body.Invoke &sm + with e -> (handle e).Invoke &sm) + + member inline _.TryFinally ([] body : CollectionBuilderCode<_>, compensation : unit -> unit) = + CollectionBuilderCode (fun sm -> + try body.Invoke &sm + with _ -> + compensation () + reraise () + compensation ()) + + member inline builder.Using (disposable : #IDisposable, [] body : #IDisposable -> CollectionBuilderCode<_>) = + builder.TryFinally ((fun sm -> (body disposable).Invoke &sm), (fun () -> if not (isNull (box disposable)) then disposable.Dispose ())) + + member inline _.For (resizeArray : ResizeArray<_>, [] body : _ -> CollectionBuilderCode<_>) = + CollectionBuilderCode (fun sm -> + for i in 0 .. resizeArray.Count - 1 do + (body resizeArray[i]).Invoke &sm) + + member inline _.Yield x = CollectionBuilderCode (fun sm -> ignore (^a : (member Add : ^b -> _) (sm, x))) + + member inline builder.YieldFrom xs = CollectionBuilderCode (fun sm -> ignore (^a : (member AddRange : ^b -> _) (sm, xs))) + + [] + type ResizeArrayBuilder<'T> () = + inherit CollectionBuilder () + static member val Instance = ResizeArrayBuilder<'T> () + member inline _.Run ([] f : CollectionBuilderCode<_>) = + let mutable sm = ResizeArray<'T> () + f.Invoke &sm + sm + + let resizeArray<'T> = ResizeArrayBuilder<'T>.Instance diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs new file mode 100644 index 00000000000..21c23d68169 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs @@ -0,0 +1,25 @@ +module Program + +module DelegateImmediateInvoke1 = + type Foo = delegate of unit -> unit + + let f () = + let f1 = Foo ignore + f1.Invoke () + +module DelegateImmediateInvoke2 = + type Foo = delegate of unit -> unit + + let f () = Foo(ignore).Invoke() + +module DelegateImmediateInvoke3 = + type Foo<'T> = delegate of 'T -> unit + + let f () = + let f1 = Foo ignore + f1.Invoke(()) + +module DelegateImmediateInvoke4 = + type Foo<'T> = delegate of 'T -> unit + + let f () = Foo(ignore).Invoke(()) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.Optimize.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.Optimize.il.bsl new file mode 100644 index 00000000000..5c03f90dab8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.Optimize.il.bsl @@ -0,0 +1,247 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed Program + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public DelegateImmediateInvoke4 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo`1 + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke(!T A_1) runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(!T A_1, + class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke3 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo`1 + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke(!T A_1) runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(!T A_1, + class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke2 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke() runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname 'f@13-1' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn void Program/DelegateImmediateInvoke2/'f@13-1'::Invoke() + IL_0007: newobj instance void Program/DelegateImmediateInvoke2/Foo::.ctor(object, + native int) + IL_000c: tail. + IL_000e: callvirt instance void Program/DelegateImmediateInvoke2/Foo::Invoke() + IL_0013: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke1 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke() runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname f@7 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn void Program/DelegateImmediateInvoke1/f@7::Invoke() + IL_0007: newobj instance void Program/DelegateImmediateInvoke1/Foo::.ctor(object, + native int) + IL_000c: tail. + IL_000e: callvirt instance void Program/DelegateImmediateInvoke1/Foo::Invoke() + IL_0013: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$Program + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.OptimizeOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.OptimizeOff.il.bsl new file mode 100644 index 00000000000..af56908af03 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/FSharpDelegateBetaReduction.fs.RealInternalSignature.OptimizeOff.il.bsl @@ -0,0 +1,277 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed Program + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public DelegateImmediateInvoke4 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo`1 + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke(!T A_1) runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(!T A_1, + class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: pop + IL_0002: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke3 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo`1 + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke(!T A_1) runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(!T A_1, + class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname 'f1@19-1' + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit delegateArg0) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: pop + IL_0002: ret + } + + } + + .method public static void f() cil managed + { + + .maxstack 4 + .locals init (class Program/DelegateImmediateInvoke3/Foo`1 V_0) + IL_0000: ldnull + IL_0001: ldftn void Program/DelegateImmediateInvoke3/'f1@19-1'::Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit) + IL_0007: newobj instance void class Program/DelegateImmediateInvoke3/Foo`1::.ctor(object, + native int) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldnull + IL_000f: tail. + IL_0011: callvirt instance void class Program/DelegateImmediateInvoke3/Foo`1::Invoke(!0) + IL_0016: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke2 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke() runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname f@13 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void f() cil managed + { + + .maxstack 8 + IL_0000: ldnull + IL_0001: ldftn void Program/DelegateImmediateInvoke2/f@13::Invoke() + IL_0007: newobj instance void Program/DelegateImmediateInvoke2/Foo::.ctor(object, + native int) + IL_000c: tail. + IL_000e: callvirt instance void Program/DelegateImmediateInvoke2/Foo::Invoke() + IL_0013: ret + } + + } + + .class abstract auto ansi sealed nested public DelegateImmediateInvoke1 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public Foo + extends [runtime]System.MulticastDelegate + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname instance void .ctor(object 'object', native int 'method') runtime managed + { + } + + .method public hidebysig strict virtual instance void Invoke() runtime managed + { + } + + .method public hidebysig strict virtual + instance class [runtime]System.IAsyncResult + BeginInvoke(class [runtime]System.AsyncCallback callback, + object objects) runtime managed + { + } + + .method public hidebysig strict virtual instance void EndInvoke(class [runtime]System.IAsyncResult result) runtime managed + { + } + + } + + .class abstract auto autochar serializable sealed nested assembly beforefieldinit specialname f1@7 + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 06 00 00 00 00 00 ) + .method assembly static void Invoke() cil managed + { + + .maxstack 8 + IL_0000: ret + } + + } + + .method public static void f() cil managed + { + + .maxstack 4 + .locals init (class Program/DelegateImmediateInvoke1/Foo V_0) + IL_0000: ldnull + IL_0001: ldftn void Program/DelegateImmediateInvoke1/f1@7::Invoke() + IL_0007: newobj instance void Program/DelegateImmediateInvoke1/Foo::.ctor(object, + native int) + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: tail. + IL_0010: callvirt instance void Program/DelegateImmediateInvoke1/Foo::Invoke() + IL_0015: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$Program + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs index d226b4dc25f..109b427ad5f 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Inlining/Inlining.fs @@ -41,6 +41,17 @@ module Inlining = |> getCompilation |> verifyCompilation + [] + let ``FSharpDelegateBetaReduction_fs`` compilation = + compilation + |> getCompilation + |> withOptions [ "--test:EmitFeeFeeAs100001" ] + |> asExe + |> withEmbeddedPdb + |> withEmbedAllSource + |> ignoreWarnings + |> verifyILBaseline + [] let ``List contains inlining`` () = Fsx """module Test diff --git a/tests/FSharp.Test.Utilities/ILChecker.fs b/tests/FSharp.Test.Utilities/ILChecker.fs index 69b5d6c6c6a..78579102120 100644 --- a/tests/FSharp.Test.Utilities/ILChecker.fs +++ b/tests/FSharp.Test.Utilities/ILChecker.fs @@ -60,8 +60,9 @@ module ILChecker = let unifyRuntimeAssemblyName ilCode = List.fold replace ilCode [ - "\[System\.Runtime\]|\[System\.Console\]|\[System\.Runtime\.Extensions\]|\[mscorlib\]|\[System\.Memory\]", "[runtime]" + "\[System\.Runtime\]|\[System\.Console\]|\[System\.Runtime\.Extensions\]|\[mscorlib\]|\[System\.Memory\]|\[System\.Collections\]", "[runtime]" "(\.assembly extern (System\.Runtime|System\.Console|System\.Runtime\.Extensions|mscorlib|System\.Memory)){1}([^\}]*)\}", ".assembly extern runtime { }" + "(\.assembly extern (System\.Collections)){1}([^\}]*)\}\\s+", "" "(\.assembly extern (FSharp.Core)){1}([^\}]*)\}", ".assembly extern FSharp.Core { }" ] let unifyImageBase ilCode = replace ilCode ("\.imagebase\s*0x\d*", ".imagebase {value}") From fdf1bddbf3ddc2e7ee344af6e5d6d2e65d2aa06a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Tue, 1 Apr 2025 13:58:36 +0200 Subject: [PATCH 044/134] Create resourceManagement.yml --- .github/policies/resourceManagement.yml | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/policies/resourceManagement.yml diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 00000000000..6a4eae33150 --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,43 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - if: + - payloadType: Issues + - labelAdded: + label: Breaking-change + then: + - addReply: + reply: >- + Refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md#required-process-for-all-net-sdk-breaking-changes) + description: Add breaking change doc instructions to issue + - if: + - payloadType: Pull_Request + - labelAdded: + label: Breaking-change + then: + - addLabel: + label: needs-breaking-change-doc-created + - addReply: + reply: >- + Added `needs-breaking-change-doc-created` label because this PR has the `breaking-change` label. + + + When you commit this breaking change: + + + 1. [ ] Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the [breaking change documentation template](https://aka.ms/dotnet/docs/new-breaking-change-issue), then remove this `needs-breaking-change-doc-created` label. + + 2. [ ] Ask a committer to mail the `.NET SDK Breaking Change Notification` email list. + + + You can refer to the [.NET SDK breaking change guidelines](https://github.com/dotnet/sdk/blob/main/documentation/project-docs/breaking-change-guidelines.md) + description: Add breaking change instructions to PR. +onFailure: +onSuccess: From d43577caeba6396a1398553fb85f3167b978160a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 2 Apr 2025 09:43:01 -0700 Subject: [PATCH 045/134] Fix PM (#18435) --- src/Compiler/Driver/ScriptClosure.fs | 6 ++++-- vsintegration/src/FSharp.Editor/Common/Extensions.fs | 2 +- .../LanguageService/FSharpProjectOptionsManager.fs | 10 ++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index b97b11a8054..b45049627cf 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -327,11 +327,13 @@ module ScriptPreprocessClosure = for kv in tcConfig.packageManagerLines do let packageManagerKey, packageManagerLines = kv.Key, kv.Value - match packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) with + let packageManagerLines = + packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) + + match packageManagerLines with | [] -> () | packageManagerLine :: _ -> let m = packageManagerLine.Range - let packageManagerLines = packageManagerLines yield! processPackageManagerLines m packageManagerLines scriptName packageManagerKey ] diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 2ed87e5ec82..ff17ac43662 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -139,7 +139,7 @@ type Document with | hr, _, _, docData, _ when ErrorHandler.Succeeded(hr) && docData <> IntPtr.Zero -> match Marshal.GetObjectForIUnknown docData with | :? IVsTextBuffer as ivsTextBuffer -> - match textManager.GetActiveView(1, ivsTextBuffer) with + match textManager.GetActiveView(0, ivsTextBuffer) with | hr, vsTextView when ErrorHandler.Succeeded(hr) -> Some vsTextView | _ -> None | _ -> None diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index edf31e68a57..d61ba717b4d 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -200,13 +200,16 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = cancellableTask { let! ct = CancellableTask.getCancellationToken () let! fileStamp = document.GetTextVersionAsync(ct) + let textViewAndCaret () : (IVsTextView * Position) option = document.TryGetTextViewAndCaretPos() match singleFileCache.TryGetValue(document.Id) with | false, _ -> let! sourceText = document.GetTextAsync(ct) let getProjectOptionsFromScript textViewAndCaret = - match textViewAndCaret with + let caret = textViewAndCaret () + + match caret with | None -> checker.GetProjectOptionsFromScript( document.FilePath, @@ -226,7 +229,6 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = userOpName = userOpName ) - let textViewAndCaret = document.TryGetTextViewAndCaretPos() let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret let project = document.Project @@ -266,7 +268,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = let updateProjectOptions () = async { - let! scriptProjectOptions, _ = getProjectOptionsFromScript None + let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret checker.NotifyFileChanged(document.FilePath, scriptProjectOptions) |> Async.Start @@ -281,7 +283,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = match value with | projectId, fileStamp, parsingOptions, projectOptions, _ -> let subscription = - match textViewAndCaret with + match textViewAndCaret () with | Some(textView, _) -> subscribeToTextViewEvents (textView, (Some onChangeCaretHandler), (Some onKillFocus), (Some onSetFocus)) | None -> None From b1490e39505624bf5150484c40daa7c085a6bfcb Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Thu, 3 Apr 2025 11:41:39 +0200 Subject: [PATCH 046/134] Fix for #18433 (internal error during xml comment processing) (#18436) * fix for 18433 * release note for #18436 --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/SyntaxTree/XmlDoc.fs | 3 ++- .../Language/XmlComments.fs | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 86672567838..8893e4d237d 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -21,6 +21,7 @@ * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) * Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) * Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) +* Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/SyntaxTree/XmlDoc.fs b/src/Compiler/SyntaxTree/XmlDoc.fs index a366a69a8a6..d4c4cada576 100644 --- a/src/Compiler/SyntaxTree/XmlDoc.fs +++ b/src/Compiler/SyntaxTree/XmlDoc.fs @@ -139,7 +139,8 @@ type XmlDocCollector() = let xmlDocBlock = struct (savedLines.Count - currentGrabPointCommentsCount, savedLines.Count - 1, false) - savedGrabPoints.Add(pos, xmlDocBlock) + // silently override duplicate grab points (which happen only when preceded by nonsensical line directives) + savedGrabPoints[pos] <- xmlDocBlock currentGrabPointCommentsCount <- 0 delayedGrabPoint <- ValueNone diff --git a/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs b/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs index eed0e37e4db..47aee9362b7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/XmlComments.fs @@ -242,3 +242,19 @@ module M = |> withXmlCommentChecking |> compile |> withDiagnostics [ ] + + // regression test for #18433 + [] + let OverrideXmlCommentsWithSameRange () = + Fs""" + module A + # 1 + /// A is int + type A = {a: int} + # 1 + /// B is int + type B = {b: int} + """ + |> withXmlCommentChecking + |> compile + |> shouldSucceed \ No newline at end of file From 0566db0c1dec6f7142c6f30b89b0698c3ef26c87 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 3 Apr 2025 13:22:38 +0300 Subject: [PATCH 047/134] Fix a small mistake in String.init's docs (#18438) There's no "mapping" parameter. I'm guessing this was a copy/paste mistake. --- src/FSharp.Core/string.fsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharp.Core/string.fsi b/src/FSharp.Core/string.fsi index e7c6ef062ad..9178af3fcf9 100644 --- a/src/FSharp.Core/string.fsi +++ b/src/FSharp.Core/string.fsi @@ -139,7 +139,7 @@ module String = [] val forall: predicate: (char -> bool) -> str: string -> bool - /// Builds a new string whose characters are the results of applying the function mapping + /// Builds a new string whose characters are the results of applying the function initializer /// to each index from 0 to count-1 and concatenating the resulting /// strings. /// From 2598fb1d3d9631fe0e3cbb0cd64625b2b0a3c498 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 3 Apr 2025 13:32:09 +0300 Subject: [PATCH 048/134] Fix a bunch of typos (#18439) --- src/Compiler/Checking/CheckPatterns.fs | 8 +- .../CheckComputationExpressions.fs | 4 +- .../Checking/PatternMatchCompilation.fs | 78 +-- src/Compiler/Checking/PostInferenceChecks.fs | 26 +- src/Compiler/Facilities/CompilerLocation.fs | 2 +- src/Compiler/Symbols/SymbolHelpers.fs | 354 +++++----- src/Compiler/Utilities/range.fsi | 38 +- tests/FSharp.Test.Utilities/Compiler.fs | 19 +- tests/fsharp/core/members/absil.fsi | 650 +++++++++--------- .../HashLight/indent_off_01.fs | 6 +- .../HashLight/indent_off_01.fsi | 4 +- .../HashLight/indent_off_01.fsscript | 6 +- .../HashLight/indent_off_01.fsx | 6 +- .../HashLight/indent_off_after_comment01.fs | 6 +- 14 files changed, 601 insertions(+), 606 deletions(-) diff --git a/src/Compiler/Checking/CheckPatterns.fs b/src/Compiler/Checking/CheckPatterns.fs index 9587c3b5e9f..9665bfd2463 100644 --- a/src/Compiler/Checking/CheckPatterns.fs +++ b/src/Compiler/Checking/CheckPatterns.fs @@ -269,7 +269,7 @@ and TcPat warnOnUpper (cenv: cenv) env valReprInfo vFlags (patEnv: TcPatLinearEn | SynPat.As (pat1, pat2, m) -> TcPatUnnamedAs warnOnUpper cenv env vFlags patEnv ty pat1 pat2 m - + | SynPat.Named (SynIdent(id,_), isMemberThis, vis, m) -> TcPatNamed warnOnUpper cenv env vFlags patEnv id ty isMemberThis vis valReprInfo m @@ -522,7 +522,7 @@ and IsNameOf (cenv: cenv) (env: TcEnv) ad m (id: Ident) = /// Check a long identifier in a pattern and TcPatLongIdent warnOnUpper cenv env ad valReprInfo vFlags (patEnv: TcPatLinearEnv) ty (longDotId, tyargs, args, vis, m) = let (SynLongIdent(longId, _, _)) = longDotId - + if tyargs.IsSome then errorR(Error(FSComp.SR.tcInvalidTypeArgumentUsage(), m)) let warnOnUpperForId = @@ -643,7 +643,7 @@ and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (m // Here we only care about the cases where the user has written the wildcard pattern explicitly // | Case _ -> ... // let myDiscardedArgFunc(Case _) = ...""" - // This needs to be a waring because it was a valid pattern in version 7.0 and earlier and we don't want to break existing code. + // This needs to be a warning because it was a valid pattern in version 7.0 and earlier and we don't want to break existing code. // The rest of the cases will still be reported as FS0725 warning(Error(FSComp.SR.matchNotAllowedForUnionCaseWithNoData(), m)) | _ -> () @@ -725,7 +725,7 @@ and TcPatLongIdentUnionCaseOrExnCase warnOnUpper cenv env ad vFlags patEnv ty (m if numArgTys > 1 then // Expects tuple without enough args let printTy = NicePrint.minimalStringOfType env.DisplayEnv - let missingArgs = + let missingArgs = argNames.[numArgs..numArgTys - 1] |> List.map (fun id -> (if id.rfield_name_generated then "" else id.DisplayName + ": ") + printTy id.FormalType) |> String.concat (Environment.NewLine + "\t") diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index fc804ab5e34..10b4a891b32 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -914,7 +914,7 @@ let inline addVarsToVarSpace (varSpace: LazyWithContext /// Try translate the syntax sugar /// /// Computation expression context (carrying caches, environments, ranges, etc) -/// Flag if it's inital check +/// Flag if it's initial check /// a flag indicating if custom operators are allowed. They are not allowed inside try/with, try/finally, if/then/else etc. /// a lazy data structure indicating the variables bound so far in the overall computation /// the computation expression being analyzed @@ -2793,7 +2793,7 @@ and convertSimpleReturnToExpr (ceenv: ComputationExpressionContext<'a>) comp var | Some(thenExpr, None) -> let elseExprOptOpt = match elseCompOpt with - // When we are missing an 'else' part alltogether in case of 'if cond then return exp', we fallback from BindReturn into regular Bind+Return + // When we are missing an 'else' part altogether in case of 'if cond then return exp', we fallback from BindReturn into regular Bind+Return | None -> None | Some elseComp -> match convertSimpleReturnToExpr ceenv comp varSpace elseComp with diff --git a/src/Compiler/Checking/PatternMatchCompilation.fs b/src/Compiler/Checking/PatternMatchCompilation.fs index 00b25756801..3b42f561c1a 100644 --- a/src/Compiler/Checking/PatternMatchCompilation.fs +++ b/src/Compiler/Checking/PatternMatchCompilation.fs @@ -197,11 +197,11 @@ exception CannotRefute [] [] -type CounterExampleType = +type CounterExampleType = /// Maps to EnumMatchIncomplete exn - | EnumCoversKnown + | EnumCoversKnown /// Maps to MatchIncomplete exn - | WithoutEnum + | WithoutEnum with member x.Combine(other) = match other with EnumCoversKnown -> other | _ -> x let RefuteDiscrimSet g m path discrims : Expr * CounterExampleType = @@ -366,7 +366,7 @@ let ShowCounterExample g denv m refuted = | [] -> raise CannotRefute | (r, eck) :: t -> ((r, eck), t) ||> List.fold (fun (rAcc, eckAcc) (r, eck) -> - CombineRefutations g rAcc r, eckAcc.Combine(eck)) + CombineRefutations g rAcc r, eckAcc.Combine(eck)) let text = LayoutRender.showL (NicePrint.dataExprL denv counterExample) let failingWhenClause = refuted |> List.exists (function RefutedWhenClause -> true | _ -> false) Some(text, failingWhenClause, enumCoversKnown) @@ -400,7 +400,7 @@ let rec isMemOfActives p1 actives = | [] -> false | Active(p2, _, _) :: rest -> pathEq p1 p2 || isMemOfActives p1 rest -// Find the information about the active investigation +// Find the information about the active investigation let rec lookupActive x l = match l with | [] -> raise (KeyNotFoundException()) @@ -423,13 +423,13 @@ type Implication = /// Work out what a successful type test (against tgtTy1) implies about a null test for the same input value. /// /// Example: -/// match x with +/// match x with /// | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test /// | null -> ... /// For any inputs where ':? string' succeeds, 'null' will fail /// /// Example: -/// match x with +/// match x with /// | :? (int option) when false -> ... // note: "when false" used so type test succeeds but proceed to next type test /// | null -> ... /// Nothing can be learned. If ':? (int option)' succeeds, 'null' may still have to be run. @@ -442,7 +442,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutNullTest g tgtTy1 = /// Work out what a failing type test (against tgtTy1) implies about a null test for the same input value. /// /// Example: -/// match x with +/// match x with /// | :? (int option) -> ... /// | null -> ... /// If ':? (int option)' fails then 'null' will fail @@ -455,13 +455,13 @@ let computeWhatFailingTypeTestImpliesAboutNullTest g tgtTy1 = /// Work out what one successful null test implies about a type test (against tgtTy2) for the same input value. /// /// Example: -/// match x with +/// match x with /// | null when false -> ... // note: "when false" used so null test succeeds but proceed to next type test /// | :? string -> ... /// For any inputs where 'null' succeeds, ':? string' will fail /// /// Example: -/// match x with +/// match x with /// | null when false -> ... // note: "when false" used so null test succeeds but proceed to next type test /// | :? (int option) -> ... /// For any inputs where 'null' succeeds, ':? (int option)' will succeed @@ -487,12 +487,12 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // supertypes (tgtTy2) always succeed. // // Example: - // match x with + // match x with // | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? IComparable -> ... // // Example: - // match x with + // match x with // | :? string when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? string -> ... // @@ -503,7 +503,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // type tests of the same object against a unrelated target type (tgtTy2) fails. // // Example: - // match x with + // match x with // | :? int when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? string -> ... // @@ -511,7 +511,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // // // This only applies if tgtTy2 is not potentially related to the sealed type tgtTy1: - // match x with + // match x with // | :? int when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? IComparable -> ... // @@ -520,7 +520,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // // // This rule also doesn't apply to unsealed types: - // match x with + // match x with // | :? SomeUnsealedClass when false -> ... // note: "when false" used so type test succeeds but proceed to next type test // | :? SomeInterface -> ... // because the input may be some subtype of SomeUnsealedClass and that type could implement SomeInterface even if @@ -528,7 +528,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // // // This rule also doesn't apply to types with null as true value: - // match x with + // match x with // | :? (int option) when false -> ... // "when false" means type test succeeds but proceed to next type test // | :? (string option) -> ... // @@ -542,7 +542,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // a type test of the same input value against an unrelated non-interface type (tgtTy2) always fails // // Example: - // match x with + // match x with // | :? SomeUnsealedClass when false -> ... // "when false" used so type test succeeds but proceed to next type test // | :? SomeUnrelatedClass -> ... // @@ -562,7 +562,7 @@ let computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // always fails. // // Example: - // match x with + // match x with // | :? IComparable when false -> ... // "when false" used so type test succeeds but proceed to next type test // | :? SomeOtherSealedClass -> ... // @@ -586,12 +586,12 @@ let computeWhatFailingTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 = // testing the same input value against an equivalent or subtype type (tgtTy2) always fails. // // Example: - // match x with + // match x with // | :? IComparable -> ... // | :? string -> ... // // Example: - // match x with + // match x with // | :? string -> ... // | :? string -> ... if TypeDefinitelySubsumesTypeNoCoercion 0 g amap m tgtTy1 tgtTy2 then @@ -696,7 +696,7 @@ let discrimWithinSimultaneousClass g amap m discrim prev = | DecisionTreeTest.IsNull, _ -> // Check that each previous test in the set, if successful, gives some information about this test - prev |> List.forall (fun edge -> + prev |> List.forall (fun edge -> match edge with | DecisionTreeTest.IsNull -> true | DecisionTreeTest.IsInst (_, tgtTy1) -> computeWhatSuccessfulTypeTestImpliesAboutNullTest g tgtTy1 <> Implication.Nothing @@ -704,7 +704,7 @@ let discrimWithinSimultaneousClass g amap m discrim prev = | DecisionTreeTest.IsInst (_, tgtTy2), _ -> // Check that each previous test in the set, if successful, gives some information about this test - prev |> List.forall (fun edge -> + prev |> List.forall (fun edge -> match edge with | DecisionTreeTest.IsNull -> true | DecisionTreeTest.IsInst (_, tgtTy1) -> computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy1 tgtTy2 <> Implication.Nothing @@ -885,8 +885,8 @@ let rec investigationPoints inpPat = match inpPat with | TPat_query((_, _, _, _, _, apinfo), subPat, _) -> Array.prepend (not apinfo.IsTotal) (investigationPoints subPat) - | TPat_isinst(_, _tgtTy, subPatOpt, _) -> - match subPatOpt with + | TPat_isinst(_, _tgtTy, subPatOpt, _) -> + match subPatOpt with | None -> singleFalseInvestigationPoint | Some subPat -> Array.prepend false (investigationPoints subPat) | TPat_as(subPat, _, _) -> investigationPoints subPat @@ -904,7 +904,7 @@ let rec investigationPoints inpPat = |> Seq.collect investigationPoints |> Seq.toArray |> Array.prepend false - | TPat_null _ + | TPat_null _ | TPat_const _ -> singleFalseInvestigationPoint | TPat_wild _ | TPat_error _ -> [||] @@ -930,7 +930,7 @@ let rec erasePartialPatterns inpPat = and erasePartials inps = List.map erasePartialPatterns inps - + let ReportUnusedTargets (clauses: MatchClause list) dtree = match dtree, clauses with | TDSuccess _, [ _ ] -> () @@ -948,7 +948,7 @@ let ReportUnusedTargets (clauses: MatchClause list) dtree = | [ head ] -> head.Id.idRange | _ -> c.Pattern.Range | _, Some guard -> guard.Range - + withStartEnd c.Range.Start m.End m |> RuleNeverMatched |> warning) @@ -994,10 +994,10 @@ let CompilePatternBasic let mutable firstIncompleteMatchClauseWithThrowExpr = None let warningsGenerated = new ResizeArray(2) let getIncompleteMatchClause refuted = - // Emit the incomplete match warning. + // Emit the incomplete match warning. if warnOnIncomplete then match actionOnFailure with - | ThrowIncompleteMatchException + | ThrowIncompleteMatchException | IgnoreWithWarning -> let ignoreWithWarning = (actionOnFailure = IgnoreWithWarning) let counterExample = ShowCounterExample g denv mMatch refuted @@ -1070,7 +1070,7 @@ let CompilePatternBasic | ThrowIncompleteMatchException -> mkThrow mMatch resultTy - (mkExnExpr(g.MatchFailureException_tcr, + (mkExnExpr(g.MatchFailureException_tcr, [ mkString g mMatch mMatch.FileName mkInt g mMatch mMatch.StartLine mkInt g mMatch mMatch.StartColumn], mMatch)) @@ -1259,7 +1259,7 @@ let CompilePatternBasic | ActivePatternReturnKind.Boolean -> false let vOpt, addrExp, _readonly, _writeonly = mkExprAddrOfExprAux g mustTakeAddress false NeverMutates appExpr None mMatch match vOpt with - | None -> + | None -> let v, vExpr = mkCompGenLocal m ("activePatternResult" + string (newUnique())) resTy if origInputVal.IsMemberOrModuleBinding then AdjustValToHaveValReprInfo v origInputVal.TryDeclaringEntity ValReprInfo.emptyValData @@ -1316,7 +1316,7 @@ let CompilePatternBasic if not total && aparity > 1 then error(Error(FSComp.SR.patcPartialActivePatternsGenerateOneResult(), m)) - if not total then + if not total then match retKind with | ActivePatternReturnKind.Boolean -> DecisionTreeTest.Const(Const.Bool true) | ActivePatternReturnKind.RefTypeWrapper -> DecisionTreeTest.UnionCase(mkAnySomeCase g false, resTys) @@ -1497,7 +1497,7 @@ let CompilePatternBasic match discrim with | DecisionTreeTest.IsInst (_srcTy, tgtTy2) -> match computeWhatSuccessfulTypeTestImpliesAboutTypeTest g amap m tgtTy2 tgtTy1 with - | Implication.Succeeds -> + | Implication.Succeeds -> match pbindOpt with | Some pbind -> let subAccess tpinst exprIn = @@ -1534,7 +1534,7 @@ let CompilePatternBasic match discrim with | DecisionTreeTest.IsNull -> [Frontier (i, newActives, valMap)] - | DecisionTreeTest.IsInst (_, tgtTy) -> + | DecisionTreeTest.IsInst (_, tgtTy) -> match computeWhatSuccessfulTypeTestImpliesAboutNullTest g tgtTy with | Implication.Succeeds -> [Frontier (i, newActives, valMap)] | Implication.Fails -> [] @@ -1637,7 +1637,7 @@ let CompilePatternBasic // - Partial active patterns // - Disjunctive patterns // - Pattern clauses with 'when' -// - isinst patterns +// - isinst patterns // // Partial active patterns that are not the "last" thing in a clause, // combined with subsequent clauses, can cause significant code expansion @@ -1666,13 +1666,13 @@ let CompilePatternBasic // a partial pattern. This can lead to sub-standard code generation // but has long been the technique we use to avoid blow-up of pattern matching. // -// Disjunctive patterns combined with 'when' clauses can also cause signficant code +// Disjunctive patterns combined with 'when' clauses can also cause significant code // expansion. In particular this leads to multiple copies of 'when' expressions (even for one clause) // and each failure path of those 'when' will then continue on the expand any remaining // pattern logic in subsequent clauses. So when generating code we take clauses up // until the first one containing a disjunctive pattern with a 'when' clause. // -// Disjunction will still cause significant expansion, e.g. +// Disjunction will still cause significant expansion, e.g. // (A | B), (C | D) -> // is immediately expanded out to four frontiers each with two investigation points. // A, C -> ... @@ -1682,7 +1682,7 @@ let CompilePatternBasic // // Of course, some decision-logic expansion here is expected. Further, for unions, integers, characters, enums etc. // the column-based matching on A/B and C/D eliminates these relatively efficiently, e.g. to -// one-switch-on-A/B +// one-switch-on-A/B // on each path, one switch on C/D // So disjunction alone isn't considered problematic, but in combination with 'when' patterns @@ -1702,7 +1702,7 @@ let rec CompilePattern g denv amap tcVal infoReader mExpr mMatch warnOnUnused a // First make sure we generate at least some of the obvious incomplete match warnings. let warnOnUnused = false // we can't turn this on since we're pretending all partials fail in order to control the complexity of this. let warnOnIncomplete = true - let clausesPretendAllPartialFail = clausesL |> List.collect (fun (MatchClause(p, whenOpt, tg, m)) -> [MatchClause(erasePartialPatterns p, whenOpt, tg, m)]) + let clausesPretendAllPartialFail = clausesL |> List.collect (fun (MatchClause(p, whenOpt, tg, m)) -> [MatchClause(erasePartialPatterns p, whenOpt, tg, m)]) let _ = CompilePatternBasic g denv amap tcVal infoReader mExpr mMatch warnOnUnused warnOnIncomplete actionOnFailure (origInputVal, origInputValTypars, origInputExprOpt) clausesPretendAllPartialFail inputTy resultTy let warnOnIncomplete = false diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 4df0185a2e5..d22f50cdc2f 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -335,9 +335,9 @@ let RecordAnonRecdInfo cenv (anonInfo: AnonRecdTypeInfo) = // approx walk of type //-------------------------------------------------------------------------- -/// Represents the container for nester type instantions, carrying information about the parent (generic type) and data about correspinding generic typar definition. +/// Represents the container for nester type instantions, carrying information about the parent (generic type) and data about corresponding generic typar definition. /// For current use, IlGenericParameterDef was enough. For other future use cases, conversion into F# Typar might be needed. -type TypeInstCtx = +type TypeInstCtx = | NoInfo | IlGenericInst of parent:TyconRef * genericArg:ILGenericParameterDef | TyparInst of parent:TyconRef @@ -649,7 +649,7 @@ let CheckTypeAux permitByRefLike (cenv: cenv) env m ty onInnerByrefError = errorR (Error(FSComp.SR.checkNotSufficientlyGenericBecauseOfScope(tp.DisplayName), m)) let visitTyconRef (ctx:TypeInstCtx) tcref = - let checkInner() = + let checkInner() = match ctx with | TopLevelAllowingByRef -> false | TyparInst(parentTcRef) @@ -694,11 +694,11 @@ let CheckTypeAux permitByRefLike (cenv: cenv) env m ty onInnerByrefError = cenv.potentialUnboundUsesOfVals <- cenv.potentialUnboundUsesOfVals.Add(vref.Stamp, m) | _ -> () - let initialCtx = + let initialCtx = match permitByRefLike with | PermitByRefType.SpanLike | PermitByRefType.NoInnerByRefLike -> TopLevelAllowingByRef - | _ -> NoInfo + | _ -> NoInfo CheckTypeDeep cenv (ignore, Some visitTyconRef, Some visitAppTy, Some visitTraitSolution, Some visitTyar) cenv.g env initialCtx ty @@ -1958,7 +1958,7 @@ and CheckAttribArgExpr cenv env expr = | Const.Single _ | Const.Char _ | Const.Zero - | Const.String _ + | Const.String _ | Const.Decimal _ -> () | _ -> if cenv.reportErrors then @@ -2231,7 +2231,7 @@ let CheckModuleBinding cenv env (TBind(v, e, _) as bind) = // Default augmentation contains the nasty 'Is' etc. let prefix = "Is" if not v.IsImplied && nm.StartsWithOrdinal prefix && hasDefaultAugmentation then - match tcref.GetUnionCaseByName(nm[prefix.Length ..]) with + match tcref.GetUnionCaseByName(nm[prefix.Length ..]) with | Some uc -> error(NameClash(nm, kind, v.DisplayName, v.Range, FSComp.SR.chkUnionCaseDefaultAugmentation(), uc.DisplayName, uc.Range)) | None -> () @@ -2398,10 +2398,10 @@ let CheckEntityDefn cenv env (tycon: Entity) = errorR(Error(FSComp.SR.chkCurriedMethodsCantHaveOutParams(), m)) if numCurriedArgSets = 1 then - let errorIfNotStringTy m ty callerInfo = + let errorIfNotStringTy m ty callerInfo = if not (typeEquiv g g.string_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m)) - + let errorIfNotStringOptionTy m ty callerInfo = if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) @@ -2523,7 +2523,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = if TyconRefHasAttribute g m g.attrib_IsReadOnlyAttribute tcref && not tycon.IsStructOrEnumTycon then errorR(Error(FSComp.SR.tcIsReadOnlyNotStruct(), tycon.Range)) - // Considers TFSharpTyconRepr and TFSharpUnionRepr. + // Considers TFSharpTyconRepr and TFSharpUnionRepr. // [Review] are all cases covered: TILObjectRepr, TAsmRepr. [Yes - these are FSharp.Core.dll only] tycon.AllFieldsArray |> Array.iter (CheckRecdField false cenv env tycon) @@ -2559,10 +2559,10 @@ let CheckEntityDefn cenv env (tycon: Entity) = // We do not have to check access of interface implementations. - if tycon.IsFSharpDelegateTycon then - match tycon.TypeReprInfo with + if tycon.IsFSharpDelegateTycon then + match tycon.TypeReprInfo with | TFSharpTyconRepr r -> - match r.fsobjmodel_kind with + match r.fsobjmodel_kind with | TFSharpDelegate ss -> //ss.ClassTypars //ss.MethodTypars diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index 7d902aefc27..abd436647ae 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -304,7 +304,7 @@ module internal FSharpEnvironment = // How to find dotnet.exe --- woe is me; probing rules make me sad. // Algorithm: // 1. Look for DOTNET_HOST_PATH environment variable - // this is the main user programable override .. provided by user to find a specific dotnet.exe + // this is the main user programmable override .. provided by user to find a specific dotnet.exe // 2. Probe for are we part of an .NetSDK install // In an sdk install we are always installed in: sdk\3.0.100-rc2-014234\FSharp // dotnet or dotnet.exe will be found in the directory that contains the sdk directory diff --git a/src/Compiler/Symbols/SymbolHelpers.fs b/src/Compiler/Symbols/SymbolHelpers.fs index 116e9ba95b7..c516f0c377b 100644 --- a/src/Compiler/Symbols/SymbolHelpers.fs +++ b/src/Compiler/Symbols/SymbolHelpers.fs @@ -5,15 +5,15 @@ namespace FSharp.Compiler.Symbols open System open System.IO -open Internal.Utilities.Library +open Internal.Utilities.Library open Internal.Utilities.Library.Extras open FSharp.Core.Printf -open FSharp.Compiler -open FSharp.Compiler.AbstractIL.Diagnostics +open FSharp.Compiler +open FSharp.Compiler.AbstractIL.Diagnostics open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.InfoReader open FSharp.Compiler.Infos -open FSharp.Compiler.IO +open FSharp.Compiler.IO open FSharp.Compiler.NameResolution open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.Text @@ -25,7 +25,7 @@ open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TypeHierarchy -open FSharp.Compiler.TcGlobals +open FSharp.Compiler.TcGlobals /// Describe a comment as either a block of text or a file+signature reference into an intellidoc file. [] @@ -38,46 +38,46 @@ module EnvMisc2 = let maxMembers = GetEnvInteger "FCS_MaxMembersInQuickInfo" 10 [] -module internal SymbolHelpers = +module internal SymbolHelpers = let rangeOfValRef preferFlag (vref: ValRef) = - match preferFlag with - | None -> vref.Range - | Some false -> vref.DefinitionRange + match preferFlag with + | None -> vref.Range + | Some false -> vref.DefinitionRange | Some true -> vref.SigRange let rangeOfEntityRef preferFlag (eref: EntityRef) = - match preferFlag with - | None -> eref.Range - | Some false -> eref.DefinitionRange + match preferFlag with + | None -> eref.Range + | Some false -> eref.DefinitionRange | Some true -> eref.SigRange - + let rangeOfPropInfo preferFlag (pinfo: PropInfo) = match pinfo with -#if !NO_TYPEPROVIDERS +#if !NO_TYPEPROVIDERS | ProvidedProp(_, pi, _) -> Construct.ComputeDefinitionLocationOfProvidedItem pi #endif | _ -> pinfo.ArbitraryValRef |> Option.map (rangeOfValRef preferFlag) - let rangeOfMethInfo (g: TcGlobals) preferFlag (minfo: MethInfo) = + let rangeOfMethInfo (g: TcGlobals) preferFlag (minfo: MethInfo) = match minfo with -#if !NO_TYPEPROVIDERS +#if !NO_TYPEPROVIDERS | ProvidedMeth(_, mi, _, _) -> Construct.ComputeDefinitionLocationOfProvidedItem mi #endif | DefaultStructCtor(_, AppTy g (tcref, _)) -> Some(rangeOfEntityRef preferFlag tcref) | _ -> minfo.ArbitraryValRef |> Option.map (rangeOfValRef preferFlag) - let rangeOfEventInfo preferFlag (einfo: EventInfo) = + let rangeOfEventInfo preferFlag (einfo: EventInfo) = match einfo with -#if !NO_TYPEPROVIDERS +#if !NO_TYPEPROVIDERS | ProvidedEvent (_, ei, _) -> Construct.ComputeDefinitionLocationOfProvidedItem ei #endif | _ -> einfo.ArbitraryValRef |> Option.map (rangeOfValRef preferFlag) - - let rangeOfUnionCaseInfo preferFlag (ucinfo: UnionCaseInfo) = - match preferFlag with - | None -> ucinfo.UnionCase.Range - | Some false -> ucinfo.UnionCase.DefinitionRange + + let rangeOfUnionCaseInfo preferFlag (ucinfo: UnionCaseInfo) = + match preferFlag with + | None -> ucinfo.UnionCase.Range + | Some false -> ucinfo.UnionCase.DefinitionRange | Some true -> ucinfo.UnionCase.SigRange let rangeOfRecdField preferFlag (rField: RecdField) = @@ -89,7 +89,7 @@ module internal SymbolHelpers = let rangeOfRecdFieldInfo preferFlag (rfinfo: RecdFieldInfo) = rangeOfRecdField preferFlag rfinfo.RecdField - let rec rangeOfItem (g: TcGlobals) preferFlag d = + let rec rangeOfItem (g: TcGlobals) preferFlag d = match d with | Item.Value vref | Item.CustomBuilder (_, vref) -> Some (rangeOfValRef preferFlag vref) | Item.UnionCase(ucinfo, _) -> Some (rangeOfUnionCaseInfo preferFlag ucinfo) @@ -103,13 +103,13 @@ module internal SymbolHelpers = | Item.Property(info = pinfos; sourceIdentifierRange = mNameOpt) -> match mNameOpt with | Some m -> Some m - | None -> rangeOfPropInfo preferFlag pinfos.Head + | None -> rangeOfPropInfo preferFlag pinfos.Head | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.map (rangeOfEntityRef preferFlag)) | Item.CustomOperation (_, _, Some minfo) -> rangeOfMethInfo g preferFlag minfo | Item.Trait _ -> None | Item.TypeVar (_, tp) -> Some tp.Range | Item.ModuleOrNamespaces modrefs -> modrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) - | Item.MethodGroup(_, minfos, _) + | Item.MethodGroup(_, minfos, _) | Item.CtorGroup(_, minfos) -> minfos |> List.tryPick (rangeOfMethInfo g preferFlag) | Item.ActivePatternResult(APInfo _, _, _, m) -> Some m | Item.SetterArg (_, item) -> rangeOfItem g preferFlag item @@ -122,27 +122,27 @@ module internal SymbolHelpers = | Item.NewDef _ -> None // Provided type definitions do not have a useful F# CCU for the purposes of goto-definition. - let computeCcuOfTyconRef (tcref: TyconRef) = + let computeCcuOfTyconRef (tcref: TyconRef) = #if !NO_TYPEPROVIDERS - if tcref.IsProvided then None else + if tcref.IsProvided then None else #endif ccuOfTyconRef tcref - let ccuOfMethInfo (g: TcGlobals) (minfo: MethInfo) = + let ccuOfMethInfo (g: TcGlobals) (minfo: MethInfo) = match minfo with | DefaultStructCtor(_, AppTy g (tcref, _)) -> computeCcuOfTyconRef tcref - | _ -> - minfo.ArbitraryValRef - |> Option.bind ccuOfValRef + | _ -> + minfo.ArbitraryValRef + |> Option.bind ccuOfValRef |> Option.orElseWith (fun () -> minfo.DeclaringTyconRef |> computeCcuOfTyconRef) - let rec ccuOfItem (g: TcGlobals) d = + let rec ccuOfItem (g: TcGlobals) d = match d with | Item.Value vref | Item.CustomBuilder (_, vref) -> - ccuOfValRef vref + ccuOfValRef vref | Item.UnionCase(ucinfo, _) -> computeCcuOfTyconRef ucinfo.TyconRef @@ -165,9 +165,9 @@ module internal SymbolHelpers = | Item.ILField finfo -> finfo.DeclaringTyconRef |> computeCcuOfTyconRef - | Item.Property(info = pinfos) -> - pinfos |> List.tryPick (fun pinfo -> - pinfo.ArbitraryValRef + | Item.Property(info = pinfos) -> + pinfos |> List.tryPick (fun pinfo -> + pinfo.ArbitraryValRef |> Option.bind ccuOfValRef |> Option.orElseWith (fun () -> pinfo.DeclaringTyconRef |> computeCcuOfTyconRef)) @@ -192,9 +192,9 @@ module internal SymbolHelpers = | Item.DelegateCtor(ty) -> ty |> tryNiceEntityRefOfTyOption |> Option.bind computeCcuOfTyconRef - | Item.ModuleOrNamespaces erefs + | Item.ModuleOrNamespaces erefs | Item.UnqualifiedType erefs -> - erefs |> List.tryPick computeCcuOfTyconRef + erefs |> List.tryPick computeCcuOfTyconRef | Item.SetterArg (_, item) -> ccuOfItem g item @@ -219,22 +219,22 @@ module internal SymbolHelpers = /// Work out the source file for an item and fix it up relative to the CCU if it is relative. let fileNameOfItem (g: TcGlobals) qualProjectDir (m: range) h = - let file = m.FileName + let file = m.FileName if verbose then dprintf "file stored in metadata is '%s'\n" file - if not (FileSystem.IsPathRootedShim file) then - match ccuOfItem g h with - | Some ccu -> + if not (FileSystem.IsPathRootedShim file) then + match ccuOfItem g h with + | Some ccu -> Path.Combine(ccu.SourceCodeDirectory, file) - | None -> - match qualProjectDir with + | None -> + match qualProjectDir with | None -> file | Some dir -> Path.Combine(dir, file) else file - let ParamNameAndTypesOfUnaryCustomOperation g minfo = - match minfo with - | FSMeth(_, _, vref, _) -> - let argInfos = ArgInfosOfMember g vref |> List.concat + let ParamNameAndTypesOfUnaryCustomOperation g minfo = + match minfo with + | FSMeth(_, _, vref, _) -> + let argInfos = ArgInfosOfMember g vref |> List.concat // Drop the first 'seq' argument representing the computation space let argInfos = if argInfos.IsEmpty then [] else argInfos.Tail [ for ty, argInfo in argInfos do @@ -258,12 +258,12 @@ module internal SymbolHelpers = |> Option.map FSharpXmlDoc.FromXmlText |> Option.defaultValue xmlDoc - /// This function gets the signature to pass to Visual Studio to use its lookup functions for .NET stuff. + /// This function gets the signature to pass to Visual Studio to use its lookup functions for .NET stuff. let rec GetXmlDocHelpSigOfItemForLookup (infoReader: InfoReader) m d = let g = infoReader.g match d with - | Item.ActivePatternCase (APElemRef(_, vref, _, _)) - | Item.Value vref | Item.CustomBuilder (_, vref) -> + | Item.ActivePatternCase (APElemRef(_, vref, _, _)) + | Item.Value vref | Item.CustomBuilder (_, vref) -> mkXmlComment (GetXmlDocSigOfValRef g vref) | Item.UnionCase (ucinfo, _) -> @@ -311,7 +311,7 @@ module internal SymbolHelpers = mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) | Item.OtherName(container = Some argContainer) -> - match argContainer with + match argContainer with | ArgumentContainer.Method minfo -> mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) | ArgumentContainer.Type tcref -> mkXmlComment (GetXmlDocSigOfEntityRef infoReader m tcref) @@ -321,7 +321,7 @@ module internal SymbolHelpers = | Item.SetterArg (_, item) -> GetXmlDocHelpSigOfItemForLookup infoReader m item - // These do not have entires in XML doc files + // These do not have entries in XML doc files | Item.CustomOperation _ | Item.OtherName _ | Item.ActivePatternResult _ @@ -340,38 +340,38 @@ module internal SymbolHelpers = |> GetXmlDocFromLoader infoReader /// Produce an XmlComment with a signature or raw text, given the F# comment and the item - let GetXmlCommentForItemAux (xmlDoc: XmlDoc option) (infoReader: InfoReader) m d = - match xmlDoc with - | Some xmlDoc when not xmlDoc.IsEmpty -> + let GetXmlCommentForItemAux (xmlDoc: XmlDoc option) (infoReader: InfoReader) m d = + match xmlDoc with + | Some xmlDoc when not xmlDoc.IsEmpty -> FSharpXmlDoc.FromXmlText xmlDoc | _ -> GetXmlDocHelpSigOfItemForLookup infoReader m d - let GetXmlCommentForMethInfoItem infoReader m d (minfo: MethInfo) = + let GetXmlCommentForMethInfoItem infoReader m d (minfo: MethInfo) = if minfo.HasDirectXmlComment || minfo.XmlDoc.NonEmpty then - GetXmlCommentForItemAux (Some minfo.XmlDoc) infoReader m d + GetXmlCommentForItemAux (Some minfo.XmlDoc) infoReader m d else mkXmlComment (GetXmlDocSigOfMethInfo infoReader m minfo) - let FormatTyparMapping denv (prettyTyparInst: TyparInstantiation) = - [ for tp, ty in prettyTyparInst -> + let FormatTyparMapping denv (prettyTyparInst: TyparInstantiation) = + [ for tp, ty in prettyTyparInst -> wordL (tagTypeParameter ("'" + tp.DisplayName)) ^^ wordL (tagText (FSComp.SR.descriptionWordIs())) ^^ NicePrint.layoutType denv ty ] [] - let (|ItemWhereTypIsPreferred|_|) item = - match item with + let (|ItemWhereTypIsPreferred|_|) item = + match item with | Item.DelegateCtor ty | Item.CtorGroup(_, [DefaultStructCtor(_, ty)]) | Item.Types(_, [ty]) -> ValueSome ty | _ -> ValueNone - /// Specifies functions for comparing 'Item' objects with respect to the user - /// (this means that some values that are not technically equal are treated as equal + /// Specifies functions for comparing 'Item' objects with respect to the user + /// (this means that some values that are not technically equal are treated as equal /// if this is what we want to show to the user, because we're comparing just the name // for some cases e.g. when using 'fullDisplayTextOfModRef') - let ItemDisplayPartialEquality g = - { new IPartialEqualityComparer<_> with - member x.InEqualityRelation item = - match item with + let ItemDisplayPartialEquality g = + { new IPartialEqualityComparer<_> with + member x.InEqualityRelation item = + match item with | Item.Trait _ -> true | Item.Types(_, _ :: _) -> true | Item.ILField(_) -> true @@ -385,7 +385,7 @@ module internal SymbolHelpers = | Item.ActivePatternCase _ -> true | Item.DelegateCtor _ -> true | Item.UnionCase _ -> true - | Item.ExnCase _ -> true + | Item.ExnCase _ -> true | Item.Event _ -> true | Item.Property _ -> true | Item.CtorGroup _ -> true @@ -404,15 +404,15 @@ module internal SymbolHelpers = | Item.ModuleOrNamespaces [] -> false //| _ -> false - - member x.Equals(item1, item2) = + + member x.Equals(item1, item2) = match item1,item2 with | null,null -> true | null,_ | _,null -> false | item1,item2 -> // This may explore assemblies that are not in the reference set. // In this case just bail out and assume items are not equal - protectAssemblyExploration false (fun () -> + protectAssemblyExploration false (fun () -> let equalHeadTypes(ty1, ty2) = match tryTcrefOfAppTy g ty1 with | ValueSome tcref1 -> @@ -421,41 +421,41 @@ module internal SymbolHelpers = | _ -> typeEquiv g ty1 ty2 | _ -> typeEquiv g ty1 ty2 - ItemsAreEffectivelyEqual g item1 item2 || + ItemsAreEffectivelyEqual g item1 item2 || // Much of this logic is already covered by 'ItemsAreEffectivelyEqual' - match item1, item2 with + match item1, item2 with | Item.DelegateCtor ty1, Item.DelegateCtor ty2 -> equalHeadTypes(ty1, ty2) | Item.Types(dn1, ty1 :: _), Item.Types(dn2, ty2 :: _) -> // Bug 4403: We need to compare names as well, because 'int' and 'Int32' are physically the same type, but we want to show both - dn1 = dn2 && equalHeadTypes(ty1, ty2) - - // Prefer a type to a DefaultStructCtor, a DelegateCtor and a FakeInterfaceCtor - | ItemWhereTypIsPreferred ty1, ItemWhereTypIsPreferred ty2 -> equalHeadTypes(ty1, ty2) + dn1 = dn2 && equalHeadTypes(ty1, ty2) + + // Prefer a type to a DefaultStructCtor, a DelegateCtor and a FakeInterfaceCtor + | ItemWhereTypIsPreferred ty1, ItemWhereTypIsPreferred ty2 -> equalHeadTypes(ty1, ty2) | Item.ExnCase tcref1, Item.ExnCase tcref2 -> tyconRefEq g tcref1 tcref2 | Item.ILField(fld1), Item.ILField(fld2) -> ILFieldInfo.ILFieldInfosUseIdenticalDefinitions fld1 fld2 - | Item.CustomOperation (_, _, Some minfo1), Item.CustomOperation (_, _, Some minfo2) -> + | Item.CustomOperation (_, _, Some minfo1), Item.CustomOperation (_, _, Some minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2 - | Item.TypeVar (nm1, tp1), Item.TypeVar (nm2, tp2) -> + | Item.TypeVar (nm1, tp1), Item.TypeVar (nm2, tp2) -> (nm1 = nm2) && typarRefEq tp1 tp2 | Item.ModuleOrNamespaces(modref1 :: _), Item.ModuleOrNamespaces(modref2 :: _) -> fullDisplayTextOfModRef modref1 = fullDisplayTextOfModRef modref2 | Item.SetterArg(id1, _), Item.SetterArg(id2, _) -> Range.equals id1.idRange id2.idRange && id1.idText = id2.idText - | Item.MethodGroup(_, meths1, _), Item.MethodGroup(_, meths2, _) -> + | Item.MethodGroup(_, meths1, _), Item.MethodGroup(_, meths2, _) -> Seq.zip meths1 meths2 |> Seq.forall (fun (minfo1, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) - | (Item.Value vref1 | Item.CustomBuilder (_, vref1)), (Item.Value vref2 | Item.CustomBuilder (_, vref2)) -> + | (Item.Value vref1 | Item.CustomBuilder (_, vref1)), (Item.Value vref2 | Item.CustomBuilder (_, vref2)) -> valRefEq g vref1 vref2 | Item.ActivePatternCase(APElemRef(_apinfo1, vref1, idx1, _)), Item.ActivePatternCase(APElemRef(_apinfo2, vref2, idx2, _)) -> idx1 = idx2 && valRefEq g vref1 vref2 - | Item.UnionCase(UnionCaseInfo(_, ur1), _), Item.UnionCase(UnionCaseInfo(_, ur2), _) -> + | Item.UnionCase(UnionCaseInfo(_, ur1), _), Item.UnionCase(UnionCaseInfo(_, ur2), _) -> g.unionCaseRefEq ur1 ur2 - | Item.RecdField(RecdFieldInfo(_, RecdFieldRef(tcref1, n1))), Item.RecdField(RecdFieldInfo(_, RecdFieldRef(tcref2, n2))) -> + | Item.RecdField(RecdFieldInfo(_, RecdFieldRef(tcref1, n1))), Item.RecdField(RecdFieldInfo(_, RecdFieldRef(tcref2, n2))) -> (tyconRefEq g tcref1 tcref2) && (n1 = n2) // there is no direct function as in the previous case - | Item.Property(info = pi1s), Item.Property(info = pi2s) -> + | Item.Property(info = pi1s), Item.Property(info = pi2s) -> (pi1s, pi2s) ||> List.forall2 PropInfo.PropInfosUseIdenticalDefinitions - | Item.Event evt1, Item.Event evt2 -> + | Item.Event evt1, Item.Event evt2 -> EventInfo.EventInfosUseIdenticalDefinitions evt1 evt2 | Item.AnonRecdField(anon1, _, i1, _), Item.AnonRecdField(anon2, _, i2, _) -> anonInfoEquiv anon1 anon2 && i1 = i2 @@ -470,13 +470,13 @@ module internal SymbolHelpers = | Item.Types(_, [AbbrevOrAppTy(tcref1, _)]), Item.UnqualifiedType([tcref2]) -> tyconRefEq g tcref1 tcref2 | Item.UnqualifiedType([tcref1]), Item.Types(_, [AbbrevOrAppTy(tcref2, _)]) -> tyconRefEq g tcref1 tcref2 | _ -> false) - + member x.GetHashCode item = // This may explore assemblies that are not in the reference set. // In this case just bail out and use a random hash code - protectAssemblyExploration 1027 (fun () -> - match item with - | ItemWhereTypIsPreferred ty -> + protectAssemblyExploration 1027 (fun () -> + match item with + | ItemWhereTypIsPreferred ty -> match tryTcrefOfAppTy g ty with | ValueSome tcref -> hash tcref.LogicalName | _ -> 1010 @@ -485,7 +485,7 @@ module internal SymbolHelpers = | Item.TypeVar (nm, _tp) -> hash nm | Item.CustomOperation (_, _, Some minfo) -> minfo.ComputeHashCode() | Item.CustomOperation (_, _, None) -> 1 - | Item.ModuleOrNamespaces(modref :: _) -> hash (fullDisplayTextOfModRef modref) + | Item.ModuleOrNamespaces(modref :: _) -> hash (fullDisplayTextOfModRef modref) | Item.SetterArg(id, _) -> hash (id.idRange, id.idText) | Item.MethodGroup(_, meths, _) -> meths |> List.fold (fun st a -> st + a.ComputeHashCode()) 0 | Item.CtorGroup(name, meths) -> name.GetHashCode() + (meths |> List.fold (fun st a -> st + a.ComputeHashCode()) 0) @@ -512,30 +512,30 @@ module internal SymbolHelpers = | Item.DelegateCtor _ | Item.ModuleOrNamespaces [] -> 0 ) } - + /// Remove all duplicate items - let RemoveDuplicateItems g (items: ItemWithInst list) = + let RemoveDuplicateItems g (items: ItemWithInst list) = if isNil items then items else items |> IPartialEqualityComparer.partialDistinctBy (IPartialEqualityComparer.On (fun item -> item.Item) (ItemDisplayPartialEquality g)) - let IsExplicitlySuppressed (g: TcGlobals) (item: Item) = + let IsExplicitlySuppressed (g: TcGlobals) (item: Item) = // This may explore assemblies that are not in the reference set. // In this case just assume the item is not suppressed. - protectAssemblyExploration true (fun () -> - match item with - | Item.Types(it, [ty]) -> + protectAssemblyExploration true (fun () -> + match item with + | Item.Types(it, [ty]) -> match tryTcrefOfAppTy g ty with | ValueSome tcr1 -> - g.suppressed_types + g.suppressed_types |> List.exists (fun supp -> let generalizedSupp = generalizedTyconRef g supp // check the display name is precisely the one we're suppressing match tryTcrefOfAppTy g generalizedSupp with | ValueSome tcr2 -> it = supp.DisplayName && - // check if they are the same logical type (after removing all abbreviations) + // check if they are the same logical type (after removing all abbreviations) tyconRefEq g tcr1 tcr2 - | _ -> false) + | _ -> false) | _ -> false | _ -> false) @@ -543,7 +543,7 @@ module internal SymbolHelpers = let RemoveExplicitlySuppressed (g: TcGlobals) (items: ItemWithInst list) = items |> List.filter (fun item -> not (IsExplicitlySuppressed g item.Item)) - let SimplerDisplayEnv denv = + let SimplerDisplayEnv denv = { denv with shortConstraints=true showStaticallyResolvedTyparAnnotations=false showNullnessAnnotations = Some true @@ -551,7 +551,7 @@ module internal SymbolHelpers = suppressNestedTypes=true maxMembers=Some EnvMisc2.maxMembers } - let rec FullNameOfItem g item = + let rec FullNameOfItem g item = let denv = DisplayEnv.Empty g match item with | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(vref=vref)) }) @@ -559,7 +559,7 @@ module internal SymbolHelpers = | Item.UnionCase (ucinfo, _) -> fullDisplayTextOfUnionCaseRef ucinfo.UnionCaseRef | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.DisplayNameByIdx idx | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.DisplayName - | Item.ExnCase ecref -> fullDisplayTextOfExnRef ecref + | Item.ExnCase ecref -> fullDisplayTextOfExnRef ecref | Item.AnonRecdField(anon, _argTys, i, _) -> anon.DisplayNameByIdx i | Item.RecdField rfinfo -> fullDisplayTextOfRecdFieldRef rfinfo.RecdFieldRef | Item.NewDef id -> id.idText @@ -568,11 +568,11 @@ module internal SymbolHelpers = | Item.Property(info = pinfo :: _) -> buildString (fun os -> NicePrint.outputTyconRef denv os pinfo.DeclaringTyconRef; bprintf os ".%s" pinfo.PropertyName) | Item.CustomOperation (customOpName, _, _) -> customOpName | Item.CtorGroup(_, minfo :: _) -> buildString (fun os -> NicePrint.outputTyconRef denv os minfo.DeclaringTyconRef) - | Item.MethodGroup(_, _, Some minfo) -> buildString (fun os -> NicePrint.outputTyconRef denv os minfo.DeclaringTyconRef; bprintf os ".%s" minfo.DisplayName) - | Item.MethodGroup(_, minfo :: _, _) -> buildString (fun os -> NicePrint.outputTyconRef denv os minfo.DeclaringTyconRef; bprintf os ".%s" minfo.DisplayName) + | Item.MethodGroup(_, _, Some minfo) -> buildString (fun os -> NicePrint.outputTyconRef denv os minfo.DeclaringTyconRef; bprintf os ".%s" minfo.DisplayName) + | Item.MethodGroup(_, minfo :: _, _) -> buildString (fun os -> NicePrint.outputTyconRef denv os minfo.DeclaringTyconRef; bprintf os ".%s" minfo.DisplayName) | Item.UnqualifiedType (tcref :: _) -> buildString (fun os -> NicePrint.outputTyconRef denv os tcref) - | Item.DelegateCtor ty - | Item.Types(_, ty :: _) -> + | Item.DelegateCtor ty + | Item.Types(_, ty :: _) -> match tryTcrefOfAppTy g ty with | ValueSome tcref -> buildString (fun os -> NicePrint.outputTyconRef denv os tcref) | _ -> "" @@ -585,16 +585,16 @@ module internal SymbolHelpers = | Item.SetterArg (_, item) -> FullNameOfItem g item | Item.ImplicitOp(id, _) -> id.idText | Item.UnionCaseField (UnionCaseInfo (_, ucref), fieldIndex) -> ucref.FieldByIndex(fieldIndex).DisplayName - // unreachable - | Item.UnqualifiedType([]) - | Item.Types(_, []) - | Item.CtorGroup(_, []) - | Item.MethodGroup(_, [], _) + // unreachable + | Item.UnqualifiedType([]) + | Item.Types(_, []) + | Item.CtorGroup(_, []) + | Item.MethodGroup(_, [], _) | Item.ModuleOrNamespaces [] | Item.Property(info = []) -> "" /// Output the description of a language item - let rec GetXmlCommentForItem (infoReader: InfoReader) m item = + let rec GetXmlCommentForItem (infoReader: InfoReader) m item = let g = infoReader.g match item with | Item.ImplicitOp(_, sln) -> @@ -609,19 +609,19 @@ module internal SymbolHelpers = | None -> GetXmlCommentForItemAux None infoReader m item - | Item.Value vref | Item.CustomBuilder (_, vref) -> + | Item.Value vref | Item.CustomBuilder (_, vref) -> let doc = if valRefInThisAssembly g.compilingFSharpCore vref || vref.XmlDoc.NonEmpty then Some vref.XmlDoc else None GetXmlCommentForItemAux doc infoReader m item - | Item.UnionCase(ucinfo, _) -> + | Item.UnionCase(ucinfo, _) -> let doc = if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ucinfo.TyconRef || ucinfo.UnionCase.XmlDoc.NonEmpty then Some ucinfo.UnionCase.XmlDoc else None GetXmlCommentForItemAux doc infoReader m item - | Item.ActivePatternCase apref -> + | Item.ActivePatternCase apref -> let doc = Some apref.ActivePatternVal.XmlDoc GetXmlCommentForItemAux doc infoReader m item - | Item.ExnCase ecref -> + | Item.ExnCase ecref -> let doc = if tyconRefUsesLocalXmlDoc g.compilingFSharpCore ecref || ecref.XmlDoc.NonEmpty then Some ecref.XmlDoc else None GetXmlCommentForItemAux doc infoReader m item @@ -641,13 +641,13 @@ module internal SymbolHelpers = let doc = if einfo.HasDirectXmlComment || einfo.XmlDoc.NonEmpty then Some einfo.XmlDoc else None GetXmlCommentForItemAux doc infoReader m item - | Item.Property(info = pinfos) -> + | Item.Property(info = pinfos) -> let pinfo = pinfos.Head let doc = if pinfo.HasDirectXmlComment || pinfo.XmlDoc.NonEmpty then Some pinfo.XmlDoc else None GetXmlCommentForItemAux doc infoReader m item - | Item.CustomOperation (_, _, Some minfo) - | Item.CtorGroup(_, minfo :: _) + | Item.CustomOperation (_, _, Some minfo) + | Item.CtorGroup(_, minfo :: _) | Item.MethodGroup(_, minfo :: _, _) -> GetXmlCommentForMethInfoItem infoReader m item minfo @@ -673,7 +673,7 @@ module internal SymbolHelpers = | _ -> None GetXmlCommentForItemAux doc infoReader m item - | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> + | Item.ModuleOrNamespaces(modref :: _ as modrefs) -> let definiteNamespace = modrefs |> List.forall (fun modref -> modref.IsNamespace) if not definiteNamespace then let doc = if entityRefInThisAssembly g.compilingFSharpCore modref || modref.XmlDoc.NonEmpty then Some modref.XmlDoc else None @@ -685,7 +685,7 @@ module internal SymbolHelpers = let doc = match argContainer with | Some(ArgumentContainer.Method minfo) -> - if minfo.HasDirectXmlComment || minfo.XmlDoc.NonEmpty then Some minfo.XmlDoc else None + if minfo.HasDirectXmlComment || minfo.XmlDoc.NonEmpty then Some minfo.XmlDoc else None | Some(ArgumentContainer.Type tcref) -> if tyconRefUsesLocalXmlDoc g.compilingFSharpCore tcref || tcref.XmlDoc.NonEmpty then Some tcref.XmlDoc else None | _ -> None @@ -699,9 +699,9 @@ module internal SymbolHelpers = None GetXmlCommentForItemAux doc infoReader m item - | Item.SetterArg (_, item) -> + | Item.SetterArg (_, item) -> GetXmlCommentForItem infoReader m item - + // In all these cases, there is no direct XML documentation from F# comments | Item.MethodGroup (_, [], _) | Item.CtorGroup (_, []) @@ -735,7 +735,7 @@ module internal SymbolHelpers = #if !NO_TYPEPROVIDERS - /// Determine if an item is a provided type + /// Determine if an item is a provided type [] let (|ItemIsProvidedType|_|) g item = match item with @@ -757,11 +757,11 @@ module internal SymbolHelpers = match tys with | [AppTy g (tcref, _typeInst)] -> if tcref.IsProvidedErasedTycon || tcref.IsProvidedGeneratedTycon then - let typeBeforeArguments = - match tcref.TypeReprInfo with + let typeBeforeArguments = + match tcref.TypeReprInfo with | TProvidedTypeRepr info -> info.ProvidedType | _ -> failwith "unreachable" - let staticParameters = typeBeforeArguments.PApplyWithProvider((fun (typeBeforeArguments, provider) -> typeBeforeArguments.GetStaticParameters provider), range=m) + let staticParameters = typeBeforeArguments.PApplyWithProvider((fun (typeBeforeArguments, provider) -> typeBeforeArguments.GetStaticParameters provider), range=m) let staticParameters = staticParameters.PApplyArray(id, "GetStaticParameters", m) ValueSome staticParameters else @@ -774,11 +774,11 @@ module internal SymbolHelpers = match item with // Prefer the static parameters from the uninstantiated method info | Item.MethodGroup(_, _, Some minfo) -> - match minfo.ProvidedStaticParameterInfo with + match minfo.ProvidedStaticParameterInfo with | Some (_, staticParameters) -> ValueSome staticParameters | _ -> ValueNone | Item.MethodGroup(_, [minfo], _) -> - match minfo.ProvidedStaticParameterInfo with + match minfo.ProvidedStaticParameterInfo with | Some (_, staticParameters) -> ValueSome staticParameters | _ -> ValueNone | _ -> ValueNone @@ -794,20 +794,20 @@ module internal SymbolHelpers = #endif /// Get the "F1 Keyword" associated with an item, for looking up documentation help indexes on the web - let rec GetF1Keyword (g: TcGlobals) item = + let rec GetF1Keyword (g: TcGlobals) item = let rec getKeywordForMethInfo (minfo : MethInfo) = - match minfo with + match minfo with | FSMeth(_, _, vref, _) -> match vref.TryDeclaringEntity with | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef) + "." + vref.CompiledName g.CompilerGlobalState |> Some | ParentNone -> None - + | ILMeth (_, minfo, _) -> let typeString = minfo.DeclaringTyconRef |> ticksAndArgCountTextOfTyconRef let paramString = - let nGenericParams = minfo.RawMetadata.GenericParams.Length + let nGenericParams = minfo.RawMetadata.GenericParams.Length if nGenericParams > 0 then "``"+(nGenericParams.ToString()) else "" sprintf "%s.%s%s" typeString minfo.RawMetadata.Name paramString |> Some @@ -816,17 +816,17 @@ module internal SymbolHelpers = #if !NO_TYPEPROVIDERS | ProvidedMeth _ -> None #endif - + match item with - | Item.Value vref | Item.CustomBuilder (_, vref) -> + | Item.Value vref | Item.CustomBuilder (_, vref) -> let v = vref.Deref if v.IsModuleBinding && v.HasDeclaringEntity then let tyconRef = v.DeclaringEntity let paramsString = match v.Typars with | [] -> "" - | l -> "``"+(List.length l).ToString() - + | l -> "``"+(List.length l).ToString() + sprintf "%s.%s%s" (tyconRef |> ticksAndArgCountTextOfTyconRef) (v.CompiledName g.CompilerGlobalState) paramsString |> Some else None @@ -839,39 +839,39 @@ module internal SymbolHelpers = | Item.RecdField rfi -> (rfi.TyconRef |> ticksAndArgCountTextOfTyconRef) + "." + rfi.DisplayName |> Some - + | Item.AnonRecdField _ -> None - + | Item.ILField finfo -> - match finfo with - | ILFieldInfo(tinfo, fdef) -> + match finfo with + | ILFieldInfo(tinfo, fdef) -> (tinfo.TyconRefOfRawMetadata |> ticksAndArgCountTextOfTyconRef) + "." + fdef.Name |> Some #if !NO_TYPEPROVIDERS | ProvidedField _ -> None #endif - | Item.Types(_, AppTy g (tcref, _) :: _) + | Item.Types(_, AppTy g (tcref, _) :: _) | Item.DelegateCtor(AppTy g (tcref, _)) | Item.UnqualifiedType (tcref :: _) - | Item.ExnCase tcref -> + | Item.ExnCase tcref -> // strip off any abbreviation - match generalizedTyconRef g tcref with + match generalizedTyconRef g tcref with | AppTy g (tcref, _) -> Some (ticksAndArgCountTextOfTyconRef tcref) | _ -> None // Pathological cases of the above - | Item.Types _ + | Item.Types _ | Item.DelegateCtor _ - | Item.UnqualifiedType [] -> + | Item.UnqualifiedType [] -> None - | Item.ModuleOrNamespaces modrefs -> - match modrefs with - | modref :: _ -> + | Item.ModuleOrNamespaces modrefs -> + match modrefs with + | modref :: _ -> // namespaces from type providers need to be handled separately because they don't have compiled representation // otherwise we'll fail at tast.fs match modref.Deref.TypeReprInfo with -#if !NO_TYPEPROVIDERS - | TProvidedNamespaceRepr _ -> +#if !NO_TYPEPROVIDERS + | TProvidedNamespaceRepr _ -> modref.CompilationPathOpt |> Option.bind (fun path -> // works similar to generation of xml-docs at tastops.fs, probably too similar @@ -884,17 +884,17 @@ module internal SymbolHelpers = | _ -> modref.Deref.CompiledRepresentationForNamedType.FullName |> Some | [] -> None // Pathological case of the above - | Item.Property(info = pinfo :: _) -> - match pinfo with - | FSProp(_, _, Some vref, _) - | FSProp(_, _, _, Some vref) -> + | Item.Property(info = pinfo :: _) -> + match pinfo with + | FSProp(_, _, Some vref, _) + | FSProp(_, _, _, Some vref) -> // per spec, extension members in F1 keywords are qualified with definition class - match vref.TryDeclaringEntity with + match vref.TryDeclaringEntity with | Parent tcref -> - (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some + (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some | ParentNone -> None - | ILProp(ILPropInfo(tinfo, pdef)) -> + | ILProp(ILPropInfo(tinfo, pdef)) -> let tcref = tinfo.TyconRefOfRawMetadata (tcref |> ticksAndArgCountTextOfTyconRef)+"."+pdef.Name |> Some | FSProp _ -> None @@ -902,25 +902,25 @@ module internal SymbolHelpers = | ProvidedProp _ -> None #endif | Item.Property(info = []) -> None // Pathological case of the above - - | Item.Event einfo -> - match einfo with + + | Item.Event einfo -> + match einfo with | ILEvent _ -> let tcref = einfo.DeclaringTyconRef (tcref |> ticksAndArgCountTextOfTyconRef)+"."+einfo.EventName |> Some | FSEvent(_, pinfo, _, _) -> - match pinfo.ArbitraryValRef with + match pinfo.ArbitraryValRef with | Some vref -> // per spec, members in F1 keywords are qualified with definition class - match vref.TryDeclaringEntity with - | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some + match vref.TryDeclaringEntity with + | Parent tcref -> (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.PropertyName|> Some | ParentNone -> None | None -> None #if !NO_TYPEPROVIDERS - | ProvidedEvent _ -> None + | ProvidedEvent _ -> None #endif | Item.CtorGroup(_, minfos) -> - match minfos with + match minfos with | [] -> None | FSMeth(_, _, vref, _) :: _ -> match vref.TryDeclaringEntity with @@ -935,14 +935,14 @@ module internal SymbolHelpers = | Item.CustomOperation (_, _, Some minfo) -> getKeywordForMethInfo minfo | Item.MethodGroup(_, _, Some minfo) -> getKeywordForMethInfo minfo | Item.MethodGroup(_, minfo :: _, _) -> getKeywordForMethInfo minfo - | Item.SetterArg (_, propOrField) -> GetF1Keyword g propOrField - | Item.MethodGroup(_, [], _) + | Item.SetterArg (_, propOrField) -> GetF1Keyword g propOrField + | Item.MethodGroup(_, [], _) | Item.CustomOperation (_, _, None) // "into" | Item.NewDef _ // "let x$yz = ..." - no keyword - | Item.OtherName _ // no keyword on named parameters + | Item.OtherName _ // no keyword on named parameters | Item.Trait _ | Item.UnionCaseField _ - | Item.TypeVar _ + | Item.TypeVar _ | Item.ImplicitOp _ | Item.ActivePatternResult _ // "let (|Foo|Bar|) = .. Fo$o ..." - no keyword -> None @@ -954,21 +954,21 @@ module internal SymbolHelpers = // the VS integration. let SelectMethodGroupItems2 g (m: range) (item: ItemWithInst) : ItemWithInst list = ignore m - match item.Item with + match item.Item with | Item.MethodGroup(nm, minfos, orig) -> minfos |> List.map (fun minfo -> { Item = Item.MethodGroup(nm, [minfo], orig); TyparInstantiation = item.TyparInstantiation }) | Item.CtorGroup(nm, cinfos) -> - cinfos |> List.map (fun minfo -> { Item = Item.CtorGroup(nm, [minfo]); TyparInstantiation = item.TyparInstantiation }) + cinfos |> List.map (fun minfo -> { Item = Item.CtorGroup(nm, [minfo]); TyparInstantiation = item.TyparInstantiation }) | Item.DelegateCtor _ -> [item] - | Item.NewDef _ + | Item.NewDef _ | Item.ILField _ -> [] | Item.Event _ -> [] | Item.RecdField rfinfo -> if isForallFunctionTy g rfinfo.FieldType then [item] else [] | Item.Value v -> if isForallFunctionTy g v.Type then [item] else [] | Item.UnionCase(ucr, _) -> if not ucr.UnionCase.IsNullary then [item] else [] | Item.ExnCase ecr -> if isNil (recdFieldsOfExnDefRef ecr) then [] else [item] - | Item.Property(info = pinfos) -> - let pinfo = List.head pinfos + | Item.Property(info = pinfos) -> + let pinfo = List.head pinfos if pinfo.IsIndexer then [item] else [] #if !NO_TYPEPROVIDERS | ItemIsWithStaticArguments m g _ -> [item] // we pretend that provided-types-with-static-args are method-like in order to get ParamInfo for them diff --git a/src/Compiler/Utilities/range.fsi b/src/Compiler/Utilities/range.fsi index 40a52efa879..90deb76d976 100755 --- a/src/Compiler/Utilities/range.fsi +++ b/src/Compiler/Utilities/range.fsi @@ -6,7 +6,7 @@ namespace FSharp.Compiler.Text open System.Collections.Generic /// An index into a global tables of filenames -type internal FileIndex = int32 +type internal FileIndex = int32 [] type internal NotedSourceConstruct = @@ -59,10 +59,10 @@ type Position = /// Check if the position is adjacent to another position member internal IsAdjacentTo: otherPos: Position -> bool - /// Decode a position fro a 64-bit integer + /// Decode a position for a 64-bit integer static member internal Decode: int64 -> pos - /// The maximum number of bits needed to store an encoded position + /// The maximum number of bits needed to store an encoded position static member internal EncodingSize: int /// Represents a position in a file @@ -105,7 +105,7 @@ type Range = /// Synthetic marks ranges which are produced by intermediate compilation phases. This /// bit signifies that the range covers something that should not be visible to language /// service operations like dot-completion. - member IsSynthetic: bool + member IsSynthetic: bool /// Convert a range to be synthetic member internal MakeSynthetic: unit -> range @@ -122,13 +122,13 @@ type Range = /// The range where all values are zero static member Zero: range - + /// Represents a range within a file and range = Range /// Represents a line number when using zero-based line counting (used by Visual Studio) #if CHECK_LINE0_TYPES -// Visual Studio uses line counts starting at 0, F# uses them starting at 1 +// Visual Studio uses line counts starting at 0, F# uses them starting at 1 [] type ZeroBasedLineAnnotation type Line0 = int @@ -158,7 +158,7 @@ module Position = /// Compare positions for greater-than-or-equal-to val posGeq: pos -> pos -> bool - /// Convert a position from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) + /// Convert a position from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) val fromZ: line:Line0 -> column:int -> pos /// Convert a position from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) @@ -188,10 +188,10 @@ module Range = /// Ordering on positions val posOrder: IComparer - /// This view of range marks uses file indexes explicitly + /// This view of range marks uses file indexes explicitly val mkFileIndexRange: FileIndex -> pos -> pos -> range - /// This view hides the use of file indexes and just uses filenames + /// This view hides the use of file indexes and just uses filenames val mkRange: string -> pos -> pos -> range /// Make a range for the first non-whitespace line of the file if any. Otherwise use line 1 chars 0-80. @@ -211,21 +211,21 @@ module Range = /// Union two ranges, taking their first occurring start position and last occurring end position val unionRanges: range -> range -> range - + // Create a new range with the given start and end positions val withStartEnd: Position -> Position -> range -> range - + // Create a new range with the given start position val withStart: Position -> range -> range - + // Create a new range with the given end position val withEnd: Position -> range -> range - + // Create a new range with the start position shifted by the given deltas val shiftStart: int -> int -> range -> range - + // Create a new range with the end position shifted by the given deltas - val shiftEnd: int -> int -> range -> range + val shiftEnd: int -> int -> range -> range /// Test to see if one range contains another range val rangeContainsRange: range -> range -> bool @@ -247,7 +247,7 @@ module Range = /// A range associated with a dummy file for the command line arguments val rangeCmdArgs: range - + /// Convert a range to a string val stringOfRange: range -> string @@ -263,10 +263,8 @@ module Range = /// Functions related to converting between lines indexed at 0 and 1 module Line = - /// Convert a line number from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) + /// Convert a line number from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) val fromZ: Line0 -> int /// Convert a line number from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) - val toZ: int -> Line0 - - + val toZ: int -> Line0 diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index c6346cb30f2..e21079818d7 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -462,7 +462,7 @@ module rec Compiler = let FsxFromPath (path: string) : CompilationUnit = fsFromString (SourceFromPath path) |> FS - + let Fs (source: string) : CompilationUnit = fsFromString (FsSource source) |> FS @@ -1049,7 +1049,7 @@ module rec Compiler = let compilation = Compilation.Compilation([], CompileOutput.Exe,Array.empty, TargetFramework.Current, references, None, None) evaluateReferences outputDirectory fsSource.IgnoreWarnings compilation |> fst - + let options = [| yield! fsSource.Options |> Array.ofList @@ -1211,7 +1211,7 @@ module rec Compiler = CompilationResult.Success (mkResult output) else let err = (errors |> String.concat "\n").Replace("\r\n","\n") - let output = + let output = ExecutionOutput {Outcome = NoExitCode; StdOut = String.Empty; StdErr = err } CompilationResult.Failure (mkResult output) @@ -1243,7 +1243,7 @@ Actual: elif FileSystem.FileExistsShim baseline.FilePath then FileSystem.FileDeleteShim baseline.FilePath - + let private createBaselineErrors (baselineFile: BaselineFile) (actualErrors: string) : unit = printfn $"creating baseline error file for convenience: {baselineFile.FilePath}, expected: {baselineFile.BslSource}" let file = FileSystem.OpenFileForWriteShim(baselineFile.FilePath) @@ -1300,7 +1300,7 @@ Actual: | Some p -> match ILChecker.verifyILAndReturnActual [] p expected with | true, _, _ -> result - | false, errorMsg, _actualIL -> + | false, errorMsg, _actualIL -> CompilationResult.Failure( {s with Output = Some (ExecutionOutput {Outcome = NoExitCode; StdOut = errorMsg; StdErr = ""})} ) | CompilationResult.Failure f -> printfn "Failure:" @@ -1614,7 +1614,7 @@ Actual: // For lists longer than 100 errors: expectedErrors |> List.iter System.Diagnostics.Debug.WriteLine - // TODO: Check all "categories", collect all results and print alltogether. + // TODO: Check all "categories", collect all results and print all together. checkEqual "Errors count" expectedErrors.Length sourceErrors.Length (sourceErrors, expectedErrors) @@ -1832,10 +1832,10 @@ Actual: let m = Regex(pattern, RegexOptions.Multiline).Match(input) if m.Success then m.Index - else + else -1 else - input.IndexOf(pattern) + input.IndexOf(pattern) let private checkOutputInOrderCore useWildcards (category: string) (substrings: string list) (selector: ExecutionOutput -> string) (result: CompilationResult) : CompilationResult = match result.RunOutput with @@ -1944,10 +1944,9 @@ Actual: let printSignatures cUnit = printSignaturesImpl None cUnit let printSignaturesWith pageWidth cUnit = printSignaturesImpl (Some pageWidth) cUnit - let getImpliedSignatureHash cUnit = + let getImpliedSignatureHash cUnit = let tcResults = cUnit |> typecheckResults let hash = tcResults.CalculateSignatureHash() match hash with | Some h -> h | None -> failwith "Implied signature hash returned 'None' which should not happen" - diff --git a/tests/fsharp/core/members/absil.fsi b/tests/fsharp/core/members/absil.fsi index 11d322553a2..c7755fa4222 100644 --- a/tests/fsharp/core/members/absil.fsi +++ b/tests/fsharp/core/members/absil.fsi @@ -6,13 +6,13 @@ open System type Guid = Option - type Document = + type Document = { Language: Option; Vendor: Option; Type: Option; File: string; } - type SourceAnnotation = + type SourceAnnotation = { Document: Document; Line: int; Column: int; @@ -23,43 +23,43 @@ open System type ModuleName = string type Locale = string - type PublicKeyInfo = + type PublicKeyInfo = | PublicKey of Bytes | PublicKeyToken of Bytes type VersionInfo = UInt16 * UInt16 * UInt16 * UInt16 - type AssemblyRef = + type AssemblyRef = { Name: string; Hash: Option; PublicKeyInfo: Option; - Version: Option; - Locale: Option; } + Version: Option; + Locale: Option; } - type ModuleRef = + type ModuleRef = { Name: string; NoMetadata: bool; - Hash: Option; } + Hash: Option; } - type ScopeRef = - | Local - | Module of ModuleRef - | Assembly of AssemblyRef + type ScopeRef = + | Local + | Module of ModuleRef + | Assembly of AssemblyRef - type BasicCallconv = + type BasicCallconv = | Default - | Cdecl - | Stdcall - | Thiscall - | Fastcall + | Cdecl + | Stdcall + | Thiscall + | Fastcall | Vararg - - type HasThis = + + type HasThis = | Instance (* accepts an implicit 'this' pointer *) | InstanceExplicit (* any 'this' pointer is made explicit (C++ only) *) | Static (* no 'this' pointer is passed *) - type Callconv + type Callconv static member InstanceCallconv: Callconv static member StaticCallconv: Callconv member IsVararg: bool @@ -72,7 +72,7 @@ open System val is_static_callconv: Callconv -> bool type ArrayShape - member Details: (Int32 option * Int32 option) list + member Details: (Int32 option * Int32 option) list member Rank: Int32 static member SingleDimensional: ArrayShape @@ -84,7 +84,7 @@ open System - type TypeRef + type TypeRef member TypeName: string member FullTypeName: string member EnclosingTypeNames: List @@ -95,17 +95,17 @@ open System val enclosing_tnames_of_tref: TypeRef -> List val scoref_of_tref: TypeRef -> ScopeRef - type TypeSpec + type TypeSpec member TypeRef: TypeSpec -> TypeRef member TypeName: TypeSpec -> string member FullTypeName: TypeSpec -> string member ScopeRef: TypeSpec -> ScopeRef member EnclosingTypeNames: TypeSpec -> List - - and Type + + and Type // member Details: (?k:TypeKind. TypeDetails) // These properties let you access the contents of a type in a - // semi-safe way - they may throw exceptions. They could be + // semi-safe way - they may throw exceptions. They could be // given different names. member Shape: ArrayShape member ElementType: Type @@ -125,14 +125,14 @@ open System static member Tyvar: Callsig -> Type static member Modified: bool * Type * Type -> Type - and TypeKind = - | Void - | Array - | Value - | Boxed - | Ptr + and TypeKind = + | Void + | Array + | Value + | Boxed + | Ptr | Byref - | Fptr + | Fptr | Tyvar | Modified @@ -179,7 +179,7 @@ open System val is_tyvar_ty: Type -> bool - type CallSig = + type CallSig = { Callconv: Callconv; ArgTypes: List; ReturnType: Type } @@ -192,11 +192,11 @@ open System // F# library signature: //------------------------------------------------------------------------- - // This is the primitive interface for implementing events corresponding to + // This is the primitive interface for implementing events corresponding to // any delegate type. // // Note 'a and 'args must correspond - if they do not runtime exceptions will arise. - // We could add a constraint of the form + // We could add a constraint of the form // when 'a :> delegate(object * 'arg -> void) type EventForDelegateType<'a> = { Add: 'a -> unit; @@ -205,7 +205,7 @@ open System type ListenerListForDelegateType<'a,'arg> = { Fire: 'arg -> unit; AsEvent: EventForDelegateType<'a> } - + val ListenerListForDelegateType: unit -> ListenerListForDelegateType<'a,'arg> when 'a :> System.Delegate // This is for the common case for F# where the event type is EventHandler @@ -215,26 +215,26 @@ open System { Fire: 'a -> unit; AsEvent: Event<'a> } - val NewListenerList: unit -> ListenerList<'a> - + val NewListenerList: unit -> ListenerList<'a> + // A component signature: type NoiseLevel = Double - - type MyComponent + + type MyComponent member OnNoise: Event member OnPaint: EventForDelegateType - + val NewMyComponent: unit -> MyComponent - - - type MethodRef + + + type MethodRef member Name: string member Callconv: Callconv member Return: Type member ArgTypes: List - member Parent: TypeRef + member Parent: TypeRef member GenericArity: int member CallSig: CallSig member Rename: MethodRef -> MethodRef @@ -245,14 +245,14 @@ open System val callconv_of_mref: MethodRef -> Callconv val ret_of_mref: MethodRef -> Type val args_of_mref: MethodRef -> List - val tref_of_mref: MethodRef -> TypeRef + val tref_of_mref: MethodRef -> TypeRef val parent_of_mref: MethodRef -> TypeRef (* same as tref_of_mref *) val genarity_of_mref: MethodRef -> int val callsig_of_mref: MethodRef -> CallSig val rename_mref: string -> MethodRef -> MethodRef val relocate_mref: Type -> MethodRef -> MethodRef - type FieldRef + type FieldRef member Type: FieldRef member Name: string member TypeRef: TypeRef @@ -318,7 +318,7 @@ open System type CodeLabel = string - type BasicType = + type BasicType = | DT_R | DT_I1 | DT_U1 @@ -334,91 +334,91 @@ open System | DT_U | DT_REF - type LdtokenInfo = - | Token_type of Type - | Token_method of MethodSpec + type LdtokenInfo = + | Token_type of Type + | Token_method of MethodSpec | Token_field of FieldSpec - type LdcInfo = + type LdcInfo = | NUM_I4 of Int32 | NUM_I8 of Int64 | NUM_R4 of Single | NUM_R8 of Double - type Tailness = + type Tailness = | Tailcall | Normalcall - type Alignment = + type Alignment = | Aligned | Unaligned_1 | Unaligned_2 | Unaligned_4 - type Volatility = + type Volatility = | Volatile | Nonvolatile - type Readonly = + type Readonly = | ReadonlyAddress | NormalAddress type VarargTypes = Option< List > type CompareOp = - | BI_beq - | BI_bge - | BI_bge_un - | BI_bgt - | BI_bgt_un - | BI_ble - | BI_ble_un - | BI_blt - | BI_blt_un - | BI_bne_un - | BI_brfalse - | BI_brtrue + | BI_beq + | BI_bge + | BI_bge_un + | BI_bgt + | BI_bgt_un + | BI_ble + | BI_ble_un + | BI_blt + | BI_blt_un + | BI_bne_un + | BI_brfalse + | BI_brtrue type ArithmeticOp = - | AI_add + | AI_add | AI_add_ovf | AI_add_ovf_un - | AI_and - | AI_div + | AI_and + | AI_div | AI_div_un - | AI_ceq - | AI_cgt - | AI_cgt_un - | AI_clt - | AI_clt_un + | AI_ceq + | AI_cgt + | AI_cgt_un + | AI_clt + | AI_clt_un | AI_conv of BasicType | AI_conv_ovf of BasicType | AI_conv_ovf_un of BasicType - | AI_mul - | AI_mul_ovf + | AI_mul + | AI_mul_ovf | AI_mul_ovf_un - | AI_rem - | AI_rem_un - | AI_shl - | AI_shr + | AI_rem + | AI_rem_un + | AI_shl + | AI_shr | AI_shr_un - | AI_sub - | AI_sub_ovf - | AI_sub_ovf_un - | AI_xor - | AI_or - | AI_neg - | AI_not - | AI_ldnull - | AI_dup + | AI_sub + | AI_sub_ovf + | AI_sub_ovf_un + | AI_xor + | AI_or + | AI_neg + | AI_not + | AI_ldnull + | AI_dup | AI_pop - | AI_ckfinite + | AI_ckfinite | AI_nop | AI_ldc of BasicType * LdcInfo // A discriminated union automatically defines a kind and a "details"? - type Instr = + type Instr = (* Basic *) | I_arith of ArithmeticOp | I_ldarg of UInt16 @@ -435,7 +435,7 @@ open System | I_jmp of MethodSpec | I_brcmp of CompareOp * CodeLabel * CodeLabel (* second label is fall-through *) | I_switch of (CodeLabel list * CodeLabel) (* last label is fallthrough *) - | I_ret + | I_ret (* Method call *) | I_call of Tailness * MethodSpec * VarargTypes @@ -444,7 +444,7 @@ open System | I_calli of Tailness * CallSig * VarargTypes | I_ldftn of MethodSpec | I_newobj of MethodSpec * VarargTypes - + (* Exceptions *) | I_throw | I_endfinally @@ -455,7 +455,7 @@ open System | I_ldsfld of Volatility * FieldSpec | I_ldfld of Alignment * Volatility * FieldSpec | I_ldsflda of FieldSpec - | I_ldflda of FieldSpec + | I_ldflda of FieldSpec | I_stsfld of Volatility * FieldSpec | I_stfld of Alignment * Volatility * FieldSpec | I_ldstr of Bytes (* Beware! This is a unicode encoding of the string! *) @@ -483,21 +483,21 @@ open System | I_ldlen | I_mkrefany of Type - | I_refanytype + | I_refanytype | I_refanyval of Type | I_rethrow - | I_break - | I_seqpoint of SourceAnnotation + | I_break + | I_seqpoint of SourceAnnotation - | I_arglist + | I_arglist | I_localloc | I_cpblk of Alignment * Volatility | I_initblk of Alignment * Volatility -type basic_block = +type basic_block = { bblockLabel: CodeLabel; bblockInstrs: Instr array } @@ -512,11 +512,11 @@ val instr_is_tailcall: Instr -> bool -type local_debug_info = +type local_debug_info = { localNum: int; localName: string; } -type Code = +type Code = | BasicBlock of basic_block | GroupBlock of local_debug_info list * Code list | RestrictBlock of List * Code @@ -524,12 +524,12 @@ type Code = member Name: string member X : int - + and seh = - | FaultBlock of Code + | FaultBlock of Code | FinallyBlock of Code | FilterCatchBlock of (filter * Code) list -and filter = +and filter = | TypeFilter of Type | CodeFilter of Code @@ -538,11 +538,11 @@ val exits_of_code: Code -> List val unique_entry_of_code: Code -> CodeLabel val unique_exit_of_code: Code -> CodeLabel -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Field Init * -------------------------------------------------------------------- *) -type FieldInit = +type FieldInit = | FieldInit_Bytes of Bytes | FieldInit_bool of bool | FieldInit_char of UInt16 @@ -558,10 +558,10 @@ type FieldInit = | FieldInit_Double of Double | FieldInit_ref -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Native Types, for marshalling to the native C interface. * These are taken directly from the ILASM syntax, and don't really - * correspond yet to the ECMA Spec (Partition II, 7.4). + * correspond yet to the ECMA Spec (Partition II, 7.4). * -------------------------------------------------------------------- *) type native_type = @@ -598,76 +598,76 @@ type native_type = | (* COM interop *) NativeType_iunknown | (* COM interop *) NativeType_idispatch | (* COM interop *) NativeType_interface - | (* COM interop *) NativeType_error - | (* COM interop *) NativeType_safe_array of variant_type * string option + | (* COM interop *) NativeType_error + | (* COM interop *) NativeType_safe_array of variant_type * string option | (* COM interop *) NativeType_ansi_bstr | (* COM interop *) NativeType_variant_bool -and variant_type = +and variant_type = | VariantType_empty | VariantType_null | VariantType_variant | VariantType_currency - | VariantType_decimal - | VariantType_date - | VariantType_bstr - | VariantType_lpstr - | VariantType_lpwstr - | VariantType_iunknown - | VariantType_idispatch - | VariantType_safearray - | VariantType_error - | VariantType_hresult - | VariantType_carray - | VariantType_userdefined - | VariantType_record + | VariantType_decimal + | VariantType_date + | VariantType_bstr + | VariantType_lpstr + | VariantType_lpwstr + | VariantType_iunknown + | VariantType_idispatch + | VariantType_safearray + | VariantType_error + | VariantType_hresult + | VariantType_carray + | VariantType_userdefined + | VariantType_record | VariantType_filetime - | VariantType_blob - | VariantType_stream - | VariantType_storage - | VariantType_streamed_object - | VariantType_stored_object - | VariantType_blob_object - | VariantType_cf + | VariantType_blob + | VariantType_stream + | VariantType_storage + | VariantType_streamed_object + | VariantType_stored_object + | VariantType_blob_object + | VariantType_cf | VariantType_clsid - | VariantType_void + | VariantType_void | VariantType_bool | VariantType_Int8 - | VariantType_Int16 - | VariantType_Int32 - | VariantType_Int64 - | VariantType_Single - | VariantType_Double - | VariantType_unsigned_Int8 - | VariantType_unsigned_Int16 - | VariantType_unsigned_Int32 - | VariantType_unsigned_Int64 - | VariantType_ptr - | VariantType_array of variant_type - | VariantType_vector of variant_type - | VariantType_byref of variant_type - | VariantType_int - | VariantType_unsigned_int - - -(* -------------------------------------------------------------------- + | VariantType_Int16 + | VariantType_Int32 + | VariantType_Int64 + | VariantType_Single + | VariantType_Double + | VariantType_unsigned_Int8 + | VariantType_unsigned_Int16 + | VariantType_unsigned_Int32 + | VariantType_unsigned_Int64 + | VariantType_ptr + | VariantType_array of variant_type + | VariantType_vector of variant_type + | VariantType_byref of variant_type + | VariantType_int + | VariantType_unsigned_int + + +(* -------------------------------------------------------------------- * Local variables * -------------------------------------------------------------------- *) -type local = +type local = { localType: Type; localPinned: bool } - :> Object + :> Object :> IComparable val typ_of_local: local -> Type -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * IL method bodies * -------------------------------------------------------------------- *) -type CILMethodBody = +type CILMethodBody = { ilZeroInit: bool; ilMaxStack: Int32; (* strictly speaking should be a UInt16 *) ilNoInlining: bool; @@ -678,26 +678,26 @@ type CILMethodBody = val locals_of_ilmbody: CILMethodBody -> local list val code_of_ilmbody: CILMethodBody -> Code -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Member Access * -------------------------------------------------------------------- *) -type MemberAccess = +type MemberAccess = | MemAccess_assembly | MemAccess_compilercontrolled | MemAccess_famandassem | MemAccess_famorassem | MemAccess_family - | MemAccess_private - | MemAccess_public + | MemAccess_private + | MemAccess_public (* -------------------------------------------------------------------- - * Custom attributes: @todo: provide a helper to parse the Bytes - * to CustomAttribute_elem's as best as possible. + * Custom attributes: @todo: provide a helper to parse the Bytes + * to CustomAttribute_elem's as best as possible. * -------------------------------------------------------------------- *) -type CustomAttributeElement = - | String of String +type CustomAttributeElement = + | String of String | Bool of Boolean | Char of Char | Int8 of SByte @@ -710,25 +710,25 @@ type CustomAttributeElement = | UInt64 of UInt64 | Single of Single | Double of Double - | Type of TypeRef + | Type of TypeRef | Enum of Type * CustomAttributeElement type CustomAttribute = - { customMethod: MethodSpec; + { customMethod: MethodSpec; customData: Bytes } type CustomAttributes (* Equivalent to CustomAttribute list - use helpers below to construct/destruct these *) val dest_CustomAttributes: CustomAttributes -> CustomAttribute list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Method parameters and return values * -------------------------------------------------------------------- *) -type param = +type param = { Name: string option; Type: Type; - Default: Option; + Default: Option; Marshal: native_type option; (* Marshalling map for parameters. COM Interop only. *) In: bool; Out: bool; @@ -738,29 +738,29 @@ type param = val name_of_param: param -> string option val typ_of_param: param -> Type -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Method return values * -------------------------------------------------------------------- *) -type ReturnSpec = +type ReturnSpec = { returnMarshal: native_type option; returnType: Type; } val typ_of_return: ReturnSpec -> Type -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Security Permissions - * + * * Attached to various structures... * -------------------------------------------------------------------- *) -type SecurityAction = - | Request +type SecurityAction = + | Request | Demand | Assert | Deny | Permitonly - | Linkcheck + | Linkcheck | Inheritcheck | Reqmin | Reqopt @@ -771,7 +771,7 @@ type SecurityAction = | Noncaslinkdemand | Noncasinheritance -type PermissionValue = +type PermissionValue = Bool of bool | Int32 of Int32 | String of string @@ -779,7 +779,7 @@ type PermissionValue = | EnumInt16 of TypeRef * Int16 | EnumInt32 of TypeRef * Int32 -type permission = +type permission = | Permission of SecurityAction * Type * (string * PermissionValue) list | PermissionSet of SecurityAction * Bytes @@ -787,11 +787,11 @@ type SecurityDecls (* Opaque type equivalent to permission list - use helpers be val dest_SecurityDecls: SecurityDecls -> permission list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * PInvoke attributes. * -------------------------------------------------------------------- *) -type pinvoke_Callconv = +type pinvoke_Callconv = | PInvoke_CC_none | PInvoke_CC_cdecl | PInvoke_CC_stdcall @@ -799,13 +799,13 @@ type pinvoke_Callconv = | PInvoke_CC_fastcall | PInvoke_CC_winapi -type pinvoke_encoding = +type pinvoke_encoding = | PInvoke_Encoding_none | PInvoke_Encoding_ansi | PInvoke_Encoding_unicode | PInvoke_Encoding_autochar -type pinvoke_attr = +type pinvoke_attr = { pinvokeWhere: ModuleRef; pinvokeName: string; pinvokeCallconv: pinvoke_Callconv; @@ -827,20 +827,20 @@ val formal_CallSig_of_ospec: OverridesSpec -> CallSig val actual_CallSig_of_ospec: OverridesSpec -> CallSig -type virtual_info = - { Final: bool; - Newslot: bool; +type virtual_info = + { Final: bool; + Newslot: bool; Abstract: bool; Overrides: OverridesSpec option; } -type method_kind = - | Static - | Cctor - | Ctor - | Nonvirtual +type method_kind = + | Static + | Cctor + | Ctor + | Nonvirtual | Virtual of virtual_info -type MethodBody_details = +type MethodBody_details = | MethodBody_il of CILMethodBody | MethodBody_pinvoke of pinvoke_attr (* platform invoke to native *) | MethodBody_abstract @@ -853,17 +853,17 @@ type method_code_kind = type MethodBody (* isomorphic to MethodBody_details *) -val dest_mbody : MethodBody -> MethodBody_details +val dest_mbody : MethodBody -> MethodBody_details -type MethodDef = +type MethodDef = { mdName: string; mdKind: method_kind; mdCallconv: Callconv; mdParams: List; mdReturn: ReturnSpec; mdAccess: MemberAccess; - mdBody: MethodBody; - mdCodeKind: method_code_kind; + mdBody: MethodBody; + mdCodeKind: method_code_kind; mdInternalCall: bool; mdManaged: bool; mdForwardRef: bool; @@ -876,9 +876,9 @@ type MethodDef = mdSynchronized: bool; mdPreserveSig: bool; mdMustRun: bool; (* Whidbey feature: SafeHandle finalizer must be run *) - mdExport: (Int32 * string option) option; + mdExport: (Int32 * string option) option; mdVtableEntry: (Int32 * Int32) option; - + (* MS-GENERICS *) mdGenericParams: GenericParams; mdCustomAttrs: CustomAttributes; } @@ -893,9 +893,9 @@ val code_of_mdef: MethodDef -> Code val entry_of_mdef: MethodDef -> CodeLabel val CallSig_of_mdef: MethodDef -> CallSig -(* -------------------------------------------------------------------- - * Delegates. Derived functions for telling if a method/class definition - * is really a delegate. Also for telling if method signatures refer to +(* -------------------------------------------------------------------- + * Delegates. Derived functions for telling if a method/class definition + * is really a delegate. Also for telling if method signatures refer to * delegate methods. * -------------------------------------------------------------------- *) @@ -907,9 +907,9 @@ val is_delegate_begin_invoke: MethodDef -> bool val is_delegate_end_invoke: MethodDef -> bool val dest_delegate_begin_end_invoke: MethodDef -> MethodDef -> List * Type -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Tables of methods. Logically equivalent to a list of methods but - * the table is kept in a form optimized for looking up methods by + * the table is kept in a form optimized for looking up methods by * name and arity. * -------------------------------------------------------------------- *) @@ -919,20 +919,20 @@ val dest_mdefs: MethodDefs -> MethodDef list val filter_mdefs: (MethodDef -> bool) -> MethodDefs -> MethodDefs val find_mdefs_by_arity: string * int -> MethodDefs -> MethodDef list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Field definitions * -------------------------------------------------------------------- *) -type FieldDef = +type FieldDef = { Name: string; Type: Type; Static: bool; Access: MemberAccess; Data: Option; - Init: Option; + Init: Option; Offset: Int32 option; (* The explicit offset in Bytes when explicit layout is used. *) SpecialName: bool; - Marshal: native_type option; + Marshal: native_type option; NotSerialized: bool; Literal: bool ; InitOnly: bool; @@ -941,9 +941,9 @@ type FieldDef = val typ_of_fdef : FieldDef -> Type val name_of_fdef: FieldDef -> string -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Tables of FieldDefs. Logically equivalent to a list of FieldDefs but - * the table is kept in a form optimized for looking up FieldDefs by + * the table is kept in a form optimized for looking up FieldDefs by * name. * -------------------------------------------------------------------- *) @@ -953,22 +953,22 @@ val dest_fdefs: FieldDefs -> FieldDef list val filter_fdefs: (FieldDef -> bool) -> FieldDefs -> FieldDefs val find_fdef: string -> FieldDefs -> FieldDef list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Event definitions * -------------------------------------------------------------------- *) -type EventDef = - { eventType: Type option; +type EventDef = + { eventType: Type option; eventName: string; eventRTSpecialName: bool; eventSpecialName: bool; - eventAddOn: MethodRef; + eventAddOn: MethodRef; eventRemoveOn: MethodRef; eventFire: Option; eventOther: MethodRef list; eventCustomAttrs: CustomAttributes; } -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Table of those events in a type definition. * -------------------------------------------------------------------- *) @@ -977,23 +977,23 @@ type EventDefs val dest_events: EventDefs -> EventDef list val filter_events: (EventDef -> bool) -> EventDefs -> EventDefs -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Property definitions * -------------------------------------------------------------------- *) -type PropertyDef = +type PropertyDef = { propName: string; propRTSpecialName: bool; propSpecialName: bool; propSet: Option; propGet: Option; propCallconv: HasThis; - propType: Type; + propType: Type; propInit: Option; propArgs: List; propCustomAttrs: CustomAttributes; } -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Table of those properties in a type definition. * -------------------------------------------------------------------- *) @@ -1002,15 +1002,15 @@ type ILPropertyDefs val dest_properties: properties -> PropertyDef list val filter_properties: (PropertyDef -> bool) -> ILPropertyDefs -> ILPropertyDefs -(* ------------------------------------------------------------------ +(* ------------------------------------------------------------------ * Method Impls - * - * If there is an entry (pms --> ms) in this table, then method [ms] - * is used to implement method [pms] for the purposes of this class - * and its subclasses. + * + * If there is an entry (pms --> ms) in this table, then method [ms] + * is used to implement method [pms] for the purposes of this class + * and its subclasses. * ------------------------------------------------------------------ *) -type MethodImpl = +type MethodImpl = { mimplOverrides: OverridesSpec; mimplOverrideBy: MethodSpec } @@ -1018,18 +1018,18 @@ type MethodImpls val dest_mimpls: MethodImpls -> MethodImpl list -(* ------------------------------------------------------------------ +(* ------------------------------------------------------------------ * Type Access, Layout etc. * ------------------------------------------------------------------ *) type TypeLayout = | TypeLayout_auto | TypeLayout_sequential of TypeLayout_info - | TypeLayout_explicit of TypeLayout_info + | TypeLayout_explicit of TypeLayout_info and TypeLayout_info = { typeSize: Int32 option; - typePack: UInt16 option } + typePack: UInt16 option } type TypeInit = | TypeInit_beforefield @@ -1040,26 +1040,26 @@ type TypeEncoding = | TypeEncoding_autochar | TypeEncoding_unicode -type TypeDefAccess = - | TypeAccess_public +type TypeDefAccess = + | TypeAccess_public | TypeAccess_private - | TypeAccess_nested of MemberAccess + | TypeAccess_nested of MemberAccess type delegate_kind = Multicast | Singlecast -type delegate_info = - { delKind: delegate_kind; +type delegate_info = + { delKind: delegate_kind; delAsync: bool; delArgs: List; delRet: Type } -type enum_info = - { enumValues: (string * FieldInit) list; +type enum_info = + { enumValues: (string * FieldInit) list; enumType: Type } val values_of_enum_info: enum_info -> (string * FieldInit) list val typ_of_enum_info: enum_info -> Type -type TypeDefKind = +type TypeDefKind = | TypeDef_class | TypeDef_valuetype | TypeDef_interface @@ -1070,21 +1070,21 @@ type TypeDefKind = val split_type_name: string -> List * string -type TypeDef = +type TypeDef = { tdKind: TypeDefKind; - tdName: string; + tdName: string; tdGenericParams: GenericParams; - tdAccess: TypeDefAccess; + tdAccess: TypeDefAccess; tdAbstract: bool; - tdSealed: bool; - tdSerializable: bool; - tdComInterop: bool; (* Class or interface generated for COM interop *) + tdSealed: bool; + tdSerializable: bool; + tdComInterop: bool; (* Class or interface generated for COM interop *) tdLayout: TypeLayout; tdSpecialName: bool; tdEncoding: TypeEncoding; tdNested: TypeDefs; - tdImplements: List; - tdExtends: Type option; + tdImplements: List; + tdExtends: Type option; tdMethodDefs: MethodDefs; tdSecurityDecls: SecurityDecls; tdFieldDefs: FieldDefs; @@ -1132,50 +1132,49 @@ val iter_lazy_tdefs: (string -> TypeDef Lazy.t -> unit) -> TypeDefs -> unit val tname_for_toplevel: string val is_toplevel_tname: string -> bool val dest_tdefs_with_toplevel_first: TypeDefs -> TypeDef list - -(* -------------------------------------------------------------------- - * "Classes Elsewhere" - classes in auxillary modules. +(* -------------------------------------------------------------------- + * "Classes Elsewhere" - classes in auxiliary modules. * - * Manifests include declarations for all the classes in an + * Manifests include declarations for all the classes in an * assembly, regardless of which module they are in. * - * The ".class extern" construct describes so-called exported Types -- - * these are public classes defined in the auxillary modules of this assembly, - * i.e. modules other than the manifest-carrying module. - * - * For example, if you have a two-module - * assembly (A.DLL and B.DLL), and the manifest resides in the A.DLL, + * The ".class extern" construct describes so-called exported Types -- + * these are public classes defined in the auxiliary modules of this assembly, + * i.e. modules other than the manifest-carrying module. + * + * For example, if you have a two-module + * assembly (A.DLL and B.DLL), and the manifest resides in the A.DLL, * then in the manifest all the public classes declared in B.DLL should - * be defined as exported Types, i.e., as ".class extern". The public classes - * defined in A.DLL should not be defined as ".class extern" -- they are - * already available in the manifest-carrying module. The union of all - * public classes defined in the manifest-carrying module and all - * exported Types defined there is the set of all classes exposed by - * this assembly. Thus, by analysing the metadata of the manifest-carrying - * module of an assembly, you can identify all the classes exposed by + * be defined as exported Types, i.e., as ".class extern". The public classes + * defined in A.DLL should not be defined as ".class extern" -- they are + * already available in the manifest-carrying module. The union of all + * public classes defined in the manifest-carrying module and all + * exported Types defined there is the set of all classes exposed by + * this assembly. Thus, by analysing the metadata of the manifest-carrying + * module of an assembly, you can identify all the classes exposed by * this assembly, and where to find them. * - * Nested classes found in external modules should also be located in + * Nested classes found in external modules should also be located in * this table, suitably nested inside another "class_elsewhere" * definition. * -------------------------------------------------------------------- *) (* these are only found in the "Nested" field of class_elsewhere objects *) -type nested_class_elsewhere = +type nested_class_elsewhere = { Name: string; Access: MemberAccess; Nested: nested_classes_elsewhere; - CustomAttrs: CustomAttributes } + CustomAttrs: CustomAttributes } and nested_classes_elsewhere (* these are only found in the classes_elsewhere table in the manifest *) -type class_elsewhere = +type class_elsewhere = { Module: ModuleRef; Name: string; Access: TypeDefAccess; Nested: nested_classes_elsewhere; - CustomAttrs: CustomAttributes } + CustomAttrs: CustomAttributes } type classes_elsewhere @@ -1183,28 +1182,28 @@ val dest_nested_classes_elsewhere: nested_classes_elsewhere -> nested_class_else val dest_classes_elsewhere: classes_elsewhere -> class_elsewhere list val find_class_elsewhere: string -> classes_elsewhere -> class_elsewhere -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * "Manifest Resources" are chunks of resource data, being one of: - * - the data section of the current module (Bytes of resource given directly) - * - in an external file in this assembly (offset given in the resource_where field) - * - as a resources in another assembly of the same name. + * - the data section of the current module (Bytes of resource given directly) + * - in an external file in this assembly (offset given in the resource_where field) + * - as a resources in another assembly of the same name. * -------------------------------------------------------------------- *) -type resource_access = - | Public - | Private -type resource_where = - | Local of Bytes +type resource_access = + | Public + | Private +type resource_where = + | Local of Bytes | File of ModuleRef * Int32 | Assembly of AssemblyRef -type Resource = +type Resource = { Name: string; Where: resource_where; Access: resource_access; CustomAttrs: CustomAttributes } -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Table of resources in a module * -------------------------------------------------------------------- *) @@ -1212,7 +1211,7 @@ type Resources val dest_resources: Resources -> Resource list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Fixups are pretty obscure stuff for C++ code. These are not * yet correctly represented in the AbstractIL syntax. * -------------------------------------------------------------------- *) @@ -1220,20 +1219,20 @@ val dest_resources: Resources -> Resource list (* type fixup = Fixup of (Int32 * List * data_label) *) (* type fixups = fixup list *) -(* -------------------------------------------------------------------- - * Manifests, The "main" module of an assembly, and Assemblies. - * +(* -------------------------------------------------------------------- + * Manifests, The "main" module of an assembly, and Assemblies. + * * The main module of an assembly is a module plus some manifest information. * - * An assembly is built by joining together a "main" module plus - * several auxiliary modules. + * An assembly is built by joining together a "main" module plus + * several auxiliary modules. * -------------------------------------------------------------------- *) -type manifest = +type manifest = { Name: string; - AuxModuleHashAlgorithm: Int32; + AuxModuleHashAlgorithm: Int32; SecurityDecls: SecurityDecls; - PublicKey: Option; + PublicKey: Option; Version: VersionInfo option; Locale: Locale option; CustomAttrs: CustomAttributes; @@ -1244,9 +1243,9 @@ type manifest = NoMachine: bool; ClassesElsewhere: classes_elsewhere; EntrypointElsewhere: ModuleRef option; - } + } -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * One module in the "current" assembly, either a main-module or * an auxiliary module. The main module will have a manifest. * @@ -1254,7 +1253,7 @@ type manifest = * code because "module" is a reserved word in OCaml. * -------------------------------------------------------------------- *) -type modul = +type modul = { Manifest: manifest option; CustomAttrs: CustomAttributes; Name: string; @@ -1265,7 +1264,7 @@ type modul = VirtAlignment: Int32; PhysAlignment: Int32; ImageBase: Int32; - Resources: Resources; + Resources: Resources; NativeResources: Bytes Lazy.t option; (* e.g. win86 resources, as the exact contents of a .res or .obj file *) } @@ -1275,33 +1274,33 @@ val assemblyName_of_mainmod: modul -> AssemblyName (* ==================================================================== * PART 2 - * - * Making metadata. Where no explicit static member - * is given, you should create the concrete datatype directly, + * + * Making metadata. Where no explicit static member + * is given, you should create the concrete datatype directly, * e.g. by filling in all appropriate record FieldDefs. * ==================================================================== *) -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Generate references to existing assemblies and modules * -------------------------------------------------------------------- *) val mk_simple_assemblyRef: AssemblyName -> AssemblyRef val mk_simple_modref: ModuleName -> ModuleRef -val mk_simple_scoref_from_assemblyName: AssemblyName -> ScopeRef -val mk_simple_scoref_from_assemblyRef: AssemblyRef -> ScopeRef +val mk_simple_scoref_from_assemblyName: AssemblyName -> ScopeRef +val mk_simple_scoref_from_assemblyRef: AssemblyRef -> ScopeRef val assemblyRef_for_manifest: manifest -> AssemblyRef val assemblyRef_for_mainmod: modul -> AssemblyRef -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Take apart MethodSpecs * -------------------------------------------------------------------- *) val rename_mspec: string -> MethodSpec -> MethodSpec val relocate_mspec: Type -> MethodSpec -> MethodSpec (* deprecated *) -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Make type refs * -------------------------------------------------------------------- *) @@ -1314,7 +1313,7 @@ val mk_nested_tref: ScopeRef * List * string -> TypeRef val mk_tref: ScopeRef * string -> TypeRef val mk_tref_in_tref: TypeRef * string -> TypeRef -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Make type specs * -------------------------------------------------------------------- *) @@ -1322,7 +1321,7 @@ val mk_nongeneric_tspec: TypeRef -> TypeSpec val mk_tspec: TypeRef * Instantiation -> TypeSpec val mk_Callconv: HasThis -> Callconv -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Make Types * -------------------------------------------------------------------- *) @@ -1336,7 +1335,7 @@ val mk_nongeneric_value_typ: TypeRef -> Type val mk_array_ty: Type * ArrayShape -> Type val mk_sdarray_ty: Type -> Type -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Make method references and specs * -------------------------------------------------------------------- *) @@ -1399,7 +1398,7 @@ val mk_mspec_to_mdef: Type * MethodDef * Instantiation -> MethodSpec val mk_CallSig: Callconv * List * Type -> CallSig -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Make generalized versions of possibly-generic Types, * e.g. Given the TypeDef for List, return the type "List". * -------------------------------------------------------------------- *) @@ -1413,17 +1412,17 @@ val gparam_of_gactual: Type -> GenericParam val gparams_of_inst: Instantiation -> GenericParam list val generalize_gparams: GenericParam list -> List -(* -------------------------------------------------------------------- - * Custom attributes +(* -------------------------------------------------------------------- + * Custom attributes * -------------------------------------------------------------------- *) -val mk_CustomAttributeibute: - TypeRef * - List (* fixed args: values and implicit Types *) * - List<(FieldSpec * bool * CustomAttributeElement)> (* named args: vluaes and flags indicating if they are FieldDefs or properties *) +val mk_CustomAttributeibute: + TypeRef * + List (* fixed args: values and implicit Types *) * + List<(FieldSpec * bool * CustomAttributeElement)> (* named args: vluaes and flags indicating if they are FieldDefs or properties *) -> CustomAttribute -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Making code. * -------------------------------------------------------------------- *) @@ -1451,7 +1450,7 @@ type ('a, 'b) choice = Choice1of2 of 'a | Choice2of2 of 'b val mk_try_multi_filter_catch_block: Code * (((CodeLabel * Code), typ) choice * (CodeLabel * Code)) list -> Code -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Injecting code into existing code blocks. A branch will * be added from the given instructions to the (unique) entry of * the code, and the first instruction will be the new entry @@ -1466,7 +1465,7 @@ val prepend_instrs_to_code: Instr list -> Code -> Code val prepend_instrs_to_ilmbody: Instr list -> CILMethodBody -> CILMethodBody val prepend_instrs_to_mdef: Instr list -> MethodDef -> MethodDef -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Default values for some of the strange flags in a module. * -------------------------------------------------------------------- *) @@ -1475,13 +1474,13 @@ val default_modulVirtAlignment: Int32 val default_modulPhysAlignment: Int32 val default_modulImageBase: Int32 -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Helper to check a class is really an enum * -------------------------------------------------------------------- *) val check_enum_FieldDefs: TypeRef -> FieldDef list -> Type * FieldDef list -(* -------------------------------------------------------------------- +(* -------------------------------------------------------------------- * Derived functions for making some instructions * -------------------------------------------------------------------- *) @@ -1543,7 +1542,7 @@ val tspec_for_nested_tdef: ScopeRef -> TypeDef list * TypeDef -> TypeSpec val prepend_instrs_to_cctor: Instr list -> Option -> TypeDef -> TypeDef -type tmps = { num_old_locals: int; mutable newlocals: local list; } +type tmps = { num_old_locals: int; mutable newlocals: local list; } val alloc_tmp: tmps -> local -> UInt16 val mk_storage_ctor: Option -> Instr list -> TypeSpec -> (string * typ) list -> MethodDef @@ -1551,7 +1550,7 @@ val mk_simple_storage_ctor: Option -> TypeSpec option -> TypeS val and_Tailness: Tailness -> bool -> Tailness -val mk_ctor_mspec_for_delegate_tdef: ScopeRef * TypeDef * Instantiation -> MethodSpec +val mk_ctor_mspec_for_delegate_tdef: ScopeRef * TypeDef * Instantiation -> MethodSpec val tref_for_toplevel: ScopeRef -> TypeRef val tspec_for_toplevel: ScopeRef -> TypeSpec @@ -1622,31 +1621,31 @@ val rescope_tspec: ScopeRef -> TypeSpec -> TypeSpec val rescope_typ: ScopeRef -> Type -> Type val rescope_mspec: ScopeRef -> MethodSpec -> MethodSpec val rescope_ospec: ScopeRef -> OverridesSpec -> OverridesSpec -val rescope_mref: ScopeRef -> MethodRef -> MethodRef +val rescope_mref: ScopeRef -> MethodRef -> MethodRef val rescope_fref: ScopeRef -> FieldRef -> FieldRef val rescope_fspec: ScopeRef -> FieldSpec -> FieldSpec -type seh_clause = +type seh_clause = | SEH_finally of (CodeLabel * CodeLabel) | SEH_fault of (CodeLabel * CodeLabel) | SEH_filter_catch of (CodeLabel * CodeLabel) * (CodeLabel * CodeLabel) | SEH_type_catch of Type * (CodeLabel * CodeLabel) -type exception_spec = +type exception_spec = { exnRange: (CodeLabel * CodeLabel); exnClauses: seh_clause list } -type local_spec = +type local_spec = { locRange: (CodeLabel * CodeLabel); locInfos: local_debug_info list } val build_code: string -> - (CodeLabel -> int) -> - Instr array -> - exception_spec list -> - local_spec list -> + (CodeLabel -> int) -> + Instr array -> + exception_spec list -> + local_spec list -> Code val inst_tspec_aux: int -> Instantiation -> TypeSpec -> TypeSpec @@ -1821,7 +1820,7 @@ val mspec_Object_Equals: MethodSpec val mspec_Object_GetHashCode: MethodSpec val mspec_IComparable_CompareTo: MethodSpec val mspec_Console_WriteLine: MethodSpec -val mspec_RuntimeHelpers_InitializeArray: MethodSpec +val mspec_RuntimeHelpers_InitializeArray: MethodSpec val mk_DebuggableAttribute: bool (* debug tracking *) * bool (* disable JIT optimizations *) -> CustomAttribute @@ -1849,11 +1848,10 @@ val intern_tspec: TypeSpec -> TypeSpec val intern_typ: Type -> Type val intern_instr: Instr -> Instr -type refs = - { refsAssembly: AssemblyRef list; +type refs = + { refsAssembly: AssemblyRef list; refsModul: ModuleRef list; } val refs_of_module: modul -> refs val combine_refs: refs -> refs -> refs val empty_refs: refs - diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fs index 6285f89c2ec..d2c6b7da964 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fs @@ -1,12 +1,12 @@ -// #Regression #Conformance #LexFilter +// #Regression #Conformance #LexFilter #indent "off" // Regression test for FSHARP1.0:1078 -// The opposit of #light is (for now) #indent "off" +// The opposite of #light is (for now) #indent "off" //This value is not a function and cannot be applied let SimpleSample() = let x = 10 + 12 - 3 in - let y = x * 2 + 1 in + let y = x * 2 + 1 in let r1,r2 = x/3, x%3 in (x,y,r1,r2) diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsi b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsi index 244dcae5e55..a37b71dc6c5 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsi +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsi @@ -1,7 +1,7 @@ -// #Regression #Conformance #LexFilter +// #Regression #Conformance #LexFilter #indent "off" // Regression test for FSHARP1.0:1078 -// The opposit of #light is (for now) #indent "off" +// The opposite of #light is (for now) #indent "off" //The signature file 'Indent_off_01' does not have a corresponding implementation file\. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match type R diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsscript b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsscript index 3fe10bcccc5..059332d9484 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsscript +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsscript @@ -1,11 +1,11 @@ -// #Regression #Conformance #LexFilter +// #Regression #Conformance #LexFilter #indent "off" // Regression test for FSHARP1.0:1078 -// The opposit of #light is (for now) #indent "off" +// The opposite of #light is (for now) #indent "off" //Main module of program is empty let SimpleSample() = let x = 10 + 12 - 3 in - let y = x * 2 + 1 in + let y = x * 2 + 1 in let r1,r2 = x/3, x%3 in (x,y,r1,r2) diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsx b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsx index 893df008972..794b7288ab2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_01.fsx @@ -1,11 +1,11 @@ -// #Regression #Conformance #LexFilter +// #Regression #Conformance #LexFilter #indent "off" // Regression test for FSHARP1.0:1078 -// The opposit of #light is (for now) #indent "off" +// The opposite of #light is (for now) #indent "off" //Main module of program is empty let SimpleSample() = let x = 10 + 12 - 3 in - let y = x * 2 + 1 in + let y = x * 2 + 1 in let r1,r2 = x/3, x%3 in (x,y,r1,r2) diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs index 6ba9a667f22..bcfe12fdd79 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs @@ -1,11 +1,11 @@ -// #Regression #Conformance #LexFilter +// #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 -// The opposit of #light is (for now) #indent "off" +// The opposite of #light is (for now) #indent "off" // #indent "off" module M let SimpleSample() = let x = 10 + 12 - 3 in - let y = x * 2 + 1 in + let y = x * 2 + 1 in let r1,r2 = x/3, x%3 in (x,y,r1,r2) From 2a4146e0d42c70cfce0b2b13b0b4097de162dc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 7 Apr 2025 00:30:04 -0700 Subject: [PATCH 049/134] Update maintenance-packages versions (#18446) * Update maintenance-packages versions * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250404.3 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25170.3 -> To Version 9.0.0-alpha.1.25204.3 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a3b61734d48..5d099d46ea5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 6968f7059f4418e985febe704a3b1320f9e5887d + 643689c88b1d5a0f1561383972c4189a0c673abe diff --git a/eng/Versions.props b/eng/Versions.props index 5ce287e802b..3b796e557b9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -74,8 +74,8 @@ 4.6.1 - 4.6.2 - 6.1.1 + 4.6.3 + 6.1.2 From 4231126be3db239f2e66cf1a0a2b811f642fc14e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 12:08:20 +0200 Subject: [PATCH 050/134] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250404.3 (#18447) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25170.3 -> To Version 9.0.0-alpha.1.25204.3 Co-authored-by: dotnet-maestro[bot] From 4ba36db1f42f33a66d9677f0b9d589d39b204a9c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 10:59:49 -0700 Subject: [PATCH 051/134] Update dependencies from https://github.com/dotnet/arcade build 20250404.5 (#18449) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25164.2 -> To Version 9.0.0-beta.25204.5 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) --- eng/Version.Details.xml | 8 ++++---- global.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5d099d46ea5..da463444bca 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - 5ba9ca776c1d0bb72b2791591e54cf51fc52dfee + 97cbc7361ff28b2948c8182720c166a744049f55 - + https://github.com/dotnet/arcade - 5ba9ca776c1d0bb72b2791591e54cf51fc52dfee + 97cbc7361ff28b2948c8182720c166a744049f55 diff --git a/global.json b/global.json index eca327e814a..434c70939fc 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25204.5", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From 38aab8f7cd329126c5e2a57ebd16fafe2a195539 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 7 Apr 2025 14:50:06 -0700 Subject: [PATCH 052/134] Update service-branch-merge.json --- .config/service-branch-merge.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/service-branch-merge.json b/.config/service-branch-merge.json index 49561874be8..9eaf6479d45 100644 --- a/.config/service-branch-merge.json +++ b/.config/service-branch-merge.json @@ -10,8 +10,8 @@ "ExtraSwitches": "-QuietComments" }, "main": { - "MergeToBranch": "release/dev17.14", + "MergeToBranch": "release/dev18.0", "ExtraSwitches": "-QuietComments" } } -} \ No newline at end of file +} From 71691a71c0b8066982275caf46ccb97eeafb5a3a Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 8 Apr 2025 09:43:35 +0200 Subject: [PATCH 053/134] Fix a copypaste checking bug in unpickling (#18430) --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/TypedTree/TypedTreePickle.fs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 8893e4d237d..7b9c0729778 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -20,6 +20,7 @@ * Fix duplicate parse error reporting for GetBackgroundCheckResultsForFileInProject ([Issue #18379](https://github.com/dotnet/fsharp/issues/18379) [PR #18380](https://github.com/dotnet/fsharp/pull/18380)) * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) * Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) +* Fix checking bug in unpickling [PR #18430](https://github.com/dotnet/fsharp/pull/18430) * Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index ba09c7a6029..9d7cadd6fce 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -1122,7 +1122,7 @@ let unpickleObjWithDanglingCcus let res = u st1 check viewedScope st1.ientities - check viewedScope st1.ientities + check viewedScope st1.ianoninfos check viewedScope st1.ivals check viewedScope st1.itypars res From 0f9d6ea8f62dc80207f8f7c1ec31ea65581e9785 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 8 Apr 2025 18:34:54 +0200 Subject: [PATCH 054/134] Tooltips: fix `null` annotation highlighting (#18457) * Tooltips: fix `null` annotation highlighting * Release notes --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/NicePrint.fs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7b9c0729778..7f0be7cb37f 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -23,6 +23,7 @@ * Fix checking bug in unpickling [PR #18430](https://github.com/dotnet/fsharp/pull/18430) * Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) +* Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Checking/NicePrint.fs b/src/Compiler/Checking/NicePrint.fs index 282773b6b8b..f1de3d43389 100644 --- a/src/Compiler/Checking/NicePrint.fs +++ b/src/Compiler/Checking/NicePrint.fs @@ -944,7 +944,7 @@ module PrintTypes = // Show nullness annotations unless explicitly turned off if denv.showNullnessAnnotations <> Some false then match nullness.Evaluate() with - | NullnessInfo.WithNull -> part2 ^^ wordL (tagText "| null") + | NullnessInfo.WithNull -> part2 ^^ wordL (tagPunctuation "|") ^^ wordL (tagKeyword "null") | NullnessInfo.WithoutNull -> part2 | NullnessInfo.AmbivalentToNull -> part2 //^^ wordL (tagText "__maybenull") else From ec243798f9d258199554c228cc661dfe54c657a6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:52:18 +0200 Subject: [PATCH 055/134] Update dependencies from https://github.com/dotnet/arcade build 20250408.6 (#18461) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25204.5 -> To Version 9.0.0-beta.25208.6 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- global.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index da463444bca..caa48e6eced 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - 97cbc7361ff28b2948c8182720c166a744049f55 + aa61e8c20a869bcc994f8b29eb07d927d2bec6f4 - + https://github.com/dotnet/arcade - 97cbc7361ff28b2948c8182720c166a744049f55 + aa61e8c20a869bcc994f8b29eb07d927d2bec6f4 diff --git a/global.json b/global.json index 434c70939fc..dad4b18b2fa 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25204.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25208.6", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From b8477587f2ff2de269f75d547313811ebd7407bc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 11:52:34 +0200 Subject: [PATCH 056/134] Update dependencies from https://github.com/dotnet/msbuild build 20250408.6 (#18462) Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.22-preview-25174-08 -> To Version 17.13.23-preview-25208-06 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NuGet.config b/NuGet.config index 944ae5b686e..dd573e4a915 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index caa48e6eced..0917752a5d6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 + 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff - + https://github.com/dotnet/msbuild - 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 + 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff - + https://github.com/dotnet/msbuild - 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 + 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff - + https://github.com/dotnet/msbuild - 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 + 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff - + https://github.com/dotnet/msbuild - 0ca03f84b7848ce9d7d3e5d1f68c5e090efa4f30 + 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 3b796e557b9..ed7cd7b47ca 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -102,7 +102,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.22 + 17.13.23 $(RoslynVersion) $(RoslynVersion) @@ -138,9 +138,9 @@ 15.0.25123-Dev15Preview - 17.13.22 - 17.13.22 - 17.13.22 + 17.13.23 + 17.13.23 + 17.13.23 $(VisualStudioEditorPackagesVersion) From 54c4b6687fbaaa78d8bb5a2bdb64f9819db311e1 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 9 Apr 2025 16:09:24 +0200 Subject: [PATCH 057/134] Make [] combination work (#18444) * Fix IL mismatch - Some() was created for a ValueOption method * notes --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/MethodCalls.fs | 12 ++++-- src/Compiler/Checking/PostInferenceChecks.fs | 26 +++++++++---- .../OptionalArguments/OptionalArguments.fs | 39 ++++++++++++++++++- tests/FSharp.Test.Utilities/Compiler.fs | 3 +- 5 files changed, 68 insertions(+), 13 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7f0be7cb37f..822a85e72ac 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -24,6 +24,7 @@ * Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) * Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) +* Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 41d731f007e..19b91dcf0b1 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -348,6 +348,12 @@ let inline mkOptionalNone (g: TcGlobals) ty calledArgTy mMethExpr = else mkNone g calledArgTy mMethExpr +let inline mkOptionalSome (g: TcGlobals) outerOptTy innerNonOptionalType expr mMethExpr = + if g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g outerOptTy then + mkValueSome g innerNonOptionalType expr mMethExpr + else + mkSome g innerNonOptionalType expr mMethExpr + /// Adjust the called argument type to take into account whether the caller's argument is CSharpMethod(?arg=Some(3)) or CSharpMethod(arg=1) let AdjustCalledArgTypeForOptionals (infoReader: InfoReader) ad enforceNullableOptionalsKnownTypes (calledArg: CalledArg) calledArgTy (callerArg: CallerArg<_>) = @@ -1502,14 +1508,14 @@ let GetDefaultExpressionForCalleeSideOptionalArg g (calledArg: CalledArg) eCalle match calledArg.CallerInfo, eCallerMemberName with | CallerLineNumber, _ when typeEquiv g calledNonOptTy g.int_ty -> let lineExpr = Expr.Const(Const.Int32 mMethExpr.StartLine, mMethExpr, calledNonOptTy) - mkSome g calledNonOptTy lineExpr mMethExpr + mkOptionalSome g calledArgTy calledNonOptTy lineExpr mMethExpr | CallerFilePath, _ when typeEquiv g calledNonOptTy g.string_ty -> let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply g.pathMap let filePathExpr = Expr.Const (Const.String(fileName), mMethExpr, calledNonOptTy) - mkSome g calledNonOptTy filePathExpr mMethExpr + mkOptionalSome g calledArgTy calledNonOptTy filePathExpr mMethExpr | CallerMemberName, Some(callerName) when typeEquiv g calledNonOptTy g.string_ty -> let memberNameExpr = Expr.Const (Const.String callerName, mMethExpr, calledNonOptTy) - mkSome g calledNonOptTy memberNameExpr mMethExpr + mkOptionalSome g calledArgTy calledNonOptTy memberNameExpr mMethExpr | _ -> mkOptionalNone g calledArgTy calledNonOptTy mMethExpr diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index d22f50cdc2f..751112e3918 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2398,13 +2398,25 @@ let CheckEntityDefn cenv env (tycon: Entity) = errorR(Error(FSComp.SR.chkCurriedMethodsCantHaveOutParams(), m)) if numCurriedArgSets = 1 then - let errorIfNotStringTy m ty callerInfo = + + let inline tryDestOptionalTy g ty = + if isOptionTy g ty then + destOptionTy g ty |> ValueSome + elif g.langVersion.SupportsFeature LanguageFeature.SupportValueOptionsAsOptionalParameters && isValueOptionTy g ty then + destValueOptionTy g ty |> ValueSome + else + ValueNone + + let errorIfNotStringTy m ty callerInfo = if not (typeEquiv g g.string_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv ty), m)) + + let errorIfNotOptional tyToCompare desiredTyName m ty callerInfo = - let errorIfNotStringOptionTy m ty callerInfo = - if not ((isOptionTy g ty) && (typeEquiv g g.string_ty (destOptionTy g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "string", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) + match tryDestOptionalTy g ty with + | ValueSome t when typeEquiv g tyToCompare t -> () + | ValueSome innerTy -> errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, desiredTyName, NicePrint.minimalStringOfType cenv.denv innerTy), m)) + | ValueNone -> errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, desiredTyName, NicePrint.minimalStringOfType cenv.denv ty), m)) minfo.GetParamDatas(cenv.amap, m, minfo.FormalMethodInst) |> List.iterSquared (fun (ParamData(_, isInArg, _, optArgInfo, callerInfo, nameOpt, _, ty)) -> @@ -2421,11 +2433,9 @@ let CheckEntityDefn cenv env (tycon: Entity) = | CallerSide _, CallerLineNumber -> if not (typeEquiv g g.int32_ty ty) then errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "int", NicePrint.minimalStringOfType cenv.denv ty), m)) - | CalleeSide, CallerLineNumber -> - if not ((isOptionTy g ty) && (typeEquiv g g.int32_ty (destOptionTy g ty))) then - errorR(Error(FSComp.SR.tcCallerInfoWrongType(callerInfo |> string, "int", NicePrint.minimalStringOfType cenv.denv (destOptionTy g ty)), m)) + | CalleeSide, CallerLineNumber -> errorIfNotOptional g.int32_ty "int" m ty callerInfo | CallerSide _, (CallerFilePath | CallerMemberName) -> errorIfNotStringTy m ty callerInfo - | CalleeSide, (CallerFilePath | CallerMemberName) -> errorIfNotStringOptionTy m ty callerInfo + | CalleeSide, (CallerFilePath | CallerMemberName) -> errorIfNotOptional g.string_ty "string" m ty callerInfo ) for pinfo in immediateProps do diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs index c0604630d56..4d0843014e0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/MemberDefinitions/OptionalArguments/OptionalArguments.fs @@ -609,4 +609,41 @@ but here has type ''T option' but here has type ''a voption' " - ] \ No newline at end of file + ] + + [] + let ``Struct optional args can have caller member name`` () = + + let source = """module TestLib +open System.Runtime.CompilerServices + +let printItOut x = + printf "%s" $"{x};" + +type Ab() = + + static member aa ([]?b: string) = + printItOut b + + static member bb ([]?i: int) = + printItOut i + +[] +let main _args = + Ab.aa() + Ab.bb() + Ab.aa("hello") + Ab.bb(42) + 0 +""" + + source + |> FSharp + |> withLangVersionPreview + |> withNoWarn 25 + |> asExe + |> compile + |> ILVerifierModule.verifyPEFileWithSystemDlls + |> run + |> verifyOutputContains [|"main;18;hello;42;"|] + \ No newline at end of file diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index e21079818d7..2b3ccface37 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1640,7 +1640,8 @@ Actual: | Some (ExecutionOutput {Outcome = Failure ex }) -> failwithf $"Eval or Execution has failed (expected to succeed): %A{ex}\n{diagnostics}" | _ -> - failwithf $"Operation failed (expected to succeed).\n{diagnostics}" + + failwithf $"Operation failed (expected to succeed).\n{diagnostics} \n OUTPUTs: %A{r.Output}" let shouldFail (result: CompilationResult) : CompilationResult = match result with From be2cd931a1fd492a0921a9af828ad48c24f16113 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 9 Apr 2025 17:07:41 +0200 Subject: [PATCH 058/134] Type checker: don't suppress errors while checking expressions (#18311) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../Checking/Expressions/CheckExpressions.fs | 62 ++++----- tests/FSharp.Compiler.Service.Tests/Common.fs | 9 +- .../FSharp.Compiler.Service.Tests.fsproj | 1 + .../PatternMatchCompilationTests.fs | 122 +++++++++--------- .../TypeChecker/TypeCheckerRecoveryTests.fs | 52 ++++++++ tests/fsharp/typecheck/sigs/neg104.vsbsl | 2 + tests/fsharp/typecheck/sigs/neg110.bsl | 2 +- tests/fsharp/typecheck/sigs/neg135.vsbsl | 8 ++ tests/fsharp/typecheck/sigs/neg64.vsbsl | 4 + tests/fsharp/typecheck/sigs/neg68.vsbsl | 20 +++ tests/fsharp/typecheck/sigs/neg70.vsbsl | 12 ++ tests/fsharp/typecheck/sigs/neg79.vsbsl | 4 + tests/fsharp/typecheck/sigs/neg80.vsbsl | 2 + tests/fsharp/typecheck/sigs/neg82.vsbsl | 2 + tests/fsharp/typecheck/sigs/neg83.vsbsl | 18 +++ tests/fsharp/typecheck/sigs/neg84.vsbsl | 2 + tests/fsharp/typecheck/sigs/neg86.vsbsl | 7 + 18 files changed, 231 insertions(+), 99 deletions(-) create mode 100644 tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs create mode 100644 tests/fsharp/typecheck/sigs/neg135.vsbsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 822a85e72ac..0b1b492c678 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -32,6 +32,7 @@ * Add support for C# `Experimental` attribute. ([PR #18253](https://github.com/dotnet/fsharp/pull/18253)) * Nullness warnings are issued for signature<>implementation conformance ([PR #18186](https://github.com/dotnet/fsharp/pull/18186)) * Symbols: Add FSharpAssembly.IsFSharp ([PR #18290](https://github.com/dotnet/fsharp/pull/18290)) +* Type checker: don't suppress errors while checking expressions ([PR #18311](https://github.com/dotnet/fsharp/pull/18311)) * Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323)) * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) * Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 7f1d22f0dd2..5f390038e35 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -5960,7 +5960,7 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE | SynExpr.FromParseError (expr1, m) -> //SolveTypeAsError cenv env.DisplayEnv m overallTy - let _, tpenv = suppressErrorReporting (fun () -> TcExpr cenv overallTy env tpenv expr1) + let _, tpenv = TcExpr cenv overallTy env tpenv expr1 mkDefault(m, overallTy.Commit), tpenv | SynExpr.Sequential (sp, dir, synExpr1, synExpr2, m, _) -> @@ -6489,9 +6489,7 @@ and TcIteratedLambdas (cenv: cenv) isFirst (env: TcEnv) overallTy takenNames tpe | e -> let env = { env with eIsControlFlow = true } - // Dive into the expression to check for syntax errors and suppress them if they show. - conditionallySuppressErrorReporting (not isFirst && synExprContainsError e) (fun () -> - TcExpr cenv overallTy env tpenv e) + TcExpr cenv overallTy env tpenv e and TcTyparExprThen (cenv: cenv) overallTy env tpenv synTypar m delayed = match delayed with @@ -11103,39 +11101,33 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt // At each module binding, dive into the expression to check for syntax errors and suppress them if they show. // Don't do this for lambdas, because we always check for suppression for all lambda bodies in TcIteratedLambdas let rhsExprChecked, tpenv = - let atTopNonLambdaDefn = - declKind.IsModuleOrMemberOrExtensionBinding && - (match rhsExpr with SynExpr.Lambda _ -> false | _ -> true) && - synExprContainsError rhsExpr - - conditionallySuppressErrorReporting atTopNonLambdaDefn (fun () -> - - // Save the arginfos away to match them up in the lambda - let (PrelimValReprInfo(argInfos, _)) = prelimValReprInfo - - // The right-hand-side is control flow (has an implicit debug point) in any situation where we - // haven't extended the debug point to include the 'let', that is, there is a debug point noted - // at the binding. - // - // This includes - // let _ = expr - // let () = expr - // which are transformed to sequential expressions in TcLetBinding - // - let rhsIsControlFlow = - match pat with - | SynPat.Wild _ - | SynPat.Const (SynConst.Unit, _) - | SynPat.Paren (SynPat.Const (SynConst.Unit, _), _) -> true - | _ -> - match debugPoint with - | DebugPointAtBinding.Yes _ -> false - | _ -> true + // Save the arginfos away to match them up in the lambda + let (PrelimValReprInfo(argInfos, _)) = prelimValReprInfo + + // The right-hand-side is control flow (has an implicit debug point) in any situation where we + // haven't extended the debug point to include the 'let', that is, there is a debug point noted + // at the binding. + // + // This includes + // let _ = expr + // let () = expr + // which are transformed to sequential expressions in TcLetBinding + // + let rhsIsControlFlow = + match pat with + | SynPat.Wild _ + | SynPat.Const (SynConst.Unit, _) + | SynPat.Paren (SynPat.Const (SynConst.Unit, _), _) -> true + | _ -> + + match debugPoint with + | DebugPointAtBinding.Yes _ -> false + | _ -> true - let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow } + let envinner = { envinner with eLambdaArgInfos = argInfos; eIsControlFlow = rhsIsControlFlow } - if isCtor then TcExprThatIsCtorBody (safeThisValOpt, safeInitInfo) cenv (MustEqual overallExprTy) envinner tpenv rhsExpr - else TcExprThatCantBeCtorBody cenv (MustConvertTo (false, overallExprTy)) envinner tpenv rhsExpr) + if isCtor then TcExprThatIsCtorBody (safeThisValOpt, safeInitInfo) cenv (MustEqual overallExprTy) envinner tpenv rhsExpr + else TcExprThatCantBeCtorBody cenv (MustConvertTo (false, overallExprTy)) envinner tpenv rhsExpr if kind = SynBindingKind.StandaloneExpression && not cenv.isScript then UnifyUnitType cenv env mBinding overallPatTy rhsExprChecked |> ignore diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index 5ad61b29ef9..dad4f489514 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -119,7 +119,6 @@ let mkProjectCommandLineArgsForScript (dllName, fileNames) = yield "--doc:test.xml" yield "--warn:3" yield "--fullpaths" - yield "--flaterrors" yield "--target:library" for x in fileNames do yield x @@ -370,11 +369,17 @@ let inline dumpDiagnostics (results: FSharpCheckFileResults) = |> Array.map (fun e -> let message = e.Message.Split('\n') - |> Array.map (fun s -> s.Trim()) + |> Array.map _.Trim() + |> Array.filter (fun s -> s.Length > 0) |> String.concat " " sprintf "%s: %s" (e.Range.ToString()) message) |> List.ofArray +let inline dumpDiagnosticNumbers (results: FSharpCheckFileResults) = + results.Diagnostics + |> Array.map (fun e -> e.Range.ToString(), e.ErrorNumber) + |> List.ofArray + let getSymbolUses (results: FSharpCheckFileResults) = results.GetAllUsesOfAllSymbolsInFile() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 1cf8d9c720b..d9db689952c 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -26,6 +26,7 @@ XunitSetup.fs + diff --git a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs index 5bd733d5316..1b6d54d3577 100644 --- a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs @@ -16,7 +16,7 @@ match () with """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(3,2--3,4): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'string'" + "(3,2--3,4): This expression was expected to have type 'unit' but here has type 'string'" ] [] @@ -26,8 +26,8 @@ let ("": unit), (x: int) = let y = () in () """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(2,5--2,7): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'string'"; - "(2,41--2,43): This expression was expected to have type\u001d 'unit * int' \u001dbut here has type\u001d 'unit'"; + "(2,5--2,7): This expression was expected to have type 'unit' but here has type 'string'"; + "(2,41--2,43): This expression was expected to have type 'unit * int' but here has type 'unit'"; "(2,4--2,24): Incomplete pattern matches on this expression." ] @@ -81,7 +81,7 @@ match A with """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(7,5--7,12): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d ''a * 'b * 'c'"; + "(7,5--7,12): This expression was expected to have type 'int' but here has type ''a * 'b * 'c'"; "(6,6--6,7): Incomplete pattern matches on this expression." ] @@ -169,7 +169,7 @@ match Some 1 with """ assertHasSymbolUsages ["a"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(3,7--3,14): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d ''a option'" + "(3,7--3,14): This expression was expected to have type 'int' but here has type ''a option'" "(2,6--2,12): Incomplete pattern matches on this expression." ] @@ -181,7 +181,7 @@ match Some 1 with """ assertHasSymbolUsages ["a"; "i"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(3,7--3,18): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d ''a option'"; + "(3,7--3,18): This expression was expected to have type 'int' but here has type ''a option'"; "(2,6--2,12): Incomplete pattern matches on this expression." ] @@ -281,7 +281,7 @@ match A with assertHasSymbolUsages ["x"; "y"; "z"] checkResults dumpDiagnostics checkResults |> shouldEqual [ "(7,2--7,21): The two sides of this 'or' pattern bind different sets of variables"; - "(7,19--7,20): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'string'"; + "(7,19--7,20): This expression was expected to have type 'int' but here has type 'string'"; "(6,6--6,7): Incomplete pattern matches on this expression. For example, the value 'A' may indicate a case not covered by the pattern(s)." ] @@ -335,7 +335,7 @@ match Unchecked.defaultof with """ assertHasSymbolUsages ["a"; "b"; "c"; "d"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(5,21--5,27): Type constraint mismatch. The type \u001d 'int' \u001dis not compatible with type\u001d 'System.Enum'" + "(5,21--5,27): Type constraint mismatch. The type 'int' is not compatible with type 'System.Enum'" ] [] @@ -550,21 +550,21 @@ let z as "(14,6--14,8): Expecting pattern"; "(15,13--15,14): Unexpected symbol '=' in pattern. Expected ')' or other token."; "(15,9--15,10): Unmatched '('"; - "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; "(17,16--17,17): Unexpected identifier in pattern. Expected '(' or other token."; "(19,6--19,8): Expecting pattern"; "(20,0--20,0): Incomplete structured construct at or before this point in binding. Expected '=' or other token."; - "(3,13--3,17): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'bool'"; + "(3,13--3,17): This expression was expected to have type 'int' but here has type 'bool'"; "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."; - "(4,16--4,17): This expression was expected to have type\u001d 'bool' \u001dbut here has type\u001d 'int'"; + "(4,16--4,17): This expression was expected to have type 'bool' but here has type 'int'"; "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."; - "(5,9--5,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; - "(6,9--6,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; - "(8,29--8,30): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; - "(9,26--9,27): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; - "(10,15--10,16): This expression was expected to have type\u001d ''a * 'b' \u001dbut here has type\u001d 'int'"; + "(5,9--5,15): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,9--6,15): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,29--8,30): This expression was expected to have type 'unit' but here has type 'int'"; + "(9,26--9,27): This expression was expected to have type 'unit' but here has type 'int'"; + "(10,15--10,16): This expression was expected to have type ''a * 'b' but here has type 'int'"; "(11,11--11,12): The type 'k' is not defined."; - "(12,16--12,18): This expression was expected to have type\u001d ''a list' \u001dbut here has type\u001d 'int'"; + "(12,16--12,18): This expression was expected to have type ''a list' but here has type 'int'"; "(12,4--12,13): Incomplete pattern matches on this expression. For example, the value '[]' may indicate a case not covered by the pattern(s)."; "(14,4--14,12): The two sides of this 'or' pattern bind different sets of variables"; "(18,14--18,15): The value or constructor 'y' is not defined." @@ -687,22 +687,22 @@ let z as = "(14,8--14,10): Unexpected keyword 'as' in binding"; "(15,8--15,10): Unexpected keyword 'as' in pattern. Expected ')' or other token."; "(15,6--15,7): Unmatched '('"; - "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; "(16,0--16,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token."; "(15,0--15,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword."; "(17,0--17,3): Incomplete structured construct at or before this point in implementation file"; - "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; - "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; - "(3,13--3,17): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'bool'"; + "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(3,13--3,17): This expression was expected to have type 'int' but here has type 'bool'"; "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."; - "(4,16--4,17): This expression was expected to have type\u001d 'bool' \u001dbut here has type\u001d 'int'"; + "(4,16--4,17): This expression was expected to have type 'bool' but here has type 'int'"; "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."; - "(5,4--5,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; - "(6,4--6,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; - "(8,29--8,30): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; - "(9,26--9,27): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; - "(10,14--10,15): This expression was expected to have type\u001d ''a * 'b' \u001dbut here has type\u001d 'int'"; - "(12,16--12,18): This expression was expected to have type\u001d ''a list' \u001dbut here has type\u001d 'int'"; + "(5,4--5,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,4--6,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,29--8,30): This expression was expected to have type 'unit' but here has type 'int'"; + "(9,26--9,27): This expression was expected to have type 'unit' but here has type 'int'"; + "(10,14--10,15): This expression was expected to have type ''a * 'b' but here has type 'int'"; + "(12,16--12,18): This expression was expected to have type ''a list' but here has type 'int'"; "(12,4--12,13): Incomplete pattern matches on this expression. For example, the value '[]' may indicate a case not covered by the pattern(s)."; "(15,4--15,5): The pattern discriminator 'r' is not defined."; "(15,4--15,12): Incomplete pattern matches on this expression." @@ -755,7 +755,7 @@ Some x |> eq """ assertHasSymbolUsages (List.map string ['a'..'z']) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(11,25--11,26): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'objnull'"; + "(11,25--11,26): This expression was expected to have type 'int' but here has type 'objnull'"; "(28,6--28,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(26,6--26,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; @@ -875,44 +875,44 @@ let :? z as "(14,9--14,11): Expecting pattern"; "(15,16--15,17): Unexpected symbol '=' in pattern. Expected ')' or other token."; "(15,12--15,13): Unmatched '('"; - "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(16,0--16,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; "(17,19--17,20): Unexpected identifier in pattern. Expected '(' or other token."; "(19,9--19,11): Expecting pattern"; "(20,0--20,0): Incomplete structured construct at or before this point in binding. Expected '=' or other token."; "(3,7--3,8): The type 'a' is not defined."; - "(3,4--3,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(3,4--3,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(4,7--4,8): The type 'b' is not defined."; - "(4,4--4,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(4,4--4,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(5,7--5,8): The type 'c' is not defined."; - "(5,4--5,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(5,4--5,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(6,7--6,8): The type 'd' is not defined."; - "(6,4--6,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,4--6,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(7,7--7,8): The type 'e' is not defined."; - "(7,4--7,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(7,4--7,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(8,7--8,8): The type 'f' is not defined."; - "(8,4--8,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,4--8,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(9,7--9,8): The type 'g' is not defined."; - "(9,4--9,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(9,4--9,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(10,7--10,8): The type 'h' is not defined."; - "(10,4--10,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(10,4--10,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(10,7--10,8): The type 'h' is not defined."; - "(10,4--10,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(10,4--10,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(11,7--11,8): The type 'j' is not defined."; - "(11,4--11,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(11,4--11,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(12,7--12,8): The type 'l' is not defined."; - "(12,4--12,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(12,4--12,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(13,7--13,8): The type 'n' is not defined."; - "(13,4--13,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(13,4--13,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(14,7--14,8): The type 'p' is not defined."; - "(14,4--14,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(14,4--14,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(15,7--15,8): The type 'r' is not defined."; - "(15,4--15,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(15,4--15,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(17,7--17,8): The type 'v' is not defined."; - "(17,4--17,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(17,4--17,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(18,7--18,8): The type 'x' is not defined."; - "(18,4--18,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(18,4--18,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(19,7--19,8): The type 'z' is not defined."; - "(19,4--19,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." + "(19,4--19,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." ] [] @@ -955,8 +955,8 @@ Some "" |> eq // No more type checks after the above line? """ assertHasSymbolUsages (Set.toList validSet) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(27,2--27,14): This expression was expected to have type\u001d 'objnull' \u001dbut here has type\u001d 'struct ('a * 'b)'"; - "(52,2--52,13): This expression was expected to have type\u001d 'objnull' \u001dbut here has type\u001d 'AAA'"; + "(27,2--27,14): This expression was expected to have type 'objnull' but here has type 'struct ('a * 'b)'"; + "(52,2--52,13): This expression was expected to have type 'objnull' but here has type 'AAA'"; "(26,6--26,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; @@ -1037,9 +1037,9 @@ Some "" |> eq """ assertHasSymbolUsages (set ['a'..'y'] - set [ 'm'..'r' ] |> Set.map string |> Set.toList) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(19,2--19,4): This expression was expected to have type\u001d 'objnull' \u001dbut here has type\u001d 'int'"; - "(21,2--21,7): This expression was expected to have type\u001d 'objnull' \u001dbut here has type\u001d 'bool'"; - "(23,2--23,6): This expression was expected to have type\u001d 'objnull' \u001dbut here has type\u001d 'bool'"; + "(19,2--19,4): This expression was expected to have type 'objnull' but here has type 'int'"; + "(21,2--21,7): This expression was expected to have type 'objnull' but here has type 'bool'"; + "(23,2--23,6): This expression was expected to have type 'objnull' but here has type 'bool'"; "(28,28--28,29): The type 'objnull' does not match the type 'int'"; "(41,5--41,6): The value or constructor 'm' is not defined."; "(42,5--42,6): The value or constructor 'n' is not defined."; @@ -1092,22 +1092,22 @@ let as :? z = "(15,13--15,15): Unexpected keyword 'as' in pattern. Expected '(' or other token."; "(16,8--16,10): Unexpected keyword 'as' in pattern. Expected ')' or other token."; "(16,6--16,7): Unmatched '('"; - "(17,0--17,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (16:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(17,0--17,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (16:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; "(17,0--17,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token."; "(16,0--16,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword."; "(17,8--17,10): Unexpected keyword 'as' in pattern. Expected ']' or other token."; - "(18,0--18,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (17:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; - "(19,0--19,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (18:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; - "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; - "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further.\u001dTo continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(18,0--18,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (17:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(19,0--19,3): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (18:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; + "(20,0--20,0): Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7."; "(3,12--3,13): The type 'a' is not defined."; "(3,9--3,13): The type 'int' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; "(4,15--4,16): The type 'b' is not defined."; "(4,12--4,16): The type 'bool' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; - "(5,4--5,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; - "(6,4--6,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(5,4--5,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,4--6,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(7,27--7,28): The type 'e' is not defined."; - "(7,24--7,28): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(7,24--7,28): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; "(8,28--8,29): The type 'f' is not defined."; "(8,25--8,29): The type 'unit' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; "(9,25--9,26): The type 'g' is not defined."; @@ -1118,7 +1118,7 @@ let as :? z = "(12,12--12,16): The type ''a list' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; "(16,4--16,5): The pattern discriminator 't' is not defined."; "(16,14--16,15): The type 'u' is not defined."; - "(16,11--16,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." + "(16,11--16,15): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." ] [] diff --git a/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs new file mode 100644 index 00000000000..07827b7d399 --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/TypeChecker/TypeCheckerRecoveryTests.fs @@ -0,0 +1,52 @@ +module FSharp.Compiler.Service.Tests.TypeChecker.TypeCheckerRecoveryTests + +open FSharp.Compiler.Service.Tests +open FSharp.Test.Assert +open Xunit + +[] +let ``Let 01`` () = + let _, checkResults = getParseAndCheckResults """ +do + let a = b.ToString() +""" + + dumpDiagnosticNumbers checkResults |> shouldEqual [ + "(3,4--3,7)", 588 + "(3,12--3,13)", 39 + ] + + +[] +let ``Tuple 01`` () = + let _, checkResults = getParseAndCheckResults """ +open System + +Math.Max(a,) +""" + + dumpDiagnosticNumbers checkResults |> shouldEqual [ + "(4,10--4,11)", 3100 + "(4,9--4,10)", 39 + "(4,0--4,12)", 41 + ] + + assertHasSymbolUsages ["Max"] checkResults + + +[] +let ``Tuple 02`` () = + let _, checkResults = getParseAndCheckResults """ +open System + +Math.Max(a,b,) +""" + + dumpDiagnosticNumbers checkResults |> shouldEqual [ + "(4,12--4,13)", 3100 + "(4,9--4,10)", 39 + "(4,11--4,12)", 39 + "(4,0--4,14)", 503 + ] + + assertHasSymbolUsages ["Max"] checkResults \ No newline at end of file diff --git a/tests/fsharp/typecheck/sigs/neg104.vsbsl b/tests/fsharp/typecheck/sigs/neg104.vsbsl index 165b4348e35..ab4a928249b 100644 --- a/tests/fsharp/typecheck/sigs/neg104.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg104.vsbsl @@ -23,6 +23,8 @@ neg104.fs(8,9,8,15): typecheck error FS0750: This construct may only be used wit neg104.fs(10,9,10,15): typecheck error FS0750: This construct may only be used within computation expressions +neg104.fs(13,21,13,26): typecheck error FS0003: This value is not a function and cannot be applied. + neg104.fs(20,9,20,15): typecheck error FS0025: Incomplete pattern matches on this expression. neg104.fs(23,9,23,15): typecheck error FS0025: Incomplete pattern matches on this expression. diff --git a/tests/fsharp/typecheck/sigs/neg110.bsl b/tests/fsharp/typecheck/sigs/neg110.bsl index 1cdd563a742..60cae991283 100644 --- a/tests/fsharp/typecheck/sigs/neg110.bsl +++ b/tests/fsharp/typecheck/sigs/neg110.bsl @@ -1,2 +1,2 @@ -neg110.fs(5,3,5,15): typecheck error FS3242: This type does not inherit Attribute, it will not work correctly with other .NET languages. +neg110.fs(5,3,5,15): typecheck error FS3242: This type does not inherit Attribute, it will not work correctly with other .NET languages. diff --git a/tests/fsharp/typecheck/sigs/neg135.vsbsl b/tests/fsharp/typecheck/sigs/neg135.vsbsl new file mode 100644 index 00000000000..e3d34411d0c --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg135.vsbsl @@ -0,0 +1,8 @@ + +neg135.fs(6,1,6,2): parse error FS0010: Unexpected symbol '}' in expression + +neg135.fs(4,5,4,11): parse error FS3122: Missing 'do' in 'while' expression. Expected 'while do '. + +neg135.fs(4,12,4,17): typecheck error FS0003: This value is not a function and cannot be applied. + +neg135.fs(4,12,4,17): typecheck error FS0003: This value is not a function and cannot be applied. diff --git a/tests/fsharp/typecheck/sigs/neg64.vsbsl b/tests/fsharp/typecheck/sigs/neg64.vsbsl index e9578dc3735..26cdbc069c1 100644 --- a/tests/fsharp/typecheck/sigs/neg64.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg64.vsbsl @@ -1,2 +1,6 @@ neg64.fsx(32,32,32,33): parse error FS0010: Unexpected symbol ')' in if/then/else expression + +neg64.fsx(32,17,32,31): typecheck error FS0001: All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is 'string'. This branch returns a value of type 'bool'. + +neg64.fsx(27,11,27,13): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Horizontal (_, _)' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg68.vsbsl b/tests/fsharp/typecheck/sigs/neg68.vsbsl index b55d58ee143..369c1e15865 100644 --- a/tests/fsharp/typecheck/sigs/neg68.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg68.vsbsl @@ -1,6 +1,26 @@ neg68.fsx(71,46,71,47): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. +neg68.fsx(71,32,71,33): typecheck error FS0062: This construct is for ML compatibility. Consider using the '+' operator instead. This may require a type annotation to indicate it acts on strings. This message can be disabled using '--nowarn:62' or '#nowarn "62"'. + +neg68.fsx(71,30,71,46): typecheck error FS0001: This expression was expected to have type + 'float' +but here has type + 'string' + +neg68.fsx(71,30,71,31): typecheck error FS1133: No constructors are available for the type 'm' + +neg68.fsx(71,43,71,44): typecheck error FS0062: This construct is for ML compatibility. Consider using the '+' operator instead. This may require a type annotation to indicate it acts on strings. This message can be disabled using '--nowarn:62' or '#nowarn "62"'. + +neg68.fsx(71,39,71,45): typecheck error FS0001: The type 'string' does not match the type 'int' + +neg68.fsx(71,39,71,41): typecheck error FS1133: No constructors are available for the type 'kg' + +neg68.fsx(71,44,71,45): typecheck error FS0001: This expression was expected to have type + 'string' +but here has type + 'int' + neg68.fsx(123,40,123,41): typecheck error FS0001: The type 'bool' does not match the type 'float<'u>' neg68.fsx(123,38,123,39): typecheck error FS0043: The type 'bool' does not match the type 'float<'u>' diff --git a/tests/fsharp/typecheck/sigs/neg70.vsbsl b/tests/fsharp/typecheck/sigs/neg70.vsbsl index 16c15ba3780..c392fc98985 100644 --- a/tests/fsharp/typecheck/sigs/neg70.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg70.vsbsl @@ -1,2 +1,14 @@ neg70.fsx(109,64,109,65): parse error FS0010: Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token. + +neg70.fsx(107,29,107,69): typecheck error FS0507: No accessible member or object constructor named 'Rectangle' takes 0 arguments. Note the call to this member also provides 1 named arguments. + +neg70.fsx(108,39,108,40): typecheck error FS0039: The value or constructor 'y' is not defined. + +neg70.fsx(110,18,110,43): typecheck error FS0041: No overloads match for method 'FillEllipse'. + +Known types of arguments: Brush * (int * bool * bool * bool) + +Available overloads: + - Graphics.FillEllipse(brush: Brush, rect: Rectangle) : unit // Argument 'rect' doesn't match + - Graphics.FillEllipse(brush: Brush, rect: RectangleF) : unit // Argument 'rect' doesn't match diff --git a/tests/fsharp/typecheck/sigs/neg79.vsbsl b/tests/fsharp/typecheck/sigs/neg79.vsbsl index b5599e27953..452690e0d91 100644 --- a/tests/fsharp/typecheck/sigs/neg79.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg79.vsbsl @@ -1,2 +1,6 @@ neg79.fsx(31,32,31,33): parse error FS0010: Unexpected symbol ')' in if/then/else expression + +neg79.fsx(31,17,31,31): typecheck error FS0001: All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is 'string'. This branch returns a value of type 'bool'. + +neg79.fsx(26,11,26,13): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Horizontal (_, _)' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg80.vsbsl b/tests/fsharp/typecheck/sigs/neg80.vsbsl index 86e8d40b6f4..66f66c479df 100644 --- a/tests/fsharp/typecheck/sigs/neg80.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg80.vsbsl @@ -1,2 +1,4 @@ neg80.fsx(79,5,79,6): parse error FS0010: Unexpected symbol '|' in pattern matching + +neg80.fsx(79,7,79,28): typecheck error FS0026: This rule will never be matched diff --git a/tests/fsharp/typecheck/sigs/neg82.vsbsl b/tests/fsharp/typecheck/sigs/neg82.vsbsl index a57ce6cbf67..af56fd45ac2 100644 --- a/tests/fsharp/typecheck/sigs/neg82.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg82.vsbsl @@ -26,4 +26,6 @@ To continue using non-conforming indentation, pass the '--strict-indentation-' f neg82.fsx(138,1,138,4): parse error FS0058: Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (102:1). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. +neg82.fsx(76,11,76,13): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Horizontal (_, _)' may indicate a case not covered by the pattern(s). + neg82.fsx(93,5,93,7): typecheck error FS0039: The value, namespace, type or module 'sb' is not defined. diff --git a/tests/fsharp/typecheck/sigs/neg83.vsbsl b/tests/fsharp/typecheck/sigs/neg83.vsbsl index b8858cfbe11..84ee39a23f5 100644 --- a/tests/fsharp/typecheck/sigs/neg83.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg83.vsbsl @@ -8,3 +8,21 @@ neg83.fsx(13,2,13,5): parse error FS0058: Unexpected syntax or possible incorrec To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. neg83.fsx(16,1,16,1): parse error FS0010: Incomplete structured construct at or before this point in expression + +neg83.fsx(8,12,8,39): typecheck error FS0001: Type mismatch. Expecting a + '('a -> 'a) -> string -> 'b' +but given a + ''c list -> 'd list' +The type ''a list' does not match the type ''b -> 'b' + +neg83.fsx(8,12,8,39): typecheck error FS0001: Type mismatch. Expecting a + '('a -> 'a) -> string -> 'b' +but given a + ''c list -> 'd list' +The type ''a list' does not match the type ''c -> 'c' + +neg83.fsx(10,15,10,17): typecheck error FS3217: This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'? + +neg83.fsx(15,4,15,31): typecheck error FS0001: The type ''a list' does not match the type ''b -> 'b' + +neg83.fsx(15,4,15,31): typecheck error FS0001: The type ''a list' does not match the type ''c -> 'c' diff --git a/tests/fsharp/typecheck/sigs/neg84.vsbsl b/tests/fsharp/typecheck/sigs/neg84.vsbsl index 6d4db3adec9..ca1137c0064 100644 --- a/tests/fsharp/typecheck/sigs/neg84.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg84.vsbsl @@ -1,2 +1,4 @@ neg84.fsx(11,1,11,1): parse error FS0010: Incomplete structured construct at or before this point in expression + +neg84.fsx(4,10,4,12): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '[_]' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg86.vsbsl b/tests/fsharp/typecheck/sigs/neg86.vsbsl index 667ca721ae3..53212577f61 100644 --- a/tests/fsharp/typecheck/sigs/neg86.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg86.vsbsl @@ -9,6 +9,13 @@ neg86.fsx(8,13,8,17): typecheck error FS3167: 'join' must be followed by 'in'. U neg86.fsx(9,21,9,22): typecheck error FS0039: The value or constructor 'e' is not defined. +neg86.fsx(18,20,18,22): typecheck error FS3145: This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. + +neg86.fsx(18,20,18,22): typecheck error FS0039: The value or constructor 'op_Atin' is not defined. Maybe you want one of the following: + Option + option + Option + neg86.fsx(23,13,23,17): typecheck error FS3097: Incorrect syntax for 'join'. Usage: join var in collection on (outerKey = innerKey). Note that parentheses are required after 'on'. neg86.fsx(28,13,28,17): typecheck error FS3097: Incorrect syntax for 'join'. Usage: join var in collection on (outerKey = innerKey). Note that parentheses are required after 'on'. From 9c8efd2b19fd0ccf47fe6469034496b1eecc3cc3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:45:48 +0200 Subject: [PATCH 059/134] Update dependencies from https://github.com/dotnet/msbuild build 20250409.1 (#18467) Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.23-preview-25208-06 -> To Version 17.13.24-preview-25209-01 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NuGet.config b/NuGet.config index dd573e4a915..da8e2711646 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0917752a5d6..b91e25051bf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff + 7a09d5ee44eb217e9c1ae0bab242c79c70423577 - + https://github.com/dotnet/msbuild - 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff + 7a09d5ee44eb217e9c1ae0bab242c79c70423577 - + https://github.com/dotnet/msbuild - 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff + 7a09d5ee44eb217e9c1ae0bab242c79c70423577 - + https://github.com/dotnet/msbuild - 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff + 7a09d5ee44eb217e9c1ae0bab242c79c70423577 - + https://github.com/dotnet/msbuild - 8e42d4a440e0f85c1e8dce43767e7a50d86aa8ff + 7a09d5ee44eb217e9c1ae0bab242c79c70423577 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index ed7cd7b47ca..e8e0195904f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -102,7 +102,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.23 + 17.13.24 $(RoslynVersion) $(RoslynVersion) @@ -138,9 +138,9 @@ 15.0.25123-Dev15Preview - 17.13.23 - 17.13.23 - 17.13.23 + 17.13.24 + 17.13.24 + 17.13.24 $(VisualStudioEditorPackagesVersion) From c04f5adb4f65d62862ad4a1e516425b1097a38a5 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:46:20 +0200 Subject: [PATCH 060/134] Tests: add helper `Stress` attribute for stress testing (#18452) --- DEVGUIDE.md | 9 ++++ eng/Build.ps1 | 3 +- eng/build.sh | 1 + .../CompilerService/AsyncMemoize.fs | 7 +-- .../FSharp.Test.Utilities.fsproj | 20 +++------ tests/FSharp.Test.Utilities/Tests.fs | 45 +++++++++++++++++++ tests/FSharp.Test.Utilities/XunitHelpers.fs | 8 ++++ tests/FSharp.Test.Utilities/xunit.runner.json | 5 +++ 8 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 tests/FSharp.Test.Utilities/Tests.fs create mode 100644 tests/FSharp.Test.Utilities/xunit.runner.json diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 28b511fac04..c551c90af2b 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -252,6 +252,15 @@ For example: module TimeCritical = ``` +For stress testing async code you can use a custom `FSharp.Test.StressAttribute`. +For example, applied to a single xUnit test case: +```fsharp +[] +``` +it will start it many times at the same time, and execute in parallel. + + + ### Updating FCS surface area baselines diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 32dcca19336..91ed6cd4008 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -615,7 +615,8 @@ try { if ($testDesktop -and $ci) { $bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - + + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Test.Utilities\" TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" diff --git a/eng/build.sh b/eng/build.sh index 1263445973f..650f78163e5 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -331,6 +331,7 @@ BuildSolution if [[ "$test_core_clr" == true ]]; then coreclrtestframework=$tfm + Test --testproject "$repo_root/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj" --targetframework $coreclrtestframework Test --testproject "$repo_root/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj" --targetframework $coreclrtestframework Test --testproject "$repo_root/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj" --targetframework $coreclrtestframework Test --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs index f37b64eb0f5..77e8f4b2137 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/AsyncMemoize.fs @@ -422,18 +422,19 @@ let ``Cancel running jobs with the same key`` () = // detach requests from their running computations cts.Cancel() + // Cancel the Get requests, leaving the jobs running unawaited. for job in jobsToCancel do assertTaskCanceled job + // Start another request. let job = cache.Get(key 11, work) |> Async.StartAsTask // up til now the jobs should have been running unobserved let current = eventsWhen events (received Requested) Assert.Equal(0, current |> countOf Canceled) - // waitUntil events (countOf Canceled >> (=) 10) - - waitUntil events (received Started) + waitUntil events (countOf Started >> (=) 11) + // Allow the single current request to finish. jobCanContinue.Set() |> ignore job.Wait() diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 37c1940b7a9..b98f57603c6 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -10,7 +10,8 @@ true false false - false + xunit + true $(OtherFlags) --warnon:1182 --realsig- true @@ -23,10 +24,9 @@ - - - - + + PreserveNewest + scriptlib.fsx @@ -46,11 +46,10 @@ + + - - - @@ -70,11 +69,6 @@ - - - - - diff --git a/tests/FSharp.Test.Utilities/Tests.fs b/tests/FSharp.Test.Utilities/Tests.fs new file mode 100644 index 00000000000..9561f1bf08f --- /dev/null +++ b/tests/FSharp.Test.Utilities/Tests.fs @@ -0,0 +1,45 @@ +module FSharp.Test.UtilitiesTests + +open System +open System.Threading +open Xunit +open FSharp.Test + +type RunOrFail(name) = + let mutable count = 0 + member _.Run(shouldFail: bool) = + let count = Interlocked.Increment &count + if shouldFail && count = 42 then + failwith $"{name}, failed as expected on {count}" + else + printfn $"{name}, iteration {count} passed" + count + +let passing = RunOrFail "Passing" +let failing = RunOrFail "Failing" + +[] +let ``Stress attribute should catch intermittent failure`` shouldFail _ = + failing.Run shouldFail + +[] +let ``Stress attribute works`` _ = + passing.Run false + +[] +let ``TestConsole captures output`` () = + let rnd = Random() + let task n = + async { + use console = new TestConsole.ExecutionCapture() + do! Async.Sleep (rnd.Next 50) + printf $"Hello, world! {n}" + do! Async.Sleep (rnd.Next 50) + eprintf $"Some error {n}" + return console.OutText, console.ErrorText + } + + let expected = [ for n in 0 .. 9 -> $"Hello, world! {n}", $"Some error {n}" ] + + let results = Seq.init 10 task |> Async.Parallel |> Async.RunSynchronously + Assert.Equal(expected, results) diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index cf7ecf3b2cf..34a44df17ed 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -21,6 +21,14 @@ open OpenTelemetry.Trace [] type RunTestCasesInSequenceAttribute() = inherit Attribute() +// Helper for stress testing. +// Runs a test case many times in parallel. +// Example usage: [] +type StressAttribute([] data: obj array) = + inherit DataAttribute() + member val Count = 1 with get, set + override this.GetData _ = Seq.init this.Count (fun i -> [| yield! data; yield box i |]) + #if XUNIT_EXTRAS // To use xUnit means to customize it. The following abomination adds 2 features: diff --git a/tests/FSharp.Test.Utilities/xunit.runner.json b/tests/FSharp.Test.Utilities/xunit.runner.json new file mode 100644 index 00000000000..b01c50a3cb5 --- /dev/null +++ b/tests/FSharp.Test.Utilities/xunit.runner.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "appDomain": "denied", + "parallelizeAssembly": true +} From b0956fe7a02f00a0adb66186b74b0b0290f264dc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 15:46:48 +0200 Subject: [PATCH 061/134] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250409.1 (#18466) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25204.3 -> To Version 9.0.0-alpha.1.25209.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b91e25051bf..47d04e20012 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 643689c88b1d5a0f1561383972c4189a0c673abe + 7dbf5deea5bdccf513df73cba179c4c0ad106010 From b567966dea4fe54cab3be8a3f767ead937d7d5ea Mon Sep 17 00:00:00 2001 From: Petr Date: Fri, 11 Apr 2025 00:28:23 +0200 Subject: [PATCH 062/134] Minor diag fixes in TypedTreePickle (#18469) --- src/Compiler/TypedTree/TypedTreePickle.fs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 9d7cadd6fce..4d38bd5462a 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -135,6 +135,14 @@ type NodeOutTable<'Data, 'Node> = Table = Table<_>.Create nm } +// Small glossary for future generations: +// o... - output +// i... - input +// os - output stream +// is - input stream +// tab - table +// osgn - output stream graph nodes + [] type WriterState = { @@ -1937,7 +1945,7 @@ let u_tcref st = match tag with | 0 -> u_local_item_ref st.ientities st |> ERefLocal | 1 -> u_nleref st |> ERefNonLocal - | _ -> ufailwith st "u_item_ref" + | _ -> ufailwith st "u_tcref" let u_ucref st = let a, b = u_tup2 u_tcref u_string st @@ -2027,7 +2035,7 @@ let u_vref st = match tag with | 0 -> u_local_item_ref st.ivals st |> VRefLocal | 1 -> u_nonlocal_val_ref st |> VRefNonLocal - | _ -> ufailwith st "u_item_ref" + | _ -> ufailwith st "u_vref" let u_vrefs = u_list u_vref @@ -3206,7 +3214,7 @@ and u_parentref st = match tag with | 0 -> ParentNone | 1 -> u_tcref st |> Parent - | _ -> ufailwith st "u_attribkind" + | _ -> ufailwith st "u_parentref" and u_attribkind st = let tag = u_byte st @@ -3496,7 +3504,7 @@ and u_lval_op_kind st = | 1 -> LByrefGet | 2 -> LSet | 3 -> LByrefSet - | _ -> ufailwith st "uval_op_kind" + | _ -> ufailwith st "ulval_op_kind" and p_op x st = match x with From 54321fef3df46111c927215c04d6be4354a60af4 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 14 Apr 2025 15:26:54 +0100 Subject: [PATCH 063/134] Fix resumable and non-resumable CE error ranges (#18450) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../CheckComputationExpressions.fs | 2 +- ...3.fs.RealInternalSignatureOff.il.debug.bsl | 48 +- ...fs.RealInternalSignatureOff.il.release.bsl | 29 +- ...t3.fs.RealInternalSignatureOn.il.debug.bsl | 32 +- ....fs.RealInternalSignatureOn.il.release.bsl | 11 - ...4.fs.RealInternalSignatureOff.il.debug.bsl | 100 ++--- ...fs.RealInternalSignatureOff.il.release.bsl | 49 +- ...t4.fs.RealInternalSignatureOn.il.debug.bsl | 72 +-- ....fs.RealInternalSignatureOn.il.release.bsl | 19 +- ...5.fs.RealInternalSignatureOff.il.debug.bsl | 98 ++-- ...fs.RealInternalSignatureOff.il.release.bsl | 57 +-- ...st5.fs.RealInternalSignatureOn.il.debug.bs | 425 ++++++++++++++++++ ...t5.fs.RealInternalSignatureOn.il.debug.bsl | 58 +-- ....fs.RealInternalSignatureOn.il.release.bsl | 15 +- ...6.fs.RealInternalSignatureOff.il.debug.bsl | 271 ++++------- ...fs.RealInternalSignatureOff.il.release.bsl | 153 +++---- ...t6.fs.RealInternalSignatureOn.il.debug.bsl | 215 ++++----- ....fs.RealInternalSignatureOn.il.release.bsl | 93 ++-- ...nExpr03.fs.RealInternalSignatureOff.il.bsl | 21 +- ...onExpr03.fs.RealInternalSignatureOn.il.bsl | 21 +- .../Language/ComputationExpressionTests.fs | 128 ++++++ .../CallerInfoAndComputationExpression.fs | 2 +- 23 files changed, 1001 insertions(+), 919 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 0b1b492c678..16f5721e22a 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -23,6 +23,7 @@ * Fix checking bug in unpickling [PR #18430](https://github.com/dotnet/fsharp/pull/18430) * Reenable β-reduction and subsequent reoptimization of immediately-invoked F#-defined generic delegates. ([PR #18401](https://github.com/dotnet/fsharp/pull/18401)) * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) +* Fix confusing type inference error in task expression ([Issue #13789](https://github.com/dotnet/fsharp/issues/13789), [PR #18450](https://github.com/dotnet/fsharp/pull/18450)) * Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 10b4a891b32..45a35970af7 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -2759,7 +2759,7 @@ and TranslateComputationExpressionBind ) let bindCall = - mkSynCall bindName bindRange (bindArgs @ [ consumeExpr ]) ceenv.builderValName + mkSynCall bindName holeFill.Range (bindArgs @ [ consumeExpr ]) ceenv.builderValName translatedCtxt (bindCall |> addBindDebugPoint)) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.debug.bsl index 86e0cc6afbd..3cd259184db 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,12 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -65,18 +54,17 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res + IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value' IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res + IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -92,8 +80,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -107,8 +94,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -116,8 +102,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, int32 V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, - int32 V_4, - int32 V_5) + int32 V_4) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -150,18 +135,15 @@ IL_0041: ldloc.2 IL_0042: stloc.s V_4 IL_0044: ldloc.s V_4 - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_5 - IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32) - IL_004f: tail. - IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0056: ret + IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32) + IL_004b: tail. + IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0052: ret } } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f3() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f3() cil managed { .maxstack 4 @@ -187,8 +169,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -214,4 +195,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.release.bsl index f564cc5c3c6..3cd259184db 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOff.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -54,8 +44,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 'value') cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -69,8 +58,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -92,8 +80,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -107,8 +94,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -157,8 +143,7 @@ } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f3() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f3() cil managed { .maxstack 4 @@ -184,8 +169,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -211,4 +195,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.debug.bsl index 38d888ef90e..02ce2ab3436 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,11 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@10-1' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -64,7 +54,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f3@10-1'::res + IL_0008: stfld int32 assembly/assembly/'f3@10-1'::'value' IL_000d: ret } @@ -74,7 +64,7 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::res + IL_0002: ldfld int32 assembly/assembly/'f3@10-1'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -112,8 +102,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, int32 V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, - int32 V_4, - int32 V_5) + int32 V_4) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -146,12 +135,10 @@ IL_0041: ldloc.2 IL_0042: stloc.s V_4 IL_0044: ldloc.s V_4 - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_5 - IL_004a: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32) - IL_004f: tail. - IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0056: ret + IL_0046: newobj instance void assembly/assembly/'f3@10-1'::.ctor(int32) + IL_004b: tail. + IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0052: ret } } @@ -246,4 +233,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.release.bsl index 69e251eafbf..02ce2ab3436 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.fs.RealInternalSignatureOn.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -243,4 +233,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.debug.bsl index 77d0d57a799..348b1d1471d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,12 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@10-2' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -65,18 +54,17 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f4@10-2'::res + IL_0008: stfld int32 assembly/assembly/'f4@10-2'::'value' IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f4@10-2'::res + IL_0002: ldfld int32 assembly/assembly/'f4@10-2'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -93,9 +81,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -112,16 +98,14 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 6 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, int32 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, - int32 V_3, - int32 V_4) + int32 V_3) IL_0000: nop IL_0001: ldc.i4.0 IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) @@ -144,12 +128,10 @@ IL_002f: ldloc.1 IL_0030: stloc.3 IL_0031: ldloc.3 - IL_0032: stloc.s V_4 - IL_0034: ldloc.s V_4 - IL_0036: newobj instance void assembly/assembly/'f4@10-2'::.ctor(int32) - IL_003b: tail. - IL_003d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0042: ret + IL_0032: newobj instance void assembly/assembly/'f4@10-2'::.ctor(int32) + IL_0037: tail. + IL_0039: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_003e: ret } } @@ -158,8 +140,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -173,8 +154,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 8 @@ -198,17 +178,15 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@6-4' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 finallyFunction + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 finallyFunction, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -218,15 +196,14 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::finallyFunction + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::compensation IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -234,7 +211,7 @@ IL_0001: ldarg.0 IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::finallyFunction + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::compensation IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::TryFinally(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -251,8 +228,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -266,17 +242,14 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_3) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -295,23 +268,18 @@ IL_0026: ldloc.0 IL_0027: newobj instance void assembly/assembly/'f4@12-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_002c: stloc.3 - IL_002d: ldloc.3 - IL_002e: stloc.s V_4 - IL_0030: ldloc.2 - IL_0031: stloc.s V_5 - IL_0033: ldloc.s V_4 - IL_0035: ldloc.s V_5 - IL_0037: newobj instance void assembly/assembly/'f4@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) - IL_003c: tail. - IL_003e: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0043: ret + IL_002d: ldloc.2 + IL_002e: ldloc.3 + IL_002f: newobj instance void assembly/assembly/'f4@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0034: tail. + IL_0036: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_003b: ret } } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f4() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f4() cil managed { .maxstack 4 @@ -337,8 +305,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -364,4 +331,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.release.bsl index 62f0e29565a..348b1d1471d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOff.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -54,8 +44,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 'value') cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -69,8 +58,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -93,9 +81,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -112,8 +98,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 6 @@ -155,8 +140,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 { .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -170,8 +154,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Core.Unit Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 8 @@ -203,9 +186,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -222,8 +203,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -248,8 +228,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -263,8 +242,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -301,8 +279,7 @@ } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f4() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f4() cil managed { .maxstack 4 @@ -328,8 +305,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -355,4 +331,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.debug.bsl index 57fce064655..87f258b2211 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,11 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@10-2' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -64,7 +54,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f4@10-2'::res + IL_0008: stfld int32 assembly/assembly/'f4@10-2'::'value' IL_000d: ret } @@ -74,7 +64,7 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f4@10-2'::res + IL_0002: ldfld int32 assembly/assembly/'f4@10-2'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -91,9 +81,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -117,8 +105,7 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, int32 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, - int32 V_3, - int32 V_4) + int32 V_3) IL_0000: nop IL_0001: ldc.i4.0 IL_0002: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) @@ -141,12 +128,10 @@ IL_002f: ldloc.1 IL_0030: stloc.3 IL_0031: ldloc.3 - IL_0032: stloc.s V_4 - IL_0034: ldloc.s V_4 - IL_0036: newobj instance void assembly/assembly/'f4@10-2'::.ctor(int32) - IL_003b: tail. - IL_003d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0042: ret + IL_0032: newobj instance void assembly/assembly/'f4@10-2'::.ctor(int32) + IL_0037: tail. + IL_0039: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_003e: ret } } @@ -193,17 +178,15 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f4@6-4' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 finallyFunction + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 finallyFunction, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -213,10 +196,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::finallyFunction + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::compensation IL_0014: ret } @@ -228,7 +211,7 @@ IL_0001: ldarg.0 IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f4@6-4'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::finallyFunction + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 assembly/assembly/'f4@6-4'::compensation IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::TryFinally(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -266,9 +249,7 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_3) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -287,17 +268,13 @@ IL_0026: ldloc.0 IL_0027: newobj instance void assembly/assembly/'f4@12-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_002c: stloc.3 - IL_002d: ldloc.3 - IL_002e: stloc.s V_4 - IL_0030: ldloc.2 - IL_0031: stloc.s V_5 - IL_0033: ldloc.s V_4 - IL_0035: ldloc.s V_5 - IL_0037: newobj instance void assembly/assembly/'f4@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) - IL_003c: tail. - IL_003e: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0043: ret + IL_002d: ldloc.2 + IL_002e: ldloc.3 + IL_002f: newobj instance void assembly/assembly/'f4@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) + IL_0034: tail. + IL_0036: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_003b: ret } } @@ -392,4 +369,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.release.bsl index 8d15000dc25..87f258b2211 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.fs.RealInternalSignatureOn.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -91,9 +81,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -198,9 +186,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 compensation) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -383,4 +369,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.debug.bsl index 537e2ce83d7..1c4d13e1c30 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -54,8 +44,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -69,8 +58,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg1) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed { .maxstack 5 @@ -101,8 +89,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -116,8 +103,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg2) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed { .maxstack 5 @@ -148,8 +134,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -163,8 +148,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 8 @@ -185,12 +169,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-4' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part2 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -200,17 +183,16 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::part2 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed { .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::part2 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 IL_0006: ret } @@ -219,7 +201,7 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-5' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -227,9 +209,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -239,21 +219,20 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 IL_000d: ldarg.0 IL_000e: ldarg.2 IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 IL_0007: ldarg.0 IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 IL_000d: tail. @@ -272,8 +251,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -287,18 +265,14 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_6) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ IL_0006: stloc.0 @@ -318,28 +292,21 @@ IL_002f: newobj instance void assembly/assembly/'f7@9-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0034: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0039: stloc.2 - IL_003a: ldloc.1 - IL_003b: stloc.3 - IL_003c: ldloc.2 - IL_003d: stloc.s V_4 - IL_003f: ldloc.3 - IL_0040: stloc.s V_5 - IL_0042: ldloc.s V_4 - IL_0044: newobj instance void assembly/assembly/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) - IL_0049: stloc.s V_6 - IL_004b: ldloc.s V_5 - IL_004d: ldloc.s V_6 - IL_004f: newobj instance void assembly/assembly/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003a: ldloc.2 + IL_003b: newobj instance void assembly/assembly/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) + IL_0040: stloc.3 + IL_0041: ldloc.1 + IL_0042: ldloc.3 + IL_0043: newobj instance void assembly/assembly/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0054: tail. - IL_0056: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_005b: ret + IL_0048: tail. + IL_004a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_004f: ret } } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_es() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_es() cil managed { .maxstack 8 @@ -347,8 +314,7 @@ IL_0005: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f7() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f7() cil managed { .maxstack 4 @@ -382,8 +348,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 6 @@ -423,4 +388,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.release.bsl index 2b8dd85d274..1c4d13e1c30 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOff.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -54,8 +44,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -69,8 +58,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg1) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed { .maxstack 5 @@ -101,8 +89,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -116,8 +103,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg2) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed { .maxstack 5 @@ -148,8 +134,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -163,8 +148,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 8 @@ -189,8 +173,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -204,8 +187,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed { .maxstack 8 @@ -227,9 +209,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -246,8 +226,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -272,8 +251,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -287,8 +265,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -329,8 +306,7 @@ } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_es() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_es() cil managed { .maxstack 8 @@ -338,8 +314,7 @@ IL_0005: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f7() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f7() cil managed { .maxstack 4 @@ -373,8 +348,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 6 @@ -414,4 +388,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bs new file mode 100644 index 00000000000..5cc24c32d78 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bs @@ -0,0 +1,425 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.dll + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public assembly + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@6-1'::builder@ + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed + { + + .maxstack 5 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldstr "hello" + IL_0007: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0011: pop + IL_0012: ldstr "hello 2" + IL_0017: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: pop + IL_0022: ldarg.0 + IL_0023: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@6-1'::builder@ + IL_0028: tail. + IL_002a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Zero() + IL_002f: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@9-3' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@9-3'::builder@ + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed + { + + .maxstack 5 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldstr "goodbye" + IL_0007: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_000c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0011: pop + IL_0012: ldstr "goodbye 2" + IL_0017: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) + IL_001c: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0021: pop + IL_0022: ldarg.0 + IL_0023: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@9-3'::builder@ + IL_0028: tail. + IL_002a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Zero() + IL_002f: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@9-2' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@9-2'::builder@ + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@9-2'::builder@ + IL_0006: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly/assembly::get_es() + IL_000b: ldarg.0 + IL_000c: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/'f7@9-2'::builder@ + IL_0011: newobj instance void assembly/assembly/'f7@9-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0016: tail. + IL_0018: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_001d: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-4' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar0) cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 + IL_0006: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-5' + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 + IL_0014: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 + IL_000d: tail. + IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f7@6 + extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> + { + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_000d: ret + } + + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + { + + .maxstack 7 + .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) + IL_0000: ldarg.0 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_0006: stloc.0 + IL_0007: ldarg.0 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly/assembly::get_es() + IL_0012: ldarg.0 + IL_0013: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_0018: newobj instance void assembly/assembly/'f7@6-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_001d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0022: stloc.1 + IL_0023: ldarg.0 + IL_0024: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_0029: ldarg.0 + IL_002a: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ + IL_002f: newobj instance void assembly/assembly/'f7@9-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0034: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0039: stloc.2 + IL_003a: ldloc.2 + IL_003b: newobj instance void assembly/assembly/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) + IL_0040: stloc.3 + IL_0041: ldloc.1 + IL_0042: ldloc.3 + IL_0043: newobj instance void assembly/assembly/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0048: tail. + IL_004a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_004f: ret + } + + } + + .field static assembly class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 es@4 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_es() cil managed + { + + .maxstack 8 + IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly/assembly::es@4 + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f7() cil managed + { + + .maxstack 4 + .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldloc.0 + IL_0008: newobj instance void assembly/assembly/f7@6::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_000d: tail. + IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0014: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 6 + .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_0, + class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1) + IL_0000: ldc.i4.3 + IL_0001: ldc.i4.4 + IL_0002: ldc.i4.5 + IL_0003: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0008: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0012: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0017: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly/assembly::es@4 + IL_001c: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly::f7() + IL_0021: stloc.0 + IL_0022: ldloc.0 + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldnull + IL_0026: ldnull + IL_0027: call !!0 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync::RunSynchronously(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1) + IL_002c: pop + IL_002d: ret + } + + .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + es() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .get class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly/assembly::get_es() + } + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call void assembly/assembly::staticInitialization@() + IL_0005: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bsl index 9c7a9399b77..5cc24c32d78 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -179,11 +169,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-4' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part2 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -193,7 +183,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::part2 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 IL_000d: ret } @@ -202,7 +192,7 @@ .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::part2 + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-4'::computation2 IL_0006: ret } @@ -211,7 +201,7 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f7@6-5' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1 .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -219,9 +209,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -231,7 +219,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 IL_000d: ldarg.0 IL_000e: ldarg.2 IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 @@ -244,7 +232,7 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f7@6-5'::computation1 IL_0007: ldarg.0 IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f7@6-5'::part2 IL_000d: tail. @@ -284,10 +272,7 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_6) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f7@6::builder@ IL_0006: stloc.0 @@ -307,22 +292,16 @@ IL_002f: newobj instance void assembly/assembly/'f7@9-2'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0034: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0039: stloc.2 - IL_003a: ldloc.1 - IL_003b: stloc.3 - IL_003c: ldloc.2 - IL_003d: stloc.s V_4 - IL_003f: ldloc.3 - IL_0040: stloc.s V_5 - IL_0042: ldloc.s V_4 - IL_0044: newobj instance void assembly/assembly/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) - IL_0049: stloc.s V_6 - IL_004b: ldloc.s V_5 - IL_004d: ldloc.s V_6 - IL_004f: newobj instance void assembly/assembly/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003a: ldloc.2 + IL_003b: newobj instance void assembly/assembly/'f7@6-4'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1) + IL_0040: stloc.3 + IL_0041: ldloc.1 + IL_0042: ldloc.3 + IL_0043: newobj instance void assembly/assembly/'f7@6-5'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0054: tail. - IL_0056: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_005b: ret + IL_0048: tail. + IL_004a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_004f: ret } } @@ -444,4 +423,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.release.bsl index e192d2bc639..5cc24c32d78 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.fs.RealInternalSignatureOn.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -219,9 +209,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -435,4 +423,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.debug.bsl index e68776c8dac..791fe74ed50 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,12 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f2@10-1' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -65,18 +54,17 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f2@10-1'::res + IL_0008: stfld int32 assembly/assembly/'f2@10-1'::'value' IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f2@10-1'::res + IL_0002: ldfld int32 assembly/assembly/'f2@10-1'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -92,8 +80,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -107,8 +94,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -116,8 +102,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, int32 V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, - int32 V_4, - int32 V_5) + int32 V_4) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -150,12 +135,10 @@ IL_0041: ldloc.2 IL_0042: stloc.s V_4 IL_0044: ldloc.s V_4 - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_5 - IL_004a: newobj instance void assembly/assembly/'f2@10-1'::.ctor(int32) - IL_004f: tail. - IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0056: ret + IL_0046: newobj instance void assembly/assembly/'f2@10-1'::.ctor(int32) + IL_004b: tail. + IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0052: ret } } @@ -163,12 +146,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@20-5' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -178,18 +160,17 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f3@20-5'::res + IL_0008: stfld int32 assembly/assembly/'f3@20-5'::'value' IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f3@20-5'::res + IL_0002: ldfld int32 assembly/assembly/'f3@20-5'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -230,16 +211,14 @@ IL_001b: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg4) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg4) cil managed { .maxstack 6 .locals init (int32 V_0, int32 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, - int32 V_3, - int32 V_4) + int32 V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -257,30 +236,26 @@ IL_001e: ldloc.1 IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: stloc.s V_4 - IL_0023: ldloc.s V_4 - IL_0025: newobj instance void assembly/assembly/'f3@20-5'::.ctor(int32) - IL_002a: tail. - IL_002c: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0031: ret + IL_0021: newobj instance void assembly/assembly/'f3@20-5'::.ctor(int32) + IL_0026: tail. + IL_0028: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002d: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@18-6' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-6' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -290,23 +265,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -324,9 +298,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -343,8 +315,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg3) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg3) cil managed { .maxstack 7 @@ -352,9 +323,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_6) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldc.i4.0 @@ -382,34 +351,28 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_0037: stloc.s V_4 IL_0039: ldloc.3 - IL_003a: stloc.s V_5 - IL_003c: ldloc.s V_4 - IL_003e: stloc.s V_6 - IL_0040: ldloc.s V_5 - IL_0042: ldloc.s V_6 - IL_0044: newobj instance void assembly/assembly/'f3@18-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003a: ldloc.s V_4 + IL_003c: newobj instance void assembly/assembly/'f3@19-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0049: tail. - IL_004b: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0050: ret + IL_0041: tail. + IL_0043: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0048: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-7' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-7' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -419,23 +382,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -453,9 +415,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -472,17 +432,14 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg2) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed { .maxstack 6 .locals init (int32 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -498,34 +455,28 @@ int32) IL_0020: stloc.3 IL_0021: ldloc.2 - IL_0022: stloc.s V_4 - IL_0024: ldloc.3 - IL_0025: stloc.s V_5 - IL_0027: ldloc.s V_4 - IL_0029: ldloc.s V_5 - IL_002b: newobj instance void assembly/assembly/'f3@15-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_0022: ldloc.3 + IL_0023: newobj instance void assembly/assembly/'f3@16-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0030: tail. - IL_0032: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0037: ret + IL_0028: tail. + IL_002a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002f: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-8' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-8' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -535,23 +486,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -568,8 +518,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -583,17 +532,14 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg1) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed { .maxstack 6 .locals init (int32 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -608,34 +554,28 @@ int32) IL_001b: stloc.3 IL_001c: ldloc.2 - IL_001d: stloc.s V_4 - IL_001f: ldloc.3 - IL_0020: stloc.s V_5 - IL_0022: ldloc.s V_4 - IL_0024: ldloc.s V_5 - IL_0026: newobj instance void assembly/assembly/'f3@14-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001d: ldloc.3 + IL_001e: newobj instance void assembly/assembly/'f3@16-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_002b: tail. - IL_002d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0032: ret + IL_0023: tail. + IL_0025: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-9' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-9' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -645,23 +585,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -671,15 +610,14 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit f3@13 + .class auto ansi serializable sealed nested assembly beforefieldinit f3@16 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -689,46 +627,38 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 6 .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0006: stloc.0 IL_0007: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly::f2() IL_000c: stloc.1 IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0013: newobj instance void assembly/assembly/'f3@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0018: stloc.2 IL_0019: ldloc.1 - IL_001a: stloc.3 - IL_001b: ldloc.2 - IL_001c: stloc.s V_4 - IL_001e: ldloc.3 - IL_001f: ldloc.s V_4 - IL_0021: newobj instance void assembly/assembly/'f3@13-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001a: ldloc.2 + IL_001b: newobj instance void assembly/assembly/'f3@16-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0026: tail. - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_002d: ret + IL_0020: tail. + IL_0022: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0027: ret } } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f2() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f2() cil managed { .maxstack 4 @@ -743,8 +673,7 @@ IL_0014: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f3() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f3() cil managed { .maxstack 4 @@ -753,7 +682,7 @@ IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: newobj instance void assembly/assembly/f3@13::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0008: newobj instance void assembly/assembly/f3@16::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_000d: tail. IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0014: ret @@ -770,8 +699,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -797,4 +725,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.release.bsl index 723f29b7d82..791fe74ed50 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOff.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -54,8 +44,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 'value') cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -69,8 +58,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -92,8 +80,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -107,8 +94,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 7 @@ -164,8 +150,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(int32 'value') cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -179,8 +164,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 @@ -227,8 +211,7 @@ IL_001b: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg4) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg4) cil managed { .maxstack 6 @@ -261,7 +244,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@18-6' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-6' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -272,9 +255,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -284,23 +265,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -318,9 +298,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -337,8 +315,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg3) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg3) cil managed { .maxstack 7 @@ -375,7 +352,7 @@ IL_0037: stloc.s V_4 IL_0039: ldloc.3 IL_003a: ldloc.s V_4 - IL_003c: newobj instance void assembly/assembly/'f3@18-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003c: newobj instance void assembly/assembly/'f3@19-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0041: tail. IL_0043: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -384,7 +361,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-7' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-7' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -395,9 +372,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -407,23 +382,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -441,9 +415,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -460,8 +432,7 @@ IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg2) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg2) cil managed { .maxstack 6 @@ -485,7 +456,7 @@ IL_0020: stloc.3 IL_0021: ldloc.2 IL_0022: ldloc.3 - IL_0023: newobj instance void assembly/assembly/'f3@15-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_0023: newobj instance void assembly/assembly/'f3@16-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0028: tail. IL_002a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -494,7 +465,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-8' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-8' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -505,9 +476,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -517,23 +486,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -550,8 +518,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -565,8 +532,7 @@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(int32 _arg1) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(int32 _arg1) cil managed { .maxstack 6 @@ -589,7 +555,7 @@ IL_001b: stloc.3 IL_001c: ldloc.2 IL_001d: ldloc.3 - IL_001e: newobj instance void assembly/assembly/'f3@14-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001e: newobj instance void assembly/assembly/'f3@16-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0023: tail. IL_0025: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -598,7 +564,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-9' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-9' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -609,9 +575,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -621,23 +585,22 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_0014: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn - Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn Invoke(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1 ctxt) cil managed { .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -647,15 +610,14 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit f3@13 + .class auto ansi serializable sealed nested assembly beforefieldinit f3@16 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -665,12 +627,11 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_000d: ret } - .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed + .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed { .maxstack 6 @@ -678,17 +639,17 @@ class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0006: stloc.0 IL_0007: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly::f2() IL_000c: stloc.1 IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0013: newobj instance void assembly/assembly/'f3@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0018: stloc.2 IL_0019: ldloc.1 IL_001a: ldloc.2 - IL_001b: newobj instance void assembly/assembly/'f3@13-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001b: newobj instance void assembly/assembly/'f3@16-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0020: tail. IL_0022: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -697,8 +658,7 @@ } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f2() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f2() cil managed { .maxstack 4 @@ -713,8 +673,7 @@ IL_0014: ret } - .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 - f3() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 f3() cil managed { .maxstack 4 @@ -723,7 +682,7 @@ IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: newobj instance void assembly/assembly/f3@13::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0008: newobj instance void assembly/assembly/f3@16::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_000d: tail. IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0014: ret @@ -740,8 +699,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 5 @@ -767,4 +725,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.debug.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.debug.bsl index d731307a799..86a46dbdb18 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.debug.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.debug.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -50,11 +40,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f2@10-1' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -64,7 +54,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f2@10-1'::res + IL_0008: stfld int32 assembly/assembly/'f2@10-1'::'value' IL_000d: ret } @@ -74,7 +64,7 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f2@10-1'::res + IL_0002: ldfld int32 assembly/assembly/'f2@10-1'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -112,8 +102,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, int32 V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_3, - int32 V_4, - int32 V_5) + int32 V_4) IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -146,12 +135,10 @@ IL_0041: ldloc.2 IL_0042: stloc.s V_4 IL_0044: ldloc.s V_4 - IL_0046: stloc.s V_5 - IL_0048: ldloc.s V_5 - IL_004a: newobj instance void assembly/assembly/'f2@10-1'::.ctor(int32) - IL_004f: tail. - IL_0051: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0056: ret + IL_0046: newobj instance void assembly/assembly/'f2@10-1'::.ctor(int32) + IL_004b: tail. + IL_004d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0052: ret } } @@ -159,11 +146,11 @@ .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@20-5' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public int32 res + .field public int32 'value' .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname instance void .ctor(int32 res) cil managed + .method assembly specialname rtspecialname instance void .ctor(int32 'value') cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -173,7 +160,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld int32 assembly/assembly/'f3@20-5'::res + IL_0008: stfld int32 assembly/assembly/'f3@20-5'::'value' IL_000d: ret } @@ -183,7 +170,7 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld int32 assembly/assembly/'f3@20-5'::res + IL_0002: ldfld int32 assembly/assembly/'f3@20-5'::'value' IL_0007: tail. IL_0009: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1::Success(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, !0) @@ -231,8 +218,7 @@ .locals init (int32 V_0, int32 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, - int32 V_3, - int32 V_4) + int32 V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -250,30 +236,26 @@ IL_001e: ldloc.1 IL_001f: stloc.3 IL_0020: ldloc.3 - IL_0021: stloc.s V_4 - IL_0023: ldloc.s V_4 - IL_0025: newobj instance void assembly/assembly/'f3@20-5'::.ctor(int32) - IL_002a: tail. - IL_002c: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0031: ret + IL_0021: newobj instance void assembly/assembly/'f3@20-5'::.ctor(int32) + IL_0026: tail. + IL_0028: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002d: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@18-6' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-6' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -283,10 +265,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_0014: ret } @@ -296,9 +278,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -316,9 +298,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -343,9 +323,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_2, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_5, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_6) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldc.i4.0 @@ -373,34 +351,28 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) IL_0037: stloc.s V_4 IL_0039: ldloc.3 - IL_003a: stloc.s V_5 - IL_003c: ldloc.s V_4 - IL_003e: stloc.s V_6 - IL_0040: ldloc.s V_5 - IL_0042: ldloc.s V_6 - IL_0044: newobj instance void assembly/assembly/'f3@18-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003a: ldloc.s V_4 + IL_003c: newobj instance void assembly/assembly/'f3@19-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0049: tail. - IL_004b: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0050: ret + IL_0041: tail. + IL_0043: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0048: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-7' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-7' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -410,10 +382,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_0014: ret } @@ -423,9 +395,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -443,9 +415,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -469,9 +439,7 @@ .locals init (int32 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -487,34 +455,28 @@ int32) IL_0020: stloc.3 IL_0021: ldloc.2 - IL_0022: stloc.s V_4 - IL_0024: ldloc.3 - IL_0025: stloc.s V_5 - IL_0027: ldloc.s V_4 - IL_0029: ldloc.s V_5 - IL_002b: newobj instance void assembly/assembly/'f3@15-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_0022: ldloc.3 + IL_0023: newobj instance void assembly/assembly/'f3@16-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0030: tail. - IL_0032: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0037: ret + IL_0028: tail. + IL_002a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002f: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-8' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-8' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -524,10 +486,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_0014: ret } @@ -537,9 +499,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -577,9 +539,7 @@ .locals init (int32 V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_4, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_5) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_3) IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: ldarg.0 @@ -594,34 +554,28 @@ int32) IL_001b: stloc.3 IL_001c: ldloc.2 - IL_001d: stloc.s V_4 - IL_001f: ldloc.3 - IL_0020: stloc.s V_5 - IL_0022: ldloc.s V_4 - IL_0024: ldloc.s V_5 - IL_0026: newobj instance void assembly/assembly/'f3@14-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001d: ldloc.3 + IL_001e: newobj instance void assembly/assembly/'f3@16-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_002b: tail. - IL_002d: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_0032: ret + IL_0023: tail. + IL_0025: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_002a: ret } } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-9' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-9' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { - .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1 + .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2 + .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 part1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> part2) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -631,10 +585,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::part1 + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::part2 + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_0014: ret } @@ -644,9 +598,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::part1 + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::part2 + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -656,7 +610,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit f3@13 + .class auto ansi serializable sealed nested assembly beforefieldinit f3@16 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -673,7 +627,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_000d: ret } @@ -683,29 +637,23 @@ .maxstack 6 .locals init (class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2, - class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_3, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_4) + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0006: stloc.0 IL_0007: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly::f2() IL_000c: stloc.1 IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0013: newobj instance void assembly/assembly/'f3@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0018: stloc.2 IL_0019: ldloc.1 - IL_001a: stloc.3 - IL_001b: ldloc.2 - IL_001c: stloc.s V_4 - IL_001e: ldloc.3 - IL_001f: ldloc.s V_4 - IL_0021: newobj instance void assembly/assembly/'f3@13-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001a: ldloc.2 + IL_001b: newobj instance void assembly/assembly/'f3@16-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0026: tail. - IL_0028: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) - IL_002d: ret + IL_0020: tail. + IL_0022: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) + IL_0027: ret } } @@ -734,7 +682,7 @@ IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: newobj instance void assembly/assembly/f3@13::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0008: newobj instance void assembly/assembly/f3@16::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_000d: tail. IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0014: ret @@ -815,4 +763,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.release.bsl index 6dd4c2cb2fc..86a46dbdb18 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.fs.RealInternalSignatureOn.il.release.bsl @@ -16,16 +16,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.dll @@ -254,7 +244,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@18-6' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@19-6' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -265,9 +255,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -277,10 +265,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_0014: ret } @@ -290,9 +278,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@18-6'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@19-6'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@18-6'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@19-6'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -310,9 +298,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -366,7 +352,7 @@ IL_0037: stloc.s V_4 IL_0039: ldloc.3 IL_003a: ldloc.s V_4 - IL_003c: newobj instance void assembly/assembly/'f3@18-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_003c: newobj instance void assembly/assembly/'f3@19-6'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0041: tail. IL_0043: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -375,7 +361,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@15-7' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-7' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -386,9 +372,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -398,10 +382,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_0014: ret } @@ -411,9 +395,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@15-7'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-7'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@15-7'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-7'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -431,9 +415,7 @@ .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, - int32 x1) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, int32 x1) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -474,7 +456,7 @@ IL_0020: stloc.3 IL_0021: ldloc.2 IL_0022: ldloc.3 - IL_0023: newobj instance void assembly/assembly/'f3@15-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_0023: newobj instance void assembly/assembly/'f3@16-7'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0028: tail. IL_002a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -483,7 +465,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@14-8' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-8' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -494,9 +476,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -506,10 +486,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_0014: ret } @@ -519,9 +499,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@14-8'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-8'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@14-8'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-8'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -575,7 +555,7 @@ IL_001b: stloc.3 IL_001c: ldloc.2 IL_001d: ldloc.3 - IL_001e: newobj instance void assembly/assembly/'f3@14-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001e: newobj instance void assembly/assembly/'f3@16-8'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0023: tail. IL_0025: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -584,7 +564,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@13-9' + .class auto ansi serializable sealed nested assembly beforefieldinit 'f3@16-9' extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation @@ -595,9 +575,7 @@ .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) - .method assembly specialname rtspecialname - instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, - class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed + .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 computation, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> binder) cil managed { .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -607,10 +585,10 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::computation + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_000d: ldarg.0 IL_000e: ldarg.2 - IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::binder + IL_000f: stfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_0014: ret } @@ -620,9 +598,9 @@ .maxstack 8 IL_0000: ldarg.1 IL_0001: ldarg.0 - IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@13-9'::computation + IL_0002: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly/'f3@16-9'::computation IL_0007: ldarg.0 - IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@13-9'::binder + IL_0008: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> assembly/assembly/'f3@16-9'::binder IL_000d: tail. IL_000f: call class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::Bind(valuetype [FSharp.Core]Microsoft.FSharp.Control.AsyncActivation`1, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, @@ -632,7 +610,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit f3@13 + .class auto ansi serializable sealed nested assembly beforefieldinit f3@16 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ @@ -649,7 +627,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0008: stfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_000d: ret } @@ -661,17 +639,17 @@ class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 V_1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> V_2) IL_0000: ldarg.0 - IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0006: stloc.0 IL_0007: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 assembly/assembly::f2() IL_000c: stloc.1 IL_000d: ldarg.0 - IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@13::builder@ + IL_000e: ldfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder assembly/assembly/f3@16::builder@ IL_0013: newobj instance void assembly/assembly/'f3@14-1'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_0018: stloc.2 IL_0019: ldloc.1 IL_001a: ldloc.2 - IL_001b: newobj instance void assembly/assembly/'f3@13-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, + IL_001b: newobj instance void assembly/assembly/'f3@16-9'::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0020: tail. IL_0022: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.AsyncPrimitives::MakeAsync(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Control.AsyncReturn>) @@ -704,7 +682,7 @@ IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldloc.0 - IL_0008: newobj instance void assembly/assembly/f3@13::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) + IL_0008: newobj instance void assembly/assembly/f3@16::.ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder) IL_000d: tail. IL_000f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0014: ret @@ -785,4 +763,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOff.il.bsl index f27f8256dfa..4d3fc2353e4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOff.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOff.il.bsl @@ -20,16 +20,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -223,7 +213,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit res3@15 + .class auto ansi serializable sealed nested assembly beforefieldinit res3@21 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ @@ -240,7 +230,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_0008: stfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_000d: ret } @@ -249,10 +239,10 @@ .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_0001: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_0006: call class [ComputationExprLibrary]Library.Eventually`1 Program::get_res2() IL_000b: ldarg.0 - IL_000c: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_000c: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_0011: newobj instance void Program/'res3@16-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) IL_0016: tail. IL_0018: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Bind(class [ComputationExprLibrary]Library.Eventually`1, @@ -332,7 +322,7 @@ IL_002b: stloc.s V_4 IL_002d: ldloc.s V_4 IL_002f: ldloc.s V_4 - IL_0031: newobj instance void Program/res3@15::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) + IL_0031: newobj instance void Program/res3@21::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) IL_0036: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_003b: dup IL_003c: stsfld class [ComputationExprLibrary]Library.Eventually`1 ''.$Program::res3@13 @@ -351,4 +341,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOn.il.bsl index 72f38d7e7cf..d0da112737c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr03.fs.RealInternalSignatureOn.il.bsl @@ -20,16 +20,6 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 -} -.mresource public FSharpSignatureCompressedData.assembly -{ - - -} -.mresource public FSharpOptimizationCompressedData.assembly -{ - - } .module assembly.exe @@ -223,7 +213,7 @@ } - .class auto ansi serializable sealed nested assembly beforefieldinit res3@15 + .class auto ansi serializable sealed nested assembly beforefieldinit res3@21 extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ @@ -240,7 +230,7 @@ IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>::.ctor() IL_0006: ldarg.0 IL_0007: ldarg.1 - IL_0008: stfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_0008: stfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_000d: ret } @@ -249,10 +239,10 @@ .maxstack 8 IL_0000: ldarg.0 - IL_0001: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_0001: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_0006: call class [ComputationExprLibrary]Library.Eventually`1 Program::get_res2() IL_000b: ldarg.0 - IL_000c: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@15::builder@ + IL_000c: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res3@21::builder@ IL_0011: newobj instance void Program/'res3@16-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) IL_0016: tail. IL_0018: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Bind(class [ComputationExprLibrary]Library.Eventually`1, @@ -317,7 +307,7 @@ IL_0029: stloc.2 IL_002a: ldloc.2 IL_002b: ldloc.2 - IL_002c: newobj instance void Program/res3@15::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) + IL_002c: newobj instance void Program/res3@21::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder) IL_0031: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) IL_0036: stsfld class [ComputationExprLibrary]Library.Eventually`1 Program::res3@13 IL_003b: call class [ComputationExprLibrary]Library.Eventually`1 Program::get_res3() @@ -364,4 +354,3 @@ - diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 55d49dbebc7..6b0a260a42f 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -1257,4 +1257,132 @@ let x18mutable = (Error 3147, Line 5, Col 17, Line 5, Col 20, "This 'let' definition may not be used in a query. Only simple value definitions may be used in queries.") (Error 3147, Line 13, Col 20, Line 13, Col 23, "This 'let' definition may not be used in a query. Only simple value definitions may be used in queries.") (Error 3147, Line 20, Col 21, Line 20, Col 22, "This 'let' definition may not be used in a query. Only simple value definitions may be used in queries.") + ] + + [] + let ``Fix resumable and non-resumable CE error ranges`` () = + FSharp """ +module Test + +open System.Threading.Tasks +let minimum () : Async = + async { + let! batch = async { return 1 } + return "1" + } + +let minimum2 () : Task = + task { + let! batch = task { return 1 } + return "1" + } + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 8, Col 16, Line 8, Col 19, "This expression was expected to have type +'int' +but here has type +'string' "); + (Error 193, Line 14, Col 16, Line 14, Col 19, "Type constraint mismatch. The type +'TaskCode' +is not compatible with type +'TaskCode' +") + ] + + [] + let ``Fix resumable and non-resumable CE error ranges 2`` () = + FSharp """ +module Test + +open System.Threading.Tasks +let minimum () : Async = + async { + let batch: Async = async { return "" } + return "1" + } + +let minimum2 () : Task = + task { + let batch: Task = task { return "" } + return "1" + } + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 7, Col 48, Line 7, Col 50, "This expression was expected to have type +'int' +but here has type +'string' "); + (Error 1, Line 8, Col 16, Line 8, Col 19, "This expression was expected to have type +'int' +but here has type +'string' "); + (Error 1, Line 13, Col 46, Line 13, Col 48, "This expression was expected to have type +'int' +but here has type +'string' "); + (Error 1, Line 14, Col 16, Line 14, Col 19, "This expression was expected to have type +'int' +but here has type +'string' ") + ] + + [] + let ``Fix resumable and non-resumable CE error ranges 3`` () = + FSharp """ +module Test + +open System.Threading.Tasks +open System.Collections.Generic +open System.Linq + +let f () : Task> = task { + let! x = task { return 42 } + + let! y = task { return 43 } + + return Seq.empty.ToList() +} + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 193, Line 13, Col 12, Line 13, Col 30, "Type constraint mismatch. The type +'TaskCode,List<'a>>' +is not compatible with type +'TaskCode,IList>' +") + ] + + [] + let ``Fix resumable and non-resumable CE error ranges 4`` () = + FSharp """ +module Test + +open System.Threading.Tasks + +let foo () : int64 = 6 +let otherAsync () = async { return "lol"} +let fooAsync () : Async = async { + let! _ = otherAsync () + return 6 +} + +let otherTask() = task { return "lol"} +let fooTask () : Task = task { + let! _ = otherTask() + return 6 + } + """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 193, Line 16, Col 16, Line 16, Col 17, "Type constraint mismatch. The type +'TaskCode' +is not compatible with type +'TaskCode' +") ] \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/CallerInfoAndComputationExpression.fs b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/CallerInfoAndComputationExpression.fs index 8c28f251fc8..71ee94aa966 100644 --- a/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/CallerInfoAndComputationExpression.fs +++ b/tests/fsharpqa/Source/Conformance/SpecialAttributesAndTypes/Imported/CallerInfo/CallerInfoAndComputationExpression.fs @@ -21,7 +21,7 @@ module Program = return x + y } - if result <> (((3, Some 21), Some 20), Some 19) then + if result <> (((3, Some 21), Some 21), Some 21) then failwith "Unexpected F# CallerLineNumber" 0 \ No newline at end of file From 85ea990d66dcab65751cba5ff9a4381641c986a3 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 16 Apr 2025 15:09:16 +0100 Subject: [PATCH 064/134] Consolidated two `SynExpr.LetOrUseBang` patterns with `isUse = true` (#18472) --- .../CheckComputationExpressions.fs | 407 ++++-------------- 1 file changed, 81 insertions(+), 326 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 45a35970af7..a7bcc1f9f87 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -849,6 +849,20 @@ let (|OptionalSequential|) e = | SynExpr.Sequential(debugPoint = _sp; isTrueSeq = true; expr1 = dataComp1; expr2 = dataComp2) -> (dataComp1, Some dataComp2) | _ -> (e, None) +[] +let (|ExprAsUseBang|_|) expr = + match expr with + | SynExpr.LetOrUseBang( + bindDebugPoint = spBind + isUse = true + isFromSource = isFromSource + pat = pat + rhs = rhsExpr + andBangs = andBangs + body = innerComp + trivia = { LetOrUseBangKeyword = mBind }) -> ValueSome(spBind, isFromSource, pat, rhsExpr, andBangs, innerComp, mBind) + | _ -> ValueNone + // "cexpr; cexpr" is treated as builder.Combine(cexpr1, cexpr1) // This is not pretty - we have to decide which range markers we use for the calls to Combine and Delay // NOTE: we should probably suppress these sequence points altogether @@ -910,6 +924,11 @@ let inline addVarsToVarSpace (varSpace: LazyWithContext id ) +/// Checks if a builder method exists and reports an error if it doesn't +let requireBuilderMethod methodName m1 cenv env ad builderTy m2 = + if isNil (TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AtMostOneResult cenv env m1 ad methodName builderTy) then + error (Error(FSComp.SR.tcRequireBuilderMethod methodName, m2)) + /// /// Try translate the syntax sugar /// @@ -1211,19 +1230,7 @@ let rec TryTranslateComputationExpression let mPat = pat.Range - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mFor - ceenv.ad - "For" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("For"), mFor)) + requireBuilderMethod "For" mFor cenv ceenv.env ceenv.ad ceenv.builderTy mFor // Add the variables to the query variable space, on demand let varSpace = @@ -1296,33 +1303,8 @@ let rec TryTranslateComputationExpression if ceenv.isQuery then error (Error(FSComp.SR.tcNoWhileInQuery (), mWhile)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mWhile - ceenv.ad - "While" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("While"), mWhile)) - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mWhile - ceenv.ad - "Delay" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Delay"), mWhile)) + requireBuilderMethod "While" mWhile cenv ceenv.env ceenv.ad ceenv.builderTy mWhile + requireBuilderMethod "Delay" mWhile cenv ceenv.env ceenv.ad ceenv.builderTy mWhile // 'while' is hit just before each time the guard is called let guardExpr = @@ -1451,33 +1433,8 @@ let rec TryTranslateComputationExpression if ceenv.isQuery then error (Error(FSComp.SR.tcNoTryFinallyInQuery (), mTry)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mTry - ceenv.ad - "TryFinally" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("TryFinally"), mTry)) - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mTry - ceenv.ad - "Delay" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Delay"), mTry)) + requireBuilderMethod "TryFinally" mTry cenv ceenv.env ceenv.ad ceenv.builderTy mTry + requireBuilderMethod "Delay" mTry cenv ceenv.env ceenv.ad ceenv.builderTy mTry let innerExpr = TranslateComputationExpressionNoQueryOps ceenv innerComp @@ -1618,34 +1575,8 @@ let rec TryTranslateComputationExpression | SynExpr.YieldOrReturnFrom(trivia = yieldOrReturnFrom) -> yieldOrReturnFrom.YieldOrReturnFromKeyword | expr -> expr.Range - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - m - ceenv.ad - "Combine" - ceenv.builderTy - ) - then - - error (Error(FSComp.SR.tcRequireBuilderMethod "Combine", combineDelayRange)) - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - m - ceenv.ad - "Delay" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod "Delay", combineDelayRange)) + requireBuilderMethod "Combine" m cenv ceenv.env ceenv.ad ceenv.builderTy combineDelayRange + requireBuilderMethod "Delay" m cenv ceenv.env ceenv.ad ceenv.builderTy combineDelayRange let combineCall = mkSynCall @@ -1748,19 +1679,7 @@ let rec TryTranslateComputationExpression ) | None -> let elseComp = - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - trivia.IfToThenRange - ceenv.ad - "Zero" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Zero"), trivia.IfToThenRange)) + requireBuilderMethod "Zero" trivia.IfToThenRange cenv ceenv.env ceenv.ad ceenv.builderTy trivia.IfToThenRange mkSynCall "Zero" trivia.IfToThenRange [] ceenv.builderValName @@ -1838,19 +1757,7 @@ let rec TryTranslateComputationExpression innerCompRange ) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - "Using" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Using"), mBind)) + requireBuilderMethod "Using" mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind Some( translatedCtxt (mkSynCall "Using" mBind [ rhsExpr; consumeExpr ] ceenv.builderValName) @@ -1903,102 +1810,59 @@ let rec TryTranslateComputationExpression ) // 'use! pat = e1 in e2' --> build.Bind(e1, (function _argN -> match _argN with pat -> build.Using(x, (fun _argN -> match _argN with pat -> e2)))) - | SynExpr.LetOrUseBang( - bindDebugPoint = spBind - isUse = true - isFromSource = isFromSource - pat = SynPat.Named(ident = SynIdent(id, _); isThisVal = false) as pat - rhs = rhsExpr - andBangs = [] - body = innerComp - trivia = { LetOrUseBangKeyword = mBind }) - | SynExpr.LetOrUseBang( - bindDebugPoint = spBind - isUse = true - isFromSource = isFromSource - pat = SynPat.LongIdent(longDotId = SynLongIdent(id = [ id ])) as pat - rhs = rhsExpr - andBangs = [] - body = innerComp - trivia = { LetOrUseBangKeyword = mBind }) -> - + | ExprAsUseBang(spBind, isFromSource, pat, rhsExpr, andBangs, innerComp, mBind) -> if ceenv.isQuery then error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - "Using" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Using"), mBind)) - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - "Bind" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Bind"), mBind)) + match pat, andBangs with + | (SynPat.Named(ident = SynIdent(id, _); isThisVal = false) | SynPat.LongIdent(longDotId = SynLongIdent(id = [ id ]))), [] -> + // Valid pattern case - handle with Using + Bind + requireBuilderMethod "Using" mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind + requireBuilderMethod "Bind" mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind - let bindExpr = - let consumeExpr = - SynExpr.MatchLambda( - false, - mBind, - [ - SynMatchClause( - pat, - None, - TranslateComputationExpressionNoQueryOps ceenv innerComp, - innerComp.Range, - DebugPointAtTarget.Yes, - SynMatchClauseTrivia.Zero - ) - ], - DebugPointAtBinding.NoneAtInvisible, - mBind - ) - - let consumeExpr = - mkSynCall "Using" mBind [ SynExpr.Ident id; consumeExpr ] ceenv.builderValName + let bindExpr = + let consumeExpr = + SynExpr.MatchLambda( + false, + mBind, + [ + SynMatchClause( + pat, + None, + TranslateComputationExpressionNoQueryOps ceenv innerComp, + innerComp.Range, + DebugPointAtTarget.Yes, + SynMatchClauseTrivia.Zero + ) + ], + DebugPointAtBinding.NoneAtInvisible, + mBind + ) - let consumeExpr = - SynExpr.MatchLambda( - false, - mBind, - [ - SynMatchClause(pat, None, consumeExpr, id.idRange, DebugPointAtTarget.No, SynMatchClauseTrivia.Zero) - ], - DebugPointAtBinding.NoneAtInvisible, - mBind - ) + let consumeExpr = + mkSynCall "Using" mBind [ SynExpr.Ident id; consumeExpr ] ceenv.builderValName - let rhsExpr = - mkSourceExprConditional isFromSource rhsExpr ceenv.sourceMethInfo ceenv.builderValName + let consumeExpr = + SynExpr.MatchLambda( + false, + mBind, + [ + SynMatchClause(pat, None, consumeExpr, id.idRange, DebugPointAtTarget.No, SynMatchClauseTrivia.Zero) + ], + DebugPointAtBinding.NoneAtInvisible, + mBind + ) - mkSynCall "Bind" mBind [ rhsExpr; consumeExpr ] ceenv.builderValName - |> addBindDebugPoint spBind + let rhsExpr = + mkSourceExprConditional isFromSource rhsExpr ceenv.sourceMethInfo ceenv.builderValName - Some(translatedCtxt bindExpr) + mkSynCall "Bind" mBind [ rhsExpr; consumeExpr ] ceenv.builderValName + |> addBindDebugPoint spBind - // 'use! pat = e1 ... in e2' where 'pat' is not a simple name -> error - | SynExpr.LetOrUseBang(isUse = true; andBangs = andBangs; trivia = { LetOrUseBangKeyword = mBind }) -> - if isNil andBangs then - error (Error(FSComp.SR.tcInvalidUseBangBinding (), mBind)) - else + Some(translatedCtxt bindExpr) + | _pat, [] -> error (Error(FSComp.SR.tcInvalidUseBangBinding (), mBind)) + | _pat, _ands -> + // Has andBangs let m = match andBangs with | [] -> comp.Range @@ -2182,19 +2046,7 @@ let rec TryTranslateComputationExpression // Call MergeSources2(e1, e2), MergeSources3(e1, e2, e3) etc let mergeSourcesName = mkMergeSourcesName numSourcesAndPats - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - mergeSourcesName - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN (bindNName), mBind)) + requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind let source = mkSynCall mergeSourcesName sourcesRange (List.map fst sourcesAndPats) ceenv.builderValName @@ -2210,19 +2062,7 @@ let rec TryTranslateComputationExpression let mergeSourcesName = mkMergeSourcesName maxMergeSources - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - mergeSourcesName - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN (bindNName), mBind)) + requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind let laterSource, laterPat = mergeSources laterSourcesAndPats @@ -2285,19 +2125,7 @@ let rec TryTranslateComputationExpression if ceenv.isQuery then error (Error(FSComp.SR.tcMatchMayNotBeUsedWithQuery (), trivia.MatchBangKeyword)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - trivia.MatchBangKeyword - ceenv.ad - "Bind" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Bind"), trivia.MatchBangKeyword)) + requireBuilderMethod "Bind" trivia.MatchBangKeyword cenv ceenv.env ceenv.ad ceenv.builderTy trivia.MatchBangKeyword let clauses = clauses @@ -2335,33 +2163,8 @@ let rec TryTranslateComputationExpression let consumeExpr = SynExpr.MatchLambda(true, mTryToLast, clauses, spWith2, mTryToLast) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mTry - ceenv.ad - "TryWith" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("TryWith"), mTry)) - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mTry - ceenv.ad - "Delay" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("Delay"), mTry)) + requireBuilderMethod "TryWith" mTry cenv ceenv.env ceenv.ad ceenv.builderTy mTry + requireBuilderMethod "Delay" mTry cenv ceenv.env ceenv.ad ceenv.builderTy mTry let innerExpr = TranslateComputationExpressionNoQueryOps ceenv innerComp @@ -2386,19 +2189,7 @@ let rec TryTranslateComputationExpression let yieldFromExpr = mkSourceExpr synYieldExpr ceenv.sourceMethInfo ceenv.builderValName - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - m - ceenv.ad - "YieldFrom" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("YieldFrom"), m)) + requireBuilderMethod "YieldFrom" m cenv ceenv.env ceenv.ad ceenv.builderTy m let yieldFromCall = mkSynCall "YieldFrom" synYieldExpr.Range [ yieldFromExpr ] ceenv.builderValName @@ -2418,19 +2209,7 @@ let rec TryTranslateComputationExpression if ceenv.isQuery then error (Error(FSComp.SR.tcReturnMayNotBeUsedInQueries (), m)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - m - ceenv.ad - "ReturnFrom" - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod ("ReturnFrom"), m)) + requireBuilderMethod "ReturnFrom" m cenv ceenv.env ceenv.ad ceenv.builderTy m let returnFromCall = mkSynCall "ReturnFrom" synReturnExpr.Range [ returnFromExpr ] ceenv.builderValName @@ -2449,19 +2228,7 @@ let rec TryTranslateComputationExpression if ceenv.isQuery && not isYield then error (Error(FSComp.SR.tcReturnMayNotBeUsedInQueries (), m)) - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - m - ceenv.ad - methName - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod methName, m)) + requireBuilderMethod methName m cenv ceenv.env ceenv.ad ceenv.builderTy m let yieldOrReturnCall = mkSynCall methName synYieldOrReturnExpr.Range [ synYieldOrReturnExpr ] ceenv.builderValName @@ -2731,19 +2498,7 @@ and TranslateComputationExpressionBind | _ -> - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - ceenv.cenv - ceenv.env - bindRange - ceenv.ad - bindName - ceenv.builderTy - ) - then - error (Error(FSComp.SR.tcRequireBuilderMethod (bindName), bindRange)) + requireBuilderMethod bindName bindRange ceenv.cenv ceenv.env ceenv.ad ceenv.builderTy bindRange // Build the `Bind` call TranslateComputationExpression ceenv CompExprTranslationPass.Initial q varSpace innerComp (fun holeFill -> From 69be2cd095394e3791dd26c5dcb45bd35d098535 Mon Sep 17 00:00:00 2001 From: Vladimir Shchur Date: Thu, 17 Apr 2025 03:18:46 -0700 Subject: [PATCH 065/134] `and!` support in TaskBulder (#18451) --- docs/release-notes/.FSharp.Core/9.0.300.md | 1 + src/FSharp.Core/fslib-extra-pervasives.fs | 1 + src/FSharp.Core/tasks.fs | 280 ++++++++++++++++++ src/FSharp.Core/tasks.fsi | 172 +++++++++++ ...p.Core.SurfaceArea.netstandard20.debug.bsl | 28 ++ ...Core.SurfaceArea.netstandard20.release.bsl | 28 ++ ...p.Core.SurfaceArea.netstandard21.debug.bsl | 28 ++ ...Core.SurfaceArea.netstandard21.release.bsl | 28 ++ .../Microsoft.FSharp.Control/Tasks.fs | 200 +++++++++++++ ...erify_FSharp.Core_Debug_netstandard2.0.bsl | 20 ++ ...erify_FSharp.Core_Debug_netstandard2.1.bsl | 20 ++ ...ify_FSharp.Core_Release_netstandard2.0.bsl | 20 ++ ...ify_FSharp.Core_Release_netstandard2.1.bsl | 20 ++ 13 files changed, 846 insertions(+) diff --git a/docs/release-notes/.FSharp.Core/9.0.300.md b/docs/release-notes/.FSharp.Core/9.0.300.md index 3b2fdab5cfe..d730ff12486 100644 --- a/docs/release-notes/.FSharp.Core/9.0.300.md +++ b/docs/release-notes/.FSharp.Core/9.0.300.md @@ -3,6 +3,7 @@ ### Added * Added nullability annotations to `.Using` builder method for `async` and `task` builders ([PR #18292](https://github.com/dotnet/fsharp/pull/18292)) +* Support for `and!` in `TaskBuilder` ([LanguageSuggestion #1363](https://github.com/fsharp/fslang-suggestions/issues/1363), [PR #18451](https://github.com/dotnet/fsharp/pull/18451)) ### Changed diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index 07a03675937..08d4ee2308b 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -325,6 +325,7 @@ module ExtraTopLevelOperators = [] [] [] + [] [] [] [] diff --git a/src/FSharp.Core/tasks.fs b/src/FSharp.Core/tasks.fs index 687bae5af85..a4ba6b2dbd7 100644 --- a/src/FSharp.Core/tasks.fs +++ b/src/FSharp.Core/tasks.fs @@ -370,7 +370,48 @@ module LowPriority = = ResumableCode.Using(resource, body) + type TaskBuilder with + member inline this.MergeSources< ^TaskLike1, ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter1, ^Awaiter2 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2)> + (task1: ^TaskLike1, task2: ^TaskLike2) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + type BackgroundTaskBuilder with + member inline this.MergeSources< ^TaskLike1, ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter1, ^Awaiter2 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2)> + (task1: ^TaskLike1, task2: ^TaskLike2) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + module HighPriority = + // High priority extensions type TaskBuilderBase with @@ -424,7 +465,36 @@ module HighPriority = member inline this.ReturnFrom(task: Task<'T>) : TaskCode<'T, 'T> = this.Bind(task, this.Return) + type TaskBuilder with + + // This overload is required for type inference in tasks cases + member inline this.MergeSources + (task1: Task< ^TResult1 >, task2: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + type BackgroundTaskBuilder with + + // This overload is required for type inference in tasks cases + member inline this.MergeSources + (task1: Task< ^TResult1 >, task2: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + module MediumPriority = + open LowPriority open HighPriority // Medium priority extensions @@ -437,3 +507,213 @@ module MediumPriority = member inline this.ReturnFrom(computation: Async<'T>) : TaskCode<'T, 'T> = this.ReturnFrom(Async.StartImmediateAsTask computation) + + type TaskBuilder with + + // This overload is required for type inference in tasks cases + member inline this.MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2 + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> 'TResult2)> + (task1: Task< ^TResult1 >, task2: ^TaskLike2) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in tasks cases + member inline this.MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> 'TResult1)> + (task1: ^TaskLike1, task2: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async cases + member inline this.MergeSources + (computation1: Async< ^TResult1 >, computation2: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + computation1, + fun (result1: ^TResult1) -> + this.Bind(computation2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in task + async cases + member inline this.MergeSources + (task: Task< ^TResult1 >, computation: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task, + fun (result1: ^TResult1) -> + this.Bind(computation, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async + task case + member inline this.MergeSources + (computation: Async< ^TResult1 >, task: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + computation, + fun (result1: ^TResult1) -> + this.Bind(task, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + type BackgroundTaskBuilder with + + // This overload is required for type inference in tasks cases + member inline this.MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2 + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> 'TResult2)> + (task1: Task< ^TResult1 >, task2: ^TaskLike2) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in tasks cases + member inline this.MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> 'TResult1)> + (task1: ^TaskLike1, task2: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task1, + fun (result1: ^TResult1) -> + this.Bind(task2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async cases + member inline this.MergeSources + (computation1: Async< ^TResult1 >, computation2: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + computation1, + fun (result1: ^TResult1) -> + this.Bind(computation2, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in task + async cases + member inline this.MergeSources + (task: Task< ^TResult1 >, computation: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task, + fun (result1: ^TResult1) -> + this.Bind(computation, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async + task case + member inline this.MergeSources + (computation: Async< ^TResult1 >, task: Task< ^TResult2 >) + : Task = + this.Run( + this.Bind( + computation, + fun (result1: ^TResult1) -> + this.Bind(task, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + +module LowPlusPriority = + open LowPriority + open MediumPriority + + type TaskBuilder with + // This overload is required for type inference in async cases + member inline this.MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2 + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> 'TResult2)> + (computation: Async< ^TResult1 >, task: ^TaskLike2) + : Task = + this.Run( + this.Bind( + computation, + fun (result1: ^TResult1) -> + this.Bind(task, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async cases + member inline this.MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> 'TResult1)> + (task: ^TaskLike1, computation: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task, + fun (result1: ^TResult1) -> + this.Bind(computation, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + type BackgroundTaskBuilder with + // This overload is required for type inference in async cases + member inline this.MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2 + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> 'TResult2)> + (computation: Async< ^TResult1 >, task: ^TaskLike2) + : Task = + this.Run( + this.Bind( + computation, + fun (result1: ^TResult1) -> + this.Bind(task, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) + + // This overload is required for type inference in async cases + member inline this.MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1 + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> 'TResult1)> + (task: ^TaskLike1, computation: Async< ^TResult2 >) + : Task = + this.Run( + this.Bind( + task, + fun (result1: ^TResult1) -> + this.Bind(computation, fun (result2: ^TResult2) -> this.Return struct (result1, result2)) + ) + ) diff --git a/src/FSharp.Core/tasks.fsi b/src/FSharp.Core/tasks.fsi index e6c801351a1..2db377cb2a1 100644 --- a/src/FSharp.Core/tasks.fsi +++ b/src/FSharp.Core/tasks.fsi @@ -239,6 +239,84 @@ module LowPriority = resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T> when 'Resource :> IDisposable | null + type TaskBuilder with + + /// + /// Implementation of the `and!` operation for two task-like values. + /// + member inline MergeSources< ^TaskLike1, ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter1, ^Awaiter2> : + task1: ^TaskLike1 * task2: ^TaskLike2 -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + + type BackgroundTaskBuilder with + + /// + /// Implementation of the `and!` operation for two task-like values. + /// + member inline MergeSources< ^TaskLike1, ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter1, ^Awaiter2> : + task1: ^TaskLike1 * task2: ^TaskLike2 -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + +module LowPlusPriority = + + type TaskBuilder with + + /// + /// Implementation of the `and!` operation for an async and a task-like value. + /// + member inline MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2> : + computation: Async< ^TResult1 > * task: ^TaskLike2 -> Task + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + + /// + /// Implementation of the `and!` operation for a task-like value and an async. + /// + member inline MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1> : + task: ^TaskLike1 * computation: Async< ^TResult2 > -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + + type BackgroundTaskBuilder with + + /// + /// Implementation of the `and!` operation for an async and a task-like value. + /// + member inline MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2> : + computation: Async< ^TResult1 > * task: ^TaskLike2 -> Task + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + + /// + /// Implementation of the `and!` operation for a task-like value and an async. + /// + member inline MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1> : + task: ^TaskLike1 * computation: Async< ^TResult2 > -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + /// /// Contains medium-priority overloads for the `task` computation expression builder. /// @@ -258,6 +336,86 @@ module MediumPriority = /// member inline ReturnFrom: computation: Async<'T> -> TaskCode<'T, 'T> + type TaskBuilder with + + /// + /// Implementation of the `and!` operation for a a task and a task-like value. + /// + member inline MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2> : + task1: Task< ^TResult1 > * task2: ^TaskLike2 -> Task + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + + /// + /// Implementation of the `and!` operation for a task-like value and a task. + /// + member inline MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1> : + task1: ^TaskLike1 * task2: Task< ^TResult2 > -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + + /// + /// Implementation of the `and!` operation for two asyncs. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + computation1: Async< ^TResult1 > * computation2: Async< ^TResult2 > -> Task + + /// + /// Implementation of the `and!` operation for a task and an async. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + task: Task< ^TResult1 > * computation: Async< ^TResult2 > -> Task + + /// + /// Implementation of the `and!` operation for an async and a task. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + computation: Async< ^TResult1 > * task: Task< ^TResult2 > -> Task + + type BackgroundTaskBuilder with + + /// + /// Implementation of the `and!` operation for a a task and a task-like value. + /// + member inline MergeSources< ^TaskLike2, ^TResult1, ^TResult2, ^Awaiter2> : + task1: Task< ^TResult1 > * task2: ^TaskLike2 -> Task + when ^TaskLike2: (member GetAwaiter: unit -> ^Awaiter2) + and ^Awaiter2 :> ICriticalNotifyCompletion + and ^Awaiter2: (member get_IsCompleted: unit -> bool) + and ^Awaiter2: (member GetResult: unit -> ^TResult2) + + /// + /// Implementation of the `and!` operation for a task-like value and a task. + /// + member inline MergeSources< ^TaskLike1, ^TResult1, ^TResult2, ^Awaiter1> : + task1: ^TaskLike1 * task2: Task< ^TResult2 > -> Task + when ^TaskLike1: (member GetAwaiter: unit -> ^Awaiter1) + and ^Awaiter1 :> ICriticalNotifyCompletion + and ^Awaiter1: (member get_IsCompleted: unit -> bool) + and ^Awaiter1: (member GetResult: unit -> ^TResult1) + + /// + /// Implementation of the `and!` operation for two asyncs. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + computation1: Async< ^TResult1 > * computation2: Async< ^TResult2 > -> Task + + /// + /// Implementation of the `and!` operation for a task and an async. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + task: Task< ^TResult1 > * computation: Async< ^TResult2 > -> Task + + /// + /// Implementation of the `and!` operation for an async and a task. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + computation: Async< ^TResult1 > * task: Task< ^TResult2 > -> Task + /// /// Contains high-priority overloads for the `task` computation expression builder. /// @@ -285,3 +443,17 @@ module HighPriority = task: Task<'TResult1> * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) -> bool + + type TaskBuilder with + /// + /// Implementation of the `and!` operation for two tasks. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + task1: Task< ^TResult1 > * task2: Task< ^TResult2 > -> Task + + type BackgroundTaskBuilder with + /// + /// Implementation of the `and!` operation for two tasks. + /// + member inline MergeSources< ^TResult1, ^TResult2> : + task1: Task< ^TResult1 > * task2: Task< ^TResult2 > -> Task diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl index 8b927e77440..5bd39b09a39 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl @@ -754,6 +754,16 @@ Microsoft.FSharp.Control.TaskBuilderBase: Microsoft.FSharp.Core.CompilerServices Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Boolean TaskBuilderBase.BindDynamic.Static[TOverall,TResult1,TResult2](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) @@ -761,8 +771,26 @@ Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Cor Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T] TaskBuilderBase.Using[TResource,TOverall,T](Microsoft.FSharp.Control.TaskBuilderBase, TResource, Microsoft.FSharp.Core.FSharpFunc`2[TResource,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom$W[TTaskLike,TAwaiter,T](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,T], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[TTaskLike,TAwaiter,T](Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder backgroundTask Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder get_backgroundTask() Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.TaskBuilder get_task() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl index cac2ceae8ed..8096acb15a1 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl @@ -754,6 +754,16 @@ Microsoft.FSharp.Control.TaskBuilderBase: Microsoft.FSharp.Core.CompilerServices Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Boolean TaskBuilderBase.BindDynamic.Static[TOverall,TResult1,TResult2](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) @@ -761,8 +771,26 @@ Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Cor Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T] TaskBuilderBase.Using[TResource,TOverall,T](Microsoft.FSharp.Control.TaskBuilderBase, TResource, Microsoft.FSharp.Core.FSharpFunc`2[TResource,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom$W[TTaskLike,TAwaiter,T](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,T], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[TTaskLike,TAwaiter,T](Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder backgroundTask Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder get_backgroundTask() Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.TaskBuilder get_task() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl index a49aac19aaa..95ebeea8a37 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl @@ -757,6 +757,16 @@ Microsoft.FSharp.Control.TaskBuilderBase: Microsoft.FSharp.Core.CompilerServices Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Boolean TaskBuilderBase.BindDynamic.Static[TOverall,TResult1,TResult2](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) @@ -764,8 +774,26 @@ Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Cor Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T] TaskBuilderBase.Using[TResource,TOverall,T](Microsoft.FSharp.Control.TaskBuilderBase, TResource, Microsoft.FSharp.Core.FSharpFunc`2[TResource,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom$W[TTaskLike,TAwaiter,T](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,T], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[TTaskLike,TAwaiter,T](Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder backgroundTask Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder get_backgroundTask() Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.TaskBuilder get_task() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl index b17d1201a5a..c4106d360c4 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl @@ -757,6 +757,16 @@ Microsoft.FSharp.Control.TaskBuilderBase: Microsoft.FSharp.Core.CompilerServices Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Boolean TaskBuilderBase.BindDynamic.Static[TOverall,TResult1,TResult2](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, System.Threading.Tasks.Task`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.HighPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Boolean TaskBuilderBase.BindDynamic.Static[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.CompilerServices.ResumableStateMachine`1[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall]] ByRef, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind$W[TTaskLike,TResult1,TResult2,TAwaiter,TOverall](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike, Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) @@ -764,8 +774,26 @@ Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Cor Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T] TaskBuilderBase.Using[TResource,TOverall,T](Microsoft.FSharp.Control.TaskBuilderBase, TResource, Microsoft.FSharp.Core.FSharpFunc`2[TResource,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],T]]) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom$W[TTaskLike,TAwaiter,T](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike,TAwaiter], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,T], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter,System.Boolean], Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[TTaskLike,TAwaiter,T](Microsoft.FSharp.Control.TaskBuilderBase, TTaskLike) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TTaskLike2,TResult1,TResult2,TAwaiter1,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, TTaskLike2) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2] TaskBuilderBase.Bind[TResult1,TOverall,TResult2](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TResult1,Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[TOverall],TResult2]]) Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: Microsoft.FSharp.Core.CompilerServices.ResumableCode`2[Microsoft.FSharp.Control.TaskStateMachineData`1[T],T] TaskBuilderBase.ReturnFrom[T](Microsoft.FSharp.Control.TaskBuilderBase, Microsoft.FSharp.Control.FSharpAsync`1[T]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.BackgroundTaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] BackgroundTaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.BackgroundTaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike1,TAwaiter1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,TResult1], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter1,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources$W[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Core.FSharpFunc`2[TTaskLike2,TAwaiter2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,TResult2], Microsoft.FSharp.Core.FSharpFunc`2[TAwaiter2,System.Boolean], Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, Microsoft.FSharp.Control.FSharpAsync`1[TResult1], System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TResult1,TResult2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], Microsoft.FSharp.Control.FSharpAsync`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike1,TResult1,TResult2,TAwaiter1](Microsoft.FSharp.Control.TaskBuilder, TTaskLike1, System.Threading.Tasks.Task`1[TResult2]) +Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority: System.Threading.Tasks.Task`1[System.ValueTuple`2[TResult1,TResult2]] TaskBuilder.MergeSources[TTaskLike2,TResult1,TResult2,TAwaiter2](Microsoft.FSharp.Control.TaskBuilder, System.Threading.Tasks.Task`1[TResult1], TTaskLike2) Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder backgroundTask Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.BackgroundTaskBuilder get_backgroundTask() Microsoft.FSharp.Control.TaskBuilderModule: Microsoft.FSharp.Control.TaskBuilder get_task() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs index cce271d58bb..f60a3562f75 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs @@ -183,6 +183,179 @@ type SmokeTestsForCompilation() = t.Wait() if t.Result <> 5 then failwith "failed" + [] + member _.merge2tasks() = + task { + let! x = Task.FromResult(1) + and! y = Task.FromResult(2) + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.merge3tasks() = + task { + let! x = Task.FromResult(1) + and! y = Task.FromResult(2) + and! z = Task.FromResult(3) + return x + y + z + } + |> fun t -> + t.Wait() + if t.Result <> 6 then failwith "failed" + + [] + member _.mergeYieldAndTask() = + task { + let! _ = Task.Yield() + and! y = Task.FromResult(1) + return y + } + |> fun t -> + t.Wait() + if t.Result <> 1 then failwith "failed" + + [] + member _.mergeTaskAndYield() = + task { + let! x = Task.FromResult(1) + and! _ = Task.Yield() + return x + } + |> fun t -> + t.Wait() + if t.Result <> 1 then failwith "failed" + + [] + member _.merge2valueTasks() = + task { + let! x = ValueTask(Task.FromResult(1)) + and! y = ValueTask(Task.FromResult(2)) + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.merge2valueTasksAndYield() = + task { + let! x = ValueTask(Task.FromResult(1)) + and! y = ValueTask(Task.FromResult(2)) + and! _ = Task.Yield() + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.mergeYieldAnd2tasks() = + task { + let! _ = Task.Yield() + and! x = Task.FromResult(1) + and! y = Task.FromResult(2) + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.merge2tasksAndValueTask() = + task { + let! x = Task.FromResult(1) + and! y = Task.FromResult(2) + and! z = ValueTask(Task.FromResult(3)) + return x + y + z + } + |> fun t -> + t.Wait() + if t.Result <> 6 then failwith "failed" + + [] + member _.merge2asyncs() = + task { + let! x = async { return 1 } + and! y = async { return 2 } + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.merge3asyncs() = + task { + let! x = async { return 1 } + and! y = async { return 2 } + and! z = async { return 3 } + return x + y + z + } + |> fun t -> + t.Wait() + if t.Result <> 6 then failwith "failed" + + [] + member _.mergeYieldAndAsync() = + task { + let! _ = Task.Yield() + and! y = async { return 1 } + return y + } + |> fun t -> + t.Wait() + if t.Result <> 1 then failwith "failed" + + [] + member _.mergeAsyncAndYield() = + task { + let! x = async { return 1 } + and! _ = Task.Yield() + return x + } + |> fun t -> + t.Wait() + if t.Result <> 1 then failwith "failed" + + [] + member _.mergeYieldAnd2asyncs() = + task { + let! _ = Task.Yield() + and! x = async { return 1 } + and! y = async { return 2 } + return x + y + } + |> fun t -> + t.Wait() + if t.Result <> 3 then failwith "failed" + + [] + member _.merge2asyncsAndValueTask() = + task { + let! x = async { return 1 } + and! y = async { return 2 } + and! z = ValueTask(Task.FromResult(3)) + return x + y + z + } + |> fun t -> + t.Wait() + if t.Result <> 6 then failwith "failed" + + [] + member _.mergeBackgroundTask() = + backgroundTask { + let! x = async { return 1 } + and! y = task { return 2 } + and! z = ValueTask(Task.FromResult(3)) + return x + y + z + } + |> fun t -> + t.Wait() + if t.Result <> 6 then failwith "failed" + exception TestException of string [] @@ -296,6 +469,33 @@ type Basics() = require (y = 1) "bailed after exn" require (x = 0) "ran past failure" + [] + member _.testCatchingInApplicative() = + printfn "Running testCatchingInApplicative..." + let mutable x = 0 + let mutable y = 0 + let t = + task { + try + let! _ = task { + do! Task.Delay(100) + x <- 1 + } + and! _ = task { + failtest "hello" + } + () + with + | TestException msg -> + require (msg = "hello") "message tampered" + | _ -> + require false "other exn type" + y <- 1 + } + t.Wait() + require (y = 1) "bailed after exn" + require (x = 1) "exit too early" + [] member _.testNestedCatching() = printfn "Running testNestedCatching..." diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl index 4e6bca186fd..7f00cdfe046 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl @@ -1,3 +1,23 @@ +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl index 4e6bca186fd..7f00cdfe046 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl @@ -1,3 +1,23 @@ +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl index 6ab50914fdd..05a10ae7797 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl @@ -1,3 +1,23 @@ +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl index 6ab50914fdd..05a10ae7797 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl @@ -1,3 +1,23 @@ +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x0000000E][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPlusPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1)][offset 0x00000016][found ref '[FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x0000000E][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, [S.P.CoreLib]System.Threading.Tasks.Task`1, !!0)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.MediumPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, [S.P.CoreLib]System.Threading.Tasks.Task`1)][offset 0x00000016][found ref '[S.P.CoreLib]System.Threading.Tasks.Task`1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::TaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.TaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x0000000E][found value 'TTaskLike1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Control.TaskBuilderExtensions.LowPriority::BackgroundTaskBuilder.MergeSources$W([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Control.BackgroundTaskBuilder, !!0, !!1)][offset 0x00000016][found value 'TTaskLike2'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2'] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. From a136b33244aa64fe69b959d539477d194faa1ce7 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 23 Apr 2025 04:58:14 -0700 Subject: [PATCH 066/134] Update package Category (#18479) --- eng/Publishing.props | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 eng/Publishing.props diff --git a/eng/Publishing.props b/eng/Publishing.props new file mode 100644 index 00000000000..5f9650d32dc --- /dev/null +++ b/eng/Publishing.props @@ -0,0 +1,9 @@ + + + + + + + + From 61d7213a32b7678604f9d44e555746cb26063572 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 12:48:23 +0200 Subject: [PATCH 067/134] Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250423.3 (#18494) Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.25209.1 -> To Version 9.0.0-alpha.1.25223.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 47d04e20012..41c6f562b32 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,9 +1,9 @@ - + https://github.com/dotnet/source-build-reference-packages - 7dbf5deea5bdccf513df73cba179c4c0ad106010 + 19eb5ea4e5f9c4e5256843a92805c8c9e942207d From 394083c5d0500f7d7881b67a8e44f000371d1c07 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Thu, 24 Apr 2025 15:40:47 +0200 Subject: [PATCH 068/134] Fix overbuilding fsharp & define solution to build in script for VMR (#18491) * Fix overbuilding fsharp & define solution to build in script FSharp was building two solutions in the VMR on Windows which resulted in the inner-build building the same thing but in parallel. The builds each take 7-8 minutes. Fix that by introducing a productBuild switch (which is already exposed in the Arcade scripts) and condition which solution to build on it or the existing source-build switch. Remove the /p:Projects property from DotNetBuild.props. * proto fix * Fix repo source-build * Fixes * fix * Add YML test fix * try * fix200 * Fix201 * Update azure-pipelines-PR.yml * Fixesss --- azure-pipelines-PR.yml | 5 ++++ azure-pipelines.yml | 5 ++++ eng/Build.ps1 | 21 +++++++---------- eng/DotNetBuild.props | 13 ----------- eng/build.sh | 23 +++++++++++-------- .../core-templates/job/source-build.yml | 2 ++ .../core-templates/steps/source-build.yml | 1 + 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index 75d0484cac9..bf59708bdb1 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -208,6 +208,11 @@ stages: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true + sourceBuildParameters: + platforms: + - name: 'Managed' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' + buildArguments: '--source-build' enableTelemetry: true helixRepo: dotnet/fsharp jobs: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 95c03d1c0d4..08c20d1ef4f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -103,6 +103,11 @@ extends: enablePublishBuildAssets: true enablePublishUsingPipelines: $(_PublishUsingPipelines) enableSourceBuild: true + sourceBuildParameters: + platforms: + - name: 'Managed' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' + buildArguments: '--source-build' enableTelemetry: true helixRepo: dotnet/fsharp jobs: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 91ed6cd4008..146372ecde6 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -68,7 +68,7 @@ param ( [switch]$testBenchmarks, [string]$officialSkipTests = "false", [switch]$noVisualStudio, - [switch]$sourceBuild, + [switch][Alias('pb')]$productBuild, [switch]$skipBuild, [switch]$compressAllMetadata, [switch]$buildnorealsig = $true, @@ -133,7 +133,7 @@ function Print-Usage() { Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -dontUseGlobalNuGetCache Do not use the global NuGet cache" Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." - Write-Host " -sourceBuild Simulate building for source-build." + Write-Host " -productBuild Build the repository in product-build mode." Write-Host " -skipbuild Skip building product" Write-Host " -compressAllMetadata Build product with compressed metadata" Write-Host " -buildnorealsig Build product with realsig- (default use realsig+, where necessary)" @@ -218,10 +218,6 @@ function Process-Arguments() { $script:pack = $True; } - if ($sourceBuild) { - $script:testpack = $False; - } - if ($noBinaryLog) { $script:binaryLog = $False; } @@ -278,7 +274,7 @@ function Update-Arguments() { } -function BuildSolution([string] $solutionName, $nopack) { +function BuildSolution([string] $solutionName, $packSolution) { Write-Host "${solutionName}:" $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.$solutionName.binlog") } else { "" } @@ -292,13 +288,11 @@ function BuildSolution([string] $solutionName, $nopack) { # Do not set the property to true explicitly, since that would override value projects might set. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } - $sourceBuildArgs = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true /p:DotNetBuildRepo=true" } else { "" } - $BUILDING_USING_DOTNET_ORIG = $env:BUILDING_USING_DOTNET $env:BUILDING_USING_DOTNET="false" - $pack = if ($nopack -eq $False) {""} else {$pack} + $pack = if ($packSolution -eq $False) {""} else {$pack} MSBuild $toolsetBuildProj ` $bl ` @@ -307,6 +301,7 @@ function BuildSolution([string] $solutionName, $nopack) { /p:RepoRoot=$RepoRoot ` /p:Restore=$restore ` /p:Build=$build ` + /p:DotNetBuildRepo=$productBuild ` /p:Rebuild=$rebuild ` /p:Pack=$pack ` /p:Sign=$sign ` @@ -319,7 +314,6 @@ function BuildSolution([string] $solutionName, $nopack) { /p:CompressAllMetadata=$CompressAllMetadata ` /p:BuildNoRealsig=$buildnorealsig ` /v:$verbosity ` - $sourceBuildArgs ` $suppressExtensionDeployment ` @properties @@ -567,7 +561,7 @@ try { } $script:BuildMessage = "Failure building product" - if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild -and -not $sourceBuild) { + if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish -and -not $skipBuild -and -not $productBuild) { $originalSignValue = $sign if ($msbuildEngine -eq "dotnet") { # Building FSharp.sln and VisualFSharp.sln with .NET Core MSBuild @@ -587,7 +581,8 @@ try { BuildSolution "FSharp.Benchmarks.sln" $False } - if ($pack) { + # When building in product build mode, only build the compiler solution. + if ($pack -or $productBuild) { $properties_storage = $properties BuildSolution "Microsoft.FSharp.Compiler.sln" $True $properties = $properties_storage diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props index 3098934511e..78286b23bab 100644 --- a/eng/DotNetBuild.props +++ b/eng/DotNetBuild.props @@ -1,5 +1,4 @@ - @@ -7,17 +6,6 @@ true - - - - $(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\Microsoft.FSharp.Compiler.sln" - - - preview diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 33772456e28..f9f9128feb6 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -27,8 +27,7 @@ $(ArtifactsDir)\SymStore $(ArtifactsDir)\Bootstrap 4.4.0 - $(WarnOn);1182 - 1182;0025;$(WarningsAsErrors) + 0025;$(WarningsAsErrors) $(OtherFlags) --nowarn:3384 $(OtherFlags) --times --nowarn:75 $(OtherFlags) $(AdditionalFscCmdFlags) diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj index 684fecb11da..3b8aafb532b 100644 --- a/buildtools/fslex/fslex.fsproj +++ b/buildtools/fslex/fslex.fsproj @@ -5,8 +5,8 @@ $(FSharpNetCoreProductTargetFramework) true LatestMajor - $(NoWarn);64;1204;1182 - $(OtherFlags) --warnaserror-:1182 + $(NoWarn);64;1204 + true diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj index 38280006de3..ba57de811c9 100644 --- a/buildtools/fsyacc/fsyacc.fsproj +++ b/buildtools/fsyacc/fsyacc.fsproj @@ -5,8 +5,8 @@ $(FSharpNetCoreProductTargetFramework) true LatestMajor - $(NoWarn);64;1204;1182 - $(OtherFlags) --warnaserror-:1182 + $(NoWarn);64;1204 + true diff --git a/src/FSharp.Core/FSharp.Core.fsproj b/src/FSharp.Core/FSharp.Core.fsproj index b0abd5048bd..a1dddc32c7a 100644 --- a/src/FSharp.Core/FSharp.Core.fsproj +++ b/src/FSharp.Core/FSharp.Core.fsproj @@ -13,8 +13,6 @@ $(DefineConstants);FSHARP_CORE $(OtherFlags) --warnon:3218 - - $(OtherFlags) --warnon:1182 $(OtherFlags) --warnon:3390 diff --git a/src/fsi/fsi.targets b/src/fsi/fsi.targets index 1fb29b4bff6..bbdcba8f749 100644 --- a/src/fsi/fsi.targets +++ b/src/fsi/fsi.targets @@ -7,7 +7,6 @@ Debug;Release;Proto $(NoWarn);44 true - $(OtherFlags) --warnon:1182 $(MSBuildThisFileDirectory)fsi.res diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 60b867c7815..49b459e2796 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -13,7 +13,6 @@ true false false - $(OtherFlags) --warnon:1182 $(NoWarn);FS0988 $(DefineConstants);RELEASE $(DefineConstants);DEBUG diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index d9db689952c..967f5aacfc4 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -5,8 +5,7 @@ net472;$(FSharpNetCoreProductTargetFramework) $(FSharpNetCoreProductTargetFramework) true - $(NoWarn);1182 - $(OtherFlags) --warnaserror-:1182 + true true xunit diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index d4dbfdd4348..b51337c3530 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -12,8 +12,7 @@ $(FSCoreUnitTestsPackageVersion) true preview - $(NoWarn);1182 - $(OtherFlags) --warnaserror-:1182 + true true xunit true diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index b98f57603c6..7788cbe6520 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -12,7 +12,7 @@ false xunit true - $(OtherFlags) --warnon:1182 --realsig- + $(OtherFlags) --realsig- true XUNIT_EXTRAS diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 32ff617c0d3..dfc4840d0c8 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -11,7 +11,7 @@ true false false - $(OtherFlags) --warnon:1182 --langversion:preview + $(OtherFlags) --langversion:preview xunit 3186 diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 5fedad089dd..fbafe3bd839 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -7,7 +7,7 @@ $(NoWarn);75 $(NoWarn);44 true - $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + $(OtherFlags) --subsystemversion:6.00 false diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 9c82f79ec9e..9968c121f7c 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -7,7 +7,7 @@ $(NoWarn);75 $(NoWarn);44 true - $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + $(OtherFlags) --subsystemversion:6.00 false diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj index b472ed00da0..e6a2e4abe8e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/FSharp.ProjectSystem.FSharp.fsproj @@ -7,7 +7,7 @@ FSharp.ProjectSystem.FSharp $(NoWarn);52;62;75 true - $(OtherFlags) --warnon:1182 --subsystemversion:6.00 + $(OtherFlags) --subsystemversion:6.00 false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index cc40ac675c7..43e8352845f 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -4,9 +4,10 @@ Library - $(NoWarn);47;75;1182 + $(NoWarn);47;75 true - $(OtherFlags) --subsystemversion:6.00 --warnaserror-:1182 + $(OtherFlags) --subsystemversion:6.00 + true false diff --git a/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj b/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj index 738a3e1323c..2a760da0f5e 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj +++ b/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj @@ -7,7 +7,6 @@ false true $(NoWarn);FS3511 - $(OtherFlags) --warnon:1182 true diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index faca7cb840b..c94be43a0bb 100644 --- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -5,7 +5,8 @@ net472 true - $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182 --warnaserror-:1182 + true + $(OtherFlags) --nowarn:3390 --nowarn:3218 diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 7f24444a6e5..e1e657a651a 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -4,8 +4,8 @@ Library - $(NoWarn);44;45;47;52;58;75;1182 - $(OtherFlags) --warnaserror-:1182 + $(NoWarn);44;45;47;52;58;75 + true true true false diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 77c7d12e017..30a871ad288 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -6,8 +6,8 @@ net472 x86 Library - $(NoWarn);44;58;75;3005;1182 - $(OtherFlags) --warnaserror-:1182 + $(NoWarn);44;58;75;3005 + true true true true From eb00cdba2dc81a266fc6854a05f25cb0479a875d Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 1 Apr 2025 20:43:06 -0700 Subject: [PATCH 071/134] Fix PM --- src/Compiler/Driver/ScriptClosure.fs | 6 ++++-- vsintegration/src/FSharp.Editor/Common/Extensions.fs | 2 +- .../LanguageService/FSharpProjectOptionsManager.fs | 10 ++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index b97b11a8054..b45049627cf 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -327,11 +327,13 @@ module ScriptPreprocessClosure = for kv in tcConfig.packageManagerLines do let packageManagerKey, packageManagerLines = kv.Key, kv.Value - match packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) with + let packageManagerLines = + packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) + + match packageManagerLines with | [] -> () | packageManagerLine :: _ -> let m = packageManagerLine.Range - let packageManagerLines = packageManagerLines yield! processPackageManagerLines m packageManagerLines scriptName packageManagerKey ] diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 2ed87e5ec82..ff17ac43662 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -139,7 +139,7 @@ type Document with | hr, _, _, docData, _ when ErrorHandler.Succeeded(hr) && docData <> IntPtr.Zero -> match Marshal.GetObjectForIUnknown docData with | :? IVsTextBuffer as ivsTextBuffer -> - match textManager.GetActiveView(1, ivsTextBuffer) with + match textManager.GetActiveView(0, ivsTextBuffer) with | hr, vsTextView when ErrorHandler.Succeeded(hr) -> Some vsTextView | _ -> None | _ -> None diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index edf31e68a57..d61ba717b4d 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -200,13 +200,16 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = cancellableTask { let! ct = CancellableTask.getCancellationToken () let! fileStamp = document.GetTextVersionAsync(ct) + let textViewAndCaret () : (IVsTextView * Position) option = document.TryGetTextViewAndCaretPos() match singleFileCache.TryGetValue(document.Id) with | false, _ -> let! sourceText = document.GetTextAsync(ct) let getProjectOptionsFromScript textViewAndCaret = - match textViewAndCaret with + let caret = textViewAndCaret () + + match caret with | None -> checker.GetProjectOptionsFromScript( document.FilePath, @@ -226,7 +229,6 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = userOpName = userOpName ) - let textViewAndCaret = document.TryGetTextViewAndCaretPos() let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret let project = document.Project @@ -266,7 +268,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = let updateProjectOptions () = async { - let! scriptProjectOptions, _ = getProjectOptionsFromScript None + let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret checker.NotifyFileChanged(document.FilePath, scriptProjectOptions) |> Async.Start @@ -281,7 +283,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = match value with | projectId, fileStamp, parsingOptions, projectOptions, _ -> let subscription = - match textViewAndCaret with + match textViewAndCaret () with | Some(textView, _) -> subscribeToTextViewEvents (textView, (Some onChangeCaretHandler), (Some onKillFocus), (Some onSetFocus)) | None -> None From fa803eea156b3cbd6849fc42176dc6dbfbaf4ee7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:31:06 +0200 Subject: [PATCH 072/134] Update dependencies from https://github.com/dotnet/msbuild build 20250414.9 (#18478) Microsoft.SourceBuild.Intermediate.msbuild , Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.24-preview-25209-01 -> To Version 17.13.25-preview-25214-09 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NuGet.config b/NuGet.config index da8e2711646..bb182ae7ad1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 41c6f562b32..f1ed5b1566a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,26 +7,26 @@ - + https://github.com/dotnet/msbuild - 7a09d5ee44eb217e9c1ae0bab242c79c70423577 + 7ad4e1c76585d0ed6e438da2d4f9394326934399 - + https://github.com/dotnet/msbuild - 7a09d5ee44eb217e9c1ae0bab242c79c70423577 + 7ad4e1c76585d0ed6e438da2d4f9394326934399 - + https://github.com/dotnet/msbuild - 7a09d5ee44eb217e9c1ae0bab242c79c70423577 + 7ad4e1c76585d0ed6e438da2d4f9394326934399 - + https://github.com/dotnet/msbuild - 7a09d5ee44eb217e9c1ae0bab242c79c70423577 + 7ad4e1c76585d0ed6e438da2d4f9394326934399 - + https://github.com/dotnet/msbuild - 7a09d5ee44eb217e9c1ae0bab242c79c70423577 + 7ad4e1c76585d0ed6e438da2d4f9394326934399 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index e8e0195904f..2bbd93c22ac 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -102,7 +102,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.24 + 17.13.25 $(RoslynVersion) $(RoslynVersion) @@ -138,9 +138,9 @@ 15.0.25123-Dev15Preview - 17.13.24 - 17.13.24 - 17.13.24 + 17.13.25 + 17.13.25 + 17.13.25 $(VisualStudioEditorPackagesVersion) From 9b4a7ce7bfdb7b5c9e50bee9b9c084111e5078a0 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 25 Apr 2025 10:37:02 +0100 Subject: [PATCH 073/134] Consolidate `SynExpr.LetOrUseBang(isUse=false)` (#18482) --- .../CheckComputationExpressions.fs | 371 +++++++++--------- 1 file changed, 183 insertions(+), 188 deletions(-) diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index a7bcc1f9f87..011b6f0a5ac 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -863,6 +863,20 @@ let (|ExprAsUseBang|_|) expr = trivia = { LetOrUseBangKeyword = mBind }) -> ValueSome(spBind, isFromSource, pat, rhsExpr, andBangs, innerComp, mBind) | _ -> ValueNone +[] +let (|ExprAsLetBang|_|) expr = + match expr with + | SynExpr.LetOrUseBang( + bindDebugPoint = spBind + isUse = false + isFromSource = isFromSource + pat = letPat + rhs = letRhsExpr + andBangs = andBangBindings + body = innerComp + trivia = { LetOrUseBangKeyword = mBind }) -> ValueSome(spBind, isFromSource, letPat, letRhsExpr, andBangBindings, innerComp, mBind) + | _ -> ValueNone + // "cexpr; cexpr" is treated as builder.Combine(cexpr1, cexpr1) // This is not pretty - we have to decide which range markers we use for the calls to Combine and Delay // NOTE: we should probably suppress these sequence points altogether @@ -1764,51 +1778,6 @@ let rec TryTranslateComputationExpression |> addBindDebugPoint spBind ) - // 'let! pat = expr in expr' - // --> build.Bind(e1, (fun _argN -> match _argN with pat -> expr)) - // or - // --> build.BindReturn(e1, (fun _argN -> match _argN with pat -> expr-without-return)) - | SynExpr.LetOrUseBang( - bindDebugPoint = spBind - isUse = false - isFromSource = isFromSource - pat = pat - rhs = rhsExpr - andBangs = [] - body = innerComp - trivia = { LetOrUseBangKeyword = mBind }) -> - - if ceenv.isQuery then - error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) - - // Add the variables to the query variable space, on demand - let varSpace = - addVarsToVarSpace varSpace (fun _mCustomOp env -> - use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink - - let _, _, vspecs, envinner, _ = - TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv pat None TcTrueMatchClause.No - - vspecs, envinner) - - let rhsExpr = - mkSourceExprConditional isFromSource rhsExpr ceenv.sourceMethInfo ceenv.builderValName - - Some( - TranslateComputationExpressionBind - ceenv - comp - q - varSpace - mBind - (addBindDebugPoint spBind) - "Bind" - [ rhsExpr ] - pat - innerComp - translatedCtxt - ) - // 'use! pat = e1 in e2' --> build.Bind(e1, (function _argN -> match _argN with pat -> build.Using(x, (fun _argN -> match _argN with pat -> e2)))) | ExprAsUseBang(spBind, isFromSource, pat, rhsExpr, andBangs, innerComp, mBind) -> if ceenv.isQuery then @@ -1870,66 +1839,21 @@ let rec TryTranslateComputationExpression error (Error(FSComp.SR.tcInvalidUseBangBindingNoAndBangs (), m)) + // 'let! pat = expr in expr' --> + // --> build.Bind(e1, (fun _argN -> match _argN with pat -> expr)) + // or + // --> build.BindReturn(e1, (fun _argN -> match _argN with pat -> expr-without-return)) // 'let! pat1 = expr1 and! pat2 = expr2 in ...' --> // build.BindN(expr1, expr2, ...) // or // build.BindNReturn(expr1, expr2, ...) // or // build.Bind(build.MergeSources(expr1, expr2), ...) - | SynExpr.LetOrUseBang( - bindDebugPoint = spBind - isUse = false - isFromSource = isFromSource - pat = letPat - rhs = letRhsExpr - andBangs = andBangBindings - body = innerComp - trivia = { LetOrUseBangKeyword = mBind }) -> - if not (cenv.g.langVersion.SupportsFeature LanguageFeature.AndBang) then - let andBangRange = - match andBangBindings with - | [] -> comp.Range - | h :: _ -> h.Trivia.AndBangKeyword - - error (Error(FSComp.SR.tcAndBangNotSupported (), andBangRange)) - - if ceenv.isQuery then - error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) - - let sources = - (letRhsExpr - :: [ for SynExprAndBang(body = andExpr) in andBangBindings -> andExpr ]) - |> List.map (fun expr -> mkSourceExprConditional isFromSource expr ceenv.sourceMethInfo ceenv.builderValName) - - let pats = - letPat :: [ for SynExprAndBang(pat = andPat) in andBangBindings -> andPat ] - - let sourcesRange = sources |> List.map (fun e -> e.Range) |> List.reduce unionRanges - - let numSources = sources.Length - let bindReturnNName = "Bind" + string numSources + "Return" - let bindNName = "Bind" + string numSources - - // Check if this is a Bind2Return etc. - let hasBindReturnN = - not ( - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - bindReturnNName - ceenv.builderTy - ) - ) - - if - hasBindReturnN - && Option.isSome (convertSimpleReturnToExpr ceenv comp varSpace innerComp) - then - let consumePat = SynPat.Tuple(false, pats, [], letPat.Range) + | ExprAsLetBang(spBind, isFromSource, letPat, letRhsExpr, andBangBindings, innerComp, mBind) -> + match andBangBindings with + | [] -> + if ceenv.isQuery then + error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) // Add the variables to the query variable space, on demand let varSpace = @@ -1937,10 +1861,13 @@ let rec TryTranslateComputationExpression use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink let _, _, vspecs, envinner, _ = - TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv consumePat None TcTrueMatchClause.No + TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv letPat None TcTrueMatchClause.No vspecs, envinner) + let rhsExpr = + mkSourceExprConditional isFromSource letRhsExpr ceenv.sourceMethInfo ceenv.builderValName + Some( TranslateComputationExpressionBind ceenv @@ -1949,17 +1876,40 @@ let rec TryTranslateComputationExpression varSpace mBind (addBindDebugPoint spBind) - bindNName - sources - consumePat + "Bind" + [ rhsExpr ] + letPat innerComp translatedCtxt ) + | _ -> + if not (cenv.g.langVersion.SupportsFeature LanguageFeature.AndBang) then + let andBangRange = + match andBangBindings with + | [] -> comp.Range + | h :: _ -> h.Trivia.AndBangKeyword - else + error (Error(FSComp.SR.tcAndBangNotSupported (), andBangRange)) + + if ceenv.isQuery then + error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) - // Check if this is a Bind2 etc. - let hasBindN = + let sources = + (letRhsExpr + :: [ for SynExprAndBang(body = andExpr) in andBangBindings -> andExpr ]) + |> List.map (fun expr -> mkSourceExprConditional isFromSource expr ceenv.sourceMethInfo ceenv.builderValName) + + let pats = + letPat :: [ for SynExprAndBang(pat = andPat) in andBangBindings -> andPat ] + + let sourcesRange = sources |> List.map (fun e -> e.Range) |> List.reduce unionRanges + + let numSources = sources.Length + let bindReturnNName = "Bind" + string numSources + "Return" + let bindNName = "Bind" + string numSources + + // Check if this is a Bind2Return etc. + let hasBindReturnN = not ( isNil ( TryFindIntrinsicOrExtensionMethInfo @@ -1968,12 +1918,15 @@ let rec TryTranslateComputationExpression ceenv.env mBind ceenv.ad - bindNName + bindReturnNName ceenv.builderTy ) ) - if hasBindN then + if + hasBindReturnN + && Option.isSome (convertSimpleReturnToExpr ceenv comp varSpace innerComp) + then let consumePat = SynPat.Tuple(false, pats, [], letPat.Range) // Add the variables to the query variable space, on demand @@ -2001,110 +1954,152 @@ let rec TryTranslateComputationExpression translatedCtxt ) else + // Check if this is a Bind2 etc. + let hasBindN = + not ( + isNil ( + TryFindIntrinsicOrExtensionMethInfo + ResultCollectionSettings.AtMostOneResult + cenv + ceenv.env + mBind + ceenv.ad + bindNName + ceenv.builderTy + ) + ) - // Look for the maximum supported MergeSources, MergeSources3, ... - let mkMergeSourcesName n = - if n = 2 then - "MergeSources" - else - "MergeSources" + (string n) - - let maxMergeSources = - let rec loop (n: int) = - let mergeSourcesName = mkMergeSourcesName n - - if - isNil ( - TryFindIntrinsicOrExtensionMethInfo - ResultCollectionSettings.AtMostOneResult - cenv - ceenv.env - mBind - ceenv.ad - mergeSourcesName - ceenv.builderTy - ) - then - (n - 1) + if hasBindN then + let consumePat = SynPat.Tuple(false, pats, [], letPat.Range) + + // Add the variables to the query variable space, on demand + let varSpace = + addVarsToVarSpace varSpace (fun _mCustomOp env -> + use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink + + let _, _, vspecs, envinner, _ = + TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv consumePat None TcTrueMatchClause.No + + vspecs, envinner) + + Some( + TranslateComputationExpressionBind + ceenv + comp + q + varSpace + mBind + (addBindDebugPoint spBind) + bindNName + sources + consumePat + innerComp + translatedCtxt + ) + else + // Look for the maximum supported MergeSources, MergeSources3, ... + let mkMergeSourcesName n = + if n = 2 then + "MergeSources" else - loop (n + 1) + "MergeSources" + (string n) + + let maxMergeSources = + let rec loop (n: int) = + let mergeSourcesName = mkMergeSourcesName n + + if + isNil ( + TryFindIntrinsicOrExtensionMethInfo + ResultCollectionSettings.AtMostOneResult + cenv + ceenv.env + mBind + ceenv.ad + mergeSourcesName + ceenv.builderTy + ) + then + (n - 1) + else + loop (n + 1) - loop 2 + loop 2 - if maxMergeSources = 1 then - error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN (bindNName), mBind)) + if maxMergeSources = 1 then + error (Error(FSComp.SR.tcRequireMergeSourcesOrBindN (bindNName), mBind)) - let rec mergeSources (sourcesAndPats: (SynExpr * SynPat) list) = - let numSourcesAndPats = sourcesAndPats.Length - assert (numSourcesAndPats <> 0) + let rec mergeSources (sourcesAndPats: (SynExpr * SynPat) list) = + let numSourcesAndPats = sourcesAndPats.Length + assert (numSourcesAndPats <> 0) - if numSourcesAndPats = 1 then - sourcesAndPats[0] + if numSourcesAndPats = 1 then + sourcesAndPats[0] - elif numSourcesAndPats <= maxMergeSources then + elif numSourcesAndPats <= maxMergeSources then - // Call MergeSources2(e1, e2), MergeSources3(e1, e2, e3) etc - let mergeSourcesName = mkMergeSourcesName numSourcesAndPats + // Call MergeSources2(e1, e2), MergeSources3(e1, e2, e3) etc + let mergeSourcesName = mkMergeSourcesName numSourcesAndPats - requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind + requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind - let source = - mkSynCall mergeSourcesName sourcesRange (List.map fst sourcesAndPats) ceenv.builderValName + let source = + mkSynCall mergeSourcesName sourcesRange (List.map fst sourcesAndPats) ceenv.builderValName - let pat = SynPat.Tuple(false, List.map snd sourcesAndPats, [], letPat.Range) - source, pat + let pat = SynPat.Tuple(false, List.map snd sourcesAndPats, [], letPat.Range) + source, pat - else + else - // Call MergeSourcesMax(e1, e2, e3, e4, (...)) - let nowSourcesAndPats, laterSourcesAndPats = - List.splitAt (maxMergeSources - 1) sourcesAndPats + // Call MergeSourcesMax(e1, e2, e3, e4, (...)) + let nowSourcesAndPats, laterSourcesAndPats = + List.splitAt (maxMergeSources - 1) sourcesAndPats - let mergeSourcesName = mkMergeSourcesName maxMergeSources + let mergeSourcesName = mkMergeSourcesName maxMergeSources - requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind + requireBuilderMethod mergeSourcesName mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind - let laterSource, laterPat = mergeSources laterSourcesAndPats + let laterSource, laterPat = mergeSources laterSourcesAndPats - let source = - mkSynCall - mergeSourcesName - sourcesRange - (List.map fst nowSourcesAndPats @ [ laterSource ]) - ceenv.builderValName + let source = + mkSynCall + mergeSourcesName + sourcesRange + (List.map fst nowSourcesAndPats @ [ laterSource ]) + ceenv.builderValName - let pat = - SynPat.Tuple(false, List.map snd nowSourcesAndPats @ [ laterPat ], [], letPat.Range) + let pat = + SynPat.Tuple(false, List.map snd nowSourcesAndPats @ [ laterPat ], [], letPat.Range) - source, pat + source, pat - let mergedSources, consumePat = mergeSources (List.zip sources pats) + let mergedSources, consumePat = mergeSources (List.zip sources pats) - // Add the variables to the query variable space, on demand - let varSpace = - addVarsToVarSpace varSpace (fun _mCustomOp env -> - use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink + // Add the variables to the query variable space, on demand + let varSpace = + addVarsToVarSpace varSpace (fun _mCustomOp env -> + use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink - let _, _, vspecs, envinner, _ = - TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv consumePat None TcTrueMatchClause.No + let _, _, vspecs, envinner, _ = + TcMatchPattern cenv (NewInferenceType cenv.g) env ceenv.tpenv consumePat None TcTrueMatchClause.No - vspecs, envinner) + vspecs, envinner) - // Build the 'Bind' call - Some( - TranslateComputationExpressionBind - ceenv - comp - q - varSpace - mBind - (addBindDebugPoint spBind) - "Bind" - [ mergedSources ] - consumePat - innerComp - translatedCtxt - ) + // Build the 'Bind' call + Some( + TranslateComputationExpressionBind + ceenv + comp + q + varSpace + mBind + (addBindDebugPoint spBind) + "Bind" + [ mergedSources ] + consumePat + innerComp + translatedCtxt + ) | SynExpr.Match(spMatch, expr, clauses, m, trivia) -> if ceenv.isQuery then From 264a54e197671311bc8cbf7111a43307c46456f2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:07:36 +0200 Subject: [PATCH 074/134] Update dependencies from https://github.com/dotnet/arcade build 20250425.6 (#18511) Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25208.6 -> To Version 9.0.0-beta.25225.6 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 +- .../job/source-index-stage1.yml | 4 +- global.json | 2 +- .../build-configuration.json | 4 + .../eng/common/PSScriptAnalyzerSettings.psd1 | 11 + src/arcade/eng/common/README.md | 28 ++ src/arcade/eng/common/SetupNugetSources.ps1 | 171 ++++++++ src/arcade/eng/common/SetupNugetSources.sh | 167 ++++++++ src/arcade/eng/common/build.cmd | 3 + .../common/core-templates/job/onelocbuild.yml | 121 ++++++ .../core-templates/jobs/source-build.yml | 58 +++ .../post-build/common-variables.yml | 22 + .../post-build/setup-maestro-vars.yml | 74 ++++ .../steps/component-governance.yml | 16 + .../steps/enable-internal-runtimes.yml | 32 ++ .../steps/enable-internal-sources.yml | 47 ++ .../steps/get-federated-access-token.yml | 42 ++ .../steps/publish-build-artifacts.yml | 20 + .../steps/publish-pipeline-artifacts.yml | 20 + .../core-templates/steps/retain-build.yml | 28 ++ .../core-templates/steps/send-to-helix.yml | 93 ++++ .../variables/pool-providers.yml | 8 + .../eng/common/cross/arm/tizen/tizen.patch | 9 + .../eng/common/cross/armel/tizen/tizen.patch | 9 + .../common/cross/riscv64/tizen/tizen.patch | 9 + .../eng/common/cross/tizen-build-rootfs.sh | 82 ++++ .../eng/common/cross/x64/tizen/tizen.patch | 9 + .../eng/common/cross/x86/tizen/tizen.patch | 9 + src/arcade/eng/common/darc-init.ps1 | 47 ++ src/arcade/eng/common/darc-init.sh | 82 ++++ src/arcade/eng/common/dotnet-install.cmd | 2 + src/arcade/eng/common/dotnet-install.ps1 | 28 ++ src/arcade/eng/common/dotnet-install.sh | 94 ++++ .../common/enable-cross-org-publishing.ps1 | 13 + src/arcade/eng/common/generate-locproject.ps1 | 189 +++++++++ src/arcade/eng/common/generate-sbom-prep.ps1 | 29 ++ src/arcade/eng/common/generate-sbom-prep.sh | 39 ++ src/arcade/eng/common/helixpublish.proj | 27 ++ src/arcade/eng/common/init-tools-native.ps1 | 203 +++++++++ src/arcade/eng/common/init-tools-native.sh | 238 +++++++++++ .../eng/common/internal-feed-operations.ps1 | 132 ++++++ .../eng/common/internal-feed-operations.sh | 141 ++++++ .../eng/common/internal/Directory.Build.props | 11 + src/arcade/eng/common/internal/NuGet.config | 7 + src/arcade/eng/common/internal/Tools.csproj | 22 + .../common/loc/P22DotNetHtmlLocalization.lss | 29 ++ src/arcade/eng/common/msbuild.ps1 | 28 ++ src/arcade/eng/common/msbuild.sh | 58 +++ .../eng/common/native/CommonLibrary.psm1 | 401 ++++++++++++++++++ .../eng/common/native/common-library.sh | 172 ++++++++ src/arcade/eng/common/native/init-compiler.sh | 146 +++++++ .../eng/common/native/init-distro-rid.sh | 110 +++++ .../eng/common/native/init-os-and-arch.sh | 85 ++++ .../eng/common/native/install-cmake-test.sh | 117 +++++ src/arcade/eng/common/native/install-cmake.sh | 117 +++++ src/arcade/eng/common/native/install-tool.ps1 | 132 ++++++ .../eng/common/pipeline-logging-functions.ps1 | 260 ++++++++++++ .../eng/common/pipeline-logging-functions.sh | 206 +++++++++ .../post-build/check-channel-consistency.ps1 | 48 +++ .../common/post-build/nuget-validation.ps1 | 22 + .../common/post-build/nuget-verification.ps1 | 121 ++++++ .../eng/common/post-build/redact-logs.ps1 | 89 ++++ .../post-build/sourcelink-validation.ps1 | 327 ++++++++++++++ .../common/post-build/symbols-validation.ps1 | 337 +++++++++++++++ src/arcade/eng/common/retain-build.ps1 | 45 ++ src/arcade/eng/common/sdl/NuGet.config | 18 + .../eng/common/sdl/configure-sdl-tool.ps1 | 130 ++++++ .../eng/common/sdl/execute-all-sdl-tools.ps1 | 167 ++++++++ .../common/sdl/extract-artifact-archives.ps1 | 63 +++ .../common/sdl/extract-artifact-packages.ps1 | 82 ++++ src/arcade/eng/common/sdl/init-sdl.ps1 | 55 +++ src/arcade/eng/common/sdl/run-sdl.ps1 | 49 +++ src/arcade/eng/common/sdl/sdl.ps1 | 38 ++ .../eng/common/sdl/trim-assets-version.ps1 | 75 ++++ src/arcade/eng/common/template-guidance.md | 133 ++++++ .../templates-official/job/onelocbuild.yml | 7 + .../job/publish-build-assets.yml | 7 + .../templates-official/job/source-build.yml | 7 + .../job/source-index-stage1.yml | 7 + .../templates-official/jobs/codeql-build.yml | 7 + .../common/templates-official/jobs/jobs.yml | 7 + .../templates-official/jobs/source-build.yml | 7 + .../post-build/common-variables.yml | 8 + .../post-build/post-build.yml | 8 + .../post-build/setup-maestro-vars.yml | 8 + .../steps/component-governance.yml | 7 + .../steps/enable-internal-runtimes.yml | 9 + .../steps/enable-internal-sources.yml | 7 + .../steps/generate-sbom.yml | 7 + .../steps/get-delegation-sas.yml | 7 + .../steps/get-federated-access-token.yml | 7 + .../templates-official/steps/publish-logs.yml | 7 + .../steps/publish-pipeline-artifacts.yml | 28 ++ .../templates-official/steps/retain-build.yml | 7 + .../steps/send-to-helix.yml | 7 + .../templates-official/steps/source-build.yml | 7 + .../variables/pool-providers.yml | 45 ++ .../variables/sdl-variables.yml | 7 + .../eng/common/templates/job/onelocbuild.yml | 7 + .../templates/job/publish-build-assets.yml | 7 + .../eng/common/templates/job/source-build.yml | 7 + .../templates/job/source-index-stage1.yml | 7 + .../common/templates/jobs/codeql-build.yml | 7 + src/arcade/eng/common/templates/jobs/jobs.yml | 7 + .../common/templates/jobs/source-build.yml | 7 + .../templates/post-build/common-variables.yml | 8 + .../templates/post-build/post-build.yml | 8 + .../post-build/setup-maestro-vars.yml | 8 + .../templates/steps/component-governance.yml | 7 + .../steps/enable-internal-runtimes.yml | 10 + .../steps/enable-internal-sources.yml | 7 + .../common/templates/steps/generate-sbom.yml | 7 + .../templates/steps/get-delegation-sas.yml | 7 + .../steps/get-federated-access-token.yml | 7 + .../common/templates/steps/publish-logs.yml | 7 + .../steps/publish-pipeline-artifacts.yml | 34 ++ .../common/templates/steps/retain-build.yml | 7 + .../common/templates/steps/send-to-helix.yml | 7 + .../common/templates/steps/source-build.yml | 7 + .../templates/variables/pool-providers.yml | 59 +++ 120 files changed, 6527 insertions(+), 7 deletions(-) create mode 100644 src/arcade/eng/common/BuildConfiguration/build-configuration.json create mode 100644 src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 create mode 100644 src/arcade/eng/common/README.md create mode 100644 src/arcade/eng/common/SetupNugetSources.ps1 create mode 100644 src/arcade/eng/common/SetupNugetSources.sh create mode 100644 src/arcade/eng/common/build.cmd create mode 100644 src/arcade/eng/common/core-templates/job/onelocbuild.yml create mode 100644 src/arcade/eng/common/core-templates/jobs/source-build.yml create mode 100644 src/arcade/eng/common/core-templates/post-build/common-variables.yml create mode 100644 src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml create mode 100644 src/arcade/eng/common/core-templates/steps/component-governance.yml create mode 100644 src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml create mode 100644 src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml create mode 100644 src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml create mode 100644 src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml create mode 100644 src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml create mode 100644 src/arcade/eng/common/core-templates/steps/retain-build.yml create mode 100644 src/arcade/eng/common/core-templates/steps/send-to-helix.yml create mode 100644 src/arcade/eng/common/core-templates/variables/pool-providers.yml create mode 100644 src/arcade/eng/common/cross/arm/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/armel/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/riscv64/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/tizen-build-rootfs.sh create mode 100644 src/arcade/eng/common/cross/x64/tizen/tizen.patch create mode 100644 src/arcade/eng/common/cross/x86/tizen/tizen.patch create mode 100644 src/arcade/eng/common/darc-init.ps1 create mode 100644 src/arcade/eng/common/darc-init.sh create mode 100644 src/arcade/eng/common/dotnet-install.cmd create mode 100644 src/arcade/eng/common/dotnet-install.ps1 create mode 100644 src/arcade/eng/common/dotnet-install.sh create mode 100644 src/arcade/eng/common/enable-cross-org-publishing.ps1 create mode 100644 src/arcade/eng/common/generate-locproject.ps1 create mode 100644 src/arcade/eng/common/generate-sbom-prep.ps1 create mode 100644 src/arcade/eng/common/generate-sbom-prep.sh create mode 100644 src/arcade/eng/common/helixpublish.proj create mode 100644 src/arcade/eng/common/init-tools-native.ps1 create mode 100644 src/arcade/eng/common/init-tools-native.sh create mode 100644 src/arcade/eng/common/internal-feed-operations.ps1 create mode 100644 src/arcade/eng/common/internal-feed-operations.sh create mode 100644 src/arcade/eng/common/internal/Directory.Build.props create mode 100644 src/arcade/eng/common/internal/NuGet.config create mode 100644 src/arcade/eng/common/internal/Tools.csproj create mode 100644 src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss create mode 100644 src/arcade/eng/common/msbuild.ps1 create mode 100644 src/arcade/eng/common/msbuild.sh create mode 100644 src/arcade/eng/common/native/CommonLibrary.psm1 create mode 100644 src/arcade/eng/common/native/common-library.sh create mode 100644 src/arcade/eng/common/native/init-compiler.sh create mode 100644 src/arcade/eng/common/native/init-distro-rid.sh create mode 100644 src/arcade/eng/common/native/init-os-and-arch.sh create mode 100644 src/arcade/eng/common/native/install-cmake-test.sh create mode 100644 src/arcade/eng/common/native/install-cmake.sh create mode 100644 src/arcade/eng/common/native/install-tool.ps1 create mode 100644 src/arcade/eng/common/pipeline-logging-functions.ps1 create mode 100644 src/arcade/eng/common/pipeline-logging-functions.sh create mode 100644 src/arcade/eng/common/post-build/check-channel-consistency.ps1 create mode 100644 src/arcade/eng/common/post-build/nuget-validation.ps1 create mode 100644 src/arcade/eng/common/post-build/nuget-verification.ps1 create mode 100644 src/arcade/eng/common/post-build/redact-logs.ps1 create mode 100644 src/arcade/eng/common/post-build/sourcelink-validation.ps1 create mode 100644 src/arcade/eng/common/post-build/symbols-validation.ps1 create mode 100644 src/arcade/eng/common/retain-build.ps1 create mode 100644 src/arcade/eng/common/sdl/NuGet.config create mode 100644 src/arcade/eng/common/sdl/configure-sdl-tool.ps1 create mode 100644 src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 create mode 100644 src/arcade/eng/common/sdl/extract-artifact-archives.ps1 create mode 100644 src/arcade/eng/common/sdl/extract-artifact-packages.ps1 create mode 100644 src/arcade/eng/common/sdl/init-sdl.ps1 create mode 100644 src/arcade/eng/common/sdl/run-sdl.ps1 create mode 100644 src/arcade/eng/common/sdl/sdl.ps1 create mode 100644 src/arcade/eng/common/sdl/trim-assets-version.ps1 create mode 100644 src/arcade/eng/common/template-guidance.md create mode 100644 src/arcade/eng/common/templates-official/job/onelocbuild.yml create mode 100644 src/arcade/eng/common/templates-official/job/publish-build-assets.yml create mode 100644 src/arcade/eng/common/templates-official/job/source-build.yml create mode 100644 src/arcade/eng/common/templates-official/job/source-index-stage1.yml create mode 100644 src/arcade/eng/common/templates-official/jobs/codeql-build.yml create mode 100644 src/arcade/eng/common/templates-official/jobs/jobs.yml create mode 100644 src/arcade/eng/common/templates-official/jobs/source-build.yml create mode 100644 src/arcade/eng/common/templates-official/post-build/common-variables.yml create mode 100644 src/arcade/eng/common/templates-official/post-build/post-build.yml create mode 100644 src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml create mode 100644 src/arcade/eng/common/templates-official/steps/component-governance.yml create mode 100644 src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml create mode 100644 src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml create mode 100644 src/arcade/eng/common/templates-official/steps/generate-sbom.yml create mode 100644 src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml create mode 100644 src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml create mode 100644 src/arcade/eng/common/templates-official/steps/publish-logs.yml create mode 100644 src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml create mode 100644 src/arcade/eng/common/templates-official/steps/retain-build.yml create mode 100644 src/arcade/eng/common/templates-official/steps/send-to-helix.yml create mode 100644 src/arcade/eng/common/templates-official/steps/source-build.yml create mode 100644 src/arcade/eng/common/templates-official/variables/pool-providers.yml create mode 100644 src/arcade/eng/common/templates-official/variables/sdl-variables.yml create mode 100644 src/arcade/eng/common/templates/job/onelocbuild.yml create mode 100644 src/arcade/eng/common/templates/job/publish-build-assets.yml create mode 100644 src/arcade/eng/common/templates/job/source-build.yml create mode 100644 src/arcade/eng/common/templates/job/source-index-stage1.yml create mode 100644 src/arcade/eng/common/templates/jobs/codeql-build.yml create mode 100644 src/arcade/eng/common/templates/jobs/jobs.yml create mode 100644 src/arcade/eng/common/templates/jobs/source-build.yml create mode 100644 src/arcade/eng/common/templates/post-build/common-variables.yml create mode 100644 src/arcade/eng/common/templates/post-build/post-build.yml create mode 100644 src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml create mode 100644 src/arcade/eng/common/templates/steps/component-governance.yml create mode 100644 src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml create mode 100644 src/arcade/eng/common/templates/steps/enable-internal-sources.yml create mode 100644 src/arcade/eng/common/templates/steps/generate-sbom.yml create mode 100644 src/arcade/eng/common/templates/steps/get-delegation-sas.yml create mode 100644 src/arcade/eng/common/templates/steps/get-federated-access-token.yml create mode 100644 src/arcade/eng/common/templates/steps/publish-logs.yml create mode 100644 src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml create mode 100644 src/arcade/eng/common/templates/steps/retain-build.yml create mode 100644 src/arcade/eng/common/templates/steps/send-to-helix.yml create mode 100644 src/arcade/eng/common/templates/steps/source-build.yml create mode 100644 src/arcade/eng/common/templates/variables/pool-providers.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f1ed5b1566a..3d486a94d20 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -42,14 +42,14 @@ - + https://github.com/dotnet/arcade - aa61e8c20a869bcc994f8b29eb07d927d2bec6f4 + bfbc858ba868b60fffaf7b2150f1d2165b01e786 - + https://github.com/dotnet/arcade - aa61e8c20a869bcc994f8b29eb07d927d2bec6f4 + bfbc858ba868b60fffaf7b2150f1d2165b01e786 diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 205fb5b3a39..8b833332b3e 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -1,7 +1,7 @@ parameters: runAsPublic: false - sourceIndexUploadPackageVersion: 2.0.0-20240522.1 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20240522.1 + sourceIndexUploadPackageVersion: 2.0.0-20250425.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20250425.2 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] diff --git a/global.json b/global.json index dad4b18b2fa..025b675460e 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25208.6", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25225.6", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/src/arcade/eng/common/BuildConfiguration/build-configuration.json b/src/arcade/eng/common/BuildConfiguration/build-configuration.json new file mode 100644 index 00000000000..3d1cc89894c --- /dev/null +++ b/src/arcade/eng/common/BuildConfiguration/build-configuration.json @@ -0,0 +1,4 @@ +{ + "RetryCountLimit": 1, + "RetryByAnyError": false +} diff --git a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 new file mode 100644 index 00000000000..4c1ea7c98ea --- /dev/null +++ b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 @@ -0,0 +1,11 @@ +@{ + IncludeRules=@('PSAvoidUsingCmdletAliases', + 'PSAvoidUsingWMICmdlet', + 'PSAvoidUsingPositionalParameters', + 'PSAvoidUsingInvokeExpression', + 'PSUseDeclaredVarsMoreThanAssignments', + 'PSUseCmdletCorrectly', + 'PSStandardDSCFunctionsInResource', + 'PSUseIdenticalMandatoryParametersForDSC', + 'PSUseIdenticalParametersForDSC') +} \ No newline at end of file diff --git a/src/arcade/eng/common/README.md b/src/arcade/eng/common/README.md new file mode 100644 index 00000000000..ff49c371527 --- /dev/null +++ b/src/arcade/eng/common/README.md @@ -0,0 +1,28 @@ +# Don't touch this folder + + uuuuuuuuuuuuuuuuuuuu + u" uuuuuuuuuuuuuuuuuu "u + u" u$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ + $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ + $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ + $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ + $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$" u" + "u """""""""""""""""" u" + """""""""""""""""""" + +!!! Changes made in this directory are subject to being overwritten by automation !!! + +The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. diff --git a/src/arcade/eng/common/SetupNugetSources.ps1 b/src/arcade/eng/common/SetupNugetSources.ps1 new file mode 100644 index 00000000000..5db4ad71ee2 --- /dev/null +++ b/src/arcade/eng/common/SetupNugetSources.ps1 @@ -0,0 +1,171 @@ +# This script adds internal feeds required to build commits that depend on internal package sources. For instance, +# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables +# disabled internal Maestro (darc-int*) feeds. +# +# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. +# +# See example call for this script below. +# +# - task: PowerShell@2 +# displayName: Setup Private Feeds Credentials +# condition: eq(variables['Agent.OS'], 'Windows_NT') +# inputs: +# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 +# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token +# env: +# Token: $(dn-bot-dnceng-artifact-feeds-rw) +# +# Note that the NuGetAuthenticate task should be called after SetupNugetSources. +# This ensures that: +# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) +# - The credential provider is installed. +# +# This logic is also abstracted into enable-internal-sources.yml. + +[CmdletBinding()] +param ( + [Parameter(Mandatory = $true)][string]$ConfigFile, + $Password +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +. $PSScriptRoot\tools.ps1 + +# Add source entry to PackageSources +function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { + $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") + + if ($packageSource -eq $null) + { + $packageSource = $doc.CreateElement("add") + $packageSource.SetAttribute("key", $SourceName) + $packageSource.SetAttribute("value", $SourceEndPoint) + $sources.AppendChild($packageSource) | Out-Null + } + else { + Write-Host "Package source $SourceName already present." + } + + AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd +} + +# Add a credential node for the specified source +function AddCredential($creds, $source, $username, $pwd) { + # If no cred supplied, don't do anything. + if (!$pwd) { + return; + } + + # Looks for credential configuration for the given SourceName. Create it if none is found. + $sourceElement = $creds.SelectSingleNode($Source) + if ($sourceElement -eq $null) + { + $sourceElement = $doc.CreateElement($Source) + $creds.AppendChild($sourceElement) | Out-Null + } + + # Add the node to the credential if none is found. + $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']") + if ($usernameElement -eq $null) + { + $usernameElement = $doc.CreateElement("add") + $usernameElement.SetAttribute("key", "Username") + $sourceElement.AppendChild($usernameElement) | Out-Null + } + $usernameElement.SetAttribute("value", $Username) + + # Add the to the credential if none is found. + # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs. + # -> https://github.com/NuGet/Home/issues/5526 + $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']") + if ($passwordElement -eq $null) + { + $passwordElement = $doc.CreateElement("add") + $passwordElement.SetAttribute("key", "ClearTextPassword") + $sourceElement.AppendChild($passwordElement) | Out-Null + } + + $passwordElement.SetAttribute("value", $pwd) +} + +function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { + $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") + + Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." + + ForEach ($PackageSource in $maestroPrivateSources) { + Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key + AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd + } +} + +function EnablePrivatePackageSources($DisabledPackageSources) { + $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") + ForEach ($DisabledPackageSource in $maestroPrivateSources) { + Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" + # Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries + $DisabledPackageSources.RemoveChild($DisabledPackageSource) + } +} + +if (!(Test-Path $ConfigFile -PathType Leaf)) { + Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile" + ExitWithExitCode 1 +} + +# Load NuGet.config +$doc = New-Object System.Xml.XmlDocument +$filename = (Get-Item $ConfigFile).FullName +$doc.Load($filename) + +# Get reference to or create one if none exist already +$sources = $doc.DocumentElement.SelectSingleNode("packageSources") +if ($sources -eq $null) { + $sources = $doc.CreateElement("packageSources") + $doc.DocumentElement.AppendChild($sources) | Out-Null +} + +$creds = $null +if ($Password) { + # Looks for a node. Create it if none is found. + $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials") + if ($creds -eq $null) { + $creds = $doc.CreateElement("packageSourceCredentials") + $doc.DocumentElement.AppendChild($creds) | Out-Null + } +} + +# Check for disabledPackageSources; we'll enable any darc-int ones we find there +$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") +if ($disabledSources -ne $null) { + Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" + EnablePrivatePackageSources -DisabledPackageSources $disabledSources +} + +$userName = "dn-bot" + +# Insert credential nodes for Maestro's private feeds +InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password + +# 3.1 uses a different feed url format so it's handled differently here +$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") +if ($dotnet31Source -ne $null) { + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password +} + +$dotnetVersions = @('5','6','7','8','9') + +foreach ($dotnetVersion in $dotnetVersions) { + $feedPrefix = "dotnet" + $dotnetVersion; + $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") + if ($dotnetSource -ne $null) { + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password + } +} + +$doc.Save($filename) diff --git a/src/arcade/eng/common/SetupNugetSources.sh b/src/arcade/eng/common/SetupNugetSources.sh new file mode 100644 index 00000000000..4604b61b032 --- /dev/null +++ b/src/arcade/eng/common/SetupNugetSources.sh @@ -0,0 +1,167 @@ +#!/usr/bin/env bash + +# This script adds internal feeds required to build commits that depend on internal package sources. For instance, +# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables +# disabled internal Maestro (darc-int*) feeds. +# +# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. +# +# See example call for this script below. +# +# - task: Bash@3 +# displayName: Setup Internal Feeds +# inputs: +# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh +# arguments: $(Build.SourcesDirectory)/NuGet.config +# condition: ne(variables['Agent.OS'], 'Windows_NT') +# - task: NuGetAuthenticate@1 +# +# Note that the NuGetAuthenticate task should be called after SetupNugetSources. +# This ensures that: +# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) +# - The credential provider is installed. +# +# This logic is also abstracted into enable-internal-sources.yml. + +ConfigFile=$1 +CredToken=$2 +NL='\n' +TB=' ' + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +if [ ! -f "$ConfigFile" ]; then + Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile" + ExitWithExitCode 1 +fi + +if [[ `uname -s` == "Darwin" ]]; then + NL=$'\\\n' + TB='' +fi + +# Ensure there is a ... section. +grep -i "" $ConfigFile +if [ "$?" != "0" ]; then + echo "Adding ... section." + ConfigNodeHeader="" + PackageSourcesTemplate="${TB}${NL}${TB}" + + sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile +fi + +# Ensure there is a ... section. +grep -i "" $ConfigFile +if [ "$?" != "0" ]; then + echo "Adding ... section." + + PackageSourcesNodeFooter="" + PackageSourceCredentialsTemplate="${TB}${NL}${TB}" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" $ConfigFile +fi + +PackageSources=() + +# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present +grep -i "" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=('dotnet3.1-internal') + + grep -i "" $ConfigFile + if [ "$?" != "0" ]; then + echo "Adding dotnet3.1-internal-transport to the packageSources." + PackageSourcesNodeFooter="" + PackageSourceTemplate="${TB}" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=('dotnet3.1-internal-transport') +fi + +DotNetVersions=('5' '6' '7' '8' '9') + +for DotNetVersion in ${DotNetVersions[@]} ; do + FeedPrefix="dotnet${DotNetVersion}"; + grep -i "" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=("$FeedPrefix-internal") + + grep -i "" $ConfigFile + if [ "$?" != "0" ]; then + echo "Adding $FeedPrefix-internal-transport to the packageSources." + PackageSourcesNodeFooter="" + PackageSourceTemplate="${TB}" + + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile + fi + PackageSources+=("$FeedPrefix-internal-transport") + fi +done + +# I want things split line by line +PrevIFS=$IFS +IFS=$'\n' +PackageSources+="$IFS" +PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"') +IFS=$PrevIFS + +if [ "$CredToken" ]; then + for FeedName in ${PackageSources[@]} ; do + # Check if there is no existing credential for this FeedName + grep -i "<$FeedName>" $ConfigFile + if [ "$?" != "0" ]; then + echo "Adding credentials for $FeedName." + + PackageSourceCredentialsNodeFooter="" + NewCredential="${TB}${TB}<$FeedName>${NL}${NL}${NL}" + + sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile + fi + done +fi + +# Re-enable any entries in disabledPackageSources where the feed name contains darc-int +grep -i "" $ConfigFile +if [ "$?" == "0" ]; then + DisabledDarcIntSources=() + echo "Re-enabling any disabled \"darc-int\" package sources in $ConfigFile" + DisabledDarcIntSources+=$(grep -oh '"darc-int-[^"]*" value="true"' $ConfigFile | tr -d '"') + for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do + if [[ $DisabledSourceName == darc-int* ]] + then + OldDisableValue="" + NewDisableValue="" + sed -i.bak "s|$OldDisableValue|$NewDisableValue|" $ConfigFile + echo "Neutralized disablePackageSources entry for '$DisabledSourceName'" + fi + done +fi diff --git a/src/arcade/eng/common/build.cmd b/src/arcade/eng/common/build.cmd new file mode 100644 index 00000000000..99daf368aba --- /dev/null +++ b/src/arcade/eng/common/build.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*" +exit /b %ErrorLevel% diff --git a/src/arcade/eng/common/core-templates/job/onelocbuild.yml b/src/arcade/eng/common/core-templates/job/onelocbuild.yml new file mode 100644 index 00000000000..00feec8ebbc --- /dev/null +++ b/src/arcade/eng/common/core-templates/job/onelocbuild.yml @@ -0,0 +1,121 @@ +parameters: + # Optional: dependencies of the job + dependsOn: '' + + # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool + pool: '' + + CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex + GithubPat: $(BotAccount-dotnet-bot-repo-PAT) + + SourcesDirectory: $(Build.SourcesDirectory) + CreatePr: true + AutoCompletePr: false + ReusePr: true + UseLfLineEndings: true + UseCheckedInLocProjectJson: false + SkipLocProjectJsonGeneration: false + LanguageSet: VS_Main_Languages + LclSource: lclFilesInRepo + LclPackageId: '' + RepoType: gitHub + GitHubOrg: dotnet + MirrorRepo: '' + MirrorBranch: main + condition: '' + JobNameSuffix: '' + is1ESPipeline: '' +jobs: +- job: OneLocBuild${{ parameters.JobNameSuffix }} + + dependsOn: ${{ parameters.dependsOn }} + + displayName: OneLocBuild${{ parameters.JobNameSuffix }} + + variables: + - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat + - name: _GenerateLocProjectArguments + value: -SourcesDirectory ${{ parameters.SourcesDirectory }} + -LanguageSet "${{ parameters.LanguageSet }}" + -CreateNeutralXlfs + - ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}: + - name: _GenerateLocProjectArguments + value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson + - template: /eng/common/core-templates/variables/pool-providers.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + + ${{ if ne(parameters.pool, '') }}: + pool: ${{ parameters.pool }} + ${{ if eq(parameters.pool, '') }}: + pool: + # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) + ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: + name: AzurePipelines-EO + image: 1ESPT-Windows2022 + demands: Cmd + os: windows + # If it's not devdiv, it's dnceng + ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: + name: $(DncEngInternalBuildPool) + image: 1es-windows-2022 + os: windows + + steps: + - ${{ if eq(parameters.is1ESPipeline, '') }}: + - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error + + - ${{ if ne(parameters.SkipLocProjectJsonGeneration, 'true') }}: + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1 + arguments: $(_GenerateLocProjectArguments) + displayName: Generate LocProject.json + condition: ${{ parameters.condition }} + + - task: OneLocBuild@2 + displayName: OneLocBuild + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + locProj: eng/Localize/LocProject.json + outDir: $(Build.ArtifactStagingDirectory) + lclSource: ${{ parameters.LclSource }} + lclPackageId: ${{ parameters.LclPackageId }} + isCreatePrSelected: ${{ parameters.CreatePr }} + isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }} + ${{ if eq(parameters.CreatePr, true) }}: + isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }} + ${{ if eq(parameters.RepoType, 'gitHub') }}: + isShouldReusePrSelected: ${{ parameters.ReusePr }} + packageSourceAuth: patAuth + patVariable: ${{ parameters.CeapexPat }} + ${{ if eq(parameters.RepoType, 'gitHub') }}: + repoType: ${{ parameters.RepoType }} + gitHubPatVariable: "${{ parameters.GithubPat }}" + ${{ if ne(parameters.MirrorRepo, '') }}: + isMirrorRepoSelected: true + gitHubOrganization: ${{ parameters.GitHubOrg }} + mirrorRepo: ${{ parameters.MirrorRepo }} + mirrorBranch: ${{ parameters.MirrorBranch }} + condition: ${{ parameters.condition }} + + - template: /eng/common/core-templates/steps/publish-build-artifacts.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + args: + displayName: Publish Localization Files + pathToPublish: '$(Build.ArtifactStagingDirectory)/loc' + publishLocation: Container + artifactName: Loc + condition: ${{ parameters.condition }} + + - template: /eng/common/core-templates/steps/publish-build-artifacts.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + args: + displayName: Publish LocProject.json + pathToPublish: '$(Build.SourcesDirectory)/eng/Localize/' + publishLocation: Container + artifactName: Loc + condition: ${{ parameters.condition }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/jobs/source-build.yml b/src/arcade/eng/common/core-templates/jobs/source-build.yml new file mode 100644 index 00000000000..a10ccfbee6d --- /dev/null +++ b/src/arcade/eng/common/core-templates/jobs/source-build.yml @@ -0,0 +1,58 @@ +parameters: + # This template adds arcade-powered source-build to CI. A job is created for each platform, as + # well as an optional server job that completes when all platform jobs complete. + + # The name of the "join" job for all source-build platforms. If set to empty string, the job is + # not included. Existing repo pipelines can use this job depend on all source-build jobs + # completing without maintaining a separate list of every single job ID: just depend on this one + # server job. By default, not included. Recommended name if used: 'Source_Build_Complete'. + allCompletedJobId: '' + + # See /eng/common/core-templates/job/source-build.yml + jobNamePrefix: 'Source_Build' + + # This is the default platform provided by Arcade, intended for use by a managed-only repo. + defaultManagedPlatform: + name: 'Managed' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' + + # Defines the platforms on which to run build jobs. One job is created for each platform, and the + # object in this array is sent to the job template as 'platform'. If no platforms are specified, + # one job runs on 'defaultManagedPlatform'. + platforms: [] + + is1ESPipeline: '' + + # If set to true and running on a non-public project, + # Internal nuget and blob storage locations will be enabled. + # This is not enabled by default because many repositories do not need internal sources + # and do not need to have the required service connections approved in the pipeline. + enableInternalSources: false + +jobs: + +- ${{ if ne(parameters.allCompletedJobId, '') }}: + - job: ${{ parameters.allCompletedJobId }} + displayName: Source-Build Complete + pool: server + dependsOn: + - ${{ each platform in parameters.platforms }}: + - ${{ parameters.jobNamePrefix }}_${{ platform.name }} + - ${{ if eq(length(parameters.platforms), 0) }}: + - ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }} + +- ${{ each platform in parameters.platforms }}: + - template: /eng/common/core-templates/job/source-build.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + jobNamePrefix: ${{ parameters.jobNamePrefix }} + platform: ${{ platform }} + enableInternalSources: ${{ parameters.enableInternalSources }} + +- ${{ if eq(length(parameters.platforms), 0) }}: + - template: /eng/common/core-templates/job/source-build.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + jobNamePrefix: ${{ parameters.jobNamePrefix }} + platform: ${{ parameters.defaultManagedPlatform }} + enableInternalSources: ${{ parameters.enableInternalSources }} diff --git a/src/arcade/eng/common/core-templates/post-build/common-variables.yml b/src/arcade/eng/common/core-templates/post-build/common-variables.yml new file mode 100644 index 00000000000..d5627a994ae --- /dev/null +++ b/src/arcade/eng/common/core-templates/post-build/common-variables.yml @@ -0,0 +1,22 @@ +variables: + - group: Publish-Build-Assets + + # Whether the build is internal or not + - name: IsInternalBuild + value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} + + # Default Maestro++ API Endpoint and API Version + - name: MaestroApiEndPoint + value: "https://maestro.dot.net" + - name: MaestroApiVersion + value: "2020-02-20" + + - name: SourceLinkCLIVersion + value: 3.0.0 + - name: SymbolToolVersion + value: 1.0.1 + - name: BinlogToolVersion + value: 1.0.11 + + - name: runCodesignValidationInjection + value: false diff --git a/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml new file mode 100644 index 00000000000..f7602980dbe --- /dev/null +++ b/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml @@ -0,0 +1,74 @@ +parameters: + BARBuildId: '' + PromoteToChannelIds: '' + is1ESPipeline: '' + +steps: + - ${{ if eq(parameters.is1ESPipeline, '') }}: + - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error + + - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Release Configs + inputs: + buildType: current + artifactName: ReleaseConfigs + checkDownloadedFiles: true + + - task: AzureCLI@2 + name: setReleaseVars + displayName: Set Release Configs Vars + inputs: + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | + try { + if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { + $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt + + $BarId = $Content | Select -Index 0 + $Channels = $Content | Select -Index 1 + $IsStableBuild = $Content | Select -Index 2 + + $AzureDevOpsProject = $Env:System_TeamProject + $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId + $AzureDevOpsBuildId = $Env:Build_BuildId + } + else { + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json + + $BarId = ${{ parameters.BARBuildId }} + $Channels = $Env:PromoteToMaestroChannels -split "," + $Channels = $Channels -join "][" + $Channels = "[$Channels]" + + $IsStableBuild = $buildInfo.stable + $AzureDevOpsProject = $buildInfo.azureDevOpsProject + $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId + $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId + } + + Write-Host "##vso[task.setvariable variable=BARBuildId]$BarId" + Write-Host "##vso[task.setvariable variable=TargetChannels]$Channels" + Write-Host "##vso[task.setvariable variable=IsStableBuild]$IsStableBuild" + + Write-Host "##vso[task.setvariable variable=AzDOProjectName]$AzureDevOpsProject" + Write-Host "##vso[task.setvariable variable=AzDOPipelineId]$AzureDevOpsBuildDefinitionId" + Write-Host "##vso[task.setvariable variable=AzDOBuildId]$AzureDevOpsBuildId" + } + catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + exit 1 + } + env: + PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/src/arcade/eng/common/core-templates/steps/component-governance.yml b/src/arcade/eng/common/core-templates/steps/component-governance.yml new file mode 100644 index 00000000000..cf0649aa956 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/component-governance.yml @@ -0,0 +1,16 @@ +parameters: + disableComponentGovernance: false + componentGovernanceIgnoreDirectories: '' + is1ESPipeline: false + displayName: 'Component Detection' + +steps: +- ${{ if eq(parameters.disableComponentGovernance, 'true') }}: + - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" + displayName: Set skipComponentGovernanceDetection variable +- ${{ if ne(parameters.disableComponentGovernance, 'true') }}: + - task: ComponentGovernanceComponentDetection@0 + continueOnError: true + displayName: ${{ parameters.displayName }} + inputs: + ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} diff --git a/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml new file mode 100644 index 00000000000..6bdbf62ac50 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml @@ -0,0 +1,32 @@ +# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' +# variable with the base64-encoded SAS token, by default + +parameters: +- name: federatedServiceConnection + type: string + default: 'dotnetbuilds-internal-read' +- name: outputVariableName + type: string + default: 'dotnetbuilds-internal-container-read-token-base64' +- name: expiryInHours + type: number + default: 1 +- name: base64Encode + type: boolean + default: true +- name: is1ESPipeline + type: boolean + default: false + +steps: +- ${{ if ne(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/core-templates/steps/get-delegation-sas.yml + parameters: + federatedServiceConnection: ${{ parameters.federatedServiceConnection }} + outputVariableName: ${{ parameters.outputVariableName }} + expiryInHours: ${{ parameters.expiryInHours }} + base64Encode: ${{ parameters.base64Encode }} + storageAccount: dotnetbuilds + container: internal + permissions: rl + is1ESPipeline: ${{ parameters.is1ESPipeline }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml b/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml new file mode 100644 index 00000000000..64f881bffc3 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml @@ -0,0 +1,47 @@ +parameters: +# This is the Azure federated service connection that we log into to get an access token. +- name: nugetFederatedServiceConnection + type: string + default: 'dnceng-artifacts-feeds-read' +- name: is1ESPipeline + type: boolean + default: false +# Legacy parameters to allow for PAT usage +- name: legacyCredential + type: string + default: '' + +steps: +- ${{ if ne(variables['System.TeamProject'], 'public') }}: + - ${{ if ne(parameters.legacyCredential, '') }}: + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token + env: + Token: ${{ parameters.legacyCredential }} + # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. + # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that + # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. + - ${{ else }}: + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config + - ${{ else }}: + - template: /eng/common/templates/steps/get-federated-access-token.yml + parameters: + federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} + outputVariableName: 'dnceng-artifacts-feeds-read-access-token' + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) + # This is required in certain scenarios to install the ADO credential provider. + # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others + # (e.g. dotnet msbuild). + - task: NuGetAuthenticate@1 diff --git a/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml b/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml new file mode 100644 index 00000000000..3a4d4410c48 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml @@ -0,0 +1,42 @@ +parameters: +- name: federatedServiceConnection + type: string +- name: outputVariableName + type: string +- name: is1ESPipeline + type: boolean +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' +# Resource to get a token for. Common values include: +# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps +# - 'https://storage.azure.com/' for storage +# Defaults to Azure DevOps +- name: resource + type: string + default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false + +steps: +- task: AzureCLI@2 + displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} + inputs: + azureSubscription: ${{ parameters.federatedServiceConnection }} + scriptType: 'pscore' + scriptLocation: 'inlineScript' + inlineScript: | + $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" + exit 1 + } + Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml b/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml new file mode 100644 index 00000000000..f24ce346684 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml @@ -0,0 +1,20 @@ +parameters: +- name: is1ESPipeline + type: boolean + default: false +- name: args + type: object + default: {} +steps: +- ${{ if ne(parameters.is1ESPipeline, true) }}: + - template: /eng/common/templates/steps/publish-build-artifacts.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + ${{ each parameter in parameters.args }}: + ${{ parameter.key }}: ${{ parameter.value }} +- ${{ else }}: + - template: /eng/common/templates-official/steps/publish-build-artifacts.yml + parameters: + is1ESPipeline: ${{ parameters.is1ESPipeline }} + ${{ each parameter in parameters.args }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml new file mode 100644 index 00000000000..2efec04dc2c --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml @@ -0,0 +1,20 @@ +parameters: +- name: is1ESPipeline + type: boolean + default: false + +- name: args + type: object + default: {} + +steps: +- ${{ if ne(parameters.is1ESPipeline, true) }}: + - template: /eng/common/templates/steps/publish-pipeline-artifacts.yml + parameters: + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} +- ${{ else }}: + - template: /eng/common/templates-official/steps/publish-pipeline-artifacts.yml + parameters: + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/core-templates/steps/retain-build.yml b/src/arcade/eng/common/core-templates/steps/retain-build.yml new file mode 100644 index 00000000000..83d97a26a01 --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/retain-build.yml @@ -0,0 +1,28 @@ +parameters: + # Optional azure devops PAT with build execute permissions for the build's organization, + # only needed if the build that should be retained ran on a different organization than + # the pipeline where this template is executing from + Token: '' + # Optional BuildId to retain, defaults to the current running build + BuildId: '' + # Azure devops Organization URI for the build in the https://dev.azure.com/ format. + # Defaults to the organization the current pipeline is running on + AzdoOrgUri: '$(System.CollectionUri)' + # Azure devops project for the build. Defaults to the project the current pipeline is running on + AzdoProject: '$(System.TeamProject)' + +steps: + - task: powershell@2 + inputs: + targetType: 'filePath' + filePath: eng/common/retain-build.ps1 + pwsh: true + arguments: > + -AzdoOrgUri: ${{parameters.AzdoOrgUri}} + -AzdoProject ${{parameters.AzdoProject}} + -Token ${{coalesce(parameters.Token, '$env:SYSTEM_ACCESSTOKEN') }} + -BuildId ${{coalesce(parameters.BuildId, '$env:BUILD_ID')}} + displayName: Enable permanent build retention + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + BUILD_ID: $(Build.BuildId) \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/send-to-helix.yml b/src/arcade/eng/common/core-templates/steps/send-to-helix.yml new file mode 100644 index 00000000000..68fa739c4ab --- /dev/null +++ b/src/arcade/eng/common/core-templates/steps/send-to-helix.yml @@ -0,0 +1,93 @@ +# Please remember to update the documentation if you make changes to these parameters! +parameters: + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon-delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixProjectPath: 'eng/common/helixpublish.proj' # optional -- path to the project file to build relative to BUILD_SOURCESDIRECTORY + HelixProjectArguments: '' # optional -- arguments passed to the build command + HelixConfiguration: '' # optional -- additional property attached to a job + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects + WorkItemTimeout: '' # optional -- a timeout in TimeSpan.Parse-ready value (e.g. 00:02:00) for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + XUnitProjects: '' # optional -- semicolon-delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true + XUnitWorkItemTimeout: '' # optional -- the workitem timeout in seconds for all workitems created from the xUnit projects specified by XUnitProjects + XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects + XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner + XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set + HelixBaseUri: 'https://helix.dot.net/' # optional -- sets the Helix API base URI (allows targeting https://helix.int-dot.net ) + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + +steps: + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + displayName: ${{ parameters.DisplayNamePrefix }} (Windows) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixConfiguration: ${{ parameters.HelixConfiguration }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + WorkItemCommand: ${{ parameters.WorkItemCommand }} + WorkItemTimeout: ${{ parameters.WorkItemTimeout }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + XUnitProjects: ${{ parameters.XUnitProjects }} + XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} + XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + HelixBaseUri: ${{ parameters.HelixBaseUri }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} (Unix) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixConfiguration: ${{ parameters.HelixConfiguration }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + WorkItemCommand: ${{ parameters.WorkItemCommand }} + WorkItemTimeout: ${{ parameters.WorkItemTimeout }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + XUnitProjects: ${{ parameters.XUnitProjects }} + XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} + XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + HelixBaseUri: ${{ parameters.HelixBaseUri }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} diff --git a/src/arcade/eng/common/core-templates/variables/pool-providers.yml b/src/arcade/eng/common/core-templates/variables/pool-providers.yml new file mode 100644 index 00000000000..41053d382a2 --- /dev/null +++ b/src/arcade/eng/common/core-templates/variables/pool-providers.yml @@ -0,0 +1,8 @@ +parameters: + is1ESPipeline: false + +variables: + - ${{ if eq(parameters.is1ESPipeline, 'true') }}: + - template: /eng/common/templates-official/variables/pool-providers.yml + - ${{ else }}: + - template: /eng/common/templates/variables/pool-providers.yml \ No newline at end of file diff --git a/src/arcade/eng/common/cross/arm/tizen/tizen.patch b/src/arcade/eng/common/cross/arm/tizen/tizen.patch new file mode 100644 index 00000000000..fb12ade7250 --- /dev/null +++ b/src/arcade/eng/common/cross/arm/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/src/arcade/eng/common/cross/armel/tizen/tizen.patch b/src/arcade/eng/common/cross/armel/tizen/tizen.patch new file mode 100644 index 00000000000..ca7c7c1ff75 --- /dev/null +++ b/src/arcade/eng/common/cross/armel/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) diff --git a/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch b/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch new file mode 100644 index 00000000000..eb6d1c07470 --- /dev/null +++ b/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch @@ -0,0 +1,9 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf64-littleriscv) +-GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-riscv64-lp64d.so.1 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-riscv64-lp64d.so.1 ) ) diff --git a/src/arcade/eng/common/cross/tizen-build-rootfs.sh b/src/arcade/eng/common/cross/tizen-build-rootfs.sh new file mode 100644 index 00000000000..ba31c93285f --- /dev/null +++ b/src/arcade/eng/common/cross/tizen-build-rootfs.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -e + +ARCH=$1 +LINK_ARCH=$ARCH + +case "$ARCH" in + arm) + TIZEN_ARCH="armv7hl" + ;; + armel) + TIZEN_ARCH="armv7l" + LINK_ARCH="arm" + ;; + arm64) + TIZEN_ARCH="aarch64" + ;; + x86) + TIZEN_ARCH="i686" + ;; + x64) + TIZEN_ARCH="x86_64" + LINK_ARCH="x86" + ;; + riscv64) + TIZEN_ARCH="riscv64" + LINK_ARCH="riscv" + ;; + *) + echo "Unsupported architecture for tizen: $ARCH" + exit 1 +esac + +__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__TIZEN_CROSSDIR="$__CrossDir/${ARCH}/tizen" + +if [[ -z "$ROOTFS_DIR" ]]; then + echo "ROOTFS_DIR is not defined." + exit 1; +fi + +TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp +mkdir -p $TIZEN_TMP_DIR + +# Download files +echo ">>Start downloading files" +VERBOSE=1 $__CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR $TIZEN_ARCH +echo "<>Start constructing Tizen rootfs" +TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` +cd $ROOTFS_DIR +for f in $TIZEN_RPM_FILES; do + rpm2cpio $f | cpio -idm --quiet +done +echo "<>Start configuring Tizen rootfs" +ln -sfn asm-${LINK_ARCH} ./usr/include/asm +patch -p1 < $__TIZEN_CROSSDIR/tizen.patch +if [[ "$TIZEN_ARCH" == "riscv64" ]]; then + echo "Fixing broken symlinks in $PWD" + rm ./usr/lib64/libresolv.so + ln -s ../../lib64/libresolv.so.2 ./usr/lib64/libresolv.so + rm ./usr/lib64/libpthread.so + ln -s ../../lib64/libpthread.so.0 ./usr/lib64/libpthread.so + rm ./usr/lib64/libdl.so + ln -s ../../lib64/libdl.so.2 ./usr/lib64/libdl.so + rm ./usr/lib64/libutil.so + ln -s ../../lib64/libutil.so.1 ./usr/lib64/libutil.so + rm ./usr/lib64/libm.so + ln -s ../../lib64/libm.so.6 ./usr/lib64/libm.so + rm ./usr/lib64/librt.so + ln -s ../../lib64/librt.so.1 ./usr/lib64/librt.so + rm ./lib/ld-linux-riscv64-lp64d.so.1 + ln -s ../lib64/ld-linux-riscv64-lp64d.so.1 ./lib/ld-linux-riscv64-lp64d.so.1 +fi +echo "< 0 ]]; do + opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + --darcversion) + darcVersion=$2 + shift + ;; + --versionendpoint) + versionEndpoint=$2 + shift + ;; + --verbosity) + verbosity=$2 + shift + ;; + --toolpath) + toolpath=$2 + shift + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + + shift +done + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +if [ -z "$darcVersion" ]; then + darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain") +fi + +function InstallDarcCli { + local darc_cli_package_name="microsoft.dotnet.darc" + + InitializeDotNetCli true + local dotnet_root=$_InitializeDotNetCli + + if [ -z "$toolpath" ]; then + local tool_list=$($dotnet_root/dotnet tool list -g) + if [[ $tool_list = *$darc_cli_package_name* ]]; then + echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) + fi + else + local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath") + if [[ $tool_list = *$darc_cli_package_name* ]]; then + echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath") + fi + fi + + local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" + + echo "Installing Darc CLI version $darcVersion..." + echo "You may need to restart your command shell if this is the first dotnet tool you have installed." + if [ -z "$toolpath" ]; then + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) + else + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") + fi +} + +InstallDarcCli diff --git a/src/arcade/eng/common/dotnet-install.cmd b/src/arcade/eng/common/dotnet-install.cmd new file mode 100644 index 00000000000..b1c2642e76f --- /dev/null +++ b/src/arcade/eng/common/dotnet-install.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" \ No newline at end of file diff --git a/src/arcade/eng/common/dotnet-install.ps1 b/src/arcade/eng/common/dotnet-install.ps1 new file mode 100644 index 00000000000..811f0f717f7 --- /dev/null +++ b/src/arcade/eng/common/dotnet-install.ps1 @@ -0,0 +1,28 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = 'minimal', + [string] $architecture = '', + [string] $version = 'Latest', + [string] $runtime = 'dotnet', + [string] $RuntimeSourceFeed = '', + [string] $RuntimeSourceFeedKey = '' +) + +. $PSScriptRoot\tools.ps1 + +$dotnetRoot = Join-Path $RepoRoot '.dotnet' + +$installdir = $dotnetRoot +try { + if ($architecture -and $architecture.Trim() -eq 'x86') { + $installdir = Join-Path $installdir 'x86' + } + InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ + ExitWithExitCode 1 +} + +ExitWithExitCode 0 diff --git a/src/arcade/eng/common/dotnet-install.sh b/src/arcade/eng/common/dotnet-install.sh new file mode 100644 index 00000000000..7b9d97e3bd4 --- /dev/null +++ b/src/arcade/eng/common/dotnet-install.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +version='Latest' +architecture='' +runtime='dotnet' +runtimeSourceFeed='' +runtimeSourceFeedKey='' +while [[ $# > 0 ]]; do + opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -version|-v) + shift + version="$1" + ;; + -architecture|-a) + shift + architecture="$1" + ;; + -runtime|-r) + shift + runtime="$1" + ;; + -runtimesourcefeed) + shift + runtimeSourceFeed="$1" + ;; + -runtimesourcefeedkey) + shift + runtimeSourceFeedKey="$1" + ;; + *) + Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1" + exit 1 + ;; + esac + shift +done + +# Use uname to determine what the CPU is, see https://en.wikipedia.org/wiki/Uname#Examples +cpuname=$(uname -m) +case $cpuname in + arm64|aarch64) + buildarch=arm64 + if [ "$(getconf LONG_BIT)" -lt 64 ]; then + # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) + buildarch=arm + fi + ;; + loongarch64) + buildarch=loongarch64 + ;; + amd64|x86_64) + buildarch=x64 + ;; + armv*l) + buildarch=arm + ;; + i[3-6]86) + buildarch=x86 + ;; + riscv64) + buildarch=riscv64 + ;; + *) + echo "Unknown CPU $cpuname detected, treating it as x64" + buildarch=x64 + ;; +esac + +dotnetRoot="${repo_root}.dotnet" +if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then + dotnetRoot="$dotnetRoot/$architecture" +fi + +InstallDotNet "$dotnetRoot" $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || { + local exit_code=$? + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2 + ExitWithExitCode $exit_code +} + +ExitWithExitCode 0 diff --git a/src/arcade/eng/common/enable-cross-org-publishing.ps1 b/src/arcade/eng/common/enable-cross-org-publishing.ps1 new file mode 100644 index 00000000000..da09da4f1fc --- /dev/null +++ b/src/arcade/eng/common/enable-cross-org-publishing.ps1 @@ -0,0 +1,13 @@ +param( + [string] $token +) + + +. $PSScriptRoot\pipeline-logging-functions.ps1 + +# Write-PipelineSetVariable will no-op if a variable named $ci is not defined +# Since this script is only ever called in AzDO builds, just universally set it +$ci = $true + +Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false diff --git a/src/arcade/eng/common/generate-locproject.ps1 b/src/arcade/eng/common/generate-locproject.ps1 new file mode 100644 index 00000000000..524aaa57f2b --- /dev/null +++ b/src/arcade/eng/common/generate-locproject.ps1 @@ -0,0 +1,189 @@ +Param( + [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here + [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json + [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one + [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally +) + +# Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: +# https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop" +. $PSScriptRoot\pipeline-logging-functions.ps1 + +$exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" +$exclusions = @{ Exclusions = @() } +if (Test-Path -Path $exclusionsFilePath) +{ + $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json +} + +Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work + +# Template files +$jsonFiles = @() +$jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern +$jsonTemplateFiles | ForEach-Object { + $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json + + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" + $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru +} + +$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern + +$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them +if (-not $wxlFiles) { + $wxlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\1033\\.+\.wxl" } # pick up en files (1033 = en) specifically so we can copy them to use as the neutral xlf files + if ($wxlEnFiles) { + $wxlFiles = @() + $wxlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $wxlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } + } +} + +$macosHtmlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\.lproj\\.+\.html$" } # add installer HTML files +$macosHtmlFiles = @() +if ($macosHtmlEnFiles) { + $macosHtmlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $macosHtmlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } +} + +$xlfFiles = @() + +$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" +$langXlfFiles = @() +if ($allXlfFiles) { + $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' + $firstLangCode = $Matches.1 + $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" +} +$langXlfFiles | ForEach-Object { + $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf + + $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" + $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru +} + +$locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles + +$locJson = @{ + Projects = @( + @{ + LanguageSet = $LanguageSet + LocItems = @( + $locFiles | ForEach-Object { + $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) + { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { + Remove-Item -Path $sourceFile + } + if ($continue) + { + if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" + } + } else { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnName" + OutputPath = $outputPath + } + } + } + } + ) + }, + @{ + LanguageSet = $LanguageSet + CloneLanguageSet = "WiX_CloneLanguages" + LssFiles = @( "wxl_loc.lss" ) + LocItems = @( + $wxlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if ($continue) + { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + } + } + } + ) + }, + @{ + LanguageSet = $LanguageSet + CloneLanguageSet = "VS_macOS_CloneLanguages" + LssFiles = @( ".\eng\common\loc\P22DotNetHtmlLocalization.lss" ) + LocItems = @( + $macosHtmlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + $lciFile = $sourceFile + ".lci" + if ($continue) { + $result = @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + } + if (Test-Path $lciFile -PathType Leaf) { + $result["LciFile"] = $lciFile + } + return $result + } + } + ) + } + ) +} + +$json = ConvertTo-Json $locJson -Depth 5 +Write-Host "LocProject.json generated:`n`n$json`n`n" +Pop-Location + +if (!$UseCheckedInLocProjectJson) { + New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created + Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json +} +else { + New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created + Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json + + if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { + Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." + + exit 1 + } + else { + Write-Host "Generated LocProject.json and current LocProject.json are identical." + } +} diff --git a/src/arcade/eng/common/generate-sbom-prep.ps1 b/src/arcade/eng/common/generate-sbom-prep.ps1 new file mode 100644 index 00000000000..a0c7d792a76 --- /dev/null +++ b/src/arcade/eng/common/generate-sbom-prep.ps1 @@ -0,0 +1,29 @@ +Param( + [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed +) + +. $PSScriptRoot\pipeline-logging-functions.ps1 + +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" +$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' +$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName + +Write-Host "Artifact name before : $ArtifactName" +Write-Host "Artifact name after : $SafeArtifactName" + +Write-Host "Creating dir $ManifestDirPath" + +# create directory for sbom manifest to be placed +if (!(Test-Path -path $SbomGenerationDir)) +{ + New-Item -ItemType Directory -path $SbomGenerationDir + Write-Host "Successfully created directory $SbomGenerationDir" +} +else{ + Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." +} + +Write-Host "Updating artifact name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/src/arcade/eng/common/generate-sbom-prep.sh b/src/arcade/eng/common/generate-sbom-prep.sh new file mode 100644 index 00000000000..b8ecca72bbf --- /dev/null +++ b/src/arcade/eng/common/generate-sbom-prep.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +. $scriptroot/pipeline-logging-functions.sh + + +# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. +artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" +safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" +manifest_dir=$1 + +# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly +# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. +sbom_generation_dir="$manifest_dir/$safe_artifact_name" + +if [ ! -d "$sbom_generation_dir" ] ; then + mkdir -p "$sbom_generation_dir" + echo "Sbom directory created." $sbom_generation_dir +else + Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." +fi + +echo "Artifact name before : "$artifact_name +echo "Artifact name after : "$safe_artifact_name +export ARTIFACT_NAME=$safe_artifact_name +echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" + +exit 0 diff --git a/src/arcade/eng/common/helixpublish.proj b/src/arcade/eng/common/helixpublish.proj new file mode 100644 index 00000000000..c1323bf4121 --- /dev/null +++ b/src/arcade/eng/common/helixpublish.proj @@ -0,0 +1,27 @@ + + + + + msbuild + + + + + %(Identity) + + + + + + $(WorkItemDirectory) + $(WorkItemCommand) + $(WorkItemTimeout) + + + + + + + + + diff --git a/src/arcade/eng/common/init-tools-native.ps1 b/src/arcade/eng/common/init-tools-native.ps1 new file mode 100644 index 00000000000..27ccdb9ecc9 --- /dev/null +++ b/src/arcade/eng/common/init-tools-native.ps1 @@ -0,0 +1,203 @@ +<# +.SYNOPSIS +Entry point script for installing native tools + +.DESCRIPTION +Reads $RepoRoot\global.json file to determine native assets to install +and executes installers for those tools + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER InstallDirectory +Directory to install native toolset. This is a command-line override for the default +Install directory precedence order: +- InstallDirectory command-line override +- NETCOREENG_INSTALL_DIRECTORY environment variable +- (default) %USERPROFILE%/.netcoreeng/native + +.PARAMETER Clean +Switch specifying to not install anything, but cleanup native asset folders + +.PARAMETER Force +Clean and then install tools + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.PARAMETER GlobalJsonFile +File path to global.json file + +.PARAMETER PathPromotion +Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines) +or break the build if a native tool is not found on the path (on a local dev machine) + +.NOTES +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external', + [string] $InstallDirectory, + [switch] $Clean = $False, + [switch] $Force = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30, + [string] $GlobalJsonFile, + [switch] $PathPromotion +) + +if (!$GlobalJsonFile) { + $GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json' +} + +Set-StrictMode -version 2.0 +$ErrorActionPreference='Stop' + +. $PSScriptRoot\pipeline-logging-functions.ps1 +Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq 'Continue' + + $EngCommonBaseDir = Join-Path $PSScriptRoot 'native\' + $NativeBaseDir = $InstallDirectory + if (!$NativeBaseDir) { + $NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory + } + $Env:CommonLibrary_NativeInstallDir = $NativeBaseDir + $InstallBin = Join-Path $NativeBaseDir 'bin' + $InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1' + + # Process tools list + Write-Host "Processing $GlobalJsonFile" + If (-Not (Test-Path $GlobalJsonFile)) { + Write-Host "Unable to find '$GlobalJsonFile'" + exit 0 + } + $NativeTools = Get-Content($GlobalJsonFile) -Raw | + ConvertFrom-Json | + Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue + if ($NativeTools) { + if ($PathPromotion -eq $True) { + $ArcadeToolsDirectory = "$env:SYSTEMDRIVE\arcade-tools" + if (Test-Path $ArcadeToolsDirectory) { # if this directory exists, we should use native tools on machine + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $InstalledTools = @{} + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + if ($ToolVersion -eq "latest") { + $ToolVersion = "" + } + $ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending) + if ($ToolDirectories -eq $null) { + Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." + exit 1 + } + $ToolDirectory = $ToolDirectories[0] + $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" + if (-not (Test-Path -Path "$BinPathFile")) { + Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." + exit 1 + } + $BinPath = Get-Content "$BinPathFile" + $ToolPath = Convert-Path -Path $BinPath + Write-Host "Adding $ToolName to the path ($ToolPath)..." + Write-Host "##vso[task.prependpath]$ToolPath" + $env:PATH = "$ToolPath;$env:PATH" + $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } + } + } + return $InstalledTools + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + + if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding." + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "If this is running on a build machine, the arcade-tools directory was not found, which means there's an error with the image." + } + } + exit 0 + } + } else { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $LocalInstallerArguments = @{ ToolName = "$ToolName" } + $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } + $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } + $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } + $LocalInstallerArguments += @{ Version = "$ToolVersion" } + + if ($Verbose) { + $LocalInstallerArguments += @{ Verbose = $True } + } + if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { + if($Force) { + $LocalInstallerArguments += @{ Force = $True } + } + } + if ($Clean) { + $LocalInstallerArguments += @{ Clean = $True } + } + + Write-Verbose "Installing $ToolName version $ToolVersion" + Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" + & $InstallerPath @LocalInstallerArguments + if ($LASTEXITCODE -Ne "0") { + $errMsg = "$ToolName installation failed" + if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { + $showNativeToolsWarning = $true + if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { + $showNativeToolsWarning = $false + } + if ($showNativeToolsWarning) { + Write-Warning $errMsg + } + $toolInstallationFailure = $true + } else { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host $errMsg + exit 1 + } + } + } + + if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { + # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 + Write-Host 'Native tools bootstrap failed' + exit 1 + } + } + } + else { + Write-Host 'No native tools defined in global.json' + exit 0 + } + + if ($Clean) { + exit 0 + } + if (Test-Path $InstallBin) { + Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin) + Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" + return $InstallBin + } + elseif (-not ($PathPromotion)) { + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed' + exit 1 + } + exit 0 +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/init-tools-native.sh b/src/arcade/eng/common/init-tools-native.sh new file mode 100644 index 00000000000..3e6a8d6acf2 --- /dev/null +++ b/src/arcade/eng/common/init-tools-native.sh @@ -0,0 +1,238 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external' +install_directory='' +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 +global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json" +declare -a native_assets + +. $scriptroot/pipeline-logging-functions.sh +. $scriptroot/native/common-library.sh + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installdirectory) + install_directory=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --donotabortonfailure) + donotabortonfailure=true + shift 1 + ;; + --donotdisplaywarnings) + donotdisplaywarnings=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --installdirectory Directory to install native toolset." + echo " This is a command-line override for the default" + echo " Install directory precedence order:" + echo " - InstallDirectory command-line override" + echo " - NETCOREENG_INSTALL_DIRECTORY environment variable" + echo " - (default) %USERPROFILE%/.netcoreeng/native" + echo "" + echo " --clean Switch specifying not to install anything, but cleanup native asset folders" + echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" + echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" + echo " --force Clean and then install tools" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --baseuri Base URI for where to download native tools from" + echo " --downloadretries Number of times a download should be attempted" + echo " --retrywaittimeseconds Wait time between download attempts" + echo "" + exit 0 + ;; + esac +done + +function ReadGlobalJsonNativeTools { + # happy path: we have a proper JSON parsing tool `jq(1)` in PATH! + if command -v jq &> /dev/null; then + + # jq: read each key/value pair under "native-tools" entry and emit: + # KEY="" VALUE="" + # followed by a null byte. + # + # bash: read line with null byte delimeter and push to array (for later `eval`uation). + + while IFS= read -rd '' line; do + native_assets+=("$line") + done < <(jq -r '. | + select(has("native-tools")) | + ."native-tools" | + keys[] as $k | + @sh "KEY=\($k) VALUE=\(.[$k])\u0000"' "$global_json_file") + + return + fi + + # Warning: falling back to manually parsing JSON, which is not recommended. + + # Following routine matches the output and escaping logic of jq(1)'s @sh formatter used above. + # It has been tested with several weird strings with escaped characters in entries (key and value) + # and results were compared with the output of jq(1) in binary representation using xxd(1); + # just before the assignment to 'native_assets' array (above and below). + + # try to capture the section under "native-tools". + if [[ ! "$(cat "$global_json_file")" =~ \"native-tools\"[[:space:]\:\{]*([^\}]+) ]]; then + return + fi + + section="${BASH_REMATCH[1]}" + + parseStarted=0 + possibleEnd=0 + escaping=0 + escaped=0 + isKey=1 + + for (( i=0; i<${#section}; i++ )); do + char="${section:$i:1}" + if ! ((parseStarted)) && [[ "$char" =~ [[:space:],:] ]]; then continue; fi + + if ! ((escaping)) && [[ "$char" == "\\" ]]; then + escaping=1 + elif ((escaping)) && ! ((escaped)); then + escaped=1 + fi + + if ! ((parseStarted)) && [[ "$char" == "\"" ]]; then + parseStarted=1 + possibleEnd=0 + elif [[ "$char" == "'" ]]; then + token="$token'\\\''" + possibleEnd=0 + elif ((escaping)) || [[ "$char" != "\"" ]]; then + token="$token$char" + possibleEnd=1 + fi + + if ((possibleEnd)) && ! ((escaping)) && [[ "$char" == "\"" ]]; then + # Use printf to unescape token to match jq(1)'s @sh formatting rules. + # do not use 'token="$(printf "$token")"' syntax, as $() eats the trailing linefeed. + printf -v token "'$token'" + + if ((isKey)); then + KEY="$token" + isKey=0 + else + line="KEY=$KEY VALUE=$token" + native_assets+=("$line") + isKey=1 + fi + + # reset for next token + parseStarted=0 + token= + elif ((escaping)) && ((escaped)); then + escaping=0 + escaped=0 + fi + done +} + +native_base_dir=$install_directory +if [[ -z $install_directory ]]; then + native_base_dir=$(GetNativeInstallDirectory) +fi + +install_bin="${native_base_dir}/bin" +installed_any=false + +ReadGlobalJsonNativeTools + +if [[ ${#native_assets[@]} -eq 0 ]]; then + echo "No native tools defined in global.json" + exit 0; +else + native_installer_dir="$scriptroot/native" + for index in "${!native_assets[@]}"; do + eval "${native_assets["$index"]}" + + installer_path="$native_installer_dir/install-$KEY.sh" + installer_command="$installer_path" + installer_command+=" --baseuri $base_uri" + installer_command+=" --installpath $install_bin" + installer_command+=" --version $VALUE" + echo $installer_command + + if [[ $force = true ]]; then + installer_command+=" --force" + fi + + if [[ $clean = true ]]; then + installer_command+=" --clean" + fi + + if [[ -a $installer_path ]]; then + $installer_command + if [[ $? != 0 ]]; then + if [[ $donotabortonfailure = true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" + exit 1 + fi + else + $installed_any = true + fi + else + if [[ $donotabortonfailure == true ]]; then + if [[ $donotdisplaywarnings != true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + fi + else + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" + exit 1 + fi + fi + done +fi + +if [[ $clean = true ]]; then + exit 0 +fi + +if [[ -d $install_bin ]]; then + echo "Native tools are available from $install_bin" + echo "##vso[task.prependpath]$install_bin" +else + if [[ $installed_any = true ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" + exit 1 + fi +fi + +exit 0 diff --git a/src/arcade/eng/common/internal-feed-operations.ps1 b/src/arcade/eng/common/internal-feed-operations.ps1 new file mode 100644 index 00000000000..92b77347d99 --- /dev/null +++ b/src/arcade/eng/common/internal-feed-operations.ps1 @@ -0,0 +1,132 @@ +param( + [Parameter(Mandatory=$true)][string] $Operation, + [string] $AuthToken, + [string] $CommitSha, + [string] $RepoName, + [switch] $IsFeedPrivate +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +. $PSScriptRoot\tools.ps1 + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified +# internal builds +function SetupCredProvider { + param( + [string] $AuthToken + ) + + # Install the Cred Provider NuGet plugin + Write-Host 'Setting up Cred Provider NuGet plugin in the agent...' + Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + $url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1' + + Write-Host "Writing the contents of 'installcredprovider.ps1' locally..." + Invoke-WebRequest $url -OutFile installcredprovider.ps1 + + Write-Host 'Installing plugin...' + .\installcredprovider.ps1 -Force + + Write-Host "Deleting local copy of 'installcredprovider.ps1'..." + Remove-Item .\installcredprovider.ps1 + + if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) { + Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!' + ExitWithExitCode 1 + } + else { + Write-Host 'CredProvider plugin was installed correctly!' + } + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + $nugetConfigPath = Join-Path $RepoRoot "NuGet.config" + + if (-Not (Test-Path -Path $nugetConfigPath)) { + Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!' + ExitWithExitCode 1 + } + + $endpoints = New-Object System.Collections.ArrayList + $nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value} + + if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) { + foreach ($stableRestoreResource in $nugetConfigPackageSources) { + $trimmedResource = ([string]$stableRestoreResource).Trim() + [void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"}) + } + } + + if (($endpoints | Measure-Object).Count -gt 0) { + $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress + + # Create the environment variables the AzDo way + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{ + 'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' + 'issecret' = 'false' + } + + # We don't want sessions cached since we will be updating the endpoints quite frequently + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{ + 'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' + 'issecret' = 'false' + } + } + else + { + Write-Host 'No internal endpoints found in NuGet.config' + } +} + +#Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + $dotnetTempDir = Join-Path $RepoRoot "dotnet" + $dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + $dotnet = "$dotnetTempDir\dotnet.exe" + $restoreProjPath = "$PSScriptRoot\restore.proj" + + Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + '' | Out-File "$restoreProjPath" + + & $dotnet restore $restoreProjPath + + Write-Host 'Arcade SDK restored!' + + if (Test-Path -Path $restoreProjPath) { + Remove-Item $restoreProjPath + } + + if (Test-Path -Path $dotnetTempDir) { + Remove-Item $dotnetTempDir -Recurse + } +} + +try { + Push-Location $PSScriptRoot + + if ($Operation -like 'setup') { + SetupCredProvider $AuthToken + } + elseif ($Operation -like 'install-restore') { + InstallDotNetSdkAndRestoreArcade + } + else { + Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!" + ExitWithExitCode 1 + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'Arcade' -Message $_ + ExitWithExitCode 1 +} +finally { + Pop-Location +} diff --git a/src/arcade/eng/common/internal-feed-operations.sh b/src/arcade/eng/common/internal-feed-operations.sh new file mode 100644 index 00000000000..9378223ba09 --- /dev/null +++ b/src/arcade/eng/common/internal-feed-operations.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash + +set -e + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. +# This should ONLY be called from identified internal builds +function SetupCredProvider { + local authToken=$1 + + # Install the Cred Provider NuGet plugin + echo "Setting up Cred Provider NuGet plugin in the agent..."... + echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" + + echo "Writing the contents of 'installcredprovider.ps1' locally..." + local installcredproviderPath="installcredprovider.sh" + if command -v curl > /dev/null; then + curl $url > "$installcredproviderPath" + else + wget -q -O "$installcredproviderPath" "$url" + fi + + echo "Installing plugin..." + . "$installcredproviderPath" + + echo "Deleting local copy of 'installcredprovider.sh'..." + rm installcredprovider.sh + + if [ ! -d "$HOME/.nuget/plugins" ]; then + Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!' + ExitWithExitCode 1 + else + echo "CredProvider plugin was installed correctly!" + fi + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + local nugetConfigPath="{$repo_root}NuGet.config" + + if [ ! "$nugetConfigPath" ]; then + Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!" + ExitWithExitCode 1 + fi + + local endpoints='[' + local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"` + local pattern="value=\"(.*)\"" + + for value in $nugetConfigPackageValues + do + if [[ $value =~ $pattern ]]; then + local endpoint="${BASH_REMATCH[1]}" + endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"}," + fi + done + + endpoints=${endpoints%?} + endpoints+=']' + + if [ ${#endpoints} -gt 2 ]; then + local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" + + echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials" + echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False" + else + echo "No internal endpoints found in NuGet.config" + fi +} + +# Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + local dotnetTempDir="$repo_root/dotnet" + local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + local restoreProjPath="$repo_root/eng/common/restore.proj" + + echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + echo "" > "$restoreProjPath" + + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + local res=`$dotnetTempDir/dotnet restore $restoreProjPath` + echo "Arcade SDK restored!" + + # Cleanup + if [ "$restoreProjPath" ]; then + rm "$restoreProjPath" + fi + + if [ "$dotnetTempDir" ]; then + rm -r $dotnetTempDir + fi +} + +source="${BASH_SOURCE[0]}" +operation='' +authToken='' +repoName='' + +while [[ $# > 0 ]]; do + opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + --operation) + operation=$2 + shift + ;; + --authtoken) + authToken=$2 + shift + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + + shift +done + +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +if [ "$operation" = "setup" ]; then + SetupCredProvider $authToken +elif [ "$operation" = "install-restore" ]; then + InstallDotNetSdkAndRestoreArcade +else + echo "Unknown operation '$operation'!" +fi diff --git a/src/arcade/eng/common/internal/Directory.Build.props b/src/arcade/eng/common/internal/Directory.Build.props new file mode 100644 index 00000000000..f1d041c33da --- /dev/null +++ b/src/arcade/eng/common/internal/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + false + false + + + + + diff --git a/src/arcade/eng/common/internal/NuGet.config b/src/arcade/eng/common/internal/NuGet.config new file mode 100644 index 00000000000..19d3d311b16 --- /dev/null +++ b/src/arcade/eng/common/internal/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/arcade/eng/common/internal/Tools.csproj b/src/arcade/eng/common/internal/Tools.csproj new file mode 100644 index 00000000000..feaa6d20812 --- /dev/null +++ b/src/arcade/eng/common/internal/Tools.csproj @@ -0,0 +1,22 @@ + + + + + net472 + false + false + + + + + + + + + + + + + + + diff --git a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss new file mode 100644 index 00000000000..5d892d61939 --- /dev/null +++ b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.ps1 b/src/arcade/eng/common/msbuild.ps1 new file mode 100644 index 00000000000..f041e5ddd95 --- /dev/null +++ b/src/arcade/eng/common/msbuild.ps1 @@ -0,0 +1,28 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = 'minimal', + [bool] $warnAsError = $true, + [bool] $nodeReuse = $true, + [switch] $ci, + [switch] $prepareMachine, + [switch] $excludePrereleaseVS, + [string] $msbuildEngine = $null, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs +) + +. $PSScriptRoot\tools.ps1 + +try { + if ($ci) { + $nodeReuse = $false + } + + MSBuild @extraArgs +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'Build' -Message $_ + ExitWithExitCode 1 +} + +ExitWithExitCode 0 \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.sh b/src/arcade/eng/common/msbuild.sh new file mode 100644 index 00000000000..20d3dad5435 --- /dev/null +++ b/src/arcade/eng/common/msbuild.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +verbosity='minimal' +warn_as_error=true +node_reuse=true +prepare_machine=false +extra_args='' + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --verbosity) + verbosity=$2 + shift 2 + ;; + --warnaserror) + warn_as_error=$2 + shift 2 + ;; + --nodereuse) + node_reuse=$2 + shift 2 + ;; + --ci) + ci=true + shift 1 + ;; + --preparemachine) + prepare_machine=true + shift 1 + ;; + *) + extra_args="$extra_args $1" + shift 1 + ;; + esac +done + +. "$scriptroot/tools.sh" + +if [[ "$ci" == true ]]; then + node_reuse=false +fi + +MSBuild $extra_args +ExitWithExitCode 0 diff --git a/src/arcade/eng/common/native/CommonLibrary.psm1 b/src/arcade/eng/common/native/CommonLibrary.psm1 new file mode 100644 index 00000000000..f71f6af6cdb --- /dev/null +++ b/src/arcade/eng/common/native/CommonLibrary.psm1 @@ -0,0 +1,401 @@ +<# +.SYNOPSIS +Helper module to install an archive to a directory + +.DESCRIPTION +Helper module to download and extract an archive to a specified directory + +.PARAMETER Uri +Uri of artifact to download + +.PARAMETER InstallDirectory +Directory to extract artifact contents to + +.PARAMETER Force +Force download / extraction if file or contents already exist. Default = False + +.PARAMETER DownloadRetries +Total number of retry attempts. Default = 5 + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds. Default = 30 + +.NOTES +Returns False if download or extraction fail, True otherwise +#> +function DownloadAndExtract { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Uri, + [Parameter(Mandatory=$True)] + [string] $InstallDirectory, + [switch] $Force = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30 + ) + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri + + # Download native tool + $DownloadStatus = CommonLibrary\Get-File -Uri $Uri ` + -Path $TempToolPath ` + -DownloadRetries $DownloadRetries ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Force:$Force ` + -Verbose:$Verbose + + if ($DownloadStatus -Eq $False) { + Write-Error "Download failed from $Uri" + return $False + } + + # Extract native tool + $UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` + -OutputDirectory $InstallDirectory ` + -Force:$Force ` + -Verbose:$Verbose + + if ($UnzipStatus -Eq $False) { + # Retry Download one more time with Force=true + $DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri ` + -Path $TempToolPath ` + -DownloadRetries 1 ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Force:$True ` + -Verbose:$Verbose + + if ($DownloadRetryStatus -Eq $False) { + Write-Error "Last attempt of download failed as well" + return $False + } + + # Retry unzip again one more time with Force=true + $UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` + -OutputDirectory $InstallDirectory ` + -Force:$True ` + -Verbose:$Verbose + if ($UnzipRetryStatus -Eq $False) + { + Write-Error "Last attempt of unzip failed as well" + # Clean up partial zips and extracts + if (Test-Path $TempToolPath) { + Remove-Item $TempToolPath -Force + } + if (Test-Path $InstallDirectory) { + Remove-Item $InstallDirectory -Force -Recurse + } + return $False + } + } + + return $True +} + +<# +.SYNOPSIS +Download a file, retry on failure + +.DESCRIPTION +Download specified file and retry if attempt fails + +.PARAMETER Uri +Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded + +.PARAMETER Path +Path to download or copy uri file to + +.PARAMETER Force +Overwrite existing file if present. Default = False + +.PARAMETER DownloadRetries +Total number of retry attempts. Default = 5 + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds Default = 30 + +#> +function Get-File { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Uri, + [Parameter(Mandatory=$True)] + [string] $Path, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30, + [switch] $Force = $False + ) + $Attempt = 0 + + if ($Force) { + if (Test-Path $Path) { + Remove-Item $Path -Force + } + } + if (Test-Path $Path) { + Write-Host "File '$Path' already exists, skipping download" + return $True + } + + $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent + if (-Not (Test-Path $DownloadDirectory)) { + New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null + } + + $TempPath = "$Path.tmp" + if (Test-Path -IsValid -Path $Uri) { + Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" + Copy-Item -Path $Uri -Destination $TempPath + Write-Verbose "Moving temporary file to '$Path'" + Move-Item -Path $TempPath -Destination $Path + return $? + } + else { + Write-Verbose "Downloading $Uri" + # Don't display the console progress UI - it's a huge perf hit + $ProgressPreference = 'SilentlyContinue' + while($Attempt -Lt $DownloadRetries) + { + try { + Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath + Write-Verbose "Downloaded to temporary location '$TempPath'" + Move-Item -Path $TempPath -Destination $Path + Write-Verbose "Moved temporary file to '$Path'" + return $True + } + catch { + $Attempt++ + if ($Attempt -Lt $DownloadRetries) { + $AttemptsLeft = $DownloadRetries - $Attempt + Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" + Start-Sleep -Seconds $RetryWaitTimeInSeconds + } + else { + Write-Error $_ + Write-Error $_.Exception + } + } + } + } + + return $False +} + +<# +.SYNOPSIS +Generate a shim for a native tool + +.DESCRIPTION +Creates a wrapper script (shim) that passes arguments forward to native tool assembly + +.PARAMETER ShimName +The name of the shim + +.PARAMETER ShimDirectory +The directory where shims are stored + +.PARAMETER ToolFilePath +Path to file that shim forwards to + +.PARAMETER Force +Replace shim if already present. Default = False + +.NOTES +Returns $True if generating shim succeeds, $False otherwise +#> +function New-ScriptShim { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $ShimName, + [Parameter(Mandatory=$True)] + [string] $ShimDirectory, + [Parameter(Mandatory=$True)] + [string] $ToolFilePath, + [Parameter(Mandatory=$True)] + [string] $BaseUri, + [switch] $Force + ) + try { + Write-Verbose "Generating '$ShimName' shim" + + if (-Not (Test-Path $ToolFilePath)){ + Write-Error "Specified tool file path '$ToolFilePath' does not exist" + return $False + } + + # WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs + # Many of the checks for installed programs expect a .exe extension for Windows tools, rather + # than a .bat or .cmd file. + # Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer + if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) { + $InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" ` + -InstallDirectory $ShimDirectory\WinShimmer ` + -Force:$Force ` + -DownloadRetries 2 ` + -RetryWaitTimeInSeconds 5 ` + -Verbose:$Verbose + } + + if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) { + Write-Host "$ShimName.exe already exists; replacing..." + Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") + } + + & "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory + return $True + } + catch { + Write-Host $_ + Write-Host $_.Exception + return $False + } +} + +<# +.SYNOPSIS +Returns the machine architecture of the host machine + +.NOTES +Returns 'x64' on 64 bit machines + Returns 'x86' on 32 bit machines +#> +function Get-MachineArchitecture { + $ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE + $ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432 + if($ProcessorArchitecture -Eq "X86") + { + if(($ProcessorArchitectureW6432 -Eq "") -Or + ($ProcessorArchitectureW6432 -Eq "X86")) { + return "x86" + } + $ProcessorArchitecture = $ProcessorArchitectureW6432 + } + if (($ProcessorArchitecture -Eq "AMD64") -Or + ($ProcessorArchitecture -Eq "IA64") -Or + ($ProcessorArchitecture -Eq "ARM64") -Or + ($ProcessorArchitecture -Eq "LOONGARCH64") -Or + ($ProcessorArchitecture -Eq "RISCV64")) { + return "x64" + } + return "x86" +} + +<# +.SYNOPSIS +Get the name of a temporary folder under the native install directory +#> +function Get-TempDirectory { + return Join-Path (Get-NativeInstallDirectory) "temp/" +} + +function Get-TempPathFilename { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Path + ) + $TempDir = CommonLibrary\Get-TempDirectory + $TempFilename = Split-Path $Path -leaf + $TempPath = Join-Path $TempDir $TempFilename + return $TempPath +} + +<# +.SYNOPSIS +Returns the base directory to use for native tool installation + +.NOTES +Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable +is set, or otherwise returns an install directory under the %USERPROFILE% +#> +function Get-NativeInstallDirectory { + $InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY + if (!$InstallDir) { + $InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/" + } + return $InstallDir +} + +<# +.SYNOPSIS +Unzip an archive + +.DESCRIPTION +Powershell module to unzip an archive to a specified directory + +.PARAMETER ZipPath (Required) +Path to archive to unzip + +.PARAMETER OutputDirectory (Required) +Output directory for archive contents + +.PARAMETER Force +Overwrite output directory contents if they already exist + +.NOTES +- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. +- Returns True if unzip operation is successful +- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory +- Returns False if unable to extract zip archive +#> +function Expand-Zip { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $ZipPath, + [Parameter(Mandatory=$True)] + [string] $OutputDirectory, + [switch] $Force + ) + + Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'" + try { + if ((Test-Path $OutputDirectory) -And (-Not $Force)) { + Write-Host "Directory '$OutputDirectory' already exists, skipping extract" + return $True + } + if (Test-Path $OutputDirectory) { + Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory" + Remove-Item $OutputDirectory -Force -Recurse + if ($? -Eq $False) { + Write-Error "Unable to remove '$OutputDirectory'" + return $False + } + } + + $TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" + if (Test-Path $TempOutputDirectory) { + Remove-Item $TempOutputDirectory -Force -Recurse + } + New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null + + Add-Type -assembly "system.io.compression.filesystem" + [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") + if ($? -Eq $False) { + Write-Error "Unable to extract '$ZipPath'" + return $False + } + + Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory + } + catch { + Write-Host $_ + Write-Host $_.Exception + + return $False + } + return $True +} + +export-modulemember -function DownloadAndExtract +export-modulemember -function Expand-Zip +export-modulemember -function Get-File +export-modulemember -function Get-MachineArchitecture +export-modulemember -function Get-NativeInstallDirectory +export-modulemember -function Get-TempDirectory +export-modulemember -function Get-TempPathFilename +export-modulemember -function New-ScriptShim diff --git a/src/arcade/eng/common/native/common-library.sh b/src/arcade/eng/common/native/common-library.sh new file mode 100644 index 00000000000..080c2c283ae --- /dev/null +++ b/src/arcade/eng/common/native/common-library.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash + +function GetNativeInstallDirectory { + local install_dir + + if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then + install_dir=$HOME/.netcoreeng/native/ + else + install_dir=$NETCOREENG_INSTALL_DIRECTORY + fi + + echo $install_dir + return 0 +} + +function GetTempDirectory { + + echo $(GetNativeInstallDirectory)temp/ + return 0 +} + +function ExpandZip { + local zip_path=$1 + local output_directory=$2 + local force=${3:-false} + + echo "Extracting $zip_path to $output_directory" + if [[ -d $output_directory ]] && [[ $force = false ]]; then + echo "Directory '$output_directory' already exists, skipping extract" + return 0 + fi + + if [[ -d $output_directory ]]; then + echo "'Force flag enabled, but '$output_directory' exists. Removing directory" + rm -rf $output_directory + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'" + return 1 + fi + fi + + echo "Creating directory: '$output_directory'" + mkdir -p $output_directory + + echo "Extracting archive" + tar -xf $zip_path -C $output_directory + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'" + return 1 + fi + + return 0 +} + +function GetCurrentOS { + local unameOut="$(uname -s)" + case $unameOut in + Linux*) echo "Linux";; + Darwin*) echo "MacOS";; + esac + return 0 +} + +function GetFile { + local uri=$1 + local path=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + if [[ -f $path ]]; then + if [[ $force = false ]]; then + echo "File '$path' already exists. Skipping download" + return 0 + else + rm -rf $path + fi + fi + + if [[ -f $uri ]]; then + echo "'$uri' is a file path, copying file to '$path'" + cp $uri $path + return $? + fi + + echo "Downloading $uri" + # Use curl if available, otherwise use wget + if command -v curl > /dev/null; then + curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail + else + wget -q -O "$path" "$uri" --tries="$download_retries" + fi + + return $? +} + +function GetTempPathFileName { + local path=$1 + + local temp_dir=$(GetTempDirectory) + local temp_file_name=$(basename $path) + echo $temp_dir$temp_file_name + return 0 +} + +function DownloadAndExtract { + local uri=$1 + local installDir=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + local temp_tool_path=$(GetTempPathFileName $uri) + + echo "downloading to: $temp_tool_path" + + # Download file + GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'." + return 1 + fi + + # Extract File + echo "extracting from $temp_tool_path to $installDir" + ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'." + return 1 + fi + + return 0 +} + +function NewScriptShim { + local shimpath=$1 + local tool_file_path=$2 + local force=${3:-false} + + echo "Generating '$shimpath' shim" + if [[ -f $shimpath ]]; then + if [[ $force = false ]]; then + echo "File '$shimpath' already exists." >&2 + return 1 + else + rm -rf $shimpath + fi + fi + + if [[ ! -f $tool_file_path ]]; then + # try to see if the path is lower cased + tool_file_path="$(echo $tool_file_path | tr "[:upper:]" "[:lower:]")" + if [[ ! -f $tool_file_path ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist" + return 1 + fi + fi + + local shim_contents=$'#!/usr/bin/env bash\n' + shim_contents+="SHIMARGS="$'$1\n' + shim_contents+="$tool_file_path"$' $SHIMARGS\n' + + # Write shim file + echo "$shim_contents" > $shimpath + + chmod +x $shimpath + + echo "Finished generating shim '$shimpath'" + + return $? +} + diff --git a/src/arcade/eng/common/native/init-compiler.sh b/src/arcade/eng/common/native/init-compiler.sh new file mode 100644 index 00000000000..9a0e1f2b456 --- /dev/null +++ b/src/arcade/eng/common/native/init-compiler.sh @@ -0,0 +1,146 @@ +#!/bin/sh +# +# This file detects the C/C++ compiler and exports it to the CC/CXX environment variables +# +# NOTE: some scripts source this file and rely on stdout being empty, make sure +# to not output *anything* here, unless it is an error message that fails the +# build. + +if [ -z "$build_arch" ] || [ -z "$compiler" ]; then + echo "Usage..." + echo "build_arch= compiler= init-compiler.sh" + echo "Specify the target architecture." + echo "Specify the name of compiler (clang or gcc)." + exit 1 +fi + +case "$compiler" in + clang*|-clang*|--clang*) + # clangx.y or clang-x.y + version="$(echo "$compiler" | tr -d '[:alpha:]-=')" + majorVersion="${version%%.*}" + + # LLVM based on v18 released in early 2024, with two releases per year + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))" + compiler=clang + ;; + + gcc*|-gcc*|--gcc*) + # gccx.y or gcc-x.y + version="$(echo "$compiler" | tr -d '[:alpha:]-=')" + majorVersion="${version%%.*}" + + # GCC based on v14 released in early 2024, with one release per year + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))" + compiler=gcc + ;; +esac + +cxxCompiler="$compiler++" + +# clear the existing CC and CXX from environment +CC= +CXX= +LDFLAGS= + +if [ "$compiler" = "gcc" ]; then cxxCompiler="g++"; fi + +check_version_exists() { + desired_version=-1 + + # Set up the environment to be used for building with the desired compiler. + if command -v "$compiler-$1" > /dev/null; then + desired_version="-$1" + elif command -v "$compiler$1" > /dev/null; then + desired_version="$1" + fi + + echo "$desired_version" +} + +__baseOS="$(uname)" +set_compiler_version_from_CC() { + if [ "$__baseOS" = "Darwin" ]; then + # On Darwin, the versions from -version/-dumpversion refer to Xcode + # versions, not llvm versions, so we can't rely on them. + return + fi + + version="$("$CC" -dumpversion)" + if [ -z "$version" ]; then + echo "Error: $CC -dumpversion didn't provide a version" + exit 1 + fi + + # gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments. + IFS=. read -r majorVersion _ < /dev/null; then + echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables." + exit 1 + fi + + CC="$(command -v "$compiler" 2> /dev/null)" + CXX="$(command -v "$cxxCompiler" 2> /dev/null)" + set_compiler_version_from_CC + fi + else + desired_version="$(check_version_exists "$majorVersion")" + if [ "$desired_version" = "-1" ]; then + echo "Error: Could not find specific version of $compiler: $majorVersion." + exit 1 + fi + fi + + if [ -z "$CC" ]; then + CC="$(command -v "$compiler$desired_version" 2> /dev/null)" + CXX="$(command -v "$cxxCompiler$desired_version" 2> /dev/null)" + if [ -z "$CXX" ]; then CXX="$(command -v "$cxxCompiler" 2> /dev/null)"; fi + set_compiler_version_from_CC + fi +else + if [ ! -f "$CLR_CC" ]; then + echo "Error: CLR_CC is set but path '$CLR_CC' does not exist" + exit 1 + fi + CC="$CLR_CC" + CXX="$CLR_CXX" + set_compiler_version_from_CC +fi + +if [ -z "$CC" ]; then + echo "Error: Unable to find $compiler." + exit 1 +fi + +if [ "$__baseOS" != "Darwin" ]; then + # On Darwin, we always want to use the Apple linker. + + # Only lld version >= 9 can be considered stable. lld supports s390x starting from 18.0. + if [ "$compiler" = "clang" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -ge 9 ] && { [ "$build_arch" != "s390x" ] || [ "$majorVersion" -ge 18 ]; }; then + if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then + LDFLAGS="-fuse-ld=lld" + fi + fi +fi + +SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version" 2> /dev/null)" + +export CC CXX LDFLAGS SCAN_BUILD_COMMAND diff --git a/src/arcade/eng/common/native/init-distro-rid.sh b/src/arcade/eng/common/native/init-distro-rid.sh new file mode 100644 index 00000000000..83ea7aab0e0 --- /dev/null +++ b/src/arcade/eng/common/native/init-distro-rid.sh @@ -0,0 +1,110 @@ +#!/bin/sh + +# getNonPortableDistroRid +# +# Input: +# targetOs: (str) +# targetArch: (str) +# rootfsDir: (str) +# +# Return: +# non-portable rid +getNonPortableDistroRid() +{ + targetOs="$1" + targetArch="$2" + rootfsDir="$3" + nonPortableRid="" + + if [ "$targetOs" = "linux" ]; then + # shellcheck disable=SC1091 + if [ -e "${rootfsDir}/etc/os-release" ]; then + . "${rootfsDir}/etc/os-release" + if echo "${VERSION_ID:-}" | grep -qE '^([[:digit:]]|\.)+$'; then + nonPortableRid="${ID}.${VERSION_ID}-${targetArch}" + else + # Rolling release distros either do not set VERSION_ID, set it as blank or + # set it to non-version looking string (such as TEMPLATE_VERSION_ID on ArchLinux); + # so omit it here to be consistent with everything else. + nonPortableRid="${ID}-${targetArch}" + fi + elif [ -e "${rootfsDir}/android_platform" ]; then + # shellcheck disable=SC1091 + . "${rootfsDir}/android_platform" + nonPortableRid="$RID" + fi + fi + + if [ "$targetOs" = "freebsd" ]; then + # $rootfsDir can be empty. freebsd-version is a shell script and should always work. + __freebsd_major_version=$("$rootfsDir"/bin/freebsd-version | cut -d'.' -f1) + nonPortableRid="freebsd.$__freebsd_major_version-${targetArch}" + elif command -v getprop >/dev/null && getprop ro.product.system.model | grep -qi android; then + __android_sdk_version=$(getprop ro.build.version.sdk) + nonPortableRid="android.$__android_sdk_version-${targetArch}" + elif [ "$targetOs" = "illumos" ]; then + __uname_version=$(uname -v) + nonPortableRid="illumos-${targetArch}" + elif [ "$targetOs" = "solaris" ]; then + __uname_version=$(uname -v) + __solaris_major_version=$(echo "$__uname_version" | cut -d'.' -f1) + nonPortableRid="solaris.$__solaris_major_version-${targetArch}" + elif [ "$targetOs" = "haiku" ]; then + __uname_release="$(uname -r)" + nonPortableRid=haiku.r"$__uname_release"-"$targetArch" + fi + + echo "$nonPortableRid" | tr '[:upper:]' '[:lower:]' +} + +# initDistroRidGlobal +# +# Input: +# os: (str) +# arch: (str) +# rootfsDir?: (nullable:string) +# +# Return: +# None +# +# Notes: +# It is important to note that the function does not return anything, but it +# exports the following variables on success: +# __DistroRid : Non-portable rid of the target platform. +# __PortableTargetOS : OS-part of the portable rid that corresponds to the target platform. +initDistroRidGlobal() +{ + targetOs="$1" + targetArch="$2" + rootfsDir="" + if [ $# -ge 3 ]; then + rootfsDir="$3" + fi + + if [ -n "${rootfsDir}" ]; then + # We may have a cross build. Check for the existence of the rootfsDir + if [ ! -e "${rootfsDir}" ]; then + echo "Error: rootfsDir has been passed, but the location is not valid." + exit 1 + fi + fi + + __DistroRid=$(getNonPortableDistroRid "${targetOs}" "${targetArch}" "${rootfsDir}") + + if [ -z "${__PortableTargetOS:-}" ]; then + __PortableTargetOS="$targetOs" + + STRINGS="$(command -v strings || true)" + if [ -z "$STRINGS" ]; then + STRINGS="$(command -v llvm-strings || true)" + fi + + # Check for musl-based distros (e.g. Alpine Linux, Void Linux). + if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl || + ( [ -n "$STRINGS" ] && "$STRINGS" "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl ); then + __PortableTargetOS="linux-musl" + fi + fi + + export __DistroRid __PortableTargetOS +} diff --git a/src/arcade/eng/common/native/init-os-and-arch.sh b/src/arcade/eng/common/native/init-os-and-arch.sh new file mode 100644 index 00000000000..38921d4338f --- /dev/null +++ b/src/arcade/eng/common/native/init-os-and-arch.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +# Use uname to determine what the OS is. +OSName=$(uname -s | tr '[:upper:]' '[:lower:]') + +if command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then + OSName="android" +fi + +case "$OSName" in +freebsd|linux|netbsd|openbsd|sunos|android|haiku) + os="$OSName" ;; +darwin) + os=osx ;; +*) + echo "Unsupported OS $OSName detected!" + exit 1 ;; +esac + +# On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html +# and `uname -p` returns processor type (e.g. i386 on amd64). +# The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. +if [ "$os" = "sunos" ]; then + if uname -o 2>&1 | grep -q illumos; then + os="illumos" + else + os="solaris" + fi + CPUName=$(isainfo -n) +else + # For the rest of the operating systems, use uname(1) to determine what the CPU is. + CPUName=$(uname -m) +fi + +case "$CPUName" in + arm64|aarch64) + arch=arm64 + if [ "$(getconf LONG_BIT)" -lt 64 ]; then + # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) + arch=arm + fi + ;; + + loongarch64) + arch=loongarch64 + ;; + + riscv64) + arch=riscv64 + ;; + + amd64|x86_64) + arch=x64 + ;; + + armv7l|armv8l) + # shellcheck disable=SC1091 + if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then + arch=armel + else + arch=arm + fi + ;; + + armv6l) + arch=armv6 + ;; + + i[3-6]86) + echo "Unsupported CPU $CPUName detected, build might not succeed!" + arch=x86 + ;; + + s390x) + arch=s390x + ;; + + ppc64le) + arch=ppc64le + ;; + *) + echo "Unknown CPU $CPUName detected!" + exit 1 + ;; +esac diff --git a/src/arcade/eng/common/native/install-cmake-test.sh b/src/arcade/eng/common/native/install-cmake-test.sh new file mode 100644 index 00000000000..8a5e7cf0db5 --- /dev/null +++ b/src/arcade/eng/common/native/install-cmake-test.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake-test" +tool_os=$(GetCurrentOS) +tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' + exit 1 +fi + +exit 0 diff --git a/src/arcade/eng/common/native/install-cmake.sh b/src/arcade/eng/common/native/install-cmake.sh new file mode 100644 index 00000000000..de496beebc5 --- /dev/null +++ b/src/arcade/eng/common/native/install-cmake.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake" +tool_os=$(GetCurrentOS) +tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' + exit 1 +fi + +exit 0 diff --git a/src/arcade/eng/common/native/install-tool.ps1 b/src/arcade/eng/common/native/install-tool.ps1 new file mode 100644 index 00000000000..78f2d84a4e4 --- /dev/null +++ b/src/arcade/eng/common/native/install-tool.ps1 @@ -0,0 +1,132 @@ +<# +.SYNOPSIS +Install native tool + +.DESCRIPTION +Install cmake native tool from Azure blob storage + +.PARAMETER InstallPath +Base directory to install native tool to + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER CommonLibraryDirectory +Path to folder containing common library modules + +.PARAMETER Force +Force install of tools even if they previously exist + +.PARAMETER Clean +Don't install the tool, just clean up the current install of the tool + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.NOTES +Returns 0 if install succeeds, 1 otherwise +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [Parameter(Mandatory=$True)] + [string] $ToolName, + [Parameter(Mandatory=$True)] + [string] $InstallPath, + [Parameter(Mandatory=$True)] + [string] $BaseUri, + [Parameter(Mandatory=$True)] + [string] $Version, + [string] $CommonLibraryDirectory = $PSScriptRoot, + [switch] $Force = $False, + [switch] $Clean = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30 +) + +. $PSScriptRoot\..\pipeline-logging-functions.ps1 + +# Import common library modules +Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1") + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $Arch = CommonLibrary\Get-MachineArchitecture + $ToolOs = "win64" + if($Arch -Eq "x32") { + $ToolOs = "win32" + } + $ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch" + $ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\" + $Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip" + $ShimPath = Join-Path $InstallPath "$ToolName.exe" + + if ($Clean) { + Write-Host "Cleaning $ToolInstallDirectory" + if (Test-Path $ToolInstallDirectory) { + Remove-Item $ToolInstallDirectory -Force -Recurse + } + Write-Host "Cleaning $ShimPath" + if (Test-Path $ShimPath) { + Remove-Item $ShimPath -Force + } + $ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri + Write-Host "Cleaning $ToolTempPath" + if (Test-Path $ToolTempPath) { + Remove-Item $ToolTempPath -Force + } + exit 0 + } + + # Install tool + if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) { + Write-Verbose "$ToolName ($Version) already exists, skipping install" + } + else { + $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri ` + -InstallDirectory $ToolInstallDirectory ` + -Force:$Force ` + -DownloadRetries $DownloadRetries ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Verbose:$Verbose + + if ($InstallStatus -Eq $False) { + Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping" + exit 1 + } + } + + $ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName } + if (@($ToolFilePath).Length -Gt 1) { + Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))" + exit 1 + } elseif (@($ToolFilePath).Length -Lt 1) { + Write-Host "$ToolName was not found in $ToolInstallDirectory." + exit 1 + } + + # Generate shim + # Always rewrite shims so that we are referencing the expected version + $GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName ` + -ShimDirectory $InstallPath ` + -ToolFilePath "$ToolFilePath" ` + -BaseUri $BaseUri ` + -Force:$Force ` + -Verbose:$Verbose + + if ($GenerateShimStatus -Eq $False) { + Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping" + return 1 + } + + exit 0 +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_ + exit 1 +} diff --git a/src/arcade/eng/common/pipeline-logging-functions.ps1 b/src/arcade/eng/common/pipeline-logging-functions.ps1 new file mode 100644 index 00000000000..8e422c561e4 --- /dev/null +++ b/src/arcade/eng/common/pipeline-logging-functions.ps1 @@ -0,0 +1,260 @@ +# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. + +# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 + +$script:loggingCommandPrefix = '##vso[' +$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? + New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } + New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } + New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } + New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } +) +# TODO: BUG: Escape % ??? +# TODO: Add test to verify don't need to escape "=". + +# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set +function Write-PipelineTelemetryError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Category, + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput, + [switch]$Force) + + $PSBoundParameters.Remove('Category') | Out-Null + + if ($Force -Or ((Test-Path variable:ci) -And $ci)) { + $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" + } + $PSBoundParameters.Remove('Message') | Out-Null + $PSBoundParameters.Add('Message', $Message) + Write-PipelineTaskError @PSBoundParameters +} + +# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set +function Write-PipelineTaskError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput, + [switch]$Force + ) + + if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { + if ($Type -eq 'error') { + Write-Host $Message -ForegroundColor Red + return + } + elseif ($Type -eq 'warning') { + Write-Host $Message -ForegroundColor Yellow + return + } + } + + if (($Type -ne 'error') -and ($Type -ne 'warning')) { + Write-Host $Message + return + } + $PSBoundParameters.Remove('Force') | Out-Null + if (-not $PSBoundParameters.ContainsKey('Type')) { + $PSBoundParameters.Add('Type', 'error') + } + Write-LogIssue @PSBoundParameters +} + +function Write-PipelineSetVariable { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Name, + [string]$Value, + [switch]$Secret, + [switch]$AsOutput, + [bool]$IsMultiJobVariable = $true) + + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ + 'variable' = $Name + 'isSecret' = $Secret + 'isOutput' = $IsMultiJobVariable + } -AsOutput:$AsOutput + } +} + +function Write-PipelinePrependPath { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Path, + [switch]$AsOutput) + + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput + } +} + +function Write-PipelineSetResult { + [CmdletBinding()] + param( + [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] + [Parameter(Mandatory = $true)] + [string]$Result, + [string]$Message) + if ((Test-Path variable:ci) -And $ci) { + Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ + 'result' = $Result + } + } +} + +<######################################## +# Private functions. +########################################> +function Format-LoggingCommandData { + [CmdletBinding()] + param([string]$Value, [switch]$Reverse) + + if (!$Value) { + return '' + } + + if (!$Reverse) { + foreach ($mapping in $script:loggingCommandEscapeMappings) { + $Value = $Value.Replace($mapping.Token, $mapping.Replacement) + } + } + else { + for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { + $mapping = $script:loggingCommandEscapeMappings[$i] + $Value = $Value.Replace($mapping.Replacement, $mapping.Token) + } + } + + return $Value +} + +function Format-LoggingCommand { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Area, + [Parameter(Mandatory = $true)] + [string]$Event, + [string]$Data, + [hashtable]$Properties) + + # Append the preamble. + [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder + $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) + + # Append the properties. + if ($Properties) { + $first = $true + foreach ($key in $Properties.Keys) { + [string]$value = Format-LoggingCommandData $Properties[$key] + if ($value) { + if ($first) { + $null = $sb.Append(' ') + $first = $false + } + else { + $null = $sb.Append(';') + } + + $null = $sb.Append("$key=$value") + } + } + } + + # Append the tail and output the value. + $Data = Format-LoggingCommandData $Data + $sb.Append(']').Append($Data).ToString() +} + +function Write-LoggingCommand { + [CmdletBinding(DefaultParameterSetName = 'Parameters')] + param( + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Area, + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Event, + [Parameter(ParameterSetName = 'Parameters')] + [string]$Data, + [Parameter(ParameterSetName = 'Parameters')] + [hashtable]$Properties, + [Parameter(Mandatory = $true, ParameterSetName = 'Object')] + $Command, + [switch]$AsOutput) + + if ($PSCmdlet.ParameterSetName -eq 'Object') { + Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput + return + } + + $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties + if ($AsOutput) { + $command + } + else { + Write-Host $command + } +} + +function Write-LogIssue { + [CmdletBinding()] + param( + [ValidateSet('warning', 'error')] + [Parameter(Mandatory = $true)] + [string]$Type, + [string]$Message, + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput) + + $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ + 'type' = $Type + 'code' = $ErrCode + 'sourcepath' = $SourcePath + 'linenumber' = $LineNumber + 'columnnumber' = $ColumnNumber + } + if ($AsOutput) { + return $command + } + + if ($Type -eq 'error') { + $foregroundColor = $host.PrivateData.ErrorForegroundColor + $backgroundColor = $host.PrivateData.ErrorBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Red + $backgroundColor = [System.ConsoleColor]::Black + } + } + else { + $foregroundColor = $host.PrivateData.WarningForegroundColor + $backgroundColor = $host.PrivateData.WarningBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Yellow + $backgroundColor = [System.ConsoleColor]::Black + } + } + + Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor +} diff --git a/src/arcade/eng/common/pipeline-logging-functions.sh b/src/arcade/eng/common/pipeline-logging-functions.sh new file mode 100644 index 00000000000..6a0b2255e91 --- /dev/null +++ b/src/arcade/eng/common/pipeline-logging-functions.sh @@ -0,0 +1,206 @@ +#!/usr/bin/env bash + +function Write-PipelineTelemetryError { + local telemetry_category='' + local force=false + local function_args=() + local message='' + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -category|-c) + telemetry_category=$2 + shift + ;; + -force|-f) + force=true + ;; + -*) + function_args+=("$1 $2") + shift + ;; + *) + message=$* + ;; + esac + shift + done + + if [[ $force != true ]] && [[ "$ci" != true ]]; then + echo "$message" >&2 + return + fi + + if [[ $force == true ]]; then + function_args+=("-force") + fi + message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message" + function_args+=("$message") + Write-PipelineTaskError ${function_args[@]} +} + +function Write-PipelineTaskError { + local message_type="error" + local sourcepath='' + local linenumber='' + local columnnumber='' + local error_code='' + local force=false + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -type|-t) + message_type=$2 + shift + ;; + -sourcepath|-s) + sourcepath=$2 + shift + ;; + -linenumber|-ln) + linenumber=$2 + shift + ;; + -columnnumber|-cn) + columnnumber=$2 + shift + ;; + -errcode|-e) + error_code=$2 + shift + ;; + -force|-f) + force=true + ;; + *) + break + ;; + esac + + shift + done + + if [[ $force != true ]] && [[ "$ci" != true ]]; then + echo "$@" >&2 + return + fi + + local message="##vso[task.logissue" + + message="$message type=$message_type" + + if [ -n "$sourcepath" ]; then + message="$message;sourcepath=$sourcepath" + fi + + if [ -n "$linenumber" ]; then + message="$message;linenumber=$linenumber" + fi + + if [ -n "$columnnumber" ]; then + message="$message;columnnumber=$columnnumber" + fi + + if [ -n "$error_code" ]; then + message="$message;code=$error_code" + fi + + message="$message]$*" + echo "$message" +} + +function Write-PipelineSetVariable { + if [[ "$ci" != true ]]; then + return + fi + + local name='' + local value='' + local secret=false + local as_output=false + local is_multi_job_variable=true + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -name|-n) + name=$2 + shift + ;; + -value|-v) + value=$2 + shift + ;; + -secret|-s) + secret=true + ;; + -as_output|-a) + as_output=true + ;; + -is_multi_job_variable|-i) + is_multi_job_variable=$2 + shift + ;; + esac + shift + done + + value=${value/;/%3B} + value=${value/\\r/%0D} + value=${value/\\n/%0A} + value=${value/]/%5D} + + local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" + + if [[ "$as_output" == true ]]; then + $message + else + echo "$message" + fi +} + +function Write-PipelinePrependPath { + local prepend_path='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -path|-p) + prepend_path=$2 + shift + ;; + esac + shift + done + + export PATH="$prepend_path:$PATH" + + if [[ "$ci" == true ]]; then + echo "##vso[task.prependpath]$prepend_path" + fi +} + +function Write-PipelineSetResult { + local result='' + local message='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -result|-r) + result=$2 + shift + ;; + -message|-m) + message=$2 + shift + ;; + esac + shift + done + + if [[ "$ci" == true ]]; then + echo "##vso[task.complete result=$result;]$message" + fi +} diff --git a/src/arcade/eng/common/post-build/check-channel-consistency.ps1 b/src/arcade/eng/common/post-build/check-channel-consistency.ps1 new file mode 100644 index 00000000000..61208d2d135 --- /dev/null +++ b/src/arcade/eng/common/post-build/check-channel-consistency.ps1 @@ -0,0 +1,48 @@ +param( + [Parameter(Mandatory=$true)][string] $PromoteToChannels, # List of channels that the build should be promoted to + [Parameter(Mandatory=$true)][array] $AvailableChannelIds # List of channel IDs available in the YAML implementation +) + +try { + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + + # `tools.ps1` checks $ci to perform some actions. Since the post-build + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + $disableConfigureToolsetImport = $true + . $PSScriptRoot\..\tools.ps1 + + if ($PromoteToChannels -eq "") { + Write-PipelineTaskError -Type 'warning' -Message "This build won't publish assets as it's not configured to any Maestro channel. If that wasn't intended use Darc to configure a default channel using add-default-channel for this branch or to promote it to a channel using add-build-to-channel. See https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#assigning-an-individual-build-to-a-channel for more info." + ExitWithExitCode 0 + } + + # Check that every channel that Maestro told to promote the build to + # is available in YAML + $PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ } + + $hasErrors = $false + + foreach ($id in $PromoteToChannelsIds) { + if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) { + Write-PipelineTaskError -Message "Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng." + $hasErrors = $true + } + } + + # The `Write-PipelineTaskError` doesn't error the script and we might report several errors + # in the previous lines. The check below makes sure that we return an error state from the + # script if we reported any validation error + if ($hasErrors) { + ExitWithExitCode 1 + } + + Write-Host 'done.' +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message "There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration." + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/post-build/nuget-validation.ps1 b/src/arcade/eng/common/post-build/nuget-validation.ps1 new file mode 100644 index 00000000000..e5de00c8983 --- /dev/null +++ b/src/arcade/eng/common/post-build/nuget-validation.ps1 @@ -0,0 +1,22 @@ +# This script validates NuGet package metadata information using this +# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage + +param( + [Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are +) + +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +$disableConfigureToolsetImport = $true +. $PSScriptRoot\..\tools.ps1 + +try { + & $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/post-build/nuget-verification.ps1 b/src/arcade/eng/common/post-build/nuget-verification.ps1 new file mode 100644 index 00000000000..a365194a938 --- /dev/null +++ b/src/arcade/eng/common/post-build/nuget-verification.ps1 @@ -0,0 +1,121 @@ +<# +.SYNOPSIS + Verifies that Microsoft NuGet packages have proper metadata. +.DESCRIPTION + Downloads a verification tool and runs metadata validation on the provided NuGet packages. This script writes an + error if any of the provided packages fail validation. All arguments provided to this PowerShell script that do not + match PowerShell parameters are passed on to the verification tool downloaded during the execution of this script. +.PARAMETER NuGetExePath + The path to the nuget.exe binary to use. If not provided, nuget.exe will be downloaded into the -DownloadPath + directory. +.PARAMETER PackageSource + The package source to use to download the verification tool. If not provided, nuget.org will be used. +.PARAMETER DownloadPath + The directory path to download the verification tool and nuget.exe to. If not provided, + %TEMP%\NuGet.VerifyNuGetPackage will be used. +.PARAMETER args + Arguments that will be passed to the verification tool. +.EXAMPLE + PS> .\verify.ps1 *.nupkg + Verifies the metadata of all .nupkg files in the currect working directory. +.EXAMPLE + PS> .\verify.ps1 --help + Displays the help text of the downloaded verifiction tool. +.LINK + https://github.com/NuGet/NuGetGallery/blob/master/src/VerifyMicrosoftPackage/README.md +#> + +# This script was copied from https://github.com/NuGet/NuGetGallery/blob/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1 + +[CmdletBinding(PositionalBinding = $false)] +param( + [string]$NuGetExePath, + [string]$PackageSource = "https://api.nuget.org/v3/index.json", + [string]$DownloadPath, + [Parameter(ValueFromRemainingArguments = $true)] + [string[]]$args +) + +# The URL to download nuget.exe. +$nugetExeUrl = "https://dist.nuget.org/win-x86-commandline/v4.9.4/nuget.exe" + +# The package ID of the verification tool. +$packageId = "NuGet.VerifyMicrosoftPackage" + +# The location that nuget.exe and the verification tool will be downloaded to. +if (!$DownloadPath) { + $DownloadPath = (Join-Path $env:TEMP "NuGet.VerifyMicrosoftPackage") +} + +$fence = New-Object -TypeName string -ArgumentList '=', 80 + +# Create the download directory, if it doesn't already exist. +if (!(Test-Path $DownloadPath)) { + New-Item -ItemType Directory $DownloadPath | Out-Null +} +Write-Host "Using download path: $DownloadPath" + +if ($NuGetExePath) { + $nuget = $NuGetExePath +} else { + $downloadedNuGetExe = Join-Path $DownloadPath "nuget.exe" + + # Download nuget.exe, if it doesn't already exist. + if (!(Test-Path $downloadedNuGetExe)) { + Write-Host "Downloading nuget.exe from $nugetExeUrl..." + $ProgressPreference = 'SilentlyContinue' + try { + Invoke-WebRequest $nugetExeUrl -OutFile $downloadedNuGetExe + $ProgressPreference = 'Continue' + } catch { + $ProgressPreference = 'Continue' + Write-Error $_ + Write-Error "nuget.exe failed to download." + exit + } + } + + $nuget = $downloadedNuGetExe +} + +Write-Host "Using nuget.exe path: $nuget" +Write-Host " " + +# Download the latest version of the verification tool. +Write-Host "Downloading the latest version of $packageId from $packageSource..." +Write-Host $fence +& $nuget install $packageId ` + -Prerelease ` + -OutputDirectory $DownloadPath ` + -Source $PackageSource +Write-Host $fence +Write-Host " " + +if ($LASTEXITCODE -ne 0) { + Write-Error "nuget.exe failed to fetch the verify tool." + exit +} + +# Find the most recently downloaded tool +Write-Host "Finding the most recently downloaded verification tool." +$verifyProbePath = Join-Path $DownloadPath "$packageId.*" +$verifyPath = Get-ChildItem -Path $verifyProbePath -Directory ` + | Sort-Object -Property LastWriteTime -Descending ` + | Select-Object -First 1 +$verify = Join-Path $verifyPath "tools\NuGet.VerifyMicrosoftPackage.exe" +Write-Host "Using verification tool: $verify" +Write-Host " " + +# Execute the verification tool. +Write-Host "Executing the verify tool..." +Write-Host $fence +& $verify $args +Write-Host $fence +Write-Host " " + +# Respond to the exit code. +if ($LASTEXITCODE -ne 0) { + Write-Error "The verify tool found some problems." +} else { + Write-Output "The verify tool succeeded." +} diff --git a/src/arcade/eng/common/post-build/redact-logs.ps1 b/src/arcade/eng/common/post-build/redact-logs.ps1 new file mode 100644 index 00000000000..b7fc1959150 --- /dev/null +++ b/src/arcade/eng/common/post-build/redact-logs.ps1 @@ -0,0 +1,89 @@ +[CmdletBinding(PositionalBinding=$False)] +param( + [Parameter(Mandatory=$true, Position=0)][string] $InputPath, + [Parameter(Mandatory=$true)][string] $BinlogToolVersion, + [Parameter(Mandatory=$false)][string] $DotnetPath, + [Parameter(Mandatory=$false)][string] $PackageFeed = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json', + # File with strings to redact - separated by newlines. + # For comments start the line with '# ' - such lines are ignored + [Parameter(Mandatory=$false)][string] $TokensFilePath, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$TokensToRedact +) + +try { + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + + # `tools.ps1` checks $ci to perform some actions. Since the post-build + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + $disableConfigureToolsetImport = $true + . $PSScriptRoot\..\tools.ps1 + + $packageName = 'binlogtool' + + $dotnet = $DotnetPath + + if (!$dotnet) { + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + } + + $toolList = & "$dotnet" tool list -g + + if ($toolList -like "*$packageName*") { + & "$dotnet" tool uninstall $packageName -g + } + + $toolPath = "$PSScriptRoot\..\..\..\.tools" + $verbosity = 'minimal' + + New-Item -ItemType Directory -Force -Path $toolPath + + Push-Location -Path $toolPath + + try { + Write-Host "Installing Binlog redactor CLI..." + Write-Host "'$dotnet' new tool-manifest" + & "$dotnet" new tool-manifest + Write-Host "'$dotnet' tool install $packageName --local --add-source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" + & "$dotnet" tool install $packageName --local --add-source "$PackageFeed" -v $verbosity --version $BinlogToolVersion + + if (Test-Path $TokensFilePath) { + Write-Host "Adding additional sensitive data for redaction from file: " $TokensFilePath + $TokensToRedact += Get-Content -Path $TokensFilePath | Foreach {$_.Trim()} | Where { $_ -notmatch "^# " } + } + + $optionalParams = [System.Collections.ArrayList]::new() + + Foreach ($p in $TokensToRedact) + { + if($p -match '^\$\(.*\)$') + { + Write-Host ("Ignoring token {0} as it is probably unexpanded AzDO variable" -f $p) + } + elseif($p) + { + $optionalParams.Add("-p:" + $p) | Out-Null + } + } + + & $dotnet binlogtool redact --input:$InputPath --recurse --in-place ` + @optionalParams + + if ($LastExitCode -ne 0) { + Write-PipelineTelemetryError -Category 'Redactor' -Type 'warning' -Message "Problems using Redactor tool (exit code: $LastExitCode). But ignoring them now." + } + } + finally { + Pop-Location + } + + Write-Host 'done.' +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Category 'Redactor' -Message "There was an error while trying to redact logs. Error: $_" + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/post-build/sourcelink-validation.ps1 b/src/arcade/eng/common/post-build/sourcelink-validation.ps1 new file mode 100644 index 00000000000..1976ef70fb8 --- /dev/null +++ b/src/arcade/eng/common/post-build/sourcelink-validation.ps1 @@ -0,0 +1,327 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored + [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation + [Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade + [Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages + [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +$disableConfigureToolsetImport = $true +. $PSScriptRoot\..\tools.ps1 + +# Cache/HashMap (File -> Exist flag) used to consult whether a file exist +# in the repository at a specific commit point. This is populated by inserting +# all files present in the repo at a specific commit point. +$global:RepoFiles = @{} + +# Maximum number of jobs to run in parallel +$MaxParallelJobs = 16 + +$MaxRetries = 5 +$RetryWaitTimeInSeconds = 30 + +# Wait time between check for system load +$SecondsBetweenLoadChecks = 10 + +if (!$InputPath -or !(Test-Path $InputPath)){ + Write-Host "No files to validate." + ExitWithExitCode 0 +} + +$ValidatePackage = { + param( + [string] $PackagePath # Full path to a Symbols.NuGet package + ) + + . $using:PSScriptRoot\..\tools.ps1 + + # Ensure input file exist + if (!(Test-Path $PackagePath)) { + Write-Host "Input file does not exist: $PackagePath" + return [pscustomobject]@{ + result = 1 + packagePath = $PackagePath + } + } + + # Extensions for which we'll look for SourceLink information + # For now we'll only care about Portable & Embedded PDBs + $RelevantExtensions = @('.dll', '.exe', '.pdb') + + Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...' + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + $FailedFiles = 0 + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $FileName = $_.FullName + $Extension = [System.IO.Path]::GetExtension($_.Name) + $FakeName = -Join((New-Guid), $Extension) + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName + + # We ignore resource DLLs + if ($FileName.EndsWith('.resources.dll')) { + return [pscustomobject]@{ + result = 0 + packagePath = $PackagePath + } + } + + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) + + $ValidateFile = { + param( + [string] $FullPath, # Full path to the module that has to be checked + [string] $RealPath, + [ref] $FailedFiles + ) + + $sourcelinkExe = "$env:USERPROFILE\.dotnet\tools" + $sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe" + $SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String + + if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) { + $NumFailedLinks = 0 + + # We only care about Http addresses + $Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches + + if ($Matches.Count -ne 0) { + $Matches.Value | + ForEach-Object { + $Link = $_ + $CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/" + + $FilePath = $Link.Replace($CommitUrl, "") + $Status = 200 + $Cache = $using:RepoFiles + + $attempts = 0 + + while ($attempts -lt $using:MaxRetries) { + if ( !($Cache.ContainsKey($FilePath)) ) { + try { + $Uri = $Link -as [System.URI] + + if ($Link -match "submodules") { + # Skip submodule links until sourcelink properly handles submodules + $Status = 200 + } + elseif ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match 'github' -or $Uri.Host -match 'githubusercontent')) { + # Only GitHub links are valid + $Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode + } + else { + # If it's not a github link, we want to break out of the loop and not retry. + $Status = 0 + $attempts = $using:MaxRetries + } + } + catch { + Write-Host $_ + $Status = 0 + } + } + + if ($Status -ne 200) { + $attempts++ + + if ($attempts -lt $using:MaxRetries) + { + $attemptsLeft = $using:MaxRetries - $attempts + Write-Warning "Download failed, $attemptsLeft attempts remaining, will retry in $using:RetryWaitTimeInSeconds seconds" + Start-Sleep -Seconds $using:RetryWaitTimeInSeconds + } + else { + if ($NumFailedLinks -eq 0) { + if ($FailedFiles.Value -eq 0) { + Write-Host + } + + Write-Host "`tFile $RealPath has broken links:" + } + + Write-Host "`t`tFailed to retrieve $Link" + + $NumFailedLinks++ + } + } + else { + break + } + } + } + } + + if ($NumFailedLinks -ne 0) { + $FailedFiles.value++ + $global:LASTEXITCODE = 1 + } + } + } + + &$ValidateFile $TargetFile $FileName ([ref]$FailedFiles) + } + } + catch { + Write-Host $_ + } + finally { + $zip.Dispose() + } + + if ($FailedFiles -eq 0) { + Write-Host 'Passed.' + return [pscustomobject]@{ + result = 0 + packagePath = $PackagePath + } + } + else { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links." + return [pscustomobject]@{ + result = 1 + packagePath = $PackagePath + } + } +} + +function CheckJobResult( + $result, + $packagePath, + [ref]$ValidationFailures, + [switch]$logErrors) { + if ($result -ne '0') { + if ($logErrors) { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "$packagePath has broken SourceLink links." + } + $ValidationFailures.Value++ + } +} + +function ValidateSourceLinkLinks { + if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) { + if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format / or -. '$GHRepoName'" + ExitWithExitCode 1 + } + else { + $GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2'; + } + } + + if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'" + ExitWithExitCode 1 + } + + if ($GHRepoName -ne '' -and $GHCommit -ne '') { + $RepoTreeURL = -Join('http://api.github.com/repos/', $GHRepoName, '/git/trees/', $GHCommit, '?recursive=1') + $CodeExtensions = @('.cs', '.vb', '.fs', '.fsi', '.fsx', '.fsscript') + + try { + # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash + $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree + + foreach ($file in $Data) { + $Extension = [System.IO.Path]::GetExtension($file.path) + + if ($CodeExtensions.Contains($Extension)) { + $RepoFiles[$file.path] = 1 + } + } + } + catch { + Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching." + } + } + elseif ($GHRepoName -ne '' -or $GHCommit -ne '') { + Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.' + } + + if (Test-Path $ExtractPath) { + Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue + } + + $ValidationFailures = 0 + + # Process each NuGet package in parallel + Get-ChildItem "$InputPath\*.symbols.nupkg" | + ForEach-Object { + Write-Host "Starting $($_.FullName)" + Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null + $NumJobs = @(Get-Job -State 'Running').Count + + while ($NumJobs -ge $MaxParallelJobs) { + Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." + sleep $SecondsBetweenLoadChecks + $NumJobs = @(Get-Job -State 'Running').Count + } + + foreach ($Job in @(Get-Job -State 'Completed')) { + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) -LogErrors + Remove-Job -Id $Job.Id + } + } + + foreach ($Job in @(Get-Job)) { + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) + Remove-Job -Id $Job.Id + } + if ($ValidationFailures -gt 0) { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation." + ExitWithExitCode 1 + } +} + +function InstallSourcelinkCli { + $sourcelinkCliPackageName = 'sourcelink' + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { + Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." + } + else { + Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." + Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' + & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global + } +} + +try { + InstallSourcelinkCli + + foreach ($Job in @(Get-Job)) { + Remove-Job -Id $Job.Id + } + + ValidateSourceLinkLinks +} +catch { + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'SourceLink' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/post-build/symbols-validation.ps1 b/src/arcade/eng/common/post-build/symbols-validation.ps1 new file mode 100644 index 00000000000..7146e593ffa --- /dev/null +++ b/src/arcade/eng/common/post-build/symbols-validation.ps1 @@ -0,0 +1,337 @@ +param( + [Parameter(Mandatory = $true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored + [Parameter(Mandatory = $true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation + [Parameter(Mandatory = $true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use + [Parameter(Mandatory = $false)][switch] $CheckForWindowsPdbs, # If we should check for the existence of windows pdbs in addition to portable PDBs + [Parameter(Mandatory = $false)][switch] $ContinueOnError, # If we should keep checking symbols after an error + [Parameter(Mandatory = $false)][switch] $Clean, # Clean extracted symbols directory after checking symbols + [Parameter(Mandatory = $false)][string] $SymbolExclusionFile # Exclude the symbols in the file from publishing to symbol server +) + +. $PSScriptRoot\..\tools.ps1 +# Maximum number of jobs to run in parallel +$MaxParallelJobs = 16 + +# Max number of retries +$MaxRetry = 5 + +# Wait time between check for system load +$SecondsBetweenLoadChecks = 10 + +# Set error codes +Set-Variable -Name "ERROR_BADEXTRACT" -Option Constant -Value -1 +Set-Variable -Name "ERROR_FILEDOESNOTEXIST" -Option Constant -Value -2 + +$WindowsPdbVerificationParam = "" +if ($CheckForWindowsPdbs) { + $WindowsPdbVerificationParam = "--windows-pdbs" +} + +$ExclusionSet = New-Object System.Collections.Generic.HashSet[string]; + +if (!$InputPath -or !(Test-Path $InputPath)){ + Write-Host "No symbols to validate." + ExitWithExitCode 0 +} + +#Check if the path exists +if ($SymbolExclusionFile -and (Test-Path $SymbolExclusionFile)){ + [string[]]$Exclusions = Get-Content "$SymbolExclusionFile" + $Exclusions | foreach { if($_ -and $_.Trim()){$ExclusionSet.Add($_)} } +} +else{ + Write-Host "Symbol Exclusion file does not exists. No symbols to exclude." +} + +$CountMissingSymbols = { + param( + [string] $PackagePath, # Path to a NuGet package + [string] $WindowsPdbVerificationParam # If we should check for the existence of windows pdbs in addition to portable PDBs + ) + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + Write-Host "Validating $PackagePath " + + # Ensure input file exist + if (!(Test-Path $PackagePath)) { + Write-PipelineTaskError "Input file does not exist: $PackagePath" + return [pscustomobject]@{ + result = $using:ERROR_FILEDOESNOTEXIST + packagePath = $PackagePath + } + } + + # Extensions for which we'll look for symbols + $RelevantExtensions = @('.dll', '.exe', '.so', '.dylib') + + # How many files are missing symbol information + $MissingSymbols = 0 + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $PackageGuid = New-Guid + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageGuid + $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols' + + try { + [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath) + } + catch { + Write-Host "Something went wrong extracting $PackagePath" + Write-Host $_ + return [pscustomobject]@{ + result = $using:ERROR_BADEXTRACT + packagePath = $PackagePath + } + } + + Get-ChildItem -Recurse $ExtractPath | + Where-Object { $RelevantExtensions -contains $_.Extension } | + ForEach-Object { + $FileName = $_.FullName + if ($FileName -Match '\\ref\\') { + Write-Host "`t Ignoring reference assembly file " $FileName + return + } + + $FirstMatchingSymbolDescriptionOrDefault = { + param( + [string] $FullPath, # Full path to the module that has to be checked + [string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols + [string] $WindowsPdbVerificationParam, # Parameter to pass to potential check for windows-pdbs. + [string] $SymbolsPath + ) + + $FileName = [System.IO.Path]::GetFileName($FullPath) + $Extension = [System.IO.Path]::GetExtension($FullPath) + + # Those below are potential symbol files that the `dotnet symbol` might + # return. Which one will be returned depend on the type of file we are + # checking and which type of file was uploaded. + + # The file itself is returned + $SymbolPath = $SymbolsPath + '\' + $FileName + + # PDB file for the module + $PdbPath = $SymbolPath.Replace($Extension, '.pdb') + + # PDB file for R2R module (created by crossgen) + $NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb') + + # DBG file for a .so library + $SODbg = $SymbolPath.Replace($Extension, '.so.dbg') + + # DWARF file for a .dylib + $DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf') + + $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" + $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" + + $totalRetries = 0 + + while ($totalRetries -lt $using:MaxRetry) { + + # Save the output and get diagnostic output + $output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String + + if ((Test-Path $PdbPath) -and (Test-path $SymbolPath)) { + return 'Module and PDB for Module' + } + elseif ((Test-Path $NGenPdb) -and (Test-Path $PdbPath) -and (Test-Path $SymbolPath)) { + return 'Dll, PDB and NGen PDB' + } + elseif ((Test-Path $SODbg) -and (Test-Path $SymbolPath)) { + return 'So and DBG for SO' + } + elseif ((Test-Path $DylibDwarf) -and (Test-Path $SymbolPath)) { + return 'Dylib and Dwarf for Dylib' + } + elseif (Test-Path $SymbolPath) { + return 'Module' + } + else + { + $totalRetries++ + } + } + + return $null + } + + $FileRelativePath = $FileName.Replace("$ExtractPath\", "") + if (($($using:ExclusionSet) -ne $null) -and ($($using:ExclusionSet).Contains($FileRelativePath) -or ($($using:ExclusionSet).Contains($FileRelativePath.Replace("\", "/"))))){ + Write-Host "Skipping $FileName from symbol validation" + } + + else { + $FileGuid = New-Guid + $ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid + + $SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault ` + -FullPath $FileName ` + -TargetServerParam '--microsoft-symbol-server' ` + -SymbolsPath "$ExpandedSymbolsPath-msdl" ` + -WindowsPdbVerificationParam $WindowsPdbVerificationParam + $SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault ` + -FullPath $FileName ` + -TargetServerParam '--internal-server' ` + -SymbolsPath "$ExpandedSymbolsPath-symweb" ` + -WindowsPdbVerificationParam $WindowsPdbVerificationParam + + Write-Host -NoNewLine "`t Checking file " $FileName "... " + + if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { + Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)" + } + else { + $MissingSymbols++ + + if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) { + Write-Host 'No symbols found on MSDL or SymWeb!' + } + else { + if ($SymbolsOnMSDL -eq $null) { + Write-Host 'No symbols found on MSDL!' + } + else { + Write-Host 'No symbols found on SymWeb!' + } + } + } + } + } + + if ($using:Clean) { + Remove-Item $ExtractPath -Recurse -Force + } + + Pop-Location + + return [pscustomobject]@{ + result = $MissingSymbols + packagePath = $PackagePath + } +} + +function CheckJobResult( + $result, + $packagePath, + [ref]$DupedSymbols, + [ref]$TotalFailures) { + if ($result -eq $ERROR_BADEXTRACT) { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files" + $DupedSymbols.Value++ + } + elseif ($result -eq $ERROR_FILEDOESNOTEXIST) { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath does not exist" + $TotalFailures.Value++ + } + elseif ($result -gt '0') { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $result modules in the package $packagePath" + $TotalFailures.Value++ + } + else { + Write-Host "All symbols verified for package $packagePath" + } +} + +function CheckSymbolsAvailable { + if (Test-Path $ExtractPath) { + Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue + } + + $TotalPackages = 0 + $TotalFailures = 0 + $DupedSymbols = 0 + + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $FileName = $_.Name + $FullName = $_.FullName + + # These packages from Arcade-Services include some native libraries that + # our current symbol uploader can't handle. Below is a workaround until + # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. + if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') { + Write-Host "Ignoring Arcade-services file: $FileName" + Write-Host + return + } + elseif ($FileName -Match 'Microsoft\.DotNet\.Maestro\.Tasks\.') { + Write-Host "Ignoring Arcade-services file: $FileName" + Write-Host + return + } + + $TotalPackages++ + + Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList @($FullName,$WindowsPdbVerificationParam) | Out-Null + + $NumJobs = @(Get-Job -State 'Running').Count + + while ($NumJobs -ge $MaxParallelJobs) { + Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." + sleep $SecondsBetweenLoadChecks + $NumJobs = @(Get-Job -State 'Running').Count + } + + foreach ($Job in @(Get-Job -State 'Completed')) { + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) + Remove-Job -Id $Job.Id + } + Write-Host + } + + foreach ($Job in @(Get-Job)) { + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) + } + + if ($TotalFailures -gt 0 -or $DupedSymbols -gt 0) { + if ($TotalFailures -gt 0) { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures/$TotalPackages packages" + } + + if ($DupedSymbols -gt 0) { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$DupedSymbols/$TotalPackages packages had duplicated symbol files and could not be extracted" + } + + ExitWithExitCode 1 + } + else { + Write-Host "All symbols validated!" + } +} + +function InstallDotnetSymbol { + $dotnetSymbolPackageName = 'dotnet-symbol' + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) { + Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed." + } + else { + Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..." + Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' + & "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global + } +} + +try { + InstallDotnetSymbol + + foreach ($Job in @(Get-Job)) { + Remove-Job -Id $Job.Id + } + + CheckSymbolsAvailable +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/retain-build.ps1 b/src/arcade/eng/common/retain-build.ps1 new file mode 100644 index 00000000000..e7ba975adeb --- /dev/null +++ b/src/arcade/eng/common/retain-build.ps1 @@ -0,0 +1,45 @@ + +Param( +[Parameter(Mandatory=$true)][int] $buildId, +[Parameter(Mandatory=$true)][string] $azdoOrgUri, +[Parameter(Mandatory=$true)][string] $azdoProject, +[Parameter(Mandatory=$true)][string] $token +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +function Get-AzDOHeaders( + [string] $token) +{ + $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) + $headers = @{"Authorization"="Basic $base64AuthInfo"} + return $headers +} + +function Update-BuildRetention( + [string] $azdoOrgUri, + [string] $azdoProject, + [int] $buildId, + [string] $token) +{ + $headers = Get-AzDOHeaders -token $token + $requestBody = "{ + `"keepForever`": `"true`" + }" + + $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" + write-Host "Attempting to retain build using the following URI: ${requestUri} ..." + + try { + Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" + Write-Host "Updated retention settings for build ${buildId}." + } + catch { + Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" + exit 1 + } +} + +Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token +exit 0 diff --git a/src/arcade/eng/common/sdl/NuGet.config b/src/arcade/eng/common/sdl/NuGet.config new file mode 100644 index 00000000000..3849bdb3cf5 --- /dev/null +++ b/src/arcade/eng/common/sdl/NuGet.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 new file mode 100644 index 00000000000..27f5a4115fc --- /dev/null +++ b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 @@ -0,0 +1,130 @@ +Param( + [string] $GuardianCliLocation, + [string] $WorkingDirectory, + [string] $TargetDirectory, + [string] $GdnFolder, + # The list of Guardian tools to configure. For each object in the array: + # - If the item is a [hashtable], it must contain these entries: + # - Name = The tool name as Guardian knows it. + # - Scenario = (Optional) Scenario-specific name for this configuration entry. It must be unique + # among all tool entries with the same Name. + # - Args = (Optional) Array of Guardian tool configuration args, like '@("Target > C:\temp")' + # - If the item is a [string] $v, it is treated as '@{ Name="$v" }' + [object[]] $ToolsList, + [string] $GuardianLoggerLevel='Standard', + # Optional: Additional params to add to any tool using CredScan. + [string[]] $CrScanAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using PoliCheck. + [string[]] $PoliCheckAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using CodeQL/Semmle. + [string[]] $CodeQLAdditionalRunConfigParams, + # Optional: Additional params to add to any tool using Binskim. + [string[]] $BinskimAdditionalRunConfigParams +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + # Normalize tools list: all in [hashtable] form with defined values for each key. + $ToolsList = $ToolsList | + ForEach-Object { + if ($_ -is [string]) { + $_ = @{ Name = $_ } + } + + if (-not ($_['Scenario'])) { $_.Scenario = "" } + if (-not ($_['Args'])) { $_.Args = @() } + $_ + } + + Write-Host "List of tools to configure:" + $ToolsList | ForEach-Object { $_ | Out-String | Write-Host } + + # We store config files in the r directory of .gdn + $gdnConfigPath = Join-Path $GdnFolder 'r' + $ValidPath = Test-Path $GuardianCliLocation + + if ($ValidPath -eq $False) + { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." + ExitWithExitCode 1 + } + + foreach ($tool in $ToolsList) { + # Put together the name and scenario to make a unique key. + $toolConfigName = $tool.Name + if ($tool.Scenario) { + $toolConfigName += "_" + $tool.Scenario + } + + Write-Host "=== Configuring $toolConfigName..." + + $gdnConfigFile = Join-Path $gdnConfigPath "$toolConfigName-configure.gdnconfig" + + # For some tools, add default and automatic args. + switch -Exact ($tool.Name) { + 'credscan' { + if ($targetDirectory) { + $tool.Args += "`"TargetDirectory < $TargetDirectory`"" + } + $tool.Args += "`"OutputType < pre`"" + $tool.Args += $CrScanAdditionalRunConfigParams + } + 'policheck' { + if ($targetDirectory) { + $tool.Args += "`"Target < $TargetDirectory`"" + } + $tool.Args += $PoliCheckAdditionalRunConfigParams + } + {$_ -in 'semmle', 'codeql'} { + if ($targetDirectory) { + $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" + } + $tool.Args += $CodeQLAdditionalRunConfigParams + } + 'binskim' { + if ($targetDirectory) { + # Binskim crashes due to specific PDBs. GitHub issue: https://github.com/microsoft/binskim/issues/924. + # We are excluding all `_.pdb` files from the scan. + $tool.Args += "`"Target < $TargetDirectory\**;-:file|$TargetDirectory\**\_.pdb`"" + } + $tool.Args += $BinskimAdditionalRunConfigParams + } + } + + # Create variable pointing to the args array directly so we can use splat syntax later. + $toolArgs = $tool.Args + + # Configure the tool. If args array is provided or the current tool has some default arguments + # defined, add "--args" and splat each element on the end. Arg format is "{Arg id} < {Value}", + # one per parameter. Doc page for "guardian configure": + # https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1395/configure + Exec-BlockVerbosely { + & $GuardianCliLocation configure ` + --working-directory $WorkingDirectory ` + --tool $tool.Name ` + --output-path $gdnConfigFile ` + --logger-level $GuardianLoggerLevel ` + --noninteractive ` + --force ` + $(if ($toolArgs) { "--args" }) @toolArgs + Exit-IfNZEC "Sdl" + } + + Write-Host "Created '$toolConfigName' configuration file: $gdnConfigFile" + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 b/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 new file mode 100644 index 00000000000..4715d75e974 --- /dev/null +++ b/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -0,0 +1,167 @@ +Param( + [string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified) + [string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified) + [string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified + [string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade) + [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master + [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located + [string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ('artifacts')), # Required: the directory where build artifacts are located + [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault + + # Optional: list of SDL tools to run on source code. See 'configure-sdl-tool.ps1' for tools list + # format. + [object[]] $SourceToolsList, + # Optional: list of SDL tools to run on built artifacts. See 'configure-sdl-tool.ps1' for tools + # list format. + [object[]] $ArtifactToolsList, + # Optional: list of SDL tools to run without automatically specifying a target directory. See + # 'configure-sdl-tool.ps1' for tools list format. + [object[]] $CustomToolsList, + + [bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs. + [string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs. + [string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber) + [bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed + [bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs. + [string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. alias@microsoft.com); TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. + [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error + [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") + [string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") + [string[]] $CodeQLAdditionalRunConfigParams, # Optional: Additional Params to custom build a Semmle/CodeQL run config in the format @("xyz < abc","sdf < 1") + [string[]] $BinskimAdditionalRunConfigParams, # Optional: Additional Params to custom build a Binskim run config in the format @("xyz < abc","sdf < 1") + [bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run +) + +try { + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + $disableConfigureToolsetImport = $true + $global:LASTEXITCODE = 0 + + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + #Replace repo names to the format of org/repo + if (!($Repository.contains('/'))) { + $RepoName = $Repository -replace '(.*?)-(.*)', '$1/$2'; + } + else{ + $RepoName = $Repository; + } + + if ($GuardianPackageName) { + $guardianCliLocation = Join-Path $NugetPackageDirectory (Join-Path $GuardianPackageName (Join-Path 'tools' 'guardian.cmd')) + } else { + $guardianCliLocation = $GuardianCliLocation + } + + $workingDirectory = (Split-Path $SourceDirectory -Parent) + $ValidPath = Test-Path $guardianCliLocation + + if ($ValidPath -eq $False) + { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Invalid Guardian CLI Location.' + ExitWithExitCode 1 + } + + Exec-BlockVerbosely { + & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel + } + $gdnFolder = Join-Path $workingDirectory '.gdn' + + if ($TsaOnboard) { + if ($TsaCodebaseName -and $TsaNotificationEmail -and $TsaCodebaseAdmin -and $TsaBugAreaPath) { + Exec-BlockVerbosely { + & $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel + } + if ($LASTEXITCODE -ne 0) { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-onboard failed with exit code $LASTEXITCODE." + ExitWithExitCode $LASTEXITCODE + } + } else { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not onboard to TSA -- not all required values ($TsaCodebaseName, $TsaNotificationEmail, $TsaCodebaseAdmin, $TsaBugAreaPath) were specified.' + ExitWithExitCode 1 + } + } + + # Configure a list of tools with a default target directory. Populates the ".gdn/r" directory. + function Configure-ToolsList([object[]] $tools, [string] $targetDirectory) { + if ($tools -and $tools.Count -gt 0) { + Exec-BlockVerbosely { + & $(Join-Path $PSScriptRoot 'configure-sdl-tool.ps1') ` + -GuardianCliLocation $guardianCliLocation ` + -WorkingDirectory $workingDirectory ` + -TargetDirectory $targetDirectory ` + -GdnFolder $gdnFolder ` + -ToolsList $tools ` + -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` + -GuardianLoggerLevel $GuardianLoggerLevel ` + -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` + -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` + -CodeQLAdditionalRunConfigParams $CodeQLAdditionalRunConfigParams ` + -BinskimAdditionalRunConfigParams $BinskimAdditionalRunConfigParams + if ($BreakOnFailure) { + Exit-IfNZEC "Sdl" + } + } + } + } + + # Configure Artifact and Source tools with default Target directories. + Configure-ToolsList $ArtifactToolsList $ArtifactsDirectory + Configure-ToolsList $SourceToolsList $SourceDirectory + # Configure custom tools with no default Target directory. + Configure-ToolsList $CustomToolsList $null + + # At this point, all tools are configured in the ".gdn" directory. Run them all in a single call. + # (If we used "run" multiple times, each run would overwrite data from earlier runs.) + Exec-BlockVerbosely { + & $(Join-Path $PSScriptRoot 'run-sdl.ps1') ` + -GuardianCliLocation $guardianCliLocation ` + -WorkingDirectory $SourceDirectory ` + -UpdateBaseline $UpdateBaseline ` + -GdnFolder $gdnFolder + } + + if ($TsaPublish) { + if ($TsaBranchName -and $BuildNumber) { + if (-not $TsaRepositoryName) { + $TsaRepositoryName = "$($Repository)-$($BranchName)" + } + Exec-BlockVerbosely { + & $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --onboard $True --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel + } + if ($LASTEXITCODE -ne 0) { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-publish failed with exit code $LASTEXITCODE." + ExitWithExitCode $LASTEXITCODE + } + } else { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not publish to TSA -- not all required values ($TsaBranchName, $BuildNumber) were specified.' + ExitWithExitCode 1 + } + } + + if ($BreakOnFailure) { + Write-Host "Failing the build in case of breaking results..." + Exec-BlockVerbosely { + & $guardianCliLocation break --working-directory $workingDirectory --logger-level $GuardianLoggerLevel + } + } else { + Write-Host "Letting the build pass even if there were breaking results..." + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + exit 1 +} diff --git a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 new file mode 100644 index 00000000000..68da4fbf257 --- /dev/null +++ b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 @@ -0,0 +1,63 @@ +# This script looks for each archive file in a directory and extracts it into the target directory. +# For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**". +# Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip. +param( + # Full path to directory where archives are stored. + [Parameter(Mandatory=$true)][string] $InputPath, + # Full path to directory to extract archives into. May be the same as $InputPath. + [Parameter(Mandatory=$true)][string] $ExtractPath +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$disableConfigureToolsetImport = $true + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + Measure-Command { + $jobs = @() + + # Find archive files for non-Windows and Windows builds. + $archiveFiles = @( + Get-ChildItem (Join-Path $InputPath "*.tar.gz") + Get-ChildItem (Join-Path $InputPath "*.zip") + ) + + foreach ($targzFile in $archiveFiles) { + $jobs += Start-Job -ScriptBlock { + $file = $using:targzFile + $fileName = [System.IO.Path]::GetFileName($file) + $extractDir = Join-Path $using:ExtractPath "$fileName.extracted" + + New-Item $extractDir -ItemType Directory -Force | Out-Null + + Write-Host "Extracting '$file' to '$extractDir'..." + + # Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early. + # This type of quit skips the catch, so we wouldn't be able to tell which file triggered the + # error. Save output so it can be stored in the exception string along with context. + $output = tar -xf $file -C $extractDir 2>&1 + # Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we + # don't have access to the outer scope. + if ($LASTEXITCODE -ne 0) { + throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'" + } + + Write-Host "Extracted to $extractDir" + } + } + + Receive-Job $jobs -Wait + } +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 new file mode 100644 index 00000000000..f031ed5b25e --- /dev/null +++ b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 @@ -0,0 +1,82 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored + [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$disableConfigureToolsetImport = $true + +function ExtractArtifacts { + if (!(Test-Path $InputPath)) { + Write-Host "Input Path does not exist: $InputPath" + ExitWithExitCode 0 + } + $Jobs = @() + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName + } + + foreach ($Job in $Jobs) { + Wait-Job -Id $Job.Id | Receive-Job + } +} + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + $ExtractPackage = { + param( + [string] $PackagePath # Full path to a NuGet package + ) + + if (!(Test-Path $PackagePath)) { + Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + $RelevantExtensions = @('.dll', '.exe', '.pdb') + Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...' + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath); + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName) + [System.IO.Directory]::CreateDirectory($TargetPath); + + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile) + } + } + catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 + } + finally { + $zip.Dispose() + } + } + Measure-Command { ExtractArtifacts } +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/init-sdl.ps1 b/src/arcade/eng/common/sdl/init-sdl.ps1 new file mode 100644 index 00000000000..3ac1d92b370 --- /dev/null +++ b/src/arcade/eng/common/sdl/init-sdl.ps1 @@ -0,0 +1,55 @@ +Param( + [string] $GuardianCliLocation, + [string] $Repository, + [string] $BranchName='master', + [string] $WorkingDirectory, + [string] $AzureDevOpsAccessToken, + [string] $GuardianLoggerLevel='Standard' +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +# `tools.ps1` checks $ci to perform some actions. Since the SDL +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +. $PSScriptRoot\..\tools.ps1 + +# Don't display the console progress UI - it's a huge perf hit +$ProgressPreference = 'SilentlyContinue' + +# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file +$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) +$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") +$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0" +$zipFile = "$WorkingDirectory/gdn.zip" + +Add-Type -AssemblyName System.IO.Compression.FileSystem +$gdnFolder = (Join-Path $WorkingDirectory '.gdn') + +try { + # if the folder does not exist, we'll do a guardian init and push it to the remote repository + Write-Host 'Initializing Guardian...' + Write-Host "$GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel" + & $GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel + if ($LASTEXITCODE -ne 0) { + Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian init failed with exit code $LASTEXITCODE." + ExitWithExitCode $LASTEXITCODE + } + # We create the mainbaseline so it can be edited later + Write-Host "$GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline" + & $GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline + if ($LASTEXITCODE -ne 0) { + Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian baseline failed with exit code $LASTEXITCODE." + ExitWithExitCode $LASTEXITCODE + } + ExitWithExitCode 0 +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/run-sdl.ps1 b/src/arcade/eng/common/sdl/run-sdl.ps1 new file mode 100644 index 00000000000..2eac8c78f10 --- /dev/null +++ b/src/arcade/eng/common/sdl/run-sdl.ps1 @@ -0,0 +1,49 @@ +Param( + [string] $GuardianCliLocation, + [string] $WorkingDirectory, + [string] $GdnFolder, + [string] $UpdateBaseline, + [string] $GuardianLoggerLevel='Standard' +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +try { + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + # We store config files in the r directory of .gdn + $gdnConfigPath = Join-Path $GdnFolder 'r' + $ValidPath = Test-Path $GuardianCliLocation + + if ($ValidPath -eq $False) + { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." + ExitWithExitCode 1 + } + + $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig' + Write-Host "Discovered Guardian config files:" + $gdnConfigFiles | Out-String | Write-Host + + Exec-BlockVerbosely { + & $GuardianCliLocation run ` + --working-directory $WorkingDirectory ` + --baseline mainbaseline ` + --update-baseline $UpdateBaseline ` + --logger-level $GuardianLoggerLevel ` + --config @gdnConfigFiles + Exit-IfNZEC "Sdl" + } +} +catch { + Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/sdl/sdl.ps1 b/src/arcade/eng/common/sdl/sdl.ps1 new file mode 100644 index 00000000000..648c5068d7d --- /dev/null +++ b/src/arcade/eng/common/sdl/sdl.ps1 @@ -0,0 +1,38 @@ + +function Install-Gdn { + param( + [Parameter(Mandatory=$true)] + [string]$Path, + + # If omitted, install the latest version of Guardian, otherwise install that specific version. + [string]$Version + ) + + $ErrorActionPreference = 'Stop' + Set-StrictMode -Version 2.0 + $disableConfigureToolsetImport = $true + $global:LASTEXITCODE = 0 + + # `tools.ps1` checks $ci to perform some actions. Since the SDL + # scripts don't necessarily execute in the same agent that run the + # build.ps1/sh script this variable isn't automatically set. + $ci = $true + . $PSScriptRoot\..\tools.ps1 + + $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") + + if ($Version) { + $argumentList += "-Version $Version" + } + + Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait + + $gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path + + if (!$gdnCliPath) + { + Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian' + } + + return $gdnCliPath.FullName +} \ No newline at end of file diff --git a/src/arcade/eng/common/sdl/trim-assets-version.ps1 b/src/arcade/eng/common/sdl/trim-assets-version.ps1 new file mode 100644 index 00000000000..0daa2a9e946 --- /dev/null +++ b/src/arcade/eng/common/sdl/trim-assets-version.ps1 @@ -0,0 +1,75 @@ +<# +.SYNOPSIS +Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name. + +.PARAMETER InputPath +Full path to directory where artifact packages are stored + +.PARAMETER Recursive +Search for NuGet packages recursively + +#> + +Param( + [string] $InputPath, + [bool] $Recursive = $true +) + +$CliToolName = "Microsoft.DotNet.VersionTools.Cli" + +function Install-VersionTools-Cli { + param( + [Parameter(Mandatory=$true)][string]$Version + ) + + Write-Host "Installing the package '$CliToolName' with a version of '$version' ..." + $feed = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" + + $argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version", "--create-manifest-if-needed") + Start-Process "$dotnet" -Verbose -ArgumentList $argumentList -NoNewWindow -Wait +} + +# ------------------------------------------------------------------- + +if (!(Test-Path $InputPath)) { + Write-Host "Input Path '$InputPath' does not exist" + ExitWithExitCode 1 +} + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$disableConfigureToolsetImport = $true +$global:LASTEXITCODE = 0 + +# `tools.ps1` checks $ci to perform some actions. Since the SDL +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +. $PSScriptRoot\..\tools.ps1 + +try { + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + + $toolsetVersion = Read-ArcadeSdkVersion + Install-VersionTools-Cli -Version $toolsetVersion + + $cliToolFound = (& "$dotnet" tool list --local | Where-Object {$_.Split(' ')[0] -eq $CliToolName}) + if ($null -eq $cliToolFound) { + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "The '$CliToolName' tool is not installed." + ExitWithExitCode 1 + } + + Exec-BlockVerbosely { + & "$dotnet" $CliToolName trim-assets-version ` + --assets-path $InputPath ` + --recursive $Recursive + Exit-IfNZEC "Sdl" + } +} +catch { + Write-Host $_ + Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ + ExitWithExitCode 1 +} diff --git a/src/arcade/eng/common/template-guidance.md b/src/arcade/eng/common/template-guidance.md new file mode 100644 index 00000000000..98bbc1ded0b --- /dev/null +++ b/src/arcade/eng/common/template-guidance.md @@ -0,0 +1,133 @@ +# Overview + +Arcade provides templates for public (`/templates`) and 1ES pipeline templates (`/templates-official`) scenarios. Pipelines which are required to be managed by 1ES pipeline templates should reference `/templates-offical`, all other pipelines may reference `/templates`. + +## How to use + +Basic guidance is: + +- 1ES Pipeline Template or 1ES Microbuild template runs should reference `eng/common/templates-official`. Any internal production-graded pipeline should use these templates. + +- All other runs should reference `eng/common/templates`. + +See [azure-pipelines.yml](../../azure-pipelines.yml) (templates-official example) or [azure-pipelines-pr.yml](../../azure-pipelines-pr.yml) (templates example) for examples. + +#### The `templateIs1ESManaged` parameter + +The `templateIs1ESManaged` is available on most templates and affects which of the variants is used for nested templates. See [Development Notes](#development-notes) below for more information on the `templateIs1ESManaged1 parameter. + +- For templates under `job/`, `jobs/`, `steps`, or `post-build/`, this parameter must be explicitly set. + +## Multiple outputs + +1ES pipeline templates impose a policy where every publish artifact execution results in additional security scans being injected into your pipeline. When using `templates-official/jobs/jobs.yml`, Arcade reduces the number of additional security injections by gathering all publishing outputs into the [Build.ArtifactStagingDirectory](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables-devops-services), and utilizing the [outputParentDirectory](https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs#multiple-outputs) feature of 1ES pipeline templates. When implementing your pipeline, if you ensure publish artifacts are located in the `$(Build.ArtifactStagingDirectory)`, and utilize the 1ES provided template context, then you can reduce the number of security scans for your pipeline. + +Example: +``` yaml +# azure-pipelines.yml +extends: + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + parameters: + stages: + - stage: build + jobs: + - template: /eng/common/templates-official/jobs/jobs.yml@self + parameters: + # 1ES makes use of outputs to reduce security task injection overhead + templateContext: + outputs: + - output: pipelineArtifact + displayName: 'Publish logs from source' + continueOnError: true + condition: always() + targetPath: $(Build.ArtifactStagingDirectory)/artifacts/log + artifactName: Logs + jobs: + - job: Windows + steps: + - script: echo "friendly neighborhood" > artifacts/marvel/spiderman.txt + # copy build outputs to artifact staging directory for publishing + - task: CopyFiles@2 + displayName: Gather build output + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/marvel' + Contents: '**' + TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/marvel' +``` + +Note: Multiple outputs are ONLY applicable to 1ES PT publishing (only usable when referencing `templates-official`). + +## Development notes + +**Folder / file structure** + +``` text +eng\common\ + [templates || templates-official]\ + job\ + job.yml (shim + artifact publishing logic) + onelocbuild.yml (shim) + publish-build-assets.yml (shim) + source-build.yml (shim) + source-index-stage1.yml (shim) + jobs\ + codeql-build.yml (shim) + jobs.yml (shim) + source-build.yml (shim) + post-build\ + post-build.yml (shim) + common-variabls.yml (shim) + setup-maestro-vars.yml (shim) + steps\ + publish-build-artifacts.yml (logic) + publish-pipeline-artifacts.yml (logic) + component-governance.yml (shim) + generate-sbom.yml (shim) + publish-logs.yml (shim) + retain-build.yml (shim) + send-to-helix.yml (shim) + source-build.yml (shim) + variables\ + pool-providers.yml (logic + redirect) # templates/variables/pool-providers.yml will redirect to templates-official/variables/pool-providers.yml if you are running in the internal project + sdl-variables.yml (logic) + core-templates\ + job\ + job.yml (logic) + onelocbuild.yml (logic) + publish-build-assets.yml (logic) + source-build.yml (logic) + source-index-stage1.yml (logic) + jobs\ + codeql-build.yml (logic) + jobs.yml (logic) + source-build.yml (logic) + post-build\ + common-variabls.yml (logic) + post-build.yml (logic) + setup-maestro-vars.yml (logic) + steps\ + component-governance.yml (logic) + generate-sbom.yml (logic) + publish-build-artifacts.yml (redirect) + publish-logs.yml (logic) + publish-pipeline-artifacts.yml (redirect) + retain-build.yml (logic) + send-to-helix.yml (logic) + source-build.yml (logic) + variables\ + pool-providers.yml (redirect) +``` + +In the table above, a file is designated as "shim", "logic", or "redirect". + +- shim - represents a yaml file which is an intermediate step between pipeline logic and .Net Core Engineering's templates (`core-templates`) and defines the `is1ESPipeline` parameter value. + +- logic - represents actual base template logic. + +- redirect- represents a file in `core-templates` which redirects to the "logic" file in either `templates` or `templates-official`. + +Logic for Arcade's templates live **primarily** in the `core-templates` folder. The exceptions to the location of the logic files are around artifact publishing, which is handled differently between 1es pipeline templates and standard templates. `templates` and `templates-official` provide shim entry points which redirect to `core-templates` while also defining the `is1ESPipeline` parameter. If a shim is referenced in `templates`, then `is1ESPipeline` is set to `false`. If a shim is referenced in `templates-official`, then `is1ESPipeline` is set to `true`. + +Within `templates` and `templates-official`, the templates at the "stages", and "jobs" / "job" level have been replaced with shims. Templates at the "steps" and "variables" level are typically too granular to be replaced with shims and instead persist logic which is directly applicable to either scenario. + +Within `core-templates`, there are a handful of places where logic is dependent on which shim entry point was used. In those places, we redirect back to the respective logic file in `templates` or `templates-official`. diff --git a/src/arcade/eng/common/templates-official/job/onelocbuild.yml b/src/arcade/eng/common/templates-official/job/onelocbuild.yml new file mode 100644 index 00000000000..0f0c514b912 --- /dev/null +++ b/src/arcade/eng/common/templates-official/job/onelocbuild.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/onelocbuild.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/publish-build-assets.yml b/src/arcade/eng/common/templates-official/job/publish-build-assets.yml new file mode 100644 index 00000000000..d667a70e8de --- /dev/null +++ b/src/arcade/eng/common/templates-official/job/publish-build-assets.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/publish-build-assets.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/source-build.yml b/src/arcade/eng/common/templates-official/job/source-build.yml new file mode 100644 index 00000000000..1a480034b67 --- /dev/null +++ b/src/arcade/eng/common/templates-official/job/source-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/source-build.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/source-index-stage1.yml b/src/arcade/eng/common/templates-official/job/source-index-stage1.yml new file mode 100644 index 00000000000..6d5ead316f9 --- /dev/null +++ b/src/arcade/eng/common/templates-official/job/source-index-stage1.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/source-index-stage1.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/codeql-build.yml b/src/arcade/eng/common/templates-official/jobs/codeql-build.yml new file mode 100644 index 00000000000..a726322ecfe --- /dev/null +++ b/src/arcade/eng/common/templates-official/jobs/codeql-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/codeql-build.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/jobs.yml b/src/arcade/eng/common/templates-official/jobs/jobs.yml new file mode 100644 index 00000000000..007deddaea0 --- /dev/null +++ b/src/arcade/eng/common/templates-official/jobs/jobs.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/jobs.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/source-build.yml b/src/arcade/eng/common/templates-official/jobs/source-build.yml new file mode 100644 index 00000000000..483e7b611f3 --- /dev/null +++ b/src/arcade/eng/common/templates-official/jobs/source-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/source-build.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/post-build/common-variables.yml b/src/arcade/eng/common/templates-official/post-build/common-variables.yml new file mode 100644 index 00000000000..c32fc49233f --- /dev/null +++ b/src/arcade/eng/common/templates-official/post-build/common-variables.yml @@ -0,0 +1,8 @@ +variables: +- template: /eng/common/core-templates/post-build/common-variables.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/post-build/post-build.yml b/src/arcade/eng/common/templates-official/post-build/post-build.yml new file mode 100644 index 00000000000..2364c0fd4a5 --- /dev/null +++ b/src/arcade/eng/common/templates-official/post-build/post-build.yml @@ -0,0 +1,8 @@ +stages: +- template: /eng/common/core-templates/post-build/post-build.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml new file mode 100644 index 00000000000..024397d8786 --- /dev/null +++ b/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml @@ -0,0 +1,8 @@ +steps: +- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/component-governance.yml b/src/arcade/eng/common/templates-official/steps/component-governance.yml new file mode 100644 index 00000000000..30bb3985ca2 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/component-governance.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/component-governance.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml new file mode 100644 index 00000000000..f9dd238c6cd --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml @@ -0,0 +1,9 @@ +# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' +# variable with the base64-encoded SAS token, by default +steps: +- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml b/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml new file mode 100644 index 00000000000..e6d57182284 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/enable-internal-sources.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/generate-sbom.yml b/src/arcade/eng/common/templates-official/steps/generate-sbom.yml new file mode 100644 index 00000000000..9a89a4706d9 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/generate-sbom.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/generate-sbom.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml b/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml new file mode 100644 index 00000000000..c5a9c1f8275 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/get-delegation-sas.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml b/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml new file mode 100644 index 00000000000..c8dcf6b8139 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/get-federated-access-token.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/publish-logs.yml b/src/arcade/eng/common/templates-official/steps/publish-logs.yml new file mode 100644 index 00000000000..579fd531e94 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/publish-logs.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/publish-logs.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml new file mode 100644 index 00000000000..172f9f0fdc9 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml @@ -0,0 +1,28 @@ +parameters: +- name: is1ESPipeline + type: boolean + default: true + +- name: args + type: object + default: {} + +steps: +- ${{ if ne(parameters.is1ESPipeline, true) }}: + - 'eng/common/templates-official cannot be referenced from a non-1ES managed template': error +- task: 1ES.PublishPipelineArtifact@1 + displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} + ${{ if parameters.args.condition }}: + condition: ${{ parameters.args.condition }} + ${{ else }}: + condition: succeeded() + ${{ if parameters.args.continueOnError }}: + continueOnError: ${{ parameters.args.continueOnError }} + inputs: + targetPath: ${{ parameters.args.targetPath }} + ${{ if parameters.args.artifactName }}: + artifactName: ${{ parameters.args.artifactName }} + ${{ if parameters.args.properties }}: + properties: ${{ parameters.args.properties }} + ${{ if parameters.args.sbomEnabled }}: + sbomEnabled: ${{ parameters.args.sbomEnabled }} diff --git a/src/arcade/eng/common/templates-official/steps/retain-build.yml b/src/arcade/eng/common/templates-official/steps/retain-build.yml new file mode 100644 index 00000000000..5594551508a --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/retain-build.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/retain-build.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/send-to-helix.yml b/src/arcade/eng/common/templates-official/steps/send-to-helix.yml new file mode 100644 index 00000000000..6500f21bf84 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/send-to-helix.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/send-to-helix.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/source-build.yml b/src/arcade/eng/common/templates-official/steps/source-build.yml new file mode 100644 index 00000000000..8f92c49e7b0 --- /dev/null +++ b/src/arcade/eng/common/templates-official/steps/source-build.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-build.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/variables/pool-providers.yml b/src/arcade/eng/common/templates-official/variables/pool-providers.yml new file mode 100644 index 00000000000..1f308b24efc --- /dev/null +++ b/src/arcade/eng/common/templates-official/variables/pool-providers.yml @@ -0,0 +1,45 @@ +# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, +# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. + +# Motivation: +# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS +# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing +# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. +# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services +# team needs to move resources around and create new and potentially differently-named pools. Using this template +# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. + +# How to use: +# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). +# If we find alternate naming conventions in broad usage it can be added to the condition below. +# +# First, import the template in an arcade-ified repo to pick up the variables, e.g.: +# +# variables: +# - template: /eng/common/templates-official/variables/pool-providers.yml +# +# ... then anywhere specifying the pool provider use the runtime variables, +# $(DncEngInternalBuildPool) +# +# pool: +# name: $(DncEngInternalBuildPool) +# image: 1es-windows-2022 + +variables: + # Coalesce the target and source branches so we know when a PR targets a release branch + # If these variables are somehow missing, fall back to main (tends to have more capacity) + + # Any new -Svc alternative pools should have variables added here to allow for splitting work + + - name: DncEngInternalBuildPool + value: $[ + replace( + replace( + eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), + True, + 'NetCore1ESPool-Svc-Internal' + ), + False, + 'NetCore1ESPool-Internal' + ) + ] \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml new file mode 100644 index 00000000000..dbdd66d4a4b --- /dev/null +++ b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml @@ -0,0 +1,7 @@ +variables: +# The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in +# sync with the packages.config file. +- name: DefaultGuardianVersion + value: 0.109.0 +- name: GuardianPackagesConfigFile + value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config \ No newline at end of file diff --git a/src/arcade/eng/common/templates/job/onelocbuild.yml b/src/arcade/eng/common/templates/job/onelocbuild.yml new file mode 100644 index 00000000000..ff829dc4c70 --- /dev/null +++ b/src/arcade/eng/common/templates/job/onelocbuild.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/onelocbuild.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/publish-build-assets.yml b/src/arcade/eng/common/templates/job/publish-build-assets.yml new file mode 100644 index 00000000000..ab2edec2adb --- /dev/null +++ b/src/arcade/eng/common/templates/job/publish-build-assets.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/publish-build-assets.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/source-build.yml b/src/arcade/eng/common/templates/job/source-build.yml new file mode 100644 index 00000000000..e44d47b1d76 --- /dev/null +++ b/src/arcade/eng/common/templates/job/source-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/source-build.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/source-index-stage1.yml b/src/arcade/eng/common/templates/job/source-index-stage1.yml new file mode 100644 index 00000000000..89f3291593c --- /dev/null +++ b/src/arcade/eng/common/templates/job/source-index-stage1.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/job/source-index-stage1.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/codeql-build.yml b/src/arcade/eng/common/templates/jobs/codeql-build.yml new file mode 100644 index 00000000000..517f24d6a52 --- /dev/null +++ b/src/arcade/eng/common/templates/jobs/codeql-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/codeql-build.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/jobs.yml b/src/arcade/eng/common/templates/jobs/jobs.yml new file mode 100644 index 00000000000..388e9037b3e --- /dev/null +++ b/src/arcade/eng/common/templates/jobs/jobs.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/jobs.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/source-build.yml b/src/arcade/eng/common/templates/jobs/source-build.yml new file mode 100644 index 00000000000..818d4c326db --- /dev/null +++ b/src/arcade/eng/common/templates/jobs/source-build.yml @@ -0,0 +1,7 @@ +jobs: +- template: /eng/common/core-templates/jobs/source-build.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/common-variables.yml b/src/arcade/eng/common/templates/post-build/common-variables.yml new file mode 100644 index 00000000000..7fa10587559 --- /dev/null +++ b/src/arcade/eng/common/templates/post-build/common-variables.yml @@ -0,0 +1,8 @@ +variables: +- template: /eng/common/core-templates/post-build/common-variables.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/post-build.yml b/src/arcade/eng/common/templates/post-build/post-build.yml new file mode 100644 index 00000000000..53ede714bdd --- /dev/null +++ b/src/arcade/eng/common/templates/post-build/post-build.yml @@ -0,0 +1,8 @@ +stages: +- template: /eng/common/core-templates/post-build/post-build.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml new file mode 100644 index 00000000000..a79fab5b441 --- /dev/null +++ b/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml @@ -0,0 +1,8 @@ +steps: +- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml + parameters: + # Specifies whether to use 1ES + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/component-governance.yml b/src/arcade/eng/common/templates/steps/component-governance.yml new file mode 100644 index 00000000000..c12a5f8d21d --- /dev/null +++ b/src/arcade/eng/common/templates/steps/component-governance.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/component-governance.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml new file mode 100644 index 00000000000..b21a8038cc1 --- /dev/null +++ b/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml @@ -0,0 +1,10 @@ +# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' +# variable with the base64-encoded SAS token, by default + +steps: +- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/enable-internal-sources.yml b/src/arcade/eng/common/templates/steps/enable-internal-sources.yml new file mode 100644 index 00000000000..5f87e9abb8a --- /dev/null +++ b/src/arcade/eng/common/templates/steps/enable-internal-sources.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/enable-internal-sources.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/generate-sbom.yml b/src/arcade/eng/common/templates/steps/generate-sbom.yml new file mode 100644 index 00000000000..26dc00a2e0f --- /dev/null +++ b/src/arcade/eng/common/templates/steps/generate-sbom.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/generate-sbom.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/get-delegation-sas.yml b/src/arcade/eng/common/templates/steps/get-delegation-sas.yml new file mode 100644 index 00000000000..83760c9798e --- /dev/null +++ b/src/arcade/eng/common/templates/steps/get-delegation-sas.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/get-delegation-sas.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/get-federated-access-token.yml b/src/arcade/eng/common/templates/steps/get-federated-access-token.yml new file mode 100644 index 00000000000..31e151d9d9e --- /dev/null +++ b/src/arcade/eng/common/templates/steps/get-federated-access-token.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/get-federated-access-token.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/publish-logs.yml b/src/arcade/eng/common/templates/steps/publish-logs.yml new file mode 100644 index 00000000000..4ea86bd8823 --- /dev/null +++ b/src/arcade/eng/common/templates/steps/publish-logs.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/publish-logs.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml new file mode 100644 index 00000000000..5dd698b212f --- /dev/null +++ b/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml @@ -0,0 +1,34 @@ +parameters: +- name: is1ESPipeline + type: boolean + default: false + +- name: args + type: object + default: {} + +steps: +- ${{ if eq(parameters.is1ESPipeline, true) }}: + - 'eng/common/templates cannot be referenced from a 1ES managed template': error +- task: PublishPipelineArtifact@1 + displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} + ${{ if parameters.args.condition }}: + condition: ${{ parameters.args.condition }} + ${{ else }}: + condition: succeeded() + ${{ if parameters.args.continueOnError }}: + continueOnError: ${{ parameters.args.continueOnError }} + inputs: + targetPath: ${{ parameters.args.targetPath }} + ${{ if parameters.args.artifactName }}: + artifactName: ${{ parameters.args.artifactName }} + ${{ if parameters.args.publishLocation }}: + publishLocation: ${{ parameters.args.publishLocation }} + ${{ if parameters.args.fileSharePath }}: + fileSharePath: ${{ parameters.args.fileSharePath }} + ${{ if parameters.args.Parallel }}: + parallel: ${{ parameters.args.Parallel }} + ${{ if parameters.args.parallelCount }}: + parallelCount: ${{ parameters.args.parallelCount }} + ${{ if parameters.args.properties }}: + properties: ${{ parameters.args.properties }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/retain-build.yml b/src/arcade/eng/common/templates/steps/retain-build.yml new file mode 100644 index 00000000000..8e841ace3d2 --- /dev/null +++ b/src/arcade/eng/common/templates/steps/retain-build.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/retain-build.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/send-to-helix.yml b/src/arcade/eng/common/templates/steps/send-to-helix.yml new file mode 100644 index 00000000000..39f99fc2762 --- /dev/null +++ b/src/arcade/eng/common/templates/steps/send-to-helix.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/send-to-helix.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/source-build.yml b/src/arcade/eng/common/templates/steps/source-build.yml new file mode 100644 index 00000000000..23c1d6f4e9f --- /dev/null +++ b/src/arcade/eng/common/templates/steps/source-build.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-build.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/variables/pool-providers.yml b/src/arcade/eng/common/templates/variables/pool-providers.yml new file mode 100644 index 00000000000..e0b19c14a07 --- /dev/null +++ b/src/arcade/eng/common/templates/variables/pool-providers.yml @@ -0,0 +1,59 @@ +# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, +# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. + +# Motivation: +# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS +# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing +# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. +# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services +# team needs to move resources around and create new and potentially differently-named pools. Using this template +# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. + +# How to use: +# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). +# If we find alternate naming conventions in broad usage it can be added to the condition below. +# +# First, import the template in an arcade-ified repo to pick up the variables, e.g.: +# +# variables: +# - template: /eng/common/templates/variables/pool-providers.yml +# +# ... then anywhere specifying the pool provider use the runtime variables, +# $(DncEngInternalBuildPool) and $ (DncEngPublicBuildPool), e.g.: +# +# pool: +# name: $(DncEngInternalBuildPool) +# demands: ImageOverride -equals windows.vs2019.amd64 +variables: + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - template: /eng/common/templates-official/variables/pool-providers.yml + - ${{ else }}: + # Coalesce the target and source branches so we know when a PR targets a release branch + # If these variables are somehow missing, fall back to main (tends to have more capacity) + + # Any new -Svc alternative pools should have variables added here to allow for splitting work + - name: DncEngPublicBuildPool + value: $[ + replace( + replace( + eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), + True, + 'NetCore-Svc-Public' + ), + False, + 'NetCore-Public' + ) + ] + + - name: DncEngInternalBuildPool + value: $[ + replace( + replace( + eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), + True, + 'NetCore1ESPool-Svc-Internal' + ), + False, + 'NetCore1ESPool-Internal' + ) + ] From 9995898e73a174fbe094cdedbde11423ec4e33db Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Mon, 28 Apr 2025 15:30:37 +0100 Subject: [PATCH 075/134] Allow `_` in `use!` bindings values (#18487) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + docs/release-notes/.Language/preview.md | 1 + .../CheckComputationExpressions.fs | 33 +++++-- src/Compiler/FSComp.txt | 1 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/pars.fsy | 22 ++++- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + .../UseBindings/UseBang01.fs | 58 ++++++++++++ .../UseBindings/UseBang02.fs | 57 ++++++++++++ .../UseBindings/UseBang03.fs | 71 +++++++++++++++ .../UseBindings/UseBang04.fs | 91 +++++++++++++++++++ .../UseBindings/UseBangBindings.fs | 86 ++++++++++++++++++ .../UseBindings/UseBindingDiscard02.fs | 26 ++++++ .../UseBindings/UseBindings.fs | 32 +------ .../FSharp.Compiler.ComponentTests.fsproj | 1 + 28 files changed, 511 insertions(+), 38 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang01.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang02.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang03.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang04.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard02.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 16f5721e22a..7224d401d6e 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -25,6 +25,7 @@ * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) * Fix confusing type inference error in task expression ([Issue #13789](https://github.com/dotnet/fsharp/issues/13789), [PR #18450](https://github.com/dotnet/fsharp/pull/18450)) * Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) +* Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) ### Added diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 905e086a163..d1576a84eca 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -4,6 +4,7 @@ * Deprecate places where `seq` can be omitted. ([Language suggestion #1033](https://github.com/fsharp/fslang-suggestions/issues/1033), [PR #17772](https://github.com/dotnet/fsharp/pull/17772)) * Added type conversions cache, only enabled for compiler runs ([PR#17668](https://github.com/dotnet/fsharp/pull/17668)) * Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) +* Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) ### Fixed diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index 011b6f0a5ac..f861665a5fc 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -4,6 +4,7 @@ /// with generalization at appropriate points. module internal FSharp.Compiler.CheckComputationExpressions +open FSharp.Compiler.TcGlobals open Internal.Utilities.Library open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking @@ -1783,12 +1784,33 @@ let rec TryTranslateComputationExpression if ceenv.isQuery then error (Error(FSComp.SR.tcBindMayNotBeUsedInQueries (), mBind)) - match pat, andBangs with - | (SynPat.Named(ident = SynIdent(id, _); isThisVal = false) | SynPat.LongIdent(longDotId = SynLongIdent(id = [ id ]))), [] -> + match andBangs with + | [] -> // Valid pattern case - handle with Using + Bind requireBuilderMethod "Using" mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind requireBuilderMethod "Bind" mBind cenv ceenv.env ceenv.ad ceenv.builderTy mBind + let supportsUseBangBindingValueDiscard = + ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.UseBangBindingValueDiscard + + // use! x = ... + // use! (x) = ... + // use! (__) = ... + // use! _ = ... + // use! (_) = ... + let rec extractIdentifierFromPattern pat = + match pat with + | SynPat.Named(ident = SynIdent(id, _); isThisVal = false) -> id, pat + | SynPat.LongIdent(longDotId = SynLongIdent(id = [ id ])) -> id, pat + | SynPat.Wild(m) when supportsUseBangBindingValueDiscard -> + // To properly call the Using(disposable) CE member, we need to convert the wildcard to a SynPat.Named + let tmpIdent = mkSynId m "_" + tmpIdent, SynPat.Named(SynIdent(tmpIdent, None), false, None, m) + | SynPat.Paren(pat = pat) -> extractIdentifierFromPattern pat + | _ -> error (Error(FSComp.SR.tcInvalidUseBangBinding (), pat.Range)) + + let ident, pat = extractIdentifierFromPattern pat + let bindExpr = let consumeExpr = SynExpr.MatchLambda( @@ -1809,14 +1831,14 @@ let rec TryTranslateComputationExpression ) let consumeExpr = - mkSynCall "Using" mBind [ SynExpr.Ident id; consumeExpr ] ceenv.builderValName + mkSynCall "Using" mBind [ SynExpr.Ident ident; consumeExpr ] ceenv.builderValName let consumeExpr = SynExpr.MatchLambda( false, mBind, [ - SynMatchClause(pat, None, consumeExpr, id.idRange, DebugPointAtTarget.No, SynMatchClauseTrivia.Zero) + SynMatchClause(pat, None, consumeExpr, ident.idRange, DebugPointAtTarget.No, SynMatchClauseTrivia.Zero) ], DebugPointAtBinding.NoneAtInvisible, mBind @@ -1829,8 +1851,7 @@ let rec TryTranslateComputationExpression |> addBindDebugPoint spBind Some(translatedCtxt bindExpr) - | _pat, [] -> error (Error(FSComp.SR.tcInvalidUseBangBinding (), mBind)) - | _pat, _ands -> + | _ -> // Has andBangs let m = match andBangs with diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 9bfa12ce963..aab4de2a554 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1798,3 +1798,4 @@ featureDontWarnOnUppercaseIdentifiersInBindingPatterns,"Don't warn on uppercase featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be omitted" featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" featureSupportWarnWhenUnitPassedToObjArg,"Warn when unit is passed to a member accepting `obj` argument, e.g. `Method(o:obj)` will warn if called via `Method()`." +featureUseBangBindingValueDiscard,"Allows use! _ = ... in computation expressions" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 7a9a14b8602..874b709d658 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -99,6 +99,7 @@ type LanguageFeature = | DeprecatePlacesWhereSeqCanBeOmitted | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg + | UseBangBindingValueDiscard /// LanguageVersion management type LanguageVersion(versionText) = @@ -229,6 +230,7 @@ type LanguageVersion(versionText) = LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted, previewVersion LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion + LanguageFeature.UseBangBindingValueDiscard, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -391,6 +393,7 @@ type LanguageVersion(versionText) = | LanguageFeature.DeprecatePlacesWhereSeqCanBeOmitted -> FSComp.SR.featureDeprecatePlacesWhereSeqCanBeOmitted () | LanguageFeature.SupportValueOptionsAsOptionalParameters -> FSComp.SR.featureSupportValueOptionsAsOptionalParameters () | LanguageFeature.WarnWhenUnitPassedToObjArg -> FSComp.SR.featureSupportWarnWhenUnitPassedToObjArg () + | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 410a8b193c9..f50357f3fe0 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -90,6 +90,7 @@ type LanguageFeature = | DeprecatePlacesWhereSeqCanBeOmitted | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg + | UseBangBindingValueDiscard /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 7cac0ad0dc0..e6e3a657592 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -3755,13 +3755,23 @@ atomicPattern: { SynPat.ArrayOrList(true, $2, lhs parseState) } | UNDERSCORE - { SynPat.Wild(lhs parseState) } + { (* Underscore pattern ('_') is represented as SynPat.Wild + This wild pattern is used in all binding forms: + - let _ = ... + - use _ = ... + - let! _ = ... + - use! _ = ... + This ensures consistent representation of wildcard bindings in the AST *) + SynPat.Wild(lhs parseState) } | QMARK ident { SynPat.OptionalVal($2, lhs parseState) } | atomicPatternLongIdent %prec prec_atompat_pathop - { let vis, lidwd = $1 + { (* This rule handles identifiers in patterns like 'use! __' *) + (* For simple identifiers (like '__'), it creates a SynPat.Named AST node *) + (* For complex paths (A.B.C) or uppercase ids, it calls mkSynPatMaybeVar *) + let vis, lidwd = $1 if not (isNilOrSingleton lidwd.LongIdent) || String.isLeadingIdentifierCharacterUpperCase (List.head lidwd.LongIdent).idText then mkSynPatMaybeVar lidwd vis (lhs parseState) else @@ -4431,7 +4441,13 @@ declExpr: SynExpr.YieldOrReturnFrom(($1, not $1), arbExpr ("yield!", mYieldAll), mYieldAll, trivia) } | BINDER headBindingPattern EQUALS typedSequentialExprBlock IN opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let - { let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 5) + { (* This rule handles the 'use!' and 'let!' binding expressions in computation expressions *) + (* The BINDER token represents keywords like 'use!' or 'let!' *) + (* headBindingPattern represents patterns in the binding: + - Underscore ('_') patterns are preserved as SynPat.Wild + - Named patterns ('__') are represented as SynPat.Named + - Identifiers (like 'value') are represented as SynPat.LongIdent *) + let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 5) let mEquals = rhs parseState 3 let m = unionRanges (rhs parseState 1) $8.Range let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 7d64601c303..adb2b01d334 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -657,6 +657,11 @@ Interoperabilita mezi neřízeným obecným omezením jazyka C# a F# (emitovat další modreq) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 67f4270377e..7deaf880012 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -657,6 +657,11 @@ Interop zwischen nicht verwalteter generischer Einschränkung in C# und F# (zusätzlicher ModReq ausgeben) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 9478e3d2c55..e8090e5579e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -657,6 +657,11 @@ Interoperabilidad entre la restricción genérica no administrada de C# y F# (emitir modreq adicional) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 57fade5d250..25faaecb3a4 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -657,6 +657,11 @@ Interopérabilité entre les contraintes génériques non gérées de C# et F# (émettre un modreq supplémentaire) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 14d670e8455..30d68a3330b 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -657,6 +657,11 @@ Interoperabilità tra il vincolo generico non gestito di C# e di F# (crea un modreq aggiuntivo) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 78acb0fd944..9f2709fa559 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -657,6 +657,11 @@ C# と F# のアンマネージド ジェネリック制約の間の相互運用 (追加の modreq を出力) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 604ac431e4a..2c80d361ef6 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -657,6 +657,11 @@ C#과 F#의 관리되지 않는 제네릭 제약 조건 간의 Interop(추가 modreq 내보내기) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index fdee3d82f7d..0bd80d75a72 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -657,6 +657,11 @@ Międzyoperacyjnie między niezarządzanym ograniczeniem ogólnym języka C# i F# (emituj dodatkowe modreq) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 2f86c57d960..c0e79885fed 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -657,6 +657,11 @@ Interoperabilidade entre a restrição genérica não gerenciada de C# e F# (emitir modreq adicional) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index fefd5255a0b..3a4610e93df 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -657,6 +657,11 @@ Взаимодействие между универсальным ограничением "unmanaged" C# и F#(создание дополнительного modreq) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 5325f0ab09f..6d1bee2476b 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -657,6 +657,11 @@ C# ile F#' arasında yönetilmeyen genel kısıtlama (ek modreq yayın) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 2e8b957d810..a60e3188af7 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -657,6 +657,11 @@ C# 和 F# 的非托管泛型约束之间的互操作(发出额外的 modreq) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index f0924b3d30f..3253c4e45f7 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -657,6 +657,11 @@ C# 與 F# 的非受控泛型條件約束之間的 Interop (發出額外的 modreq) + + Allows use! _ = ... in computation expressions + Allows use! _ = ... in computation expressions + + Use type conversion cache during compilation Use type conversion cache during compilation diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang01.fs new file mode 100644 index 00000000000..4b6335c3789 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang01.fs @@ -0,0 +1,58 @@ +open System + +open System + +type Disposable(id: int) = + static let mutable disposedIds = Set.empty + static let mutable constructedIds = Set.empty + + do constructedIds <- constructedIds.Add(id) + + member _.Id = id + + static member GetDisposed() = disposedIds + static member GetConstructed() = constructedIds + static member Reset() = + disposedIds <- Set.empty + constructedIds <- Set.empty + + interface IDisposable with + member this.Dispose() = disposedIds <- disposedIds.Add(this.Id) + +type DisposableBuilder() = + member _.Using(resource: #IDisposable, f) = + async { + use res = resource + return! f res + } + + member _.Bind(disposable: Disposable, f) = async.Bind(async.Return(disposable), f) + member _.Return(x) = async.Return x + member _.ReturnFrom(x) = x + member _.Bind(task, f) = async.Bind(task, f) + +let counterDisposable = DisposableBuilder() + +let testBindingPatterns() = + Disposable.Reset() + + counterDisposable { + use! res = new Disposable(1) + use! __ = new Disposable(2) + use! (res1) = new Disposable(3) + use! _ = new Disposable(4) + use! (_) = new Disposable(5) + return () + } |> Async.RunSynchronously + + let constructed = Disposable.GetConstructed() + let disposed = Disposable.GetDisposed() + let undisposed = constructed - disposed + + if not undisposed.IsEmpty then + printfn $"Undisposed instances: %A{undisposed}" + failwithf "Not all disposables were properly disposed" + else + printfn $"Success! All %d{constructed.Count} disposables were properly disposed" + +testBindingPatterns() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang02.fs new file mode 100644 index 00000000000..d57f0b8c14d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang02.fs @@ -0,0 +1,57 @@ +open System + +open System + +type Disposable(id: int) = + static let mutable disposedIds = Set.empty + static let mutable constructedIds = Set.empty + + do constructedIds <- constructedIds.Add(id) + + member _.Id = id + + static member GetDisposed() = disposedIds + static member GetConstructed() = constructedIds + static member Reset() = + disposedIds <- Set.empty + constructedIds <- Set.empty + + interface IDisposable with + member this.Dispose() = disposedIds <- disposedIds.Add(this.Id) + +type DisposableBuilder() = + member _.Using(resource: #IDisposable, f) = + async { + use res = resource + return! f res + } + + member _.Bind(disposable: Disposable, f) = async.Bind(async.Return(disposable), f) + member _.Return(x) = async.Return x + member _.ReturnFrom(x) = x + member _.Bind(task, f) = async.Bind(task, f) + +let counterDisposable = DisposableBuilder() + +let testBindingPatterns() = + Disposable.Reset() + + counterDisposable { + use! _ = new Disposable(1) + use! _ = new Disposable(2) + use! (_) = new Disposable(3) + use! (_) = new Disposable(4) + return () + } |> Async.RunSynchronously + + let constructed = Disposable.GetConstructed() + let disposed = Disposable.GetDisposed() + let undisposed = constructed - disposed + + if not undisposed.IsEmpty then + printfn $"Undisposed instances: %A{undisposed}" + failwithf "Not all disposables were properly disposed" + else + printfn $"Success! All %d{constructed.Count} disposables were properly disposed" + +testBindingPatterns() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang03.fs new file mode 100644 index 00000000000..57c814c561a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang03.fs @@ -0,0 +1,71 @@ +open System + +type Disposable(id: int) = + static let mutable disposedIds = Map.empty + static let mutable constructedIds = Set.empty + + do constructedIds <- constructedIds.Add(id) + + member _.Id = id + + static member GetDisposed() = disposedIds + static member GetConstructed() = constructedIds + static member Reset() = + disposedIds <- Map.empty + constructedIds <- Set.empty + + interface IDisposable with + member this.Dispose() = + let currentCount = + match Map.tryFind this.Id disposedIds with + | Some count -> count + | None -> 0 + disposedIds <- Map.add this.Id (currentCount + 1) disposedIds + +type DisposableBuilder() = + member _.Using(resource: #IDisposable, f) = + async { + use res = resource + return! f res + } + + member _.Bind(disposable: Disposable, f) = async.Bind(async.Return(disposable), f) + member _.Return(x) = async.Return x + member _.ReturnFrom(x) = x + member _.Bind(task, f) = async.Bind(task, f) + +let counterDisposable = DisposableBuilder() + +let testBindingPatterns() = + Disposable.Reset() + + counterDisposable { + use! res = new Disposable(1) + use! __ = new Disposable(2) + use! (res1) = new Disposable(3) + use! _ = new Disposable(4) + use! (_) = new Disposable(5) + return () + } |> Async.RunSynchronously + + let constructed = Disposable.GetConstructed() + let disposed = Disposable.GetDisposed() + + let disposedSet = Set.ofSeq (Map.keys disposed) + let undisposed = constructed - disposedSet + + if not undisposed.IsEmpty then + printfn $"Undisposed instances: %A{undisposed}" + failwithf "Not all disposables were properly disposed" + + let multipleDisposed = + disposed + |> Map.filter (fun _ count -> count > 1) + + if not multipleDisposed.IsEmpty then + printfn $"Objects disposed multiple times: %A{multipleDisposed}" + failwithf "Some disposables were disposed multiple times" + + printfn $"Success! All %d{constructed.Count} disposables were properly disposed exactly once" + +testBindingPatterns() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang04.fs new file mode 100644 index 00000000000..3c32e29bc46 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang04.fs @@ -0,0 +1,91 @@ +open System + +type Disposable(id: int) = + static let mutable disposedIds = Map.empty + static let mutable constructedIds = Set.empty + + do constructedIds <- constructedIds.Add(id) + + member _.Id = id + + static member GetDisposed() = disposedIds + static member GetConstructed() = constructedIds + static member Reset() = + disposedIds <- Map.empty + constructedIds <- Set.empty + + interface IDisposable with + member this.Dispose() = + let currentCount = + match Map.tryFind this.Id disposedIds with + | Some count -> count + | None -> 0 + disposedIds <- Map.add this.Id (currentCount + 1) disposedIds + +type DisposableBuilder() = + member _.Using(resource: #IDisposable, f) = + async { + use res = resource + return! f res + } + + member _.Bind(disposable: Disposable, f) = async.Bind(async.Return(disposable), f) + member _.Return(x) = async.Return x + member _.ReturnFrom(x) = x + member _.Bind(task, f) = async.Bind(task, f) + +let counterDisposable = DisposableBuilder() + +let testBindingPatterns() = + Disposable.Reset() + + counterDisposable { + use! res = new Disposable(1) + use! __ = new Disposable(2) + use! (res1) = new Disposable(3) + + use! _ = new Disposable(4) + use! _ = new Disposable(5) + + use! x = new Disposable(6) + use! x = new Disposable(7) + + use! (_) = new Disposable(8) + use! (_) = new Disposable(9) + + return () + } |> Async.RunSynchronously + + let constructed = Disposable.GetConstructed() + let disposed = Disposable.GetDisposed() + + let disposedSet = Set.ofSeq (Map.keys disposed) + let undisposed = constructed - disposedSet + + if not undisposed.IsEmpty then + printfn $"Undisposed instances: %A{undisposed}" + failwithf "Not all disposables were properly disposed" + + // Verify each object was disposed exactly once + let incorrectlyDisposed = + disposed + |> Map.partition (fun _ count -> count = 1) + |> snd + + if not incorrectlyDisposed.IsEmpty then + printfn $"Objects with incorrect disposal count: %A{incorrectlyDisposed}" + failwithf "Some disposables were not disposed exactly once" + + let idChecks = + [1..9] |> List.map (fun id -> + match Map.tryFind id disposed with + | Some 1 -> true + | _ -> false + ) + + if not ((List.forall id) idChecks) then + failwithf "Not all disposable IDs were properly handled" + + printfn $"Success! All %d{constructed.Count} disposables were properly disposed exactly once, including repeated patterns" + +testBindingPatterns() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs new file mode 100644 index 00000000000..ba0f31bd885 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Language + +open FSharp.Test +open Xunit +open FSharp.Test.Compiler + +module UseBangBindingsVersion9 = + [] + let ``UseBangBindings - UseBang01_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1228, Line 43, Col 14, Line 43, Col 15, "'use!' bindings must be of the form 'use! = '") + ] + + [] + let ``UseBangBindings - UseBang02_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1228, Line 40, Col 14, Line 40, Col 15, "'use!' bindings must be of the form 'use! = '") + ] + + [] + let ``UseBangBindings - UseBang03_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1228, Line 46, Col 14, Line 46, Col 15, "'use!' bindings must be of the form 'use! = '") + ] + + [] + let ``UseBangBindings - UseBang04_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 1228, Line 47, Col 14, Line 47, Col 15, "'use!' bindings must be of the form 'use! = '") + ] + +module UseBangBindingsPreview = + [] + let ``UseBangBindings - UseBang01_fs - Preview LangVersion`` compilation = + compilation + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``UseBangBindings - UseBang02_fs - Preview LangVersion`` compilation = + compilation + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``UseBangBindings - UseBang03_fs - Preview LangVersion`` compilation = + compilation + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``UseBangBindings - UseBang04_fs - Preview LangVersion`` compilation = + compilation + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard02.fs new file mode 100644 index 00000000000..9a31ba2763b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard02.fs @@ -0,0 +1,26 @@ +open System + +type private Disposable() = + [] static val mutable private disposedTimes: int + [] static val mutable private constructedTimes: int + + do Disposable.constructedTimes <- Disposable.constructedTimes + 1 + + static member DisposeCallCount() = Disposable.disposedTimes + static member ConstructorCallCount() = Disposable.constructedTimes + + interface System.IDisposable with + member _.Dispose() = + Disposable.disposedTimes <- Disposable.disposedTimes + 1 + +let _scope = + use _ = new Disposable() + () + +let disposeCalls = Disposable.DisposeCallCount() +if disposeCalls <> 1 then + failwith "was not disposed or disposed too many times" + +let ctorCalls = Disposable.ConstructorCallCount() +if ctorCalls <> 1 then + failwithf "unexpected constructor call count: %i" ctorCalls diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs index 8196a9fe286..74137286a8a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs @@ -27,35 +27,9 @@ module UseBindings = |> withErrorCode 3350 |> withDiagnosticMessageMatches "Feature 'discard pattern in use binding' is not available.*" - [] - let ``Dispose called for discarded value of use binding`` () = - Fsx """ -type private Disposable() = - [] static val mutable private disposedTimes: int - [] static val mutable private constructedTimes: int - - do Disposable.constructedTimes <- Disposable.constructedTimes + 1 - - static member DisposeCallCount() = Disposable.disposedTimes - static member ConstructorCallCount() = Disposable.constructedTimes - - interface System.IDisposable with - member _.Dispose() = - Disposable.disposedTimes <- Disposable.disposedTimes + 1 - -let _scope = - use _ = new Disposable() - () - -let disposeCalls = Disposable.DisposeCallCount() -if disposeCalls <> 1 then - failwith "was not disposed or disposed too many times" - -let ctorCalls = Disposable.ConstructorCallCount() -if ctorCalls <> 1 then - failwithf "unexpected constructor call count: %i" ctorCalls - - """ + [] + let ``Dispose called for discarded value of use binding`` compilation = + compilation |> asExe |> withLangVersion60 |> compileAndRun diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 49b459e2796..98eb8a9336c 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -75,6 +75,7 @@ + From 54fb3da711680b99e3323c0616b9f14d63b495ef Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 30 Apr 2025 09:29:37 +0200 Subject: [PATCH 076/134] Checker: don't capture environment for checked modules (#18519) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/CheckDeclarations.fs | 11 ++-- src/Compiler/Checking/CheckDeclarations.fsi | 3 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 6 +- .../CompletionTests.fs | 64 +++++++++++++++++++ 5 files changed, 74 insertions(+), 11 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7224d401d6e..8b539ee2e56 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -27,6 +27,7 @@ * Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) +* Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 78acf62bb98..92368118f3a 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -341,7 +341,7 @@ let AddNonLocalCcu g amap scopem env assemblyName (ccu: CcuThunk, internalsVisib env /// Adjust the TcEnv to account for a fully processed "namespace" declaration in this file -let AddLocalRootModuleOrNamespace tcSink g amap scopem env (moduleTy: ModuleOrNamespaceType) = +let AddLocalRootModuleOrNamespace g amap scopem env (moduleTy: ModuleOrNamespaceType) = // Compute the top-rooted module or namespace references let modrefs = moduleTy.ModuleAndNamespaceDefinitions |> List.map mkLocalModuleRef // Compute the top-rooted type definitions @@ -350,7 +350,6 @@ let AddLocalRootModuleOrNamespace tcSink g amap scopem env (moduleTy: ModuleOrNa let env = { env with eNameResEnv = if isNil tcrefs then env.eNameResEnv else AddTyconRefsToNameEnv BulkAdd.No false g amap env.eAccessRights scopem true env.eNameResEnv tcrefs eUngeneralizableItems = addFreeItemOfModuleTy moduleTy env.eUngeneralizableItems } - CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env /// Inside "namespace X.Y.Z" there is an implicit open of "X.Y.Z" @@ -4978,7 +4977,7 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE CallNameResolutionSink cenv.tcSink (moduleEntity.Range, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Binding, env.AccessRights)) // For 'namespace rec' and 'module rec' we add the thing being defined - let envNS = if isRec then AddLocalRootModuleOrNamespace cenv.tcSink g cenv.amap m envNS modTyRoot else envNS + let envNS = if isRec then AddLocalRootModuleOrNamespace g cenv.amap m envNS modTyRoot else envNS let nsInfo = Some (modulNSOpt, envNS.eModuleOrNamespaceTypeAccumulator) let mutRecNSInfo = if isRec then nsInfo else None @@ -4990,7 +4989,7 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE if isNil enclosingNamespacePath then envAtEnd else - let env = AddLocalRootModuleOrNamespace cenv.tcSink g cenv.amap m env modTyRoot + let env = AddLocalRootModuleOrNamespace g cenv.amap m env modTyRoot // If the namespace is an interactive fragment e.g. FSI_0002, then open FSI_0002 in the subsequent environment. let env, _openDecls = @@ -5440,7 +5439,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem CallNameResolutionSink cenv.tcSink (moduleEntity.Range, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Binding, env.AccessRights)) // For 'namespace rec' and 'module rec' we add the thing being defined - let envNS = if isRec then AddLocalRootModuleOrNamespace cenv.tcSink g cenv.amap m envNS modTyRoot else envNS + let envNS = if isRec then AddLocalRootModuleOrNamespace g cenv.amap m envNS modTyRoot else envNS let nsInfo = Some (modulNSOpt, envNS.eModuleOrNamespaceTypeAccumulator) let mutRecNSInfo = if isRec then nsInfo else None @@ -5453,7 +5452,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem if isNil enclosingNamespacePath then envAtEnd, [] else - let env = AddLocalRootModuleOrNamespace cenv.tcSink g cenv.amap m env modTyRoot + let env = AddLocalRootModuleOrNamespace g cenv.amap m env modTyRoot // If the namespace is an interactive fragment e.g. FSI_0002, then open FSI_0002 in the subsequent environment let env, openDecls = diff --git a/src/Compiler/Checking/CheckDeclarations.fsi b/src/Compiler/Checking/CheckDeclarations.fsi index fb4679f2438..9b06fcc828d 100644 --- a/src/Compiler/Checking/CheckDeclarations.fsi +++ b/src/Compiler/Checking/CheckDeclarations.fsi @@ -13,8 +13,7 @@ open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.TypedTree -val AddLocalRootModuleOrNamespace: - TcResultsSink -> TcGlobals -> ImportMap -> range -> TcEnv -> ModuleOrNamespaceType -> TcEnv +val AddLocalRootModuleOrNamespace: TcGlobals -> ImportMap -> range -> TcEnv -> ModuleOrNamespaceType -> TcEnv val CreateInitialTcEnv: TcGlobals * ImportMap * range * assemblyName: string * (CcuThunk * string list * string list) list -> diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 6b7171b5697..3d9884b2cef 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -1198,14 +1198,14 @@ let AddCheckResultsToTcState // Add the implementation as to the implementation env let tcImplEnv = - AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcImplEnv implFileSigType + AddLocalRootModuleOrNamespace tcGlobals amap m tcImplEnv implFileSigType // Add the implementation as to the signature env (unless it had an explicit signature) let tcSigEnv = if hadSig then tcState.tcsTcSigEnv else - AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv implFileSigType + AddLocalRootModuleOrNamespace tcGlobals amap m tcState.tcsTcSigEnv implFileSigType // Open the prefixPath for fsi.exe (tcImplEnv) let tcImplEnv, openDecls = @@ -1563,7 +1563,7 @@ let CheckOneInputWithCallback let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs let tcSigEnv = - AddLocalRootModuleOrNamespace TcResultsSink.NoSink tcGlobals amap m tcState.tcsTcSigEnv sigFileType + AddLocalRootModuleOrNamespace tcGlobals amap m tcState.tcsTcSigEnv sigFileType // Add the signature to the signature env (unless it had an explicit signature) let ccuSigForFile = CombineCcuContentFragments [ sigFileType; tcState.tcsCcuSig ] diff --git a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs index 38c6812728d..c4a924d25d9 100644 --- a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs @@ -134,3 +134,67 @@ let f (s: string) = () """ assertHasItemWithNames ["Length"] info + + +[] +let ``Import - Ns 01`` () = + let info = + getCompletionInfo "let _: R " (14, 12) """ +namespace Ns + +type Rec1 = { F: int } + + +namespace Ns + +type Rec2 = { F: int } + +module M = + + type Rec3 = { F: int } + + let _: R = () +""" + assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info + +[] +let ``Import - Ns 02 - Rec`` () = + let info = + getCompletionInfo "let _: R " (14, 12) """ +namespace Ns + +type Rec1 = { F: int } + + +namespace rec Ns + +type Rec2 = { F: int } + +module M = + + type Rec3 = { F: int } + + let _: R = () +""" + assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info + +[] +let ``Import - Ns 03 - Rec`` () = + let info = + getCompletionInfo "let _: R " (14, 12) """ +namespace Ns + +type Rec1 = { F: int } + + +namespace rec Ns + +type Rec2 = { F: int } + +module rec M = + + type Rec3 = { F: int } + + let _: R = () +""" + assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info \ No newline at end of file From cf6b53e8f3aff1a79e660ad2cdf84564dd0ff1c3 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:07:56 +0200 Subject: [PATCH 077/134] reuse fsi sessions in tests (#18527) --- eng/build.sh | 2 +- .../Miscellaneous/FsharpSuiteMigrated.fs | 26 +++++--- .../Miscellaneous/MigratedCoreTests.fs | 10 +-- tests/FSharp.Test.Utilities/Compiler.fs | 12 +++- tests/FSharp.Test.Utilities/ScriptHelpers.fs | 5 +- tests/FSharp.Test.Utilities/XunitHelpers.fs | 62 ++++++++++++++----- 6 files changed, 83 insertions(+), 34 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index 53de7fda4c9..3c9404c8161 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -226,7 +226,7 @@ function Test() { projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" - args+=" -- xUnit.MaxParallelThreads=1" + "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs index 8ab6a4ac584..ecba3a3fa85 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/FsharpSuiteMigrated.fs @@ -14,11 +14,18 @@ open FSharp.Test.ScriptHelpers module Configuration = let supportedNames = set ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] +[] +type ScriptSessionIsolation = Shared | Isolated + module ScriptRunner = open Internal.Utilities.Library - let private createEngine(args,version) = - getSessionForEval args version + let private getOrCreateEngine(args,version) sessionIsolation = + match sessionIsolation with + | ScriptSessionIsolation.Isolated -> + new FSharpScript(args, true, version) + | ScriptSessionIsolation.Shared -> + getSessionForEval args version let defaultDefines = [ @@ -27,12 +34,12 @@ module ScriptRunner = #endif ] - let runScriptFile version (cu:CompilationUnit) = + let runScriptFile version sessionIsolation (cu:CompilationUnit) = let cu = cu |> withDefines defaultDefines match cu with | FS fsSource -> use capture = new TestConsole.ExecutionCapture() - let engine = createEngine (fsSource.Options |> Array.ofList,version) + let engine = getOrCreateEngine (fsSource.Options |> Array.ofList,version) sessionIsolation let res = evalScriptFromDiskInSharedSession engine cu match res with | CompilationResult.Failure _ -> res @@ -88,7 +95,7 @@ module TestFrameworkAdapter = | LangVersion.SupportsMl -> "5.0", "--mlcompatibility" :: bonusArgs - let singleTestBuildAndRunAuxVersion (folder:string) bonusArgs mode langVersion = + let singleTestBuildAndRunAuxVersion (folder:string) bonusArgs mode langVersion sessionIsolation = let absFolder = Path.Combine(baseFolder,folder) let supportedNames, files = match mode with @@ -137,17 +144,17 @@ module TestFrameworkAdapter = cu |> withDebug |> withNoOptimize - |> ScriptRunner.runScriptFile langVersion + |> ScriptRunner.runScriptFile langVersion sessionIsolation |> shouldSucceed | FSC_OPTIMIZED -> cu |> withOptimize |> withNoDebug - |> ScriptRunner.runScriptFile langVersion + |> ScriptRunner.runScriptFile langVersion sessionIsolation |> shouldSucceed | FSI -> cu - |> ScriptRunner.runScriptFile langVersion + |> ScriptRunner.runScriptFile langVersion sessionIsolation |> shouldSucceed | COMPILED_EXE_APP -> cu @@ -161,7 +168,8 @@ module TestFrameworkAdapter = let singleTestBuildAndRunAux folder bonusArgs mode = singleTestBuildAndRunAuxVersion folder bonusArgs mode LangVersion.Latest let singleTestBuildAndRunVersion folder mode version = singleTestBuildAndRunAuxVersion folder [] mode version - let singleTestBuildAndRun folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest + let singleTestBuildAndRun folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest ScriptSessionIsolation.Shared + let singleTestBuildAndRunIsolated folder mode = singleTestBuildAndRunVersion folder mode LangVersion.Latest ScriptSessionIsolation.Isolated let singleVersionedNegTestAux folder bonusArgs version testName = singleTestBuildAndRunAuxVersion folder bonusArgs (NEG_TEST_BUILD testName) version diff --git a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs index d0cd80472f1..bc2e782a769 100644 --- a/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Miscellaneous/MigratedCoreTests.fs @@ -352,13 +352,13 @@ let ``subtype-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/subtype" FSC_OPTI let ``subtype-FSI`` () = singleTestBuildAndRun "core/subtype" FSI [] -let ``syntax-FSC_DEBUG`` () = singleTestBuildAndRun "core/syntax" FSC_DEBUG +let ``syntax-FSC_DEBUG`` () = singleTestBuildAndRunIsolated "core/syntax" FSC_DEBUG [] -let ``syntax-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/syntax" FSC_OPTIMIZED +let ``syntax-FSC_OPTIMIZED`` () = singleTestBuildAndRunIsolated "core/syntax" FSC_OPTIMIZED [] -let ``syntax-FSI`` () = singleTestBuildAndRun "core/syntax" FSI +let ``syntax-FSI`` () = singleTestBuildAndRunIsolated "core/syntax" FSI [] let ``test int32-FSC_DEBUG`` () = singleTestBuildAndRun "core/int32" FSC_DEBUG @@ -453,10 +453,10 @@ let ``fsi_load-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/fsi-load" FSC_OP let ``fsi_load-FSI`` () = singleTestBuildAndRun "core/fsi-load" FSI [] -let ``reflect-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/reflect" FSC_OPTIMIZED +let ``reflect-FSC_OPTIMIZED`` () = singleTestBuildAndRunIsolated "core/reflect" FSC_OPTIMIZED [] -let ``reflect-FSI`` () = singleTestBuildAndRun "core/reflect" FSI +let ``reflect-FSI`` () = singleTestBuildAndRunIsolated "core/reflect" FSI let isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 2b3ccface37..9cda28613dd 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1154,7 +1154,17 @@ module rec Compiler = evalFSharp fs script | _ -> failwith "Script evaluation is only supported for F#." - let getSessionForEval args version = new FSharpScript(additionalArgs=args,quiet=true,langVersion=version) + let internal sessionCache = + Collections.Concurrent.ConcurrentDictionary * LangVersion, FSharpScript>() + + let getSessionForEval args version = + let key = Set args, version + match sessionCache.TryGetValue(key) with + | true, script -> script + | _ -> + let script = new FSharpScript(additionalArgs=args,quiet=true,langVersion=version) + sessionCache.TryAdd(key, script) |> ignore + script let evalInSharedSession (script:FSharpScript) (cUnit: CompilationUnit) : CompilationResult = match cUnit with diff --git a/tests/FSharp.Test.Utilities/ScriptHelpers.fs b/tests/FSharp.Test.Utilities/ScriptHelpers.fs index aa0593fa090..f7b68ac812e 100644 --- a/tests/FSharp.Test.Utilities/ScriptHelpers.fs +++ b/tests/FSharp.Test.Utilities/ScriptHelpers.fs @@ -64,7 +64,10 @@ type FSharpScript(?additionalArgs: string[], ?quiet: bool, ?langVersion: LangVer Thread.CurrentThread.CurrentCulture <- Option.defaultValue Globalization.CultureInfo.InvariantCulture desiredCulture let cancellationToken = defaultArg cancellationToken CancellationToken.None - let ch, errors = fsi.EvalInteractionNonThrowing(code, cancellationToken) + let ch, errors = + // lock, because For memory conservation in CI FSharpScripts may be reused between tests + lock fsi <| fun () -> + fsi.EvalInteractionNonThrowing(code, cancellationToken) Thread.CurrentThread.CurrentCulture <- originalCulture diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 34a44df17ed..b17e1b1cd4b 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -12,9 +12,9 @@ open TestFramework open FSharp.Compiler.Diagnostics -open OpenTelemetry open OpenTelemetry.Resources open OpenTelemetry.Trace +open OpenTelemetry.Metrics /// Disables custom internal parallelization added with XUNIT_EXTRAS. /// Execute test cases in a class or a module one by one instead of all at once. Allow other collections to run simultaneously. @@ -130,6 +130,45 @@ type CustomTheoryTestCase = #endif + +type OpenTelemetryExport(testRunName, enable) = + // On Windows forwarding localhost to wsl2 docker container sometimes does not work. Use IP address instead. + let otlpEndpoint = Uri("http://127.0.0.1:4317") + + // Configure OpenTelemetry export. + let providers : IDisposable list = + if not enable then [] else + [ + // Configure OpenTelemetry tracing export. Traces can be viewed in Jaeger or other compatible tools. + OpenTelemetry.Sdk.CreateTracerProviderBuilder() + .AddSource(ActivityNames.FscSourceName) + .ConfigureResource(fun r -> r.AddService("F#") |> ignore) + .AddOtlpExporter(fun o -> + o.Endpoint <- otlpEndpoint + o.Protocol <- OpenTelemetry.Exporter.OtlpExportProtocol.Grpc + // Empirical values to ensure no traces are lost and no significant delay at the end of test run. + o.TimeoutMilliseconds <- 200 + o.BatchExportProcessorOptions.MaxQueueSize <- 16384 + o.BatchExportProcessorOptions.ScheduledDelayMilliseconds <- 100 + ) + .Build() + + // Configure OpenTelemetry metrics export. Metrics can be viewed in Prometheus or other compatible tools. + OpenTelemetry.Sdk.CreateMeterProviderBuilder() + .AddMeter("System.Runtime") + .ConfigureResource(fun r -> r.AddService(testRunName) |> ignore) + .AddOtlpExporter(fun e m -> + e.Endpoint <- otlpEndpoint + e.Protocol <- OpenTelemetry.Exporter.OtlpExportProtocol.Grpc + m.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds <- 1000 + ) + .Build() + ] + + interface IDisposable with + member this.Dispose() = + for p in providers do p.Dispose() + /// `XunitTestFramework` providing parallel console support and conditionally enabling optional xUnit customizations. type FSharpXunitFramework(sink: IMessageSink) = inherit XunitTestFramework(sink) @@ -145,33 +184,22 @@ type FSharpXunitFramework(sink: IMessageSink) = // We need AssemblyResolver already here, because OpenTelemetry loads some assemblies dynamically. AssemblyResolver.addResolver () #endif - - // Configure OpenTelemetry export. Traces can be viewed in Jaeger or other compatible tools. - use tracerProvider = - OpenTelemetry.Sdk.CreateTracerProviderBuilder() - .AddSource(ActivityNames.FscSourceName) - .ConfigureResource(fun r -> r.AddService("F#") |> ignore) - .AddOtlpExporter(fun o -> - // Empirical values to ensure no traces are lost and no significant delay at the end of test run. - o.TimeoutMilliseconds <- 200 - o.BatchExportProcessorOptions.MaxQueueSize <- 16384 - o.BatchExportProcessorOptions.ScheduledDelayMilliseconds <- 100 - ) - .Build() + let testRunName = $"RunTests_{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" + + use _ = new OpenTelemetryExport(testRunName, Environment.GetEnvironmentVariable("FSHARP_OTEL_EXPORT") <> null) + logConfig initialConfig log "Installing TestConsole redirection" TestConsole.install() begin - use _ = Activity.startNoTags $"RunTests_{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" + use _ = Activity.startNoTags testRunName // We can't just call base.RunTestCases here, because it's implementation is async void. use runner = new XunitTestAssemblyRunner (x.TestAssembly, testCases, x.DiagnosticMessageSink, executionMessageSink, executionOptions) runner.RunAsync().Wait() end - tracerProvider.ForceFlush() |> ignore - cleanUpTemporaryDirectoryOfThisTestRun () } From 34dbfc17eaea59e08286ccfb7d9b28b6b35269e2 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 30 Apr 2025 22:09:42 +0200 Subject: [PATCH 078/134] Code completion: fix getting qualifier expression in `do` statements in type decls (#18524) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Service/ServiceParseTreeWalk.fs | 2 + tests/FSharp.Compiler.Service.Tests/Common.fs | 10 ++ .../CompletionTests.fs | 113 ++++++++++++------ 4 files changed, 92 insertions(+), 34 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 8b539ee2e56..7cb7eae4d6c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -28,6 +28,7 @@ * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) +* Code completion: fix getting qualifier expression in do statements in type decls ([PR #18524](https://github.com/dotnet/fsharp/pull/18524)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 659f4c4bc60..33734db9a62 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -1014,6 +1014,8 @@ module SyntaxTraversal = let path = SyntaxNode.SynBinding b :: origPath match b with + | SynBinding(kind = SynBindingKind.Do; expr = expr) -> traverseSynExpr path expr + | SynBinding(headPat = synPat; expr = synExpr; attributes = attributes; range = m) -> [ yield! attributeApplicationDives path attributes diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index dad4f489514..f1de5739d47 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -342,6 +342,16 @@ let rec allSymbolsInEntities compGen (entities: IList) = yield! allSymbolsInEntities compGen entity.NestedEntities ] +let getCursorPosAndPrepareSource (source: string) : string * string * pos = + let lines = source.Split([|"\r\n"; "\n"|], StringSplitOptions.None) + let line = lines |> Seq.findIndex _.Contains("{caret}") + let lineText = lines[line] + let column = lineText.IndexOf("{caret}") + + let source = source.Replace("{caret}", "") + let lineText = lineText.Replace("{caret}", "") + source, lineText, Position.mkPos (line + 1) (column - 1) + let getParseResults (source: string) = parseSourceCode("Test.fsx", source) diff --git a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs index c4a924d25d9..2d70f5c58f6 100644 --- a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs @@ -4,10 +4,11 @@ open FSharp.Compiler.Service.Tests.Common open FSharp.Compiler.EditorServices open Xunit -let getCompletionInfo lineText (line, column) source = +let getCompletionInfo source = + let source, lineText, pos = getCursorPosAndPrepareSource source let parseResults, checkResults = getParseAndCheckResultsPreview source - let plid = QuickParse.GetPartialLongNameEx(lineText, column) - checkResults.GetDeclarationListInfo(Some parseResults, line, lineText, plid) + let plid = QuickParse.GetPartialLongNameEx(lineText, pos.Column) + checkResults.GetDeclarationListInfo(Some parseResults, pos.Line, lineText, plid) let getCompletionItemNames (completionInfo: DeclarationListInfo) = completionInfo.Items |> Array.map (fun item -> item.NameInCode) @@ -19,92 +20,100 @@ let assertHasItemWithNames names (completionInfo: DeclarationListInfo) = Assert.True(Set.contains name itemNames, $"{name} not found in {itemNames}") [] -let ``Expr - After record decl`` () = - let info = getCompletionInfo "{ Fi }" (4, 0) """ +let ``Expr - After record decl 01`` () = + let info = getCompletionInfo """ type Record = { Field: int } +{ Fi{caret} } +""" + assertHasItemWithNames ["ignore"] info +[] +let ``Expr - After record decl 02`` () = + let info = getCompletionInfo """ +type Record = { Field: int } + +{caret} """ assertHasItemWithNames ["ignore"] info [] let ``Expr - record - field 01 - anon module`` () = - let info = getCompletionInfo "{ Fi }" (4, 3) """ + let info = getCompletionInfo """ type Record = { Field: int } -{ Fi } +{ Fi{caret} } """ assertHasItemWithNames ["Field"] info [] let ``Expr - record - field 02 - anon module`` () = - let info = getCompletionInfo "{ Fi }" (6, 3) """ + let info = getCompletionInfo """ type Record = { Field: int } let record = { Field = 1 } -{ Fi } +{ Fi{caret} } """ assertHasItemWithNames ["Field"] info [] let ``Expr - record - empty 01`` () = - let info = getCompletionInfo "{ }" (4, 2) """ + let info = getCompletionInfo """ type Record = { Field: int } -{ } +{ {caret} } """ assertHasItemWithNames ["Field"] info [] let ``Expr - record - empty 02`` () = - let info = getCompletionInfo "{ }" (6, 2) """ + let info = getCompletionInfo """ type Record = { Field: int } let record = { Field = 1 } -{ } +{ {caret} } """ assertHasItemWithNames ["Field"; "record"] info [] let ``Underscore dot lambda - completion`` () = - let info = getCompletionInfo " |> _.Len" (4, 11) """ + let info = getCompletionInfo """ let myFancyFunc (x:string) = x - |> _.Len""" + |> _.Len{caret}""" assertHasItemWithNames ["Length"] info [] let ``Underscore dot lambda - method completion`` () = - let info = getCompletionInfo " |> _.ToL" (4, 11) """ + let info = getCompletionInfo """ let myFancyFunc (x:string) = x - |> _.ToL""" + |> _.ToL{caret}""" assertHasItemWithNames ["ToLower"] info [] let ``Underscore dot lambda - No prefix`` () = - let info = getCompletionInfo "[s] |> List.map _. " (3, 18) """ + let info = getCompletionInfo """ let s = "" -[s] |> List.map _. +[s] |> List.map _.{caret} """ assertHasItemWithNames ["Length"] info [] let ``Type decl - Record - Field type 01`` () = - let info = getCompletionInfo "type Record = { Field: }" (2, 23) """ -type Record = { Field: } + let info = getCompletionInfo """ +type Record = { Field: {caret} } """ assertHasItemWithNames ["string"] info [] let ``Expr - Qualifier 01`` () = - let info = - getCompletionInfo "s.Trim(). " (3, 13) """ + let info = getCompletionInfo """ let f (s: string) = - s.Trim(). + s.Trim().{caret} s.Trim() s.Trim() () @@ -114,10 +123,10 @@ let f (s: string) = [] let ``Expr - Qualifier 02`` () = let info = - getCompletionInfo "s.Trim(). " (4, 13) """ + getCompletionInfo """ let f (s: string) = s.Trim() - s.Trim(). + s.Trim().{caret} s.Trim() () """ @@ -126,20 +135,56 @@ let f (s: string) = [] let ``Expr - Qualifier 03`` () = let info = - getCompletionInfo "s.Trim(). " (5, 13) """ + getCompletionInfo """ let f (s: string) = s.Trim() s.Trim() - s.Trim(). + s.Trim().{caret} () """ assertHasItemWithNames ["Length"] info +[] +let ``Expr - Qualifier 04`` () = + let info = + getCompletionInfo """ +type T() = + do + System.String.Empty.ToString().L{caret} +""" + assertHasItemWithNames ["Length"] info + +[] +let ``Expr - Qualifier 05`` () = + let info = + getCompletionInfo """ +System.String.Empty.ToString().{caret} +""" + assertHasItemWithNames ["Length"] info + +[] +let ``Expr - Qualifier 06`` () = + let info = + getCompletionInfo """ +System.String.Empty.ToString().L{caret} +""" + assertHasItemWithNames ["Length"] info + +[] +let ``Expr - Qualifier 07`` () = + let info = + getCompletionInfo """ +type T() = + do + System.String.Empty.ToString().L{caret} + () +""" + assertHasItemWithNames ["Length"] info [] let ``Import - Ns 01`` () = let info = - getCompletionInfo "let _: R " (14, 12) """ + getCompletionInfo """ namespace Ns type Rec1 = { F: int } @@ -153,14 +198,14 @@ module M = type Rec3 = { F: int } - let _: R = () + let _: R{caret} = () """ assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info [] let ``Import - Ns 02 - Rec`` () = let info = - getCompletionInfo "let _: R " (14, 12) """ + getCompletionInfo """ namespace Ns type Rec1 = { F: int } @@ -174,14 +219,14 @@ module M = type Rec3 = { F: int } - let _: R = () + let _: R{caret} = () """ assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info [] let ``Import - Ns 03 - Rec`` () = let info = - getCompletionInfo "let _: R " (14, 12) """ + getCompletionInfo """ namespace Ns type Rec1 = { F: int } @@ -195,6 +240,6 @@ module rec M = type Rec3 = { F: int } - let _: R = () + let _: R{caret} = () """ assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info \ No newline at end of file From 05500b8b5d64b324c57a28b9b991ede079df03f4 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 1 May 2025 08:05:00 +0200 Subject: [PATCH 079/134] Enable TypeSubsumptionCache for IDE use (#18499) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/TypeRelations.fs | 8 +- src/Compiler/Checking/import.fs | 42 +-- src/Compiler/Checking/import.fsi | 12 +- src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Utilities/Caches.fs | 316 ++++++++++++++++++ src/Compiler/Utilities/Caches.fsi | 44 +++ src/Compiler/Utilities/TypeHashing.fs | 82 ++++- .../CompilerService/Caches.fs | 90 +++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + tests/FSharp.Test.Utilities/XunitHelpers.fs | 5 + .../src/FSharp.Editor/Common/Logging.fs | 73 +++- .../LanguageService/LanguageService.fs | 18 +- .../FSharp.Editor.Tests.fsproj | 3 + .../tests/Salsa/VisualFSharp.Salsa.fsproj | 3 + .../UnitTests/VisualFSharp.UnitTests.fsproj | 3 + 16 files changed, 634 insertions(+), 69 deletions(-) create mode 100644 src/Compiler/Utilities/Caches.fs create mode 100644 src/Compiler/Utilities/Caches.fsi create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Caches.fs diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7cb7eae4d6c..c39b44e1d7a 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -40,6 +40,7 @@ * Type parameter constraint `null` in generic code will now automatically imply `not struct` ([Issue #18320](https://github.com/dotnet/fsharp/issues/18320), [PR #18323](https://github.com/dotnet/fsharp/pull/18323)) * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) * Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394) +* Enable TypeSubsumptionCache for IDE use. [PR #18499](https://github.com/dotnet/fsharp/pull/18499) ### Changed diff --git a/src/Compiler/Checking/TypeRelations.fs b/src/Compiler/Checking/TypeRelations.fs index 2cb5dd4057a..fddf6027875 100644 --- a/src/Compiler/Checking/TypeRelations.fs +++ b/src/Compiler/Checking/TypeRelations.fs @@ -102,7 +102,7 @@ let TypesFeasiblyEquivStripMeasures g amap m ty1 ty2 = TypesFeasiblyEquivalent true 0 g amap m ty1 ty2 let inline TryGetCachedTypeSubsumption (g: TcGlobals) (amap: ImportMap) key = - if g.compilationMode = CompilationMode.OneOff && g.langVersion.SupportsFeature LanguageFeature.UseTypeSubsumptionCache then + if g.langVersion.SupportsFeature LanguageFeature.UseTypeSubsumptionCache then match amap.TypeSubsumptionCache.TryGetValue(key) with | true, subsumes -> ValueSome subsumes @@ -112,8 +112,8 @@ let inline TryGetCachedTypeSubsumption (g: TcGlobals) (amap: ImportMap) key = ValueNone let inline UpdateCachedTypeSubsumption (g: TcGlobals) (amap: ImportMap) key subsumes : unit = - if g.compilationMode = CompilationMode.OneOff && g.langVersion.SupportsFeature LanguageFeature.UseTypeSubsumptionCache then - amap.TypeSubsumptionCache[key] <- subsumes + if g.langVersion.SupportsFeature LanguageFeature.UseTypeSubsumptionCache then + amap.TypeSubsumptionCache.TryAdd(key, subsumes) |> ignore /// The feasible coercion relation. Part of the language spec. let rec TypeFeasiblySubsumesType ndeep (g: TcGlobals) (amap: ImportMap) m (ty1: TType) (canCoerce: CanCoerce) (ty2: TType) = @@ -125,7 +125,7 @@ let rec TypeFeasiblySubsumesType ndeep (g: TcGlobals) (amap: ImportMap) m (ty1: let ty2 = stripTyEqns g ty2 // Check if language feature supported - let key = TTypeCacheKey.FromStrippedTypes (ty1, ty2, canCoerce, g) + let key = TTypeCacheKey.FromStrippedTypes (ty1, ty2, canCoerce) match TryGetCachedTypeSubsumption g amap key with | ValueSome subsumes -> diff --git a/src/Compiler/Checking/import.fs b/src/Compiler/Checking/import.fs index c87d6cdad03..f1f44090f19 100644 --- a/src/Compiler/Checking/import.fs +++ b/src/Compiler/Checking/import.fs @@ -6,22 +6,25 @@ module internal FSharp.Compiler.Import open System.Collections.Concurrent open System.Collections.Generic open System.Collections.Immutable -open FSharp.Compiler.Text.Range +open System.Diagnostics + open Internal.Utilities.Library open Internal.Utilities.Library.Extras open Internal.Utilities.TypeHashing -open Internal.Utilities.TypeHashing.HashTypes + open FSharp.Compiler open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.Text +open FSharp.Compiler.Text.Range open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TypedTreeOps open FSharp.Compiler.TcGlobals +open FSharp.Compiler.Caches #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders @@ -52,18 +55,18 @@ type CanCoerce = | CanCoerce | NoCoerce -type [] TTypeCacheKey = +[] +type TTypeCacheKey = val ty1: TType val ty2: TType val canCoerce: CanCoerce - val tcGlobals: TcGlobals - private new (ty1, ty2, canCoerce, tcGlobals) = - { ty1 = ty1; ty2 = ty2; canCoerce = canCoerce; tcGlobals = tcGlobals } + private new (ty1, ty2, canCoerce) = + { ty1 = ty1; ty2 = ty2; canCoerce = canCoerce } - static member FromStrippedTypes (ty1, ty2, canCoerce, tcGlobals) = - TTypeCacheKey(ty1, ty2, canCoerce, tcGlobals) + static member FromStrippedTypes (ty1, ty2, canCoerce) = + TTypeCacheKey(ty1, ty2, canCoerce) interface System.IEquatable with member this.Equals other = @@ -72,23 +75,24 @@ type [] TTypeCacheKey = elif this.ty1 === other.ty1 && this.ty2 === other.ty2 then true else - stampEquals this.tcGlobals this.ty1 other.ty1 - && stampEquals this.tcGlobals this.ty2 other.ty2 + HashStamps.stampEquals this.ty1 other.ty1 + && HashStamps.stampEquals this.ty2 other.ty2 override this.Equals(other:objnull) = match other with | :? TTypeCacheKey as p -> (this :> System.IEquatable).Equals p | _ -> false - override this.GetHashCode() : int = - let g = this.tcGlobals - - let ty1Hash = combineHash (hashStamp g this.ty1) (hashTType g this.ty1) - let ty2Hash = combineHash (hashStamp g this.ty2) (hashTType g this.ty2) + override this.GetHashCode () : int = + HashStamps.hashTType this.ty1 + |> pipeToHash (HashStamps.hashTType this.ty2) + |> pipeToHash (hash this.canCoerce) - let combined = combineHash (combineHash ty1Hash ty2Hash) (hash this.canCoerce) + override this.ToString () = $"{this.ty1.DebugText}-{this.ty2.DebugText}" - combined +let typeSubsumptionCache = + // Leave most of the capacity in reserve for bursts. + lazy Cache.Create({ TotalCapacity = 131072; HeadroomPercentage = 75 }, name = "TypeSubsumptionCache") //------------------------------------------------------------------------- // Import an IL types as F# types. @@ -106,15 +110,13 @@ type [] TTypeCacheKey = type ImportMap(g: TcGlobals, assemblyLoader: AssemblyLoader) = let typeRefToTyconRefCache = ConcurrentDictionary() - let typeSubsumptionCache = ConcurrentDictionary(System.Environment.ProcessorCount, 1024) - member _.g = g member _.assemblyLoader = assemblyLoader member _.ILTypeRefToTyconRefCache = typeRefToTyconRefCache - member _.TypeSubsumptionCache = typeSubsumptionCache + member val TypeSubsumptionCache: Cache = typeSubsumptionCache.Value let CanImportILScopeRef (env: ImportMap) m scoref = diff --git a/src/Compiler/Checking/import.fsi b/src/Compiler/Checking/import.fsi index c387558fcba..72611e12bf7 100644 --- a/src/Compiler/Checking/import.fsi +++ b/src/Compiler/Checking/import.fsi @@ -5,13 +5,12 @@ module internal FSharp.Compiler.Import open Internal.Utilities.Library open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.Caches open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree -open System.Collections.Concurrent - #if !NO_TYPEPROVIDERS open FSharp.Compiler.TypeProviders #endif @@ -45,15 +44,14 @@ type CanCoerce = [] type TTypeCacheKey = interface System.IEquatable - private new: ty1: TType * ty2: TType * canCoerce: CanCoerce * tcGlobals: TcGlobals -> TTypeCacheKey + private new: ty1: TType * ty2: TType * canCoerce: CanCoerce -> TTypeCacheKey - static member FromStrippedTypes: - ty1: TType * ty2: TType * canCoerce: CanCoerce * tcGlobals: TcGlobals -> TTypeCacheKey + static member FromStrippedTypes: ty1: TType * ty2: TType * canCoerce: CanCoerce -> TTypeCacheKey val ty1: TType val ty2: TType val canCoerce: CanCoerce - val tcGlobals: TcGlobals + override GetHashCode: unit -> int /// Represents a context used for converting AbstractIL .NET and provided types to F# internal compiler data structures. @@ -73,7 +71,7 @@ type ImportMap = member g: TcGlobals /// Type subsumption cache - member TypeSubsumptionCache: ConcurrentDictionary + member TypeSubsumptionCache: Cache module Nullness = diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index 74e59954e8f..bbddf424684 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -146,6 +146,8 @@ + + diff --git a/src/Compiler/Utilities/Caches.fs b/src/Compiler/Utilities/Caches.fs new file mode 100644 index 00000000000..04829d4d1f3 --- /dev/null +++ b/src/Compiler/Utilities/Caches.fs @@ -0,0 +1,316 @@ +// LinkedList uses nulls, so we need to disable the nullability warnings for this file. +namespace FSharp.Compiler.Caches + +open System +open System.Collections.Generic +open System.Collections.Concurrent +open System.Threading +open System.Diagnostics +open System.Diagnostics.Metrics + +[] +type CacheOptions = + { + /// Total capacity, determines the size of the underlying store. + TotalCapacity: int + + /// Safety margin size as a percentage of TotalCapacity. + HeadroomPercentage: int + } + + static member Default = + { + TotalCapacity = 128 + HeadroomPercentage = 50 + } + +// It is important that this is not a struct, because LinkedListNode holds a reference to it, +// and it holds the reference to that Node, in a circular way. +[] +[] +type CachedEntity<'Key, 'Value> = + val mutable Key: 'Key + val mutable Value: 'Value + val mutable AccessCount: int64 + val mutable Node: LinkedListNode> voption + + new(key, value) = + { + Key = key + Value = value + AccessCount = 0L + Node = ValueNone + } + + // This is one time initialization, outside of the constructor because of circular reference. + // The contract is that each CachedEntity that the EntityPool produces, has Node assigned. + member this.WithNode() = + this.Node <- ValueSome(LinkedListNode this) + this + + member this.ReUse(key, value) = + this.Key <- key + this.Value <- value + this.AccessCount <- 0L + this + + override this.ToString() = $"{this.Key}" + +// Currently the Cache itself exposes Metrics.Counters that count raw cache events: hits, misses, evictions etc. +// This class observes those counters and keeps a snapshot of readings. For now this is used only to print cache stats in debug mode. +// TODO: We could add some System.Diagnostics.Metrics.Gauge instruments to this class, to get computed stats also exposed as metrics. +type CacheMetrics(cacheId) = + static let meter = new Meter("FSharp.Compiler.Cache") + + static let observedCaches = ConcurrentDictionary() + + let readings = ConcurrentDictionary() + + let listener = new MeterListener() + + do + listener.InstrumentPublished <- + fun i l -> + if i.Meter = meter && i.Description = cacheId then + l.EnableMeasurementEvents(i) + + listener.SetMeasurementEventCallback(fun k v _ _ -> Interlocked.Add(readings.GetOrAdd(k.Name, ref 0L), v) |> ignore) + listener.Start() + + member this.Dispose() = listener.Dispose() + + member val CacheId = cacheId + + static member val Meter = meter + + member val RecentStats = "-" with get, set + + member this.TryUpdateStats(clearCounts) = + let ratio = + try + float readings["hits"].Value + / float (readings["hits"].Value + readings["misses"].Value) + * 100.0 + with _ -> + Double.NaN + + let stats = + [ + for name in readings.Keys do + let v = readings[name].Value + + if v > 0 then + $"{name}: {v}" + ] + |> String.concat ", " + |> sprintf "%s | hit ratio: %s %s" this.CacheId (if Double.IsNaN(ratio) then "-" else $"%.1f{ratio}%%") + + if clearCounts then + for r in readings.Values do + Interlocked.Exchange(r, 0L) |> ignore + + if stats <> this.RecentStats then + this.RecentStats <- stats + true + else + false + + // TODO: Should return a Map, not a string + static member GetStats(cacheId) = + observedCaches[cacheId].TryUpdateStats(false) |> ignore + observedCaches[cacheId].RecentStats + + static member GetStatsUpdateForAllCaches(clearCounts) = + [ + for i in observedCaches.Values do + if i.TryUpdateStats(clearCounts) then + i.RecentStats + ] + |> String.concat "\n" + + static member AddInstrumentation(cacheId) = + if observedCaches.ContainsKey cacheId then + invalidArg "cacheId" $"cache with name {cacheId} already exists" + + observedCaches[cacheId] <- new CacheMetrics(cacheId) + + static member RemoveInstrumentation(cacheId) = + observedCaches[cacheId].Dispose() + observedCaches.TryRemove(cacheId) |> ignore + +// Creates and after reclaiming holds entities for reuse. +// More than totalCapacity can be created, but it will hold for reuse at most totalCapacity. +type EntityPool<'Key, 'Value>(totalCapacity, cacheId) = + let pool = ConcurrentBag>() + let mutable created = 0 + + let overCapacity = + CacheMetrics.Meter.CreateCounter("over-capacity", "count", cacheId) + + member _.Acquire(key, value) = + match pool.TryTake() with + | true, entity -> entity.ReUse(key, value) + | _ -> + if Interlocked.Increment &created > totalCapacity then + overCapacity.Add 1L + + // Associate a LinkedListNode with freshly created entity. + // This is a one time initialization. + CachedEntity(key, value).WithNode() + + member _.Reclaim(entity: CachedEntity<'Key, 'Value>) = + if pool.Count < totalCapacity then + pool.Add(entity) + +module Cache = + // During testing a lot of compilations are started in app domains and subprocesses. + // This is a reliable way to pass the override to all of them. + [] + let private overrideVariable = "FSHARP_CACHE_OVERRIDE" + + /// Use for testing purposes to reduce memory consumption in testhost and its subprocesses. + let OverrideCapacityForTesting () = + Environment.SetEnvironmentVariable(overrideVariable, "true", EnvironmentVariableTarget.Process) + + let applyOverride (capacity: int) = + match Environment.GetEnvironmentVariable(overrideVariable) with + | NonNull _ when capacity > 4096 -> 4096 + | _ -> capacity + +[] +type EvictionQueueMessage<'Key, 'Value> = + | Add of CachedEntity<'Key, 'Value> + | Update of CachedEntity<'Key, 'Value> + +[] +[] +type Cache<'Key, 'Value when 'Key: not null and 'Key: equality> internal (totalCapacity, headroom, ?name, ?observeMetrics) = + + let instanceId = defaultArg name (Guid.NewGuid().ToString()) + + let observeMetrics = defaultArg observeMetrics false + + do + if observeMetrics then + CacheMetrics.AddInstrumentation instanceId + + let meter = CacheMetrics.Meter + let hits = meter.CreateCounter("hits", "count", instanceId) + let misses = meter.CreateCounter("misses", "count", instanceId) + let evictions = meter.CreateCounter("evictions", "count", instanceId) + + let evictionFails = + meter.CreateCounter("eviction-fails", "count", instanceId) + + let pool = EntityPool<'Key, 'Value>(totalCapacity, instanceId) + + let store = + ConcurrentDictionary<'Key, CachedEntity<'Key, 'Value>>(Environment.ProcessorCount, totalCapacity) + + let evictionQueue = LinkedList>() + + // Non-evictable capacity. + let capacity = totalCapacity - headroom + + let evicted = Event<_>() + + let cts = new CancellationTokenSource() + + let evictionProcessor = + MailboxProcessor.Start( + (fun mb -> + let rec processNext () = + async { + match! mb.Receive() with + | EvictionQueueMessage.Add entity -> + + assert entity.Node.IsSome + + evictionQueue.AddLast(entity.Node.Value) + + // Evict one immediately if necessary. + while evictionQueue.Count > capacity do + let first = nonNull evictionQueue.First + + match store.TryRemove(first.Value.Key) with + | true, removed -> + evictionQueue.Remove(first) + pool.Reclaim(removed) + evictions.Add 1L + evicted.Trigger() + | _ -> evictionFails.Add 1L + + | EvictionQueueMessage.Update entity -> + entity.AccessCount <- entity.AccessCount + 1L + + assert entity.Node.IsSome + + let node = entity.Node.Value + assert (node.List = evictionQueue) + // Just move this node to the end of the list. + evictionQueue.Remove(node) + evictionQueue.AddLast(node) + + return! processNext () + } + + processNext ()), + cts.Token + ) + + member val Evicted = evicted.Publish + + member val Name = instanceId + + member _.TryGetValue(key: 'Key, value: outref<'Value>) = + match store.TryGetValue(key) with + | true, cachedEntity -> + hits.Add 1L + evictionProcessor.Post(EvictionQueueMessage.Update cachedEntity) + value <- cachedEntity.Value + true + | _ -> + misses.Add 1L + value <- Unchecked.defaultof<'Value> + false + + member _.TryAdd(key: 'Key, value: 'Value) = + let cachedEntity = pool.Acquire(key, value) + + if store.TryAdd(key, cachedEntity) then + evictionProcessor.Post(EvictionQueueMessage.Add cachedEntity) + true + else + pool.Reclaim(cachedEntity) + false + + interface IDisposable with + member this.Dispose() = + cts.Cancel() + cts.Dispose() + evictionProcessor.Dispose() + store.Clear() + + if observeMetrics then + CacheMetrics.RemoveInstrumentation instanceId + + member this.Dispose() = (this :> IDisposable).Dispose() + + member this.GetStats() = CacheMetrics.GetStats(this.Name) + + static member Create<'Key, 'Value>(options: CacheOptions, ?name, ?observeMetrics) = + if options.TotalCapacity < 0 then + invalidArg "Capacity" "Capacity must be positive" + + if options.HeadroomPercentage < 0 then + invalidArg "HeadroomPercentage" "HeadroomPercentage must be positive" + + let totalCapacity = Cache.applyOverride options.TotalCapacity + // Determine evictable headroom as the percentage of total capcity, since we want to not resize the dictionary. + let headroom = + int (float options.TotalCapacity * float options.HeadroomPercentage / 100.0) + + let cache = + new Cache<_, _>(totalCapacity, headroom, ?name = name, ?observeMetrics = observeMetrics) + + cache diff --git a/src/Compiler/Utilities/Caches.fsi b/src/Compiler/Utilities/Caches.fsi new file mode 100644 index 00000000000..565342bf7f5 --- /dev/null +++ b/src/Compiler/Utilities/Caches.fsi @@ -0,0 +1,44 @@ +namespace FSharp.Compiler.Caches + +open System +open System.Diagnostics.Metrics +open System.Threading + +[] +type internal CacheOptions = + { + /// Total capacity, determines the size of the underlying store. + TotalCapacity: int + + /// Safety margin size as a percentage of TotalCapacity. + HeadroomPercentage: int + } + + static member Default: CacheOptions + +module internal Cache = + val OverrideCapacityForTesting: unit -> unit + +[] +type internal Cache<'Key, 'Value when 'Key: not null and 'Key: equality> = + new: totalCapacity: int * headroom: int * ?name: string * ?observeMetrics: bool -> Cache<'Key, 'Value> + + member TryGetValue: key: 'Key * value: outref<'Value> -> bool + member TryAdd: key: 'Key * value: 'Value -> bool + /// Cancels the background eviction task. + member Dispose: unit -> unit + + interface IDisposable + + /// For testing only + member Evicted: IEvent + + static member Create<'Key, 'Value> : + options: CacheOptions * ?name: string * ?observeMetrics: bool -> Cache<'Key, 'Value> + +[] +type internal CacheMetrics = + static member Meter: Meter + static member GetStats: cacheId: string -> string + /// Retrieves current hit ratio, hits, misses, evictions etc. formatted for printing or logging. + static member GetStatsUpdateForAllCaches: clearCounts: bool -> string diff --git a/src/Compiler/Utilities/TypeHashing.fs b/src/Compiler/Utilities/TypeHashing.fs index bcdface38be..7907c2148dc 100644 --- a/src/Compiler/Utilities/TypeHashing.fs +++ b/src/Compiler/Utilities/TypeHashing.fs @@ -126,22 +126,6 @@ module HashAccessibility = module rec HashTypes = open Microsoft.FSharp.Core.LanguagePrimitives - let stampEquals g ty1 ty2 = - match (stripTyEqns g ty1), (stripTyEqns g ty2) with - | TType_app(tcref1, _, _), TType_app(tcref2, _, _) -> tcref1.Stamp.Equals(tcref2.Stamp) - | TType_var(r1, _), TType_var(r2, _) -> r1.Stamp.Equals(r2.Stamp) - | _ -> false - - /// Get has for Stamp for TType_app tyconref and TType_var typar - let hashStamp g ty = - let v: Stamp = - match (stripTyEqns g ty) with - | TType_app(tcref, _, _) -> tcref.Stamp - | TType_var(r, _) -> r.Stamp - | _ -> GenericZero - - hash v - /// Hash a reference to a type let hashTyconRef tcref = hashTyconRefImpl tcref @@ -344,3 +328,69 @@ module HashTastMemberOrVals = hashNonMemberVal (g, obs) (tps, vref.Deref, tau, cxs) | Some _ -> hashMember (g, obs) emptyTyparInst vref.Deref + +/// Practical TType comparer strictly for the use with cache keys. +module HashStamps = + let rec typeInstStampsEqual (tys1: TypeInst) (tys2: TypeInst) = + tys1.Length = tys2.Length && (tys1, tys2) ||> Seq.forall2 stampEquals + + and inline typarStampEquals (t1: Typar) (t2: Typar) = t1.Stamp = t2.Stamp + + and typarsStampsEqual (tps1: Typars) (tps2: Typars) = + tps1.Length = tps2.Length && (tps1, tps2) ||> Seq.forall2 typarStampEquals + + and measureStampEquals (m1: Measure) (m2: Measure) = + match m1, m2 with + | Measure.Var(mv1), Measure.Var(mv2) -> mv1.Stamp = mv2.Stamp + | Measure.Const(t1, _), Measure.Const(t2, _) -> t1.Stamp = t2.Stamp + | Measure.Prod(m1, m2, _), Measure.Prod(m3, m4, _) -> measureStampEquals m1 m3 && measureStampEquals m2 m4 + | Measure.Inv m1, Measure.Inv m2 -> measureStampEquals m1 m2 + | Measure.One _, Measure.One _ -> true + | Measure.RationalPower(m1, r1), Measure.RationalPower(m2, r2) -> r1 = r2 && measureStampEquals m1 m2 + | _ -> false + + and nullnessEquals (n1: Nullness) (n2: Nullness) = + match n1, n2 with + | Nullness.Known k1, Nullness.Known k2 -> k1 = k2 + | Nullness.Variable _, Nullness.Variable _ -> true + | _ -> false + + and stampEquals ty1 ty2 = + match ty1, ty2 with + | TType_ucase(u, tys1), TType_ucase(v, tys2) -> u.CaseName = v.CaseName && typeInstStampsEqual tys1 tys2 + | TType_app(tcref1, tinst1, n1), TType_app(tcref2, tinst2, n2) -> + tcref1.Stamp = tcref2.Stamp + && nullnessEquals n1 n2 + && typeInstStampsEqual tinst1 tinst2 + | TType_anon(info1, tys1), TType_anon(info2, tys2) -> info1.Stamp = info2.Stamp && typeInstStampsEqual tys1 tys2 + | TType_tuple(c1, tys1), TType_tuple(c2, tys2) -> c1 = c2 && typeInstStampsEqual tys1 tys2 + | TType_forall(tps1, tau1), TType_forall(tps2, tau2) -> stampEquals tau1 tau2 && typarsStampsEqual tps1 tps2 + | TType_var(r1, n1), TType_var(r2, n2) -> r1.Stamp = r2.Stamp && nullnessEquals n1 n2 + | TType_measure m1, TType_measure m2 -> measureStampEquals m1 m2 + | _ -> false + + let inline hashStamp (x: Stamp) : Hash = uint x * 2654435761u |> int + + // The idea is to keep the illusion of immutability of TType. + // This hash must be stable during compilation, otherwise we won't be able to find keys or evict from the cache. + let rec hashTType ty : Hash = + match ty with + | TType_ucase(u, tinst) -> tinst |> hashListOrderMatters (hashTType) |> pipeToHash (hash u.CaseName) + | TType_app(tcref, tinst, Nullness.Known n) -> + tinst + |> hashListOrderMatters (hashTType) + |> pipeToHash (hashStamp tcref.Stamp) + |> pipeToHash (hash n) + | TType_app(tcref, tinst, Nullness.Variable _) -> tinst |> hashListOrderMatters (hashTType) |> pipeToHash (hashStamp tcref.Stamp) + | TType_anon(info, tys) -> tys |> hashListOrderMatters (hashTType) |> pipeToHash (hashStamp info.Stamp) + | TType_tuple(c, tys) -> tys |> hashListOrderMatters (hashTType) |> pipeToHash (hash c) + | TType_forall(tps, tau) -> + tps + |> Seq.map _.Stamp + |> hashListOrderMatters (hashStamp) + |> pipeToHash (hashTType tau) + | TType_fun(d, r, Nullness.Known n) -> hashTType d |> pipeToHash (hashTType r) |> pipeToHash (hash n) + | TType_fun(d, r, Nullness.Variable _) -> hashTType d |> pipeToHash (hashTType r) + | TType_var(r, Nullness.Known n) -> hashStamp r.Stamp |> pipeToHash (hash n) + | TType_var(r, Nullness.Variable _) -> hashStamp r.Stamp + | TType_measure _ -> 0 diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Caches.fs b/tests/FSharp.Compiler.ComponentTests/CompilerService/Caches.fs new file mode 100644 index 00000000000..3849cd9addd --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Caches.fs @@ -0,0 +1,90 @@ +module CompilerService.Caches + +open FSharp.Compiler.Caches + +open System.Threading +open Xunit + +[] +let ``Create and dispose many`` () = + let caches = + [ + for _ in 1 .. 100 do + Cache.Create(CacheOptions.Default, observeMetrics = true) + ] + + for c in caches do c.Dispose() + +[] +let ``Create and dispose many named`` () = + let caches = + [ + for i in 1 .. 100 do + Cache.Create(CacheOptions.Default, name = $"testCache{i}", observeMetrics = true) + ] + + for c in caches do c.Dispose() + +[] +let ``Basic add and retrieve`` () = + use cache = Cache.Create(CacheOptions.Default, observeMetrics = true) + + cache.TryAdd("key1", 1) |> ignore + cache.TryAdd("key2", 2) |> ignore + + let mutable value = 0 + Assert.True(cache.TryGetValue("key1", &value), "Should retrieve key1") + Assert.Equal(1, value) + Assert.True(cache.TryGetValue("key2", &value), "Should retrieve key2") + Assert.Equal(2, value) + Assert.False(cache.TryGetValue("key3", &value), "Should not retrieve non-existent key3") + +[] +let ``Eviction of least recently used`` () = + use cache = Cache.Create({ TotalCapacity = 2; HeadroomPercentage = 0 }, observeMetrics = true) + + cache.TryAdd("key1", 1) |> ignore + cache.TryAdd("key2", 2) |> ignore + + // Make key1 recently used by accessing it + let mutable value = 0 + cache.TryGetValue("key1", &value) |> ignore + + let evicted = new ManualResetEvent(false) + cache.Evicted.Add(fun _ -> evicted.Set() |> ignore) + + // Add a third item, which should schedule key2 for eviction + cache.TryAdd("key3", 3) |> ignore + + // Wait for eviction to complete using the event + evicted.WaitOne() |> ignore + + Assert.False(cache.TryGetValue("key2", &value), "key2 should have been evicted") + Assert.True(cache.TryGetValue("key1", &value), "key1 should still be in cache") + Assert.Equal(1, value) + Assert.True(cache.TryGetValue("key3", &value), "key3 should be in cache") + Assert.Equal(3, value) + +[] +let ``Metrics can be retrieved`` () = + use cache = Cache.Create({ TotalCapacity = 2; HeadroomPercentage = 0 }, name = "test_metrics", observeMetrics = true) + + cache.TryAdd("key1", 1) |> ignore + cache.TryAdd("key2", 2) |> ignore + + // Make key1 recently used by accessing it + let mutable value = 0 + cache.TryGetValue("key1", &value) |> ignore + + let evicted = new ManualResetEvent(false) + cache.Evicted.Add(fun _ -> evicted.Set() |> ignore) + + // Add a third item, which should schedule key2 for eviction + cache.TryAdd("key3", 3) |> ignore + + // Wait for eviction to complete using the event + evicted.WaitOne() |> ignore + + let metrics = CacheMetrics.GetStats "test_metrics" + + Assert.Contains("test_metrics | hit ratio", metrics) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 98eb8a9336c..812833e988c 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -301,6 +301,7 @@ + diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index b17e1b1cd4b..50deb42ea68 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -10,6 +10,7 @@ open Xunit.Abstractions open TestFramework +open FSharp.Compiler.Caches open FSharp.Compiler.Diagnostics open OpenTelemetry.Resources @@ -155,6 +156,7 @@ type OpenTelemetryExport(testRunName, enable) = // Configure OpenTelemetry metrics export. Metrics can be viewed in Prometheus or other compatible tools. OpenTelemetry.Sdk.CreateMeterProviderBuilder() + .AddMeter(CacheMetrics.Meter.Name) .AddMeter("System.Runtime") .ConfigureResource(fun r -> r.AddService(testRunName) |> ignore) .AddOtlpExporter(fun e m -> @@ -185,6 +187,9 @@ type FSharpXunitFramework(sink: IMessageSink) = AssemblyResolver.addResolver () #endif + // Override cache capacity to reduce memory usage in CI. + Cache.OverrideCapacityForTesting() + let testRunName = $"RunTests_{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" use _ = new OpenTelemetryExport(testRunName, Environment.GetEnvironmentVariable("FSHARP_OTEL_EXPORT") <> null) diff --git a/vsintegration/src/FSharp.Editor/Common/Logging.fs b/vsintegration/src/FSharp.Editor/Common/Logging.fs index b0f56df3234..de96d46e254 100644 --- a/vsintegration/src/FSharp.Editor/Common/Logging.fs +++ b/vsintegration/src/FSharp.Editor/Common/Logging.fs @@ -30,6 +30,8 @@ module Config = let fsharpOutputGuid = Guid fsharpOutputGuidString open Config +open System.Diagnostics.Metrics +open System.Text [] type Logger [] ([)>] serviceProvider: IServiceProvider) = @@ -118,11 +120,8 @@ module Logging = let logExceptionWithContext (ex: Exception, context) = logErrorf "Context: %s\nException Message: %s\nStack Trace: %s" context ex.Message ex.StackTrace -#if DEBUG -module Activity = - - open OpenTelemetry.Resources - open OpenTelemetry.Trace +module FSharpServiceTelemetry = + open FSharp.Compiler.Caches let listen filter = let indent (activity: Activity) = @@ -135,16 +134,15 @@ module Activity = String.replicate (loop activity 0) " " let collectTags (activity: Activity) = - [ for tag in activity.Tags -> $"{tag.Key}: %A{tag.Value}" ] - |> String.concat ", " + [ for tag in activity.Tags -> $"{tag.Key}: {tag.Value}" ] |> String.concat ", " let listener = new ActivityListener( - ShouldListenTo = (fun source -> source.Name = FSharp.Compiler.Diagnostics.ActivityNames.FscSourceName), + ShouldListenTo = (fun source -> source.Name = ActivityNames.FscSourceName), Sample = (fun context -> if context.Name.Contains(filter) then - ActivitySamplingResult.AllDataAndRecorded + ActivitySamplingResult.AllData else ActivitySamplingResult.None), ActivityStarted = (fun a -> logMsg $"{indent a}{a.OperationName} {collectTags a}") @@ -152,13 +150,56 @@ module Activity = ActivitySource.AddActivityListener(listener) - let export () = - OpenTelemetry.Sdk - .CreateTracerProviderBuilder() - .AddSource(ActivityNames.FscSourceName) - .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(serviceName = "F#", serviceVersion = "1.0.0")) - .AddOtlpExporter() - .Build() + let logCacheMetricsToOutput () = + + let timer = new System.Timers.Timer(1000.0, AutoReset = true) + + timer.Elapsed.Add(fun _ -> + let stats = CacheMetrics.GetStatsUpdateForAllCaches(clearCounts = true) + + if stats <> "" then + logMsg $"\n{stats}") + + timer.Start() + +#if DEBUG + open OpenTelemetry.Resources + open OpenTelemetry.Trace + open OpenTelemetry.Metrics + + let otelExport () = + // On Windows forwarding localhost to wsl2 docker container sometimes does not work. Use IP address instead. + let otlpEndpoint = Uri("http://127.0.0.1:4317") + + let meterProvider = + // Configure OpenTelemetry metrics. Metrics can be viewed in Prometheus or other compatible tools. + OpenTelemetry.Sdk + .CreateMeterProviderBuilder() + .ConfigureResource(fun r -> r.AddService("F#") |> ignore) + .AddMeter(CacheMetrics.Meter.Name) + .AddMeter("System.Runtime") + .AddOtlpExporter(fun e m -> + e.Endpoint <- otlpEndpoint + m.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds <- 1000 + m.TemporalityPreference <- MetricReaderTemporalityPreference.Cumulative) + .Build() + + let tracerProvider = + // Configure OpenTelemetry export. Traces can be viewed in Jaeger or other compatible tools. + OpenTelemetry.Sdk + .CreateTracerProviderBuilder() + .AddSource(ActivityNames.FscSourceName) + .ConfigureResource(fun r -> r.AddService("F#") |> ignore) + .AddOtlpExporter(fun e -> e.Endpoint <- otlpEndpoint) + .Build() + + let a = Activity.startNoTags "FSharpPackage" + + fun () -> + a.Dispose() + tracerProvider.ForceFlush(5000) |> ignore + tracerProvider.Dispose() + meterProvider.Dispose() let listenToAll () = listen "" #endif diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 5cc9cec2943..4eb399a39f3 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -340,15 +340,21 @@ type internal FSharpPackage() as this = let mutable solutionEventsOpt = None -#if DEBUG - let _traceProvider = Logging.Activity.export () - let _logger = Logging.Activity.listenToAll () - // Logging.Activity.listen "IncrementalBuild" -#endif - // FSI-LINKAGE-POINT: unsited init do FSharp.Interactive.Hooks.fsiConsoleWindowPackageCtorUnsited (this :> Package) +#if DEBUG + do Logging.FSharpServiceTelemetry.logCacheMetricsToOutput () + + let flushTelemetry = Logging.FSharpServiceTelemetry.otelExport () + + override this.Dispose(disposing: bool) = + base.Dispose(disposing: bool) + + if disposing then + flushTelemetry () +#endif + override this.InitializeAsync(cancellationToken: CancellationToken, progress: IProgress) : Tasks.Task = // `base.` methods can't be called in the `async` builder, so we have to cache it let baseInitializeAsync = base.InitializeAsync(cancellationToken, progress) diff --git a/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj b/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj index 2a760da0f5e..c084fc6f06a 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj +++ b/vsintegration/tests/FSharp.Editor.Tests/FSharp.Editor.Tests.fsproj @@ -16,6 +16,9 @@ + + XunitSetup.fs + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index e1e657a651a..395400a795e 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -16,6 +16,9 @@ + + XunitSetup.fs + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 30a871ad288..c02e6f1bfc7 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -17,6 +17,9 @@ + + XunitSetup.fs + From 172dc31e21548990663cc371915c3cb81875a6b5 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 2 May 2025 17:21:19 +0100 Subject: [PATCH 080/134] include accessibility range in `SynPat.Named` (#18526) --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/pars.fsy | 6 +++- .../data/SyntaxTree/SynType/Named 01.fs | 3 ++ .../data/SyntaxTree/SynType/Named 01.fs.bsl | 21 ++++++++++++ .../data/SyntaxTree/SynType/Named 02.fs | 3 ++ .../data/SyntaxTree/SynType/Named 02.fs.bsl | 23 +++++++++++++ .../data/SyntaxTree/SynType/Named 03.fs | 3 ++ .../data/SyntaxTree/SynType/Named 03.fs.bsl | 24 ++++++++++++++ .../data/SyntaxTree/SynType/Named 04.fs | 3 ++ .../data/SyntaxTree/SynType/Named 04.fs.bsl | 24 ++++++++++++++ .../data/SyntaxTree/SynType/Named 05.fs | 3 ++ .../data/SyntaxTree/SynType/Named 05.fs.bsl | 30 +++++++++++++++++ .../data/SyntaxTree/SynType/Named 06.fs | 3 ++ .../data/SyntaxTree/SynType/Named 06.fs.bsl | 32 +++++++++++++++++++ .../data/SyntaxTree/SynType/Named 07.fs | 3 ++ .../data/SyntaxTree/SynType/Named 07.fs.bsl | 31 ++++++++++++++++++ .../data/SyntaxTree/SynType/Named 08.fs | 3 ++ .../data/SyntaxTree/SynType/Named 08.fs.bsl | 28 ++++++++++++++++ .../data/SyntaxTree/SynType/Named 09.fs | 4 +++ .../data/SyntaxTree/SynType/Named 09.fs.bsl | 20 ++++++++++++ 20 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 tests/service/data/SyntaxTree/SynType/Named 01.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 02.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 03.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 04.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 05.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 06.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 07.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 08.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Named 09.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index c39b44e1d7a..2eeef97ffb1 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -25,6 +25,7 @@ * Fixed [#18433](https://github.com/dotnet/fsharp/issues/18433), a rare case of an internal error in xml comment processing. ([PR #18436](https://github.com/dotnet/fsharp/pull/18436)) * Fix confusing type inference error in task expression ([Issue #13789](https://github.com/dotnet/fsharp/issues/13789), [PR #18450](https://github.com/dotnet/fsharp/pull/18450)) * Fix missing `null` highlighting in tooltips ([PR #18457](https://github.com/dotnet/fsharp/pull/18457)) +* Fix range of SynPat.Named doesn't include accessibility ([PR #18526](https://github.com/dotnet/fsharp/pull/18526)) * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index e6e3a657592..e5e0bca6a29 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -3776,7 +3776,11 @@ atomicPattern: mkSynPatMaybeVar lidwd vis (lhs parseState) else let synIdent = List.head lidwd.IdentsWithTrivia - SynPat.Named(synIdent, false, vis, synIdent.Range) } + let m = + match vis with + | Some vis -> unionRanges vis.Range synIdent.Range + | _ -> synIdent.Range + SynPat.Named(synIdent, false, vis, m) } | constant { SynPat.Const(fst $1, snd $1) } diff --git a/tests/service/data/SyntaxTree/SynType/Named 01.fs b/tests/service/data/SyntaxTree/SynType/Named 01.fs new file mode 100644 index 00000000000..b3d177741da --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 01.fs @@ -0,0 +1,3 @@ +module Module + +let value = 42 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl new file mode 100644 index 00000000000..0781e30ef03 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl @@ -0,0 +1,21 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 01.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named (SynIdent (value, None), false, None, (3,4--3,9)), None, + Const (Int32 42, (3,12--3,14)), (3,4--3,9), Yes (3,0--3,14), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], (3,0--3,14))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 02.fs b/tests/service/data/SyntaxTree/SynType/Named 02.fs new file mode 100644 index 00000000000..d77886cd9dd --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 02.fs @@ -0,0 +1,3 @@ +module Module + +let private value = 42 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl new file mode 100644 index 00000000000..524fced7a9a --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl @@ -0,0 +1,23 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 02.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent (value, None), false, Some (Private (3,4--3,11)), + (3,4--3,17)), None, Const (Int32 42, (3,20--3,22)), + (3,4--3,17), Yes (3,0--3,22), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,18--3,19) })], (3,0--3,22))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 03.fs b/tests/service/data/SyntaxTree/SynType/Named 03.fs new file mode 100644 index 00000000000..191fca6323c --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 03.fs @@ -0,0 +1,3 @@ +module Module + +let (|A|) = 0 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl new file mode 100644 index 00000000000..6cddbf89cae --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl @@ -0,0 +1,24 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 03.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent + (|A|, Some (HasParenthesis ((3,4--3,5), (3,8--3,9)))), + false, None, (3,4--3,9)), None, + Const (Int32 0, (3,12--3,13)), (3,4--3,9), Yes (3,0--3,13), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], (3,0--3,13))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 04.fs b/tests/service/data/SyntaxTree/SynType/Named 04.fs new file mode 100644 index 00000000000..c1788fab9a0 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 04.fs @@ -0,0 +1,3 @@ +module Module + +let private (|A|) = 0 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl new file mode 100644 index 00000000000..c205d9d5518 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl @@ -0,0 +1,24 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 04.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent + (|A|, Some (HasParenthesis ((3,12--3,13), (3,16--3,17)))), + false, Some (Private (3,4--3,11)), (3,4--3,17)), None, + Const (Int32 0, (3,20--3,21)), (3,4--3,17), Yes (3,0--3,21), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,18--3,19) })], (3,0--3,21))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 05.fs b/tests/service/data/SyntaxTree/SynType/Named 05.fs new file mode 100644 index 00000000000..710b9d60ce9 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 05.fs @@ -0,0 +1,3 @@ +module Module + +let a, private b = 1, 2 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl new file mode 100644 index 00000000000..fafa4eb0a3f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl @@ -0,0 +1,30 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 05.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Tuple + (false, + [Named (SynIdent (a, None), false, None, (3,4--3,5)); + Named + (SynIdent (b, None), false, Some (Private (3,7--3,14)), + (3,7--3,16))], [(3,5--3,6)], (3,4--3,16)), None, + Tuple + (false, + [Const (Int32 1, (3,19--3,20)); + Const (Int32 2, (3,22--3,23))], [(3,20--3,21)], + (3,19--3,23)), (3,4--3,16), Yes (3,0--3,23), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,17--3,18) })], (3,0--3,23))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 06.fs b/tests/service/data/SyntaxTree/SynType/Named 06.fs new file mode 100644 index 00000000000..31ee6a99e79 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 06.fs @@ -0,0 +1,3 @@ +module Module + +let private a, private b = 1, 2 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl new file mode 100644 index 00000000000..75f20e20fdd --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 06.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Tuple + (false, + [Named + (SynIdent (a, None), false, Some (Private (3,4--3,11)), + (3,4--3,13)); + Named + (SynIdent (b, None), false, Some (Private (3,15--3,22)), + (3,15--3,24))], [(3,13--3,14)], (3,4--3,24)), None, + Tuple + (false, + [Const (Int32 1, (3,27--3,28)); + Const (Int32 2, (3,30--3,31))], [(3,28--3,29)], + (3,27--3,31)), (3,4--3,24), Yes (3,0--3,31), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,25--3,26) })], (3,0--3,31))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,31), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 07.fs b/tests/service/data/SyntaxTree/SynType/Named 07.fs new file mode 100644 index 00000000000..ed76155a8ef --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 07.fs @@ -0,0 +1,3 @@ +module Module + +let private a, b = 1, 2 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl new file mode 100644 index 00000000000..65e957b2058 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl @@ -0,0 +1,31 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 07.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Tuple + (false, + [Named + (SynIdent (a, None), false, Some (Private (3,4--3,11)), + (3,4--3,13)); + Named (SynIdent (b, None), false, None, (3,15--3,16))], + [(3,13--3,14)], (3,4--3,16)), None, + Tuple + (false, + [Const (Int32 1, (3,19--3,20)); + Const (Int32 2, (3,22--3,23))], [(3,20--3,21)], + (3,19--3,23)), (3,4--3,16), Yes (3,0--3,23), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,17--3,18) })], (3,0--3,23))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 08.fs b/tests/service/data/SyntaxTree/SynType/Named 08.fs new file mode 100644 index 00000000000..57c471b0631 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 08.fs @@ -0,0 +1,3 @@ +module Module + +let private (1, 2) = 0 \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl new file mode 100644 index 00000000000..c6f0d6cbd6d --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl @@ -0,0 +1,28 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 08.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Named + (SynIdent + (op_MultiplyMultiplyMultiplyMultiply, + Some (HasParenthesis ((3,12--3,13), (3,17--3,18)))), + false, Some (Private (3,4--3,11)), (3,4--3,18)), None, + Const (Int32 0, (3,21--3,22)), (3,4--3,18), Yes (3,0--3,22), + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,19--3,20) })], (3,0--3,22))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) + +(3,13)-(3,14) parse error Unexpected integer literal in binding +(3,12)-(3,18) parse error Attempted to parse this as an operator name, but failed diff --git a/tests/service/data/SyntaxTree/SynType/Named 09.fs b/tests/service/data/SyntaxTree/SynType/Named 09.fs new file mode 100644 index 00000000000..1158b0991b0 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 09.fs @@ -0,0 +1,4 @@ +module Module + +match 1 with +| private x -> () \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl new file mode 100644 index 00000000000..a97b6dd3461 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl @@ -0,0 +1,20 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Named 09.fs", false, QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (Match + (Yes (3,0--3,12), Const (Int32 1, (3,6--3,7)), + [SynMatchClause + (Named + (SynIdent (x, None), false, Some (Private (4,2--4,9)), + (4,2--4,11)), None, Const (Unit, (4,15--4,17)), + (4,2--4,17), Yes, { ArrowRange = Some (4,12--4,14) + BarRange = Some (4,0--4,1) })], + (3,0--4,17), { MatchKeyword = (3,0--3,5) + WithKeyword = (3,8--3,12) }), (3,0--4,17))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) From abffd375fc32cc23f01e02ceca9cf56fd7146722 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 5 May 2025 08:39:55 -0700 Subject: [PATCH 081/134] Fix mixed emit-multi+/- sessions (#18465) * Fix mixed emit-multi+/- sessions * fantomas * ilverify baseline --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Interactive/fsi.fs | 25 +++++--- .../Scripting/Interactive.fs | 47 ++++++++++----- tests/FSharp.Test.Utilities/Compiler.fs | 59 ++++++++++++++----- tests/FSharp.Test.Utilities/CompilerAssert.fs | 5 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 2 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 9 files changed, 102 insertions(+), 43 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 2eeef97ffb1..e187f285d4b 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -30,6 +30,7 @@ * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) * Code completion: fix getting qualifier expression in do statements in type decls ([PR #18524](https://github.com/dotnet/fsharp/pull/18524)) +* Fixed: [#18441](https://github.com/dotnet/fsharp/issues/18441) FSI multi-emit unstable. ([PR #18465](https://github.com/dotnet/fsharp/pull/18465)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 78d5cb94dcd..98c62839018 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -1673,7 +1673,8 @@ let internal mkBoundValueTypedImpl tcGlobals m moduleName name ty = let qname = QualifiedNameOfFile.QualifiedNameOfFile(Ident(moduleName, m)) entity, v, CheckedImplFile.CheckedImplFile(qname, [], mty, contents, false, false, StampMap.Empty, Map.empty) -let dynamicCcuName = "FSI-ASSEMBLY" +let dynamicCcuName (isEmitMulti) = + $"""FSI-ASSEMBLY{if isEmitMulti then "-MULTI" else ""}""" /// Encapsulates the coordination of the typechecking, optimization and code generation /// components of the F# compiler for interactively executed fragments of code. @@ -1723,7 +1724,11 @@ type internal FsiDynamicCompiler None else let assemBuilder, moduleBuilder = - mkDynamicAssemblyAndModule (dynamicCcuName, tcConfigB.optSettings.LocalOptimizationsEnabled, fsiCollectible) + mkDynamicAssemblyAndModule ( + dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), + tcConfigB.optSettings.LocalOptimizationsEnabled, + fsiCollectible + ) dynamicAssemblies.Add(assemBuilder) Some(assemBuilder, moduleBuilder) @@ -1813,7 +1818,7 @@ type internal FsiDynamicCompiler let attrs = [ - tcGlobals.MakeInternalsVisibleToAttribute(dynamicCcuName) + tcGlobals.MakeInternalsVisibleToAttribute(dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit)) yield! manifest.CustomAttrs.AsList() ] @@ -1960,7 +1965,9 @@ type internal FsiDynamicCompiler diagnosticsLogger.AbortOnError(fsiConsoleOutput) ReportTime tcConfig "Linking" - let ilxMainModule = CreateModuleFragment(tcConfigB, dynamicCcuName, codegenResults) + + let ilxMainModule = + CreateModuleFragment(tcConfigB, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), codegenResults) diagnosticsLogger.AbortOnError(fsiConsoleOutput) @@ -2652,7 +2659,7 @@ type internal FsiDynamicCompiler let tcEnv, asms = try - RequireReferences(ctok, tcImports, tcState.TcEnvFromImpls, dynamicCcuName, resolutions) + RequireReferences(ctok, tcImports, tcState.TcEnvFromImpls, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit), resolutions) with _ -> for (path, _, _, m) in refs do tcConfigB.RemoveReferencedAssemblyByPath(m, path) @@ -3025,7 +3032,7 @@ type internal FsiDynamicCompiler let emEnv0 = if tcConfigB.fsiMultiAssemblyEmit then let emEnv = - ILMultiInMemoryAssemblyEmitEnv(ilGlobals, resolveAssemblyRef, dynamicCcuName) + ILMultiInMemoryAssemblyEmitEnv(ilGlobals, resolveAssemblyRef, dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit)) MultipleInMemoryAssemblies emEnv else @@ -3041,10 +3048,10 @@ type internal FsiDynamicCompiler let emEnv = ILDynamicAssemblyWriter.emEnv0 SingleRefEmitAssembly(cenv, emEnv) - let tcEnv, openDecls0 = - GetInitialTcEnv(dynamicCcuName, rangeStdin0, tcConfig, tcImports, tcGlobals) + let ccuName = dynamicCcuName (tcConfigB.fsiMultiAssemblyEmit) - let ccuName = dynamicCcuName + let tcEnv, openDecls0 = + GetInitialTcEnv(ccuName, rangeStdin0, tcConfig, tcImports, tcGlobals) let tcState = GetInitialTcState(rangeStdin0, ccuName, tcConfig, tcGlobals, tcImports, tcEnv, openDecls0) diff --git a/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs b/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs index 4fab401b9c6..7580dae0925 100644 --- a/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs +++ b/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs @@ -7,6 +7,9 @@ open Xunit open System open FSharp.Test.Compiler open FSharp.Test.ScriptHelpers +open FSharp.Compiler.Interactive.Shell +open FSharp.Compiler.Diagnostics +open FSharp.Test.CompilerAssertHelpers module ``Interactive tests`` = @@ -35,34 +38,48 @@ module ``Interactive tests`` = ] [] - [] - [] - let ``Evaluation of multiple sessions should succeed`` (useMultiEmit) = + [] + [] + [] + [] + let ``Evaluation of multiple sessions should succeed`` (useMultiEmit1, useMultiEmit2) = - let args : string array = [| if useMultiEmit then "--multiemit+" else "--multiemit-"|] - use sessionOne = new FSharpScript(additionalArgs=args) - use sessionTwo = new FSharpScript(additionalArgs=args) + // This test is to check that we can have multiple sessions and that they can access each other - sessionOne.Eval(""" -module Test1 = + let AssertCanWeAccessTheOtherSession (session: FSharpScript) (script: string) (moduleName: string) (errorChoice: string) = - let test1 obj = sprintf "Execute - Test1.test1 - %A" obj""") |> ignore + let result: Result * FSharpDiagnostic[] = session.Eval(script) + let expected = + [ (Error 39, Line 1, Col 1, Line 1, Col 6, $"The value, namespace, type or module '{moduleName}' is not defined. Maybe you want one of the following:{errorChoice}") ] - let result1 = sessionOne.Eval("""Test1.test1 18""") |> getValue + match result with + | Result.Error _, diagnostics -> Assert.WithDiagnostics(0, diagnostics, expected) + | _ -> () + + // Initialize + let args useMultiEmit : string array = [| if useMultiEmit then "--multiemit+" else "--multiemit-"|] + use sessionOne = new FSharpScript(additionalArgs = args useMultiEmit1) + use sessionTwo = new FSharpScript(additionalArgs = args useMultiEmit2) + use sessionThree = new FSharpScript(additionalArgs = args useMultiEmit2) + + // First session + sessionOne.Eval("""module Test1 = let test1 obj = sprintf "Execute - Test1.test1 - %A" obj""") |> ignore + let result1 = sessionOne.Eval("Test1.test1 18") |> getValue let value1 = result1.Value Assert.Equal(typeof, value1.ReflectionType) Assert.Equal("Execute - Test1.test1 - 18", value1.ReflectionValue :?> string) - sessionTwo.Eval(""" -module Test2 = - - let test2 obj = sprintf "Execute - Test2.test2 - %A" obj""") |> ignore - + // Second session + sessionTwo.Eval("""module Test2 = let test2 obj = sprintf "Execute - Test2.test2 - %A" obj""") |> ignore let result2 = sessionTwo.Eval("""Test2.test2 27""") |> getValue let value2 = result2.Value Assert.Equal(typeof, value2.ReflectionType) Assert.Equal("Execute - Test2.test2 - 27", value2.ReflectionValue :?> string) + // Can I access the other session + AssertCanWeAccessTheOtherSession sessionOne "Test2.test2 19" "Test2" "\nTest1\nText" // Session 1 can't access values from session 2 + AssertCanWeAccessTheOtherSession sessionTwo "Test1.test1 13" "Test1" "\nTest2\nText" // Session 2 can't access values from session 1 + module ``External FSI tests`` = [] let ``Eval object value``() = diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 9cda28613dd..ba72ee42e29 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1671,20 +1671,47 @@ Actual: let private withResultIgnoreNativeRange (expectedResult: ErrorInfo ) (result: CompilationResult) : CompilationResult = withResultsIgnoreNativeRange [expectedResult] result - let withDiagnostics (expected: (ErrorType * Line * Col * Line * Col * string) list) (result: CompilationResult) : CompilationResult = - let expectedResults: ErrorInfo list = - [ for e in expected do - let (error, Line startLine, Col startCol, Line endLine, Col endCol, message) = e - { Error = error - Range = - { StartLine = startLine - StartColumn = startCol - EndLine = endLine - EndColumn = endCol } - NativeRange = Unchecked.defaultof<_> - SubCategory = "" - Message = message } ] - withResultsIgnoreNativeRange expectedResults result + let private convertExpectedsToErrorInfos(expected: (ErrorType * Line * Col * Line * Col * string) list): ErrorInfo list = [ + for e in expected do + let (error, Line startLine, Col startCol, Line endLine, Col endCol, message) = e + { + Error = error + Range = { + StartLine = startLine + StartColumn = startCol + EndLine = endLine + EndColumn = endCol + } + NativeRange = Unchecked.defaultof<_> + SubCategory = "" + Message = message + } + ] + + let private convertDiagnosticsToErrorInfos (diagnostics: FSharpDiagnostic[]) : ErrorInfo list = + diagnostics + |> Array.map (fun diagnostic -> + let errorType = + match diagnostic.Severity with + | FSharpDiagnosticSeverity.Error -> Error diagnostic.ErrorNumber + | FSharpDiagnosticSeverity.Warning -> Warning diagnostic.ErrorNumber + | FSharpDiagnosticSeverity.Info -> Information diagnostic.ErrorNumber + | FSharpDiagnosticSeverity.Hidden -> Hidden diagnostic.ErrorNumber + { + Error = errorType + Range = { + StartLine = diagnostic.StartLine + StartColumn = diagnostic.StartColumn + EndLine = diagnostic.EndLine + EndColumn = diagnostic.EndColumn + } + NativeRange = diagnostic.Range + Message = diagnostic.Message + SubCategory = diagnostic.Subcategory + }) |> Array.toList + + let withDiagnostics expected (result: CompilationResult) : CompilationResult = + withResultsIgnoreNativeRange (convertExpectedsToErrorInfos expected) result let withSingleDiagnostic (expected: (ErrorType * Line * Col * Line * Col * string)) (result: CompilationResult) : CompilationResult = withDiagnostics [expected] result @@ -1695,6 +1722,10 @@ Actual: let withError (expectedError: ErrorInfo) (result: CompilationResult) : CompilationResult = withErrors [expectedError] result + type Assert = + static member WithDiagnostics(libAdjust, result, expected) = + assertErrors "Results" libAdjust (convertDiagnosticsToErrorInfos result) (convertExpectedsToErrorInfos expected) + module StructuredResultsAsserts = type SimpleErrorInfo = { Error: ErrorType diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 0f7baf597fb..1ec26cb3769 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -466,7 +466,7 @@ module CompilerAssertHelpers = yield source.WithFileName(destFileName) ] rawCompile outputFilePath isExe options targetFramework sources - + let assertErrors libAdjust ignoreWarnings (errors: FSharpDiagnostic []) expectedErrors = let errorMessage (error: FSharpDiagnostic) = let errN, range, message = error.ErrorNumber, error.Range, error.Message @@ -694,6 +694,9 @@ Updated automatically, please check diffs in your pull request, changes must be compileCompilation ignoreWarnings cmpl (fun ((errors, _, _), _) -> assertErrors 0 ignoreWarnings errors expectedErrors) + static member assertWithErrors(libAdjust, ignoreWarnings, errors, expectedErrors) = + assertErrors libAdjust, ignoreWarnings, errors, expectedErrors + static member Compile(cmpl: Compilation, ?ignoreWarnings) = CompilerAssert.CompileWithErrors(cmpl, [||], defaultArg ignoreWarnings false) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 69842b9e059..fd4b4d78bd0 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 6e41547cd11..4eaf1633b58 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 4e7b5396676..0267e2b1bb0 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,7 +21,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 431d4e5512a..37aaa79a6f2 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,7 +28,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3502-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. From 63dd8cae6a2f5e32b4c56290de05781b855546a7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 10:10:50 -0500 Subject: [PATCH 082/134] [main] Update dependencies from dotnet/arcade (#18535) * Update dependencies from https://github.com/dotnet/arcade build 20250505.3 Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25225.6 -> To Version 9.0.0-beta.25255.3 * Disable report prebuilt usage Remove SB intermediates & prebuilt baseline file Fixes https://github.com/dotnet/source-build/issues/5085 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Viktor Hofer --- eng/DotNetBuild.props | 4 ++++ eng/SourceBuildPrebuiltBaseline.xml | 33 ----------------------------- eng/Version.Details.xml | 21 ++---------------- global.json | 2 +- 4 files changed, 7 insertions(+), 53 deletions(-) delete mode 100644 eng/SourceBuildPrebuiltBaseline.xml diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props index 78286b23bab..8bdf6363873 100644 --- a/eng/DotNetBuild.props +++ b/eng/DotNetBuild.props @@ -1,9 +1,13 @@ + fsharp true + $(DotNetBuildOrchestrator) + false + false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3d486a94d20..ff7657a28c0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,17 +1,6 @@ - - https://github.com/dotnet/source-build-reference-packages - 19eb5ea4e5f9c4e5256843a92805c8c9e942207d - - - - - https://github.com/dotnet/msbuild - 7ad4e1c76585d0ed6e438da2d4f9394326934399 - - https://github.com/dotnet/msbuild 7ad4e1c76585d0ed6e438da2d4f9394326934399 @@ -42,15 +31,9 @@ - - https://github.com/dotnet/arcade - bfbc858ba868b60fffaf7b2150f1d2165b01e786 - - - + https://github.com/dotnet/arcade - bfbc858ba868b60fffaf7b2150f1d2165b01e786 - + dba26274ff5a0906a1880443fc3c0466d1a298ae https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/global.json b/global.json index 025b675460e..1c977b14b7c 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25225.6", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25255.3", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From aa4550ebdac1cb4099ea1c0f03fd3822a5561056 Mon Sep 17 00:00:00 2001 From: Alex Delepine Date: Wed, 7 May 2025 08:28:55 -0700 Subject: [PATCH 083/134] Update VisualFSharp.Core.targets (#18536) --- .../VisualFSharpFull/VisualFSharp.Core.targets | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets index 16d69751fd7..674c3487ac7 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharp.Core.targets @@ -30,7 +30,6 @@ FSharp.Build DebugSymbolsProjectOutputGroup%3b true - All 2 True TargetFramework=netstandard2.0 @@ -42,7 +41,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True TargetFramework=netstandard2.0 @@ -54,7 +52,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True TargetFramework=netstandard2.0 @@ -66,7 +63,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True TargetFramework=netstandard2.0 @@ -117,7 +113,6 @@ ReferenceCopyLocalPathsOutputGroup%3bBuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -128,7 +123,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -147,7 +141,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -158,7 +151,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -169,7 +161,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -180,7 +171,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -191,7 +181,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -202,7 +191,6 @@ BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b DebugSymbolsProjectOutputGroup%3b true - All 2 True @@ -276,4 +264,4 @@ - \ No newline at end of file + From 5a239f61f6f25909b8458d36877d9982cf5c3533 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 09:59:31 -0700 Subject: [PATCH 084/134] Update dependencies from https://github.com/dotnet/arcade build 20250505.5 (#18538) Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25255.3 -> To Version 9.0.0-beta.25255.5 Co-authored-by: dotnet-maestro[bot] Co-authored-by: Kevin Ransom (msft) --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ff7657a28c0..08868123018 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -31,9 +31,9 @@ - + https://github.com/dotnet/arcade - dba26274ff5a0906a1880443fc3c0466d1a298ae + 1cfa39f82d00b3659a3d367bc344241946e10681 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/global.json b/global.json index 1c977b14b7c..809fed994d0 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25255.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25255.5", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From f78ce10d707b23ae8384a00de05d66e49df1338e Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 12 May 2025 11:01:35 -0400 Subject: [PATCH 085/134] Keep parens around records in interpolated strings (#18534) --- .../.FSharp.Compiler.Service/9.0.300.md | 2 +- src/Compiler/Service/SynExpr.fs | 8 +++++++ .../RemoveUnnecessaryParenthesesTests.fs | 21 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index e187f285d4b..52cf5eb8350 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -16,7 +16,7 @@ * Unsafe downcast from `obj` to generic `T` no longer requires `not null` constraint on `T`([Issue #18275](https://github.com/dotnet/fsharp/issues/18275), [PR #18343](https://github.com/dotnet/fsharp/pull/18343)) * Fix "type inference problem too complicated" for SRTP with T:null and T:struct dummy constraint([Issue #18288](https://github.com/dotnet/fsharp/issues/18288), [PR #18345](https://github.com/dotnet/fsharp/pull/18345)) * Fix for missing parse diagnostics in TransparentCompiler.ParseAndCheckProject ([PR #18366](https://github.com/dotnet/fsharp/pull/18366)) -* Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350)) +* Miscellanous parentheses analyzer fixes. ([PR #18350](https://github.com/dotnet/fsharp/pull/18350), [PR #18534](https://github.com/dotnet/fsharp/pull/18534)) * Fix duplicate parse error reporting for GetBackgroundCheckResultsForFileInProject ([Issue #18379](https://github.com/dotnet/fsharp/issues/18379) [PR #18380](https://github.com/dotnet/fsharp/pull/18380)) * Fix MethodDefNotFound when compiling code invoking delegate with option parameter ([Issue #5171](https://github.com/dotnet/fsharp/issues/5171), [PR #18385](https://github.com/dotnet/fsharp/pull/18385)) * Fix #r nuget ..." downloads unneeded packages ([Issue #18231](https://github.com/dotnet/fsharp/issues/18231), [PR #18393](https://github.com/dotnet/fsharp/pull/18393)) diff --git a/src/Compiler/Service/SynExpr.fs b/src/Compiler/Service/SynExpr.fs index 5981dd5b286..52c10e8a7a5 100644 --- a/src/Compiler/Service/SynExpr.fs +++ b/src/Compiler/Service/SynExpr.fs @@ -1078,6 +1078,14 @@ module SynExpr = | SynExpr.Sequential(expr1 = SynExpr.Paren(expr = Is inner); expr2 = expr2), _ when innerBindingsWouldShadowOuter inner expr2 -> true + // $"{({ A = 3 })}" + // $"{({| A = 3 |})}" + // $"{({1..10})}" + // $"{(();1)}" + // $"{(1,2)}" + | SynExpr.InterpolatedString _, SynExpr.Record _ + | SynExpr.InterpolatedString _, SynExpr.AnonRecd _ + | SynExpr.InterpolatedString _, SynExpr.ComputationExpr _ | SynExpr.InterpolatedString _, SynExpr.Sequential _ | SynExpr.InterpolatedString _, SynExpr.Tuple(isStruct = false) -> true diff --git a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs index 224849a59e2..a7b90207877 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/CodeFixes/RemoveUnnecessaryParenthesesTests.fs @@ -1390,6 +1390,27 @@ in x $"{3 + LanguagePrimitives.GenericZero :N0}" """ + """ + $"{({ A = 3 })}" + """, + """ + $"{({ A = 3 })}" + """ + + """ + $"{({| A = 3 |})}" + """, + """ + $"{({| A = 3 |})}" + """ + + """ + $"{({ 1..10 })}" + """, + """ + $"{({ 1..10 })}" + """ + // LibraryOnlyILAssembly """(# "ldlen.multi 2 0" array : int #)""", """(# "ldlen.multi 2 0" array : int #)""" From c4ed80c4466dcc7dbecb369d997c354835bdcece Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 12 May 2025 17:05:07 -0700 Subject: [PATCH 086/134] Clean up Conformance UnitsOfMeasure (#18537) --- .../CompilerOptions/fsc/checked/checked.fs | 2 +- .../Conformance/UnitsOfMeasure/Basic.fs | 64 ----- .../Conformance/UnitsOfMeasure/Basic/Basic.fs | 56 +++++ .../UnitsOfMeasure/Basic/Calculus.fsx} | 1 + .../UnitsOfMeasure/Basic/DynamicTypeTest.fsx} | 0 .../UnitsOfMeasure/Basic/E_MassForce.fsx} | 0 .../UnitsOfMeasure/Basic/Ints01.fsx} | 0 .../UnitsOfMeasure/Basic/Mars.fsx} | 0 .../UnitsOfMeasure/Basic/MassForce.fsx} | 0 .../UnitsOfMeasure/Basic/Misc01.fsx} | 0 .../UnitsOfMeasure/Basic/Misc02.fsx} | 2 +- .../UnitsOfMeasure/Basic/Misc03.fsx} | 0 .../UnitsOfMeasure/Basic/Misc04.fsx} | 0 .../UnitsOfMeasure/Basic/OnDecimals01.fsx} | 0 .../Basic/Quotation04_hidden.fsx} | 0 .../Basic/RationalExponents01.fsx} | 0 .../UnitsOfMeasure/Basic/SI.fsx} | 0 .../UnitsOfMeasure/Basic/Stats.fsx} | 0 .../UnitsOfMeasure/Bounds/Bounds.fs | 36 +++ .../UnitsOfMeasure/Bounds/infinity_01.fsx} | 0 .../UnitsOfMeasure/Bounds/nan_01.fsx} | 1 - .../UnitsOfMeasure/Constants/Constants.fs | 42 ++++ .../Constants/E_UnsupportedTypes01.fsx} | 0 .../Constants/SpecialSyntax_.fsx} | 0 .../UnitsOfMeasure/Constants/decimal.fsx} | 0 .../UnitsOfMeasure/Constants/ieee32.fsx} | 0 .../UnitsOfMeasure/Constants/ieee64.fsx} | 0 .../Conformance/UnitsOfMeasure/Diagnostics.fs | 21 -- .../UnitsOfMeasure/Diagnostics/Diagnostics.fs | 226 ++++++++++++++++++ .../E_CantBeUsedAsPrefixArgToAType01.fsx | 0 .../E_CantBeUsedAsPrefixArgToAType02.fsx | 0 .../E_CantBeUsedAsPrefixArgToAType03.fsx | 0 .../E_CantBeUsedAsPrefixArgToAType04.fsx | 0 .../E_CantBeUsedAsPrefixArgToAType05.fsx | 0 .../E_ExpectedTypeNotUnitOfMeasure01.fsx} | 0 .../E_ExplicitUnitOfMeasureParameters01.fsx} | 0 .../E_ExplicitUnitOfMeasureParameters02.fsx} | 0 .../E_ExplicitUnitOfMeasureParameters03.fsx} | 0 .../E_ExplicitUnitOfMeasureParameters04.fsx} | 0 .../E_NonGenVarInValueRestrictionWarning.fsx} | 0 .../E_ParsingRationalExponents.fsx} | 0 .../Diagnostics/E_RangeExpression01.fsx} | 0 .../Diagnostics/E_RangeOfDecimals01.fsx} | 0 .../Diagnostics/E_RangeOfDimensioned03.fsx} | 0 .../E_UnexpectedTypeParameter01.fsx} | 0 .../Diagnostics/E_UnsupportedType01.fsx} | 0 .../Diagnostics/E_ZeroDenominator.fsx} | 0 .../Diagnostics/IntTypes01.fsx} | 2 +- .../Diagnostics/RangeExpression01.fsx} | 1 - .../Diagnostics/RangeOfDimensioned01.fsx} | 2 +- .../Diagnostics/RangeOfDimensioned02.fsx} | 4 +- .../W_UnitOfMeasureCodeLessGeneric01.fsx} | 0 .../UnitsOfMeasure/Operators/Operators.fs | 24 ++ .../Operators/Operators_decimal_01.fsx} | 0 .../Operators/Operators_float32_01.fsx} | 0 .../Operators/Operators_float_01.fsx} | 0 .../UnitsOfMeasure/Parenthesis/E_Error02.fsx} | 0 .../UnitsOfMeasure/Parenthesis/E_Error03.fsx} | 0 .../UnitsOfMeasure/Parenthesis/E_Error04.fsx} | 0 .../UnitsOfMeasure/Parenthesis/E_Error05.fsx} | 0 .../UnitsOfMeasure/Parenthesis/E_Error06.fsx} | 0 .../Parenthesis/E_IncompleteParens01.fsx} | 0 .../Parenthesis/E_IncompleteParens02.fsx} | 0 .../UnitsOfMeasure/Parenthesis/Parenthesis.fs | 106 ++++++++ .../Parenthesis/W_ImplicitProduct01.fsx} | 0 .../Parenthesis/W_Positive01.fsx} | 0 .../Conformance/UnitsOfMeasure/Parsing.fs | 55 ----- .../Parsing/E_KnownTypeAsUnit01b.fsx} | 0 .../UnitsOfMeasure/Parsing/E_Nesting01.fsx} | 0 .../Parsing/GreaterBarRBrack01.fsx} | 0 .../UnitsOfMeasure/Parsing/Parsing.fs | 72 ++++++ .../UnitsOfMeasure/Parsing/PowerSynonym.fsx} | 0 .../UnitsOfMeasure/Parsing/Quotient.fsx} | 0 .../UnitsOfMeasure/Parsing/QuotientAssoc.fsx} | 0 .../UnitsOfMeasure/Parsing/Reciprocal01.fsx} | 0 .../UnitsOfMeasure/Parsing/W_find_gtdef.fsx} | 0 .../Conformance/UnitsOfMeasure/TypeChecker.fs | 19 -- ...terfaceWithDifferentGenInstantiations.fsx} | 0 .../TypeChecker/E_typechecker01.fsx} | 0 .../TypeChecker/Generalization01.fsx} | 2 +- .../TypeChecker/GenericSubType01.fsx} | 0 .../TypeChecker/Slash_InFunction01.fsx} | 0 .../TypeChecker/Slash_InMethod01.fsx} | 0 .../TypeAbbreviation_decimal_01.fsx} | 2 +- .../TypeAbbreviation_float32_01.fsx} | 2 +- .../TypeAbbreviation_float_01.fsx} | 2 +- .../UnitsOfMeasure/TypeChecker/TypeChecker.fs | 117 +++++++++ .../TypeChecker/TypeConstraint02.fsx} | 0 .../TypeChecker/ValueRestriction01.fsx} | 0 .../TypeChecker/W_LessGeneric01.fsx | 0 .../TypeChecker/W_LessGeneric02.fsx} | 2 +- .../TypeChecker/W_TypeConstraint01.fsx} | 0 .../TypeChecker/W_TypeConstraint03.fsx} | 4 +- .../WithOOP/E_GenericUOM01.fsx} | 0 .../WithOOP/E_NoConstructorOnMeasure01.fsx} | 2 +- .../WithOOP/E_NoInstanceOnMeasure01.fsx} | 2 +- .../WithOOP/E_OverloadsDifferByUOMAttr.fsx} | 0 .../WithOOP/E_Polymorphism01.fsx | 5 +- .../UnitsOfMeasure/WithOOP/GenericUOM01.fsx} | 4 +- .../UnitsOfMeasure/WithOOP/InInterface01.fsx} | 4 +- .../WithOOP/Polymorphism02.fsx} | 2 +- .../WithOOP/StaticsOnMeasure01.fsx} | 2 +- .../UnitsOfMeasure/WithOOP/WithOOP.fs | 86 +++++++ .../FSharp.Compiler.ComponentTests.fsproj | 13 +- tests/FSharp.Test.Utilities/Compiler.fs | 3 +- .../UnitsOfMeasure/Basic/Calculus.fs | 31 --- .../UnitsOfMeasure/Basic/Misc01.fs | 9 - .../UnitsOfMeasure/Basic/Misc03.fs | 25 -- .../Basic/RationalExponents01.fs | 35 --- .../Conformance/UnitsOfMeasure/Basic/SI.fs | 32 --- .../Conformance/UnitsOfMeasure/Basic/Stats.fs | 32 --- .../Conformance/UnitsOfMeasure/Basic/env.lst | 18 -- .../Conformance/UnitsOfMeasure/Bounds/env.lst | 2 - .../UnitsOfMeasure/Constants/env.lst | 8 - .../UnitsOfMeasure/Diagnostics/env.lst | 29 --- .../UnitsOfMeasure/Operators/env.lst | 7 - .../UnitsOfMeasure/Parenthesis/env.lst | 13 - .../Parsing/GreaterBarRBrack01.fs | 18 -- .../Parsing/KnownTypeAsUnit01.fs | 25 -- .../UnitsOfMeasure/Parsing/Quotient.fs | 19 -- .../UnitsOfMeasure/Parsing/QuotientAssoc.fs | 24 -- .../UnitsOfMeasure/Parsing/Reciprocal01.fs | 17 -- .../UnitsOfMeasure/Parsing/env.lst | 4 - .../UnitsOfMeasure/TypeChecker/env.lst | 19 -- .../UnitsOfMeasure/WithOOP/env.lst | 10 - tests/fsharpqa/Source/test.lst | 10 - 126 files changed, 799 insertions(+), 578 deletions(-) delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Basic.fs rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/Calculus.fs => Conformance/UnitsOfMeasure/Basic/Calculus.fsx} (97%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/E_MassForce.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/E_MassForce.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Ints01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Ints01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Mars.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Mars.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/MassForce.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/MassForce.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/Misc01.fs => Conformance/UnitsOfMeasure/Basic/Misc01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc02.fsx} (97%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/Misc03.fs => Conformance/UnitsOfMeasure/Basic/Misc03.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc04.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc04.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fs => Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs => Conformance/UnitsOfMeasure/Basic/RationalExponents01.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/SI.fs => Conformance/UnitsOfMeasure/Basic/SI.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs => Conformance/UnitsOfMeasure/Basic/Stats.fsx} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/Bounds.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/infinity_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/infinity_01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/nan_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/nan_01.fsx} (97%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/Constants.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/decimal.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/decimal.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee32.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee32.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee64.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee64.fsx} (100%) delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/Diagnostics.fs rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType01.fsx (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType02.fsx (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType03.fsx (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType04.fsx (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType05.fsx (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_NonGenVarInValueRestrictionWarning.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fsx} (97%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fs => Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fsx} (94%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fsx} (86%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fsx} (70%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fsx} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fsx} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/Parenthesis.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/Positive01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_Positive01.fsx} (100%) delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_KnownTypeAsUnit01b.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs => Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fsx} (100%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Parsing.fs rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fs => Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Parsing/Quotient.fs => Conformance/UnitsOfMeasure/Parsing/Quotient.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs => Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fsx} (100%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs => Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/W_find_gtdef.fsx} (100%) delete mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/typechecker01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_typechecker01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fsx} (94%) rename tests/FSharp.Compiler.ComponentTests/{resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs => Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fsx} (87%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fsx} (86%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fsx} (87%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeChecker.fs rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fsx} (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric01.fsx (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/LessGeneric02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric02.fsx} (99%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint03.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint03.fsx} (88%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx} (100%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fsx} (97%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fsx} (97%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fsx} (100%) rename tests/{fsharpqa/Source => FSharp.Compiler.ComponentTests}/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx (94%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fsx} (95%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fsx} (96%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fsx} (97%) rename tests/{fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fs => FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fsx} (96%) create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Calculus.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc03.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/SI.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Stats.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Quotient.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/env.lst delete mode 100644 tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/env.lst diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/checked/checked.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/checked/checked.fs index 8a0447a450e..b842f04de77 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/checked/checked.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/checked/checked.fs @@ -12,7 +12,7 @@ module Checked = [] let ``fsc-unchecked - unchecked01_fs`` compilation = compilation - |> getCompilation + |> getCompilation |> asFs |> compile |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic.fs deleted file mode 100644 index da86f949265..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic.fs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Conformance.UnitsOfMeasure - -open Xunit -open FSharp.Test -open FSharp.Test.Compiler - -module Basic = - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - Misc01_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - Misc03_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - Stats_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - SI_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - RationalExponents01_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Basic) - [] - let ``Basic - Quotation04_hidden_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Basic.fs new file mode 100644 index 00000000000..ddb3a9fb049 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Basic.fs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Basic = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + let ``Basic - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + [] + let ``Basic - E_MassForce`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 1, Line 15, Col 27, Line 15, Col 32, "The unit of measure 'N' does not match the unit of measure 'kg'") + (Error 43, Line 15, Col 25, Line 15, Col 26, "The unit of measure 'N' does not match the unit of measure 'kg'") + ] + + [] + let ``Basic - Misc02_fs`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Warning 64, Line 36, Col 60, Line 36, Col 61, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'v has been constrained to be measure ''u/'w'.") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Calculus.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Calculus.fsx similarity index 97% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Calculus.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Calculus.fsx index 0263135fc55..cd91c9f2d2b 100644 --- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Calculus.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Calculus.fsx @@ -18,6 +18,7 @@ let rec newton (f:float<_> -> float<_>) f' x xacc = else newton f f' x' xacc // Non-regular datatype: a list of derivatives of a function +[] type derivs<[] 'u, [] 'v> = Nil | Cons of (float<'u> -> float<'v>) * derivs<'u,'v/'u> diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/DynamicTypeTest.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/E_MassForce.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/E_MassForce.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/E_MassForce.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/E_MassForce.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Ints01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Ints01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Ints01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Ints01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Mars.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Mars.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Mars.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Mars.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/MassForce.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/MassForce.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/MassForce.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/MassForce.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Misc01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc01.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Misc01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc02.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc02.fsx index 87e1f8d6025..79b036bef91 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc02.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc02.fsx @@ -94,4 +94,4 @@ let r2 = (polyadd (new ComplexProd())) let weird(x:float<'u 'w>) (y:float<'v 'w>) (z:float<'w/'u 'v>) = 1 -if (r/1.0 = 14.0) && (r2/1.0 = 28.0) then exit 0 else 1 +(if (r/1.0 = 14.0) && (r2/1.0 = 28.0) then 0 else 1) |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Misc03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc03.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Misc03.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc03.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc04.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc04.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Misc04.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/OnDecimals01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Quotation04_hidden.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/SI.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/SI.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/SI.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/SI.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Stats.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Basic/Stats.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/Bounds.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/Bounds.fs new file mode 100644 index 00000000000..f2473d8a31e --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/Bounds.fs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Bounds = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + + [] + let ``infinity_01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 717, Line 12, Col 18, Line 12, Col 27, "Unexpected type arguments") + (Error 717, Line 13, Col 18, Line 13, Col 26, "Unexpected type arguments") + (Error 717, Line 14, Col 19, Line 14, Col 28, "Unexpected type arguments") + (Error 717, Line 15, Col 19, Line 15, Col 27, "Unexpected type arguments") + ] + + [] + let ``nan_01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 717, Line 7, Col 19, Line 7, Col 22, "Unexpected type arguments") + ] diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/infinity_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/infinity_01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/infinity_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/infinity_01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/nan_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/nan_01.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/nan_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/nan_01.fsx index 399089c85de..3272b6ad107 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/nan_01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Bounds/nan_01.fsx @@ -5,4 +5,3 @@ #light [] type kg let mysterymass = nan -exit 1 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/Constants.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/Constants.fs new file mode 100644 index 00000000000..fd1d8440aef --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/Constants.fs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Constants = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + [] + let ``Constants - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + [] + let ``E_UnsupportedTypes01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 636, Line 22, Col 9, Line 22, Col 15, "Units-of-measure are only supported on float, float32, decimal, and integer types.") + (Error 636, Line 23, Col 9, Line 23, Col 15, "Units-of-measure are only supported on float, float32, decimal, and integer types.") + ] diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/E_UnsupportedTypes01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/SpecialSyntax_.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/decimal.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/decimal.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/decimal.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/decimal.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee32.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee32.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee32.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee32.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee64.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee64.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/ieee64.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Constants/ieee64.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics.fs deleted file mode 100644 index df101be4a31..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics.fs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Conformance.UnitsOfMeasure - -open Xunit -open FSharp.Test -open FSharp.Test.Compiler - -module Diagnostics = - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Diagnostics) - // - [] - let ``Diagnostics - RangeExpression01_fs - --test:ErrorRanges`` compilation = - compilation - |> asFsx - |> withOptions ["--test:ErrorRanges"] - |> compile - |> shouldSucceed - |> ignore - diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/Diagnostics.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/Diagnostics.fs new file mode 100644 index 00000000000..703dc3cb517 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/Diagnostics.fs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Diagnostics = + + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> compile + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceedWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> ignoreWarnings + |> compile + |> shouldSucceed + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> compile + |> shouldSucceed + + [] + [] + [] + [] + [] + let ``Diagnostics - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + [] + let ``E_CantBeUsedAsPrefixArgToAType01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 706, Line 9, Col 12, Line 9, Col 29, "Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.") + ] + + [] + let ``E_CantBeUsedAsPrefixArgToAType02_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 706, Line 9, Col 12, Line 9, Col 24, "Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.") + ] + + [] + let ``E_CantBeUsedAsPrefixArgToAType03_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 706, Line 9, Col 12, Line 9, Col 27, "Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.") + ] + + [] + let ``E_CantBeUsedAsPrefixArgToAType04_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 706, Line 9, Col 12, Line 9, Col 21, "Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.") + ] + + [] + let ``E_CantBeUsedAsPrefixArgToAType05_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 716, Line 10, Col 12, Line 10, Col 21, "Unexpected / in type") + (Error 704, Line 10, Col 12, Line 10, Col 13, "Expected type, not unit-of-measure") + (Error 706, Line 10, Col 14, Line 10, Col 21, "Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets.") + ] + + [] + let ``E_ExpectedTypeNotUnitOfMeasure01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 33, Line 11, Col 10, Line 11, Col 19, "The non-generic type 'Microsoft.FSharp.Core.string' does not expect any type arguments, but here is given 1 type argument(s)") + (Error 704, Line 12, Col 11, Line 12, Col 12, "Expected type, not unit-of-measure") + (Error 704, Line 13, Col 17, Line 13, Col 18, "Expected type, not unit-of-measure") + (Error 704, Line 14, Col 49, Line 14, Col 50, "Expected type, not unit-of-measure") + ] + + [] + let ``E_ExplicitUnitOfMeasureParameters01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 702, Line 6, Col 41, Line 6, Col 43, "Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute.") + ] + + [] + let ``E_ExplicitUnitOfMeasureParameters02_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 702, Line 6, Col 45, Line 6, Col 47, "Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute.") + ] + + [] + let ``E_ExplicitUnitOfMeasureParameters03_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 702, Line 6, Col 33, Line 6, Col 35, "Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute.") + (Warning 1178, Line 6, Col 6, Line 6, Col 12, "The struct, record or union type 'T_2920' is not structurally comparable because the type 'obj' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type 'T_2920' to clarify that the type is not comparable") + ] + + [] + let ``E_ExplicitUnitOfMeasureParameters04_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 702, Line 6, Col 27, Line 6, Col 29, "Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute.") + (Error 35, Line 6, Col 6, Line 6, Col 12, "This construct is deprecated: This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'.") + ] + + [] + let ``E_NonGenVarInValueRestrictionWarning_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 30, Line 6, Col 5, Line 6, Col 6, """Value restriction: The value 'x' has an inferred generic type + val x: float<'_u> list ref + However, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following: + - Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1" + - Add an explicit type annotation like "let x : int" + - Use the value as a non-generic type in later code for type inference like "do x" + or if you still want type-dependent results, you can define 'x' as a function instead by doing either: + - Add a unit parameter like "let x()" + - Write explicit type parameters like "let x<'a>". + This error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results.""") + (Error 30, Line 7, Col 5, Line 7, Col 6, """Value restriction: The value 'y' has an inferred generic type + val y: '_a list ref + However, values cannot have generic type variables like '_a in "let x: '_a". You can do one of the following: + - Define it as a simple data term like an integer literal, a string literal or a union case like "let x = 1" + - Add an explicit type annotation like "let x : int" + - Use the value as a non-generic type in later code for type inference like "do x" + or if you still want type-dependent results, you can define 'y' as a function instead by doing either: + - Add a unit parameter like "let x()" + - Write explicit type parameters like "let x<'a>". + This error is because a let binding without parameters defines a value, not a function. Values cannot be generic because reading a value is assumed to result in the same everywhere but generic type parameters may invalidate this assumption by enabling type-dependent results.""") + ] + + [] + let ``E_ParsingRationalExponents_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 620, Line 11, Col 19, Line 11, Col 20, "Unexpected integer literal in unit-of-measure expression") + (Error 10, Line 12, Col 20, Line 12, Col 21, "Unexpected symbol ')' in binding. Expected integer literal or other token.") + (Error 10, Line 13, Col 18, Line 13, Col 19, "Unexpected infix operator in binding. Expected integer literal, '-' or other token.") + ] + + [] + let ``E_RangeOfDecimals01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 1, Line 8, Col 16, Line 8, Col 23, "The type 'decimal' does not match the type 'decimal'") + ] + + [] + let ``E_RangeOfDimensioned03_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 1, Line 7, Col 11, Line 7, Col 18, "The type 'float' does not match the type 'float'") + (Error 1, Line 7, Col 22, Line 7, Col 28, """Type mismatch. Expecting a +'float' +but given a +'float' +The unit of measure 'Kg' does not match the unit of measure 's'""") + (Error 1, Line 9, Col 22, Line 9, Col 28, "The unit of measure 's' does not match the unit of measure 'Kg'") + ] + + [] + let ``E_UnexpectedTypeParameter01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 634, Line 7, Col 15, Line 7, Col 17, "Non-zero constants cannot have generic units. For generic zero, write 0.0<_>.") + (Error 634, Line 8, Col 16, Line 8, Col 18, "Non-zero constants cannot have generic units. For generic zero, write 0.0<_>.") + (Error 634, Line 9, Col 16, Line 9, Col 18, "Non-zero constants cannot have generic units. For generic zero, write 0.0<_>.") + ] + + [] + let ``E_UnsupportedType01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 636, Line 9, Col 9, Line 9, Col 15, "Units-of-measure are only supported on float, float32, decimal, and integer types.") + ] + + [] + let ``E_ZeroDenominator_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 625, Line 8, Col 19, Line 8, Col 20, "Denominator must not be 0 in unit-of-measure exponent") + (Error 625, Line 9, Col 21, Line 9, Col 22, "Denominator must not be 0 in unit-of-measure exponent") + ] + + [] + let ``W_UnitOfMeasureCodeLessGeneric01_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 64, Line 5, Col 30, Line 5, Col 31, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'a has been constrained to be measure '1'.") + ] + + diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType01.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType02.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType02.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType02.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType02.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType03.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType03.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType03.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType03.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType04.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType04.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType04.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType04.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType05.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType05.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType05.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_CantBeUsedAsPrefixArgToAType05.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExpectedTypeNotUnitOfMeasure01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters02.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters03.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ExplicitUnitOfMeasureParameters04.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_NonGenVarInValueRestrictionWarning.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_NonGenVarInValueRestrictionWarning.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_NonGenVarInValueRestrictionWarning.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ParsingRationalExponents.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeExpression01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDecimals01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_RangeOfDimensioned03.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnexpectedTypeParameter01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_UnsupportedType01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/E_ZeroDenominator.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fsx index aa6402c8405..486eec82180 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/IntTypes01.fsx @@ -9,4 +9,4 @@ let b = 1 * 1 // int=int32 let c = 1s / 1s // int16 let d = 1y + 1y // int8 -exit 0 +ignore 0 diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fsx similarity index 94% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fsx index c2ba1e3df38..5124be877c5 100644 --- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeExpression01.fsx @@ -10,4 +10,3 @@ type foo let m, n = 1, 10 [m .. 1 .. n] // OK -printfn "Finished" diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fsx similarity index 86% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fsx index 028d13cfb5d..940800dbe51 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fsx @@ -7,4 +7,4 @@ let v1 = [1.0 .. 1.0 .. 3.0] |> Seq.sum -(if v1 = 6.0 then 0 else 1) |> exit +(if v1 = 6.0 then 0 else 1) |> ignore diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fsx similarity index 70% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fsx index 60007529f20..a692428ab3e 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fsx @@ -5,8 +5,8 @@ [] type Kg -let v1 = [1.0 .. 2.0 .. 5.0] |> Seq.nth 1 +let v1 = [1.0 .. 2.0 .. 5.0] |> Seq.item 1 -(if v1 = 3.0 then 0 else 1) |> exit +(if v1 = 3.0 then 0 else 1) |> ignore diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Diagnostics/W_UnitOfMeasureCodeLessGeneric01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators.fs new file mode 100644 index 00000000000..34b4f119447 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators.fs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Operators = + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + let ``Operators - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_decimal_01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float32_01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Operators/Operators_float_01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error02.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error03.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error04.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error05.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_Error06.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/E_IncompleteParens02.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/Parenthesis.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/Parenthesis.fs new file mode 100644 index 00000000000..16df852fb55 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/Parenthesis.fs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Parenthesis = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceedWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> ignoreWarnings + |> typecheck + |> shouldSucceed + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + let ``E_Error02_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 620, Line 11, Col 19, Line 11, Col 20, "Unexpected integer literal in unit-of-measure expression") + ] + + [] + let ``E_Error03_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 10, Line 11, Col 31, Line 11, Col 32, "Unexpected symbol ')' in binding") + ] + + [] + let ``E_Error04_fs`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 10, Line 11, Col 34, Line 11, Col 35, "Unexpected symbol '_' in binding") + ] + + [] + let ``E_Error05_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 10, Line 11, Col 28, Line 11, Col 29, "Unexpected symbol ')' in binding") + ] + + [] + let ``E_Error06_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 620, Line 11, Col 20, Line 11, Col 23, "Unexpected integer literal in unit-of-measure expression") + ] + + [] + let ``E_IncompleteParens01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 10, Line 11, Col 1, Line 11, Col 1, "Incomplete structured construct at or before this point in expression. Expected ')' or other token.") + (Error 583, Line 10, Col 26, Line 10, Col 27, "Unmatched '('") + ] + + [] + let ``E_IncompleteParens02_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 3156, Line 11, Col 24, Line 11, Col 25, "Unexpected token '/' or incomplete expression") + (Error 10, Line 11, Col 26, Line 11, Col 27, "Unexpected symbol ')' in binding. Expected incomplete structured construct at or before this point or other token.") + ] + + [] + let ``W_ImplicitProduct01_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 632, Line 11, Col 25, Line 11, Col 32, "Implicit product of measures following /") + ] + + [] + let ``W_Positive01_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 464, Line 24, Col 33, Line 24, Col 39, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + ] diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_ImplicitProduct01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/Positive01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_Positive01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/Positive01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parenthesis/W_Positive01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing.fs deleted file mode 100644 index 6dc46f8013f..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing.fs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Conformance.UnitsOfMeasure - -open Xunit -open FSharp.Test -open FSharp.Test.Compiler - -module Parsing = - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Parsing) - [] - let ``Parsing - GreaterBarRBrack01_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Parsing) - [] - let ``Parsing - Reciprocal01_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Parsing) - [] - let ``Parsing - QuotientAssoc_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Parsing) - [] - let ``Parsing - Quotient_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/Parsing) - [] - let ``Parsing - PowerSynonym_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_KnownTypeAsUnit01b.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_KnownTypeAsUnit01b.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/E_Nesting01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Parsing.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Parsing.fs new file mode 100644 index 00000000000..6b2b654517f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Parsing.fs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module Parsing = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceedWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> ignoreWarnings + |> typecheck + |> shouldSucceed + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + [] + [] + let ``Parsing - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + [] + let ``E_KnownTypeAsUnit01b_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 705, Line 14, Col 9, Line 14, Col 14, "Expected unit-of-measure, not type") + (Error 705, Line 17, Col 17, Line 17, Col 20, "Expected unit-of-measure, not type") + (Error 705, Line 20, Col 24, Line 20, Col 27, "Expected unit-of-measure, not type") + (Error 705, Line 23, Col 37, Line 23, Col 42, "Expected unit-of-measure, not type") + (Error 705, Line 26, Col 38, Line 26, Col 41, "Expected unit-of-measure, not type") + ] + + [] + let ``E_Nesting01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 714, Line 12, Col 19, Line 12, Col 20, "Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression") + (Error 707, Line 17, Col 17, Line 17, Col 21, "Unit-of-measure cannot be used in type constructor application") + ] + + [] + let ``W_find_gtdef_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 64, Line 16, Col 21, Line 16, Col 22, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'u has been constrained to be measure 'Continuous'.") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/PowerSynonym.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/Quotient.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Quotient.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/Quotient.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Quotient.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/W_find_gtdef.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/Parsing/W_find_gtdef.fsx diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker.fs deleted file mode 100644 index 34d3de20940..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker.fs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Conformance.UnitsOfMeasure - -open Xunit -open FSharp.Test -open FSharp.Test.Compiler - -module TypeChecker = - - // This test was automatically generated (moved from FSharpQA suite - Conformance/UnitsOfMeasure/TypeChecker) - [] - let ``TypeChecker - GenericSubType01_fs`` compilation = - compilation - |> asFsx - |> typecheck - |> shouldSucceed - |> ignore - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_GenInterfaceWithDifferentGenInstantiations.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/typechecker01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_typechecker01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/typechecker01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/E_typechecker01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fsx similarity index 94% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fsx index c46cefad1f4..53494495f23 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Generalization01.fsx @@ -14,4 +14,4 @@ type T = static member star ( y:'b when 'b :> M<'a>) = 0 let p = 1 let m = Unchecked.defaultof> -T.star(m) |> exit +T.star(m) |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fsx similarity index 100% rename from tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InFunction01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/Slash_InMethod01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fsx similarity index 87% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fsx index bcb68704da5..b6231bdc933 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fsx @@ -10,4 +10,4 @@ module WithDecimal = let a = 100.0M let a_na = a * 2.0M // Bug #3427 let b : Ab = 100.0M - (if (b*2.0M = 200.0M) then 0 else 1) |> exit + (if (b*2.0M = 200.0M) then 0 else 1) |> ignore diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fsx similarity index 86% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fsx index 3a4b5c44f18..cf52976f431 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fsx @@ -10,5 +10,5 @@ module WithFloat32 = let a = 100.0f let a_na = a * 2.0f let b : Ab = 100.0f - (if (b*2.0f = 200.0f) then 0 else 1) |> exit + (if (b*2.0f = 200.0f) then 0 else 1) |> ignore diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fsx similarity index 87% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fsx index 015e097a977..5075586b4d2 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fsx @@ -12,5 +12,5 @@ module WithFloat = let a_na = a * 2.0 let b : Ab = 100.0 - (if (b*2.0 = 200.0) then 0 else 1) |> exit + (if (b*2.0 = 200.0) then 0 else 1) |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeChecker.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeChecker.fs new file mode 100644 index 00000000000..7b511e22b41 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeChecker.fs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module TypeChecker = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceedWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> ignoreWarnings + |> typecheck + |> shouldSucceed + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + [] + [] + [] + [] + [] + [] + let ``TypeChecker - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + + [] + let ``E_GenInterfaceWithDifferentGenInstantiations_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 3360, Line 13, Col 6, Line 13, Col 8, "'IB<'b>' cannot implement the interface 'IA<_>' with the two instantiations 'IA' and 'IA<'b>' because they may unify.") + ] + + [] + let ``E_typechecker01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 687, Line 8, Col 1, Line 8, Col 2, "This value, type or method expects 2 type parameter(s) but was given 1") + ] + + [] + let ``W_LessGeneric01_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 64, Line 18, Col 17, Line 18, Col 19, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'u has been constrained to be measure '1'.") + ] + + [] + let ``W_LessGeneric02_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 464, Line 9, Col 18, Line 9, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 10, Col 18, Line 10, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 11, Col 18, Line 11, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 12, Col 18, Line 12, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 13, Col 18, Line 13, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 14, Col 18, Line 14, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 15, Col 18, Line 15, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 16, Col 18, Line 16, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 17, Col 18, Line 17, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 18, Col 18, Line 18, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 19, Col 18, Line 19, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 20, Col 18, Line 20, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 21, Col 18, Line 21, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 22, Col 18, Line 22, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 23, Col 18, Line 23, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 24, Col 18, Line 24, Col 25, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + (Warning 464, Line 25, Col 21, Line 25, Col 28, "This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'.") + ] + + [] + let ``W_TypeConstraint01_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ + (Warning 64, Line 11, Col 7, Line 11, Col 14, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'u has been constrained to be measure 'kg'.") + (Warning 64, Line 11, Col 19, Line 11, Col 26, "This construct causes code to be less generic than indicated by the type annotations. The unit-of-measure variable 'v has been constrained to be measure 'kg'.") + ] + + [] + let ``W_TypeConstraint03_fsx`` compilation = + compilation + |> getCompilation + |> shouldSucceedWithDiagnostics [ +#if NETFRAMEWORK + (Warning 52, Line 10, Col 7, Line 10, Col 21, "The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed") +#endif + ] diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint02.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/ValueRestriction01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric01.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/LessGeneric02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric02.fsx similarity index 99% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/LessGeneric02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric02.fsx index 51b928922a3..55fe6960ad4 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/LessGeneric02.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_LessGeneric02.fsx @@ -26,4 +26,4 @@ let sq = } |> Seq.sum -exit 0 +ignore 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint03.fsx similarity index 88% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint03.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint03.fsx index 4fe15a1481e..686f194055e 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeConstraint03.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/TypeChecker/W_TypeConstraint03.fsx @@ -8,5 +8,5 @@ type x = System.Nullable> let x_obj = Unchecked.defaultof match x_obj.HasValue with -| false -> exit 0 -| _ -> exit 1 \ No newline at end of file +| false -> ignore 0 +| _ -> ignore 1 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fsx index aa1a38aefd3..9149a410877 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoConstructorOnMeasure01.fsx @@ -10,4 +10,4 @@ type kg = static member Foo() = 1 let objKg = 1.0f -exit 1 +ignore 1 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fsx index 4ff94cf8683..8a3a857491c 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_NoInstanceOnMeasure01.fsx @@ -8,4 +8,4 @@ type kg = member this.Foo() = 5 -exit 1 +ignore 1 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fsx similarity index 100% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_OverloadsDifferByUOMAttr.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx similarity index 94% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx index 961af529c02..f33870b14f6 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_Polymorphism01.fsx @@ -14,8 +14,5 @@ type Meter() = type Value< [] 'a > = float<'a> * Unit<'a> -#if INTERACTIVE -;; -exit 1;; -#endif +ignore 1 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fsx similarity index 95% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fsx index 3fd973024cd..30fe2cd9c98 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/GenericUOM01.fsx @@ -23,6 +23,6 @@ let y = x.Foo 1.0 if y <> 5.0 then - exit 1 + ignore 1 -exit 0 +ignore 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fsx similarity index 96% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fsx index ec5f4282007..42b23b9e271 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/InInterface01.fsx @@ -31,6 +31,6 @@ let testResult = | _ -> true if testResult = false then - exit 1 + ignore 1 -exit 0 +ignore 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fsx similarity index 97% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fsx index ad94a9d4e1f..8161b0560f7 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fsx @@ -13,4 +13,4 @@ type Unit<[] 'a >() = let objUnit = new Unit() if objUnit.Factor() <> 1.0 then exit 1 -exit 0 +ignore 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fsx similarity index 96% rename from tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fs rename to tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fsx index ead91c1ad14..58047848f92 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/StaticsOnMeasure01.fsx @@ -11,4 +11,4 @@ type kg = if kg.Prop <> 5 then exit 1 if kg.Func 3 <> 4 then exit 1 -exit 0 +ignore 0 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs new file mode 100644 index 00000000000..3b416979e43 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.UnitsOfMeasure + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + +module WithOOP = + let shouldFailWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldFail + |> withDiagnostics expectedDiagnostics + + let shouldSucceedWithDiagnostics expectedDiagnostics compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> ignoreWarnings + |> typecheck + |> shouldSucceed + |> withDiagnostics expectedDiagnostics + + let shouldSucceed compilation = + compilation + |> asLibrary + |> withOptions ["--test:ErrorRanges"] + |> typecheck + |> shouldSucceed + + [] + [] + [] + [] + [] + let ``TypeChecker - shouldSucceed`` compilation = + compilation + |> getCompilation + |> shouldSucceed + + [] + let ``E_GenericUOM01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 842, Line 8, Col 36, Line 8, Col 51, "This attribute is not valid for use on this language element") + ] + + [] + let ``E_NoConstructorOnMeasure01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 904, Line 8, Col 5, Line 8, Col 18, "Measure declarations may have only static members: constructors are not available") + ] + + [] + let ``E_NoInstanceOnMeasure01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 897, Line 9, Col 5, Line 9, Col 26, "Measure declarations may have only static members") + ] + + + [] + let ``E_OverloadsDifferByUOMAttr_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 438, Line 10, Col 5, Line 10, Col 8, "Duplicate method. The method '.ctor' has the same name and signature as another method in type 'Foo<'a>' once tuples, functions, units of measure and/or provided types are erased.") + (Error 438, Line 9, Col 5, Line 9, Col 8, "Duplicate method. The method '.ctor' has the same name and signature as another method in type 'Foo<'a>' once tuples, functions, units of measure and/or provided types are erased.") + ] + + [] + let ``E_Polymorphism01_fsx`` compilation = + compilation + |> getCompilation + |> shouldFailWithDiagnostics [ + (Error 366, Line 12, Col 13, Line 12, Col 25, "No implementation was given for 'abstract Unit.Factor: unit -> float'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'.") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 812833e988c..df531ac0058 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -129,10 +129,15 @@ - - - - + + + + + + + + + diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index ba72ee42e29..e3c9269a5bd 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -1629,7 +1629,8 @@ Actual: (sourceErrors, expectedErrors) ||> List.iter2 (fun actual expected -> - Assert.Equal(expected, actual)) + try Assert.Equal(expected, actual) + with | _ -> failwith $"%s{what}:\nactual:\n %s{actual}\nexpected:\n %s{expected}") let adjust (adjust: int) (result: CompilationResult) : CompilationResult = match result with diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Calculus.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Calculus.fs deleted file mode 100644 index 0263135fc55..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Calculus.fs +++ /dev/null @@ -1,31 +0,0 @@ -// #Conformance #UnitsOfMeasure -#light - -let diff (h:float<_>) (f :_ -> float<_>) = fun x -> (f (x+h) - f (x-h)) / (2.0*h) - -let integrate (f:float<_> -> float<_>) (a:float<_>) (b:float<_>) n = - let h = (b-a) / (float n) - let rec iter x i = - if i=0 then 0.0<_> - else f x + iter (x+h) (i-1) - h * (f a / 2.0 + iter (a+h) (n-1) + f b / 2.0) - -let rec newton (f:float<_> -> float<_>) f' x xacc = - let dx = f x / f' x - let x' = x - dx - if abs dx / x' < xacc - then x' - else newton f f' x' xacc - -// Non-regular datatype: a list of derivatives of a function -type derivs<[] 'u, [] 'v> = - Nil -| Cons of (float<'u> -> float<'v>) * derivs<'u,'v/'u> - -// Essential use of polymorphic recursion! -// Given a step h, function f, and integer n, compute a list of n derivatives -// [f; f'; f''; ...] -// where f is the function itself, f' is the first derivative, f'' is the second, etc. - -let rec makeDerivs<[] 'u, [] 'v> (h:float<'u>, f:float<'u> -> float<'v>, n:int) : derivs<'u,'v> = - if n=0 then Nil else Cons(f, makeDerivs(h, diff h f, n-1)) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc01.fs deleted file mode 100644 index a48edb12d9d..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc01.fs +++ /dev/null @@ -1,9 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:2869 -#light - -// Polymorphic recursion -let rec prodlists<[] 'u,[] 'v>(xs:float<'u> list,ys:float<'v> list) : float<'u 'v> list = - match xs,ys with - | x::xs,y::ys -> x*y :: prodlists<'v,'u>(ys,xs) - | _ -> [] diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc03.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc03.fs deleted file mode 100644 index 4f6b5a4429b..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Misc03.fs +++ /dev/null @@ -1,25 +0,0 @@ -// #Conformance #UnitsOfMeasure -let recip1 x = 1.0/x -let recip2 (x:float<_>) = 1.0/x - -let zero1 = 0.0 -let zero2 = 0.0<_> - -let halvelist0 xs = List.map ( (/) 2.0 : float -> float ) xs -let halvelist1 xs = List.map ( (/) 2.0 : float<_> -> float<_> ) xs -let halvelist2 (xs:float<_> list) = List.map ( (/) 2.0) xs -let halvelist3 xs = List.map ( (/) 2.0) xs - -let pr x y = printf "%f %s" x y -let pr2 (x:float<_>) = printf "%f" x - -// From thesis -let abs x = if x < 0.0<_> then 0.0<_> - x else x -let sqr (x:float<_>) = x*x -let cube x = x*sqr x -let powers x y z = sqr x + cube y + sqr z * cube z - -// Now let's test some explicit types -let sqr2< [] 'u>(x:float<'u>) = x*x -let cube2<[] 'v>(x) = sqr2<'v> x * x -let rec reccube1(x) = if x < 0.0<_> then x else - reccube1(x) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs deleted file mode 100644 index 79c649e564e..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/RationalExponents01.fs +++ /dev/null @@ -1,35 +0,0 @@ -// #Conformance #UnitsOfMeasure -// Rational exponents feature - -[] -type kg - -[] -type s - -[] -type m - -// Simple fractions -let test01() = 1.0 -let test02() = 2.0 -let test03() = sqrt (test01()) + test02() - -// Negative fractions -let test04() = 4.0 -let test05() = 5.0 -let test06() = 1.0 / (test04() * test05()) + 3.0 - -// More complex expressions -let test07() = 2.0 -let test08() = 4.0<(s^6 kg^3)^(1/4)> -let test09() = test07() * test08() + 3.0 - -// Generics -let test10(x:float<'u>) (y:float<'u^(1/2)>) = sqrt x + y -let test11(x:float<'u^-(1/4)>) (y:float<'u^(3/4)>) : float = (x*x*x + 1.0/y) * x -let test12(x:float<'u^(1/2)>) (y:float<'v^2>) :float<'u 'v> = x*x*sqrt y -let test13() = test12 4.0 2.0 + 3.0<(kg s)^(1/2)> - -exit 0 - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/SI.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/SI.fs deleted file mode 100644 index 582f849d974..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/SI.fs +++ /dev/null @@ -1,32 +0,0 @@ -// #Conformance #UnitsOfMeasure -#light - -[] type kg // kilogram -[] type m // metre -[] type s // second -[] type A // ampere -[] type mol // mole -[] type K // kelvin -[] type cd // candela - -[] type rad = m/m // radian -[] type sr = m^2/m^2 // steradian -[] type Hz = s^-1 // hertz -[] type N = kg m / s^2 // newton -[] type Pa = N / m^2 // pascal -[] type J = N m // joule -[] type W = J / s // watt -[] type C = s A // coulomb -[] type V = W/A // watt -[] type F = C/V // farad -[] type ohm = V/A // ohm -[] type S = A/V // siemens -[] type Wb = V s // weber -[] type T = Wb/m^2 // tesla -[] type H = Wb/A // henry -[] type lm = cd sr // lumen -[] type lx = lm/m^2 // lux -[] type Bq = s^-1 // becquerel -[] type Gy = J/kg // gray -[] type Sv = J/kg // sievert -[] type kat = mol/s // katal diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Stats.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Stats.fs deleted file mode 100644 index 8bdb04c9dc1..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/Stats.fs +++ /dev/null @@ -1,32 +0,0 @@ -// #Conformance #UnitsOfMeasure -#light - -let rec sum xs = match xs with [] -> 0.0<_> | (x::xs) -> x + sum xs - -let rec sumMap f xs = match xs with [] -> 0.0<_> | (x::xs) -> f x + sumMap f xs -let rec sumMap2 f xs ys = match xs,ys with (x::xs,y::ys) -> f x y + sumMap2 f xs ys | _ -> 0.0<_> - -let mean xs = sum xs / float (List.length xs) - -let meanMap f xs = sumMap f xs / float (List.length xs) - -let sqr (x:float<_>) = x*x - -let cube x = x*sqr x - -let variance xs = let m = mean xs in meanMap (fun x -> sqr (x-m)) xs -let sdeviation xs = sqrt (variance xs) - -let skewness xs = - let n = float (List.length xs) - let m = mean xs - let s = sdeviation xs - meanMap (fun x -> cube(x-m)) xs / (cube s) - -let covariance xs ys = - let m = mean xs - let n = mean ys - sumMap2 (fun x y -> (x-m)*(y-n)) xs ys / (float n) - -let correlation xs ys = - covariance xs ys / (mean xs * mean ys) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/env.lst deleted file mode 100644 index 378c1aa2247..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Basic/env.lst +++ /dev/null @@ -1,18 +0,0 @@ - SOURCE=Calculus.fs COMPILE_ONLY=1 # Calculus.fs - - SOURCE=Mars.fs # Mars.fs - - SOURCE=MassForce.fs # MassForce.fs - SOURCE=E_MassForce.fs SCFLAGS="--test:ErrorRanges" # E_MassForce.fs - - SOURCE=Ints01.fs # Ints01.fs - - SOURCE=Misc02.fs # Misc02.fs - SOURCE=Misc04.fs # Misc04.fs - - - - - SOURCE=DynamicTypeTest.fs # DynamicTypeTest.fs - SOURCE=OnDecimals01.fs # OnDecimals01.fs - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/env.lst deleted file mode 100644 index ea51d725c9e..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Bounds/env.lst +++ /dev/null @@ -1,2 +0,0 @@ - SOURCE=infinity_01.fs SCFLAGS="--test:ErrorRanges" # infinity_01.fs - SOURCE=nan_01.fs SCFLAGS="--test:ErrorRanges" # nan_01.fs diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/env.lst deleted file mode 100644 index 10221fc0251..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Constants/env.lst +++ /dev/null @@ -1,8 +0,0 @@ - SOURCE=decimal.fs SCFLAGS=-a # decimal.fs - SOURCE=E_UnsupportedTypes01.fs SCFLAGS=-a # E_UnsupportedTypes01.fs - SOURCE=ieee32.fs SCFLAGS=-a # ieee32.fs - SOURCE=ieee64.fs SCFLAGS=-a # ieee64.fs - SOURCE=SpecialSyntax_.fs SCFLAGS=-a # SpecialSyntax_.fs - - - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/env.lst deleted file mode 100644 index 8b92be2e707..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/env.lst +++ /dev/null @@ -1,29 +0,0 @@ - SOURCE=E_RangeExpression01.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_RangeExpression01.fs - - SOURCE=W_NonGenVarInValueRestrictionWarning.fs SCFLAGS="--test:ErrorRanges --flaterrors" # W_NonGenVarInValueRestrictionWarning.fs - SOURCE=E_CantBeUsedAsPrefixArgToAType01.fsx SCFLAGS="--test:ErrorRanges" # E_CantBeUsedAsPrefixArgToAType01.fsx - SOURCE=E_CantBeUsedAsPrefixArgToAType02.fsx SCFLAGS="--test:ErrorRanges" # E_CantBeUsedAsPrefixArgToAType02.fsx - SOURCE=E_CantBeUsedAsPrefixArgToAType03.fsx SCFLAGS="--test:ErrorRanges" # E_CantBeUsedAsPrefixArgToAType03.fsx - SOURCE=E_CantBeUsedAsPrefixArgToAType04.fsx SCFLAGS="--test:ErrorRanges" # E_CantBeUsedAsPrefixArgToAType04.fsx - SOURCE=E_CantBeUsedAsPrefixArgToAType05.fsx SCFLAGS="--test:ErrorRanges" # E_CantBeUsedAsPrefixArgToAType05.fsx - - SOURCE=E_UnexpectedTypeParameter01.fs SCFLAGS="--test:ErrorRanges" # E_UnexpectedTypeParameter01.fs - SOURCE=E_ZeroDenominator.fs SCFLAGS="--test:ErrorRanges" # E_ZeroDenominator.fs - SOURCE=E_ParsingRationalExponents.fs SCFLAGS="--test:ErrorRanges" # E_ParsingRationalExponents.fs - - SOURCE=W_UnitOfMeasureCodeLessGeneric01.fs SCFLAGS="--test:ErrorRanges -a" # W_UnitOfMeasureCodeLessGeneric01.fs - - SOURCE=E_ExplicitUnitOfMeasureParameters01.fs SCFLAGS="--test:ErrorRanges" # E_ExplicitUnitOfMeasureParameters01.fs - SOURCE=E_ExplicitUnitOfMeasureParameters02.fs SCFLAGS="--test:ErrorRanges" # E_ExplicitUnitOfMeasureParameters02.fs - SOURCE=E_ExplicitUnitOfMeasureParameters03.fs SCFLAGS="--test:ErrorRanges" # E_ExplicitUnitOfMeasureParameters03.fs - SOURCE=E_ExplicitUnitOfMeasureParameters04.fs SCFLAGS="--test:ErrorRanges" # E_ExplicitUnitOfMeasureParameters04.fs - - SOURCE=E_RangeOfDimensioned03.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_RangeOfDimensioned03.fs - SOURCE=RangeOfDimensioned01.fs SCFLAGS="--test:ErrorRanges" # RangeOfDimensioned01.fs - SOURCE=RangeOfDimensioned02.fs SCFLAGS="--test:ErrorRanges" # RangeOfDimensioned02.fs - - SOURCE=E_ExpectedTypeNotUnitOfMeasure01.fs SCFLAGS="--test:ErrorRanges --flaterrors" # E_ExpectedTypeNotUnitOfMeasure01.fs - SOURCE=E_UnsupportedType01.fs SCFLAGS="--test:ErrorRanges" # E_UnsupportedType01.fs - SOURCE=E_RangeOfDecimals01.fs SCFLAGS="--test:ErrorRanges" # E_RangeOfDecimals01.fs - - SOURCE=IntTypes01.fs SCFLAGS="--test:ErrorRanges -a" # IntTypes01.fs diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/env.lst deleted file mode 100644 index 30b2960759c..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Operators/env.lst +++ /dev/null @@ -1,7 +0,0 @@ - SOURCE=Operators_decimal_01.fs SCFLAGS=-a # Operators_decimal_01.fs - SOURCE=Operators_float32_01.fs SCFLAGS=-a # Operators_float32_01.fs - SOURCE=Operators_float_01.fs SCFLAGS=-a # Operators_float_01.fs - - - - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst deleted file mode 100644 index 07058de7ec7..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parenthesis/env.lst +++ /dev/null @@ -1,13 +0,0 @@ -SOURCE=Positive01.fs SCFLAGS="--test:ErrorRanges -a" # Positive01.fs - -SOURCE=W_ImplicitProduct01.fs SCFLAGS="--test:ErrorRanges" # W_ImplicitProduct01.fs - -SOURCE=E_Error02.fs SCFLAGS="--test:ErrorRanges" # E_Error02.fs -SOURCE=E_Error03.fs SCFLAGS="--test:ErrorRanges" # E_Error03.fs -SOURCE=E_Error04.fs SCFLAGS="--test:ErrorRanges" # E_Error04.fs -SOURCE=E_Error05.fs SCFLAGS="--test:ErrorRanges" # E_Error05.fs -SOURCE=E_Error06.fs SCFLAGS="--test:ErrorRanges" # E_Error06.fs - -SOURCE=E_IncompleteParens01.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens01.fs -SOURCE=E_IncompleteParens02.fs SCFLAGS="--test:ErrorRanges" # E_IncompleteParens02.fs - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs deleted file mode 100644 index dced37284cd..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/GreaterBarRBrack01.fs +++ /dev/null @@ -1,18 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:2791 -// Make sure we can parse arrays of dimensioned numbers without needing a space between > and |] -// -#light - -[] -type m - -let l1 = [|10.0|] // ok -let l2 = [|10.0 |] // ok - -// This was not really specific to Units of Measure, we while we are here -// we check that care too. -let p1 = [|Array.empty|] // ok -let p2 = [|Array.empty |] // ok - -exit 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01.fs deleted file mode 100644 index 57dee6b46b4..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01.fs +++ /dev/null @@ -1,25 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:2708 -// ICE when using a known type (int, decimal, etc...) as a unit of measure -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -[] type Kg - -module M1 = - 1.0 // error - -module M2 = - let x = 1.0 // error - -module M3 = - let f2 ( x : float) = x // error - -module M4 = - let f4 (x : 'a when 'a :> float) = x // error - -module M5 = - type T<[] 'a>(x : float, y : float<_>) = class end // error - diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Quotient.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Quotient.fs deleted file mode 100644 index 4c8458ed935..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Quotient.fs +++ /dev/null @@ -1,19 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:6157 - Units of measure containing "/" get rejected in arguments to method invocation - -[] type m -[] type s - -let sqr<[] 'u>(x:float<'u>) = x*x - -type T() = - member this.sqr<[] 'u>(x:float<'u>) = x*x - - -let t = new T() -let a = sqr(5.0) -let b = sqr(2.0) -let c = sqr(3.0) -let d = t.sqr(5.0) -let e = t.sqr(2.0) -let f = t.sqr(3.0) diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs deleted file mode 100644 index fe3aecf7e94..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/QuotientAssoc.fs +++ /dev/null @@ -1,24 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:4124 - Units of measure: division should be left-associative in both types and constants -// Regression test for FSHARP1.0:4188 - Type parameters for units of measure parsed inconsistently. - -#light - -[] type s -[] type m -[] type A = m / s / s -[] type AA = m / s^2 -[] type B = m^2 / m s / s^2 / s^-1 -[] type B' = m / s / s / s / s / s / s / s / s^-5 -[] type C = m / s * s / s * s / s / s - -let (x : float) = 1.0 -let y = 2.0 -let z = x+y -let a = 1.0 -let aa = 2.0 -let (b : float) = 3.0 -let b' = 4.0 -let (c : float) = 5.0 - -let res = a + aa + b + b' + c diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs deleted file mode 100644 index dcac1cb1c50..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/Reciprocal01.fs +++ /dev/null @@ -1,17 +0,0 @@ -// #Regression #Conformance #UnitsOfMeasure -// Regression test for FSHARP1.0:2748 -// Units or measures: we should not require a space between < and \ when using a reciprocal of a unit - -// Regression test for FSHARP1.0:4195 -// Reciprocals parsed incorrectly for Measure definitions. - -#light - -[] type s // [] type s -[] type s' = / s / s // [] type s' = /s ^ 2 -let oneHertz = 1.0 // OK -let twoHertz = 2.0f< /s> // OK - -if (1.0 + 2.0 <> 3.0) then exit 1 - -exit 0 diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/env.lst deleted file mode 100644 index fcc63fee947..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/env.lst +++ /dev/null @@ -1,4 +0,0 @@ - SOURCE=KnownTypeAsUnit01.fs SCFLAGS="--test:ErrorRanges" # KnownTypeAsUnit01.fs - SOURCE=KnownTypeAsUnit01b.fs SCFLAGS="--test:ErrorRanges" # KnownTypeAsUnit01b.fs - SOURCE=E_Nesting01.fs SCFLAGS="--test:ErrorRanges" # E_Nesting01.fs.fs -NoMT SOURCE=find_gtdef.fsx FSIMODE=EXEC COMPILE_ONLY=1 # find_gtdef.fsx diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/env.lst deleted file mode 100644 index caf239bf3f8..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/env.lst +++ /dev/null @@ -1,19 +0,0 @@ - - SOURCE=Slash_InFunction01.fs SCFLAGS=--warnaserror+ # Slash_InFunction01.fs - SOURCE=Slash_InMethod01.fs SCFLAGS=--warnaserror+ # Slash_InMethod01.fs - - SOURCE=Generalization01.fs SCFLAGS=--warnaserror # Generalization01.fs - - SOURCE=E_GenInterfaceWithDifferentGenInstantiations.fs SCFLAGS="--test:ErrorRanges --langversion:5.0" # E_GenInterfaceWithDifferentGenInstantiations.fs - - SOURCE=TypeAbbreviation_decimal_01.fs # TypeAbbreviation_decimal_01.fs - SOURCE=TypeAbbreviation_float32_01.fs # TypeAbbreviation_float32_01.fs - SOURCE=TypeAbbreviation_float_01.fs # TypeAbbreviation_float_01.fs - - SOURCE=typechecker01.fs SCFLAGS="--test:ErrorRanges" # typechecker01.fs - SOURCE=W_TypeConstraint01.fs SCFLAGS="--test:ErrorRanges" # W_TypeConstraint01.fs - SOURCE=TypeConstraint02.fs # TypeConstraint02.fs - SOURCE=TypeConstraint03.fs # TypeConstraint03.fs -NoMT SOURCE=W_LessGeneric01.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=PIPE # W_LessGeneric01.fsx - SOURCE=LessGeneric02.fs # LessGeneric02.fs - SOURCE=ValueRestriction01.fs # ValueRestriction01.fs diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/env.lst b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/env.lst deleted file mode 100644 index d30059c87fe..00000000000 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/env.lst +++ /dev/null @@ -1,10 +0,0 @@ - SOURCE=InInterface01.fs # InInterface01.fs - SOURCE=E_NoInstanceOnMeasure01.fs SCFFLAGS="--test:ErrorRanges" # E_NoInstanceOnMeasure01.fs - SOURCE=StaticsOnMeasure01.fs # StaticsOnMeasure01.fs - SOURCE=E_OverloadsDifferByUOMAttr.fs SCFFLAGS="--test:ErrorRanges" # E_OverloadsDifferByUOMAttr.fs - SOURCE=GenericUOM01.fs # GenericUOM01.fs -NoMT SOURCE=E_Polymorphism01.fsx FSIMODE=PIPE SCFLAGS="--test:ErrorRanges" COMPILE_ONLY=1 # E_Polymorphism01.fsx - SOURCE=Polymorphism02.fs # Polymorphism02.fs - SOURCE=E_NoConstructorOnMeasure01.fs SCFLAGS="--test:ErrorRanges" # E_NoConstructorOnMeasure01.fs - SOURCE=E_GenericUOM01.fs # E_GenericUOM01.fs - diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index 31b787ef41e..f0ae0203c87 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -140,16 +140,6 @@ Conformance08 Conformance\TypesAndTypeConstraints\LogicalPropertiesOfTypes Conformance08 Conformance\TypesAndTypeConstraints\TypeConstraints Conformance08 Conformance\TypesAndTypeConstraints\TypeParameterDefinitions -Conformance08 Conformance\UnitsOfMeasure\Basic -Conformance08 Conformance\UnitsOfMeasure\Bounds -Conformance08 Conformance\UnitsOfMeasure\Constants -Conformance08 Conformance\UnitsOfMeasure\Diagnostics -Conformance08 Conformance\UnitsOfMeasure\Operators -Conformance08 Conformance\UnitsOfMeasure\Parenthesis -Conformance08 Conformance\UnitsOfMeasure\Parsing -Conformance08 Conformance\UnitsOfMeasure\TypeChecker -Conformance08 Conformance\UnitsOfMeasure\WithOOP - Misc01 Diagnostics\async Misc01,Diagnostics Diagnostics\General Misc01 Diagnostics\NONTERM From 66e16371e6a592293597e5a3a97a53189de55a81 Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Wed, 14 May 2025 09:51:36 +0200 Subject: [PATCH 087/134] Scoped nowarn (#18049) --- .../.FSharp.Compiler.Service/9.0.300.md | 2 +- docs/release-notes/.Language/preview.md | 1 + src/Compiler/Checking/CheckDeclarations.fs | 4 +- src/Compiler/CodeGen/IlxGen.fs | 2 +- src/Compiler/Driver/CompilerDiagnostics.fs | 58 +-- src/Compiler/Driver/CompilerDiagnostics.fsi | 8 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 288 +++++------- src/Compiler/Driver/ParseAndCheckInputs.fsi | 9 +- src/Compiler/Driver/ScriptClosure.fs | 64 +-- src/Compiler/Driver/ScriptClosure.fsi | 3 - src/Compiler/Driver/fsc.fs | 16 +- src/Compiler/FSComp.txt | 5 + src/Compiler/FSharp.Compiler.Service.fsproj | 2 + src/Compiler/Facilities/DiagnosticOptions.fs | 2 + src/Compiler/Facilities/DiagnosticOptions.fsi | 3 +- src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/Interactive/fsi.fs | 57 +-- .../Optimize/InnerLambdasToTopLevelFuncs.fs | 4 +- src/Compiler/Optimize/Optimizer.fs | 4 +- src/Compiler/Service/BackgroundCompiler.fs | 12 +- src/Compiler/Service/FSharpCheckerResults.fs | 21 +- src/Compiler/Service/IncrementalBuild.fs | 6 +- src/Compiler/Service/ServiceLexing.fs | 25 +- src/Compiler/Service/ServiceLexing.fsi | 1 + src/Compiler/Service/TransparentCompiler.fs | 52 +-- src/Compiler/Symbols/Exprs.fs | 2 +- src/Compiler/SyntaxTree/LexHelpers.fs | 5 +- src/Compiler/SyntaxTree/LexerStore.fs | 38 +- src/Compiler/SyntaxTree/LexerStore.fsi | 2 +- src/Compiler/SyntaxTree/ParseHelpers.fs | 2 +- src/Compiler/SyntaxTree/SyntaxTree.fs | 20 +- src/Compiler/SyntaxTree/SyntaxTree.fsi | 23 +- src/Compiler/SyntaxTree/SyntaxTrivia.fs | 20 +- src/Compiler/SyntaxTree/SyntaxTrivia.fsi | 23 +- src/Compiler/SyntaxTree/UnicodeLexing.fs | 15 + src/Compiler/SyntaxTree/UnicodeLexing.fsi | 4 + src/Compiler/SyntaxTree/WarnScopes.fs | 441 ++++++++++++++++++ src/Compiler/SyntaxTree/WarnScopes.fsi | 33 ++ src/Compiler/TypedTree/TypedTree.fs | 3 - src/Compiler/TypedTree/TypedTree.fsi | 3 - src/Compiler/TypedTree/TypedTreeOps.fs | 8 +- src/Compiler/lex.fsl | 11 +- src/Compiler/pars.fsy | 4 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 25 + src/Compiler/xlf/FSComp.txt.de.xlf | 25 + src/Compiler/xlf/FSComp.txt.es.xlf | 25 + src/Compiler/xlf/FSComp.txt.fr.xlf | 25 + src/Compiler/xlf/FSComp.txt.it.xlf | 25 + src/Compiler/xlf/FSComp.txt.ja.xlf | 25 + src/Compiler/xlf/FSComp.txt.ko.xlf | 25 + src/Compiler/xlf/FSComp.txt.pl.xlf | 25 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 25 + src/Compiler/xlf/FSComp.txt.ru.xlf | 25 + src/Compiler/xlf/FSComp.txt.tr.xlf | 25 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 25 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 25 + .../CompilerDirectives/NonStringArgs.fs | 51 +- .../CompilerDirectives/Nowarn.fs | 184 ++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../ExprTests.fs | 48 -- ...ervice.SurfaceArea.netstandard20.debug.bsl | 103 ++-- ...vice.SurfaceArea.netstandard20.release.bsl | 103 ++-- .../FSharp.Compiler.Service.Tests.fsproj | 1 + .../SyntaxTreeTests.fs | 5 +- .../WarnScopeTests.fs | 210 +++++++++ tests/FSharp.Test.Utilities/CompilerAssert.fs | 6 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 18 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 18 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 20 +- ...ompiler.Service_Release_netstandard2.0.bsl | 20 +- .../fsharp/core/load-script/ProjectDriver.fsx | 3 +- .../Attribute/RangeOfAttribute.fs.bsl | 3 +- .../Attribute/RangeOfAttributeWithPath.fs.bsl | 3 +- .../RangeOfAttributeWithTarget.fs.bsl | 3 +- ...ColonBeforeReturnTypeIsPartOfTrivia.fs.bsl | 3 +- ...eturnTypeIsPartOfTriviaInProperties.fs.bsl | 2 +- ...itionalDirectiveAroundInlineKeyword.fs.bsl | 3 +- .../Binding/InlineKeywordInBinding.fs.bsl | 3 +- ...nShouldBeIncludedInSynModuleDeclLet.fs.bsl | 3 +- ...BeIncludedInBindingOfSynExprObjExpr.fs.bsl | 3 +- ...dedInConstructorSynMemberDefnMember.fs.bsl | 3 +- ...tructorSynMemberDefnMemberOptAsSpec.fs.bsl | 3 +- ...edInFullSynMemberDefnMemberProperty.fs.bsl | 2 +- ...uldBeIncludedInSecondaryConstructor.fs.bsl | 3 +- ...eIncludedInSynMemberDefnLetBindings.fs.bsl | 3 +- ...ouldBeIncludedInSynMemberDefnMember.fs.bsl | 3 +- ...eShouldBeIncludedInSynModuleDeclLet.fs.bsl | 2 +- ...riteOnlySynMemberDefnMemberProperty.fs.bsl | 3 +- ...ignShouldBePresentInLocalLetBinding.fs.bsl | 2 +- ...ouldBePresentInLocalLetBindingTyped.fs.bsl | 3 +- ...lSignShouldBePresentInMemberBinding.fs.bsl | 3 +- ...resentInMemberBindingWithParameters.fs.bsl | 3 +- ...resentInMemberBindingWithReturnType.fs.bsl | 3 +- ...fEqualSignShouldBePresentInProperty.fs.bsl | 3 +- ...dBePresentInSynModuleDeclLetBinding.fs.bsl | 3 +- ...esentInSynModuleDeclLetBindingTyped.fs.bsl | 3 +- ...ldBePresentInSynExprLetOrUseBinding.fs.bsl | 3 +- ...dBePresentInSynModuleDeclLetBinding.fs.bsl | 3 +- ...nModuleDeclLetBindingWithAttributes.fs.bsl | 3 +- ...turnTypeOfBindingShouldContainStars.fs.bsl | 3 +- .../BlockCommentInSourceCode.fs.bsl | 3 +- ...ckCommentInSourceCodeSignatureFile.fsi.bsl | 3 +- .../CodeComment/CommentAfterSourceCode.fs.bsl | 3 +- ...ommentAfterSourceCodeSignatureFile.fsi.bsl | 3 +- .../CodeComment/CommentAtEndOfFile.fs.bsl | 3 +- .../CodeComment/CommentOnSingleLine.fs.bsl | 3 +- .../CommentOnSingleLineSignatureFile.fsi.bsl | 3 +- ...BeCapturedIfUsedInAnInvalidLocation.fs.bsl | 3 +- ...ipleSlashCommentShouldNotBeCaptured.fs.bsl | 3 +- ...atStartsAtAndAndEndsAfterExpression.fs.bsl | 2 +- ...geStartsAtAndAndEndsAfterExpression.fs.bsl | 3 +- ...tilineCommentAreNotReportedAsTrivia.fs.bsl | 2 +- ...reNotReportedAsTriviaSignatureFile.fsi.bsl | 3 +- ...ltilineStringAreNotReportedAsTrivia.fs.bsl | 2 +- ...reNotReportedAsTriviaSignatureFile.fsi.bsl | 3 +- .../NestedIfElseEndif.fs.bsl | 3 +- .../NestedIfElseEndifSignatureFile.fsi.bsl | 3 +- ...NestedIfEndifWithComplexExpressions.fs.bsl | 3 +- ...ithComplexExpressionsSignatureFile.fsi.bsl | 2 +- .../SingleIfElseEndif.fs.bsl | 3 +- .../SingleIfElseEndifSignatureFile.fsi.bsl | 3 +- .../ConditionalDirective/SingleIfEndif.fs.bsl | 3 +- .../SingleIfEndifSignatureFile.fsi.bsl | 3 +- .../MultipleSynEnumCasesHaveBarRange.fs.bsl | 3 +- .../SingleSynEnumCaseHasBarRange.fs.bsl | 3 +- .../SingleSynEnumCaseWithoutBar.fs.bsl | 3 +- .../Exception/Missing name 01.fs.bsl | 3 +- .../Exception/Missing name 02.fs.bsl | 3 +- .../Exception/Missing name 03.fs.bsl | 3 +- .../Exception/Recover Function Type 01.fs.bsl | 3 +- ...uldContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- .../Expression/AnonymousRecords-01.fs.bsl | 3 +- .../Expression/AnonymousRecords-02.fs.bsl | 3 +- .../Expression/AnonymousRecords-03.fs.bsl | 3 +- .../Expression/AnonymousRecords-04.fs.bsl | 3 +- .../Expression/AnonymousRecords-05.fs.bsl | 3 +- .../Expression/AnonymousRecords-06.fs.bsl | 3 +- .../Expression/Binary - Eq 01.fs.bsl | 3 +- .../Expression/Binary - Eq 02.fs.bsl | 3 +- .../Expression/Binary - Eq 03.fs.bsl | 3 +- .../Expression/Binary - Eq 04.fs.bsl | 3 +- .../Expression/Binary - Eq 05.fs.bsl | 3 +- .../Expression/Binary - Eq 06.fs.bsl | 3 +- .../Expression/Binary - Eq 07.fs.bsl | 3 +- .../Expression/Binary - Plus 01.fs.bsl | 3 +- .../Expression/Binary - Plus 02.fs.bsl | 3 +- .../Expression/Binary - Plus 03.fs.bsl | 3 +- .../Expression/Binary - Plus 04.fs.bsl | 3 +- .../Expression/Binary - Plus 05.fs.bsl | 3 +- .../SyntaxTree/Expression/Binary 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Binary 02.fs.bsl | 3 +- ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 2 +- .../data/SyntaxTree/Expression/Do 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Do 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Do 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Do 04.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Do 05.fs.bsl | 3 +- .../DotLambda - _ Recovery - Casts.fsx.bsl | 3 +- .../DotLambda - _ Recovery - Eof.fsx.bsl | 3 +- .../Expression/DotLambda - _ Recovery.fsx.bsl | 3 +- .../DotLambda - _. Recovery - Eof.fsx.bsl | 3 +- .../DotLambda - _. Recovery.fsx.bsl | 3 +- ...umentExpressionInInnerAppExpression.fs.bsl | 2 +- ...bda_FunctionWithUnderscoreDotLambda.fs.bsl | 3 +- ...bda_NestedPropertiesAfterUnderscore.fs.bsl | 3 +- ...NotAllowedFunctionExpressionWithArg.fs.bsl | 3 +- .../Expression/DotLambda_TopLevelLet.fs.bsl | 3 +- ...tLambda_TopLevelStandaloneDotLambda.fs.bsl | 3 +- ...tionCallWithSpaceAndUnitApplication.fs.bsl | 3 +- .../DotLambda_UnderscoreToString.fs.bsl | 3 +- ...DotLambda_WithNonTupledFunctionCall.fs.bsl | 3 +- .../Expression/DotLambda_WithoutDot.fs.bsl | 3 +- .../DotLambda_WithoutUnderscore.fs.bsl | 3 +- .../SyntaxTree/Expression/Downcast 01.fs.bsl | 2 +- .../SyntaxTree/Expression/Downcast 02.fs.bsl | 2 +- .../SyntaxTree/Expression/Downcast 03.fs.bsl | 2 +- .../data/SyntaxTree/Expression/For 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/For 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/For 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/For 04.fs.bsl | 3 +- .../data/SyntaxTree/Expression/For 05.fs.bsl | 3 +- .../Expression/GlobalKeywordAsSynExpr.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 04.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 05.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 06.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Id 07.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 04.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 05.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 06.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 07.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 08.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 09.fs.bsl | 3 +- .../data/SyntaxTree/Expression/If 10.fs.bsl | 3 +- ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 3 +- .../Lambda - Missing expr 01.fs.bsl | 3 +- .../Lambda - Missing expr 02.fs.bsl | 3 +- .../SyntaxTree/Expression/Lambda 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Lambda 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Lazy 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Lazy 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Lazy 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Let 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Let 02.fs.bsl | 3 +- .../Expression/List - Comprehension 01.fs.bsl | 3 +- .../Expression/List - Comprehension 02.fs.bsl | 3 +- ...LetOrUseContainsTheRangeOfInKeyword.fs.bsl | 2 +- .../Expression/Object - Class 01.fs.bsl | 3 +- .../Expression/Object - Class 02.fs.bsl | 3 +- .../Expression/Object - Class 03.fs.bsl | 3 +- .../Expression/Object - Class 04.fs.bsl | 3 +- .../Expression/Object - Class 05.fs.bsl | 3 +- .../Expression/Object - Class 06.fs.bsl | 3 +- .../Expression/Object - Class 07.fs.bsl | 3 +- .../Expression/Object - Class 08.fs.bsl | 3 +- .../Expression/Object - Class 09.fs.bsl | 3 +- .../Expression/Object - Class 10.fs.bsl | 3 +- .../Expression/Object - Class 11.fs.bsl | 3 +- .../Expression/Object - Class 12.fs.bsl | 3 +- .../Expression/Object - Class 13.fs.bsl | 3 +- .../Expression/Object - Class 14.fs.bsl | 3 +- .../Expression/Object - Class 15.fs.bsl | 3 +- .../SyntaxTree/Expression/Rarrow 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Rarrow 02.fs.bsl | 3 +- .../SyntaxTree/Expression/Rarrow 03.fs.bsl | 3 +- .../Expression/Record - Anon 01.fs.bsl | 3 +- .../Expression/Record - Anon 02.fs.bsl | 3 +- .../Expression/Record - Anon 03.fs.bsl | 3 +- .../Expression/Record - Anon 04.fs.bsl | 3 +- .../Expression/Record - Anon 05.fs.bsl | 3 +- .../Expression/Record - Anon 06.fs.bsl | 3 +- .../Expression/Record - Anon 07.fs.bsl | 3 +- .../Expression/Record - Anon 08.fs.bsl | 3 +- .../Expression/Record - Anon 09.fs.bsl | 3 +- .../Expression/Record - Anon 10.fs.bsl | 3 +- .../Expression/Record - Anon 11.fs.bsl | 3 +- .../Expression/Record - Anon 12.fs.bsl | 3 +- .../Expression/Record - Field 01.fs.bsl | 3 +- .../Expression/Record - Field 02.fs.bsl | 3 +- .../Expression/Record - Field 03.fs.bsl | 3 +- .../Expression/Record - Field 04.fs.bsl | 3 +- .../Expression/Record - Field 05.fs.bsl | 3 +- .../Expression/Record - Field 06.fs.bsl | 3 +- .../Expression/Record - Field 07.fs.bsl | 3 +- .../Expression/Record - Field 08.fs.bsl | 3 +- .../Expression/Record - Field 09.fs.bsl | 3 +- .../Expression/Record - Field 10.fs.bsl | 3 +- .../Expression/Record - Field 11.fs.bsl | 3 +- .../Expression/Record - Field 12.fs.bsl | 3 +- .../Expression/Record - Field 13.fs.bsl | 3 +- .../Expression/Record - Field 14.fs.bsl | 3 +- .../Expression/Sequential 01.fs.bsl | 3 +- .../Expression/Sequential 02.fs.bsl | 3 +- .../Expression/Sequential 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Set 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Set 02.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Set 03.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Set 04.fs.bsl | 3 +- .../SynExprAnonRecdWithStructKeyword.fs.bsl | 3 +- ...sTheRangeOfTheEqualsSignInTheFields.fs.bsl | 3 +- ...xprDoContainsTheRangeOfTheDoKeyword.fs.bsl | 3 +- .../SynExprDynamicDoesContainIdent.fs.bsl | 3 +- ...ynExprDynamicDoesContainParentheses.fs.bsl | 3 +- ...rForContainsTheRangeOfTheEqualsSign.fs.bsl | 3 +- ...BangContainsTheRangeOfTheEqualsSign.fs.bsl | 2 +- ...LetOrUseContainsTheRangeOfInKeyword.fs.bsl | 3 +- ...seDoesNotContainTheRangeOfInKeyword.fs.bsl | 2 +- ...rsDoesNotContainTheRangeOfInKeyword.fs.bsl | 3 +- ...eBindingContainsTheRangeOfInKeyword.fs.bsl | 3 +- ...insTheRangeOfTheMatchAndWithKeyword.fs.bsl | 3 +- ...insTheRangeOfTheMatchAndWithKeyword.fs.bsl | 3 +- ...bjExprContainsTheRangeOfWithKeyword.fs.bsl | 3 +- .../Expression/SynExprObjWithSetter.fs.bsl | 3 +- ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 3 +- ...dFieldsContainCorrectAmountOfTrivia.fs.bsl | 3 +- .../SynExprSetWithSynExprDynamic.fs.bsl | 3 +- ...tainsTheRangeOfTheTryAndWithKeyword.fs.bsl | 3 +- ...tainsTheRangeOfTheTryAndWithKeyword.fs.bsl | 3 +- .../Expression/Try - Finally 01.fs.bsl | 3 +- .../Expression/Try - Finally 02.fs.bsl | 3 +- .../Expression/Try - Finally 03.fs.bsl | 3 +- .../Expression/Try - Finally 04.fs.bsl | 3 +- .../Expression/Try - With 01.fs.bsl | 2 +- .../Expression/Try - With 02.fs.bsl | 2 +- .../Expression/Try - With 03.fs.bsl | 2 +- .../Expression/Try - With 04.fs.bsl | 2 +- .../Expression/Try - With 05.fs.bsl | 2 +- .../Expression/Try - With 06.fs.bsl | 2 +- .../Expression/Try - With 07.fs.bsl | 2 +- .../Expression/Try - With 08.fs.bsl | 2 +- .../Expression/Try - With 09.fs.bsl | 2 +- .../data/SyntaxTree/Expression/Try 01.fs.bsl | 3 +- .../data/SyntaxTree/Expression/Try 02.fs.bsl | 3 +- .../Try with - Missing expr 01.fs.bsl | 3 +- .../Try with - Missing expr 02.fs.bsl | 3 +- .../Try with - Missing expr 03.fs.bsl | 3 +- .../Try with - Missing expr 04.fs.bsl | 3 +- .../Try with - Missing expr 05.fs.bsl | 3 +- .../SyntaxTree/Expression/Try with 01.fs.bsl | 2 +- .../Expression/Tuple - Missing item 01.fs.bsl | 3 +- .../Expression/Tuple - Missing item 02.fs.bsl | 3 +- .../Expression/Tuple - Missing item 03.fs.bsl | 3 +- .../Expression/Tuple - Missing item 04.fs.bsl | 3 +- .../Expression/Tuple - Missing item 05.fs.bsl | 3 +- .../Expression/Tuple - Missing item 06.fs.bsl | 3 +- .../Expression/Tuple - Missing item 07.fs.bsl | 3 +- .../Expression/Tuple - Missing item 08.fs.bsl | 3 +- .../Expression/Tuple - Missing item 09.fs.bsl | 3 +- .../Expression/Tuple - Missing item 10.fs.bsl | 3 +- .../Expression/Tuple - Missing item 11.fs.bsl | 3 +- .../SyntaxTree/Expression/Tuple 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Tuple 02.fs.bsl | 3 +- .../SyntaxTree/Expression/Type test 01.fs.bsl | 2 +- .../SyntaxTree/Expression/Type test 02.fs.bsl | 2 +- .../SyntaxTree/Expression/Type test 03.fs.bsl | 2 +- .../SyntaxTree/Expression/Type test 04.fs.bsl | 2 +- .../SyntaxTree/Expression/Typed 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Typed 02.fs.bsl | 3 +- .../SyntaxTree/Expression/Typed 03.fs.bsl | 3 +- .../SyntaxTree/Expression/Typed 04.fs.bsl | 3 +- .../Expression/Unary - Reserved 01.fs.bsl | 3 +- .../Expression/Unary - Reserved 02.fs.bsl | 3 +- .../Unfinished escaped ident 01.fs.bsl | 3 +- .../Unfinished escaped ident 02.fs.bsl | 3 +- .../Unfinished escaped ident 03.fs.bsl | 3 +- .../SyntaxTree/Expression/Upcast 01.fs.bsl | 3 +- .../SyntaxTree/Expression/Upcast 02.fs.bsl | 3 +- .../SyntaxTree/Expression/Upcast 03.fs.bsl | 3 +- .../SyntaxTree/Expression/Upcast 04.fs.bsl | 3 +- .../SyntaxTree/Expression/Upcast 05.fs.bsl | 3 +- .../SyntaxTree/Expression/While 01.fs.bsl | 3 +- .../SyntaxTree/Expression/While 02.fs.bsl | 3 +- .../SyntaxTree/Expression/While 03.fs.bsl | 3 +- .../SyntaxTree/Expression/While 04.fs.bsl | 3 +- .../SyntaxTree/Expression/While 05.fs.bsl | 3 +- .../SyntaxTree/Expression/While 06.fs.bsl | 3 +- .../SyntaxTree/Expression/WhileBang 01.fs.bsl | 2 +- .../SyntaxTree/Expression/WhileBang 02.fs.bsl | 2 +- .../SyntaxTree/Expression/WhileBang 03.fs.bsl | 2 +- .../SyntaxTree/Expression/WhileBang 04.fs.bsl | 2 +- .../SyntaxTree/Expression/WhileBang 05.fs.bsl | 2 +- .../SyntaxTree/Expression/WhileBang 06.fs.bsl | 2 +- .../data/SyntaxTree/Extern/Extern 01.fs.bsl | 3 +- .../ExternKeywordIsPresentInTrivia.fs.bsl | 3 +- .../IfThenElse/Comment after else 01.fs.bsl | 3 +- .../IfThenElse/Comment after else 02.fs.bsl | 3 +- .../IfThenElse/DeeplyNestedIfThenElse.fs.bsl | 3 +- .../ElseKeywordInSimpleIfThenElse.fs.bsl | 3 +- .../IfThenElse/IfKeywordInIfThenElse.fs.bsl | 3 +- ...IfThenAndElseKeywordOnSeparateLines.fs.bsl | 3 +- .../IfThenElse/NestedElifInIfThenElse.fs.bsl | 3 +- .../NestedElseIfInIfThenElse.fs.bsl | 3 +- ...stedElseIfOnTheSameLineInIfThenElse.fs.bsl | 3 +- ...ComplexArgumentsLambdaHasArrowRange.fs.bsl | 3 +- .../DestructedLambdaHasArrowRange.fs.bsl | 3 +- ...rameterWithWildCardGivesCorrectBody.fs.bsl | 3 +- ...daWithTwoParametersGivesCorrectBody.fs.bsl | 3 +- ...thWildCardParameterGivesCorrectBody.fs.bsl | 3 +- ...dThatReturnsALambdaGivesCorrectBody.fs.bsl | 3 +- .../MultilineLambdaHasArrowRange.fs.bsl | 3 +- .../Lambda/Param - Missing type 01.fs.bsl | 3 +- .../Lambda/Param - Missing type 02.fs.bsl | 3 +- .../Lambda/Param - Missing type 03.fs.bsl | 3 +- .../Lambda/Param - Missing type 04.fs.bsl | 3 +- .../Lambda/SimpleLambdaHasArrowRange.fs.bsl | 3 +- .../Lambda/TupleInLambdaHasArrowRange.fs.bsl | 3 +- .../LeadingKeyword/AbstractKeyword.fs.bsl | 3 +- .../AbstractMemberKeyword.fs.bsl | 3 +- .../LeadingKeyword/AndKeyword.fs.bsl | 3 +- .../LeadingKeyword/DefaultKeyword.fsi.bsl | 3 +- .../LeadingKeyword/DefaultValKeyword.fs.bsl | 3 +- .../LeadingKeyword/DoKeyword.fs.bsl | 3 +- .../LeadingKeyword/DoStaticKeyword.fs.bsl | 3 +- .../LeadingKeyword/ExternKeyword.fs.bsl | 3 +- .../LeadingKeyword/LetKeyword.fs.bsl | 3 +- .../LeadingKeyword/LetRecKeyword.fs.bsl | 3 +- .../LeadingKeyword/MemberKeyword.fs.bsl | 3 +- .../LeadingKeyword/MemberValKeyword.fs.bsl | 3 +- .../LeadingKeyword/NewKeyword.fs.bsl | 3 +- .../LeadingKeyword/OverrideKeyword.fs.bsl | 3 +- .../LeadingKeyword/OverrideValKeyword.fs.bsl | 3 +- .../StaticAbstractKeyword.fs.bsl | 3 +- .../StaticAbstractMemberKeyword.fs.bsl | 3 +- .../LeadingKeyword/StaticLetKeyword.fs.bsl | 3 +- .../LeadingKeyword/StaticLetRecKeyword.fs.bsl | 3 +- .../LeadingKeyword/StaticMemberKeyword.fs.bsl | 3 +- .../StaticMemberValKeyword.fs.bsl | 3 +- .../LeadingKeyword/StaticValKeyword.fsi.bsl | 3 +- .../LeadingKeyword/SyntheticKeyword.fs.bsl | 3 +- .../LeadingKeyword/UseKeyword.fs.bsl | 3 +- .../LeadingKeyword/UseRecKeyword.fs.bsl | 3 +- .../LeadingKeyword/ValKeyword.fsi.bsl | 2 +- .../MatchClause/Missing expr 01.fs.bsl | 3 +- .../MatchClause/Missing expr 02.fs.bsl | 3 +- .../MatchClause/Missing expr 03.fs.bsl | 3 +- .../MatchClause/Missing expr 04.fs.bsl | 3 +- .../MatchClause/Missing expr 05.fs.bsl | 3 +- .../MatchClause/Missing pat 01.fs.bsl | 3 +- .../MatchClause/Missing pat 02.fs.bsl | 3 +- .../MatchClause/Missing pat 03.fs.bsl | 3 +- .../MatchClause/Missing pat 04.fs.bsl | 3 +- .../MatchClause/Missing pat 05.fs.bsl | 3 +- ...ingleSynMatchClauseInSynExprTryWith.fs.bsl | 3 +- .../RangeOfArrowInSynMatchClause.fs.bsl | 3 +- ...ArrowInSynMatchClauseWithWhenClause.fs.bsl | 3 +- ...ipleSynMatchClausesInSynExprTryWith.fs.bsl | 3 +- ...ASingleSynMatchClauseInSynExprMatch.fs.bsl | 3 +- ...ingleSynMatchClauseInSynExprTryWith.fs.bsl | 2 +- ...ltipleSynMatchClausesInSynExprMatch.fs.bsl | 2 +- .../RangeOfMultipleSynMatchClause.fs.bsl | 3 +- .../RangeOfSingleSynMatchClause.fs.bsl | 3 +- ...OfSingleSynMatchClauseFollowedByBar.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 01.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 02.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 03.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 04.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 05.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 06.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 07.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 08.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 09.fs.bsl | 3 +- .../SyntaxTree/Measure/Constant - 10.fs.bsl | 3 +- ...easureContainsTheRangeOfTheConstant.fs.bsl | 3 +- .../SynMeasureParenHasCorrectRange.fs.bsl | 3 +- ...eTupleInMeasureTypeWithLeadingSlash.fs.bsl | 3 +- ...TypeTupleInMeasureTypeWithNoSlashes.fs.bsl | 3 +- ...TupleInMeasureTypeWithStartAndSlash.fs.bsl | 3 +- .../Member/Abstract - Property 01.fs.bsl | 3 +- .../Member/Abstract - Property 02.fs.bsl | 3 +- .../Member/Abstract - Property 03.fs.bsl | 3 +- .../Member/Abstract - Property 04.fs.bsl | 3 +- .../Member/Abstract - Property 05.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 01.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 02.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 03.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 04.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 05.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 06.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 07.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 08.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 09.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 10.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 11.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 12.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 13.fs.bsl | 2 +- .../SyntaxTree/Member/Auto property 14.fs.bsl | 3 +- .../SyntaxTree/Member/Auto property 15.fs.bsl | 3 +- .../data/SyntaxTree/Member/Do 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Do 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Do 03.fs.bsl | 3 +- .../data/SyntaxTree/Member/Do 04.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 03.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 04.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 05.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 06.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 07.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 08.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 09.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 10.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 11.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 12.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 13.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 14.fs.bsl | 3 +- .../data/SyntaxTree/Member/Field 15.fs.bsl | 3 +- .../SyntaxTree/Member/GetSetMember 01.fs.bsl | 3 +- .../GetSetMemberWithInlineKeyword.fs.bsl | 3 +- .../Implicit ctor - Missing type 01.fs.bsl | 3 +- .../Implicit ctor - Missing type 02.fs.bsl | 3 +- .../Implicit ctor - Pat - Tuple 01.fs.bsl | 3 +- .../Implicit ctor - Pat - Tuple 02.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 01.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 02.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 03.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 04.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 05.fs.bsl | 3 +- .../Implicit ctor - Type - Fun 06.fs.bsl | 3 +- .../Implicit ctor - Type - Tuple 01.fs.bsl | 3 +- .../Implicit ctor - Type - Tuple 02.fs.bsl | 3 +- .../Implicit ctor - Type - Tuple 03.fs.bsl | 3 +- .../Implicit ctor - Type - Tuple 04.fs.bsl | 3 +- .../Implicit ctor - Type - Tuple 05.fs.bsl | 3 +- .../Member/ImplicitCtorWithAsKeyword.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 03.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 04.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 05.fs.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 06.fsi.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 07.fsi.bsl | 3 +- .../data/SyntaxTree/Member/Inherit 08.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 01.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 02.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 03.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 04.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 05.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 06.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 07.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 08.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 09.fs.bsl | 3 +- .../SyntaxTree/Member/Interface 10.fs.bsl | 3 +- .../data/SyntaxTree/Member/Let 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Let 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Let 03.fs.bsl | 3 +- .../data/SyntaxTree/Member/Let 04.fs.bsl | 3 +- .../Member/Member - Attributes 01.fs.bsl | 3 +- .../Member - Param - Missing type 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 03.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 04.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 05.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 06.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 07.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 08.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 09.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 10.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 11.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 12.fs.bsl | 3 +- .../data/SyntaxTree/Member/Member 13.fs.bsl | 3 +- .../Member/MemberMispelledToMeme.fs.bsl | 3 +- .../Member/MemberWithInlineKeyword.fs.bsl | 3 +- ...berContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...berContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- .../Member/SignatureMemberWithGet.fsi.bsl | 3 +- .../Member/SignatureMemberWithSet.fsi.bsl | 3 +- .../Member/SignatureMemberWithSetget.fsi.bsl | 2 +- .../data/SyntaxTree/Member/Static 01.fs.bsl | 3 +- .../data/SyntaxTree/Member/Static 02.fs.bsl | 3 +- .../data/SyntaxTree/Member/Static 03.fs.bsl | 3 +- ...lotContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...ertyContainsTheRangeOfTheEqualsSign.fs.bsl | 3 +- ...rtyContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...eDefnWithMemberWithGetHasXmlComment.fs.bsl | 3 +- .../SynTypeDefnWithMemberWithSetget.fs.bsl | 3 +- ...nTypeDefnWithStaticMemberWithGetset.fs.bsl | 3 +- ...berContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...ynExprObjMembersHaveCorrectKeywords.fs.bsl | 3 +- ...erDefnAbstractSlotHasCorrectKeyword.fs.bsl | 3 +- ...erDefnAutoPropertyHasCorrectKeyword.fs.bsl | 3 +- ...fnMemberSynValDataHasCorrectKeyword.fs.bsl | 3 +- ...nMemberSigMemberHasCorrectKeywords.fsi.bsl | 3 +- .../data/SyntaxTree/ModuleMember/Do 01.fs.bsl | 3 +- .../data/SyntaxTree/ModuleMember/Do 02.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Let 01.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Let 02.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Let 03.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Let 04.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Let 05.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 01.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 02.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 03.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 04.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 05.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 06.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 07.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Open 08.fs.bsl | 3 +- .../SyntaxTree/ModuleMember/Val 01.fsi.bsl | 3 +- .../ModuleOrNamespace/Anon module 01.fs.bsl | 3 +- .../ModuleOrNamespace/Anon module 02.fsx.bsl | 3 +- ...eRangeShouldStartAtNamespaceKeyword.fs.bsl | 3 +- ...GlobalInOpenPathShouldContainTrivia.fs.bsl | 3 +- ...espaceShouldStartAtNamespaceKeyword.fs.bsl | 3 +- .../Module - Attribute 01.fs.bsl | 3 +- .../ModuleOrNamespace/Module 01.fs.bsl | 3 +- .../ModuleOrNamespace/Module 02.fs.bsl | 3 +- .../ModuleOrNamespace/Module 03.fs.bsl | 3 +- .../ModuleOrNamespace/Module 04.fs.bsl | 3 +- .../ModuleOrNamespace/Module 05.fs.bsl | 2 +- .../ModuleOrNamespace/Module 06.fs.bsl | 2 +- .../ModuleOrNamespace/Module 07.fs.bsl | 2 +- .../ModuleShouldContainModuleKeyword.fs.bsl | 3 +- ...angeThatStartsAtTheNamespaceKeyword.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 01.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 02.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 03.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 04.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 05.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 06.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 07.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 08.fs.bsl | 3 +- .../ModuleOrNamespace/Namespace 09.fs.bsl | 3 +- ...espaceShouldContainNamespaceKeyword.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 01.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 02.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 03.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 04.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 05.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 06.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 07.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 08.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 09.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 10.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 11.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 12.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 13.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 14.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 15.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 16.fs.bsl | 3 +- .../ModuleOrNamespace/Nested module 17.fs.bsl | 3 +- ...spaceShouldStartAtNamespaceKeyword.fsi.bsl | 3 +- .../ModuleAbbreviation.fsi.bsl | 3 +- ...leRangeShouldStartAtFirstAttribute.fsi.bsl | 3 +- .../ModuleShouldContainModuleKeyword.fsi.bsl | 3 +- .../Namespace - Keyword 01.fsi.bsl | 3 +- .../Nested module 01.fsi.bsl | 3 +- ...urnsRangeOfSynModuleOrNamespaceSig.fsi.bsl | 2 +- ...leteNestedModuleSigShouldBePresent.fsi.bsl | 3 +- .../NestedModuleWithBeginEndAndDecls.fs.bsl | 3 +- .../NestedModuleWithBeginEndAndDecls.fsi.bsl | 3 +- ...IncludedInSynModuleDeclNestedModule.fs.bsl | 3 +- ...udedInSynModuleSigDeclNestedModule.fsi.bsl | 3 +- .../NestedModule/RangeOfBeginEnd.fs.bsl | 3 +- .../NestedModule/RangeOfBeginEnd.fsi.bsl | 3 +- .../RangeOfEqualSignShouldBePresent.fs.bsl | 3 +- ...alSignShouldBePresentSignatureFile.fsi.bsl | 3 +- ...ShouldEndAtTheLastSynModuleSigDecl.fsi.bsl | 2 +- .../Nullness/AbstractClassProperty.fs.bsl | 3 +- .../Nullness/DuCaseStringOrNull.fs.bsl | 3 +- .../Nullness/DuCaseTuplePrecedence.fs.bsl | 3 +- .../SyntaxTree/Nullness/ExplicitField.fs.bsl | 3 +- .../FunctionArgAsPatternWithNullCase.fs.bsl | 3 +- ...ericFunctionReturnTypeNotStructNull.fs.bsl | 3 +- .../GenericFunctionTyparNotNull.fs.bsl | 3 +- .../Nullness/GenericFunctionTyparNull.fs.bsl | 3 +- .../Nullness/GenericTypeNotNull.fs.bsl | 3 +- ...enericTypeNotNullAndOtherConstraint.fs.bsl | 3 +- ...tAndOtherConstraint-I_am_Still_Sane.fs.bsl | 3 +- .../Nullness/GenericTypeNull.fs.bsl | 3 +- ...icTypeOtherConstraintAndThenNotNull.fs.bsl | 3 +- .../SyntaxTree/Nullness/IntListOrNull.fs.bsl | 3 +- .../Nullness/IntListOrNullOrNullOrNull.fs.bsl | 3 +- .../Nullness/MatchWithTypeCast.fs.bsl | 3 +- .../Nullness/MatchWithTypeCastParens.fs.bsl | 3 +- ...thTypeCastParensAndSeparateNullCase.fs.bsl | 3 +- .../Nullness/NullAnnotatedExpression.fs.bsl | 3 +- ...gressionAnnotatedInlinePatternMatch.fs.bsl | 3 +- .../Nullness/RegressionChoiceType.fs.bsl | 3 +- .../Nullness/RegressionListType.fs.bsl | 3 +- .../RegressionOneLinerOptionType.fs.bsl | 3 +- .../Nullness/RegressionOptionType.fs.bsl | 3 +- .../Nullness/RegressionOrPattern.fs.bsl | 3 +- .../Nullness/RegressionResultType.fs.bsl | 3 +- .../Nullness/SignatureInAbstractMember.fs.bsl | 3 +- .../SyntaxTree/Nullness/StringOrNull.fs.bsl | 3 +- .../Nullness/StringOrNullInFunctionArg.fs.bsl | 3 +- .../TypeAbbreviationAddingWithNull.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 01.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 02.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 03.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 04.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 05.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 06.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 07.fs.bsl | 3 +- .../OperatorName/ActivePatternAnd 08.fs.bsl | 3 +- .../ActivePatternAsFunction.fs.bsl | 3 +- .../ActivePatternDefinition.fs.bsl | 3 +- .../ActivePatternExceptionAnd 01.fs.bsl | 3 +- .../ActivePatternExceptionAnd 02.fs.bsl | 3 +- .../ActivePatternExceptionAnd 03.fs.bsl | 3 +- .../ActivePatternExceptionAnd 04.fs.bsl | 3 +- .../ActivePatternExceptionAnd 05.fs.bsl | 3 +- .../ActivePatternExceptionAnd 06.fs.bsl | 3 +- .../ActivePatternExceptionAnd 07.fs.bsl | 3 +- .../ActivePatternExceptionAnd 08.fs.bsl | 3 +- ...ivePatternIdentifierInPrivateMember.fs.bsl | 3 +- .../CustomOperatorDefinition.fs.bsl | 3 +- ...tDifferenceBetweenCompiledOperators.fs.bsl | 3 +- .../OperatorName/InfixOperation.fs.bsl | 3 +- .../OperatorName/NamedParameter.fs.bsl | 3 +- .../OperatorName/NameofOperator.fs.bsl | 3 +- .../ObjectModelWithTwoMembers.fs.bsl | 3 +- .../OperatorName/OperatorAsFunction.fs.bsl | 3 +- .../OperatorInMemberDefinition.fs.bsl | 3 +- .../OperatorNameInSynValSig.fsi.bsl | 3 +- .../OperatorNameInValConstraint.fsi.bsl | 3 +- .../OperatorName/OptionalExpression.fs.bsl | 3 +- .../PartialActivePatternAsFunction.fs.bsl | 3 +- .../PartialActivePatternDefinition.fs.bsl | 3 +- ...ePatternDefinitionWithoutParameters.fs.bsl | 3 +- .../OperatorName/PrefixOperation.fs.bsl | 3 +- .../PrefixOperationWithTwoCharacters.fs.bsl | 3 +- .../QualifiedOperatorExpression.fs.bsl | 3 +- ...StringAsParsedHashDirectiveArgument.fs.bsl | 2 +- ...tifierAsParsedHashDirectiveArgument.fs.bsl | 3 +- ...StringAsParsedHashDirectiveArgument.fs.bsl | 13 +- ...StringAsParsedHashDirectiveArgument.fs.bsl | 2 +- .../data/SyntaxTree/Pattern/And 01.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/And 02.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/And 03.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/And 04.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 01.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 02.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 03.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 04.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 05.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 06.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 07.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 08.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 09.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 10.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 11.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/As 12.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Cons 01.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Cons 02.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Cons 03.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Cons 04.fs.bsl | 3 +- .../SyntaxTree/Pattern/InHeadPattern.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/IsInst 01.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/IsInst 02.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/IsInst 03.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/IsInst 04.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/IsInst 05.fs.bsl | 3 +- .../SyntaxTree/Pattern/Named field 01.fs.bsl | 2 +- .../SyntaxTree/Pattern/Named field 02.fs.bsl | 2 +- .../SyntaxTree/Pattern/Named field 03.fs.bsl | 2 +- .../SyntaxTree/Pattern/Named field 04.fs.bsl | 2 +- .../SyntaxTree/Pattern/Named field 05.fs.bsl | 2 +- .../Pattern/OperatorInMatchPattern.fs.bsl | 3 +- .../Pattern/OperatorInSynPatLongIdent.fs.bsl | 3 +- ...ParenthesesOfSynArgPatsNamePatPairs.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 01.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 02.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 03.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 04.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 05.fs.bsl | 3 +- .../data/SyntaxTree/Pattern/Record 06.fs.bsl | 3 +- ...airsContainsTheRangeOfTheEqualsSign.fs.bsl | 3 +- .../SynPatOrContainsTheRangeOfTheBar.fs.bsl | 3 +- .../Pattern/Tuple - HeadPat 01.fs.bsl | 3 +- .../Pattern/Tuple - HeadPat 02.fs.bsl | 3 +- .../Pattern/Tuple - Recover 01.fs.bsl | 3 +- .../Pattern/Tuple - Recover 02.fs.bsl | 3 +- .../Pattern/Tuple - Recover 03.fs.bsl | 3 +- .../Pattern/Tuple - Recover 04.fs.bsl | 3 +- .../Pattern/Tuple - Struct 01.fs.bsl | 2 +- .../Pattern/Typed - Missing type 01.fs.bsl | 3 +- .../Pattern/Typed - Missing type 02.fs.bsl | 3 +- .../Pattern/Typed - Missing type 03.fs.bsl | 3 +- .../Pattern/Typed - Missing type 04.fs.bsl | 3 +- .../Pattern/Typed - Missing type 05.fs.bsl | 3 +- .../Pattern/Typed - Missing type 06.fs.bsl | 3 +- .../Pattern/Typed - Missing type 07.fs.bsl | 3 +- .../Pattern/Typed - Missing type 08.fs.bsl | 3 +- .../Pattern/Typed - Missing type 09.fs.bsl | 3 +- .../Pattern/Typed - Missing type 10.fs.bsl | 3 +- .../Pattern/Typed - Missing type 11.fs.bsl | 3 +- .../Pattern/Typed - Missing type 12.fs.bsl | 3 +- ...alsTokenIsPresentInSynValSigMember.fsi.bsl | 3 +- ...ualsTokenIsPresentInSynValSigValue.fsi.bsl | 3 +- .../LeadingKeywordInRecursiveTypes.fsi.bsl | 3 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 2 +- ...dTypeHasStaticTypeAsLeadingKeyword.fsi.bsl | 3 +- ...xceptionDefnReprAndSynExceptionSig.fsi.bsl | 3 +- ...teShouldBeIncludedInSynTypeDefnSig.fsi.bsl | 2 +- ...uldBeIncludedInSynValSpfnAndMember.fsi.bsl | 3 +- ...esShouldBeIncludedInRecursiveTypes.fsi.bsl | 2 +- ...ionSigAndSynModuleSigDeclException.fsi.bsl | 3 +- ...fnSigDelegateOfShouldStartFromName.fsi.bsl | 2 +- ...igObjectModelShouldEndAtLastMember.fsi.bsl | 3 +- ...DefnSigRecordShouldEndAtLastMember.fsi.bsl | 2 +- ...ypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl | 3 +- .../RangeOfTypeShouldEndAtEndKeyword.fsi.bsl | 3 +- ...ldContainsTheRangeOfTheWithKeyword.fsi.bsl | 3 +- ...numContainsTheRangeOfTheEqualsSign.fsi.bsl | 3 +- ...assContainsTheRangeOfTheEqualsSign.fsi.bsl | 2 +- ...ateContainsTheRangeOfTheEqualsSign.fsi.bsl | 2 +- ...ionContainsTheRangeOfTheEqualsSign.fsi.bsl | 3 +- .../SynValSigContainsParameterNames.fsi.bsl | 3 +- .../TriviaIsPresentInSynTypeDefnSig.fsi.bsl | 3 +- .../ValKeywordIsPresentInSynValSig.fsi.bsl | 3 +- .../SyntaxTree/SignatureType/With 01.fsi.bsl | 3 +- .../SimplePats/SimplePats - Recover 01.fs.bsl | 3 +- .../SimplePats/SimplePats 01.fs.bsl | 3 +- .../SimplePats/SimplePats 02.fs.bsl | 3 +- .../SyntaxTree/SourceIdentifier/_LINE_.fs.bsl | 2 +- .../SourceIdentifier/_SOURCEDIRECTORY_.fs.bsl | 3 +- .../SourceIdentifier/_SOURCEFILE_.fs.bsl | 3 +- .../InterpolatedStringOffsideInModule.fs.bsl | 3 +- ...nterpolatedStringOffsideInNestedLet.fs.bsl | 3 +- ...stBytesWithSynByteStringKindRegular.fs.bsl | 3 +- ...tBytesWithSynByteStringKindVerbatim.fs.bsl | 3 +- ...ConstStringWithSynStringKindRegular.fs.bsl | 3 +- ...tStringWithSynStringKindTripleQuote.fs.bsl | 3 +- ...onstStringWithSynStringKindVerbatim.fs.bsl | 3 +- ...latedStringWithSynStringKindRegular.fs.bsl | 2 +- ...dStringWithSynStringKindTripleQuote.fs.bsl | 3 +- ...atedStringWithSynStringKindVerbatim.fs.bsl | 2 +- ...tringWithTripleQuoteMultipleDollars.fs.bsl | 3 +- ...ringWithTripleQuoteMultipleDollars2.fs.bsl | 3 +- .../SynIdent/IncompleteLongIdent 01.fs.bsl | 3 +- .../SynIdent/IncompleteLongIdent 02.fs.bsl | 3 +- .../Constraint intersection 01.fs.bsl | 3 +- .../SynType/Constraint intersection 01.fs.bsl | 3 +- .../SynType/Constraint intersection 02.fs.bsl | 3 +- .../SynType/Constraint intersection 03.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 01.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 02.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 03.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 04.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 05.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Div 06.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 01.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 02.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 03.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 04.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 05.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 06.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 07.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 08.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 09.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Fun 10.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 01.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 02.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 03.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 04.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 05.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 06.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 07.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 08.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Named 09.fs.bsl | 3 +- ...stedSynTypeOrInsideSynExprTraitCall.fs.bsl | 3 +- ...SingleSynTypeInsideSynExprTraitCall.fs.bsl | 3 +- .../SynTypeOrInsideSynExprTraitCall.fs.bsl | 3 +- ...eConstraintWhereTyparSupportsMember.fs.bsl | 3 +- ...TypeOrWithAppTypeOnTheRightHandSide.fs.bsl | 3 +- ...sIncludeLeadingParameterAttributes.fsi.bsl | 2 +- ...pleDoesIncludeLeadingParameterName.fsi.bsl | 3 +- .../SynType/Tuple - Nested 01.fs.bsl | 3 +- .../SynType/Tuple - Nested 02.fs.bsl | 3 +- .../SynType/Tuple - Nested 03.fs.bsl | 3 +- .../SynType/Tuple - Nested 04.fs.bsl | 3 +- .../SynType/Tuple - Nested 05.fs.bsl | 3 +- .../SynType/Tuple - Nested 06.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 01.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 02.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 03.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 04.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 05.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 06.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 07.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 08.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 09.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 10.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 11.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 12.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 13.fs.bsl | 3 +- .../data/SyntaxTree/SynType/Tuple 14.fs.bsl | 3 +- .../SyntaxTree/Type/Abbreviation 01.fs.bsl | 3 +- .../SyntaxTree/Type/Abbreviation 02.fs.bsl | 3 +- .../SyntaxTree/Type/Abbreviation 03.fs.bsl | 3 +- .../SyntaxTree/Type/Abbreviation 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 05.fs.bsl | 3 +- .../data/SyntaxTree/Type/And 06.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 01.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 02.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 03.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 04.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 05.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 06.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 07.fs.bsl | 3 +- .../service/data/SyntaxTree/Type/As 08.fs.bsl | 3 +- ...butesInOptionalNamedMemberParameter.fs.bsl | 3 +- .../data/SyntaxTree/Type/Class 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Class 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Class 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Class 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Class 05.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 05.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 06.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl | 3 +- .../data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl | 3 +- .../data/SyntaxTree/Type/Interface 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Interface 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Interface 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Interface 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Interface 05.fs.bsl | 2 +- .../data/SyntaxTree/Type/Interface 06.fs.bsl | 2 +- .../data/SyntaxTree/Type/Interface 07.fs.bsl | 3 +- ...eSynEnumCaseContainsRangeOfConstant.fs.bsl | 3 +- .../Type/NamedParametersInDelegateType.fs.bsl | 3 +- ...edTypeHasStaticTypeAsLeadingKeyword.fs.bsl | 3 +- .../SyntaxTree/Type/Primary ctor 01.fs.bsl | 3 +- .../SyntaxTree/Type/Primary ctor 02.fs.bsl | 3 +- .../SyntaxTree/Type/Primary ctor 03.fs.bsl | 3 +- .../SyntaxTree/Type/Primary ctor 04.fs.bsl | 3 +- .../SyntaxTree/Type/Primary ctor 05.fs.bsl | 3 +- ...ributeShouldBeIncludedInSynTypeDefn.fs.bsl | 3 +- ...tesShouldBeIncludedInRecursiveTypes.fs.bsl | 2 +- .../SyntaxTree/Type/Record - Access 01.fs.bsl | 2 +- .../SyntaxTree/Type/Record - Access 02.fs.bsl | 2 +- .../SyntaxTree/Type/Record - Access 03.fs.bsl | 2 +- .../SyntaxTree/Type/Record - Access 04.fs.bsl | 2 +- .../Type/Record - Mutable 01.fs.bsl | 2 +- .../Type/Record - Mutable 02.fs.bsl | 2 +- .../Type/Record - Mutable 03.fs.bsl | 2 +- .../Type/Record - Mutable 04.fs.bsl | 2 +- .../Type/Record - Mutable 05.fs.bsl | 2 +- .../data/SyntaxTree/Type/Record 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Record 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Record 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Record 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Record 05.fs.bsl | 3 +- ...eSynEnumCaseContainsRangeOfConstant.fs.bsl | 3 +- .../data/SyntaxTree/Type/Struct 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Struct 02.fs.bsl | 3 +- ...aceContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...uteContainsTheRangeOfTheTypeKeyword.fs.bsl | 3 +- ...ionContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...EnumContainsTheRangeOfTheEqualsSign.fs.bsl | 2 +- ...gateContainsTheRangeOfTheEqualsSign.fs.bsl | 2 +- ...ordContainsTheRangeOfTheWithKeyword.fs.bsl | 3 +- ...nionContainsTheRangeOfTheEqualsSign.fs.bsl | 3 +- ...DocContainsTheRangeOfTheTypeKeyword.fs.bsl | 3 +- .../Type/SynTypeFunHasRangeOfArrow.fs.bsl | 3 +- .../Type/SynTypeTupleWithStruct.fs.bsl | 3 +- .../SynTypeTupleWithStructRecovery.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 05.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 06.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 07.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 08.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 09.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 10.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 11.fs.bsl | 3 +- .../data/SyntaxTree/Type/Type 12.fs.bsl | 3 +- .../SyntaxTree/Type/Union - Field 01.fs.bsl | 2 +- .../SyntaxTree/Type/Union - Field 02.fs.bsl | 2 +- .../SyntaxTree/Type/Union - Field 03.fs.bsl | 2 +- .../data/SyntaxTree/Type/Union 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 05.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 06.fs.bsl | 3 +- .../data/SyntaxTree/Type/Union 07.fs.bsl | 3 +- .../data/SyntaxTree/Type/With 01.fs.bsl | 3 +- .../data/SyntaxTree/Type/With 02.fs.bsl | 3 +- .../data/SyntaxTree/Type/With 03.fs.bsl | 3 +- .../data/SyntaxTree/Type/With 04.fs.bsl | 3 +- .../data/SyntaxTree/Type/With 05.fs.bsl | 3 +- .../UnionCase/Missing keyword of.fs.bsl | 3 +- .../UnionCase/Missing name 01.fs.bsl | 3 +- .../UnionCase/Missing name 02.fs.bsl | 3 +- .../UnionCase/Missing name 03.fs.bsl | 3 +- .../UnionCase/Missing name 04.fs.bsl | 3 +- .../UnionCase/Missing name 05.fs.bsl | 3 +- .../UnionCase/Missing name 06.fs.bsl | 3 +- .../UnionCase/Missing name 07.fs.bsl | 3 +- .../UnionCase/Missing name 08.fs.bsl | 3 +- .../UnionCase/Missing name 09.fs.bsl | 3 +- .../MultipleSynUnionCasesHaveBarRange.fs.bsl | 3 +- .../UnionCase/PrivateKeywordHasRange.fs.bsl | 3 +- .../UnionCase/Recover Function Type 01.fs.bsl | 3 +- .../UnionCase/Recover Function Type 02.fs.bsl | 3 +- .../UnionCase/Recover Function Type 03.fs.bsl | 3 +- .../SingleSynUnionCaseHasBarRange.fs.bsl | 3 +- .../SingleSynUnionCaseWithoutBar.fs.bsl | 3 +- .../UnionCase/SynUnionCaseKindFullType.fs.bsl | 3 +- .../UnionCaseFieldsCanHaveComments.fs.bsl | 3 +- .../data/SyntaxTree/Val/InlineKeyword.fsi.bsl | 3 +- .../data/SyntaxTree/WarnScope/WarnScope.fs | 4 + .../SyntaxTree/WarnScope/WarnScope.fs.bsl | 12 + .../WarnScope/WarnScopeInSubmodule.fs | 7 + .../WarnScope/WarnScopeInSubmodule.fs.bsl | 22 + .../Tests.LanguageService.ErrorList.fs | 2 +- .../Tests.LanguageService.Script.fs | 5 +- 987 files changed, 3474 insertions(+), 1648 deletions(-) create mode 100644 src/Compiler/SyntaxTree/WarnScopes.fs create mode 100644 src/Compiler/SyntaxTree/WarnScopes.fsi create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs mode change 100755 => 100644 tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl mode change 100755 => 100644 tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl create mode 100644 tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs create mode 100644 tests/service/data/SyntaxTree/WarnScope/WarnScope.fs create mode 100644 tests/service/data/SyntaxTree/WarnScope/WarnScope.fs.bsl create mode 100644 tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs create mode 100644 tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 52cf5eb8350..14bb14be5a3 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -43,7 +43,7 @@ * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) * Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394) * Enable TypeSubsumptionCache for IDE use. [PR #18499](https://github.com/dotnet/fsharp/pull/18499) - +* 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)) ### Changed * FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index d1576a84eca..4a420016a14 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -6,6 +6,7 @@ * Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) +* Scoped Nowarn: added 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)) ### Fixed diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 92368118f3a..7d8a0e0764e 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -5752,7 +5752,7 @@ let CheckOneImplFile synImplFile, diagnosticOptions) = - let (ParsedImplFileInput (fileName, isScript, qualNameOfFile, scopedPragmas, _, implFileFrags, isLastCompiland, _, _)) = synImplFile + let (ParsedImplFileInput (fileName, isScript, qualNameOfFile, _, implFileFrags, isLastCompiland, _, _)) = synImplFile let infoReader = InfoReader(g, amap) cancellable { @@ -5891,7 +5891,7 @@ let CheckOneImplFile |> Array.map (fun (KeyValue(k,v)) -> (k,v)) |> Map - let implFile = CheckedImplFile (qualNameOfFile, scopedPragmas, implFileTy, implFileContents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) + let implFile = CheckedImplFile (qualNameOfFile, implFileTy, implFileContents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) return (topAttrs, implFile, envAtEnd, cenv.createsGeneratedProvidedTypes) } diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 1be3b7be3a2..258346b9104 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -10391,7 +10391,7 @@ and GenModuleBinding cenv (cgbuf: CodeGenBuffer) (qname: QualifiedNameOfFile) la /// Generate the namespace fragments in a single file and GenImplFile cenv (mgbuf: AssemblyBuilder) mainInfoOpt eenv (implFile: CheckedImplFileAfterOptimization) = - let (CheckedImplFile(qname, _, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, _)) = + let (CheckedImplFile(qname, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, _)) = implFile.ImplFile let optimizeDuringCodeGen = implFile.OptimizeDuringCodeGen diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 68813e69a83..2bdb5fe6923 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -379,7 +379,7 @@ type PhasedDiagnostic with // Level 2 | _ -> 2 - member x.IsEnabled(severity, options) = + member private x.IsEnabled(severity, options) = let level = options.WarnLevel let specificWarnOn = options.WarnOn let n = x.Number @@ -412,19 +412,25 @@ type PhasedDiagnostic with member x.AdjustSeverity(options, severity) = let n = x.Number - let warnOff () = List.contains n options.WarnOff + let localWarnon () = WarnScopes.IsWarnon options n x.Range + + let localNowarn () = WarnScopes.IsNowarn options n x.Range + + let warnOff () = + List.contains n options.WarnOff && not (localWarnon ()) || localNowarn () match severity with | FSharpDiagnosticSeverity.Error -> FSharpDiagnosticSeverity.Error | FSharpDiagnosticSeverity.Warning when x.IsEnabled(severity, options) && ((options.GlobalWarnAsError && not (warnOff ())) - || List.contains n options.WarnAsError) + || List.contains n options.WarnAsError && not (localNowarn ())) && not (List.contains n options.WarnAsWarn) -> FSharpDiagnosticSeverity.Error + | FSharpDiagnosticSeverity.Info when List.contains n options.WarnAsError && not (localNowarn ()) -> FSharpDiagnosticSeverity.Error | FSharpDiagnosticSeverity.Warning when x.IsEnabled(severity, options) && not (warnOff ()) -> FSharpDiagnosticSeverity.Warning - | FSharpDiagnosticSeverity.Info when List.contains n options.WarnAsError -> FSharpDiagnosticSeverity.Error + | FSharpDiagnosticSeverity.Warning when localWarnon () -> FSharpDiagnosticSeverity.Warning | FSharpDiagnosticSeverity.Info when List.contains n options.WarnOn && not (warnOff ()) -> FSharpDiagnosticSeverity.Warning | FSharpDiagnosticSeverity.Info when x.IsEnabled(severity, options) && not (warnOff ()) -> FSharpDiagnosticSeverity.Info | _ -> FSharpDiagnosticSeverity.Hidden @@ -2274,51 +2280,25 @@ type PhasedDiagnostic with diagnostic.OutputContext(buf, prefix, fileLineFunction) diagnostic.Output(buf, tcConfig, severity)) -//---------------------------------------------------------------------------- -// Scoped #nowarn pragmas - -/// Build an DiagnosticsLogger that delegates to another DiagnosticsLogger but filters warnings turned off by the given pragma declarations -// -// NOTE: we allow a flag to turn of strict file checking. This is because file names sometimes don't match due to use of -// #line directives, e.g. for pars.fs/pars.fsy. In this case we just test by line number - in most cases this is sufficient -// because we install a filtering error handler on a file-by-file basis for parsing and type-checking. -// However this is indicative of a more systematic problem where source-line -// sensitive operations (lexfilter and warning filtering) do not always -// interact well with #line directives. -type DiagnosticsLoggerFilteringByScopedPragmas - (checkFile, scopedPragmas, diagnosticOptions: FSharpDiagnosticOptions, diagnosticsLogger: DiagnosticsLogger) = - inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedPragmas") +/// Build an DiagnosticsLogger that delegates to another DiagnosticsLogger but filters warnings +type DiagnosticsLoggerFilteringByScopedNowarn(diagnosticOptions: FSharpDiagnosticOptions, diagnosticsLogger: DiagnosticsLogger) = + inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedNowarn") let mutable realErrorPresent = false override _.DiagnosticSink(diagnostic: PhasedDiagnostic, severity) = + if severity = FSharpDiagnosticSeverity.Error then realErrorPresent <- true diagnosticsLogger.DiagnosticSink(diagnostic, severity) else - let report = - let warningNum = diagnostic.Number - - match diagnostic.Range with - | Some m -> - scopedPragmas - |> List.exists (fun pragma -> - let (ScopedPragma.WarningOff(pragmaRange, warningNumFromPragma)) = pragma - - warningNum = warningNumFromPragma - && (not checkFile || m.FileIndex = pragmaRange.FileIndex) - && posGeq m.Start pragmaRange.Start) - |> not - | None -> true - - if report then - match diagnostic.AdjustSeverity(diagnosticOptions, severity) with - | FSharpDiagnosticSeverity.Hidden -> () - | s -> diagnosticsLogger.DiagnosticSink(diagnostic, s) + match diagnostic.AdjustSeverity(diagnosticOptions, severity) with + | FSharpDiagnosticSeverity.Hidden -> () + | s -> diagnosticsLogger.DiagnosticSink(diagnostic, s) override _.ErrorCount = diagnosticsLogger.ErrorCount override _.CheckForRealErrorsIgnoringWarnings = realErrorPresent -let GetDiagnosticsLoggerFilteringByScopedPragmas (checkFile, scopedPragmas, diagnosticOptions, diagnosticsLogger) = - DiagnosticsLoggerFilteringByScopedPragmas(checkFile, scopedPragmas, diagnosticOptions, diagnosticsLogger) :> DiagnosticsLogger +let GetDiagnosticsLoggerFilteringByScopedNowarn (diagnosticOptions, diagnosticsLogger) = + DiagnosticsLoggerFilteringByScopedNowarn(diagnosticOptions, diagnosticsLogger) :> DiagnosticsLogger diff --git a/src/Compiler/Driver/CompilerDiagnostics.fsi b/src/Compiler/Driver/CompilerDiagnostics.fsi index cdf559c301a..1f6e91d0012 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fsi +++ b/src/Compiler/Driver/CompilerDiagnostics.fsi @@ -77,12 +77,8 @@ type PhasedDiagnostic with unit /// Get a diagnostics logger that filters the reporting of warnings based on scoped pragma information -val GetDiagnosticsLoggerFilteringByScopedPragmas: - checkFile: bool * - scopedPragmas: ScopedPragma list * - diagnosticOptions: FSharpDiagnosticOptions * - diagnosticsLogger: DiagnosticsLogger -> - DiagnosticsLogger +val GetDiagnosticsLoggerFilteringByScopedNowarn: + diagnosticOptions: FSharpDiagnosticOptions * diagnosticsLogger: DiagnosticsLogger -> DiagnosticsLogger /// Remove 'implicitIncludeDir' from a file name before output val SanitizeFileName: fileName: string -> implicitIncludeDir: string -> string diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index 3d9884b2cef..1ce85b734fa 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -4,7 +4,6 @@ module internal FSharp.Compiler.ParseAndCheckInputs open System -open System.Diagnostics open System.IO open System.Threading open System.Collections.Generic @@ -41,7 +40,6 @@ open FSharp.Compiler.Text.Range open FSharp.Compiler.Xml open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.TypedTreeBasics open FSharp.Compiler.TcGlobals let CanonicalizeFilename fileName = @@ -96,13 +94,13 @@ let PrependPathToSpec x (SynModuleOrNamespaceSig(longId, isRecursive, kind, decl let PrependPathToInput x inp = match inp with - | ParsedInput.ImplFile(ParsedImplFileInput(b, c, q, d, hd, impls, e, trivia, i)) -> + | ParsedInput.ImplFile(ParsedImplFileInput(b, c, q, hd, impls, e, trivia, i)) -> ParsedInput.ImplFile( - ParsedImplFileInput(b, c, PrependPathToQualFileName x q, d, hd, List.map (PrependPathToImpl x) impls, e, trivia, i) + ParsedImplFileInput(b, c, PrependPathToQualFileName x q, hd, List.map (PrependPathToImpl x) impls, e, trivia, i) ) - | ParsedInput.SigFile(ParsedSigFileInput(b, q, d, hd, specs, trivia, i)) -> - ParsedInput.SigFile(ParsedSigFileInput(b, PrependPathToQualFileName x q, d, hd, List.map (PrependPathToSpec x) specs, trivia, i)) + | ParsedInput.SigFile(ParsedSigFileInput(b, q, hd, specs, trivia, i)) -> + ParsedInput.SigFile(ParsedSigFileInput(b, PrependPathToQualFileName x q, hd, List.map (PrependPathToSpec x) specs, trivia, i)) let IsValidAnonModuleName (modname: string) = modname |> String.forall (fun c -> Char.IsLetterOrDigit c || c = '_') @@ -217,36 +215,55 @@ let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, fileName, intf) SynModuleOrNamespaceSig(lid, isRecursive, kind, decls, xmlDoc, attributes, None, range, trivia) -let GetScopedPragmasForHashDirective hd (langVersion: LanguageVersion) = - [ - match hd with - | ParsedHashDirective("nowarn", args, _) -> - for arg in args do - let rangeAndDescription = - match arg with - | ParsedHashDirectiveArgument.Int32(n, m) -> Some(m, WarningDescription.Int32 n) - | ParsedHashDirectiveArgument.Ident(ident, m) -> Some(m, WarningDescription.Ident ident) - | ParsedHashDirectiveArgument.String(s, _, m) -> Some(m, WarningDescription.String s) - | _ -> None - - match rangeAndDescription with - | None -> () - | Some(m, description) -> - match GetWarningNumber(m, description, langVersion, WarningNumberSource.CompilerDirective) with - | None -> () - | Some n -> ScopedPragma.WarningOff(m, n) - | _ -> () - ] +let private collectCodeComments (lexbuf: UnicodeLexing.Lexbuf) = + let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf) -let private collectCodeComments (lexbuf: UnicodeLexing.Lexbuf) (tripleSlashComments: range list) = [ yield! CommentStore.GetComments(lexbuf) yield! (List.map CommentTrivia.LineComment tripleSlashComments) + yield! WarnScopes.getCommentTrivia lexbuf ] |> List.sortBy (function | CommentTrivia.LineComment r | CommentTrivia.BlockComment r -> r.StartLine, r.StartColumn) +let private collectParsedInputTrivia lexbuf diagnosticOptions isScript submoduleRanges = + WarnScopes.MergeInto diagnosticOptions isScript submoduleRanges lexbuf + + { + ConditionalDirectives = IfdefStore.GetTrivia(lexbuf) + WarnDirectives = WarnScopes.getDirectiveTrivia (lexbuf) + CodeComments = collectCodeComments lexbuf + } + +let private getImplSubmoduleRanges (impls: ParsedImplFileFragment list) = + let getDecls (impl: ParsedImplFileFragment) = + match impl with + | ParsedImplFileFragment.AnonModule(decls, _) -> decls + | ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(decls = decls)) -> decls + | ParsedImplFileFragment.NamespaceFragment(decls = decls) -> decls + + let getSubmoduleRange decl = + match decl with + | SynModuleDecl.NestedModule(range = m) -> Some m + | _ -> None + + impls |> List.collect getDecls |> List.choose getSubmoduleRange + +let private getSpecSubmoduleRanges (specs: ParsedSigFileFragment list) = + let getDecls (spec: ParsedSigFileFragment) = + match spec with + | ParsedSigFileFragment.AnonModule(decls, _) -> decls + | ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(decls = decls)) -> decls + | ParsedSigFileFragment.NamespaceFragment(decls = decls) -> decls + + let getSubmoduleRange decl = + match decl with + | SynModuleSigDecl.NestedModule(range = m) -> Some m + | _ -> None + + specs |> List.collect getDecls |> List.choose getSubmoduleRange + let PostParseModuleImpls ( defaultNamespace, @@ -254,9 +271,15 @@ let PostParseModuleImpls isLastCompiland, ParsedImplFile(hashDirectives, impls), lexbuf: UnicodeLexing.Lexbuf, - tripleSlashComments: range list, + diagnosticOptions: FSharpDiagnosticOptions, identifiers: Set ) = + + let isScript = IsScript fileName + + let trivia = + collectParsedInputTrivia lexbuf diagnosticOptions isScript (getImplSubmoduleRanges impls) + let othersWithSameName = impls |> List.rev @@ -273,31 +296,8 @@ let PostParseModuleImpls |> List.mapi (fun i x -> PostParseModuleImpl(i, defaultNamespace, isLastCompiland, fileName, x)) let qualName = QualFileNameOfImpls fileName impls - let isScript = IsScript fileName - let scopedPragmas = - [ - for SynModuleOrNamespace(decls = decls) in impls do - for d in decls do - match d with - | SynModuleDecl.HashDirective(hd, _) -> yield! GetScopedPragmasForHashDirective hd lexbuf.LanguageVersion - | _ -> () - for hd in hashDirectives do - yield! GetScopedPragmasForHashDirective hd lexbuf.LanguageVersion - ] - - let conditionalDirectives = IfdefStore.GetTrivia(lexbuf) - let codeComments = collectCodeComments lexbuf tripleSlashComments - - let trivia: ParsedImplFileInputTrivia = - { - ConditionalDirectives = conditionalDirectives - CodeComments = codeComments - } - - ParsedInput.ImplFile( - ParsedImplFileInput(fileName, isScript, qualName, scopedPragmas, hashDirectives, impls, isLastCompiland, trivia, identifiers) - ) + ParsedInput.ImplFile(ParsedImplFileInput(fileName, isScript, qualName, hashDirectives, impls, isLastCompiland, trivia, identifiers)) let PostParseModuleSpecs ( @@ -306,9 +306,13 @@ let PostParseModuleSpecs isLastCompiland, ParsedSigFile(hashDirectives, specs), lexbuf: UnicodeLexing.Lexbuf, - tripleSlashComments: range list, + diagnosticOptions: FSharpDiagnosticOptions, identifiers: Set ) = + + let trivia = + collectParsedInputTrivia lexbuf diagnosticOptions false (getSpecSubmoduleRanges specs) + let othersWithSameName = specs |> List.rev @@ -326,27 +330,7 @@ let PostParseModuleSpecs let qualName = QualFileNameOfSpecs fileName specs - let scopedPragmas = - [ - for SynModuleOrNamespaceSig(decls = decls) in specs do - for d in decls do - match d with - | SynModuleSigDecl.HashDirective(hd, _) -> yield! GetScopedPragmasForHashDirective hd lexbuf.LanguageVersion - | _ -> () - for hd in hashDirectives do - yield! GetScopedPragmasForHashDirective hd lexbuf.LanguageVersion - ] - - let conditionalDirectives = IfdefStore.GetTrivia(lexbuf) - let codeComments = collectCodeComments lexbuf tripleSlashComments - - let trivia: ParsedSigFileInputTrivia = - { - ConditionalDirectives = conditionalDirectives - CodeComments = codeComments - } - - ParsedInput.SigFile(ParsedSigFileInput(fileName, qualName, scopedPragmas, hashDirectives, specs, trivia, identifiers)) + ParsedInput.SigFile(ParsedSigFileInput(fileName, qualName, hashDirectives, specs, trivia, identifiers)) type ModuleNamesDict = Map> @@ -391,26 +375,26 @@ let DeduplicateModuleName (moduleNamesDict: ModuleNamesDict) (fileName: string) let DeduplicateParsedInputModuleName (moduleNamesDict: ModuleNamesDict) input = match input with | ParsedInput.ImplFile implFile -> - let (ParsedImplFileInput(fileName, isScript, qualNameOfFile, scopedPragmas, hashDirectives, modules, flags, trivia, identifiers)) = + let (ParsedImplFileInput(fileName, isScript, qualNameOfFile, hashDirectives, modules, flags, trivia, identifiers)) = implFile let qualNameOfFileR, moduleNamesDictR = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile let implFileR = - ParsedImplFileInput(fileName, isScript, qualNameOfFileR, scopedPragmas, hashDirectives, modules, flags, trivia, identifiers) + ParsedImplFileInput(fileName, isScript, qualNameOfFileR, hashDirectives, modules, flags, trivia, identifiers) let inputR = ParsedInput.ImplFile implFileR inputR, moduleNamesDictR | ParsedInput.SigFile sigFile -> - let (ParsedSigFileInput(fileName, qualNameOfFile, scopedPragmas, hashDirectives, modules, trivia, identifiers)) = + let (ParsedSigFileInput(fileName, qualNameOfFile, hashDirectives, modules, trivia, identifiers)) = sigFile let qualNameOfFileR, moduleNamesDictR = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile let sigFileR = - ParsedSigFileInput(fileName, qualNameOfFileR, scopedPragmas, hashDirectives, modules, trivia, identifiers) + ParsedSigFileInput(fileName, qualNameOfFileR, hashDirectives, modules, trivia, identifiers) let inputT = ParsedInput.SigFile sigFileR inputT, moduleNamesDictR @@ -449,66 +433,54 @@ let ParseInput use _ = UseDiagnosticsLogger delayLogger use _ = UseBuildPhase BuildPhase.Parse - let mutable scopedPragmas = [] - try - let input = - let identStore = HashSet() - - let lexer = - if identCapture then - (fun x -> - let token = lexer x - - match token with - | Parser.token.PERCENT_OP ident - | Parser.token.FUNKY_OPERATOR_NAME ident - | Parser.token.ADJACENT_PREFIX_OP ident - | Parser.token.PLUS_MINUS_OP ident - | Parser.token.INFIX_AMP_OP ident - | Parser.token.INFIX_STAR_DIV_MOD_OP ident - | Parser.token.PREFIX_OP ident - | Parser.token.INFIX_BAR_OP ident - | Parser.token.INFIX_AT_HAT_OP ident - | Parser.token.INFIX_COMPARE_OP ident - | Parser.token.INFIX_STAR_STAR_OP ident - | Parser.token.IDENT ident -> identStore.Add ident |> ignore - | _ -> () - - token) - else - lexer - - if FSharpMLCompatFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then - errorR (Error(FSComp.SR.buildInvalidSourceFileExtensionML fileName, rangeStartup)) - else - mlCompatWarning (FSComp.SR.buildCompilingExtensionIsForML ()) rangeStartup - - // Call the appropriate parser - for signature files or implementation files - if FSharpImplFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - let impl = Parser.implementationFile lexer lexbuf - - let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf) - - PostParseModuleImpls(defaultNamespace, fileName, isLastCompiland, impl, lexbuf, tripleSlashComments, Set identStore) - elif FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - let intfs = Parser.signatureFile lexer lexbuf - - let tripleSlashComments = XmlDocStore.ReportInvalidXmlDocPositions(lexbuf) + let identStore = HashSet() + + let lexer = + if identCapture then + (fun x -> + let token = lexer x + + match token with + | Parser.token.PERCENT_OP ident + | Parser.token.FUNKY_OPERATOR_NAME ident + | Parser.token.ADJACENT_PREFIX_OP ident + | Parser.token.PLUS_MINUS_OP ident + | Parser.token.INFIX_AMP_OP ident + | Parser.token.INFIX_STAR_DIV_MOD_OP ident + | Parser.token.PREFIX_OP ident + | Parser.token.INFIX_BAR_OP ident + | Parser.token.INFIX_AT_HAT_OP ident + | Parser.token.INFIX_COMPARE_OP ident + | Parser.token.INFIX_STAR_STAR_OP ident + | Parser.token.IDENT ident -> identStore.Add ident |> ignore + | _ -> () - PostParseModuleSpecs(defaultNamespace, fileName, isLastCompiland, intfs, lexbuf, tripleSlashComments, Set identStore) - else if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then - error (Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated fileName, rangeStartup)) + token) else - error (Error(FSComp.SR.buildInvalidSourceFileExtension fileName, rangeStartup)) + lexer - scopedPragmas <- input.ScopedPragmas - input + if FSharpMLCompatFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then + if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then + errorR (Error(FSComp.SR.buildInvalidSourceFileExtensionML fileName, rangeStartup)) + else + mlCompatWarning (FSComp.SR.buildCompilingExtensionIsForML ()) rangeStartup + + // Call the appropriate parser - for signature files or implementation files + if FSharpImplFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then + let impl = Parser.implementationFile lexer lexbuf + PostParseModuleImpls(defaultNamespace, fileName, isLastCompiland, impl, lexbuf, diagnosticOptions, Set identStore) + elif FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then + let intfs = Parser.signatureFile lexer lexbuf + PostParseModuleSpecs(defaultNamespace, fileName, isLastCompiland, intfs, lexbuf, diagnosticOptions, Set identStore) + else if lexbuf.SupportsFeature LanguageFeature.MLCompatRevisions then + error (Error(FSComp.SR.buildInvalidSourceFileExtensionUpdated fileName, rangeStartup)) + else + error (Error(FSComp.SR.buildInvalidSourceFileExtension fileName, rangeStartup)) finally // OK, now commit the errors, since the ScopedPragmas will (hopefully) have been scraped let filteringDiagnosticsLogger = - GetDiagnosticsLoggerFilteringByScopedPragmas(false, scopedPragmas, diagnosticOptions, diagnosticsLogger) + GetDiagnosticsLoggerFilteringByScopedNowarn(diagnosticOptions, diagnosticsLogger) delayLogger.CommitDelayedDiagnostics filteringDiagnosticsLogger @@ -572,20 +544,7 @@ let ReportParsingStatistics res = let EmptyParsedInput (fileName, isLastCompiland) = if FSharpSigFileSuffixes |> List.exists (FileSystemUtils.checkSuffix fileName) then - ParsedInput.SigFile( - ParsedSigFileInput( - fileName, - QualFileNameOfImpls fileName [], - [], - [], - [], - { - ConditionalDirectives = [] - CodeComments = [] - }, - Set.empty - ) - ) + ParsedInput.SigFile(ParsedSigFileInput(fileName, QualFileNameOfImpls fileName [], [], [], ParsedInputTrivia.Empty, Set.empty)) else ParsedInput.ImplFile( ParsedImplFileInput( @@ -594,12 +553,8 @@ let EmptyParsedInput (fileName, isLastCompiland) = QualFileNameOfImpls fileName [], [], [], - [], isLastCompiland, - { - ConditionalDirectives = [] - CodeComments = [] - }, + ParsedInputTrivia.Empty, Set.empty ) ) @@ -836,11 +791,7 @@ let ParseInputFiles (tcConfig: TcConfig, lexResourceManager, sourceFiles, diagno tcConfig.exiter.Exit 1 let ProcessMetaCommandsFromInput - ( - nowarnF: 'state -> range * string -> 'state, - hashReferenceF: 'state -> range * string * Directive -> 'state, - loadSourceF: 'state -> range * string -> unit - ) + (hashReferenceF: 'state -> range * string * Directive -> 'state, loadSourceF: 'state -> range * string -> unit) (tcConfig: TcConfigBuilder, inp: ParsedInput, pathOfMetaCommandSource, state0) = @@ -884,11 +835,6 @@ let ProcessMetaCommandsFromInput state - | ParsedHashDirective("nowarn", hashArguments, m) -> - let arguments = parsedHashDirectiveArgumentsNoCheck hashArguments - - List.fold (fun state d -> nowarnF state (m, d)) state arguments - | ParsedHashDirective(("reference" | "r") as c, [], m) -> if not canHaveScriptMetaCommands then errorR (HashDirectiveNotAllowedInNonScript m) @@ -1009,19 +955,9 @@ let ProcessMetaCommandsFromInput let state = List.fold ProcessMetaCommandsFromModuleImpl state implFile.Contents state -let ApplyNoWarnsToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource) = - // Clone - let tcConfigB = tcConfig.CloneToBuilder() - let addNoWarn = fun () (m, s) -> tcConfigB.TurnWarningOff(m, s) - let addReference = fun () (_m, _s, _) -> () - let addLoadedSource = fun () (_m, _s) -> () - ProcessMetaCommandsFromInput (addNoWarn, addReference, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) - TcConfig.Create(tcConfigB, validate = false) - let ApplyMetaCommandsFromInputToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource, dependencyProvider) = // Clone let tcConfigB = tcConfig.CloneToBuilder() - let getWarningNumber = fun () _ -> () let addReferenceDirective = fun () (m, path, directive) -> tcConfigB.AddReferenceDirective(dependencyProvider, m, path, directive) @@ -1029,7 +965,7 @@ let ApplyMetaCommandsFromInputToTcConfig (tcConfig: TcConfig, inp: ParsedInput, let addLoadedSource = fun () (m, s) -> tcConfigB.AddLoadedSource(m, s, pathOfMetaCommandSource) - ProcessMetaCommandsFromInput (getWarningNumber, addReferenceDirective, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) + ProcessMetaCommandsFromInput (addReferenceDirective, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) TcConfig.Create(tcConfigB, validate = false) /// Build the initial type checking environment @@ -1269,7 +1205,7 @@ let SkippedImplFilePlaceholder (tcConfig: TcConfig, tcImports: TcImports, tcGlob tcState let emptyImplFile = - CheckedImplFile(qualNameOfFile, [], rootSigTy, ModuleOrNamespaceContents.TMDefs [], false, false, StampMap [], Map.empty) + CheckedImplFile(qualNameOfFile, rootSigTy, ModuleOrNamespaceContents.TMDefs [], false, false, StampMap [], Map.empty) let tcEnvAtEnd = tcStateForImplFile.TcEnvFromImpls Some((tcEnvAtEnd, EmptyTopAttrs, Some emptyImplFile, ccuSigForFile), tcState) @@ -1402,15 +1338,15 @@ let CheckOneInput } // Within a file, equip loggers to locally filter w.r.t. scope pragmas in each input -let DiagnosticsLoggerForInput (tcConfig: TcConfig, input: ParsedInput, oldLogger) = - GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, oldLogger) +let DiagnosticsLoggerForInput (tcConfig: TcConfig, oldLogger) = + GetDiagnosticsLoggerFilteringByScopedNowarn(tcConfig.diagnosticsOptions, oldLogger) /// Typecheck a single file (or interactive entry into F# Interactive) let CheckOneInputEntry (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt) tcState input = cancellable { // Equip loggers to locally filter w.r.t. scope pragmas in each input use _ = - UseTransformedDiagnosticsLogger(fun oldLogger -> DiagnosticsLoggerForInput(tcConfig, input, oldLogger)) + UseTransformedDiagnosticsLogger(fun oldLogger -> DiagnosticsLoggerForInput(tcConfig, oldLogger)) use _ = UseBuildPhase BuildPhase.TypeCheck @@ -1915,7 +1851,7 @@ let CheckMultipleInputsUsingGraphMode inputsWithLoggers |> List.toArray |> Array.map (fun (input, oldLogger) -> - let logger = DiagnosticsLoggerForInput(tcConfig, input, oldLogger) + let logger = DiagnosticsLoggerForInput(tcConfig, oldLogger) input, logger) let processFile (node: NodeToTypeCheck) (state: State) : Finisher = diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fsi b/src/Compiler/Driver/ParseAndCheckInputs.fsi index fb32a4557cd..281638b5685 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fsi +++ b/src/Compiler/Driver/ParseAndCheckInputs.fsi @@ -7,12 +7,12 @@ open System.IO open Internal.Utilities.Library open FSharp.Compiler.CheckBasics open FSharp.Compiler.CheckDeclarations -open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerImports open FSharp.Compiler.Diagnostics open FSharp.Compiler.DependencyManager open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.GraphChecking open FSharp.Compiler.NameResolution open FSharp.Compiler.Syntax @@ -78,16 +78,13 @@ val ParseInput: /// A general routine to process hash directives val ProcessMetaCommandsFromInput: - ('T -> range * string -> 'T) * ('T -> range * string * Directive -> 'T) * ('T -> range * string -> unit) -> + ('T -> range * string * Directive -> 'T) * ('T -> range * string -> unit) -> TcConfigBuilder * ParsedInput * string * 'T -> 'T -/// Process all the #r, #I etc. in an input. For non-scripts report warnings about ignored directives. +/// Process all the #r, #I etc. in an input. val ApplyMetaCommandsFromInputToTcConfig: TcConfig * ParsedInput * string * DependencyProvider -> TcConfig -/// Process the #nowarn in an input and integrate them into the TcConfig -val ApplyNoWarnsToTcConfig: TcConfig * ParsedInput * string -> TcConfig - /// Parse one input stream val ParseOneInputStream: tcConfig: TcConfig * diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index b45049627cf..a9dd5442626 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -63,9 +63,6 @@ type LoadClosure = /// The #load, including those that didn't resolve OriginalLoadReferences: (range * string * string) list - /// The #nowarns - NoWarns: (string * range list) list - /// Diagnostics seen while processing resolutions ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list @@ -95,8 +92,7 @@ module ScriptPreprocessClosure = range: range * parsedInput: ParsedInput option * parseDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list * - metaDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list * - nowarns: (string * range) list + metaDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list type Observed() = let seen = Dictionary<_, bool>() @@ -262,13 +258,9 @@ module ScriptPreprocessClosure = errorRecovery exn m [] - let ApplyMetaCommandsFromInputToTcConfigAndGatherNoWarn - (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource, dependencyProvider) - = + let ApplyMetaCommandsFromInputToTcConfig (tcConfig: TcConfig, inp: ParsedInput, pathOfMetaCommandSource, dependencyProvider) = let tcConfigB = tcConfig.CloneToBuilder() - let mutable nowarns = [] - let getWarningNumber () (m, s) = nowarns <- (s, m) :: nowarns let addReferenceDirective () (m, s, directive) = tcConfigB.AddReferenceDirective(dependencyProvider, m, s, directive) @@ -277,19 +269,17 @@ module ScriptPreprocessClosure = tcConfigB.AddLoadedSource(m, s, pathOfMetaCommandSource) try - ProcessMetaCommandsFromInput - (getWarningNumber, addReferenceDirective, addLoadedSource) - (tcConfigB, inp, pathOfMetaCommandSource, ()) + ProcessMetaCommandsFromInput (addReferenceDirective, addLoadedSource) (tcConfigB, inp, pathOfMetaCommandSource, ()) with ReportedError _ -> // Recover by using whatever did end up in the tcConfig () try - TcConfig.Create(tcConfigB, validate = false), nowarns + TcConfig.Create(tcConfigB, validate = false) with ReportedError _ -> // Recover by using a default TcConfig. let tcConfigB = tcConfig.CloneToBuilder() - TcConfig.Create(tcConfigB, validate = false), nowarns + TcConfig.Create(tcConfigB, validate = false) let getDirective d = match d with @@ -474,13 +464,8 @@ module ScriptPreprocessClosure = let pathOfMetaCommandSource = !!Path.GetDirectoryName(fileName) let preSources = tcConfig.GetAvailableLoadedSources() - let tcConfigResult, noWarns = - ApplyMetaCommandsFromInputToTcConfigAndGatherNoWarn( - tcConfig, - parseResult, - pathOfMetaCommandSource, - dependencyProvider - ) + let tcConfigResult = + ApplyMetaCommandsFromInputToTcConfig(tcConfig, parseResult, pathOfMetaCommandSource, dependencyProvider) tcConfig <- tcConfigResult // We accumulate the tcConfig in order to collect assembly references @@ -501,14 +486,14 @@ module ScriptPreprocessClosure = for subSource in ClosureSourceOfFilename(subFile, m, tcConfigResult.inputCodePage, false) do yield! processClosureSource subSource else - ClosureFile(subFile, m, None, [], [], []) + ClosureFile(subFile, m, None, [], []) - ClosureFile(fileName, m, Some parseResult, parseDiagnostics, diagnosticsLogger.Diagnostics, noWarns) + ClosureFile(fileName, m, Some parseResult, parseDiagnostics, diagnosticsLogger.Diagnostics) else // Don't traverse into .fs leafs. printfn "yielding non-script source %s" fileName - ClosureFile(fileName, m, None, [], [], []) + ClosureFile(fileName, m, None, [], []) ] let sources = closureSources |> List.collect processClosureSource @@ -520,32 +505,22 @@ module ScriptPreprocessClosure = /// Mark the last file as isLastCompiland. let MarkLastCompiland (tcConfig: TcConfig, lastClosureFile) = - let (ClosureFile(fileName, m, lastParsedInput, parseDiagnostics, metaDiagnostics, nowarns)) = + let (ClosureFile(fileName, m, lastParsedInput, parseDiagnostics, metaDiagnostics)) = lastClosureFile match lastParsedInput with | Some(ParsedInput.ImplFile lastParsedImplFile) -> - let (ParsedImplFileInput(name, isScript, qualNameOfFile, scopedPragmas, hashDirectives, implFileFlags, _, trivia, identifiers)) = + let (ParsedImplFileInput(name, isScript, qualNameOfFile, hashDirectives, implFileFlags, _, trivia, identifiers)) = lastParsedImplFile let isLastCompiland = (true, tcConfig.target.IsExe) let lastParsedImplFileR = - ParsedImplFileInput( - name, - isScript, - qualNameOfFile, - scopedPragmas, - hashDirectives, - implFileFlags, - isLastCompiland, - trivia, - identifiers - ) + ParsedImplFileInput(name, isScript, qualNameOfFile, hashDirectives, implFileFlags, isLastCompiland, trivia, identifiers) let lastClosureFileR = - ClosureFile(fileName, m, Some(ParsedInput.ImplFile lastParsedImplFileR), parseDiagnostics, metaDiagnostics, nowarns) + ClosureFile(fileName, m, Some(ParsedInput.ImplFile lastParsedImplFileR), parseDiagnostics, metaDiagnostics) lastClosureFileR | _ -> lastClosureFile @@ -563,12 +538,12 @@ module ScriptPreprocessClosure = // Get all source files. let sourceFiles = - [ for ClosureFile(fileName, m, _, _, _, _) in closureFiles -> (fileName, m) ] + [ for ClosureFile(fileName, m, _, _, _) in closureFiles -> (fileName, m) ] let sourceInputs = [ for closureFile in closureFiles -> - let (ClosureFile(fileName, _, input, parseDiagnostics, metaDiagnostics, _nowarns)) = + let (ClosureFile(fileName, _, input, parseDiagnostics, metaDiagnostics)) = closureFile let closureInput: LoadClosureInput = @@ -582,10 +557,6 @@ module ScriptPreprocessClosure = closureInput ] - let globalNoWarns = - closureFiles - |> List.collect (fun (ClosureFile(_, _, _, _, _, noWarns)) -> noWarns) - // Resolve all references. let references, unresolvedReferences, resolutionDiagnostics = let diagnosticsLogger = CapturingDiagnosticsLogger("GetLoadClosure") @@ -601,7 +572,7 @@ module ScriptPreprocessClosure = // Root errors and warnings - look at the last item in the closureFiles list let loadClosureRootDiagnostics, allRootDiagnostics = match List.rev closureFiles with - | ClosureFile(_, _, _, parseDiagnostics, metaDiagnostics, _) :: _ -> + | ClosureFile(_, _, _, parseDiagnostics, metaDiagnostics) :: _ -> (earlierDiagnostics @ metaDiagnostics @ resolutionDiagnostics), (parseDiagnostics @ earlierDiagnostics @ metaDiagnostics @ resolutionDiagnostics) | _ -> [], [] // When no file existed. @@ -632,7 +603,6 @@ module ScriptPreprocessClosure = SdkDirOverride = tcConfig.sdkDirOverride UnresolvedReferences = unresolvedReferences Inputs = sourceInputs - NoWarns = List.groupBy fst globalNoWarns |> List.map (map2Of2 (List.map snd)) OriginalLoadReferences = tcConfig.loadedSources ResolutionDiagnostics = resolutionDiagnostics AllRootFileDiagnostics = allRootDiagnostics diff --git a/src/Compiler/Driver/ScriptClosure.fsi b/src/Compiler/Driver/ScriptClosure.fsi index 249885036cd..b54b9b2f0d0 100644 --- a/src/Compiler/Driver/ScriptClosure.fsi +++ b/src/Compiler/Driver/ScriptClosure.fsi @@ -60,9 +60,6 @@ type LoadClosure = /// The original #load references, including those that didn't resolve OriginalLoadReferences: (range * string * string) list - /// The #nowarns - NoWarns: (string * range list) list - /// Diagnostics seen while processing resolutions ResolutionDiagnostics: (PhasedDiagnostic * FSharpDiagnosticSeverity) list diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 3518d9d4884..2ef07e66e6b 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -77,7 +77,7 @@ type DiagnosticsLoggerUpToMaxErrors(tcConfigB: TcConfigBuilder, exiter: Exiter, override x.DiagnosticSink(diagnostic, severity) = let tcConfig = TcConfig.Create(tcConfigB, validate = false) - match diagnostic.AdjustSeverity(tcConfigB.diagnosticsOptions, severity) with + match diagnostic.AdjustSeverity(tcConfig.diagnosticsOptions, severity) with | FSharpDiagnosticSeverity.Error -> if errors >= tcConfig.maxErrors then x.HandleTooManyErrors(FSComp.SR.fscTooManyErrors ()) @@ -225,11 +225,6 @@ let AdjustForScriptCompile (tcConfigB: TcConfigBuilder, commandLineSourceFiles, references |> List.iter (fun r -> tcConfigB.AddReferencedAssemblyByPath(r.originalReference.Range, r.resolvedPath)) - // Also record the other declarations from the script. - closure.NoWarns - |> List.collect (fun (n, ms) -> ms |> List.map (fun m -> m, n)) - |> List.iter (fun (x, m) -> tcConfigB.TurnWarningOff(x, m)) - closure.SourceFiles |> List.map fst |> List.iter AddIfNotPresent closure.AllRootFileDiagnostics |> List.iter diagnosticSink @@ -644,7 +639,6 @@ let main1 if not tcConfig.continueAfterParseFailure then AbortOnError(diagnosticsLogger, exiter) - // Apply any nowarn flags let tcConfig = (tcConfig, inputs) ||> List.fold (fun z (input, sourceFileDirectory) -> @@ -735,13 +729,7 @@ let main2 let oldLogger = diagnosticsLogger let diagnosticsLogger = - let scopedPragmas = - [ - for CheckedImplFile(pragmas = pragmas) in typedImplFiles do - yield! pragmas - ] - - GetDiagnosticsLoggerFilteringByScopedPragmas(true, scopedPragmas, tcConfig.diagnosticsOptions, oldLogger) + GetDiagnosticsLoggerFilteringByScopedNowarn(tcConfig.diagnosticsOptions, oldLogger) SetThreadDiagnosticsLoggerNoUnwind diagnosticsLogger diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index aab4de2a554..010088e958e 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1799,3 +1799,8 @@ featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" featureSupportWarnWhenUnitPassedToObjArg,"Warn when unit is passed to a member accepting `obj` argument, e.g. `Method(o:obj)` will warn if called via `Method()`." featureUseBangBindingValueDiscard,"Allows use! _ = ... in computation expressions" +featureScopedNowarn,"Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules" +3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" +3875,lexWarnDirectiveMustHaveArgs,"Warn directives must have warning number(s) as argument(s)" +3876,lexWarnDirectivesMustMatch,"There is another %s for this warning already in line %d." +3877,lexLineDirectiveMappingIsNotUnique,"The file '%s' was also pointed to in a line directive in '%s'. Proper warn directive application may not be possible." \ No newline at end of file diff --git a/src/Compiler/FSharp.Compiler.Service.fsproj b/src/Compiler/FSharp.Compiler.Service.fsproj index bbddf424684..6c087fa99fe 100644 --- a/src/Compiler/FSharp.Compiler.Service.fsproj +++ b/src/Compiler/FSharp.Compiler.Service.fsproj @@ -280,6 +280,8 @@ + + diff --git a/src/Compiler/Facilities/DiagnosticOptions.fs b/src/Compiler/Facilities/DiagnosticOptions.fs index 2a3a6ffe742..b5f87d482ad 100644 --- a/src/Compiler/Facilities/DiagnosticOptions.fs +++ b/src/Compiler/Facilities/DiagnosticOptions.fs @@ -20,6 +20,7 @@ type FSharpDiagnosticOptions = WarnOn: int list WarnAsError: int list WarnAsWarn: int list + mutable WarnScopeData: obj option } static member Default = @@ -30,6 +31,7 @@ type FSharpDiagnosticOptions = WarnOn = [] WarnAsError = [] WarnAsWarn = [] + WarnScopeData = None } member x.CheckXmlDocs = diff --git a/src/Compiler/Facilities/DiagnosticOptions.fsi b/src/Compiler/Facilities/DiagnosticOptions.fsi index 8ff6b3d2f88..a6f041c7ed9 100644 --- a/src/Compiler/Facilities/DiagnosticOptions.fsi +++ b/src/Compiler/Facilities/DiagnosticOptions.fsi @@ -19,7 +19,8 @@ type FSharpDiagnosticOptions = WarnOff: int list WarnOn: int list WarnAsError: int list - WarnAsWarn: int list } + WarnAsWarn: int list + mutable WarnScopeData: obj option } static member Default: FSharpDiagnosticOptions diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 874b709d658..763452592a4 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -100,6 +100,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | ScopedNowarn /// LanguageVersion management type LanguageVersion(versionText) = @@ -231,6 +232,7 @@ type LanguageVersion(versionText) = LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion LanguageFeature.UseBangBindingValueDiscard, previewVersion + LanguageFeature.ScopedNowarn, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -394,6 +396,7 @@ type LanguageVersion(versionText) = | LanguageFeature.SupportValueOptionsAsOptionalParameters -> FSComp.SR.featureSupportValueOptionsAsOptionalParameters () | LanguageFeature.WarnWhenUnitPassedToObjArg -> FSComp.SR.featureSupportWarnWhenUnitPassedToObjArg () | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () + | LanguageFeature.ScopedNowarn -> FSComp.SR.featureScopedNowarn () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index f50357f3fe0..a452205765e 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -91,6 +91,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | ScopedNowarn /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 98c62839018..662ba9752e7 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -41,11 +41,8 @@ open FSharp.Compiler.CompilerOptions open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerDiagnostics open FSharp.Compiler.CompilerImports -open FSharp.Compiler.CompilerGlobalState -open FSharp.Compiler.CreateILModule open FSharp.Compiler.DependencyManager open FSharp.Compiler.Diagnostics -open FSharp.Compiler.EditorServices open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features open FSharp.Compiler.IlxGen @@ -70,7 +67,6 @@ open FSharp.Compiler.Xml open FSharp.Compiler.Tokenization open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps -open FSharp.Compiler.BuildGraph open FSharp.Compiler.CheckExpressionsOps //---------------------------------------------------------------------------- @@ -1671,7 +1667,7 @@ let internal mkBoundValueTypedImpl tcGlobals m moduleName name ty = let contents = TMDefs([ TMDefs[TMDefRec(false, [], [], [ mbinding ], m)] ]) let qname = QualifiedNameOfFile.QualifiedNameOfFile(Ident(moduleName, m)) - entity, v, CheckedImplFile.CheckedImplFile(qname, [], mty, contents, false, false, StampMap.Empty, Map.empty) + entity, v, CheckedImplFile.CheckedImplFile(qname, mty, contents, false, false, StampMap.Empty, Map.empty) let dynamicCcuName (isEmitMulti) = $"""FSI-ASSEMBLY{if isEmitMulti then "-MULTI" else ""}""" @@ -2482,13 +2478,9 @@ type internal FsiDynamicCompiler true, ComputeQualifiedNameOfFileFromUniquePath(m, prefixPath), [], - [], [ impl ], (isLastCompiland, isExe), - { - ConditionalDirectives = [] - CodeComments = [] - }, + ParsedInputTrivia.Empty, Set.empty ) ) @@ -2829,14 +2821,11 @@ type internal FsiDynamicCompiler = WithImplicitHome (tcConfigB, directoryName sourceFile) (fun () -> ProcessMetaCommandsFromInput - ((fun st (m, nm) -> - tcConfigB.TurnWarningOff(m, nm) - st), - (fun st (m, path, directive) -> - let st, _ = - fsiDynamicCompiler.PartiallyProcessReferenceOrPackageIncludePathDirective(ctok, st, directive, path, false, m) + ((fun st (m, path, directive) -> + let st, _ = + fsiDynamicCompiler.PartiallyProcessReferenceOrPackageIncludePathDirective(ctok, st, directive, path, false, m) - st), + st), (fun _ _ -> ())) (tcConfigB, input, !!Path.GetDirectoryName(sourceFile), istate)) @@ -2875,10 +2864,6 @@ type internal FsiDynamicCompiler fsiConsoleOutput.uprintfn "]" - for (warnNum, ranges) in closure.NoWarns do - for m in ranges do - tcConfigB.TurnWarningOff(m, warnNum) - // Play errors and warnings from resolution closure.ResolutionDiagnostics |> List.iter diagnosticSink @@ -3686,7 +3671,7 @@ type FsiInteractionProcessor error (Error(FSIstrings.SR.fsiDirectoryDoesNotExist (path), m)) /// Parse one interaction. Called on the parser thread. - let ParseInteraction (tokenizer: LexFilter.LexFilter) = + let ParseInteraction diagnosticOptions (tokenizer: LexFilter.LexFilter) = let mutable lastToken = Parser.ELSE // Any token besides SEMICOLON_SEMICOLON will do for initial value try @@ -3702,6 +3687,8 @@ type FsiInteractionProcessor Parser.interaction lexerWhichSavesLastToken tokenizer.LexBuffer) + WarnScopes.MergeInto diagnosticOptions false [] tokenizer.LexBuffer + Some input with e -> // On error, consume tokens until to ;; or EOF. @@ -3730,7 +3717,7 @@ type FsiInteractionProcessor let tokenizer = fsiStdinLexerProvider.CreateBufferLexer("hdummy.fsx", lexbuf, diagnosticsLogger) - let parsedInteraction = ParseInteraction tokenizer + let parsedInteraction = ParseInteraction tcConfigB.diagnosticsOptions tokenizer match parsedInteraction with | Some(ParsedScriptInteraction.Definitions([ SynModuleDecl.Expr(e, _) ], _)) -> @@ -3839,12 +3826,6 @@ type FsiInteractionProcessor istate, Completed None - | ParsedHashDirective("nowarn", nowarnArguments, m) -> - let numbers = (parsedHashDirectiveArgumentsNoCheck nowarnArguments) - - List.iter (fun (d: string) -> tcConfigB.TurnWarningOff(m, d)) numbers - istate, Completed None - | ParsedHashDirective("terms", [], _) -> tcConfigB.showTerms <- not tcConfigB.showTerms istate, Completed None @@ -4147,6 +4128,7 @@ type FsiInteractionProcessor runCodeOnMainThread, istate: FsiDynamicCompilerState, tokenizer: LexFilter.LexFilter, + diagnosticOptions, diagnosticsLogger, ?cancellationToken: CancellationToken ) = @@ -4173,7 +4155,7 @@ type FsiInteractionProcessor // Parse the interaction. When FSI.EXE is waiting for input from the console the // parser thread is blocked somewhere deep this call. - let action = ParseInteraction tokenizer + let action = ParseInteraction diagnosticOptions tokenizer if progress then fprintfn fsiConsoleOutput.Out "returned from ParseInteraction...calling runCodeOnMainThread..." @@ -4211,7 +4193,13 @@ type FsiInteractionProcessor let rec run istate = let status = - processor.ParseAndExecuteInteractionFromLexbuf((fun f istate -> f ctok istate), istate, tokenizer, diagnosticsLogger) + processor.ParseAndExecuteInteractionFromLexbuf( + (fun f istate -> f ctok istate), + istate, + tokenizer, + tcConfigB.diagnosticsOptions, + diagnosticsLogger + ) ProcessStepStatus status None (fun _ istate -> run istate) @@ -4291,7 +4279,7 @@ type FsiInteractionProcessor currState |> InteractiveCatch diagnosticsLogger (fun istate -> - let expr = ParseInteraction tokenizer + let expr = ParseInteraction tcConfigB.diagnosticsOptions tokenizer ExecuteParsedInteractionOnMainThread(ctok, diagnosticsLogger, expr, istate, cancellationToken)) |> commitResult @@ -4344,7 +4332,7 @@ type FsiInteractionProcessor // mainForm.Invoke to pipe a message back through the form's main event loop. (The message // is a delegate to execute on the main Thread) // - member processor.StartStdinReadAndProcessThread diagnosticsLogger = + member processor.StartStdinReadAndProcessThread(diagnosticOptions, diagnosticsLogger) = if progress then fprintfn fsiConsoleOutput.Out "creating stdinReaderThread" @@ -4378,6 +4366,7 @@ type FsiInteractionProcessor runCodeOnMainThread, currState, currTokenizer, + diagnosticOptions, diagnosticsLogger ) @@ -4985,7 +4974,7 @@ type FsiEvaluationSession | _ -> ()) fsiInteractionProcessor.LoadInitialFiles(ctokRun, diagnosticsLogger) - fsiInteractionProcessor.StartStdinReadAndProcessThread(diagnosticsLogger) + fsiInteractionProcessor.StartStdinReadAndProcessThread(tcConfigB.diagnosticsOptions, diagnosticsLogger) DriveFsiEventLoop(fsi, fsiInterruptController, fsiConsoleOutput) diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index f03db8f5e6f..0e2ced16da4 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -1332,9 +1332,9 @@ module Pass4_RewriteAssembly = let rhs, z = TransModuleContents penv z rhs ModuleOrNamespaceBinding.Module(nm, rhs), z - let TransImplFile penv z (CheckedImplFile (fragName, pragmas, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = + let TransImplFile penv z (CheckedImplFile (fragName, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = let contentsR, z = TransModuleContents penv z contents - (CheckedImplFile (fragName, pragmas, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)), z + (CheckedImplFile (fragName, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)), z //------------------------------------------------------------------------- // pass5: copyExpr diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 2840331f54b..52e404cea3e 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -4367,7 +4367,7 @@ and OptimizeModuleDefs cenv (env, bindInfosColl) defs = (defs, UnionOptimizationInfos minfos), (env, bindInfosColl) and OptimizeImplFileInternal cenv env isIncrementalFragment hidden implFile = - let (CheckedImplFile (qname, pragmas, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile + let (CheckedImplFile (qname, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile let env, contentsR, minfo, hidden = // FSI compiles interactive fragments as if you're typing incrementally into one module. // @@ -4389,7 +4389,7 @@ and OptimizeImplFileInternal cenv env isIncrementalFragment hidden implFile = let env = BindValsInModuleOrNamespace cenv minfo env env, mexprR, minfoExternal, hidden - let implFileR = CheckedImplFile (qname, pragmas, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) + let implFileR = CheckedImplFile (qname, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) env, implFileR, minfo, hidden diff --git a/src/Compiler/Service/BackgroundCompiler.fs b/src/Compiler/Service/BackgroundCompiler.fs index 5eb8bd35f99..29d73f63617 100644 --- a/src/Compiler/Service/BackgroundCompiler.fs +++ b/src/Compiler/Service/BackgroundCompiler.fs @@ -1350,8 +1350,6 @@ type internal BackgroundCompiler yield! otherFlags for r in loadClosure.References do yield "-r:" + fst r - for code, _ in loadClosure.NoWarns do - yield "--nowarn:" + code |] let options = @@ -1479,7 +1477,7 @@ type internal BackgroundCompiler member _.BeforeBackgroundFileCheck = self.BeforeBackgroundFileCheck - member _.CheckFileInProject + member this.CheckFileInProject ( parseResults: FSharpParseFileResults, fileName: string, @@ -1488,7 +1486,13 @@ type internal BackgroundCompiler options: FSharpProjectOptions, userOpName: string ) : Async = - self.CheckFileInProject(parseResults, fileName, fileVersion, sourceText, options, userOpName) + async { + ignore parseResults + + let! _, result = this.ParseAndCheckFileInProject(fileName, fileVersion, sourceText, options, userOpName) + + return result + } member _.CheckFileInProjectAllowingStaleCachedResults ( diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 57d322c81a8..a169b4a6a56 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -3102,8 +3102,14 @@ module internal ParseAndCheckFile = errHandler.CollectedDiagnostics(None), parseResult, errHandler.AnyErrors let ApplyLoadClosure - (tcConfig, parsedMainInput, mainInputFileName: string, loadClosure: LoadClosure option, tcImports: TcImports, backgroundDiagnostics) - = + ( + tcConfig: TcConfig, + parsedMainInput, + mainInputFileName: string, + loadClosure: LoadClosure option, + tcImports: TcImports, + backgroundDiagnostics + ) = // If additional references were brought in by the preprocessor then we need to process them match loadClosure with @@ -3240,13 +3246,6 @@ module internal ParseAndCheckFile = use _unwindBP = UseBuildPhase BuildPhase.TypeCheck - // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) - let tcConfig = - ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !!Path.GetDirectoryName(mainInputFileName)) - - // update the error handler with the modified tcConfig - errHandler.DiagnosticOptions <- tcConfig.diagnosticsOptions - // If additional references were brought in by the preprocessor then we need to process them ApplyLoadClosure(tcConfig, parsedMainInput, mainInputFileName, loadClosure, tcImports, backgroundDiagnostics) @@ -3293,7 +3292,9 @@ module internal ParseAndCheckFile = // Play background errors and warnings for this file. do for err, severity in backgroundDiagnostics do - diagnosticSink (err, severity) + match err.AdjustSeverity(tcConfig.diagnosticsOptions, severity) with + | FSharpDiagnosticSeverity.Hidden -> () + | s -> diagnosticSink (err, s) let (tcEnvAtEnd, _, implFiles, ccuSigsForFiles), tcState = resOpt diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 0cdc4b9235e..f98ccd09a12 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -30,6 +30,7 @@ open FSharp.Compiler.NameResolution open FSharp.Compiler.ParseAndCheckInputs open FSharp.Compiler.ScriptClosure open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text open FSharp.Compiler.Text.Range @@ -128,9 +129,8 @@ module IncrementalBuildSyntaxTree = sigName, [], [], - [], isLastCompiland, - { ConditionalDirectives = []; CodeComments = [] }, + ParsedInputTrivia.Empty, Set.empty ) ), sourceRange, fileName, [||] @@ -254,7 +254,7 @@ type BoundModel private ( IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBETypechecked fileName) let capturingDiagnosticsLogger = CapturingDiagnosticsLogger("TypeCheck") - let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) + let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedNowarn(tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) beforeFileChecked.Trigger fileName diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 8e97816290f..bc07224d70b 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -404,6 +404,7 @@ module internal TokenClassifications = | HASH_LIGHT _ | HASH_LINE _ + | WARN_DIRECTIVE _ | HASH_IF _ | HASH_ELSE _ | HASH_ENDIF _ -> (FSharpTokenColorKind.PreprocessorKeyword, FSharpTokenCharKind.WhiteSpace, FSharpTokenTriggerClass.None) @@ -935,6 +936,21 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, maxLength: int option, fi let offset = beforeIdent + identLength processWhiteAndComment str offset delay cont) + let processWarnDirective (str: string) leftc rightc cont = + let hashIdx = str.IndexOf("#", StringComparison.Ordinal) + let commentIdx = str.IndexOf("//", StringComparison.Ordinal) + + if commentIdx > 0 then + delayToken (COMMENT cont, leftc + commentIdx - 1, rightc) + + let rightc = if commentIdx > 0 then leftc + commentIdx else rightc + + if (hashIdx > 0) then + delayToken (WARN_DIRECTIVE(range0, "", cont), hashIdx, rightc) + WHITESPACE cont, leftc, leftc + hashIdx - 1 + else + WARN_DIRECTIVE(range0, "", cont), leftc, rightc + // Set up the initial file position do match fileName with @@ -1035,7 +1051,8 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, maxLength: int option, fi | HASH_IF(m, lineStr, cont) when lineStr <> "" -> false, processHashIfLine m.StartColumn lineStr cont | HASH_ELSE(m, lineStr, cont) when lineStr <> "" -> false, processHashEndElse m.StartColumn lineStr 4 cont | HASH_ENDIF(m, lineStr, cont) when lineStr <> "" -> false, processHashEndElse m.StartColumn lineStr 5 cont - | HASH_IDENT(ident) -> + | WARN_DIRECTIVE(_, s, cont) -> false, processWarnDirective s leftc rightc cont + | HASH_IDENT ident -> delayToken (IDENT ident, leftc + 1, rightc) false, (HASH, leftc, leftc) | RQUOTE_DOT(s, raw) -> @@ -1173,9 +1190,7 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, maxLength: int option, fi | true, "silentCd" | true, "q" | true, "quit" - | true, "help" - // These are for script and non-script - | _, "nowarn" -> + | true, "help" -> // Merge both tokens into one. let lexcontFinal = if isCached then @@ -1286,6 +1301,7 @@ type FSharpTokenKind = | HashIf | HashElse | HashEndIf + | WarnDirective | CommentTrivia | WhitespaceTrivia | HashLine @@ -1497,6 +1513,7 @@ type FSharpToken = | HASH_IF _ -> FSharpTokenKind.HashIf | HASH_ELSE _ -> FSharpTokenKind.HashElse | HASH_ENDIF _ -> FSharpTokenKind.HashEndIf + | WARN_DIRECTIVE _ -> FSharpTokenKind.WarnDirective | COMMENT _ -> FSharpTokenKind.CommentTrivia | WHITESPACE _ -> FSharpTokenKind.WhitespaceTrivia | HASH_LINE _ -> FSharpTokenKind.HashLine diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index ee2ab7411d5..261c7c6764e 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -371,6 +371,7 @@ type public FSharpTokenKind = | HashIf | HashElse | HashEndIf + | WarnDirective | CommentTrivia | WhitespaceTrivia | HashLine diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 4385ca4f1e3..57bf639a224 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -299,7 +299,9 @@ type CacheSizes = { ParseFileKeepStrongly = 50 * sizeFactor - ParseFileKeepWeakly = 20 * sizeFactor + // Since ParseFile version is just a content hash, we keep only one version + // in order to ensure that we re-parse after undo for the sake of WarnScopes + ParseFileKeepWeakly = 0 // 20 * sizeFactor ParseFileWithoutProjectKeepStrongly = 5 * sizeFactor ParseFileWithoutProjectKeepWeakly = 2 * sizeFactor ParseAndCheckFileInProjectKeepStrongly = sizeFactor @@ -341,7 +343,9 @@ type internal CompilerCaches(cacheSizes: CacheSizes) = member _.CacheSizes = cs - member val ParseFile = AsyncMemoize(keepStrongly = cs.ParseFileKeepStrongly, keepWeakly = cs.ParseFileKeepWeakly, name = "ParseFile") + member val ParseFile = + AsyncMemoize(keepStrongly = cs.ParseFileKeepStrongly, keepWeakly = cs.ParseFileKeepWeakly, name = "ParseFile") + : AsyncMemoize<(FSharpProjectIdentifier * string), (string * string * bool), ProjectSnapshot.FSharpParsedFile> member val ParseFileWithoutProject = AsyncMemoize( @@ -1379,7 +1383,6 @@ type internal TransparentCompiler let mainInputFileName = file.FileName let sourceText = file.SourceText - let parsedMainInput = file.ParsedInput // Initialize the error handler let errHandler = @@ -1392,14 +1395,10 @@ type internal TransparentCompiler tcConfig.flatErrors ) - // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) - let tcConfig = - ApplyNoWarnsToTcConfig(tcConfig, parsedMainInput, !!Path.GetDirectoryName(mainInputFileName)) - let diagnosticsLogger = errHandler.DiagnosticsLogger let diagnosticsLogger = - GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, diagnosticsLogger) + GetDiagnosticsLoggerFilteringByScopedNowarn(tcConfig.diagnosticsOptions, diagnosticsLogger) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) @@ -1644,9 +1643,7 @@ type internal TransparentCompiler let extraLogger = CapturingDiagnosticsLogger("DiagnosticsWhileCreatingDiagnostics") use _ = new CompilationGlobalsScope(extraLogger, BuildPhase.TypeCheck) - // Apply nowarns to tcConfig (may generate errors, so ensure diagnosticsLogger is installed) - let tcConfig = - ApplyNoWarnsToTcConfig(bootstrapInfo.TcConfig, parseResults.ParseTree, Path.GetDirectoryName fileName |> (!!)) + let tcConfig = bootstrapInfo.TcConfig let diagnosticsOptions = tcConfig.diagnosticsOptions @@ -2077,22 +2074,20 @@ type internal TransparentCompiler // TODO: might need to deal with exceptions here: use _ = new CompilationGlobalsScope(DiscardErrorsLogger, BuildPhase.Parse) - let! tcConfigB, sourceFileNames, _ = ComputeTcConfigBuilder projectSnapshot - - let tcConfig = TcConfig.Create(tcConfigB, validate = true) - let _index, fileSnapshot = - projectSnapshot.SourceFiles - |> Seq.mapi pair - |> Seq.tryFind (fun (_, f) -> f.FileName = fileName) - |> Option.defaultWith (fun () -> failwith $"File not found: {fileName}") + match! ComputeBootstrapInfo projectSnapshot with + | None, creationDiags -> return emptyParseResult fileName creationDiags + | Some bootstrapInfo, _ -> + let tcConfig = bootstrapInfo.TcConfig - let isExe = tcConfig.target.IsExe - let isLastCompiland = fileName = (sourceFileNames |> List.last) + let fileSnapshot = + projectSnapshot.SourceFiles |> List.find (fun f -> f.FileName = fileName) - let! file = LoadSource fileSnapshot isExe isLastCompiland - let! parseResult = getParseResult projectSnapshot Seq.empty file tcConfig - return parseResult + let isExe = tcConfig.target.IsExe + let isLastCompiland = fileName = List.last projectSnapshot.SourceFileNames + let! file = LoadSource fileSnapshot isExe isLastCompiland + let! parseResult = getParseResult projectSnapshot Seq.empty file tcConfig + return parseResult } member _.ParseFileWithoutProject @@ -2417,14 +2412,7 @@ type internal TransparentCompiler assumeDotNetFramework otherFlags - let otherFlags = - [ - yield "--noframework" - yield "--warn:3" - yield! otherFlags - for code, _ in loadClosure.NoWarns do - yield "--nowarn:" + code - ] + let otherFlags = [ yield "--noframework"; yield "--warn:3"; yield! otherFlags ] // Once we do have the script closure, we can populate the cache to re-use can later. let loadClosureKey = diff --git a/src/Compiler/Symbols/Exprs.fs b/src/Compiler/Symbols/Exprs.fs index 5ec81f6861d..33c87edb597 100644 --- a/src/Compiler/Symbols/Exprs.fs +++ b/src/Compiler/Symbols/Exprs.fs @@ -1353,7 +1353,7 @@ and FSharpImplementationFileDeclaration = and FSharpImplementationFileContents(cenv, mimpl) = let g = cenv.g - let (CheckedImplFile (qname, _pragmas, _, contents, hasExplicitEntryPoint, isScript, _anonRecdTypes, _)) = mimpl + let (CheckedImplFile (qname, _, contents, hasExplicitEntryPoint, isScript, _anonRecdTypes, _)) = mimpl let rec getBind (bind: Binding) = let v = bind.Var assert v.IsCompiledAsTopLevel diff --git a/src/Compiler/SyntaxTree/LexHelpers.fs b/src/Compiler/SyntaxTree/LexHelpers.fs index faf85ad811d..dddaaa37a94 100644 --- a/src/Compiler/SyntaxTree/LexHelpers.fs +++ b/src/Compiler/SyntaxTree/LexHelpers.fs @@ -9,17 +9,16 @@ open Internal.Utilities open Internal.Utilities.Library open Internal.Utilities.Text.Lexing -open FSharp.Compiler.IO open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Features -open FSharp.Compiler.LexerStore +open FSharp.Compiler.IO open FSharp.Compiler.ParseHelpers -open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Parser open FSharp.Compiler.Syntax open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.Text open FSharp.Compiler.Text.Range +open FSharp.Compiler.UnicodeLexing /// The "mock" file name used by fsi.exe when reading from stdin. /// Has special treatment by the lexer, i.e. __SOURCE_DIRECTORY__ becomes GetCurrentDirectory() diff --git a/src/Compiler/SyntaxTree/LexerStore.fs b/src/Compiler/SyntaxTree/LexerStore.fs index 2914d944c20..e2c6010a561 100644 --- a/src/Compiler/SyntaxTree/LexerStore.fs +++ b/src/Compiler/SyntaxTree/LexerStore.fs @@ -4,40 +4,18 @@ module internal FSharp.Compiler.LexerStore open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.SyntaxTrivia -open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Text open FSharp.Compiler.Text.Position open FSharp.Compiler.Text.Range +open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Xml -//------------------------------------------------------------------------ -// Lexbuf.BufferLocalStore is used during lexing/parsing of a file for different purposes. -// All access happens through the functions and modules below. -//------------------------------------------------------------------------ - -let private getStoreData<'T when 'T: not null> (lexbuf: Lexbuf) key (getInitialData: unit -> 'T) = - let store = lexbuf.BufferLocalStore - - match store.TryGetValue key with - | true, data -> data :?> 'T - | _ -> - let data = getInitialData () - store[key] <- data - data - -let private tryGetStoreData<'T when 'T: not null> (lexbuf: Lexbuf) key = - let store = lexbuf.BufferLocalStore - - match store.TryGetValue key with - | true, data -> Some(data :?> 'T) - | _ -> None - //------------------------------------------------------------------------ // A SynArgNameGenerator for the current file, used by the parser //------------------------------------------------------------------------ let getSynArgNameGenerator (lexbuf: Lexbuf) = - getStoreData lexbuf "SynArgNameGenerator" SynArgNameGenerator + lexbuf.GetLocalData("SynArgNameGenerator", SynArgNameGenerator) //------------------------------------------------------------------------ // A XmlDocCollector, used to hold the current accumulated Xml doc lines, and related access functions @@ -47,8 +25,8 @@ let getSynArgNameGenerator (lexbuf: Lexbuf) = module XmlDocStore = let private xmlDocKey = "XmlDoc" - let private getCollector (lexbuf: Lexbuf) = - getStoreData lexbuf xmlDocKey XmlDocCollector + let private getCollector (lexbuf: Lexbuf) : XmlDocCollector = + lexbuf.GetLocalData(xmlDocKey, XmlDocCollector) /// Called from the lexer to save a single line of XML doc comment. let SaveXmlDocLine (lexbuf: Lexbuf, lineText, range: range) = @@ -78,9 +56,9 @@ module XmlDocStore = /// Called from the parser each time we parse a construct that marks the end of an XML doc comment range, /// e.g. a 'type' declaration. The markerRange is the range of the keyword that delimits the construct. let GrabXmlDocBeforeMarker (lexbuf: Lexbuf, markerRange: range) = - match tryGetStoreData lexbuf xmlDocKey with + match lexbuf.TryGetLocalData xmlDocKey with | Some collector -> PreXmlDoc.CreateFromGrabPoint(collector, markerRange.Start) - | _ -> PreXmlDoc.Empty + | None -> PreXmlDoc.Empty let ReportInvalidXmlDocPositions (lexbuf: Lexbuf) = let collector = getCollector lexbuf @@ -106,7 +84,7 @@ let rec LexerIfdefEval (lookup: string -> bool) = [] module IfdefStore = let private getStore (lexbuf: Lexbuf) = - getStoreData lexbuf "Ifdef" ResizeArray + lexbuf.GetLocalData("Ifdef", ResizeArray) let private mkRangeWithoutLeadingWhitespace (lexed: string) (m: range) : range = let startColumn = lexed.Length - lexed.TrimStart().Length @@ -150,7 +128,7 @@ module IfdefStore = [] module CommentStore = let private getStore (lexbuf: Lexbuf) = - getStoreData lexbuf "Comments" ResizeArray + lexbuf.GetLocalData("Comments", ResizeArray) let SaveSingleLineComment (lexbuf: Lexbuf, startRange: range, endRange: range) = let store = getStore lexbuf diff --git a/src/Compiler/SyntaxTree/LexerStore.fsi b/src/Compiler/SyntaxTree/LexerStore.fsi index 952a0cc6f81..e6bda944438 100644 --- a/src/Compiler/SyntaxTree/LexerStore.fsi +++ b/src/Compiler/SyntaxTree/LexerStore.fsi @@ -4,8 +4,8 @@ module internal FSharp.Compiler.LexerStore open FSharp.Compiler.SyntaxTreeOps open FSharp.Compiler.SyntaxTrivia -open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Text +open FSharp.Compiler.UnicodeLexing open FSharp.Compiler.Xml val getSynArgNameGenerator: Lexbuf -> SynArgNameGenerator diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index a8a8724f58b..62eb2159081 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -85,7 +85,7 @@ type LexerIfdefStack = LexerIfdefStackEntries /// Specifies how the 'endline' function in the lexer should continue after /// it reaches end of line or eof. The options are to continue with 'token' function -/// or to continue with 'skip' function. +/// or to continue with 'ifdefSkip' function. [] type LexerEndlineContinuation = | Token diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index bd918e8848a..978a75ab6cc 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1759,9 +1759,6 @@ type ParsedImplFile = ParsedImplFile of hashDirectives: ParsedHashDirective list [] type ParsedSigFile = ParsedSigFile of hashDirectives: ParsedHashDirective list * fragments: ParsedSigFileFragment list -[] -type ScopedPragma = WarningOff of range: range * warningNumber: int - [] type QualifiedNameOfFile = | QualifiedNameOfFile of Ident @@ -1778,19 +1775,15 @@ type ParsedImplFileInput = fileName: string * isScript: bool * qualifiedNameOfFile: QualifiedNameOfFile * - scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * contents: SynModuleOrNamespace list * flags: (bool * bool) * - trivia: ParsedImplFileInputTrivia * + trivia: ParsedInputTrivia * identifiers: Set member x.QualifiedName = (let (ParsedImplFileInput(qualifiedNameOfFile = qualNameOfFile)) = x in qualNameOfFile) - member x.ScopedPragmas = - (let (ParsedImplFileInput(scopedPragmas = scopedPragmas)) = x in scopedPragmas) - member x.HashDirectives = (let (ParsedImplFileInput(hashDirectives = hashDirectives)) = x in hashDirectives) @@ -1812,18 +1805,14 @@ type ParsedSigFileInput = | ParsedSigFileInput of fileName: string * qualifiedNameOfFile: QualifiedNameOfFile * - scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * contents: SynModuleOrNamespaceSig list * - trivia: ParsedSigFileInputTrivia * + trivia: ParsedInputTrivia * identifiers: Set member x.QualifiedName = (let (ParsedSigFileInput(qualifiedNameOfFile = qualNameOfFile)) = x in qualNameOfFile) - member x.ScopedPragmas = - (let (ParsedSigFileInput(scopedPragmas = scopedPragmas)) = x in scopedPragmas) - member x.HashDirectives = (let (ParsedSigFileInput(hashDirectives = hashDirectives)) = x in hashDirectives) @@ -1844,11 +1833,6 @@ type ParsedInput = | ParsedInput.ImplFile file -> file.FileName | ParsedInput.SigFile file -> file.FileName - member inp.ScopedPragmas = - match inp with - | ParsedInput.ImplFile file -> file.ScopedPragmas - | ParsedInput.SigFile file -> file.ScopedPragmas - member inp.QualifiedName = match inp with | ParsedInput.ImplFile file -> file.QualifiedName diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index f50adfa289d..30ecc56c166 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1933,12 +1933,6 @@ type ParsedImplFile = [] type ParsedSigFile = ParsedSigFile of hashDirectives: ParsedHashDirective list * fragments: ParsedSigFileFragment list -/// Represents a scoped pragma -[] -type ScopedPragma = - /// A pragma to turn a warning off - | WarningOff of range: range * warningNumber: int - /// Represents a qualifying name for anonymous module specifications and implementations, [] type QualifiedNameOfFile = @@ -1960,11 +1954,10 @@ type ParsedImplFileInput = fileName: string * isScript: bool * qualifiedNameOfFile: QualifiedNameOfFile * - scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * contents: SynModuleOrNamespace list * flags: (bool * bool) * - trivia: ParsedImplFileInputTrivia * + trivia: ParsedInputTrivia * identifiers: Set member FileName: string @@ -1973,13 +1966,11 @@ type ParsedImplFileInput = member QualifiedName: QualifiedNameOfFile - member ScopedPragmas: ScopedPragma list - member HashDirectives: ParsedHashDirective list member Contents: SynModuleOrNamespace list - member Trivia: ParsedImplFileInputTrivia + member Trivia: ParsedInputTrivia member IsLastCompiland: bool @@ -1991,23 +1982,20 @@ type ParsedSigFileInput = | ParsedSigFileInput of fileName: string * qualifiedNameOfFile: QualifiedNameOfFile * - scopedPragmas: ScopedPragma list * hashDirectives: ParsedHashDirective list * contents: SynModuleOrNamespaceSig list * - trivia: ParsedSigFileInputTrivia * + trivia: ParsedInputTrivia * identifiers: Set member FileName: string member QualifiedName: QualifiedNameOfFile - member ScopedPragmas: ScopedPragma list - member HashDirectives: ParsedHashDirective list member Contents: SynModuleOrNamespaceSig list - member Trivia: ParsedSigFileInputTrivia + member Trivia: ParsedInputTrivia /// Represents the syntax tree for a parsed implementation or signature file [] @@ -2027,8 +2015,5 @@ type ParsedInput = /// Gets the qualified name used to help match signature and implementation files member QualifiedName: QualifiedNameOfFile - /// Gets the #nowarn and other scoped pragmas - member ScopedPragmas: ScopedPragma list - /// Gets a set of all identifiers used in this parsed input. Only populated if captureIdentifiersWhenParsing option was used. member Identifiers: Set diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 2cd42701e70..2137ffe4275 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -22,24 +22,30 @@ and [] IfDirectiveExpression = | Not of IfDirectiveExpression | Ident of string +[] +type WarnDirectiveTrivia = + | Nowarn of warnNumbers: int list * range + | Warnon of warnNumbers: int list * range + [] type CommentTrivia = | LineComment of range: range | BlockComment of range: range [] -type ParsedImplFileInputTrivia = +type ParsedInputTrivia = { ConditionalDirectives: ConditionalDirectiveTrivia list + WarnDirectives: WarnDirectiveTrivia list CodeComments: CommentTrivia list } -[] -type ParsedSigFileInputTrivia = - { - ConditionalDirectives: ConditionalDirectiveTrivia list - CodeComments: CommentTrivia list - } + static member Empty = + { + ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] + } [] type SynExprTryWithTrivia = diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index ab6525bc010..9d4e50ce1f4 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -34,33 +34,32 @@ type IfDirectiveExpression = | Not of IfDirectiveExpression | Ident of string +[] +type WarnDirectiveTrivia = + | Nowarn of warnNumbers: int list * range + | Warnon of warnNumbers: int list * range + [] type CommentTrivia = | LineComment of range: range | BlockComment of range: range -/// Represents additional information for ParsedImplFileInput +/// Represents additional information for ParsedInput [] -type ParsedImplFileInputTrivia = +type ParsedInputTrivia = { /// Preprocessor directives of type #if, #else or #endif ConditionalDirectives: ConditionalDirectiveTrivia list - /// Represent code comments found in the source file - CodeComments: CommentTrivia list - } - -/// Represents additional information for ParsedSigFileInputTrivia -[] -type ParsedSigFileInputTrivia = - { - /// Preprocessor directives of type #if, #else or #endif - ConditionalDirectives: ConditionalDirectiveTrivia list + /// Warn directives (#nowarn / #warnon) + WarnDirectives: WarnDirectiveTrivia list /// Represent code comments found in the source file CodeComments: CommentTrivia list } + static member internal Empty: ParsedInputTrivia + /// Represents additional information for SynExpr.TryWith [] type SynExprTryWithTrivia = diff --git a/src/Compiler/SyntaxTree/UnicodeLexing.fs b/src/Compiler/SyntaxTree/UnicodeLexing.fs index abb3d0e3d83..4ea41cbcf84 100644 --- a/src/Compiler/SyntaxTree/UnicodeLexing.fs +++ b/src/Compiler/SyntaxTree/UnicodeLexing.fs @@ -8,6 +8,21 @@ open Internal.Utilities.Text.Lexing type Lexbuf = LexBuffer +type LexBuffer<'char> with + + member lexbuf.GetLocalData<'T when 'T: not null>(key: string, initializer) = + match lexbuf.BufferLocalStore.TryGetValue key with + | true, data -> data :?> 'T + | _ -> + let data = initializer () + lexbuf.BufferLocalStore[key] <- data + data + + member lexbuf.TryGetLocalData<'T when 'T: not null>(key: string) = + match lexbuf.BufferLocalStore.TryGetValue key with + | true, data -> Some(data :?> 'T) + | _ -> None + let StringAsLexbuf (reportLibraryOnlyFeatures, langVersion, strictIndentation, s: string) = LexBuffer.FromChars(reportLibraryOnlyFeatures, langVersion, strictIndentation, s.ToCharArray()) diff --git a/src/Compiler/SyntaxTree/UnicodeLexing.fsi b/src/Compiler/SyntaxTree/UnicodeLexing.fsi index 80d772e03e1..ee722ee08c3 100644 --- a/src/Compiler/SyntaxTree/UnicodeLexing.fsi +++ b/src/Compiler/SyntaxTree/UnicodeLexing.fsi @@ -9,6 +9,10 @@ open Internal.Utilities.Text.Lexing type Lexbuf = LexBuffer +type LexBuffer<'char> with + member GetLocalData<'T when 'T: not null> : key: string * initializer: (unit -> 'T) -> 'T + member TryGetLocalData<'T when 'T: not null> : key: string -> 'T option + val StringAsLexbuf: reportLibraryOnlyFeatures: bool * langVersion: LanguageVersion * strictIndentation: bool option * string -> Lexbuf diff --git a/src/Compiler/SyntaxTree/WarnScopes.fs b/src/Compiler/SyntaxTree/WarnScopes.fs new file mode 100644 index 00000000000..2efab44f5de --- /dev/null +++ b/src/Compiler/SyntaxTree/WarnScopes.fs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler + +open FSharp.Compiler.Diagnostics +open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features +open FSharp.Compiler.SyntaxTrivia +open FSharp.Compiler.Text +open FSharp.Compiler.Text.Position +open FSharp.Compiler.Text.Range +open FSharp.Compiler.UnicodeLexing +open Internal.Utilities.Library +open System.Text.RegularExpressions + +[] +module internal WarnScopes = + + // ************************************* + // Temporary storage (during lexing one file) for warn scope related data + // ************************************* + + type private FileIndex = int + type private WarningNumber = int + type private LineNumber = int + + [] + type private WarnCmd = + | Nowarn of WarningNumber * range + | Warnon of WarningNumber * range + + member w.WarningNumber = + match w with + | Nowarn(n, _) + | Warnon(n, _) -> n + + type private WarnDirective = + { + DirectiveRange: range + CommentRange: range option + WarnCmds: WarnCmd list + } + + let private isWarnonDirective (w: WarnDirective) = + match w.WarnCmds with + | [] -> false + | h :: _ -> h.IsWarnon + + type private LineDirective = + { + SurrogateFileIndex: FileIndex + SurrogateLine: LineNumber + OriginalLine: LineNumber + } + + type private LexbufData = + { + OriginalFileIndex: int + mutable WarnDirectives: WarnDirective list + mutable LineDirectives: LineDirective list + } + + let private initialData (lexbuf: Lexbuf) = + { + OriginalFileIndex = lexbuf.StartPos.FileIndex + WarnDirectives = [] + LineDirectives = [] + } + + let private getLexbufData (lexbuf: Lexbuf) = + lexbuf.GetLocalData("WarnScopeData", (fun () -> initialData lexbuf)) + + // ************************************* + // Collect the line directives during lexing + // ************************************* + + let RegisterLineDirective (lexbuf, fileIndex, line: int) = //TODO: send OriginalLine i.o. lexbuf + let data = getLexbufData lexbuf + + let lineDirective = + { + SurrogateFileIndex = fileIndex + SurrogateLine = line + OriginalLine = lexbuf.StartPos.OriginalLine + 1 + } + + data.LineDirectives <- lineDirective :: data.LineDirectives + + // ************************************* + // Collect the warn scopes during lexing + // ************************************* + + let private getNumber (langVersion: LanguageVersion) m (ns: string) = + let argFeature = LanguageFeature.ParsedHashDirectiveArgumentNonQuotes + + let removeQuotes (s: string) = + if s.StartsWithOrdinal "\"" && s.EndsWithOrdinal "\"" then + if s.StartsWithOrdinal "\"\"\"" && s.EndsWithOrdinal "\"\"\"" then + Some(s.Substring(3, s.Length - 6)) + else + Some(s.Substring(1, s.Length - 2)) + elif tryCheckLanguageFeatureAndRecover langVersion argFeature m then + Some s + else + None + + let removePrefix (s: string) = + match s.StartsWithOrdinal "FS", langVersion.SupportsFeature argFeature with + | true, true -> Some(s.Substring 2, s) + | true, false -> + warning (Error(FSComp.SR.buildInvalidWarningNumber s, m)) + None + | false, _ -> Some(s, s) + + let parseInt (intString: string, argString) = + match System.Int32.TryParse intString with + | true, i -> Some i + | false, _ -> + if langVersion.SupportsFeature LanguageFeature.ScopedNowarn then + errorR (Error(FSComp.SR.buildInvalidWarningNumber argString, m)) + elif langVersion.SupportsFeature argFeature then + warning (Error(FSComp.SR.buildInvalidWarningNumber argString, m)) + + None + + ns |> removeQuotes |> Option.bind removePrefix |> Option.bind parseInt + + let private regex = + // This regex is matching the following lexer pattern that brought us here: + // anywhite* ("#nowarn" | "#warnon") anystring newline + // while extracting from "anystring" the directive arguments and the comment. + // A directive argument is any group of characters that is not a space, a newline, a slash or a semicolon. + // Both the presence and syntactic correctness of the directive arguments are checked later. + // For compatibility reasons, the arguments are allowed to be followed by a double semicolon. + // The comment is optional and starts with "//". + // The "(?: ...)?" is just a way to make the arguments optional while not interfering with the capturing. + // Matching a directive with this regex creates 5 groups (next to the full match): + // 1. The leading whitespace. + // 2. The directive identifier ("nowarn" or "warnon", possibly followed by additional characters). + // 3. The directive arguments (if any), with each argument in a separate capture. + // 4. The trailing whitespace. + // 5. The comment (if any). + + Regex("""( *)#(\S+)(?: +([^ \r\n/;]+))*(?:;;)?( *)(\/\/.*)?$""", RegexOptions.CultureInvariant) + + let private parseDirective originalFileIndex lexbuf = + let text = Lexbuf.LexemeString lexbuf + let startPos = lexbuf.StartPos + + let mGroups = (regex.Match text).Groups + let dIdentGroup = mGroups[2] + let dIdent = dIdentGroup.Value + let argsGroup = mGroups[3] + let argCaptures = [ for c in argsGroup.Captures -> c ] + let commentGroup = mGroups[5] + + let positions line offset length = + mkPos line (startPos.Column + offset), mkPos line (startPos.Column + offset + length) + // "normal" ranges (i.e. taking #line directives into account), for errors in the warn directive + let mkRange offset length = + positions lexbuf.StartPos.Line offset length + ||> mkFileIndexRange startPos.FileIndex + // "original" ranges, for the warn scopes + let mkOriginalRange offset length = + positions lexbuf.StartPos.OriginalLine offset length + ||> mkFileIndexRange originalFileIndex + + let directiveLength = + if argsGroup.Success then + argsGroup.Index - (dIdentGroup.Index - 1) + argsGroup.Length + else + dIdentGroup.Length + 1 + + let directiveRange = mkRange (dIdentGroup.Index - 1) directiveLength + + let commentRange = + if commentGroup.Success then + Some(mkRange commentGroup.Index commentGroup.Length) + else + None + + if argCaptures.IsEmpty then + errorR (Error(FSComp.SR.lexWarnDirectiveMustHaveArgs (), directiveRange)) + + let mkDirective ctor (c: Capture) = + getNumber lexbuf.LanguageVersion (mkRange c.Index c.Length) c.Value + |> Option.map (fun n -> ctor (n, mkOriginalRange c.Index c.Length)) + + let warnCmds = + match dIdent with + | "warnon" -> argCaptures |> List.choose (mkDirective WarnCmd.Warnon) + | "nowarn" -> argCaptures |> List.choose (mkDirective WarnCmd.Nowarn) + | _ -> + errorR (Error(FSComp.SR.fsiInvalidDirective ($"#{dIdent}", ""), directiveRange)) + [] + + { + DirectiveRange = directiveRange + CommentRange = commentRange + WarnCmds = warnCmds + } + + let ParseAndRegisterWarnDirective (lexbuf: Lexbuf) = + let data = getLexbufData lexbuf + let warnDirective = parseDirective data.OriginalFileIndex lexbuf + data.WarnDirectives <- warnDirective :: data.WarnDirectives + + // ************************************* + // After lexing, the (processed) warn scope data are kept in diagnosticOptions + // ************************************* + + [] + type private WarnScope = + | Off of range + | On of range + | OpenOff of range + | OpenOn of range + + /// Information about the mapping implied by the #line directives. + /// The Map key is the file index of the surrogate source (the source file pointed to by the line directive). + /// The Map value contains the file index of the original source (the one just being parsed) and + /// a list of mapped sections (surrogate and original start lines). + type private LineMaps = Map + + type private WarnScopeData = + { + ScopedNowarnFeatureIsSupported: bool + ScriptNowarns: WarningNumber list // only needed to avoid breaking changes for previous language versions + WarnScopes: Map> + LineMaps: LineMaps + } + + let private getWarnScopeData (diagnosticOptions: FSharpDiagnosticOptions) = + match diagnosticOptions.WarnScopeData with + | None -> + { + ScopedNowarnFeatureIsSupported = true + ScriptNowarns = [] + WarnScopes = Map.empty + LineMaps = Map.empty + } + | Some data -> data :?> WarnScopeData + + let private setWarnScopeData (diagnosticOptions: FSharpDiagnosticOptions) data = + diagnosticOptions.WarnScopeData <- Some data + + // ************************************* + // Create the warn scopes from the directives and store them in diagnosticOptions. + // ************************************* + + let MergeInto diagnosticOptions isScript subModuleRanges lexbuf = + let lexbufData = getLexbufData lexbuf + let fileIndex = lexbufData.OriginalFileIndex + + let scopedNowarnFeatureIsSupported = + lexbuf.LanguageVersion.SupportsFeature LanguageFeature.ScopedNowarn + + let fileWarnCmds, fileScriptNowarns = + let warnDirectives = lexbufData.WarnDirectives |> List.rev + + if scopedNowarnFeatureIsSupported then + List.collect _.WarnCmds warnDirectives, [] + else + let isInSubmodule (warnDirective: WarnDirective) = + List.exists (fun mRange -> rangeContainsRange mRange warnDirective.DirectiveRange) subModuleRanges + + let subModuleWarnDirectives, topLevelWarnDirectives = + List.partition isInSubmodule warnDirectives + + // Warn about and ignore directives in submodules + subModuleWarnDirectives + |> List.iter (fun wd -> warning (Error(FSComp.SR.buildDirectivesInModulesAreIgnored (), wd.DirectiveRange))) + + let topLevelWarnonDirectives, topLevelNowarnDirectives = + List.partition isWarnonDirective topLevelWarnDirectives + + // "feature not available in this language version" error for top-level #nowarn + topLevelWarnonDirectives + |> List.iter (fun wd -> errorR (languageFeatureError lexbuf.LanguageVersion LanguageFeature.ScopedNowarn wd.DirectiveRange)) + + let nowarnCmds = List.collect _.WarnCmds topLevelNowarnDirectives + + nowarnCmds, + if isScript then + nowarnCmds |> List.map _.WarningNumber + else + [] + + let processWarnCmd warnScopeMap warnCmd = + let getScopes warningNumber warnScopes = + Map.tryFind warningNumber warnScopes |> Option.defaultValue [] + + let mkScope (m1: range) (m2: range) = + mkFileIndexRange m1.FileIndex m1.Start m2.End + + match warnCmd with + | WarnCmd.Nowarn(n, m) -> + match getScopes n warnScopeMap with + | WarnScope.OpenOn m' :: t -> warnScopeMap.Add(n, WarnScope.On(mkScope m' m) :: t) + | WarnScope.OpenOff m' :: _ + | WarnScope.On m' :: _ -> + if scopedNowarnFeatureIsSupported then + informationalWarning (Error(FSComp.SR.lexWarnDirectivesMustMatch ("#nowarn", m'.StartLine), m)) + + warnScopeMap + | scopes -> warnScopeMap.Add(n, WarnScope.OpenOff(mkScope m m) :: scopes) + | WarnCmd.Warnon(n, m) -> + match getScopes n warnScopeMap with + | WarnScope.OpenOff m' :: t -> warnScopeMap.Add(n, WarnScope.Off(mkScope m' m) :: t) + | WarnScope.OpenOn m' :: _ + | WarnScope.Off m' :: _ -> + warning (Error(FSComp.SR.lexWarnDirectivesMustMatch ("#warnon", m'.EndLine), m)) + warnScopeMap + | scopes -> warnScopeMap.Add(n, WarnScope.OpenOn(mkScope m m) :: scopes) + + let fileWarnScopes = fileWarnCmds |> List.fold processWarnCmd Map.empty + + let fileLineMaps: LineMaps = + let sortedSectionMaps = + List.map (fun ld -> ld.SurrogateLine, ld.OriginalLine) >> List.sortBy fst + + lexbufData.LineDirectives + |> List.groupBy _.SurrogateFileIndex + |> List.map (fun (surrIdx, lineDirectives) -> surrIdx, (fileIndex, sortedSectionMaps lineDirectives)) + |> Map + + let merge () = + let projectData = getWarnScopeData diagnosticOptions + + // If the same file is parsed again (same fileIndex), we replace the warn scopes. + let projectWarnScopes = projectData.WarnScopes.Add(fileIndex, fileWarnScopes) + + // If the same surrogate file has entries already (from another parse), we replace the line maps. + // However, if it was referred to from a different original file before, we issue a warning. + // (Because it means the maps are not reliable.) + let projectLineMaps = + let checkAndAdd previousLinemaps surrIdx (newOrigIdx, linePairList as newLinemaps) = + match Map.tryFind surrIdx previousLinemaps with + | Some(origIdx, _) when origIdx <> newOrigIdx -> + let _, origLine = List.head linePairList + let m = mkFileIndexRange origIdx (mkPos origLine 0) (mkPos origLine 4) + + let getName idx = + FileIndex.fileOfFileIndex idx |> System.IO.Path.GetFileName |> string + + warning (Error(FSComp.SR.lexLineDirectiveMappingIsNotUnique (getName surrIdx, getName origIdx), m)) + | _ -> () + + Map.add surrIdx newLinemaps previousLinemaps + + Map.fold checkAndAdd projectData.LineMaps fileLineMaps + + let newWarnScopeData = + { + ScopedNowarnFeatureIsSupported = scopedNowarnFeatureIsSupported + ScriptNowarns = List.distinct (projectData.ScriptNowarns @ fileScriptNowarns) + WarnScopes = projectWarnScopes + LineMaps = projectLineMaps + } + + setWarnScopeData diagnosticOptions newWarnScopeData + + lock diagnosticOptions merge + + let getDirectiveTrivia (lexbuf: Lexbuf) = + let mkTrivia d = + if isWarnonDirective d then + WarnDirectiveTrivia.Warnon(d.WarnCmds |> List.map _.WarningNumber, d.DirectiveRange) + else + WarnDirectiveTrivia.Nowarn(d.WarnCmds |> List.map _.WarningNumber, d.DirectiveRange) + + (getLexbufData lexbuf).WarnDirectives |> List.rev |> List.map mkTrivia + + let getCommentTrivia (lexbuf: Lexbuf) = + (getLexbufData lexbuf).WarnDirectives + |> List.rev + |> List.choose _.CommentRange + |> List.map CommentTrivia.LineComment + + // ************************************* + // Apply the warn scopes after lexing + // ************************************* + + let private getScopes fileIndex warningNumber warnScopes = + Map.tryFind fileIndex warnScopes + |> Option.bind (Map.tryFind warningNumber) + |> Option.defaultValue [] + + let private originalRange lineMaps (m: range) = + match Map.tryFind m.FileIndex lineMaps with + | None -> m + | Some(origFileIndex, sectionMaps) -> + let surrLine, origLine = + if List.isEmpty sectionMaps || m.StartLine < fst sectionMaps.Head then + (1, 1) + else + sectionMaps |> List.skipWhile (fun (s, _) -> m.StartLine < s) |> List.head + + let origStart = mkPos (m.StartLine + origLine - surrLine) m.StartColumn + let origEnd = mkPos (m.EndLine + origLine - surrLine) m.EndColumn + mkFileIndexRange origFileIndex origStart origEnd + + // true if m1 contains the *start* of m2 + // i.e. if the error range encloses the closing warn directive, we still say it is in scope + let private contains (m2: range) (m1: range) = + m2.StartLine > m1.StartLine && m2.StartLine < m1.EndLine + + let private isEnclosingWarnonScope m scope = + match scope with + | WarnScope.On wm when contains m wm -> true + | WarnScope.OpenOn wm when m.StartLine > wm.StartLine -> true + | _ -> false + + let private isEnclosingNowarnScope m scope = + match scope with + | WarnScope.Off wm when contains m wm -> true + | WarnScope.OpenOff wm when m.StartLine > wm.StartLine -> true + | _ -> false + + let IsWarnon (diagnosticOptions: FSharpDiagnosticOptions) warningNumber (mo: range option) = + let data = getWarnScopeData diagnosticOptions + + match mo, data.ScopedNowarnFeatureIsSupported with + | Some m, true -> + let mOrig = originalRange data.LineMaps m + let scopes = getScopes mOrig.FileIndex warningNumber data.WarnScopes + List.exists (isEnclosingWarnonScope mOrig) scopes + | _ -> false + + let IsNowarn (diagnosticOptions: FSharpDiagnosticOptions) warningNumber (mo: range option) = + let data = getWarnScopeData diagnosticOptions + + if List.contains warningNumber data.ScriptNowarns then // this happens only for legacy language versions + true + else + match mo with + | Some m -> + let mOrig = originalRange data.LineMaps m + let scopes = getScopes mOrig.FileIndex warningNumber data.WarnScopes + List.exists (isEnclosingNowarnScope mOrig) scopes + | None -> false diff --git a/src/Compiler/SyntaxTree/WarnScopes.fsi b/src/Compiler/SyntaxTree/WarnScopes.fsi new file mode 100644 index 00000000000..1cdecc76149 --- /dev/null +++ b/src/Compiler/SyntaxTree/WarnScopes.fsi @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler + +open FSharp.Compiler.Diagnostics +open FSharp.Compiler.SyntaxTrivia +open FSharp.Compiler.Text +open FSharp.Compiler.UnicodeLexing + +module internal WarnScopes = + + /// To be called during lexing to register the line directives for warn scope processing. + val internal RegisterLineDirective: lexbuf: Lexbuf * fileIndex: int * line: int -> unit + + /// To be called during lexing to save #nowarn / #warnon directives. + val ParseAndRegisterWarnDirective: lexbuf: Lexbuf -> unit + + /// To be called after lexing a file to create warn scopes from the stored line and + /// warn directives and to add them to the warn scopes from other files in the diagnostics options. + /// Note that isScript and subModuleRanges are needed only to avoid breaking changes for previous language versions. + val MergeInto: FSharpDiagnosticOptions -> isScript: bool -> subModuleRanges: range list -> Lexbuf -> unit + + /// Get the collected ranges of the warn directives + val getDirectiveTrivia: Lexbuf -> WarnDirectiveTrivia list + + /// Get the ranges of comments after warn directives + val getCommentTrivia: Lexbuf -> CommentTrivia list + + /// Check if the range is inside a "warnon" scope for the given warning number. + val IsWarnon: FSharpDiagnosticOptions -> warningNumber: int -> mo: range option -> bool + + /// Check if the range is inside a "nowarn" scope for the given warning number. + val IsNowarn: FSharpDiagnosticOptions -> warningNumber: int -> mo: range option -> bool diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 817730ec6ea..47815bed680 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -5609,7 +5609,6 @@ type NamedDebugPointKey = type CheckedImplFile = | CheckedImplFile of qualifiedNameOfFile: QualifiedNameOfFile * - pragmas: ScopedPragma list * signature: ModuleOrNamespaceType * contents: ModuleOrNamespaceContents * hasExplicitEntryPoint: bool * @@ -5623,8 +5622,6 @@ type CheckedImplFile = member x.QualifiedNameOfFile = let (CheckedImplFile (qualifiedNameOfFile=res)) = x in res - member x.Pragmas = let (CheckedImplFile (pragmas=res)) = x in res - member x.HasExplicitEntryPoint = let (CheckedImplFile (hasExplicitEntryPoint=res)) = x in res member x.IsScript = let (CheckedImplFile (isScript=res)) = x in res diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 28ef5776e5a..d9216efbe5e 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -4059,7 +4059,6 @@ type NamedDebugPointKey = type CheckedImplFile = | CheckedImplFile of qualifiedNameOfFile: Syntax.QualifiedNameOfFile * - pragmas: Syntax.ScopedPragma list * signature: ModuleOrNamespaceType * contents: ModuleOrNamespaceContents * hasExplicitEntryPoint: bool * @@ -4078,8 +4077,6 @@ type CheckedImplFile = member IsScript: bool - member Pragmas: Syntax.ScopedPragma list - member QualifiedNameOfFile: Syntax.QualifiedNameOfFile member Signature: ModuleOrNamespaceType diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 4b41db72349..a1258657e78 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -6495,10 +6495,10 @@ and remapAndRenameModBind ctxt compgen tmenv x = ModuleOrNamespaceBinding.Module(mspec, def) and remapImplFile ctxt compgen tmenv implFile = - let (CheckedImplFile (fragName, pragmas, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile + let (CheckedImplFile (fragName, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile let contentsR = copyAndRemapModDef ctxt compgen tmenv contents let signatureR, tmenv = copyAndRemapAndBindModTy ctxt compgen tmenv signature - let implFileR = CheckedImplFile (fragName, pragmas, signatureR, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) + let implFileR = CheckedImplFile (fragName, signatureR, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) implFileR, tmenv // Entry points @@ -9868,9 +9868,9 @@ and rewriteModuleOrNamespaceBindings env mbinds = List.map (rewriteModuleOrNamespaceBinding env) mbinds and RewriteImplFile env implFile = - let (CheckedImplFile (fragName, pragmas, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile + let (CheckedImplFile (fragName, signature, contents, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode)) = implFile let contentsR = rewriteModuleOrNamespaceContents env contents - let implFileR = CheckedImplFile (fragName, pragmas, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) + let implFileR = CheckedImplFile (fragName, signature, contentsR, hasExplicitEntryPoint, isScript, anonRecdTypes, namedDebugPointsForInlinedCode) implFileR //-------------------------------------------------------------------------- diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index 34bfe4bfe17..2d52ec029f7 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -817,7 +817,9 @@ rule token (args: LexArgs) (skip: bool) = parse // Construct the new position if args.applyLineDirectives then - lexbuf.EndPos <- pos.ApplyLineDirective((match file with Some f -> FileIndex.fileIndexOfFile f | None -> pos.FileIndex), line) + let fileIndex = match file with Some f -> FileIndex.fileIndexOfFile f | None -> pos.FileIndex + WarnScopes.RegisterLineDirective(lexbuf, fileIndex, line) + lexbuf.EndPos <- pos.ApplyLineDirective(fileIndex, line) else // add a newline when we don't apply a directive since we consumed a newline getting here incrLine lexbuf @@ -1080,6 +1082,13 @@ rule token (args: LexArgs) (skip: bool) = parse lexbuf.StartPos <- lexbuf.StartPos.ShiftColumnBy(n) HASH_IDENT(lexemeTrimLeft lexbuf (n+1)) } + | anywhite* ("#nowarn" | "#warnon") anystring + { let m = lexbuf.LexemeRange + shouldStartLine args lexbuf m (FSComp.SR.lexWarnDirectiveMustBeFirst()) + WarnScopes.ParseAndRegisterWarnDirective lexbuf + let tok = WARN_DIRECTIVE(m, lexeme lexbuf, LexCont.EndLine(args.ifdefStack, args.stringNest, LexerEndlineContinuation.Token)) + if skip then endline LexerEndlineContinuation.Token args skip lexbuf else tok } + | surrogateChar surrogateChar | _ diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index e5e0bca6a29..7326c4a6a12 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -152,7 +152,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) -> /* These are artificial */ %token LEX_FAILURE %token COMMENT WHITESPACE HASH_LINE HASH_LIGHT INACTIVECODE LINE_COMMENT STRING_TEXT EOF -%token HASH_IF HASH_ELSE HASH_ENDIF +%token HASH_IF HASH_ELSE HASH_ENDIF WARN_DIRECTIVE %start signatureFile implementationFile interaction typedSequentialExprEOF typEOF %type typedSequentialExprEOF @@ -474,7 +474,7 @@ interactiveSeparator: | OBLOCKSEP { } /*--------------------------------------------------------------------------*/ -/* #directives - used by both F# Interactive directives and #nowarn etc. */ +/* #directives - used by F# Interactive directives */ /* A #directive in a module, namespace or an interaction */ diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index adb2b01d334..de5b2815fdc 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -597,6 +597,11 @@ Sdílení podkladových polí v rozlišeném sjednocení [<Struct>] za předpokladu, že mají stejný název a typ + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints omezení vlastního typu @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Znak }} musí být v interpolovaném řetězci uvozený (zdvojeným znakem). @@ -867,6 +877,21 @@ Interpolovaný řetězec obsahuje nespárované složené závorky. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Všechny prvky seznamu musí být implicitně převoditelné na typ prvního prvku, což je řazená kolekce členů o délce {0} typu\n {1} \nTento element je řazená kolekce členů o délce {2} typu\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 7deaf880012..53bf24ff3e9 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -597,6 +597,11 @@ Teilen sie zugrunde liegende Felder in einen [<Struct>]-diskriminierten Union, solange sie denselben Namen und Typ aufweisen. + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints Selbsttypeinschränkungen @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Ein }}-Zeichen muss in einer interpolierten Zeichenfolge (durch Verdoppeln) mit Escapezeichen versehen werden. @@ -867,6 +877,21 @@ Die interpolierte Zeichenfolge enthält schließende geschweifte Klammern ohne Entsprechung. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Alle Elemente einer Liste müssen implizit in den Typ des ersten Elements konvertiert werden. Hierbei handelt es sich um ein Tupel der Länge {0} vom Typ\n {1} \nDieses Element ist ein Tupel der Länge {2} vom Typ\n {3}. \n diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index e8090e5579e..483e820ed5c 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -597,6 +597,11 @@ Compartir campos subyacentes en una unión discriminada [<Struct>] siempre y cuando tengan el mismo nombre y tipo + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints restricciones de tipo propio @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. El carácter "}}" se debe escapar (duplicándose) en las cadenas interpoladas. @@ -867,6 +877,21 @@ La cadena interpolada contiene llaves de cierre no coincidentes. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Todos los elementos de una lista deben convertirse implícitamente en el tipo del primer elemento, que aquí es una tupla de longitud {0} de tipo\n {1} \nEste elemento es una tupla de longitud {2} de tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 25faaecb3a4..f003166db2d 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -597,6 +597,11 @@ Partager les champs sous-jacents dans une union discriminée [<Struct>] tant qu’ils ont le même nom et le même type + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints contraintes d’auto-type @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Un caractère '}}' doit faire l'objet d'une séquence d'échappement (par doublement) dans une chaîne interpolée. @@ -867,6 +877,21 @@ La chaîne interpolée contient des accolades fermantes sans correspondance. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Tous les éléments d’une liste doivent être implicitement convertibles en type du premier élément, qui est ici un tuple de longueur {0} de type\n {1} \nCet élément est un tuple de longueur {2} de type\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 30d68a3330b..e4c08f83cb2 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -597,6 +597,11 @@ Condividi i campi sottostanti in un'unione discriminata di [<Struct>] purché abbiano lo stesso nome e tipo + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints vincoli di tipo automatico @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. In una stringa interpolata è necessario specificare il carattere di escape di un carattere '}}' raddoppiandolo. @@ -867,6 +877,21 @@ La stringa interpolata contiene parentesi graffe di chiusura non corrispondenti. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Tutti gli elementi di un elenco devono essere convertibili in modo implicito nel tipo del primo elemento, che qui è una tupla di lunghezza {0} di tipo\n {1} \nQuesto elemento è una tupla di lunghezza {2} di tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 9f2709fa559..7d56499a955 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -597,6 +597,11 @@ 名前と型が同じである限り、[<Struct>] 判別可能な共用体で基になるフィールドを共有する + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints 自己型制約 @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. 文字 '}}' は、補間された文字列内で (二重にすることで) エスケープする必要があります。 @@ -867,6 +877,21 @@ 補間された文字列には、一致しない閉じかっこが含まれています。 + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n リストのすべての要素は、最初の要素の型に暗黙的に変換できる必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの要素は、型の長さ {2} のタプルです\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 2c80d361ef6..887f0f199f1 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -597,6 +597,11 @@ 이름과 형식이 같으면 [<Struct>] 구분된 공용 구조체에서 기본 필드 공유 + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints 자체 형식 제약 조건 @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. '}}' 문자는 보간된 문자열에서 이중으로 사용하여 이스케이프해야 합니다. @@ -867,6 +877,21 @@ 보간된 문자열에 일치하지 않는 닫는 중괄호가 포함되어 있습니다. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n 목록의 모든 요소는 첫 번째 요소의 형식으로 암시적으로 변환할 수 있어야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 요소는 형식이 \n {3}이고 길이가 {2}인 튜플입니다. \n diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 0bd80d75a72..589e0f8535e 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -597,6 +597,11 @@ Udostępnij pola źródłowe w unii rozłącznej [<Struct>], o ile mają taką samą nazwę i ten sam typ + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints ograniczenia typu własnego @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. W przypadku znaku „}}” należy zastosować ucieczkę (przez wpisanie dwóch takich znaków) w ciągu interpolowanym. @@ -867,6 +877,21 @@ Ciąg interpolowany zawiera niedopasowane zamykające nawiasy klamrowe. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Wszystkie elementy tablicy muszą być niejawnie konwertowalne na typ pierwszego elementu, który w tym miejscu jest krotką o długości {0} typu\n {1} \nTen element jest krotką o długości {2} typu\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index c0e79885fed..5af5b7fcd34 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -597,6 +597,11 @@ Compartilhar campos subjacentes em uma união discriminada [<Struct>], desde que tenham o mesmo nome e tipo + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints restrições de auto-tipo @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Um caractere ''}}' precisa ser de escape (ao duplicar) em uma cadeia de caracteres interpolada. @@ -867,6 +877,21 @@ A cadeia de caracteres interpolada contém chaves de fechamento sem correspondência. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Todos os elementos de uma lista devem ser implicitamente conversíveis ao tipo do primeiro elemento, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEste elemento é uma tupla de comprimento {2} do tipo\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 3a4610e93df..e8747be3f5c 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -597,6 +597,11 @@ Совместное использование базовых полей в дискриминируемом объединении [<Struct>], если они имеют одинаковое имя и тип. + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints ограничения самостоятельного типа @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Символ "}}" необходимо экранировать (путем дублирования) в интерполированной строке. @@ -867,6 +877,21 @@ Интерполированная строка содержит непарные закрывающие фигурные скобки. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Все элементы списка должны поддерживать неявное преобразование в тип первого элемента, который здесь является кортежем длиной {0} типа\n {1} \nЭтот элемент является кортежем длиной {2} типа\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 6d1bee2476b..a2d6e89305c 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -597,6 +597,11 @@ Aynı ada ve türe sahip oldukları sürece temel alınan alanları [<Struct>] ayırt edici birleşim biçiminde paylaşın + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints kendi kendine tür kısıtlamaları @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. Bir '}}' karakteri, düz metin arasına kod eklenmiş bir dizede kaçış dizisi ile (yineleme yapılarak) belirtilir. @@ -867,6 +877,21 @@ İlişkilendirilmiş dize, eşleşmeyen kapatma küme ayraçları içeriyor. + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n Bir listenin tüm öğeleri örtük olarak ilk öğenin türüne dönüştürülebilir olmalıdır. Burada ilk öğe {0} uzunluğunda türü\n {1} \nolan bir demet. Bu öğe ise {2} uzunluğunda türü\n {3} \nolan bir demet. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index a60e3188af7..fce23f29c9a 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -597,6 +597,11 @@ 只要它们具有相同的名称和类型,即可在 [<Struct>] 中共享基础字段 + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints 自类型约束 @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. 在内插字符串中,必需对 "}}" 字符进行转义(通过加倍)。 @@ -867,6 +877,21 @@ 内插字符串包含不匹配的右大括号。 + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n 列表的所有元素必须可隐式转换为第一个元素的类型,这是一个长度为 {0} 的类型的元组\n {1} \n此元素是长度为 {2} 类型的元组\n {3} \n diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 3253c4e45f7..d2563922fc3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -597,6 +597,11 @@ 只要 [<Struct>] 具有相同名稱和類型,就以強制聯集共用基礎欄位 + + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules + + self type constraints 自我類型限制式 @@ -837,6 +842,11 @@ This is not a valid byte character literal. The value must be less than or equal to '\127'B.\nNote: In a future F# version this warning will be promoted to an error. + + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + The file '{0}' was also pointed to in a line directive in '{1}'. Proper warn directive application may not be possible. + + A '}}' character must be escaped (by doubling) in an interpolated string. 在插補字串中,必須將 '}}' 字元逸出 (重複一次)。 @@ -867,6 +877,21 @@ 差補字串包含不成對的右大括弧。 + + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + #nowarn/#warnon directives must appear as the first non-whitespace characters on a line + + + + Warn directives must have warning number(s) as argument(s) + Warn directives must have warning number(s) as argument(s) + + + + There is another {0} for this warning already in line {1}. + There is another {0} for this warning already in line {1}. + + All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n 清單的所有元素必須以隱含方式轉換成第一個元素的類型,這是類型為\n {1} \n的元組長度 {0}此元素是類型為\n {3} \n的元組長度 {2} diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs index 32f40de89d2..a28132266be 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/NonStringArgs.fs @@ -9,7 +9,7 @@ module NonStringArgs = [] [] [] - let ``#nowarn - errors`` (languageVersion) = + let ``#nowarn - errors - separate`` (languageVersion) = FSharp """ #nowarn "988" @@ -43,42 +43,7 @@ module NonStringArgs = [] [] - [] - let ``#nowarn - errors - collected`` (languageVersion) = - - FSharp """ -#nowarn - "988" - FS - FSBLAH - ACME - "FS" - "FSBLAH" - "ACME" - """ - |> withLangVersion languageVersion - |> asExe - |> compile - |> shouldFail - |> withDiagnostics [ - if languageVersion = "8.0" then - (Error 3350, Line 4, Col 5, Line 4, Col 7, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") - (Error 3350, Line 5, Col 5, Line 5, Col 11, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") - (Error 3350, Line 6, Col 5, Line 6, Col 9, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") - (Warning 203, Line 7, Col 5, Line 7, Col 9, "Invalid warning number 'FS'"); - (Warning 203, Line 8, Col 5, Line 8, Col 13, "Invalid warning number 'FSBLAH'"); - else - (Warning 203, Line 4, Col 5, Line 4, Col 7, "Invalid warning number 'FS'"); - (Warning 203, Line 5, Col 5, Line 5, Col 11, "Invalid warning number 'FSBLAH'"); - (Warning 203, Line 6, Col 5, Line 6, Col 9, "Invalid warning number 'ACME'"); - (Warning 203, Line 7, Col 5, Line 7, Col 9, "Invalid warning number 'FS'"); - (Warning 203, Line 8, Col 5, Line 8, Col 13, "Invalid warning number 'FSBLAH'"); - (Warning 203, Line 9, Col 5, Line 9, Col 11, "Invalid warning number 'ACME'") - ] - - - [] - [] + [] [] let ``#nowarn - errors - inline`` (languageVersion) = @@ -97,18 +62,26 @@ module NonStringArgs = (Error 3350, Line 3, Col 19, Line 3, Col 23, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") (Warning 203, Line 3, Col 24, Line 3, Col 28, "Invalid warning number 'FS'"); (Warning 203, Line 3, Col 29, Line 3, Col 37, "Invalid warning number 'FSBLAH'"); - else + elif languageVersion = "9.0" then (Warning 203, Line 3, Col 9, Line 3, Col 11, "Invalid warning number 'FS'"); (Warning 203, Line 3, Col 12, Line 3, Col 18, "Invalid warning number 'FSBLAH'"); (Warning 203, Line 3, Col 19, Line 3, Col 23, "Invalid warning number 'ACME'"); (Warning 203, Line 3, Col 24, Line 3, Col 28, "Invalid warning number 'FS'"); (Warning 203, Line 3, Col 29, Line 3, Col 37, "Invalid warning number 'FSBLAH'"); (Warning 203, Line 3, Col 38, Line 3, Col 44, "Invalid warning number 'ACME'") + else // preview + (Error 203, Line 3, Col 9, Line 3, Col 11, "Invalid warning number 'FS'"); + (Error 203, Line 3, Col 12, Line 3, Col 18, "Invalid warning number 'FSBLAH'"); + (Error 203, Line 3, Col 19, Line 3, Col 23, "Invalid warning number 'ACME'"); + (Error 203, Line 3, Col 24, Line 3, Col 28, "Invalid warning number 'FS'"); + (Error 203, Line 3, Col 29, Line 3, Col 37, "Invalid warning number 'FSBLAH'"); + (Error 203, Line 3, Col 38, Line 3, Col 44, "Invalid warning number 'ACME'") ] [] [] + [] [] let ``#nowarn - realcode`` (langVersion) = @@ -142,10 +115,10 @@ module DoBinding = compileResult |> shouldFail |> withDiagnostics [ - (Warning 1104, Line 5, Col 15, Line 5, Col 31, "Identifiers containing '@' are reserved for use in F# code generation") (Error 3350, Line 2, Col 9, Line 2, Col 11, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") (Error 3350, Line 2, Col 12, Line 2, Col 18, "Feature '# directives with non-quoted string arguments' is not available in F# 8.0. Please use language version 9.0 or greater.") (Warning 203, Line 2, Col 26, Line 2, Col 34, "Invalid warning number 'FS3221'") + (Warning 1104, Line 5, Col 15, Line 5, Col 31, "Identifiers containing '@' are reserved for use in F# code generation") ] else compileResult diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs new file mode 100644 index 00000000000..dfbb6d3a735 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +namespace CompilerDirectives + +open Xunit +open FSharp.Test.Compiler +open FSharp.Test +open System +open System.Text + +module Nowarn = + + let private nowarn n = $"#nowarn {n}" + let private warnon n = $"#warnon {n}" + let private line1 = """#line 1 "some.fsy" """ + let private line10 = """#line 10 "some.fsy" """ + let private make20 = "1" + let private make25 = "match None with None -> ()" + let private W20 = Warning 20 + let private vp = "PREVIEW" + let private v9 = "9.0" + let private fs = String.concat Environment.NewLine >> FsSource + let private fsMod lines = fs ("module A" :: lines) + let private fsSub lines = fs ("namespace A" :: "module B =" :: (lines |> List.map (fun s -> " " + s))) + let private fsi = String.concat Environment.NewLine >> FsiSource + let private fsx = String.concat Environment.NewLine >> FsxSourceCode + + let private fsiSource44 = [ + "namespace A" + "[]" + "type T = class end" + "type T2 = T" + "#nowarn 44" + "type T3 = T" + "#warnon 44" + "type T4 = T" + "#nowarn 44" + "type T5 = T" + ] + + let private fsSource44 = [ + "namespace A" + "#nowarn 44" + "[]" + "type T = class end" + "type T2 = T" + "type T3 = T" + "type T4 = T" + "type T5 = T" + ] + + let private testData = + [ + vp, [], [fsMod [make20]], [W20, 2] + vp, [], [fsMod [nowarn 20; make20]], [] + vp, [], [fsMod ["#nowarn 20;;"; make20]], [] + vp, [], [fsMod [make20; nowarn 20; make20; warnon 20; make20]], [W20, 2; W20, 6] + v9, [], [fsMod [make20; nowarn 20; make20; warnon 20; make20]], [Error 3350, 5] + vp, [], [fsMod [nowarn 20; line1; make20]], [] + v9, [], [fsMod [nowarn 20; line1; make20]], [] // real v9 shows a warning here + vp, [], [fsMod [nowarn 20; line10; make20]], [] + v9, [], [fsMod [nowarn 20; line10; make20]], [] + vp, [], [fsMod [nowarn 20; line1; make20; warnon 20; make20]], [W20, 3] + v9, [], [fsMod [nowarn 20; line1; make20; warnon 20; make20]], [Error 3350, 2] + vp, ["--nowarn:20"], [fsMod [make20]], [] + v9, ["--nowarn:20"], [fsMod [make20]], [] + vp, ["--nowarn:20"], [fsMod [warnon 20; make20]], [W20, 3] + v9, ["--nowarn:20"], [fsMod [warnon 20; make20]], [Error 3350, 2] + vp, ["--warnon:3579"], [fsMod ["""ignore $"{1}" """]], [Warning 3579, 2] + v9, ["--warnon:3579"], [fsMod ["""ignore $"{1}" """]], [Warning 3579, 2] + vp, [], [fsMod ["#warnon 3579"; """ignore $"{1}" """]], [Warning 3579, 3] + v9, [], [fsMod ["#warnon 3579"; """ignore $"{1}" """]], [Error 3350, 2] + vp, ["--warnaserror"], [fsMod [make20]], [Error 20, 2] + vp, ["--warnaserror"; "--nowarn:20"], [fsMod [make20]], [] + vp, ["--warnaserror"; "--nowarn:20"], [fsMod [warnon 20; make20]], [Error 20, 3] + v9, ["--warnaserror"; "--nowarn:20"], [fsMod [warnon 20; make20]], [Error 3350, 2] + vp, ["--warnaserror"], [fsMod [nowarn 20; make20]], [] + vp, ["--warnaserror"; "--warnaserror-:20"], [fsMod [make20]], [W20, 2] + vp, ["--warnaserror:20"], [fsMod [nowarn 20; make20]], [] + vp, [], [fsSub [nowarn 20; make20]], [] + v9, [], [fsSub [nowarn 20; make20]], [Warning 236, 3; W20, 4] + vp, [], [fsSub [make20; nowarn 20; make20; warnon 20; make20]], [W20, 3; W20, 7] + v9, [], [fsSub [make20; nowarn 20; make20; warnon 20; make20]], [Warning 236, 4; Warning 236, 6; W20, 3; W20, 5; W20, 7] + vp, [], [fsi fsiSource44; fs fsSource44], [Warning 44, 4; Warning 44, 8] + v9, [], [fsi fsiSource44; fs fsSource44], [Error 3350, 7] + vp, [], [fsx ["module A"; make20; nowarn 20; make20; warnon 20; make20]], [] // 20 is not checked in scripts + vp, [], [fsx ["module A"; make25; nowarn 25; make25; warnon 25; make25]], [Warning 25, 2; Warning 25, 6] + v9, [], [fsx ["module A"; make25; nowarn 25; make25; warnon 25; make25]], [Error 3350, 5] + v9, [], [fsx ["module A"; make25; nowarn 25; make25]], [] + vp, [], [fsMod ["let x ="; nowarn 20; " 1"; warnon 20; " 2"; " 3"; "4"]], [W20, 6; W20, 8] + vp, [], [fsMod [nowarn 20; nowarn 20; warnon 20; make20]], [Information 3876, 3; W20, 5] + vp, [], [fsMod [nowarn 20; warnon 20; warnon 20; make20]], [Warning 3876, 4; W20, 5] + vp, ["--warnon:3876"], [fsMod [nowarn 20; nowarn 20; warnon 20; make20]], [Warning 3876, 3; W20, 5] + vp, [], [fsMod ["#nowarn \"\"\"20\"\"\" "; make20]], [] + vp, [], [fsMod ["#nowarnx 20"; make20]], [Error 3353, 2] + vp, [], [fsMod ["#nowarn 20 // comment"; make20]], [] + vp, [], [fsMod ["#nowarn"; make20]], [Error 3875, 2] + vp, [], [fsMod ["let a = 1; #nowarn 20"; make20]], [Error 3874, 2] + ] + |> List.mapi (fun i (v, fl, sources, diags) -> [| + box (i + 1) + box v + box fl + box (List.toArray sources) + box (List.toArray diags) |]) + + let testMemberData = + match System.Int32.TryParse(System.Environment.GetEnvironmentVariable("NowarnSingleTest")) with + | true, n when n > 0 && n <= testData.Length -> [testData[n-1]] + | _ -> testData + + let private testFailed (expected: (ErrorType * int) list) (actual: ErrorInfo list) = + expected.Length <> actual.Length + || (List.zip expected actual |> List.exists(fun((error, line), d) -> error <> d.Error || line <> d.Range.StartLine)) + + let private withDiags testId langVersion flags (sources: SourceCodeFileKind list) (expected: (ErrorType * int) list) (result: CompilationResult) = + let actual = result.Output.Diagnostics + if testFailed expected actual then + let sb = new StringBuilder() + let print (s: string) = sb.AppendLine s |> ignore + print "" + print $"test {testId} of {testData.Length}" + print " language version:" + print $" {langVersion}" + print " added compiler options:" + for flag in flags do print $" {flag}" + for source in sources do + print $" source code %s{source.GetSourceFileName}:" + let text = source.GetSourceText |> Option.defaultValue "" + let lines = text.Split(Environment.NewLine |> Seq.toArray) |> Array.toList + for line in lines do print $" {line}" + print $" expected diagnostics:" + for (error, line) in expected do print $" {error} in line {line}" + print $" actual diagnostics:" + for d in actual do print $" {d.Error} in line {d.Range.StartLine}" + Assert.Fail(string sb) + + [] + [] + let testWarnScopes testId langVersion flags (sourceArray: SourceCodeFileKind array) expectedDiags = + let sources = Array.toList sourceArray + sources.Head + |> fsFromString + |> FS + |> withAdditionalSourceFiles sources.Tail + |> withLangVersion langVersion + |> withOptions flags + |> compile + |> withDiags testId langVersion flags sources (Array.toList expectedDiags) + + [] + let testBadLineDirectiveInteraction() = + let sources = + [ + "test1.fs", "module A1 \n#line 10 \"test.fsy\" \n()" + "test2.fs", "module A2 \n#line 20 \"test.fsy\" \n()" + ] + |> List.map (fun (name, text) -> {FileName = name; SourceText = Some text}) + |> List.map SourceCodeFileKind.Fs + let result = + sources.Head + |> fsFromString + |> FS + |> withAdditionalSourceFiles sources.Tail + |> compile + let actual = result.Output.Diagnostics + if actual.Length <> 1 then Assert.Fail $"expected 1 warning, got {actual.Length}" + let errorInfo = actual.Head + if errorInfo.Error <> Warning 3877 then Assert.Fail $"expected Warning 3877, got {errorInfo.Error}" + if errorInfo.Range.StartLine <> 3 then Assert.Fail $"expected warning in line 3, got line {errorInfo.Range.StartLine}" + if not <| errorInfo.Message.StartsWith "The file 'test.fsy' was also pointed to" then Assert.Fail $"unexpected message {errorInfo.Message}" + + [] + let warnDirectiveArgRange() = + FSharp """ +module A +#nowarn xy "abx" +let a = 1; #nowarn 20 +""" + |> compile + |> withDiagnostics [ + Error 3874, Line 4, Col 11, Line 4, Col 22, "#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" + Warning 203, Line 3, Col 9, Line 3, Col 11, "Invalid warning number 'xy'" + Warning 203, Line 3, Col 12, Line 3, Col 17, "Invalid warning number 'abx'" + ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index df531ac0058..36754f92217 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -30,6 +30,7 @@ XunitSetup.fs + diff --git a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs index 71de89dfd42..eac5d3f1774 100644 --- a/tests/FSharp.Compiler.Service.Tests/ExprTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ExprTests.fs @@ -3504,51 +3504,3 @@ let ``Test ProjectForWitnesses4 GetWitnessPassingInfo`` () = printfn "actual:\n\n%A" actual actual |> shouldEqual expected - -module internal ProjectForNoWarnHashDirective = - - let fileSource1 = """ -module N.M -#nowarn "40" -let rec f = new System.EventHandler(fun _ _ -> f.Invoke(null,null)) -""" - - let createOptions() = createProjectOptions [fileSource1] [] - -[] -let ``Test NoWarn HashDirective`` () = - let options = ProjectForNoWarnHashDirective.createOptions() - let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) - let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate - - for e in wholeProjectResults.Diagnostics do - printfn "ProjectForNoWarnHashDirective error: <<<%s>>>" e.Message - - wholeProjectResults.Diagnostics.Length |> shouldEqual 0 - -let private sourceForParseError = """ -module N.M -#nowarn 0xy -() -""" - -[] -let ``RegressionTestForMissingParseError(TransparentCompiler)`` () = - let options = createProjectOptions [sourceForParseError] [] - let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) - let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate - wholeProjectResults.Diagnostics.Length |> shouldEqual 1 - wholeProjectResults.Diagnostics.[0].ErrorNumber |> shouldEqual 1156 - wholeProjectResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 - -[] -let ``RegressionTestForDuplicateParseError(BackgroundCompiler)`` () = - let options = createProjectOptions [sourceForParseError] [] - let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) - let sourceName = options.SourceFiles[0] - let _wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate - let _, checkResults = exprChecker.GetBackgroundCheckResultsForFileInProject(sourceName, options) |> Async.RunImmediate - checkResults.Diagnostics.Length |> shouldEqual 1 - checkResults.Diagnostics.[0].ErrorNumber |> shouldEqual 1156 - checkResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 - diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl old mode 100755 new mode 100644 index f89f7a406be..bb0389f5021 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -2208,9 +2208,6 @@ FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.CodeAnalysis. FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.CodeAnalysis.FSharpParsingOptions get_Default() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions DiagnosticOptions FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions get_DiagnosticOptions() -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(FSharp.Compiler.CodeAnalysis.FSharpParsingOptions) -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(System.Object) -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 GetHashCode() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Microsoft.FSharp.Collections.FSharpList`1[System.String] ConditionalDefines @@ -2940,9 +2937,6 @@ FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Boolean get_CheckXmlDocs() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Boolean get_GlobalWarnAsError() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions Default FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions get_Default() -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions) -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(System.Object) -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 GetHashCode() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 WarnLevel @@ -2955,8 +2949,12 @@ FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collection FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnAsWarn() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnOff() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnOn() +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] WarnScopeData +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] WarnScopeData@ +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] get_WarnScopeData() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: System.String ToString() -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void .ctor(Int32, Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32]) +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void .ctor(Int32, Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Object]) +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void set_WarnScopeData(Microsoft.FSharp.Core.FSharpOption`1[System.Object]) FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Error FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Hidden FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Info @@ -6274,25 +6272,21 @@ FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsLastCompiland() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_isScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean isScript -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.ParsedImplFileInput NewParsedImplFileInput(System.String, Boolean, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace], System.Tuple`2[System.Boolean,System.Boolean], FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.ParsedImplFileInput NewParsedImplFileInput(System.String, Boolean, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace], System.Tuple`2[System.Boolean,System.Boolean], FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia Trivia -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_Trivia() -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_trivia() -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia trivia +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_Trivia() +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_trivia() +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia trivia FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] Contents FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] contents FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] get_Contents() @@ -6327,8 +6321,6 @@ FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.ParsedInput: Int32 Tag FSharp.Compiler.Syntax.ParsedInput: Int32 get_Tag() -FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[System.String] Identifiers FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[System.String] get_Identifiers() FSharp.Compiler.Syntax.ParsedInput: System.String FileName @@ -6397,25 +6389,21 @@ FSharp.Compiler.Syntax.ParsedSigFileFragment: FSharp.Compiler.Syntax.ParsedSigFi FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileFragment: System.String ToString() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia Trivia -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_Trivia() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_trivia() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia trivia +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_Trivia() +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_trivia() +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia trivia FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] Contents FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] contents FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] get_Contents() @@ -6483,20 +6471,6 @@ FSharp.Compiler.Syntax.QualifiedNameOfFile: Int32 get_Tag() FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String Text FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String ToString() FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String get_Text() -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma, System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Syntax.ScopedPragma NewWarningOff(FSharp.Compiler.Text.Range, Int32) -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.ScopedPragma: Int32 GetHashCode() -FSharp.Compiler.Syntax.ScopedPragma: Int32 GetHashCode(System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: Int32 Tag -FSharp.Compiler.Syntax.ScopedPragma: Int32 get_Tag() -FSharp.Compiler.Syntax.ScopedPragma: Int32 get_warningNumber() -FSharp.Compiler.Syntax.ScopedPragma: Int32 warningNumber -FSharp.Compiler.Syntax.ScopedPragma: System.String ToString() FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly, System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object) @@ -10281,18 +10255,14 @@ FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: FSharp.Compiler.SyntaxTrivia FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: Int32 Tag FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: Int32 get_Tag() FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia] WarnDirectives +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia] get_WarnDirectives() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: FSharp.Compiler.Text.Range ParenRange FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: FSharp.Compiler.Text.Range get_ParenRange() FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: System.String ToString() @@ -10857,6 +10827,28 @@ FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: System.String ToString() 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]) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range Item2 +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range get_Item2() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Nowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Warnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range Item2 +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range get_Item2() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsNowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsWarnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsNowarn() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsWarnon() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewNowarn(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewWarnon(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Int32 Tag +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Int32 get_Tag() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: System.String ToString() FSharp.Compiler.Text.ISourceText: Boolean ContentEquals(FSharp.Compiler.Text.ISourceText) FSharp.Compiler.Text.ISourceText: Boolean SubTextEquals(System.String, Int32) FSharp.Compiler.Text.ISourceText: Char Item [Int32] @@ -11423,6 +11415,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Underscore FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Upcast FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Val FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Void +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 WarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 When FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 While FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 WhileBang @@ -11618,6 +11611,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsUnderscore FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsUpcast FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsVal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsVoid +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhen FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhile FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhileBang @@ -11809,6 +11803,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsUnderscore() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsUpcast() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsVal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsVoid() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWarnDirective() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhen() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhile() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhileBang() @@ -12000,6 +11995,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Upcast FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Val FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Void +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind WarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind When FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind While FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind WhileBang @@ -12191,6 +12187,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Upcast() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Val() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Void() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_WarnDirective() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_When() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_While() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_WhileBang() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl old mode 100755 new mode 100644 index f89f7a406be..bb0389f5021 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -2208,9 +2208,6 @@ FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.CodeAnalysis. FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.CodeAnalysis.FSharpParsingOptions get_Default() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions DiagnosticOptions FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions get_DiagnosticOptions() -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(FSharp.Compiler.CodeAnalysis.FSharpParsingOptions) -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(System.Object) -FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 GetHashCode() FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.CodeAnalysis.FSharpParsingOptions: Microsoft.FSharp.Collections.FSharpList`1[System.String] ConditionalDefines @@ -2940,9 +2937,6 @@ FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Boolean get_CheckXmlDocs() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Boolean get_GlobalWarnAsError() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions Default FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions get_Default() -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions) -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(System.Object) -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 CompareTo(System.Object, System.Collections.IComparer) FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 GetHashCode() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 GetHashCode(System.Collections.IEqualityComparer) FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Int32 WarnLevel @@ -2955,8 +2949,12 @@ FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collection FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnAsWarn() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnOff() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_WarnOn() +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] WarnScopeData +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] WarnScopeData@ +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Microsoft.FSharp.Core.FSharpOption`1[System.Object] get_WarnScopeData() FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: System.String ToString() -FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void .ctor(Int32, Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32]) +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void .ctor(Int32, Boolean, Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Collections.FSharpList`1[System.Int32], Microsoft.FSharp.Core.FSharpOption`1[System.Object]) +FSharp.Compiler.Diagnostics.FSharpDiagnosticOptions: Void set_WarnScopeData(Microsoft.FSharp.Core.FSharpOption`1[System.Object]) FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Error FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Hidden FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity+Tags: Int32 Info @@ -6274,25 +6272,21 @@ FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsLastCompiland() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_IsScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean get_isScript() FSharp.Compiler.Syntax.ParsedImplFileInput: Boolean isScript -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.ParsedImplFileInput NewParsedImplFileInput(System.String, Boolean, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace], System.Tuple`2[System.Boolean,System.Boolean], FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.ParsedImplFileInput NewParsedImplFileInput(System.String, Boolean, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace], System.Tuple`2[System.Boolean,System.Boolean], FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia Trivia -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_Trivia() -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia get_trivia() -FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia trivia +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_Trivia() +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_trivia() +FSharp.Compiler.Syntax.ParsedImplFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia trivia FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedImplFileInput: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() -FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] Contents FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] contents FSharp.Compiler.Syntax.ParsedImplFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespace] get_Contents() @@ -6327,8 +6321,6 @@ FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.ParsedInput: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.ParsedInput: Int32 Tag FSharp.Compiler.Syntax.ParsedInput: Int32 get_Tag() -FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[System.String] Identifiers FSharp.Compiler.Syntax.ParsedInput: Microsoft.FSharp.Collections.FSharpSet`1[System.String] get_Identifiers() FSharp.Compiler.Syntax.ParsedInput: System.String FileName @@ -6397,25 +6389,21 @@ FSharp.Compiler.Syntax.ParsedSigFileFragment: FSharp.Compiler.Syntax.ParsedSigFi FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileFragment: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileFragment: System.String ToString() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.ParsedSigFileInput NewParsedSigFileInput(System.String, FSharp.Compiler.Syntax.QualifiedNameOfFile, Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig], FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia, Microsoft.FSharp.Collections.FSharpSet`1[System.String]) FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile QualifiedName FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_QualifiedName() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile get_qualifiedNameOfFile() FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.Syntax.QualifiedNameOfFile qualifiedNameOfFile -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia Trivia -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_Trivia() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia get_trivia() -FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia trivia +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia Trivia +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_Trivia() +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia get_trivia() +FSharp.Compiler.Syntax.ParsedSigFileInput: FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia trivia FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 Tag FSharp.Compiler.Syntax.ParsedSigFileInput: Int32 get_Tag() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] HashDirectives FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_HashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] get_hashDirectives() FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ParsedHashDirective] hashDirectives -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] ScopedPragmas -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_ScopedPragmas() -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] get_scopedPragmas() -FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.ScopedPragma] scopedPragmas FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] Contents FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] contents FSharp.Compiler.Syntax.ParsedSigFileInput: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynModuleOrNamespaceSig] get_Contents() @@ -6483,20 +6471,6 @@ FSharp.Compiler.Syntax.QualifiedNameOfFile: Int32 get_Tag() FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String Text FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String ToString() FSharp.Compiler.Syntax.QualifiedNameOfFile: System.String get_Text() -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(FSharp.Compiler.Syntax.ScopedPragma, System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object) -FSharp.Compiler.Syntax.ScopedPragma: Boolean Equals(System.Object, System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Syntax.ScopedPragma NewWarningOff(FSharp.Compiler.Text.Range, Int32) -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.ScopedPragma: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.ScopedPragma: Int32 GetHashCode() -FSharp.Compiler.Syntax.ScopedPragma: Int32 GetHashCode(System.Collections.IEqualityComparer) -FSharp.Compiler.Syntax.ScopedPragma: Int32 Tag -FSharp.Compiler.Syntax.ScopedPragma: Int32 get_Tag() -FSharp.Compiler.Syntax.ScopedPragma: Int32 get_warningNumber() -FSharp.Compiler.Syntax.ScopedPragma: Int32 warningNumber -FSharp.Compiler.Syntax.ScopedPragma: System.String ToString() FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(FSharp.Compiler.Syntax.SeqExprOnly, System.Collections.IEqualityComparer) FSharp.Compiler.Syntax.SeqExprOnly: Boolean Equals(System.Object) @@ -10281,18 +10255,14 @@ FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: FSharp.Compiler.SyntaxTrivia FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: Int32 Tag FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: Int32 get_Tag() FSharp.Compiler.SyntaxTrivia.IfDirectiveExpression: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedImplFileInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.ParsedSigFileInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] CodeComments +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia] get_CodeComments() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] ConditionalDirectives +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia] get_ConditionalDirectives() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia] WarnDirectives +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia] get_WarnDirectives() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: System.String ToString() +FSharp.Compiler.SyntaxTrivia.ParsedInputTrivia: Void .ctor(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.ConditionalDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.SyntaxTrivia.CommentTrivia]) FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: FSharp.Compiler.Text.Range ParenRange FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: FSharp.Compiler.Text.Range get_ParenRange() FSharp.Compiler.SyntaxTrivia.SynArgPatsNamePatPairsTrivia: System.String ToString() @@ -10857,6 +10827,28 @@ FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: System.String ToString() 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]) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range Item2 +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: FSharp.Compiler.Text.Range get_Item2() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Nowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags: Int32 Warnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range Item2 +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: FSharp.Compiler.Text.Range get_Item2() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] get_warnNumbers() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon: Microsoft.FSharp.Collections.FSharpList`1[System.Int32] warnNumbers +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsNowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean IsWarnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsNowarn() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Boolean get_IsWarnon() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewNowarn(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia NewWarnon(Microsoft.FSharp.Collections.FSharpList`1[System.Int32], FSharp.Compiler.Text.Range) +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Nowarn +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Tags +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia+Warnon +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Int32 Tag +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: Int32 get_Tag() +FSharp.Compiler.SyntaxTrivia.WarnDirectiveTrivia: System.String ToString() FSharp.Compiler.Text.ISourceText: Boolean ContentEquals(FSharp.Compiler.Text.ISourceText) FSharp.Compiler.Text.ISourceText: Boolean SubTextEquals(System.String, Int32) FSharp.Compiler.Text.ISourceText: Char Item [Int32] @@ -11423,6 +11415,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Underscore FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Upcast FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Val FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Void +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 WarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 When FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 While FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 WhileBang @@ -11618,6 +11611,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsUnderscore FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsUpcast FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsVal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsVoid +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhen FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhile FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsWhileBang @@ -11809,6 +11803,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsUnderscore() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsUpcast() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsVal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsVoid() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWarnDirective() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhen() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhile() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsWhileBang() @@ -12000,6 +11995,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Upcast FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Val FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Void +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind WarnDirective FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind When FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind While FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind WhileBang @@ -12191,6 +12187,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Upcast() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Val() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Void() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_WarnDirective() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_When() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_While() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_WhileBang() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 967f5aacfc4..fc325ec28aa 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -75,6 +75,7 @@ + diff --git a/tests/FSharp.Compiler.Service.Tests/SyntaxTreeTests.fs b/tests/FSharp.Compiler.Service.Tests/SyntaxTreeTests.fs index 654c01d6cc0..42bf0cf0eb0 100644 --- a/tests/FSharp.Compiler.Service.Tests/SyntaxTreeTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/SyntaxTreeTests.fs @@ -95,7 +95,6 @@ let private sanitizeAST (sourceDirectoryValue: string) (ast: ParsedInput) : Pars | ParsedInput.ImplFile(ParsedImplFileInput(fileName, isScript, qualifiedNameOfFile, - scopedPragmas, hashDirectives, contents, flags, @@ -105,7 +104,6 @@ let private sanitizeAST (sourceDirectoryValue: string) (ast: ParsedInput) : Pars fileName, isScript, qualifiedNameOfFile, - scopedPragmas, List.map mapParsedHashDirective hashDirectives, List.map mapSynModuleOrNamespace contents, flags, @@ -113,11 +111,10 @@ let private sanitizeAST (sourceDirectoryValue: string) (ast: ParsedInput) : Pars identifiers ) |> ParsedInput.ImplFile - | ParsedInput.SigFile(ParsedSigFileInput(fileName, qualifiedNameOfFile, scopedPragmas, hashDirectives, contents, trivia, identifiers)) -> + | ParsedInput.SigFile(ParsedSigFileInput(fileName, qualifiedNameOfFile, hashDirectives, contents, trivia, identifiers)) -> ParsedSigFileInput( fileName, qualifiedNameOfFile, - scopedPragmas, List.map mapParsedHashDirective hashDirectives, List.map mapSynModuleOrNamespaceSig contents, trivia, diff --git a/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs b/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs new file mode 100644 index 00000000000..6348fa560ff --- /dev/null +++ b/tests/FSharp.Compiler.Service.Tests/WarnScopeTests.fs @@ -0,0 +1,210 @@ +module FSharp.Compiler.Service.Tests.WarnScopeTests + +open Xunit +open FSharp.Test +open FSharp.Test.Assert +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Diagnostics +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Text + +module private ProjectForNoWarnHashDirective = + + let fileSource1 = """ +module N.M +#nowarn "40" +let rec f = new System.EventHandler(fun _ _ -> f.Invoke(null,null)) +""" + + let createOptions() = createProjectOptions [fileSource1] [] + +[] +let ``Test NoWarn HashDirective`` () = + let options = ProjectForNoWarnHashDirective.createOptions() + let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate + + for e in wholeProjectResults.Diagnostics do + printfn "ProjectForNoWarnHashDirective error: <<<%s>>>" e.Message + + wholeProjectResults.Diagnostics.Length |> shouldEqual 0 + +let private sourceForParseError = """ +module N.M +#nowarn 0xy +() +""" + +[] +let ``RegressionTestForMissingParseError(TransparentCompiler)`` () = + let options = createProjectOptions [sourceForParseError] [] + let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate + wholeProjectResults.Diagnostics.Length |> shouldEqual 1 + wholeProjectResults.Diagnostics.[0].ErrorNumber |> shouldEqual 203 + wholeProjectResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 + +[] +let ``RegressionTestForDuplicateParseError(BackgroundCompiler)`` () = + let options = createProjectOptions [sourceForParseError] [] + let exprChecker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let sourceName = options.SourceFiles[0] + let _wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunImmediate + let _, checkResults = exprChecker.GetBackgroundCheckResultsForFileInProject(sourceName, options) |> Async.RunImmediate + checkResults.Diagnostics.Length |> shouldEqual 1 + checkResults.Diagnostics.[0].ErrorNumber |> shouldEqual 203 + checkResults.Diagnostics.[0].Range.StartLine |> shouldEqual 3 + +type private Expected = + | Err of errorNumber: int * lineNumber: int + | Warn of errorNumber: int * lineNumber: int +type private TestDef = {source: string; errors: Map} + +let private justNowarnTest = {source = """ +module N.M +"" +#nowarn "20" +"" +"" +"" +() +"""; errors = Map["9.0", [Warn(20, 3)]; "preview", [Warn(20, 3)]]} + +let private noNowarnTest = {source = """ +module N.M +"" +"" +"" +"" +() +"""; errors = Map[ + "9.0", [Warn(20, 3); Warn(20, 4); Warn(20, 5); Warn(20, 6)] + "preview", [Warn(20, 3); Warn(20, 4); Warn(20, 5); Warn(20, 6) + ]]} + +let private onOffTest = {source = """ +module N.M +"" +#nowarn "20" +"" +#warnon "20" +"" +#nowarn "20" +"" +() +"""; errors = Map["9.0", [Err(3350, 6); Warn(20, 3)]; "preview", [Warn(20, 3); Warn(20, 7)]]} + +let mkProjectOptionsAndChecker langVersion = + let options = createProjectOptions [onOffTest.source] [$"--langversion:{langVersion}"] + let checker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + options, checker + +let private checkDiagnostics (expected: Expected list) (diagnostics: FSharpDiagnostic list) = + let fail() = + printfn $"expected:" + for exp in expected do printfn $"{exp}" + printfn $"actual:" + for diag in diagnostics do printfn $"{diag.Severity} {diag.ErrorNumber} {diag.StartLine}" + Assert.Fail "unexpected diagnostics" + let unexpected(exp, diag: FSharpDiagnostic) = + match exp with + | Err(errno, line) -> + diag.Severity <> FSharpDiagnosticSeverity.Error || errno <> diag.ErrorNumber || line <> diag.StartLine + | Warn(errno, line) -> + diag.Severity <> FSharpDiagnosticSeverity.Warning || errno <> diag.ErrorNumber || line <> diag.StartLine + if diagnostics.Length <> expected.Length then fail() + elif List.exists unexpected (List.zip expected diagnostics) then fail() + +[] +[] +[] +let ParseAndCheckProjectTest langVersion = + let options, checker = mkProjectOptionsAndChecker langVersion + let wholeProjectResults = checker.ParseAndCheckProject(options) |> Async.RunImmediate + checkDiagnostics onOffTest.errors[langVersion] (Array.toList wholeProjectResults.Diagnostics) + +[] +[] +[] +let ParseAndCheckFileInProjectTest langVersion = + let options, checker = mkProjectOptionsAndChecker langVersion + let sourceName = options.SourceFiles[0] + let parseAndCheckFileInProject testDef = + let source = SourceText.ofString testDef.source + let _, checkAnswer = checker.ParseAndCheckFileInProject(sourceName, 0, source, options) |> Async.RunImmediate + match checkAnswer with + | FSharpCheckFileAnswer.Aborted -> Assert.Fail("Expected error, got Aborted") + | FSharpCheckFileAnswer.Succeeded checkResults -> + checkDiagnostics testDef.errors[langVersion] (Array.toList checkResults.Diagnostics) + [justNowarnTest; noNowarnTest; onOffTest] |> List.iter parseAndCheckFileInProject + +[] +[] +[] +let CheckFileInProjectTest langVersion = + let projectOptions, checker = mkProjectOptionsAndChecker langVersion + let sourceName = projectOptions.SourceFiles[0] + let parsingOptions = {FSharpParsingOptions.Default with SourceFiles = [|sourceName|]; LangVersionText = langVersion} + let checkFileInProject testDef = + let source = SourceText.ofString testDef.source + let parseResults = checker.ParseFile(sourceName, source, parsingOptions) |> Async.RunImmediate + let checkAnswer = checker.CheckFileInProject(parseResults, sourceName, 0, source, projectOptions) |> Async.RunImmediate + match checkAnswer with + | FSharpCheckFileAnswer.Aborted -> Assert.Fail("Expected error, got Aborted") + | FSharpCheckFileAnswer.Succeeded checkResults -> + checkDiagnostics testDef.errors[langVersion] (Array.toList checkResults.Diagnostics) + [justNowarnTest; noNowarnTest; onOffTest] |> List.iter checkFileInProject + +[] +[] +[] +let GetBackgroundCheckResultsForFileInProjectTest langVersion = + let options, checker = mkProjectOptionsAndChecker langVersion + let sourceName = options.SourceFiles[0] + let _wholeProjectResults = checker.ParseAndCheckProject(options) |> Async.RunImmediate + let _, checkResults = checker.GetBackgroundCheckResultsForFileInProject(sourceName, options) |> Async.RunImmediate + checkDiagnostics onOffTest.errors[langVersion] (Array.toList checkResults.Diagnostics) + +let private warnEdits = [ + "module X\n#nowarn 20\n0\n#warnon 20\n0", [Warn(20, 5)]; + "module X\n#nowarn 20\n0\n#warnon 21\n0", []; + "module X\n#nowarn 20\n0\n#warnon 20\n0", [Warn(20, 5)]; +] + +let private createProjectOptions() = + let args = mkProjectCommandLineArgs ("warnEdits.dll", []) + checker.GetProjectOptionsFromCommandLineArgs ("warnEdits.fsproj", args) + +#nowarn 57 +[] +let EditUndoCheckTest () = + let sourceName, projName, outputName = "warnEdits.fs", "warnEdits.fsproj", "warnEdits.dll" + let checker = FSharpChecker.Create(keepAssemblyContents=true, useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler) + let emptyDocSource = DocumentSource.Custom(fun s -> async {return Some (SourceText.ofString "")}) + let args = mkProjectCommandLineArgs(outputName, []) + let options = {checker.GetProjectOptionsFromCommandLineArgs(projName, args) with SourceFiles = [| sourceName |]} + let snapshot = FSharpProjectSnapshot.FromOptions(options, emptyDocSource) |> Async.RunImmediate + let parseAndCheckFileInProject i (sourceText, errors) = + let getSource() = System.Threading.Tasks.Task.FromResult(SourceTextNew.ofString sourceText) + let fileSnapshot = ProjectSnapshot.FSharpFileSnapshot(sourceName, string i, getSource) + let snapshot = FSharpProjectSnapshot.Create( + snapshot.ProjectFileName, + snapshot.OutputFileName, + snapshot.ProjectId, + [fileSnapshot], + snapshot.ReferencesOnDisk, + snapshot.OtherOptions, + snapshot.ReferencedProjects, + snapshot.IsIncompleteTypeCheckEnvironment, + snapshot.UseScriptResolutionRules, + snapshot.LoadTime, + snapshot.UnresolvedReferences, + snapshot.OriginalLoadReferences, + None + ) + let _, checkAnswer = checker.ParseAndCheckFileInProject(sourceName, snapshot) |> Async.RunImmediate + match checkAnswer with + | FSharpCheckFileAnswer.Aborted -> Assert.Fail("Expected error, got Aborted") + | FSharpCheckFileAnswer.Succeeded checkResults -> + checkDiagnostics errors (Array.toList checkResults.Diagnostics) + warnEdits |> List.iteri parseAndCheckFileInProject diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 1ec26cb3769..f52a66e92bc 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -309,6 +309,10 @@ and Compilation = module CompilerAssertHelpers = + let uniqueName = + let mutable counter = 0 + fun (ext: string) -> $"test%x{Interlocked.Increment &counter}{ext}" + let UseTransparentCompiler = FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically || not (String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TEST_TRANSPARENT_COMPILER"))) @@ -407,7 +411,7 @@ module CompilerAssertHelpers = #endif |] { - ProjectFileName = "Z:\\test.fsproj" + ProjectFileName = "Z:\\" ++ uniqueName ".fsproj" ProjectId = None SourceFiles = [|"test.fs"|] OtherOptions = Array.append testDefaults assemblies diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index fd4b4d78bd0..897dd2ac22a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,14 +21,14 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. -[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. @@ -37,8 +37,8 @@ [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+getSwitch@325::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000E9F][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. +[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. +[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. [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. [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.PatternMatchCompilation::isProblematicClause([FSharp.Compiler.Service]FSharp.Compiler.PatternMatchCompilation+MatchClause)][offset 0x00000065][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 4eaf1633b58..e81c636f402 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,18 +28,18 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. -[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. +[IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. @@ -53,8 +53,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+attempt@373::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000E9F][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+processArg@333::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x0000004D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+Pipe #1 stage #1 at line 1845@1845::Invoke(int32)][offset 0x00000039][found Char] Unexpected type on the stack. +[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. +[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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerImports+line@570-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [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. [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. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 0267e2b1bb0..9821dc3dc1a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -21,15 +21,15 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::parseOption@266(string)][offset 0x0000000B][found Char] Unexpected type on the stack. @@ -39,8 +39,8 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::attempt@372([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1)][offset 0x00000A99][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000005E] Stack underflow. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [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. [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. [IL]: Error [StackUnexpected]: : FSharp.Compiler.IlxGen::HashRangeSorted([S.P.CoreLib]System.Collections.Generic.IDictionary`2>)][offset 0x00000011][found ref '[FSharp.Compiler.Service]FSharp.Compiler.IlxGen+HashRangeSorted@1873-1'][expected ref '[FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,int32>'] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 37aaa79a6f2..b53d7c7ecc6 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -28,20 +28,20 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x00000024][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A7][found Char] Unexpected type on the stack. @@ -55,8 +55,8 @@ [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. [IL]: Error [StackUnderflow]: : FSharp.Compiler.CompilerOptions::DoWithColor([System.Console]System.ConsoleColor, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2)][offset 0x0000005E] Stack underflow. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions+ResponseFile+parseLine@239::Invoke(string)][offset 0x00000026][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1845::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x00000031][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.ParseAndCheckInputs+CheckMultipleInputsUsingGraphMode@1781::Invoke(int32)][offset 0x0000003A][found Char] Unexpected type on the stack. [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. [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. [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. diff --git a/tests/fsharp/core/load-script/ProjectDriver.fsx b/tests/fsharp/core/load-script/ProjectDriver.fsx index e614c5a3f72..e394078cc2a 100644 --- a/tests/fsharp/core/load-script/ProjectDriver.fsx +++ b/tests/fsharp/core/load-script/ProjectDriver.fsx @@ -1,9 +1,10 @@ // #Conformance #FSI #load "ThisProject.fsx" +#nowarn "44" [] let fn x = 0 -let y = fn 1 // This would be an 'obsolete' warning but ThisProject.fsx nowarns it +let y = fn 1 // This would be an 'obsolete' warning but for the #nowarn above printfn "Result = %d" (Namespace.Type.Method()) diff --git a/tests/service/data/SyntaxTree/Attribute/RangeOfAttribute.fs.bsl b/tests/service/data/SyntaxTree/Attribute/RangeOfAttribute.fs.bsl index bde23ff1693..8e83e55acfa 100644 --- a/tests/service/data/SyntaxTree/Attribute/RangeOfAttribute.fs.bsl +++ b/tests/service/data/SyntaxTree/Attribute/RangeOfAttribute.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Attribute/RangeOfAttribute.fs", false, - QualifiedNameOfFile RangeOfAttribute, [], [], + QualifiedNameOfFile RangeOfAttribute, [], [SynModuleOrNamespace ([RangeOfAttribute], false, AnonModule, [Attributes @@ -30,4 +30,5 @@ ImplFile Expr (Do (Const (Unit, (3,3--3,5)), (3,0--3,5)), (3,0--3,5))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithPath.fs.bsl b/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithPath.fs.bsl index b8c9c031836..4db0f069189 100644 --- a/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithPath.fs.bsl +++ b/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithPath.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Attribute/RangeOfAttributeWithPath.fs", false, - QualifiedNameOfFile RangeOfAttributeWithPath, [], [], + QualifiedNameOfFile RangeOfAttributeWithPath, [], [SynModuleOrNamespace ([RangeOfAttributeWithPath], false, AnonModule, [Attributes @@ -32,4 +32,5 @@ ImplFile Expr (Do (Const (Unit, (3,3--3,5)), (3,0--3,5)), (3,0--3,5))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithTarget.fs.bsl b/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithTarget.fs.bsl index cdb1fdd30fe..38b51a3bffd 100644 --- a/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithTarget.fs.bsl +++ b/tests/service/data/SyntaxTree/Attribute/RangeOfAttributeWithTarget.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Attribute/RangeOfAttributeWithTarget.fs", false, - QualifiedNameOfFile RangeOfAttributeWithTarget, [], [], + QualifiedNameOfFile RangeOfAttributeWithTarget, [], [SynModuleOrNamespace ([RangeOfAttributeWithTarget], false, AnonModule, [Attributes @@ -30,4 +30,5 @@ ImplFile Expr (Do (Const (Unit, (3,3--3,5)), (3,0--3,5)), (3,0--3,5))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTrivia.fs.bsl b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTrivia.fs.bsl index 17fea8f0a33..654c3bed59d 100644 --- a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTrivia.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/ColonBeforeReturnTypeIsPartOfTrivia.fs", false, - QualifiedNameOfFile ColonBeforeReturnTypeIsPartOfTrivia, [], [], + QualifiedNameOfFile ColonBeforeReturnTypeIsPartOfTrivia, [], [SynModuleOrNamespace ([ColonBeforeReturnTypeIsPartOfTrivia], false, AnonModule, [Let @@ -35,4 +35,5 @@ ImplFile (2,0--2,31))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl index dd5022f2bc2..92d2ae4ebfc 100644 --- a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs", false, QualifiedNameOfFile ColonBeforeReturnTypeIsPartOfTriviaInProperties, [], - [], [SynModuleOrNamespace ([ColonBeforeReturnTypeIsPartOfTriviaInProperties], false, AnonModule, [Types @@ -104,4 +103,5 @@ ImplFile WithKeyword = None })], (2,0--3,62))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/ConditionalDirectiveAroundInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Binding/ConditionalDirectiveAroundInlineKeyword.fs.bsl index 115b95c51eb..495a509c7ca 100644 --- a/tests/service/data/SyntaxTree/Binding/ConditionalDirectiveAroundInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/ConditionalDirectiveAroundInlineKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/ConditionalDirectiveAroundInlineKeyword.fs", false, - QualifiedNameOfFile ConditionalDirectiveAroundInlineKeyword, [], [], + QualifiedNameOfFile ConditionalDirectiveAroundInlineKeyword, [], [SynModuleOrNamespace ([ConditionalDirectiveAroundInlineKeyword], false, AnonModule, [Let @@ -47,4 +47,5 @@ ImplFile (true, true), { ConditionalDirectives = [If (Not (Ident "FOO"), (3,0--3,8)); EndIf (5,0--5,6)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/InlineKeywordInBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/InlineKeywordInBinding.fs.bsl index 596eb100812..3213618de10 100644 --- a/tests/service/data/SyntaxTree/Binding/InlineKeywordInBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/InlineKeywordInBinding.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/InlineKeywordInBinding.fs", false, - QualifiedNameOfFile InlineKeywordInBinding, [], [], + QualifiedNameOfFile InlineKeywordInBinding, [], [SynModuleOrNamespace ([InlineKeywordInBinding], false, AnonModule, [Let @@ -52,4 +52,5 @@ ImplFile EqualsRange = Some (2,17--2,18) })], (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet.fs.bsl index 63b8a81ea59..90cbfb00a2a 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet, - [], [], + [], [SynModuleOrNamespace ([RangeOfAttributeBetweenLetKeywordAndPatternShouldBeIncludedInSynModuleDeclLet], false, AnonModule, @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (2,22--2,23) })], (2,0--2,25))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr.fs.bsl index db5fe5051fe..8dbf89faea4 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr.fs", false, QualifiedNameOfFile - RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr, [], [], + RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr, [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInBindingOfSynExprObjExpr], false, AnonModule, @@ -50,4 +50,5 @@ ImplFile (2,2--2,21), (2,0--4,32)), (2,0--4,32))], PreXmlDocEmpty, [], None, (2,0--4,32), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl index d52e2f085ba..f53b47a4eaa 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs", false, QualifiedNameOfFile - RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember, [], [], + RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember, [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember], false, AnonModule, @@ -51,4 +51,5 @@ ImplFile WithKeyword = None })], (2,0--4,15))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl index 4717531eb39..dde24f9afc2 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec, - [], [], + [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec], false, AnonModule, @@ -52,4 +52,5 @@ ImplFile WithKeyword = None })], (2,0--4,23))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl index fe111972f91..3a657b48cb7 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl @@ -4,7 +4,6 @@ ImplFile false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty, [], - [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty], false, AnonModule, @@ -107,4 +106,5 @@ ImplFile WithKeyword = None })], (2,0--6,50))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl index ceff4f8e244..566cba41a61 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs", false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSecondaryConstructor, - [], [], + [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInSecondaryConstructor], false, AnonModule, @@ -117,4 +117,5 @@ ImplFile WithKeyword = None })], (2,0--11,12))], PreXmlDocEmpty, [], None, (2,0--12,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl index a8e5110eeb4..791854800d3 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs", false, QualifiedNameOfFile - RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings, [], [], + RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings, [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings], false, AnonModule, @@ -42,4 +42,5 @@ ImplFile WithKeyword = None })], (2,0--4,13))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl index 83139fe83ee..ff220a2a034 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs", false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynMemberDefnMember, - [], [], + [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInSynMemberDefnMember], false, AnonModule, @@ -55,4 +55,5 @@ ImplFile WithKeyword = None })], (2,0--4,33))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynModuleDeclLet.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynModuleDeclLet.fs.bsl index 08edc3d2631..b15cdc324a7 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynModuleDeclLet.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynModuleDeclLet.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/Binding/RangeOfAttributeShouldBeIncludedInSynModuleDeclLet.fs", false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynModuleDeclLet, [], - [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInSynModuleDeclLet], false, AnonModule, @@ -27,4 +26,5 @@ ImplFile EqualsRange = Some (3,6--3,7) })], (2,0--3,9))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl index bf0e8802e32..8698f8ddc7c 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty, - [], [], + [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty], false, AnonModule, @@ -71,4 +71,5 @@ ImplFile WithKeyword = None })], (2,0--4,79))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBinding.fs.bsl index e3156b5c3b5..9921095320e 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBinding.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/Binding/RangeOfEqualSignShouldBePresentInLocalLetBinding.fs", false, QualifiedNameOfFile RangeOfEqualSignShouldBePresentInLocalLetBinding, [], - [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInLocalLetBinding], false, AnonModule, [Expr @@ -25,4 +24,5 @@ ImplFile InKeyword = None }), (2,0--4,6)), (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBindingTyped.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBindingTyped.fs.bsl index 93dabea4c82..770bfd5f4d5 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBindingTyped.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInLocalLetBindingTyped.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfEqualSignShouldBePresentInLocalLetBindingTyped.fs", false, QualifiedNameOfFile RangeOfEqualSignShouldBePresentInLocalLetBindingTyped, - [], [], + [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInLocalLetBindingTyped], false, AnonModule, @@ -35,4 +35,5 @@ ImplFile InKeyword = None }), (2,0--4,6)), (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl index 9e0bd27f359..0a48a4272fc 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs", false, - QualifiedNameOfFile RangeOfEqualSignShouldBePresentInMemberBinding, [], [], + QualifiedNameOfFile RangeOfEqualSignShouldBePresentInMemberBinding, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInMemberBinding], false, AnonModule, [Types @@ -49,4 +49,5 @@ ImplFile WithKeyword = None })], (2,0--3,21))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl index 463fcef24ba..c8eb3a32a50 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs", false, QualifiedNameOfFile - RangeOfEqualSignShouldBePresentInMemberBindingWithParameters, [], [], + RangeOfEqualSignShouldBePresentInMemberBindingWithParameters, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInMemberBindingWithParameters], false, AnonModule, @@ -56,4 +56,5 @@ ImplFile WithKeyword = None })], (2,0--3,24))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl index 49eeec4d346..431946b6f94 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs", false, QualifiedNameOfFile - RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType, [], [], + RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType], false, AnonModule, @@ -65,4 +65,5 @@ ImplFile WithKeyword = None })], (2,0--3,33))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl index 32f9f50c83a..72ee28c403d 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/RangeOfEqualSignShouldBePresentInProperty.fs", false, - QualifiedNameOfFile RangeOfEqualSignShouldBePresentInProperty, [], [], + QualifiedNameOfFile RangeOfEqualSignShouldBePresentInProperty, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInProperty], false, AnonModule, [Types @@ -96,4 +96,5 @@ ImplFile WithKeyword = None })], (2,0--5,50))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding.fs.bsl index eca7f36b6dd..8453e7e60c9 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding.fs", false, QualifiedNameOfFile - RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding, [], [], + RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInSynModuleDeclLetBinding], false, AnonModule, @@ -21,4 +21,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--2,10))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped.fs.bsl index 651cdb4f8ce..77819f9484e 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped.fs", false, QualifiedNameOfFile - RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped, [], [], + RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresentInSynModuleDeclLetBindingTyped], false, AnonModule, @@ -28,4 +28,5 @@ ImplFile EqualsRange = Some (2,12--2,13) })], (2,0--2,16))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding.fs.bsl index 86775dec80c..747fdcbc1e2 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding.fs", false, QualifiedNameOfFile - RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding, [], [], + RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding, [], [SynModuleOrNamespace ([RangeOfLetKeywordShouldBePresentInSynExprLetOrUseBinding], false, AnonModule, @@ -42,4 +42,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding.fs.bsl index 0a175553cad..c2d3ab9e526 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding.fs", false, QualifiedNameOfFile - RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding, [], [], + RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding, [], [SynModuleOrNamespace ([RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBinding], false, AnonModule, @@ -21,4 +21,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--2,10))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes.fs.bsl index 613931862dd..af82b819e97 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes, - [], [], + [], [SynModuleOrNamespace ([RangeOfLetKeywordShouldBePresentInSynModuleDeclLetBindingWithAttributes], false, AnonModule, @@ -29,4 +29,5 @@ ImplFile EqualsRange = Some (5,6--5,7) })], (2,0--5,10))], PreXmlDocEmpty, [], None, (3,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,0--4,15)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Binding/TupleReturnTypeOfBindingShouldContainStars.fs.bsl b/tests/service/data/SyntaxTree/Binding/TupleReturnTypeOfBindingShouldContainStars.fs.bsl index a8dae863d64..0ac9a8d3c94 100644 --- a/tests/service/data/SyntaxTree/Binding/TupleReturnTypeOfBindingShouldContainStars.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/TupleReturnTypeOfBindingShouldContainStars.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Binding/TupleReturnTypeOfBindingShouldContainStars.fs", false, - QualifiedNameOfFile TupleReturnTypeOfBindingShouldContainStars, [], [], + QualifiedNameOfFile TupleReturnTypeOfBindingShouldContainStars, [], [SynModuleOrNamespace ([TupleReturnTypeOfBindingShouldContainStars], false, AnonModule, [Let @@ -78,4 +78,5 @@ ImplFile EqualsRange = Some (3,28--3,29) })], (3,0--3,42))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCode.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCode.fs.bsl index 91dffc0ee66..9dcd99749c5 100644 --- a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCode.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCode.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/CodeComment/BlockCommentInSourceCode.fs", false, - QualifiedNameOfFile BlockCommentInSourceCode, [], [], + QualifiedNameOfFile BlockCommentInSourceCode, [], [SynModuleOrNamespace ([BlockCommentInSourceCode], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (2,17--2,18) })], (2,0--2,25))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (2,6--2,13)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl index 977d7b388de..e5fefe917a8 100644 --- a/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/CodeComment/BlockCommentInSourceCodeSignatureFile.fsi", - QualifiedNameOfFile BlockCommentInSourceCodeSignatureFile, [], [], + QualifiedNameOfFile BlockCommentInSourceCodeSignatureFile, [], [SynModuleOrNamespaceSig ([Meh], false, DeclaredNamespace, [Val @@ -17,4 +17,5 @@ SigFile EqualsRange = None }), (4,0--4,19))], PreXmlDocEmpty, [], None, (2,0--4,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (4,6--4,13)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCode.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCode.fs.bsl index a3bb2470842..07bd380cf4f 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCode.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCode.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/CodeComment/CommentAfterSourceCode.fs", false, - QualifiedNameOfFile CommentAfterSourceCode, [], [], + QualifiedNameOfFile CommentAfterSourceCode, [], [SynModuleOrNamespace ([CommentAfterSourceCode], false, AnonModule, [Expr @@ -10,4 +10,5 @@ ImplFile (2,0--2,5))], PreXmlDocEmpty, [], None, (2,0--2,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,6--2,17)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl index 7b8fc685e00..df379c0f423 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentAfterSourceCodeSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/CodeComment/CommentAfterSourceCodeSignatureFile.fsi", - QualifiedNameOfFile CommentAfterSourceCodeSignatureFile, [], [], + QualifiedNameOfFile CommentAfterSourceCodeSignatureFile, [], [SynModuleOrNamespaceSig ([Meh], false, DeclaredNamespace, [Val @@ -17,4 +17,5 @@ SigFile EqualsRange = None }), (4,0--4,13))], PreXmlDocEmpty, [], None, (2,0--4,13), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,14--4,25)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentAtEndOfFile.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentAtEndOfFile.fs.bsl index 4c1f24b1384..eb0ecc84f09 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentAtEndOfFile.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentAtEndOfFile.fs.bsl @@ -1,9 +1,10 @@ ImplFile (ParsedImplFileInput ("/root/CodeComment/CommentAtEndOfFile.fs", false, - QualifiedNameOfFile CommentAtEndOfFile, [], [], + QualifiedNameOfFile CommentAtEndOfFile, [], [SynModuleOrNamespace ([CommentAtEndOfFile], false, AnonModule, [Expr (Ident x, (2,0--2,1))], PreXmlDocEmpty, [], None, (2,0--2,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,2--2,6)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLine.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLine.fs.bsl index ad5aa017eac..d4dcf1896dc 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLine.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLine.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/CodeComment/CommentOnSingleLine.fs", false, - QualifiedNameOfFile CommentOnSingleLine, [], [], + QualifiedNameOfFile CommentOnSingleLine, [], [SynModuleOrNamespace ([CommentOnSingleLine], false, AnonModule, [Expr @@ -10,4 +10,5 @@ ImplFile (3,0--3,5))], PreXmlDocEmpty, [], None, (3,0--3,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,0--2,11)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl index 5dd445b4d00..899d4dacd23 100644 --- a/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/CommentOnSingleLineSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/CodeComment/CommentOnSingleLineSignatureFile.fsi", - QualifiedNameOfFile CommentOnSingleLineSignatureFile, [], [], + QualifiedNameOfFile CommentOnSingleLineSignatureFile, [], [SynModuleOrNamespaceSig ([Meh], false, DeclaredNamespace, [Val @@ -17,4 +17,5 @@ SigFile EqualsRange = None }), (4,0--4,10))], PreXmlDocEmpty, [], None, (2,0--4,10), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,0--3,11)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation.fs.bsl index b57381ca8e6..86c4c524b60 100644 --- a/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/CodeComment/TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation.fs", false, QualifiedNameOfFile - TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation, [], [], + TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation, [], [SynModuleOrNamespace ([TripleSlashCommentShouldBeCapturedIfUsedInAnInvalidLocation], false, AnonModule, @@ -38,6 +38,7 @@ ImplFile PreXmlDocEmpty, [], None, (3,0--10,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,4--4,40); LineComment (6,4--6,36); LineComment (7,4--7,27)] }, set [])) diff --git a/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldNotBeCaptured.fs.bsl b/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldNotBeCaptured.fs.bsl index fafd932e041..e5f11934a8f 100644 --- a/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldNotBeCaptured.fs.bsl +++ b/tests/service/data/SyntaxTree/CodeComment/TripleSlashCommentShouldNotBeCaptured.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/CodeComment/TripleSlashCommentShouldNotBeCaptured.fs", false, - QualifiedNameOfFile TripleSlashCommentShouldNotBeCaptured, [], [], + QualifiedNameOfFile TripleSlashCommentShouldNotBeCaptured, [], [SynModuleOrNamespace ([TripleSlashCommentShouldNotBeCaptured], false, AnonModule, [Let @@ -18,4 +18,5 @@ ImplFile EqualsRange = Some (3,6--3,7) })], (2,0--3,9))], PreXmlDocEmpty, [], None, (3,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ComputationExpression/MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression.fs.bsl b/tests/service/data/SyntaxTree/ComputationExpression/MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression.fs.bsl index 16e62c6c1aa..77bbe3164c6 100644 --- a/tests/service/data/SyntaxTree/ComputationExpression/MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/ComputationExpression/MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression.fs.bsl @@ -4,7 +4,6 @@ ImplFile false, QualifiedNameOfFile MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression, [], - [], [SynModuleOrNamespace ([MultipleSynExprAndBangHaveRangeThatStartsAtAndAndEndsAfterExpression], false, AnonModule, @@ -47,4 +46,5 @@ ImplFile (2,0--7,1)), (2,0--7,1))], PreXmlDocEmpty, [], None, (2,0--7,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs.bsl b/tests/service/data/SyntaxTree/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs.bsl index 9ee7e15f532..610ab87132f 100644 --- a/tests/service/data/SyntaxTree/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/ComputationExpression/SynExprAndBangRangeStartsAtAndAndEndsAfterExpression.fs", false, QualifiedNameOfFile SynExprAndBangRangeStartsAtAndAndEndsAfterExpression, - [], [], + [], [SynModuleOrNamespace ([SynExprAndBangRangeStartsAtAndAndEndsAfterExpression], false, AnonModule, @@ -36,4 +36,5 @@ ImplFile (2,0--8,1)), (2,0--8,1))], PreXmlDocEmpty, [], None, (2,0--8,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTrivia.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTrivia.fs.bsl index 8a7a55c28a1..8ed093aa434 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTrivia.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTrivia.fs", false, QualifiedNameOfFile DirectivesInMultilineCommentAreNotReportedAsTrivia, [], - [], [SynModuleOrNamespace ([DirectivesInMultilineCommentAreNotReportedAsTrivia], false, AnonModule, @@ -21,4 +20,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--8,6))], PreXmlDocEmpty, [], None, (2,0--9,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (3,0--7,2)] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl index bb8a2a87d75..cd8a4e3f8ff 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile.fsi", QualifiedNameOfFile - DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile, [], [], + DirectivesInMultilineCommentAreNotReportedAsTriviaSignatureFile, [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -19,4 +19,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--10,6), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (5,0--9,2)] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTrivia.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTrivia.fs.bsl index 231cfd08d6f..2c1508983b8 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTrivia.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTrivia.fs", false, QualifiedNameOfFile DirectivesInMultilineStringAreNotReportedAsTrivia, [], - [], [SynModuleOrNamespace ([DirectivesInMultilineStringAreNotReportedAsTrivia], false, AnonModule, [Let @@ -28,4 +27,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--7,3))], PreXmlDocEmpty, [], None, (2,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl index 3a151928254..ad832870af4 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile.fsi", QualifiedNameOfFile - DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile, [], [], + DirectivesInMultilineStringAreNotReportedAsTriviaSignatureFile, [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -29,4 +29,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--9,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndif.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndif.fs.bsl index 9f409f45808..3a6cd1220fd 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndif.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndif.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ConditionalDirective/NestedIfElseEndif.fs", false, - QualifiedNameOfFile NestedIfElseEndif, [], [], + QualifiedNameOfFile NestedIfElseEndif, [], [SynModuleOrNamespace ([NestedIfElseEndif], false, AnonModule, [Let @@ -22,4 +22,5 @@ ImplFile [If (Ident "FOO", (3,4--3,11)); If (Ident "MEH", (4,8--4,15)); Else (6,8--6,13); EndIf (8,8--8,14); Else (9,4--9,9); EndIf (11,4--11,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl index c1293f6c9c9..26f0f17c77e 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/NestedIfElseEndifSignatureFile.fsi", - QualifiedNameOfFile NestedIfElseEndifSignatureFile, [], [], + QualifiedNameOfFile NestedIfElseEndifSignatureFile, [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -21,4 +21,5 @@ SigFile [If (Ident "FOO", (5,4--5,11)); If (Ident "MEH", (6,8--6,15)); Else (8,8--8,13); EndIf (10,8--10,14); Else (11,4--11,9); EndIf (13,4--13,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressions.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressions.fs.bsl index 25821646aa0..2a2ab666df7 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressions.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressions.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ConditionalDirective/NestedIfEndifWithComplexExpressions.fs", false, - QualifiedNameOfFile NestedIfEndifWithComplexExpressions, [], [], + QualifiedNameOfFile NestedIfEndifWithComplexExpressions, [], [SynModuleOrNamespace ([NestedIfEndifWithComplexExpressions], false, AnonModule, [Let @@ -23,4 +23,5 @@ ImplFile If (And (Ident "FOO", Ident "BAR"), (4,8--4,22)); If (Or (Ident "MEH", Ident "HMM"), (5,12--5,26)); EndIf (7,12--7,18); EndIf (8,8--8,14); EndIf (9,4--9,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl index 9f0375afada..416dec61255 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/NestedIfEndifWithComplexExpressionsSignatureFile.fsi", QualifiedNameOfFile NestedIfEndifWithComplexExpressionsSignatureFile, [], - [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -23,4 +22,5 @@ SigFile If (And (Ident "FOO", Ident "BAR"), (6,8--6,22)); If (Or (Ident "MEH", Ident "HMM"), (7,12--7,26)); EndIf (9,12--9,18); EndIf (10,8--10,14); EndIf (11,4--11,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndif.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndif.fs.bsl index 72ac590cc94..6a070b4b63c 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndif.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndif.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ConditionalDirective/SingleIfElseEndif.fs", false, - QualifiedNameOfFile SingleIfElseEndif, [], [], + QualifiedNameOfFile SingleIfElseEndif, [], [SynModuleOrNamespace ([SingleIfElseEndif], false, AnonModule, [Let @@ -20,4 +20,5 @@ ImplFile (true, true), { ConditionalDirectives = [If (Ident "DEBUG", (3,4--3,13)); Else (5,4--5,9); EndIf (7,4--7,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl index 4164c59cd03..393ca5b7291 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/SingleIfElseEndifSignatureFile.fsi", - QualifiedNameOfFile SingleIfElseEndifSignatureFile, [], [], + QualifiedNameOfFile SingleIfElseEndifSignatureFile, [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -19,4 +19,5 @@ SigFile { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [If (Ident "DEBUG", (5,4--5,13)); Else (7,4--7,9); EndIf (9,4--9,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndif.fs.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndif.fs.bsl index cd4a4243c4e..45ef82ca4c5 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndif.fs.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndif.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ConditionalDirective/SingleIfEndif.fs", false, - QualifiedNameOfFile SingleIfEndif, [], [], + QualifiedNameOfFile SingleIfEndif, [], [SynModuleOrNamespace ([SingleIfEndif], false, AnonModule, [Let @@ -20,4 +20,5 @@ ImplFile (true, true), { ConditionalDirectives = [If (Ident "DEBUG", (3,4--3,13)); EndIf (5,4--5,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl index ea0a6308762..bec565d234d 100644 --- a/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/ConditionalDirective/SingleIfEndifSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ConditionalDirective/SingleIfEndifSignatureFile.fsi", - QualifiedNameOfFile SingleIfEndifSignatureFile, [], [], + QualifiedNameOfFile SingleIfEndifSignatureFile, [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Val @@ -19,4 +19,5 @@ SigFile { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [If (Ident "DEBUG", (5,4--5,13)); EndIf (7,4--7,10)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl index 121139817fc..65b7c6c556f 100644 --- a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/EnumCase/MultipleSynEnumCasesHaveBarRange.fs", false, - QualifiedNameOfFile MultipleSynEnumCasesHaveBarRange, [], [], + QualifiedNameOfFile MultipleSynEnumCasesHaveBarRange, [], [SynModuleOrNamespace ([MultipleSynEnumCasesHaveBarRange], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--4,14))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl index 7f1b4d84526..ca80ebf45a9 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/EnumCase/SingleSynEnumCaseHasBarRange.fs", false, - QualifiedNameOfFile SingleSynEnumCaseHasBarRange, [], [], + QualifiedNameOfFile SingleSynEnumCaseHasBarRange, [], [SynModuleOrNamespace ([SingleSynEnumCaseHasBarRange], false, AnonModule, [Types @@ -24,4 +24,5 @@ ImplFile WithKeyword = None })], (2,0--2,20))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl index 2b2f3d90daa..4ac684664e3 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/EnumCase/SingleSynEnumCaseWithoutBar.fs", false, - QualifiedNameOfFile SingleSynEnumCaseWithoutBar, [], [], + QualifiedNameOfFile SingleSynEnumCaseWithoutBar, [], [SynModuleOrNamespace ([SingleSynEnumCaseWithoutBar], false, AnonModule, [Types @@ -24,4 +24,5 @@ ImplFile WithKeyword = None })], (2,0--2,18))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Exception/Missing name 01.fs.bsl b/tests/service/data/SyntaxTree/Exception/Missing name 01.fs.bsl index 3bf7aea22b1..94c5dedbc2d 100644 --- a/tests/service/data/SyntaxTree/Exception/Missing name 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Exception/Missing name 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Exception/Missing name 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Exception @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(5,0) parse error Incomplete structured construct at or before this point in exception definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Exception/Missing name 02.fs.bsl b/tests/service/data/SyntaxTree/Exception/Missing name 02.fs.bsl index d71336169b3..4381c755f22 100644 --- a/tests/service/data/SyntaxTree/Exception/Missing name 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Exception/Missing name 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Exception/Missing name 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Exception @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,9) parse error Unexpected keyword 'exception' in exception definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Exception/Missing name 03.fs.bsl b/tests/service/data/SyntaxTree/Exception/Missing name 03.fs.bsl index 2cb9b84bc5b..2b032173b1b 100644 --- a/tests/service/data/SyntaxTree/Exception/Missing name 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Exception/Missing name 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Exception/Missing name 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Exception @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,19)-(5,0) parse error Incomplete structured construct at or before this point in exception definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Exception/Recover Function Type 01.fs.bsl b/tests/service/data/SyntaxTree/Exception/Recover Function Type 01.fs.bsl index 690183a18b6..a1d17ea6c10 100644 --- a/tests/service/data/SyntaxTree/Exception/Recover Function Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Exception/Recover Function Type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Exception/Recover Function Type 01.fs", false, - QualifiedNameOfFile Recover Function Type 01, [], [], + QualifiedNameOfFile Recover Function Type 01, [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Exception @@ -43,6 +43,7 @@ ImplFile PreXmlDocEmpty, [], None, (1,0--4,22), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(3,27) parse error Unexpected function type in union case field definition. If you intend the field to be a function, consider wrapping the function signature with parens, e.g. | Case of a -> b into | Case of (a -> b). diff --git a/tests/service/data/SyntaxTree/Exception/SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Exception/SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword.fs.bsl index 8326a320162..83c72a55237 100644 --- a/tests/service/data/SyntaxTree/Exception/SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Exception/SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Exception/SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile SynExceptionDefnShouldContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([X], false, DeclaredNamespace, [Exception @@ -41,4 +41,5 @@ ImplFile (4,0--5,22)), (4,0--5,22))], PreXmlDocEmpty, [], None, (2,0--5,22), { LeadingKeyword = Namespace (2,0--2,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl index f931eda4280..7dbc5c7695b 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-01.fs", false, - QualifiedNameOfFile AnonymousRecords-01, [], [], + QualifiedNameOfFile AnonymousRecords-01, [], [SynModuleOrNamespace ([AnonymousRecords-01], false, AnonModule, [Expr @@ -34,6 +34,7 @@ ImplFile (6,0--6,17), { OpeningBraceRange = (6,7--6,9) }), (6,0--6,17))], PreXmlDocEmpty, [], None, (1,0--6,17), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,3)-(5,7) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl index 4701bc305a6..fc0a410b79e 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-02.fs", false, - QualifiedNameOfFile AnonymousRecords-02, [], [], + QualifiedNameOfFile AnonymousRecords-02, [], [SynModuleOrNamespace ([AnonymousRecords-02], false, AnonModule, [Expr @@ -12,6 +12,7 @@ ImplFile { OpeningBraceRange = (1,0--1,2) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,2) parse error Unmatched '{|' diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl index 074b9f0b601..4582e5eca53 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-03.fs", false, - QualifiedNameOfFile AnonymousRecords-03, [], [], + QualifiedNameOfFile AnonymousRecords-03, [], [SynModuleOrNamespace ([AnonymousRecords-03], false, AnonModule, [Expr @@ -12,6 +12,7 @@ ImplFile { OpeningBraceRange = (1,7--1,9) }), (1,0--2,0))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,7)-(1,9) parse error Unmatched '{|' diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-04.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-04.fs.bsl index 3314197171d..64a376f178c 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-04.fs", false, - QualifiedNameOfFile AnonymousRecords-04, [], [], + QualifiedNameOfFile AnonymousRecords-04, [], [SynModuleOrNamespace ([AnonymousRecords-04], false, AnonModule, [Expr @@ -10,6 +10,7 @@ ImplFile (1,0--1,2))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,2) parse error Unmatched '{|' diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-05.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-05.fs.bsl index fde8214fb91..38eb618a0ed 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-05.fs", false, - QualifiedNameOfFile AnonymousRecords-05, [], [], + QualifiedNameOfFile AnonymousRecords-05, [], [SynModuleOrNamespace ([AnonymousRecords-05], false, AnonModule, [Expr @@ -10,6 +10,7 @@ ImplFile (1,0--1,9))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,7)-(1,9) parse error Unmatched '{|' diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl index 90e976cc843..9994586b626 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-06.fs", false, - QualifiedNameOfFile AnonymousRecords-06, [], [], + QualifiedNameOfFile AnonymousRecords-06, [], [SynModuleOrNamespace ([AnonymousRecords-06], false, AnonModule, [Let @@ -31,6 +31,7 @@ ImplFile EqualsRange = Some (1,8--1,9) })], (1,0--1,39))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'AnonymousRecords-06' based on the file name 'AnonymousRecords-06.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 01.fs.bsl index 4c3ccc484a3..39cbf2026e0 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 02.fs.bsl index e6453f7d365..fe9b811b7f4 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,4 +22,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 03.fs.bsl index 5e7b2edfe2e..5bfca010bf6 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,5) parse error Unexpected token '=' or incomplete expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 04.fs.bsl index 9fabf903f5c..5939066e98c 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -38,6 +38,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,11)-(3,12) parse error Unexpected token '=' or incomplete expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 05.fs.bsl index 252070781e5..43fc5bc8157 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -38,6 +38,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,6) parse error Unexpected symbol ',' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 06.fs.bsl index f0fd4f42abb..930c655f57a 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 06.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -49,6 +49,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(3,13) parse error Unexpected symbol ',' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Eq 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Eq 07.fs.bsl index 09316e6513d..c78056c2631 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Eq 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Eq 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Eq 07.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -38,6 +38,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Plus 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Plus 01.fs.bsl index 748e99e38be..36821c30963 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Plus 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Plus 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Plus 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Plus 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Plus 02.fs.bsl index 8233f7b8725..145364c43c1 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Plus 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Plus 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Plus 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,3), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Plus 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Plus 03.fs.bsl index 95babc117f7..3088cf8197e 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Plus 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Plus 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Plus 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,5) parse error Unexpected token '+' or incomplete expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Plus 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Plus 04.fs.bsl index 8f5d5280bb7..6ed4a9524f4 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Plus 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Plus 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Plus 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,2) parse error Unexpected infix operator in expression diff --git a/tests/service/data/SyntaxTree/Expression/Binary - Plus 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary - Plus 05.fs.bsl index 6717b3e3537..39964c93e47 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary - Plus 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary - Plus 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Binary - Plus 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Binary 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary 01.fs.bsl index d0679ba06df..6c8f50ea30a 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Binary 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Binary 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Binary 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Binary 02.fs.bsl index 0b5419a8632..6dbcde51d91 100644 --- a/tests/service/data/SyntaxTree/Expression/Binary 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Binary 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Binary 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Binary 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -28,4 +28,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index fde625dfdba..3fdf51035f5 100644 --- a/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -4,7 +4,6 @@ ImplFile false, QualifiedNameOfFile CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField, [], - [], [SynModuleOrNamespace ([CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField], false, AnonModule, @@ -17,4 +16,5 @@ ImplFile (2,0--5,20))], PreXmlDocEmpty, [], None, (2,0--5,20), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Do 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Do 01.fs.bsl index bbac8331c5c..a5e8992fe50 100644 --- a/tests/service/data/SyntaxTree/Expression/Do 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Do 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Do 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Do 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Do (Const (Int32 1, (4,4--4,5)), (3,0--4,5)), (3,0--4,5)); @@ -8,4 +8,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Do 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Do 02.fs.bsl index b3cfba16181..bff410302b0 100644 --- a/tests/service/data/SyntaxTree/Expression/Do 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Do 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Do 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Do 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Do (Const (Int32 1, (4,4--4,5)), (3,0--4,5)), (3,0--4,5)); @@ -8,4 +8,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Do 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Do 03.fs.bsl index 2bf1e3df8cb..846451482b1 100644 --- a/tests/service/data/SyntaxTree/Expression/Do 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Do 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Do 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Do 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Do 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Do 04.fs.bsl index 7edad619273..8e8a69fb49d 100644 --- a/tests/service/data/SyntaxTree/Expression/Do 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Do 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Do 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Do 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Do 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Do 05.fs.bsl index 8707692afc7..7fa6c873dd7 100644 --- a/tests/service/data/SyntaxTree/Expression/Do 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Do 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Do 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Do 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Casts.fsx.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Casts.fsx.bsl index e0923b67823..40768a3059a 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Casts.fsx.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Casts.fsx.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda - _ Recovery - Casts.fsx", true, - QualifiedNameOfFile DotLambda - _ Recovery - Casts$fsx, [], [], + QualifiedNameOfFile DotLambda - _ Recovery - Casts$fsx, [], [SynModuleOrNamespace ([DotLambda - _ Recovery - Casts], false, AnonModule, [Let @@ -60,6 +60,7 @@ ImplFile EqualsRange = Some (3,6--3,7) })], (3,0--3,19))], PreXmlDocEmpty, [], None, (1,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,19)-(1,20) parse error Unexpected symbol ')' in expression. Expected '.' or other token. diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Eof.fsx.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Eof.fsx.bsl index f481a08bdd5..f337a4c3922 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Eof.fsx.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery - Eof.fsx.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda - _ Recovery - Eof.fsx", true, - QualifiedNameOfFile DotLambda - _ Recovery - Eof$fsx, [], [], + QualifiedNameOfFile DotLambda - _ Recovery - Eof$fsx, [], [SynModuleOrNamespace ([DotLambda - _ Recovery - Eof], false, AnonModule, [Expr @@ -18,6 +18,7 @@ ImplFile (1,0--1,6)), (1,0--1,6))], PreXmlDocEmpty, [], None, (1,0--1,6), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,5)-(1,6) parse error Unexpected end of input in expression diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery.fsx.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery.fsx.bsl index 1dfda19d13b..02ac877b298 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery.fsx.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda - _ Recovery.fsx.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda - _ Recovery.fsx", true, - QualifiedNameOfFile DotLambda - _ Recovery$fsx, [], [], + QualifiedNameOfFile DotLambda - _ Recovery$fsx, [], [SynModuleOrNamespace ([DotLambda - _ Recovery], false, AnonModule, [Expr @@ -10,6 +10,7 @@ ImplFile Some (1,2--1,3), (1,0--1,3)), (1,0--1,3))], PreXmlDocEmpty, [], None, (1,0--1,3), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,2)-(1,3) parse error Unexpected symbol ')' in expression. Expected '.' or other token. diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery - Eof.fsx.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery - Eof.fsx.bsl index 878b39bfb7a..3336a9e9419 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery - Eof.fsx.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery - Eof.fsx.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda - _. Recovery - Eof.fsx", true, - QualifiedNameOfFile DotLambda - _. Recovery - Eof$fsx, [], [], + QualifiedNameOfFile DotLambda - _. Recovery - Eof$fsx, [], [SynModuleOrNamespace ([DotLambda - _; Recovery - Eof], false, AnonModule, [Expr @@ -21,6 +21,7 @@ ImplFile DotRange = (1,6--1,7) }), (1,0--1,7)), (1,0--1,7))], PreXmlDocEmpty, [], None, (1,0--1,7), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,6)-(1,7) parse error Unexpected end of input in expression diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery.fsx.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery.fsx.bsl index 0bc367b4df3..3f0ab6de4e0 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery.fsx.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda - _. Recovery.fsx.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda - _. Recovery.fsx", true, - QualifiedNameOfFile DotLambda - _. Recovery$fsx, [], [], + QualifiedNameOfFile DotLambda - _. Recovery$fsx, [], [SynModuleOrNamespace ([DotLambda - _; Recovery], false, AnonModule, [Expr @@ -13,6 +13,7 @@ ImplFile (1,0--1,4)), (1,0--1,4))], PreXmlDocEmpty, [], None, (1,0--1,4), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,3)-(1,4) parse error Unexpected symbol ')' in expression diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_ArgumentExpressionInInnerAppExpression.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_ArgumentExpressionInInnerAppExpression.fs.bsl index cba7a3d17c6..ea4488dc2eb 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_ArgumentExpressionInInnerAppExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_ArgumentExpressionInInnerAppExpression.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/Expression/DotLambda_ArgumentExpressionInInnerAppExpression.fs", false, QualifiedNameOfFile DotLambda_ArgumentExpressionInInnerAppExpression, [], - [], [SynModuleOrNamespace ([DotLambda_ArgumentExpressionInInnerAppExpression], false, AnonModule, [Let @@ -29,4 +28,5 @@ ImplFile (1,0--1,17))], PreXmlDocEmpty, [], None, (1,0--1,17), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_FunctionWithUnderscoreDotLambda.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_FunctionWithUnderscoreDotLambda.fs.bsl index 378bed8cdf2..38bb6337e0a 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_FunctionWithUnderscoreDotLambda.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_FunctionWithUnderscoreDotLambda.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_FunctionWithUnderscoreDotLambda.fs", false, - QualifiedNameOfFile DotLambda_FunctionWithUnderscoreDotLambda, [], [], + QualifiedNameOfFile DotLambda_FunctionWithUnderscoreDotLambda, [], [SynModuleOrNamespace ([DotLambda_FunctionWithUnderscoreDotLambda], false, AnonModule, [Let @@ -22,4 +22,5 @@ ImplFile EqualsRange = Some (1,11--1,12) })], (1,0--1,25))], PreXmlDocEmpty, [], None, (1,0--1,25), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_NestedPropertiesAfterUnderscore.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_NestedPropertiesAfterUnderscore.fs.bsl index ad08dcfcd15..2211e80a157 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_NestedPropertiesAfterUnderscore.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_NestedPropertiesAfterUnderscore.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_NestedPropertiesAfterUnderscore.fs", false, - QualifiedNameOfFile DotLambda_NestedPropertiesAfterUnderscore, [], [], + QualifiedNameOfFile DotLambda_NestedPropertiesAfterUnderscore, [], [SynModuleOrNamespace ([DotLambda_NestedPropertiesAfterUnderscore], false, AnonModule, [Let @@ -26,4 +26,5 @@ ImplFile EqualsRange = Some (1,11--1,12) })], (1,0--1,41))], PreXmlDocEmpty, [], None, (1,0--1,41), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_NotAllowedFunctionExpressionWithArg.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_NotAllowedFunctionExpressionWithArg.fs.bsl index 561a8c4d1ee..a8b3627712a 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_NotAllowedFunctionExpressionWithArg.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_NotAllowedFunctionExpressionWithArg.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_NotAllowedFunctionExpressionWithArg.fs", false, - QualifiedNameOfFile DotLambda_NotAllowedFunctionExpressionWithArg, [], [], + QualifiedNameOfFile DotLambda_NotAllowedFunctionExpressionWithArg, [], [SynModuleOrNamespace ([DotLambda_NotAllowedFunctionExpressionWithArg], false, AnonModule, [Let @@ -24,4 +24,5 @@ ImplFile (1,0--1,15))], PreXmlDocEmpty, [], None, (1,0--1,15), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelLet.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelLet.fs.bsl index 7b8f9aa8c69..981cafe11c6 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelLet.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelLet.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_TopLevelLet.fs", false, - QualifiedNameOfFile DotLambda_TopLevelLet, [], [], + QualifiedNameOfFile DotLambda_TopLevelLet, [], [SynModuleOrNamespace ([DotLambda_TopLevelLet], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile (1,0--1,25))], PreXmlDocEmpty, [], None, (1,0--1,25), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelStandaloneDotLambda.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelStandaloneDotLambda.fs.bsl index 2c57852951a..dfc66d9269e 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelStandaloneDotLambda.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_TopLevelStandaloneDotLambda.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_TopLevelStandaloneDotLambda.fs", false, - QualifiedNameOfFile DotLambda_TopLevelStandaloneDotLambda, [], [], + QualifiedNameOfFile DotLambda_TopLevelStandaloneDotLambda, [], [SynModuleOrNamespace ([DotLambda_TopLevelStandaloneDotLambda], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile (1,0--1,17)), (1,0--1,17))], PreXmlDocEmpty, [], None, (1,0--1,17), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication.fs.bsl index 5d634a011a2..f469e8302b0 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication.fs", false, QualifiedNameOfFile - DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication, [], [], + DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication, [], [SynModuleOrNamespace ([DotLambda_UnderscoreToFunctionCallWithSpaceAndUnitApplication], false, AnonModule, @@ -28,4 +28,5 @@ ImplFile EqualsRange = Some (1,11--1,12) })], (1,0--1,30))], PreXmlDocEmpty, [], None, (1,0--1,30), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToString.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToString.fs.bsl index 177818e273f..8fe0a2efe72 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToString.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_UnderscoreToString.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_UnderscoreToString.fs", false, - QualifiedNameOfFile DotLambda_UnderscoreToString, [], [], + QualifiedNameOfFile DotLambda_UnderscoreToString, [], [SynModuleOrNamespace ([DotLambda_UnderscoreToString], false, AnonModule, [Expr @@ -13,4 +13,5 @@ ImplFile (1,0--1,12))], PreXmlDocEmpty, [], None, (1,0--1,12), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_WithNonTupledFunctionCall.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_WithNonTupledFunctionCall.fs.bsl index 2aaeb2c9bff..7786431ba6a 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_WithNonTupledFunctionCall.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_WithNonTupledFunctionCall.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_WithNonTupledFunctionCall.fs", false, - QualifiedNameOfFile DotLambda_WithNonTupledFunctionCall, [], [], + QualifiedNameOfFile DotLambda_WithNonTupledFunctionCall, [], [SynModuleOrNamespace ([DotLambda_WithNonTupledFunctionCall], false, AnonModule, [Let @@ -30,4 +30,5 @@ ImplFile EqualsRange = Some (1,11--1,12) })], (1,0--1,37))], PreXmlDocEmpty, [], None, (1,0--1,37), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutDot.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutDot.fs.bsl index c9e140cb3a0..99bf5675320 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutDot.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutDot.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_WithoutDot.fs", false, - QualifiedNameOfFile DotLambda_WithoutDot, [], [], + QualifiedNameOfFile DotLambda_WithoutDot, [], [SynModuleOrNamespace ([DotLambda_WithoutDot], false, AnonModule, [Expr @@ -10,4 +10,5 @@ ImplFile (1,0--1,11)), (1,0--1,11))], PreXmlDocEmpty, [], None, (1,0--1,11), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutUnderscore.fs.bsl b/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutUnderscore.fs.bsl index 624a15c29e4..4600f7b41e8 100644 --- a/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutUnderscore.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/DotLambda_WithoutUnderscore.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/Expression/DotLambda_WithoutUnderscore.fs", false, - QualifiedNameOfFile DotLambda_WithoutUnderscore, [], [], + QualifiedNameOfFile DotLambda_WithoutUnderscore, [], [SynModuleOrNamespace ([DotLambda_WithoutUnderscore], false, AnonModule, [], PreXmlDocEmpty, [], None, (1,0--1,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,1) parse error Unexpected symbol '.' in implementation file diff --git a/tests/service/data/SyntaxTree/Expression/Downcast 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Downcast 01.fs.bsl index 8fde0743e4b..e090f188cc3 100644 --- a/tests/service/data/SyntaxTree/Expression/Downcast 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Downcast 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Downcast 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Downcast 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Downcast 02.fs.bsl index d9a03af749d..18d0a648f3b 100644 --- a/tests/service/data/SyntaxTree/Expression/Downcast 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Downcast 02.fs.bsl @@ -1,13 +1,13 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Downcast 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Downcast (Ident i, Anon (4,0--4,2), (3,0--4,2)), (3,0--4,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,1)-(4,2) parse error Unexpected symbol ')' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Downcast 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Downcast 03.fs.bsl index fab179734b2..dae32087164 100644 --- a/tests/service/data/SyntaxTree/Expression/Downcast 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Downcast 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Downcast 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,4 +10,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/For 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/For 01.fs.bsl index 97d7c7cb03e..ff36ce94f17 100644 --- a/tests/service/data/SyntaxTree/Expression/For 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/For 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/For 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/For 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,4 +12,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/For 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/For 02.fs.bsl index aad044dcf30..06684182ce5 100644 --- a/tests/service/data/SyntaxTree/Expression/For 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/For 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/For 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/For 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,4 +12,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/For 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/For 03.fs.bsl index 023ec9d79e0..f0fcaf35d0a 100644 --- a/tests/service/data/SyntaxTree/Expression/For 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/For 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/For 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/For 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/For 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/For 04.fs.bsl index 41ed392a753..2f2bdc1381a 100644 --- a/tests/service/data/SyntaxTree/Expression/For 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/For 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/For 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/For 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -22,4 +22,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/For 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/For 05.fs.bsl index 9a71d8f9e4c..034c9fb57de 100644 --- a/tests/service/data/SyntaxTree/Expression/For 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/For 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/For 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/For 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -22,4 +22,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/GlobalKeywordAsSynExpr.fs.bsl b/tests/service/data/SyntaxTree/Expression/GlobalKeywordAsSynExpr.fs.bsl index d76e9fe48b4..cf9e8ee0a9b 100644 --- a/tests/service/data/SyntaxTree/Expression/GlobalKeywordAsSynExpr.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/GlobalKeywordAsSynExpr.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/GlobalKeywordAsSynExpr.fs", false, - QualifiedNameOfFile GlobalKeywordAsSynExpr, [], [], + QualifiedNameOfFile GlobalKeywordAsSynExpr, [], [SynModuleOrNamespace ([GlobalKeywordAsSynExpr], false, AnonModule, [Expr @@ -12,4 +12,5 @@ ImplFile (2,0--2,6)), (2,0--2,6))], PreXmlDocEmpty, [], None, (2,0--2,6), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Id 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 01.fs.bsl index e24dcc6b23b..6d2f542b4d3 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 01.fs.bsl @@ -1,9 +1,10 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Id 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Ident a, (3,0--3,1))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Id 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 02.fs.bsl index d46a4254b22..108d2f3c42f 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 02.fs.bsl @@ -1,12 +1,13 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Id 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Ident a, (3,0--3,3)); Expr (Ident b, (4,0--4,1))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,3) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Id 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 03.fs.bsl index 26ef9dd71d4..bb388104ac3 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Id 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (FromParseError (Ident , (3,0--3,2)), (3,0--3,2)); @@ -8,6 +8,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,2) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Id 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 04.fs.bsl index c76189328b1..55cfbf59da5 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Id 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (FromParseError (Ident , (3,0--3,1)), (3,0--3,1)); @@ -8,6 +8,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Id 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 05.fs.bsl index 2e3f9d5568d..9d258b6db1a 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Id 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Id 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 06.fs.bsl index bade7e896ea..e175c015187 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 06.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 06.fs", false, QualifiedNameOfFile Id 06, [], [], + ("/root/Expression/Id 06.fs", false, QualifiedNameOfFile Id 06, [], [SynModuleOrNamespace ([Id 06], false, AnonModule, [Expr (FromParseError (Ident , (1,0--1,2)), (1,0--1,2))], PreXmlDocEmpty, [], None, (1,0--1,2), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,2) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Id 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Id 07.fs.bsl index 60d8974e781..aee51fa86ae 100644 --- a/tests/service/data/SyntaxTree/Expression/Id 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Id 07.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Id 07.fs", false, QualifiedNameOfFile Id 07, [], [], + ("/root/Expression/Id 07.fs", false, QualifiedNameOfFile Id 07, [], [SynModuleOrNamespace ([Id 07], false, AnonModule, [Expr (FromParseError (Ident , (1,0--1,1)), (1,0--1,1))], PreXmlDocEmpty, [], None, (1,0--1,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,1) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/If 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 01.fs.bsl index 775d6d7764d..f39f9211e22 100644 --- a/tests/service/data/SyntaxTree/Expression/If 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,4 +15,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/If 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 02.fs.bsl index 8f026aa409e..8a3b70d7861 100644 --- a/tests/service/data/SyntaxTree/Expression/If 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,4 +15,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/If 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 03.fs.bsl index c68682f6f59..ae9e6a4ec23 100644 --- a/tests/service/data/SyntaxTree/Expression/If 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(5,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/If 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 04.fs.bsl index 99ffbe73e73..f2495d64253 100644 --- a/tests/service/data/SyntaxTree/Expression/If 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(5,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/If 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 05.fs.bsl index 0197cbcd0d2..b890559871b 100644 --- a/tests/service/data/SyntaxTree/Expression/If 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/If 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 06.fs.bsl index 2c0215d0a8f..e1d1405077e 100644 --- a/tests/service/data/SyntaxTree/Expression/If 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,4) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/If 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 07.fs.bsl index d4d53023ff8..781ea3d377e 100644 --- a/tests/service/data/SyntaxTree/Expression/If 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/If 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 08.fs.bsl index 016bc4dbfe7..9f0b60b3108 100644 --- a/tests/service/data/SyntaxTree/Expression/If 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/If 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 09.fs.bsl index 6541b409bd9..8756a96f138 100644 --- a/tests/service/data/SyntaxTree/Expression/If 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/If 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/If 10.fs.bsl index ef03391599d..096cafbaaff 100644 --- a/tests/service/data/SyntaxTree/Expression/If 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/If 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/If 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/If 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index 8c19bf183e8..8e2a71ee797 100644 --- a/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField, - [], [], + [], [SynModuleOrNamespace ([InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField], false, AnonModule, @@ -23,4 +23,5 @@ ImplFile (2,0--2,34))], PreXmlDocEmpty, [], None, (2,0--2,34), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 01.fs.bsl index f67f65c9688..da7586f679b 100644 --- a/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Lambda - Missing expr 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,1)-(3,9) parse error Missing function body diff --git a/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 02.fs.bsl index 42bbbc58539..db52b133a52 100644 --- a/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lambda - Missing expr 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Lambda - Missing expr 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (1:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Lambda 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lambda 01.fs.bsl index 095a5f6834a..710431524da 100644 --- a/tests/service/data/SyntaxTree/Expression/Lambda 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lambda 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Lambda 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Lambda 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,4 +16,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Lambda 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lambda 02.fs.bsl index 82cf6a37d3a..e95c7440fd7 100644 --- a/tests/service/data/SyntaxTree/Expression/Lambda 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lambda 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Lambda 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Lambda 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,4 +14,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Lazy 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lazy 01.fs.bsl index 9af75da75fe..38abbd179a4 100644 --- a/tests/service/data/SyntaxTree/Expression/Lazy 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lazy 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Lazy 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Lazy 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Lazy 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lazy 02.fs.bsl index 32e1522a9e5..c1441f5807d 100644 --- a/tests/service/data/SyntaxTree/Expression/Lazy 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lazy 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Lazy 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Lazy 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Lazy 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Lazy 03.fs.bsl index 17a4c9785fb..6b04c031cd7 100644 --- a/tests/service/data/SyntaxTree/Expression/Lazy 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Lazy 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Lazy 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Lazy 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Let 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Let 01.fs.bsl index 8eaabfb3d65..634f5cbd322 100644 --- a/tests/service/data/SyntaxTree/Expression/Let 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Let 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Let 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Let 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Let 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Let 02.fs.bsl index bf9b340b539..e033e0ed9f1 100644 --- a/tests/service/data/SyntaxTree/Expression/Let 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Let 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Let 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Let 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/List - Comprehension 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/List - Comprehension 01.fs.bsl index 517c835a63a..a80d19b37bd 100644 --- a/tests/service/data/SyntaxTree/Expression/List - Comprehension 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/List - Comprehension 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/List - Comprehension 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/List - Comprehension 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/List - Comprehension 02.fs.bsl index 9897592fb0a..84d19bf27f3 100644 --- a/tests/service/data/SyntaxTree/Expression/List - Comprehension 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/List - Comprehension 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/List - Comprehension 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(3,18) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/NestedSynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/NestedSynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl index 791f6099b9e..51a31c623dd 100644 --- a/tests/service/data/SyntaxTree/Expression/NestedSynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/NestedSynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/Expression/NestedSynExprLetOrUseContainsTheRangeOfInKeyword.fs", false, QualifiedNameOfFile NestedSynExprLetOrUseContainsTheRangeOfInKeyword, [], - [], [SynModuleOrNamespace ([NestedSynExprLetOrUseContainsTheRangeOfInKeyword], false, AnonModule, [Let @@ -64,4 +63,5 @@ ImplFile EqualsRange = Some (2,9--2,10) })], (2,0--5,9))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,17--3,55)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 01.fs.bsl index cf716944487..01cc65b67ec 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -33,4 +33,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 02.fs.bsl index 9a06f01ae6e..d09eb05ae24 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -60,4 +60,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 03.fs.bsl index 92401919062..14eb81a9938 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -88,4 +88,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--10,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 04.fs.bsl index 5b7efb7cdf9..b5f3b9cfb96 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,15)-(3,16) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 05.fs.bsl index d4dbc824d6d..ec7aab469c5 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,5)-(4,6) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 06.fs.bsl index 1880c3c044f..37a61aeba7d 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 06.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -34,6 +34,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(4,13) parse error Incomplete structured construct at or before this point in object expression diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 07.fs.bsl index eeaef3fd16a..bf1c735224d 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 07.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -33,6 +33,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,17)-(4,18) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 08.fs.bsl index f7c76b0b8fb..33c5ba7f048 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 08.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -33,6 +33,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,18)-(4,19) parse error Identifier expected diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 09.fs.bsl index 831deffbeac..8f5d7ae0774 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 09.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,19)-(4,20) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 10.fs.bsl index d7670c74151..dd507d0fa2c 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 10.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -37,6 +37,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,21)-(4,22) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 11.fs.bsl index ff41ad2a5d8..eeb2063d6ac 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 11.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -59,6 +59,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,5)-(5,11) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:6). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 12.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 12.fs.bsl index 53d26ec6e93..28a4afa9b04 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 12.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -58,6 +58,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,20)-(5,5) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 13.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 13.fs.bsl index 6567abe2e7b..8127a275f38 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 13.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 13.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -55,6 +55,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,18)-(5,5) parse error Incomplete structured construct at or before this point in object expression diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 14.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 14.fs.bsl index 64530949bbc..fbebde8b07c 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 14.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 14.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -55,6 +55,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,17)-(5,5) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Expression/Object - Class 15.fs.bsl b/tests/service/data/SyntaxTree/Expression/Object - Class 15.fs.bsl index ec08bebfe92..ed81dff8214 100644 --- a/tests/service/data/SyntaxTree/Expression/Object - Class 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Object - Class 15.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Object - Class 15.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -56,6 +56,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(5,5) parse error Incomplete structured construct at or before this point in object expression diff --git a/tests/service/data/SyntaxTree/Expression/Rarrow 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Rarrow 01.fs.bsl index c3c454436ce..770fbc8ed98 100644 --- a/tests/service/data/SyntaxTree/Expression/Rarrow 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Rarrow 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Rarrow 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Rarrow 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,4) parse error The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. diff --git a/tests/service/data/SyntaxTree/Expression/Rarrow 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Rarrow 02.fs.bsl index 3a0af632862..59d36bd5980 100644 --- a/tests/service/data/SyntaxTree/Expression/Rarrow 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Rarrow 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Rarrow 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Rarrow 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,6 +11,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Rarrow 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Rarrow 03.fs.bsl index ceae74bf09b..e62be3cb75a 100644 --- a/tests/service/data/SyntaxTree/Expression/Rarrow 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Rarrow 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Rarrow 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Rarrow 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl index 0e74d6eb486..409a6349663 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -13,4 +13,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl index 52748529a11..abb4f9c61af 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(3,9) parse error Unexpected symbol '|}' in definition diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 03.fs.bsl index dbb9b6e063f..24b70e7a5c0 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,6 +11,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 04.fs.bsl index 07303e1a146..d20ecba85e3 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,6) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 05.fs.bsl index 6c2cefee45d..c80a4ecab50 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,7) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 06.fs.bsl index edbeaa194e6..093f445494c 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 06.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,8) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl index 1bc1a409d91..0a2441bca98 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 07.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,3)-(4,5) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl index 0cd4a997180..70fdc8e6a09 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 08.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,3)-(4,5) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl index e851232c521..c40cd96963e 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 09.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl index 2e01c7ef8c7..cc908ff2853 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 10.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,3)-(4,5) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl index 97ffe8e441d..4fe46cfb3d5 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 11.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,4 +22,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Anon 12.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Anon 12.fs.bsl index 3371e7a75e6..0fcf36be842 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Anon 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Anon 12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Anon 12.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,5) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 01.fs.bsl index be62dae5864..7c25259a523 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 01.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 02.fs.bsl index 41d98a61173..7000a0b1901 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 02.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,6) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl index 7ca89a4c8ed..d15f4c6b78c 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 03.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl index d37f41ae725..c395eb014d6 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 04.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,6) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl index f0baef9a8ff..8c12002c7d8 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 05.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -14,4 +14,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl index a280f304f7d..9126643f0cf 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 06.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -14,4 +14,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 07.fs.bsl index 58a717c0121..6bc57ed48ca 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 07.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl index a9a2cbc8047..a50149dd91b 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 08.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,3)-(4,4) parse error Unexpected end of type. Expected a name after this point. diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl index 6132a89bd66..19fe3d819a2 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 09.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,3) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 10.fs.bsl index 0b0379f5dbf..02cb421c64e 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 10.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -23,4 +23,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl index 6b20cddae13..1ba251bdb3a 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 11.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,7) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl index f1c61f45015..3cdbc54ea47 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 12.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -25,4 +25,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl index 0012edc2639..f059d4924a4 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 13.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,4) parse error Field bindings must have the form 'id = expr;' diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl index 1afdd819fb1..a3acec5a7b7 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Record - Field 14.fs", false, QualifiedNameOfFile Foo, - [], [], + [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Expr @@ -28,4 +28,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Sequential 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Sequential 01.fs.bsl index c42ed608ed2..763ab6d97b8 100644 --- a/tests/service/data/SyntaxTree/Expression/Sequential 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Sequential 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Sequential 01.fs", false, - QualifiedNameOfFile Sequential 01, [], [], + QualifiedNameOfFile Sequential 01, [], [SynModuleOrNamespace ([Sequential 01], false, AnonModule, [Expr @@ -12,6 +12,7 @@ ImplFile (1,0--1,8))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Sequential 01' based on the file name 'Sequential 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Expression/Sequential 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Sequential 02.fs.bsl index 7d58b85ed22..724388842b5 100644 --- a/tests/service/data/SyntaxTree/Expression/Sequential 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Sequential 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Sequential 02.fs", false, - QualifiedNameOfFile Sequential 02, [], [], + QualifiedNameOfFile Sequential 02, [], [SynModuleOrNamespace ([Sequential 02], false, AnonModule, [Expr @@ -12,6 +12,7 @@ ImplFile (1,0--1,11))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Sequential 02' based on the file name 'Sequential 02.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Expression/Sequential 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Sequential 03.fs.bsl index b04598b79fd..064662b49c7 100644 --- a/tests/service/data/SyntaxTree/Expression/Sequential 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Sequential 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Sequential 03.fs", false, - QualifiedNameOfFile Sequential 03, [], [], + QualifiedNameOfFile Sequential 03, [], [SynModuleOrNamespace ([Sequential 03], false, AnonModule, [Expr @@ -14,6 +14,7 @@ ImplFile (1,0--1,21)), (1,0--1,21))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Sequential 03' based on the file name 'Sequential 03.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Expression/Set 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Set 01.fs.bsl index 68e1f2c85c2..6fa90963927 100644 --- a/tests/service/data/SyntaxTree/Expression/Set 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Set 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Set 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Set 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,4 +11,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Set 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Set 02.fs.bsl index da5e8af6a69..f7e69c6dde9 100644 --- a/tests/service/data/SyntaxTree/Expression/Set 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Set 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Set 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Set 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,4 +11,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Set 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Set 03.fs.bsl index fc450c30c94..e2eb444e310 100644 --- a/tests/service/data/SyntaxTree/Expression/Set 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Set 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Set 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Set 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,4 +10,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Set 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Set 04.fs.bsl index ee798381576..297ef11ba05 100644 --- a/tests/service/data/SyntaxTree/Expression/Set 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Set 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Set 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Set 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl index 4e6e88c4234..abb76d98ae6 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecdWithStructKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprAnonRecdWithStructKeyword.fs", false, - QualifiedNameOfFile SynExprAnonRecdWithStructKeyword, [], [], + QualifiedNameOfFile SynExprAnonRecdWithStructKeyword, [], [SynModuleOrNamespace ([SynExprAnonRecdWithStructKeyword], false, AnonModule, [Expr @@ -16,4 +16,5 @@ ImplFile (7,0--7,12))], PreXmlDocEmpty, [], None, (2,0--7,12), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,4--4,11)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl index 534c40ade09..e7e6666975a 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields.fs", false, QualifiedNameOfFile - SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields, [], [], + SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields, [], [SynModuleOrNamespace ([SynExprAnonRecordContainsTheRangeOfTheEqualsSignInTheFields], false, AnonModule, @@ -19,4 +19,5 @@ ImplFile { OpeningBraceRange = (2,0--2,2) }), (2,0--4,18))], PreXmlDocEmpty, [], None, (2,0--4,18), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprDoContainsTheRangeOfTheDoKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprDoContainsTheRangeOfTheDoKeyword.fs.bsl index 4b3437c248d..651879d2cb0 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprDoContainsTheRangeOfTheDoKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprDoContainsTheRangeOfTheDoKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprDoContainsTheRangeOfTheDoKeyword.fs", false, - QualifiedNameOfFile SynExprDoContainsTheRangeOfTheDoKeyword, [], [], + QualifiedNameOfFile SynExprDoContainsTheRangeOfTheDoKeyword, [], [SynModuleOrNamespace ([SynExprDoContainsTheRangeOfTheDoKeyword], false, AnonModule, [Let @@ -23,4 +23,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--6,18))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainIdent.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainIdent.fs.bsl index fe39cf8a627..872dba8d062 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainIdent.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainIdent.fs.bsl @@ -1,10 +1,11 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprDynamicDoesContainIdent.fs", false, - QualifiedNameOfFile SynExprDynamicDoesContainIdent, [], [], + QualifiedNameOfFile SynExprDynamicDoesContainIdent, [], [SynModuleOrNamespace ([SynExprDynamicDoesContainIdent], false, AnonModule, [Expr (Dynamic (Ident x, (2,1--2,2), Ident k, (2,0--2,3)), (2,0--2,3))], PreXmlDocEmpty, [], None, (2,0--2,3), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainParentheses.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainParentheses.fs.bsl index 46eee1bf1b6..c22b13523e0 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainParentheses.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprDynamicDoesContainParentheses.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprDynamicDoesContainParentheses.fs", false, - QualifiedNameOfFile SynExprDynamicDoesContainParentheses, [], [], + QualifiedNameOfFile SynExprDynamicDoesContainParentheses, [], [SynModuleOrNamespace ([SynExprDynamicDoesContainParentheses], false, AnonModule, [Expr @@ -11,4 +11,5 @@ ImplFile (2,0--2,5)), (2,0--2,5))], PreXmlDocEmpty, [], None, (2,0--2,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprForContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprForContainsTheRangeOfTheEqualsSign.fs.bsl index e62b4dc35d8..d2c4077e59c 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprForContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprForContainsTheRangeOfTheEqualsSign.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprForContainsTheRangeOfTheEqualsSign.fs", false, - QualifiedNameOfFile SynExprForContainsTheRangeOfTheEqualsSign, [], [], + QualifiedNameOfFile SynExprForContainsTheRangeOfTheEqualsSign, [], [SynModuleOrNamespace ([SynExprForContainsTheRangeOfTheEqualsSign], false, AnonModule, [Expr @@ -18,4 +18,5 @@ ImplFile (2,0--3,14))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs.bsl index 0264686482c..c5a6b577bc1 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/Expression/SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign.fs", false, QualifiedNameOfFile SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign, [], - [], [SynModuleOrNamespace ([SynExprLetOrUseBangContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -33,4 +32,5 @@ ImplFile (2,0--6,1)), (2,0--6,1))], PreXmlDocEmpty, [], None, (2,0--6,1), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl index 5408f5d71d1..47612e2ac1c 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprLetOrUseContainsTheRangeOfInKeyword.fs", false, - QualifiedNameOfFile SynExprLetOrUseContainsTheRangeOfInKeyword, [], [], + QualifiedNameOfFile SynExprLetOrUseContainsTheRangeOfInKeyword, [], [SynModuleOrNamespace ([SynExprLetOrUseContainsTheRangeOfInKeyword], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile InKeyword = Some (2,10--2,12) }), (2,0--2,15))], PreXmlDocEmpty, [], None, (2,0--2,15), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseDoesNotContainTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseDoesNotContainTheRangeOfInKeyword.fs.bsl index bb9dcafe15f..a7ba9540a40 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseDoesNotContainTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseDoesNotContainTheRangeOfInKeyword.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/Expression/SynExprLetOrUseDoesNotContainTheRangeOfInKeyword.fs", false, QualifiedNameOfFile SynExprLetOrUseDoesNotContainTheRangeOfInKeyword, [], - [], [SynModuleOrNamespace ([SynExprLetOrUseDoesNotContainTheRangeOfInKeyword], false, AnonModule, [Expr @@ -26,4 +25,5 @@ ImplFile InKeyword = None }), (2,0--4,2)), (2,0--4,2))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword.fs.bsl index 554f4eb21ef..691c7762f37 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword, - [], [], + [], [SynModuleOrNamespace ([SynExprLetOrUseWhereBodyExprStartsWithTokenOfTwoCharactersDoesNotContainTheRangeOfInKeyword], false, AnonModule, @@ -45,4 +45,5 @@ ImplFile (2,0--4,16))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword.fs.bsl index 8b57f33b953..b2ac0ca44e8 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword.fs", false, QualifiedNameOfFile - SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword, [], [], + SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword, [], [SynModuleOrNamespace ([SynExprLetOrUseWithRecursiveBindingContainsTheRangeOfInKeyword], false, AnonModule, @@ -39,4 +39,5 @@ ImplFile InKeyword = Some (4,15--4,17) }), (2,0--5,6)), (2,0--5,6))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl index e70d8c752eb..871e70098d3 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword.fs", false, QualifiedNameOfFile - SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword, [], [], + SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword, [], [SynModuleOrNamespace ([SynExprMatchBangContainsTheRangeOfTheMatchAndWithKeyword], false, AnonModule, @@ -18,4 +18,5 @@ ImplFile WithKeyword = (2,9--2,13) }), (2,0--3,8))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl index acbf05115af..f1e4b950125 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword.fs", false, QualifiedNameOfFile SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword, - [], [], + [], [SynModuleOrNamespace ([SynExprMatchContainsTheRangeOfTheMatchAndWithKeyword], false, AnonModule, @@ -18,4 +18,5 @@ ImplFile WithKeyword = (2,8--2,12) }), (2,0--3,8))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprObjExprContainsTheRangeOfWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprObjExprContainsTheRangeOfWithKeyword.fs.bsl index c84d9fb3d27..8ee3426fb4e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprObjExprContainsTheRangeOfWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprObjExprContainsTheRangeOfWithKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprObjExprContainsTheRangeOfWithKeyword.fs", false, - QualifiedNameOfFile SynExprObjExprContainsTheRangeOfWithKeyword, [], [], + QualifiedNameOfFile SynExprObjExprContainsTheRangeOfWithKeyword, [], [SynModuleOrNamespace ([SynExprObjExprContainsTheRangeOfWithKeyword], false, AnonModule, [Expr @@ -80,4 +80,5 @@ ImplFile (5,2--6,35))], (2,2--2,11), (2,0--6,37)), (2,0--6,37))], PreXmlDocEmpty, [], None, (2,0--6,37), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl index 405f967b350..ce9e69a010f 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprObjWithSetter.fs", false, - QualifiedNameOfFile SynExprObjWithSetter, [], [], + QualifiedNameOfFile SynExprObjWithSetter, [], [SynModuleOrNamespace ([SynExprObjWithSetter], false, AnonModule, [Types @@ -100,4 +100,5 @@ ImplFile (6,0--7,69)), (6,0--7,69))], PreXmlDocEmpty, [], None, (2,0--7,69), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index bbd85336307..5287fdc598b 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs", false, QualifiedNameOfFile - SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField, [], [], + SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField, [], [SynModuleOrNamespace ([SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField], false, AnonModule, @@ -27,4 +27,5 @@ ImplFile (2,0--7,23))], PreXmlDocEmpty, [], None, (2,0--7,23), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,13--3,28)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl index 109d053a41d..8adb7c8269f 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs", false, QualifiedNameOfFile SynExprRecordFieldsContainCorrectAmountOfTrivia, - [], [], + [], [SynModuleOrNamespace ([SynExprRecordFieldsContainCorrectAmountOfTrivia], false, AnonModule, [Expr @@ -62,4 +62,5 @@ ImplFile (2,0--5,28)), (2,0--5,28))], PreXmlDocEmpty, [], None, (2,0--5,28), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprSetWithSynExprDynamic.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprSetWithSynExprDynamic.fs.bsl index 4cd0b5776e6..f919b4c95cf 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprSetWithSynExprDynamic.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprSetWithSynExprDynamic.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/SynExprSetWithSynExprDynamic.fs", false, - QualifiedNameOfFile SynExprSetWithSynExprDynamic, [], [], + QualifiedNameOfFile SynExprSetWithSynExprDynamic, [], [SynModuleOrNamespace ([SynExprSetWithSynExprDynamic], false, AnonModule, [Expr @@ -10,4 +10,5 @@ ImplFile Const (Int32 2, (2,7--2,8)), (2,0--2,8)), (2,0--2,8))], PreXmlDocEmpty, [], None, (2,0--2,8), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword.fs.bsl index 4e1d438bfe7..43d2f88584e 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword.fs", false, QualifiedNameOfFile - SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword, [], [], + SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword, [], [SynModuleOrNamespace ([SynExprTryFinallyContainsTheRangeOfTheTryAndWithKeyword], false, AnonModule, @@ -14,4 +14,5 @@ ImplFile FinallyKeyword = (4,0--4,7) }), (2,0--5,2))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword.fs.bsl index 7900862979d..690618cda81 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Expression/SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword.fs", false, QualifiedNameOfFile SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword, - [], [], + [], [SynModuleOrNamespace ([SynExprTryWithContainsTheRangeOfTheTryAndWithKeyword], false, AnonModule, @@ -21,4 +21,5 @@ ImplFile WithToEndRange = (4,0--5,9) }), (2,0--5,9))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - Finally 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - Finally 01.fs.bsl index d2437e5ebfc..5a03c6066c8 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - Finally 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - Finally 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - Finally 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - Finally 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - Finally 02.fs.bsl index 4d463ef1077..d0ad1002eea 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - Finally 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - Finally 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - Finally 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - Finally 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - Finally 03.fs.bsl index 2ad046c6c6a..05d4bf58c56 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - Finally 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - Finally 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - Finally 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - Finally 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - Finally 04.fs.bsl index 58c6e87e550..2efe693eb39 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - Finally 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - Finally 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - Finally 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 01.fs.bsl index beb30aedfe4..4b9b32262aa 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 02.fs.bsl index 0fa71a2d560..2805db17744 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 03.fs.bsl index f357989f6d7..628ff8509d0 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 04.fs.bsl index b3ed1e9fdf0..2ff3b16f3c2 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -32,6 +31,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 05.fs.bsl index cce7a7716ca..f266fe9c97d 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 05.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 05.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Incomplete structured construct at or before this point in pattern matching. Expected '->' or other token. diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 06.fs.bsl index 2f37ac458b1..367842a5c41 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 06.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 06.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -25,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 07.fs.bsl index 394af4cbd7c..3e000ea7d4a 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 07.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 07.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 08.fs.bsl index bcad7831beb..8c78faa7c9c 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 08.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 08.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Incomplete structured construct at or before this point in pattern matching. Expected '->' or other token. diff --git a/tests/service/data/SyntaxTree/Expression/Try - With 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try - With 09.fs.bsl index d3557177c85..efc7f1e612f 100644 --- a/tests/service/data/SyntaxTree/Expression/Try - With 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try - With 09.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try - With 09.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -25,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Try 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try 01.fs.bsl index 94e5c9c690d..61abb3656ca 100644 --- a/tests/service/data/SyntaxTree/Expression/Try 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Try 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Try 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in expression. Expected 'finally', 'with' or other token. diff --git a/tests/service/data/SyntaxTree/Expression/Try 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try 02.fs.bsl index b1330bbff79..57f8ddac5e9 100644 --- a/tests/service/data/SyntaxTree/Expression/Try 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Try 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Try 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 01.fs.bsl index 8a17abd5fe8..cb0e0eb6abf 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with - Missing expr 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,4) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 02.fs.bsl index 4d6eeb04f62..0ee1ddcecc9 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with - Missing expr 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 03.fs.bsl index 74ec0b40076..7fe035f2d55 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with - Missing expr 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,3), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 04.fs.bsl index 74221e70a5f..319880a8b0a 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with - Missing expr 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,3) parse error The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. diff --git a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 05.fs.bsl index e55f5f0b2ef..4c001b2e367 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with - Missing expr 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with - Missing expr 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,3), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,6) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Try with 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Try with 01.fs.bsl index 3435a66a380..e7263d93cc4 100644 --- a/tests/service/data/SyntaxTree/Expression/Try with 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Try with 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Try with 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 01.fs.bsl index 6df06c17cc4..d521c1789ec 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,2)-(3,3) parse error Expected an expression after this point diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 02.fs.bsl index 8478b3cd009..ccd6e5f67ee 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,1)-(3,2) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 03.fs.bsl index 8690087c0b8..507b7d9912a 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,1)-(3,2) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 04.fs.bsl index 142fb6f4d4d..c185b93c766 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 05.fs.bsl index 9ff45a09481..5e7cf3894a5 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,5) parse error Expected an expression after this point diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 06.fs.bsl index f1ac3a85d0a..8d07f50febd 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 06.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,2)-(3,3) parse error Unexpected symbol ',' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 07.fs.bsl index 28b3b9ebffd..9fa5505703b 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 07.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,3)-(3,4) parse error Expecting expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 08.fs.bsl index 750a36647f4..4626a7a68a3 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 08.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,0), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (1:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 09.fs.bsl index ee4a18e88a0..8e500764925 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 09.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,5) parse error Unexpected symbol ',' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 10.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 10.fs.bsl index d44279250a4..c7bf2053a39 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 10.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:9). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 11.fs.bsl index df9f4900d70..92db48f5d0d 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple - Missing item 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Tuple - Missing item 11.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,9) parse error Unexpected symbol ',' in binding diff --git a/tests/service/data/SyntaxTree/Expression/Tuple 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple 01.fs.bsl index 5310605d97b..08d3bc21594 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Tuple 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Tuple 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,4 +10,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Tuple 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Tuple 02.fs.bsl index d8ef94b69a8..f3b4e3f4e28 100644 --- a/tests/service/data/SyntaxTree/Expression/Tuple 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Tuple 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Tuple 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Tuple 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,4 +12,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Type test 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Type test 01.fs.bsl index 7e404d712a8..17a27f16a50 100644 --- a/tests/service/data/SyntaxTree/Expression/Type test 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Type test 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Type test 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Type test 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Type test 02.fs.bsl index a0c458e845c..f47e0daee15 100644 --- a/tests/service/data/SyntaxTree/Expression/Type test 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Type test 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Type test 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Type test 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Type test 03.fs.bsl index 4189996253d..84ed9ca2d0f 100644 --- a/tests/service/data/SyntaxTree/Expression/Type test 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Type test 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Type test 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(4,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Type test 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Type test 04.fs.bsl index ab70a127c9c..d01cecf2e10 100644 --- a/tests/service/data/SyntaxTree/Expression/Type test 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Type test 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Type test 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,12) parse error Unexpected keyword 'then' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Typed 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Typed 01.fs.bsl index 126033bd3a0..5defbcc13e1 100644 --- a/tests/service/data/SyntaxTree/Expression/Typed 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Typed 01.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Typed 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Typed 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Ident i, (3,0--3,1))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,1)-(3,2) parse error Unexpected symbol ':' in definition. Expected incomplete structured construct at or before this point or other token. diff --git a/tests/service/data/SyntaxTree/Expression/Typed 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Typed 02.fs.bsl index cfca2392376..e583d82bdd1 100644 --- a/tests/service/data/SyntaxTree/Expression/Typed 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Typed 02.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Typed 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Typed 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Ident i, (3,0--3,1))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,1)-(3,2) parse error Unexpected symbol ':' in definition. Expected incomplete structured construct at or before this point or other token. diff --git a/tests/service/data/SyntaxTree/Expression/Typed 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Typed 03.fs.bsl index ea133deba4a..9d829ce73d8 100644 --- a/tests/service/data/SyntaxTree/Expression/Typed 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Typed 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Typed 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Typed 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Typed 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Typed 04.fs.bsl index 2bef6b3b004..ead43033b31 100644 --- a/tests/service/data/SyntaxTree/Expression/Typed 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Typed 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Typed 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Typed 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/Expression/Unary - Reserved 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Unary - Reserved 01.fs.bsl index 0ef183357aa..9438da58699 100644 --- a/tests/service/data/SyntaxTree/Expression/Unary - Reserved 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Unary - Reserved 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Unary - Reserved 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Unary - Reserved 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Unary - Reserved 02.fs.bsl index d246acbd5b9..c913a482807 100644 --- a/tests/service/data/SyntaxTree/Expression/Unary - Reserved 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Unary - Reserved 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Unary - Reserved 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,2)-(3,3) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 01.fs.bsl index 7e4b6c613c6..40795098b50 100644 --- a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Unfinished escaped ident 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -72,6 +72,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--46,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,5) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 02.fs.bsl index d85ff5016bd..d8ac768d36b 100644 --- a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Unfinished escaped ident 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -82,6 +82,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,16)-(4,17) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 03.fs.bsl index 683dccae609..043ea507ef0 100644 --- a/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Unfinished escaped ident 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/Unfinished escaped ident 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -35,6 +35,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,3) parse error This is not a valid identifier diff --git a/tests/service/data/SyntaxTree/Expression/Upcast 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Upcast 01.fs.bsl index cd9537573ea..3a61bc5ca0e 100644 --- a/tests/service/data/SyntaxTree/Expression/Upcast 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Upcast 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Upcast 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Upcast 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -9,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Upcast 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Upcast 02.fs.bsl index 3b979512571..7349d893d1b 100644 --- a/tests/service/data/SyntaxTree/Expression/Upcast 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Upcast 02.fs.bsl @@ -1,12 +1,13 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Upcast 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Upcast 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr (Upcast (Ident i, Anon (4,0--4,2), (3,0--4,2)), (3,0--4,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,1)-(4,2) parse error Unexpected symbol ')' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Upcast 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Upcast 03.fs.bsl index 174f880184b..24b83414582 100644 --- a/tests/service/data/SyntaxTree/Expression/Upcast 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Upcast 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Upcast 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Upcast 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,4 +10,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Upcast 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Upcast 04.fs.bsl index adf29275cb5..ea64ddbe559 100644 --- a/tests/service/data/SyntaxTree/Expression/Upcast 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Upcast 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Upcast 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Upcast 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,6 +11,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/Upcast 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Upcast 05.fs.bsl index 62339dd016f..78cddea4a93 100644 --- a/tests/service/data/SyntaxTree/Expression/Upcast 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Upcast 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/Upcast 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/Upcast 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/While 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 01.fs.bsl index e8039cbe2cf..3ca61e2fb2f 100644 --- a/tests/service/data/SyntaxTree/Expression/While 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,4 +11,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/While 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 02.fs.bsl index 99e63d5e069..4e922840a50 100644 --- a/tests/service/data/SyntaxTree/Expression/While 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,4 +11,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/While 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 03.fs.bsl index f8e8df6f239..f97b2ef3702 100644 --- a/tests/service/data/SyntaxTree/Expression/While 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/While 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 04.fs.bsl index 525fd0e42a5..bc9409d1352 100644 --- a/tests/service/data/SyntaxTree/Expression/While 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/While 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 05.fs.bsl index b6d3daf4f51..63f49be132f 100644 --- a/tests/service/data/SyntaxTree/Expression/While 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/While 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/While 06.fs.bsl index e106a73365d..fa00ab9ef46 100644 --- a/tests/service/data/SyntaxTree/Expression/While 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/While 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Expression/While 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Expression/While 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 01.fs.bsl index deb6d27aa83..a516411d1db 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 02.fs.bsl index 52eaca7bfdc..30c58b59105 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 03.fs.bsl index 437c23a2c6b..9cd7ffdf523 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 04.fs.bsl index 70db990cb0e..6afb7df4944 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,35), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 05.fs.bsl index a8b4a21543b..68269efd975 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 05.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 05.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,4 +30,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/WhileBang 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/WhileBang 06.fs.bsl index df87ceb6a9d..733ec5ee330 100644 --- a/tests/service/data/SyntaxTree/Expression/WhileBang 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/WhileBang 06.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Expression/WhileBang 06.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,4 +30,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Extern/Extern 01.fs.bsl b/tests/service/data/SyntaxTree/Extern/Extern 01.fs.bsl index efb3580fda3..7e70df62f0d 100644 --- a/tests/service/data/SyntaxTree/Extern/Extern 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Extern/Extern 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Extern/Extern 01.fs", false, QualifiedNameOfFile Extern 01, [], [], + ("/root/Extern/Extern 01.fs", false, QualifiedNameOfFile Extern 01, [], [SynModuleOrNamespace ([Extern 01], false, AnonModule, [Let @@ -98,6 +98,7 @@ ImplFile EqualsRange = None })], (1,0--2,70))], PreXmlDocEmpty, [], None, (1,0--2,70), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Extern 01' based on the file name 'Extern 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Extern/ExternKeywordIsPresentInTrivia.fs.bsl b/tests/service/data/SyntaxTree/Extern/ExternKeywordIsPresentInTrivia.fs.bsl index 8b6a9a601fc..cd770091661 100644 --- a/tests/service/data/SyntaxTree/Extern/ExternKeywordIsPresentInTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/Extern/ExternKeywordIsPresentInTrivia.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Extern/ExternKeywordIsPresentInTrivia.fs", false, - QualifiedNameOfFile ExternKeywordIsPresentInTrivia, [], [], + QualifiedNameOfFile ExternKeywordIsPresentInTrivia, [], [SynModuleOrNamespace ([ExternKeywordIsPresentInTrivia], false, AnonModule, [Let @@ -42,4 +42,5 @@ ImplFile EqualsRange = None })], (2,0--2,28))], PreXmlDocEmpty, [], None, (2,0--2,28), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/Comment after else 01.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/Comment after else 01.fs.bsl index 6800642d8f9..15cfd83a38c 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/Comment after else 01.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/Comment after else 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/Comment after else 01.fs", false, - QualifiedNameOfFile Comment after else 01, [], [], + QualifiedNameOfFile Comment after else 01, [], [SynModuleOrNamespace ([Comment after else 01], false, AnonModule, [Expr @@ -23,6 +23,7 @@ ImplFile IfToThenRange = (1,0--1,9) }), (1,0--4,5))], PreXmlDocEmpty, [], None, (1,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (3,5--3,33)] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'Comment after else 01' based on the file name 'Comment after else 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/IfThenElse/Comment after else 02.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/Comment after else 02.fs.bsl index 6fcbf474c2f..d3974f75b62 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/Comment after else 02.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/Comment after else 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/Comment after else 02.fs", false, - QualifiedNameOfFile Comment after else 02, [], [], + QualifiedNameOfFile Comment after else 02, [], [SynModuleOrNamespace ([Comment after else 02], false, AnonModule, [Expr @@ -17,6 +17,7 @@ ImplFile Expr (Ident b, (2,0--2,1))], PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [BlockComment (3,5--3,33)] }, set [])) (2,0)-(2,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (1:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/IfThenElse/DeeplyNestedIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/DeeplyNestedIfThenElse.fs.bsl index a94aa49c2f8..6c91bc3c497 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/DeeplyNestedIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/DeeplyNestedIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/DeeplyNestedIfThenElse.fs", false, - QualifiedNameOfFile DeeplyNestedIfThenElse, [], [], + QualifiedNameOfFile DeeplyNestedIfThenElse, [], [SynModuleOrNamespace ([DeeplyNestedIfThenElse], false, AnonModule, [Expr @@ -32,4 +32,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--10,13))], PreXmlDocEmpty, [], None, (2,0--11,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/ElseKeywordInSimpleIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/ElseKeywordInSimpleIfThenElse.fs.bsl index 4ee21824e57..8880778d7d4 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/ElseKeywordInSimpleIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/ElseKeywordInSimpleIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/ElseKeywordInSimpleIfThenElse.fs", false, - QualifiedNameOfFile ElseKeywordInSimpleIfThenElse, [], [], + QualifiedNameOfFile ElseKeywordInSimpleIfThenElse, [], [SynModuleOrNamespace ([ElseKeywordInSimpleIfThenElse], false, AnonModule, [Expr @@ -14,4 +14,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--2,18))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/IfKeywordInIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/IfKeywordInIfThenElse.fs.bsl index afb0f0222c3..e5e31766436 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/IfKeywordInIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/IfKeywordInIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/IfKeywordInIfThenElse.fs", false, - QualifiedNameOfFile IfKeywordInIfThenElse, [], [], + QualifiedNameOfFile IfKeywordInIfThenElse, [], [SynModuleOrNamespace ([IfKeywordInIfThenElse], false, AnonModule, [Expr @@ -14,4 +14,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--2,11))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/IfThenAndElseKeywordOnSeparateLines.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/IfThenAndElseKeywordOnSeparateLines.fs.bsl index f1421e566ab..7ecb4d2a588 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/IfThenAndElseKeywordOnSeparateLines.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/IfThenAndElseKeywordOnSeparateLines.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/IfThenAndElseKeywordOnSeparateLines.fs", false, - QualifiedNameOfFile IfThenAndElseKeywordOnSeparateLines, [], [], + QualifiedNameOfFile IfThenAndElseKeywordOnSeparateLines, [], [SynModuleOrNamespace ([IfThenAndElseKeywordOnSeparateLines], false, AnonModule, [Expr @@ -14,4 +14,5 @@ ImplFile IfToThenRange = (2,0--3,4) }), (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/NestedElifInIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/NestedElifInIfThenElse.fs.bsl index 08b9a76501c..4d59e2371b3 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/NestedElifInIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/NestedElifInIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/NestedElifInIfThenElse.fs", false, - QualifiedNameOfFile NestedElifInIfThenElse, [], [], + QualifiedNameOfFile NestedElifInIfThenElse, [], [SynModuleOrNamespace ([NestedElifInIfThenElse], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--4,13))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfInIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfInIfThenElse.fs.bsl index 07bafab126e..8085e2915cd 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfInIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfInIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/NestedElseIfInIfThenElse.fs", false, - QualifiedNameOfFile NestedElseIfInIfThenElse, [], [], + QualifiedNameOfFile NestedElseIfInIfThenElse, [], [SynModuleOrNamespace ([NestedElseIfInIfThenElse], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--5,15))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfOnTheSameLineInIfThenElse.fs.bsl b/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfOnTheSameLineInIfThenElse.fs.bsl index da6f78fb889..7b9c52347c3 100644 --- a/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfOnTheSameLineInIfThenElse.fs.bsl +++ b/tests/service/data/SyntaxTree/IfThenElse/NestedElseIfOnTheSameLineInIfThenElse.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/IfThenElse/NestedElseIfOnTheSameLineInIfThenElse.fs", false, - QualifiedNameOfFile NestedElseIfOnTheSameLineInIfThenElse, [], [], + QualifiedNameOfFile NestedElseIfOnTheSameLineInIfThenElse, [], [SynModuleOrNamespace ([NestedElseIfOnTheSameLineInIfThenElse], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile IfToThenRange = (2,0--2,9) }), (2,0--5,5))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/ComplexArgumentsLambdaHasArrowRange.fs.bsl b/tests/service/data/SyntaxTree/Lambda/ComplexArgumentsLambdaHasArrowRange.fs.bsl index b7334e423de..930c7d13e77 100644 --- a/tests/service/data/SyntaxTree/Lambda/ComplexArgumentsLambdaHasArrowRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/ComplexArgumentsLambdaHasArrowRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/ComplexArgumentsLambdaHasArrowRange.fs", false, - QualifiedNameOfFile ComplexArgumentsLambdaHasArrowRange, [], [], + QualifiedNameOfFile ComplexArgumentsLambdaHasArrowRange, [], [SynModuleOrNamespace ([ComplexArgumentsLambdaHasArrowRange], false, AnonModule, [Expr @@ -161,4 +161,5 @@ ImplFile { ArrowRange = Some (5,4--5,6) }), (2,0--6,13))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/DestructedLambdaHasArrowRange.fs.bsl b/tests/service/data/SyntaxTree/Lambda/DestructedLambdaHasArrowRange.fs.bsl index 442d815a3dd..3f1c530f9d5 100644 --- a/tests/service/data/SyntaxTree/Lambda/DestructedLambdaHasArrowRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/DestructedLambdaHasArrowRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/DestructedLambdaHasArrowRange.fs", false, - QualifiedNameOfFile DestructedLambdaHasArrowRange, [], [], + QualifiedNameOfFile DestructedLambdaHasArrowRange, [], [SynModuleOrNamespace ([DestructedLambdaHasArrowRange], false, AnonModule, [Expr @@ -64,4 +64,5 @@ ImplFile { ArrowRange = Some (2,14--2,16) }), (2,0--2,22))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/LambdaWithTupleParameterWithWildCardGivesCorrectBody.fs.bsl b/tests/service/data/SyntaxTree/Lambda/LambdaWithTupleParameterWithWildCardGivesCorrectBody.fs.bsl index af455533914..e85c474072a 100644 --- a/tests/service/data/SyntaxTree/Lambda/LambdaWithTupleParameterWithWildCardGivesCorrectBody.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/LambdaWithTupleParameterWithWildCardGivesCorrectBody.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Lambda/LambdaWithTupleParameterWithWildCardGivesCorrectBody.fs", false, QualifiedNameOfFile LambdaWithTupleParameterWithWildCardGivesCorrectBody, - [], [], + [], [SynModuleOrNamespace ([LambdaWithTupleParameterWithWildCardGivesCorrectBody], false, AnonModule, @@ -39,4 +39,5 @@ ImplFile (2,0--2,19))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/LambdaWithTwoParametersGivesCorrectBody.fs.bsl b/tests/service/data/SyntaxTree/Lambda/LambdaWithTwoParametersGivesCorrectBody.fs.bsl index c014aa3236c..8e77bc9eed1 100644 --- a/tests/service/data/SyntaxTree/Lambda/LambdaWithTwoParametersGivesCorrectBody.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/LambdaWithTwoParametersGivesCorrectBody.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/LambdaWithTwoParametersGivesCorrectBody.fs", false, - QualifiedNameOfFile LambdaWithTwoParametersGivesCorrectBody, [], [], + QualifiedNameOfFile LambdaWithTwoParametersGivesCorrectBody, [], [SynModuleOrNamespace ([LambdaWithTwoParametersGivesCorrectBody], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile (2,0--2,12))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardParameterGivesCorrectBody.fs.bsl b/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardParameterGivesCorrectBody.fs.bsl index 9e2a1e33385..e38de7b5537 100644 --- a/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardParameterGivesCorrectBody.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardParameterGivesCorrectBody.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/LambdaWithWildCardParameterGivesCorrectBody.fs", false, - QualifiedNameOfFile LambdaWithWildCardParameterGivesCorrectBody, [], [], + QualifiedNameOfFile LambdaWithWildCardParameterGivesCorrectBody, [], [SynModuleOrNamespace ([LambdaWithWildCardParameterGivesCorrectBody], false, AnonModule, [Expr @@ -30,4 +30,5 @@ ImplFile (2,0--2,14))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardThatReturnsALambdaGivesCorrectBody.fs.bsl b/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardThatReturnsALambdaGivesCorrectBody.fs.bsl index 83435aa48a5..eb2ff3402e8 100644 --- a/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardThatReturnsALambdaGivesCorrectBody.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/LambdaWithWildCardThatReturnsALambdaGivesCorrectBody.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Lambda/LambdaWithWildCardThatReturnsALambdaGivesCorrectBody.fs", false, QualifiedNameOfFile LambdaWithWildCardThatReturnsALambdaGivesCorrectBody, - [], [], + [], [SynModuleOrNamespace ([LambdaWithWildCardThatReturnsALambdaGivesCorrectBody], false, AnonModule, @@ -32,4 +32,5 @@ ImplFile { ArrowRange = Some (2,6--2,8) }), (2,0--2,19))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/MultilineLambdaHasArrowRange.fs.bsl b/tests/service/data/SyntaxTree/Lambda/MultilineLambdaHasArrowRange.fs.bsl index 6d3ea6eea4a..40da24ed4d1 100644 --- a/tests/service/data/SyntaxTree/Lambda/MultilineLambdaHasArrowRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/MultilineLambdaHasArrowRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/MultilineLambdaHasArrowRange.fs", false, - QualifiedNameOfFile MultilineLambdaHasArrowRange, [], [], + QualifiedNameOfFile MultilineLambdaHasArrowRange, [], [SynModuleOrNamespace ([MultilineLambdaHasArrowRange], false, AnonModule, [Expr @@ -72,4 +72,5 @@ ImplFile { ArrowRange = Some (3,28--3,30) }), (2,0--4,41))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 01.fs.bsl b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 01.fs.bsl index cf6edce993f..dfce41e19da 100644 --- a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/Param - Missing type 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,7) parse error Unexpected symbol ':' in lambda expression. Expected '->' or other token. diff --git a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 02.fs.bsl b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 02.fs.bsl index faf86a319e0..6cb18044558 100644 --- a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/Param - Missing type 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,7) parse error Unexpected symbol ':' in lambda expression. Expected '->' or other token. diff --git a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 03.fs.bsl b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 03.fs.bsl index 490a20dd75f..6031ebdc107 100644 --- a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/Param - Missing type 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,9) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 04.fs.bsl b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 04.fs.bsl index 6c522c46bab..71f17176866 100644 --- a/tests/service/data/SyntaxTree/Lambda/Param - Missing type 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/Param - Missing type 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/Param - Missing type 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -31,6 +31,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,9) parse error Unexpected symbol ',' in pattern diff --git a/tests/service/data/SyntaxTree/Lambda/SimpleLambdaHasArrowRange.fs.bsl b/tests/service/data/SyntaxTree/Lambda/SimpleLambdaHasArrowRange.fs.bsl index 818107806bf..54ee6a39cde 100644 --- a/tests/service/data/SyntaxTree/Lambda/SimpleLambdaHasArrowRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/SimpleLambdaHasArrowRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/SimpleLambdaHasArrowRange.fs", false, - QualifiedNameOfFile SimpleLambdaHasArrowRange, [], [], + QualifiedNameOfFile SimpleLambdaHasArrowRange, [], [SynModuleOrNamespace ([SimpleLambdaHasArrowRange], false, AnonModule, [Expr @@ -16,4 +16,5 @@ ImplFile (2,0--2,10))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Lambda/TupleInLambdaHasArrowRange.fs.bsl b/tests/service/data/SyntaxTree/Lambda/TupleInLambdaHasArrowRange.fs.bsl index 30442a303f0..788eb98a507 100644 --- a/tests/service/data/SyntaxTree/Lambda/TupleInLambdaHasArrowRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Lambda/TupleInLambdaHasArrowRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Lambda/TupleInLambdaHasArrowRange.fs", false, - QualifiedNameOfFile TupleInLambdaHasArrowRange, [], [], + QualifiedNameOfFile TupleInLambdaHasArrowRange, [], [SynModuleOrNamespace ([TupleInLambdaHasArrowRange], false, AnonModule, [Expr @@ -41,4 +41,5 @@ ImplFile (2,0--2,19), { ArrowRange = Some (2,11--2,13) }), (2,0--2,19))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl index 9c4b593e133..34aa70d3379 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/AbstractKeyword.fs", false, - QualifiedNameOfFile AbstractKeyword, [], [], + QualifiedNameOfFile AbstractKeyword, [], [SynModuleOrNamespace ([AbstractKeyword], false, AnonModule, [Types @@ -37,4 +37,5 @@ ImplFile WithKeyword = None })], (2,0--3,20))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl index 0cbd9b3a434..9f3ccbf040b 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/AbstractMemberKeyword.fs", false, - QualifiedNameOfFile AbstractMemberKeyword, [], [], + QualifiedNameOfFile AbstractMemberKeyword, [], [SynModuleOrNamespace ([AbstractMemberKeyword], false, AnonModule, [Types @@ -38,4 +38,5 @@ ImplFile WithKeyword = None })], (2,0--3,27))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AndKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AndKeyword.fs.bsl index 7376e64e8e4..c1c8979edcb 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AndKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AndKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/AndKeyword.fs", false, - QualifiedNameOfFile AndKeyword, [], [], + QualifiedNameOfFile AndKeyword, [], [SynModuleOrNamespace ([AndKeyword], false, AnonModule, [Let @@ -59,4 +59,5 @@ ImplFile EqualsRange = Some (3,8--3,9) })], (2,0--3,15))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl index ba9b7296835..b8ef7219487 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/LeadingKeyword/DefaultKeyword.fsi", - QualifiedNameOfFile DefaultKeyword, [], [], + QualifiedNameOfFile DefaultKeyword, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -38,4 +38,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--5,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl index 2c243f2ca9d..028585bc0b5 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/DefaultValKeyword.fs", false, - QualifiedNameOfFile DefaultValKeyword, [], [], + QualifiedNameOfFile DefaultValKeyword, [], [SynModuleOrNamespace ([DefaultValKeyword], false, AnonModule, [Types @@ -40,4 +40,5 @@ ImplFile WithKeyword = None })], (2,0--3,27))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl index 41ed25792f7..e70a4e5463e 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/DoKeyword.fs", false, QualifiedNameOfFile DoKeyword, - [], [], + [], [SynModuleOrNamespace ([DoKeyword], false, AnonModule, [Types @@ -29,4 +29,5 @@ ImplFile WithKeyword = None })], (2,0--3,9))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl index 1c7e811ab69..29b5e5c9688 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/DoStaticKeyword.fs", false, - QualifiedNameOfFile DoStaticKeyword, [], [], + QualifiedNameOfFile DoStaticKeyword, [], [SynModuleOrNamespace ([DoStaticKeyword], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--3,16))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/ExternKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/ExternKeyword.fs.bsl index ae6df6a8091..189a700298e 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/ExternKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/ExternKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/ExternKeyword.fs", false, - QualifiedNameOfFile ExternKeyword, [], [], + QualifiedNameOfFile ExternKeyword, [], [SynModuleOrNamespace ([ExternKeyword], false, AnonModule, [Let @@ -42,4 +42,5 @@ ImplFile EqualsRange = None })], (2,0--2,17))], PreXmlDocEmpty, [], None, (2,0--2,17), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/LetKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/LetKeyword.fs.bsl index c783b4b4354..c8ae05916a7 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/LetKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/LetKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/LetKeyword.fs", false, - QualifiedNameOfFile LetKeyword, [], [], + QualifiedNameOfFile LetKeyword, [], [SynModuleOrNamespace ([LetKeyword], false, AnonModule, [Let @@ -33,4 +33,5 @@ ImplFile EqualsRange = Some (2,8--2,9) })], (2,0--2,15))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/LetRecKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/LetRecKeyword.fs.bsl index a5ecb2a98b5..816ba3b4e59 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/LetRecKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/LetRecKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/LetRecKeyword.fs", false, - QualifiedNameOfFile LetRecKeyword, [], [], + QualifiedNameOfFile LetRecKeyword, [], [SynModuleOrNamespace ([LetRecKeyword], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (2,12--2,13) })], (2,0--2,19))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl index d9497db0bfe..3d161da52e3 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/MemberKeyword.fs", false, - QualifiedNameOfFile MemberKeyword, [], [], + QualifiedNameOfFile MemberKeyword, [], [SynModuleOrNamespace ([MemberKeyword], false, AnonModule, [Types @@ -45,4 +45,5 @@ ImplFile WithKeyword = None })], (2,0--3,26))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl index 63618be45b7..d9ba80b80df 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/MemberValKeyword.fs", false, - QualifiedNameOfFile MemberValKeyword, [], [], + QualifiedNameOfFile MemberValKeyword, [], [SynModuleOrNamespace ([MemberValKeyword], false, AnonModule, [Types @@ -40,4 +40,5 @@ ImplFile WithKeyword = None })], (2,0--3,26))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl index 1e408d27f4b..ebc374d1432 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/NewKeyword.fs", false, - QualifiedNameOfFile NewKeyword, [], [], + QualifiedNameOfFile NewKeyword, [], [SynModuleOrNamespace ([NewKeyword], false, AnonModule, [Types @@ -61,4 +61,5 @@ ImplFile WithKeyword = None })], (2,0--3,30))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl index 896ea64e69b..f9d0ec25562 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/OverrideKeyword.fs", false, - QualifiedNameOfFile OverrideKeyword, [], [], + QualifiedNameOfFile OverrideKeyword, [], [SynModuleOrNamespace ([OverrideKeyword], false, AnonModule, [Types @@ -50,4 +50,5 @@ ImplFile WithKeyword = None })], (2,0--3,28))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl index 3fff6cb5b0d..837e1b368fd 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/OverrideValKeyword.fs", false, - QualifiedNameOfFile OverrideValKeyword, [], [], + QualifiedNameOfFile OverrideValKeyword, [], [SynModuleOrNamespace ([OverrideValKeyword], false, AnonModule, [Types @@ -40,4 +40,5 @@ ImplFile WithKeyword = None })], (2,0--3,28))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl index 92d3182daea..e75b4c25218 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticAbstractKeyword.fs", false, - QualifiedNameOfFile StaticAbstractKeyword, [], [], + QualifiedNameOfFile StaticAbstractKeyword, [], [SynModuleOrNamespace ([StaticAbstractKeyword], false, AnonModule, [Types @@ -42,6 +42,7 @@ ImplFile WithKeyword = None })], (2,0--3,34))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,19) parse warning Declaring "interfaces with static abstract methods" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn "3535"' or '--nowarn:3535'. diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl index 8b2dc3b5c8f..73e5a522b4b 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticAbstractMemberKeyword.fs", false, - QualifiedNameOfFile StaticAbstractMemberKeyword, [], [], + QualifiedNameOfFile StaticAbstractMemberKeyword, [], [SynModuleOrNamespace ([StaticAbstractMemberKeyword], false, AnonModule, [Types @@ -43,6 +43,7 @@ ImplFile WithKeyword = None })], (2,0--3,41))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,19) parse warning Declaring "interfaces with static abstract methods" is an advanced feature. See https://aka.ms/fsharp-iwsams for guidance. You can disable this warning by using '#nowarn "3535"' or '--nowarn:3535'. diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl index 25ad616ec0f..94e3e11ef7f 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticLetKeyword.fs", false, - QualifiedNameOfFile StaticLetKeyword, [], [], + QualifiedNameOfFile StaticLetKeyword, [], [SynModuleOrNamespace ([StaticLetKeyword], false, AnonModule, [Types @@ -35,4 +35,5 @@ ImplFile WithKeyword = None })], (2,0--3,24))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl index a0851241351..06aa352f3d3 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticLetRecKeyword.fs", false, - QualifiedNameOfFile StaticLetRecKeyword, [], [], + QualifiedNameOfFile StaticLetRecKeyword, [], [SynModuleOrNamespace ([StaticLetRecKeyword], false, AnonModule, [Types @@ -41,4 +41,5 @@ ImplFile WithKeyword = None })], (2,0--3,41))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl index 70b40e7ccd2..541b6f582a9 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticMemberKeyword.fs", false, - QualifiedNameOfFile StaticMemberKeyword, [], [], + QualifiedNameOfFile StaticMemberKeyword, [], [SynModuleOrNamespace ([StaticMemberKeyword], false, AnonModule, [Types @@ -47,4 +47,5 @@ ImplFile WithKeyword = None })], (2,0--3,29))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl index 1ce7e21fea2..feb33135568 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/StaticMemberValKeyword.fs", false, - QualifiedNameOfFile StaticMemberValKeyword, [], [], + QualifiedNameOfFile StaticMemberValKeyword, [], [SynModuleOrNamespace ([StaticMemberValKeyword], false, AnonModule, [Types @@ -41,4 +41,5 @@ ImplFile WithKeyword = None })], (2,0--3,33))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl index a30354d3b41..47aa7f74ac2 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/LeadingKeyword/StaticValKeyword.fsi", - QualifiedNameOfFile StaticValKeyword, [], [], + QualifiedNameOfFile StaticValKeyword, [], [SynModuleOrNamespaceSig ([Meh], false, DeclaredNamespace, [Types @@ -31,4 +31,5 @@ SigFile WithKeyword = None })], (4,0--5,29))], PreXmlDocEmpty, [], None, (2,0--5,29), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/SyntheticKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/SyntheticKeyword.fs.bsl index b833f40ae10..ef4aa89c83d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/SyntheticKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/SyntheticKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/SyntheticKeyword.fs", false, - QualifiedNameOfFile SyntheticKeyword, [], [], + QualifiedNameOfFile SyntheticKeyword, [], [SynModuleOrNamespace ([SyntheticKeyword], false, AnonModule, [Expr @@ -21,4 +21,5 @@ ImplFile (2,0--3,12)), (2,0--3,12))], PreXmlDocEmpty, [], None, (2,0--3,12), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/UseKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/UseKeyword.fs.bsl index 4571189344f..913dfadb878 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/UseKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/UseKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/UseKeyword.fs", false, - QualifiedNameOfFile UseKeyword, [], [], + QualifiedNameOfFile UseKeyword, [], [SynModuleOrNamespace ([UseKeyword], false, AnonModule, [Expr @@ -27,4 +27,5 @@ ImplFile InKeyword = None }), (2,0--4,6)), (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/UseRecKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/UseRecKeyword.fs.bsl index ac1d1ce9819..eac3e1cf38c 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/UseRecKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/UseRecKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/LeadingKeyword/UseRecKeyword.fs", false, - QualifiedNameOfFile UseRecKeyword, [], [], + QualifiedNameOfFile UseRecKeyword, [], [SynModuleOrNamespace ([UseRecKeyword], false, AnonModule, [Expr @@ -27,4 +27,5 @@ ImplFile InKeyword = None }), (2,0--4,6)), (2,0--4,6))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl index 1c940b8d6fd..111c2ac7565 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl @@ -1,7 +1,6 @@ SigFile (ParsedSigFileInput ("/root/LeadingKeyword/ValKeyword.fsi", QualifiedNameOfFile ValKeyword, [], - [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -26,4 +25,5 @@ SigFile WithKeyword = None })], (4,0--5,15))], PreXmlDocEmpty, [], None, (2,0--5,15), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing expr 01.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing expr 01.fs.bsl index 6f92c909aa0..53fc9e8d6ed 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing expr 01.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing expr 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing expr 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing expr 02.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing expr 02.fs.bsl index a38e67668d2..ad4bd5152d4 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing expr 02.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing expr 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing expr 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing expr 03.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing expr 03.fs.bsl index 36e8ecc9e9b..cb1b6725877 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing expr 03.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing expr 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing expr 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected symbol '|' in pattern matching diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing expr 04.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing expr 04.fs.bsl index eae47c2aa83..0ced217b112 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing expr 04.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing expr 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing expr 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected symbol '|' in pattern matching diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing expr 05.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing expr 05.fs.bsl index 787b09b31dc..c998f9ea0ff 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing expr 05.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing expr 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing expr 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing pat 01.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing pat 01.fs.bsl index 3e5974d65be..c93e51541e9 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing pat 01.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing pat 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing pat 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing pat 02.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing pat 02.fs.bsl index 0812581e1ff..33d920952dd 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing pat 02.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing pat 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing pat 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing pat 03.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing pat 03.fs.bsl index 8fb3f4b8142..871797f6a49 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing pat 03.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing pat 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing pat 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing pat 04.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing pat 04.fs.bsl index 8fde4f353ee..886feeff984 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing pat 04.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing pat 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing pat 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/MatchClause/Missing pat 05.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/Missing pat 05.fs.bsl index e9693065f21..ea498351936 100644 --- a/tests/service/data/SyntaxTree/MatchClause/Missing pat 05.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/Missing pat 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/Missing pat 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/MatchClause/NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl index 79e765d0135..4fb707a309e 100644 --- a/tests/service/data/SyntaxTree/MatchClause/NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/MatchClause/NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs", false, QualifiedNameOfFile NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith, - [], [], + [], [SynModuleOrNamespace ([NoRangeOfBarInASingleSynMatchClauseInSynExprTryWith], false, AnonModule, @@ -23,4 +23,5 @@ ImplFile WithToEndRange = (4,0--6,6) }), (2,0--6,6))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,4--5,19)] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClause.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClause.fs.bsl index 850422e1df8..23af64bcfe3 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClause.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClause.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfArrowInSynMatchClause.fs", false, - QualifiedNameOfFile RangeOfArrowInSynMatchClause, [], [], + QualifiedNameOfFile RangeOfArrowInSynMatchClause, [], [SynModuleOrNamespace ([RangeOfArrowInSynMatchClause], false, AnonModule, [Expr @@ -19,4 +19,5 @@ ImplFile WithKeyword = (2,10--2,14) }), (2,0--3,15))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClauseWithWhenClause.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClauseWithWhenClause.fs.bsl index 3ec91a6aab5..37445cfd5a1 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClauseWithWhenClause.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfArrowInSynMatchClauseWithWhenClause.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfArrowInSynMatchClauseWithWhenClause.fs", false, - QualifiedNameOfFile RangeOfArrowInSynMatchClauseWithWhenClause, [], [], + QualifiedNameOfFile RangeOfArrowInSynMatchClauseWithWhenClause, [], [SynModuleOrNamespace ([RangeOfArrowInSynMatchClauseWithWhenClause], false, AnonModule, [Expr @@ -25,4 +25,5 @@ ImplFile WithKeyword = (2,10--2,14) }), (2,0--3,36))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith.fs.bsl index 00fd4e2de7b..5a1bf39c36b 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/MatchClause/RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith.fs", false, QualifiedNameOfFile RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith, - [], [], + [], [SynModuleOrNamespace ([RangeOfBarInAMultipleSynMatchClausesInSynExprTryWith], false, AnonModule, @@ -33,4 +33,5 @@ ImplFile WithToEndRange = (4,0--8,10) }), (2,0--8,10))], PreXmlDocEmpty, [], None, (2,0--9,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (6,4--6,19)] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprMatch.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprMatch.fs.bsl index 744fc813f3c..07c297570a9 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprMatch.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprMatch.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprMatch.fs", false, QualifiedNameOfFile RangeOfBarInASingleSynMatchClauseInSynExprMatch, - [], [], + [], [SynModuleOrNamespace ([RangeOfBarInASingleSynMatchClauseInSynExprMatch], false, AnonModule, [Expr @@ -26,4 +26,5 @@ ImplFile WithKeyword = (2,10--2,14) }), (2,0--3,36))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl index 8306431f657..8df2cbe5f9f 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/MatchClause/RangeOfBarInASingleSynMatchClauseInSynExprTryWith.fs", false, QualifiedNameOfFile RangeOfBarInASingleSynMatchClauseInSynExprTryWith, [], - [], [SynModuleOrNamespace ([RangeOfBarInASingleSynMatchClauseInSynExprTryWith], false, AnonModule, [Expr @@ -23,4 +22,5 @@ ImplFile WithToEndRange = (4,0--5,11) }), (2,0--5,11))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInMultipleSynMatchClausesInSynExprMatch.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInMultipleSynMatchClausesInSynExprMatch.fs.bsl index 02122fba61d..dbe210b96d4 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInMultipleSynMatchClausesInSynExprMatch.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfBarInMultipleSynMatchClausesInSynExprMatch.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/MatchClause/RangeOfBarInMultipleSynMatchClausesInSynExprMatch.fs", false, QualifiedNameOfFile RangeOfBarInMultipleSynMatchClausesInSynExprMatch, [], - [], [SynModuleOrNamespace ([RangeOfBarInMultipleSynMatchClausesInSynExprMatch], false, AnonModule, [Expr @@ -38,4 +37,5 @@ ImplFile WithKeyword = (2,10--2,14) }), (2,0--4,20))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfMultipleSynMatchClause.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfMultipleSynMatchClause.fs.bsl index f4b3b9f7a39..25fb2192c73 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfMultipleSynMatchClause.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfMultipleSynMatchClause.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfMultipleSynMatchClause.fs", false, - QualifiedNameOfFile RangeOfMultipleSynMatchClause, [], [], + QualifiedNameOfFile RangeOfMultipleSynMatchClause, [], [SynModuleOrNamespace ([RangeOfMultipleSynMatchClause], false, AnonModule, [Expr @@ -54,4 +54,5 @@ ImplFile WithToEndRange = (5,0--10,8) }), (2,0--10,8))], PreXmlDocEmpty, [], None, (2,0--11,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClause.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClause.fs.bsl index 324463e7b2e..547027c53ab 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClause.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClause.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfSingleSynMatchClause.fs", false, - QualifiedNameOfFile RangeOfSingleSynMatchClause, [], [], + QualifiedNameOfFile RangeOfSingleSynMatchClause, [], [SynModuleOrNamespace ([RangeOfSingleSynMatchClause], false, AnonModule, [Expr @@ -48,4 +48,5 @@ ImplFile WithToEndRange = (5,0--7,8) }), (2,0--7,8))], PreXmlDocEmpty, [], None, (2,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClauseFollowedByBar.fs.bsl b/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClauseFollowedByBar.fs.bsl index 132cbd01cc0..11f88dadedb 100644 --- a/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClauseFollowedByBar.fs.bsl +++ b/tests/service/data/SyntaxTree/MatchClause/RangeOfSingleSynMatchClauseFollowedByBar.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MatchClause/RangeOfSingleSynMatchClauseFollowedByBar.fs", false, - QualifiedNameOfFile RangeOfSingleSynMatchClauseFollowedByBar, [], [], + QualifiedNameOfFile RangeOfSingleSynMatchClauseFollowedByBar, [], [SynModuleOrNamespace ([RangeOfSingleSynMatchClauseFollowedByBar], false, AnonModule, [Expr @@ -39,6 +39,7 @@ ImplFile (2,0--8,1))], PreXmlDocEmpty, [], None, (2,0--9,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (9,0)-(9,0) parse error Incomplete structured construct at or before this point in pattern matching diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 01.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 01.fs.bsl index a9bc46a831a..8ffb582cf4d 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 01.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 01.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -12,4 +12,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 02.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 02.fs.bsl index 9cc97f47504..2eeda517c00 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 02.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 02.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -13,4 +13,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 03.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 03.fs.bsl index a28e62906de..2739d05837a 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 03.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 03.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -12,4 +12,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 04.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 04.fs.bsl index bf2ab0c3bd3..612593fef4e 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 04.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 04.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -15,4 +15,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 05.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 05.fs.bsl index b18f6f4a22f..e95c55e8bb3 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 05.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 05.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -16,4 +16,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 06.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 06.fs.bsl index 7d5bac5d2e4..031570ff774 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 06.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 06.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 07.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 07.fs.bsl index db9e83c0fb8..6b7f9dfad3b 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 07.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 07.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -20,4 +20,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 08.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 08.fs.bsl index b4a8f0b48c2..cbde40a93f2 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 08.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 08.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,24), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 09.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 09.fs.bsl index 2eeee44a379..c45821bf58e 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 09.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 09.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/Constant - 10.fs.bsl b/tests/service/data/SyntaxTree/Measure/Constant - 10.fs.bsl index f6e6b3d7fee..6604a2712ac 100644 --- a/tests/service/data/SyntaxTree/Measure/Constant - 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/Constant - 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Measure/Constant - 10.fs", false, QualifiedNameOfFile M, [], [], + ("/root/Measure/Constant - 10.fs", false, QualifiedNameOfFile M, [], [SynModuleOrNamespace ([M], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/MeasureContainsTheRangeOfTheConstant.fs.bsl b/tests/service/data/SyntaxTree/Measure/MeasureContainsTheRangeOfTheConstant.fs.bsl index b0150fbdc0b..541c856bb70 100644 --- a/tests/service/data/SyntaxTree/Measure/MeasureContainsTheRangeOfTheConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/MeasureContainsTheRangeOfTheConstant.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Measure/MeasureContainsTheRangeOfTheConstant.fs", false, - QualifiedNameOfFile MeasureContainsTheRangeOfTheConstant, [], [], + QualifiedNameOfFile MeasureContainsTheRangeOfTheConstant, [], [SynModuleOrNamespace ([MeasureContainsTheRangeOfTheConstant], false, AnonModule, [Let @@ -42,4 +42,5 @@ ImplFile (3,0--3,17))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/SynMeasureParenHasCorrectRange.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynMeasureParenHasCorrectRange.fs.bsl index 84f544b9146..dc6bfe9c588 100644 --- a/tests/service/data/SyntaxTree/Measure/SynMeasureParenHasCorrectRange.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynMeasureParenHasCorrectRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Measure/SynMeasureParenHasCorrectRange.fs", false, - QualifiedNameOfFile SynMeasureParenHasCorrectRange, [], [], + QualifiedNameOfFile SynMeasureParenHasCorrectRange, [], [SynModuleOrNamespace ([SynMeasureParenHasCorrectRange], false, AnonModule, [Expr @@ -21,4 +21,5 @@ ImplFile GreaterRange = (2,22--2,23) }), (2,0--2,23)), (2,0--2,23))], PreXmlDocEmpty, [], None, (2,0--2,23), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl index 65535c03d20..33675b1a3a1 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs", false, - QualifiedNameOfFile SynTypeTupleInMeasureTypeWithLeadingSlash, [], [], + QualifiedNameOfFile SynTypeTupleInMeasureTypeWithLeadingSlash, [], [SynModuleOrNamespace ([SynTypeTupleInMeasureTypeWithLeadingSlash], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--2,29))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl index dca088b13db..fc29ce7d7e1 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs", false, - QualifiedNameOfFile SynTypeTupleInMeasureTypeWithNoSlashes, [], [], + QualifiedNameOfFile SynTypeTupleInMeasureTypeWithNoSlashes, [], [SynModuleOrNamespace ([SynTypeTupleInMeasureTypeWithNoSlashes], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--2,26))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl index f47273a687c..6e423837385 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs", false, - QualifiedNameOfFile SynTypeTupleInMeasureTypeWithStartAndSlash, [], [], + QualifiedNameOfFile SynTypeTupleInMeasureTypeWithStartAndSlash, [], [SynModuleOrNamespace ([SynTypeTupleInMeasureTypeWithStartAndSlash], false, AnonModule, [Types @@ -32,4 +32,5 @@ ImplFile WithKeyword = None })], (2,0--2,30))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl index 9ec3b5452d7..20e86102317 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Abstract - Property 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -38,4 +38,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl index 95ced08879b..c78f3040f42 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Abstract - Property 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +40,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl index d9393dc8da0..cff1499dca4 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Abstract - Property 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl index f315032ac6c..a208af54581 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Abstract - Property 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -39,6 +39,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl index e8092cae4f6..6ad8da57115 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Abstract - Property 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -59,6 +59,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,12) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl index 211a0fed943..7490cf06b8e 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +39,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl index 31f825ba1af..cd6d84a1903 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +42,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl index fced13abaa4..499e1c4c6ec 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -65,6 +64,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,10) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl index 19e8d589688..c57b6c5faad 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -64,4 +63,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl index ca97d03b523..6ae271aaa1a 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 05.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -64,6 +63,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,15)-(5,4) parse error Incomplete structured construct at or before this point in member definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl index 6a60db20a73..4e0c9d821ae 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 06.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -41,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,18)-(4,19) parse error Unexpected symbol '=' in member definition diff --git a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl index 8e6436d4eb4..920e5a36916 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Auto property 07.fs", false, QualifiedNameOfFile A, [], [], + ("/root/Member/Auto property 07.fs", false, QualifiedNameOfFile A, [], [SynModuleOrNamespace ([A], false, NamedModule, [Types @@ -52,4 +52,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,38), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl index b4d9c9da2c4..c758fcae4a9 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 08.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -42,6 +41,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl index 5599ff4faa3..70796107bed 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 09.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -65,6 +64,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,10) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:23). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl index 0a94591f95a..ba04b1a3de7 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 10.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -41,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,29), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl index f6f1fb9e52b..dfd6e2fff03 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 11.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -41,4 +40,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,29), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl index da5a5eb7b72..80e694f5424 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 12.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -41,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,21)-(4,25) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl index b28a6d273bb..d6522b75532 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Member/Auto property 13.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -64,6 +63,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,21)-(4,25) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl index d9725daa923..ba44d47b0c0 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Auto property 14.fs", false, QualifiedNameOfFile A, [], [], + ("/root/Member/Auto property 14.fs", false, QualifiedNameOfFile A, [], [SynModuleOrNamespace ([A], false, NamedModule, [Types @@ -54,4 +54,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,54), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl index 417da42ef8a..6e0b861b01e 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Auto property 15.fs", false, QualifiedNameOfFile A, [], [], + ("/root/Member/Auto property 15.fs", false, QualifiedNameOfFile A, [], [SynModuleOrNamespace ([A], false, NamedModule, [Types @@ -55,4 +55,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,63), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl index 5f63d7bdc38..ebcf90b0c06 100644 --- a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Do 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Do 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +40,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl index 1585d6135ee..41cc0daa22e 100644 --- a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Do 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Do 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -42,4 +42,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl index b255897d0e8..51c20b468ad 100644 --- a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Do 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Do 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (5:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl index 637426c98df..6bb13a90212 100644 --- a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Do 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Do 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -42,6 +42,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (5:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl index add8ac4adbe..517082e1e06 100644 --- a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl index 33eba0a9f87..874473c1059 100644 --- a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -35,6 +35,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(5,4) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl index 4308cbcfebb..b2663b51b18 100644 --- a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -35,6 +35,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(5,4) parse error Incomplete structured construct at or before this point in type definition. Expected ':' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl index e481768ccb4..878fc8647bd 100644 --- a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -34,6 +34,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,8)-(5,4) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl index 46cf2e29c7f..80f5a737513 100644 --- a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl index 723a8c44f25..3c29ce9e5ab 100644 --- a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected ':' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl index e62126034db..9d652142213 100644 --- a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl index c74f09be72c..77a967f379a 100644 --- a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,7) parse error Unexpected keyword 'end' in member definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl index 8b4d8d1fa48..4f9de01f3a6 100644 --- a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl index 77016903ad5..fa1e21bf3e1 100644 --- a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl index 4f3cfe4b8b4..e62fa49126b 100644 --- a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 11.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 11.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl index d29045ba0e7..54f58854119 100644 --- a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 12.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 12.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition. Expected ':' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl index 3b42126b6db..86fcb6cd48d 100644 --- a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 13.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 13.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl index b9ae59996cf..4873d37e961 100644 --- a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 14.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 14.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,4 +28,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl index 472d5e0c2f9..62e1ee5046f 100644 --- a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Field 15.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Field 15.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -34,4 +34,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl index 55fb27c87bd..9e5a4d2c4b8 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/GetSetMember 01.fs", false, QualifiedNameOfFile Foo, [], [], + ("/root/Member/GetSetMember 01.fs", false, QualifiedNameOfFile Foo, [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Types @@ -203,6 +203,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,92), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,57)-(5,87) parse error When the visibility for a property is specified, setting the visibility of the set or get method is not allowed. diff --git a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl index 3768075ef94..f09cb92e147 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/GetSetMemberWithInlineKeyword.fs", false, - QualifiedNameOfFile GetSetMemberWithInlineKeyword, [], [], + QualifiedNameOfFile GetSetMemberWithInlineKeyword, [], [SynModuleOrNamespace ([GetSetMemberWithInlineKeyword], false, AnonModule, [Types @@ -83,4 +83,5 @@ ImplFile WithKeyword = None })], (2,0--5,29))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 01.fs.bsl index d603121ea71..72f6fee4eb6 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Missing type 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -39,6 +39,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 02.fs.bsl index d963c4115e8..567a68b336c 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Missing type 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Missing type 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -48,6 +48,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,25), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Unexpected symbol ',' in pattern diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 01.fs.bsl index 2bc4b5f488f..26a281bd317 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Pat - Tuple 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -73,4 +73,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,40), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 02.fs.bsl index 35502745762..e1f3b5fa319 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Pat - Tuple 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Pat - Tuple 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -47,6 +47,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(3,11) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 01.fs.bsl index 424a3619305..7a2f7aff28c 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -45,4 +45,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,29), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 02.fs.bsl index 0146ad5a153..2f79bcc5830 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -51,4 +51,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,34), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 03.fs.bsl index 61b3b7f3776..5d8f26d1d61 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -51,4 +51,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,34), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 04.fs.bsl index ca30a8c2327..ab62149eaf0 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -45,6 +45,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,15)-(3,16) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 05.fs.bsl index bd89bbaf94e..d96ff30cc94 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -51,6 +51,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,32), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,15)-(3,17) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 06.fs.bsl index ac58a094acb..fcf88aa59ce 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Fun 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Fun 06.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -65,6 +65,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,35), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,22)-(3,23) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 01.fs.bsl index 473bd768b3c..6e2a0109f5c 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Tuple 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -52,4 +52,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 02.fs.bsl index 57b5279161a..b7193884014 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Tuple 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -58,4 +58,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,32), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 03.fs.bsl index 92b69f0c2b2..8d6e7c19f5b 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Tuple 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -50,6 +50,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,14)-(3,15) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 04.fs.bsl index 5ff10cae81b..810cb8303f7 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Tuple 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -56,6 +56,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,31), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,18)-(3,19) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 05.fs.bsl index a39da9cc29e..11c7411ee8b 100644 --- a/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Implicit ctor - Type - Tuple 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Implicit ctor - Type - Tuple 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -56,6 +56,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,31), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,14)-(3,15) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl index 61f182611f8..06e7e3f9fdc 100644 --- a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/ImplicitCtorWithAsKeyword.fs", false, - QualifiedNameOfFile ImplicitCtorWithAsKeyword, [], [], + QualifiedNameOfFile ImplicitCtorWithAsKeyword, [], [SynModuleOrNamespace ([ImplicitCtorWithAsKeyword], false, AnonModule, [Types @@ -80,6 +80,7 @@ ImplFile PreXmlDocEmpty, [], None, (2,0--9,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,0--3,23); LineComment (5,0--5,7); LineComment (6,0--6,8); LineComment (7,0--7,9)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl index 817c15422b4..16618257bdd 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl index 3a9482667e2..80da2bd45fd 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl index 76aeb2e2e47..7b476b67650 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,11) parse error Type name cannot be empty. diff --git a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl index 2b1741c3714..e502b24ef0c 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,11) parse error Type name cannot be empty. diff --git a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl index f2bdb9713e2..d006bbe9099 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -44,6 +44,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(6,4) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl index 3ac7c9adc29..04d00187693 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/Member/Inherit 06.fsi", QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 06.fsi", QualifiedNameOfFile Module, [], [SynModuleOrNamespaceSig ([Module], false, NamedModule, [Types @@ -19,6 +19,7 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,11), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in member signature diff --git a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl index 7dc4657766f..2c6af3b87ee 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/Member/Inherit 07.fsi", QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 07.fsi", QualifiedNameOfFile Module, [], [SynModuleOrNamespaceSig ([Module], false, NamedModule, [Types @@ -38,6 +38,7 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,17), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(6,4) parse error Incomplete structured construct at or before this point in member signature diff --git a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl index 1b0e4712cb5..d75196d3f26 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Inherit 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Inherit 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -44,6 +44,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(4,14) parse error Unexpected keyword 'as' in type definition diff --git a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl index 332508f43f8..c99c2599dfd 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -71,4 +71,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl index 2d699762c27..7d67643e0fa 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -44,6 +44,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,21) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl index 8f563d2c61a..0f0731b660c 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,4 +20,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl index 20db259a02e..af0e0006af0 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -33,4 +33,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl index 1394c744330..d284b54e20c 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,4 +32,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl index b92b4abc202..b841c289ab7 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -34,6 +34,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,14) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl index 66c618d8e44..03171bf375d 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -44,4 +44,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl index 301dc4c9570..ce5ae85345f 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -44,6 +44,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,14)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl index 9260f21ff5b..cbea58a540b 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -34,6 +34,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl index 9ddc6fb80bb..76edb4cdbf1 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Interface 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Interface 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -34,6 +34,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl index c4071e92b4f..50dca73426c 100644 --- a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Let 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Let 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,4 +43,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl index e8e2862dcc6..fc1ab916f24 100644 --- a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Let 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Let 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (5:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl index 01cb91bbe95..d6656bcd492 100644 --- a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Let 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Let 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -42,6 +42,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,6) parse error Incomplete structured construct at or before this point in binding. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl index 439bf0d6cb7..41a0f46443e 100644 --- a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Let 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Let 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,6) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl index 168769ff761..7efcd1a8341 100644 --- a/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Member - Attributes 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -108,6 +108,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,17)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Member - Param - Missing type 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Member - Param - Missing type 01.fs.bsl index 432229da76f..4cbba8169f3 100644 --- a/tests/service/data/SyntaxTree/Member/Member - Param - Missing type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member - Param - Missing type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/Member - Param - Missing type 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -51,6 +51,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,20)-(4,21) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl index e5ce844b09e..e6ca39bf5f5 100644 --- a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -107,6 +107,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,17)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl index dc24f73a058..af9957edb7b 100644 --- a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -107,6 +107,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,22)-(6,4) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl index cb85a85bfc7..a7baa985888 100644 --- a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -107,6 +107,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,23)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl index c4bfa610f42..5b11990bd32 100644 --- a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -108,6 +108,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,25)-(6,4) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl index 7fdadfeebbc..9f480a45c60 100644 --- a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -109,6 +109,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (5:11). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl index d249dd2cc26..e33344ba3e9 100644 --- a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -108,4 +108,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl index 5e5c51e0f2b..c919ab5a29d 100644 --- a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -106,6 +106,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,23)-(5,24) parse error Unexpected symbol '=' in member definition diff --git a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl index b2e10558c6a..2f1415319fd 100644 --- a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -74,6 +74,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,63), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl index e101bf1b6da..a9104d2dfb0 100644 --- a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,0) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl index e0e6936d612..b30067d371f 100644 --- a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,0) parse error Expecting member body diff --git a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl index a4d4b985c40..eb37ddf77d9 100644 --- a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 11.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 11.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,0) parse error Incomplete structured construct at or before this point in member definition. Expected identifier, '(', '(*)' or other token. diff --git a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl index 44e361be813..33eac2d6efd 100644 --- a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 12.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 12.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Identifier expected diff --git a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl index 129c9f529ce..929250cabbe 100644 --- a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Member 13.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Member 13.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -71,6 +71,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl index 13e0c26b915..dcd3bb70c91 100644 --- a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/MemberMispelledToMeme.fs", false, - QualifiedNameOfFile MemberMispelledToMeme, [], [], + QualifiedNameOfFile MemberMispelledToMeme, [], [SynModuleOrNamespace ([MemberMispelledToMeme], false, AnonModule, [Types @@ -57,6 +57,7 @@ ImplFile WithKeyword = None })], (1,0--2,39))], PreXmlDocEmpty, [], None, (1,0--2,39), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (2,3)-(2,9) parse error Incomplete declaration of a static construct. Use 'static let','static do','static member' or 'static val' for declaration. diff --git a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl index 7db3831e689..65401553b8f 100644 --- a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/MemberWithInlineKeyword.fs", false, - QualifiedNameOfFile MemberWithInlineKeyword, [], [], + QualifiedNameOfFile MemberWithInlineKeyword, [], [SynModuleOrNamespace ([MemberWithInlineKeyword], false, AnonModule, [Types @@ -45,4 +45,5 @@ ImplFile WithKeyword = None })], (2,0--3,29))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 6692c520246..94e0c06897d 100644 --- a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Types @@ -64,4 +64,5 @@ ImplFile WithKeyword = None })], (3,0--5,60))], PreXmlDocEmpty, [], None, (1,0--5,60), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,4--4,28)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 8319d790680..110af6cd16c 100644 --- a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -100,4 +100,5 @@ ImplFile WithKeyword = None })], (2,0--6,50))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,4--3,29)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl index a516a7766cf..c257b90f316 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/Member/SignatureMemberWithGet.fsi", QualifiedNameOfFile Meh, [], [], + ("/root/Member/SignatureMemberWithGet.fsi", QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Types @@ -38,4 +38,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--8,35), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,4--5,23)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl index 038b502e256..6be357ee2c4 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/Member/SignatureMemberWithSet.fsi", QualifiedNameOfFile Meh, [], [], + ("/root/Member/SignatureMemberWithSet.fsi", QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Types @@ -38,4 +38,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--8,31), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,4--5,23)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index acb516b9113..c5bf35a6c4e 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -1,7 +1,6 @@ SigFile (ParsedSigFileInput ("/root/Member/SignatureMemberWithSetget.fsi", QualifiedNameOfFile Meh, [], - [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Types @@ -40,4 +39,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--8,39), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,4--5,23)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl index 7c47ccf95ec..4993c476447 100644 --- a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Static 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Static 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -50,6 +50,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,11)-(7,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl index ecf86c4e1f6..d339245331b 100644 --- a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Static 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Static 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -106,6 +106,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,17)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl index 70d5eb3aba9..68d1466b47a 100644 --- a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Member/Static 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Member/Static 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -107,6 +107,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,24)-(6,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index 4158e55ca3f..4838003cfc0 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile - SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword, [], [], + SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword, [], [SynModuleOrNamespace ([SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -52,4 +52,5 @@ ImplFile WithKeyword = None })], (2,0--3,42))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 06e0765a03b..3009a787588 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs", false, QualifiedNameOfFile - SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign, [], [], + SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign, [], [SynModuleOrNamespace ([SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -86,4 +86,5 @@ ImplFile WithKeyword = None })], (2,0--5,40))], PreXmlDocEmpty, [], None, (3,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index 95b26eac8a3..f437240766a 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile - SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword, [], [], + SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword, [], [SynModuleOrNamespace ([SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -72,4 +72,5 @@ ImplFile WithKeyword = None })], (2,0--4,39))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl index b09a60eed84..cf045eeca1f 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs", false, - QualifiedNameOfFile SynTypeDefnWithMemberWithGetHasXmlComment, [], [], + QualifiedNameOfFile SynTypeDefnWithMemberWithGetHasXmlComment, [], [SynModuleOrNamespace ([SynTypeDefnWithMemberWithGetHasXmlComment], false, AnonModule, [Types @@ -52,4 +52,5 @@ ImplFile WithKeyword = None })], (2,0--4,29))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl index e3fe9618a23..97c59244fb9 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/SynTypeDefnWithMemberWithSetget.fs", false, - QualifiedNameOfFile SynTypeDefnWithMemberWithSetget, [], [], + QualifiedNameOfFile SynTypeDefnWithMemberWithSetget, [], [SynModuleOrNamespace ([SynTypeDefnWithMemberWithSetget], false, AnonModule, [Types @@ -112,4 +112,5 @@ ImplFile WithKeyword = None })], (2,0--3,62))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl index 33c1348b561..7277f5e58c2 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Member/SynTypeDefnWithStaticMemberWithGetset.fs", false, - QualifiedNameOfFile SynTypeDefnWithStaticMemberWithGetset, [], [], + QualifiedNameOfFile SynTypeDefnWithStaticMemberWithGetset, [], [SynModuleOrNamespace ([SynTypeDefnWithStaticMemberWithGetset], false, AnonModule, [Types @@ -109,4 +109,5 @@ ImplFile WithKeyword = None })], (2,0--5,54))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 79a865c5eed..70bb20dca39 100644 --- a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Types @@ -71,4 +71,5 @@ ImplFile WithKeyword = None })], (3,0--5,79))], PreXmlDocEmpty, [], None, (1,0--5,79), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,4--4,29)] }, set [])) diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynExprObjMembersHaveCorrectKeywords.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynExprObjMembersHaveCorrectKeywords.fs.bsl index cb73ae7b1dd..c820010e740 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynExprObjMembersHaveCorrectKeywords.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynExprObjMembersHaveCorrectKeywords.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MemberFlag/SynExprObjMembersHaveCorrectKeywords.fs", false, - QualifiedNameOfFile SynExprObjMembersHaveCorrectKeywords, [], [], + QualifiedNameOfFile SynExprObjMembersHaveCorrectKeywords, [], [SynModuleOrNamespace ([SynExprObjMembersHaveCorrectKeywords], false, AnonModule, [Let @@ -107,4 +107,5 @@ ImplFile EqualsRange = Some (2,8--2,9) })], (2,0--7,34))], PreXmlDocEmpty, [], None, (2,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl index 23d12756c3e..bbc45fd79ae 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs", false, - QualifiedNameOfFile SynMemberDefnAbstractSlotHasCorrectKeyword, [], [], + QualifiedNameOfFile SynMemberDefnAbstractSlotHasCorrectKeyword, [], [SynModuleOrNamespace ([SynMemberDefnAbstractSlotHasCorrectKeyword], false, AnonModule, [Types @@ -58,4 +58,5 @@ ImplFile WithKeyword = None })], (2,0--4,26))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl index 76d6b9ac1b5..2f12d930aa0 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs", false, - QualifiedNameOfFile SynMemberDefnAutoPropertyHasCorrectKeyword, [], [], + QualifiedNameOfFile SynMemberDefnAutoPropertyHasCorrectKeyword, [], [SynModuleOrNamespace ([SynMemberDefnAutoPropertyHasCorrectKeyword], false, AnonModule, [Types @@ -110,4 +110,5 @@ ImplFile WithKeyword = None })], (2,0--6,27))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl index ae8cfbaa083..ddf52181d1c 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs", false, QualifiedNameOfFile SynMemberDefnMemberSynValDataHasCorrectKeyword, - [], [], + [], [SynModuleOrNamespace ([SynMemberDefnMemberSynValDataHasCorrectKeyword], false, AnonModule, [Types @@ -127,4 +127,5 @@ ImplFile WithKeyword = None })], (2,0--6,25))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl index 878187410bc..e697a34ef5b 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi", - QualifiedNameOfFile SynMemberSigMemberHasCorrectKeywords, [], [], + QualifiedNameOfFile SynMemberSigMemberHasCorrectKeywords, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -140,4 +140,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--10,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleMember/Do 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Do 01.fs.bsl index 0db6971e934..f6827b5cca3 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Do 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Do 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Do 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Do 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,6 +11,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Do 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Do 02.fs.bsl index 581e4ff62c0..6838d51523f 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Do 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Do 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Do 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Do 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -11,6 +11,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,4) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 01.fs.bsl index 92101cded07..1623f819216 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Let 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Let 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Let 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 02.fs.bsl index cfa14a90cd0..5ee1e17fb11 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Let 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Let 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Let 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 03.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 03.fs.bsl index 374a64bda0e..3d562c39590 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Let 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Let 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Let 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Incomplete structured construct at or before this point in binding. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 04.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 04.fs.bsl index 7d2f30db848..d03ca1555db 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Let 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Let 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Let 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let (false, [], (3,0--3,3)); @@ -8,6 +8,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl index 684cfa3cfb0..8f2b8b3bb5b 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Let 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Let 05.fs", false, QualifiedNameOfFile Let 05, [], [], + ("/root/ModuleMember/Let 05.fs", false, QualifiedNameOfFile Let 05, [], [SynModuleOrNamespace ([Let 05], false, AnonModule, [Let @@ -22,6 +22,7 @@ ImplFile Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], None, (1,0--3,2), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Incomplete structured construct at or before this point in binding. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 01.fs.bsl index 9ba9b81eb53..46136d486f5 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(4,0) parse error Incomplete structured construct at or before this point in open declaration. Expected identifier, 'global', 'type' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 02.fs.bsl index 2a17ef664a5..1b9e7cf4b25 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(4,0) parse error Incomplete structured construct at or before this point in open declaration diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 03.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 03.fs.bsl index 549a2c50a79..0e14ee764f0 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -9,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(5,0) parse error Incomplete structured construct at or before this point in open declaration diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 04.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 04.fs.bsl index 26532b885c0..b3e6f0cbafa 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -9,6 +9,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(5,0) parse error Incomplete structured construct at or before this point in open declaration diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl index d6339de665b..943f383f438 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(5,0) parse error Incomplete structured construct at or before this point in open declaration. Expected identifier, 'global', 'type' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 06.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 06.fs.bsl index 44453c403fa..89c4d60ac8e 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -13,6 +13,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(4,0) parse error Incomplete structured construct at or before this point in open declaration diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 07.fs.bsl index 38af89635b8..a2557366856 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(5,0) parse error Incomplete structured construct at or before this point in open declaration diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 08.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 08.fs.bsl index 5968d7456b1..731b88cc4e2 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 08.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/ModuleMember/Open 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Open 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Open @@ -10,4 +10,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl index 33a28bec72c..54b0a1a1d57 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Val 01.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/ModuleMember/Val 01.fsi", QualifiedNameOfFile Module, [], [], + ("/root/ModuleMember/Val 01.fsi", QualifiedNameOfFile Module, [], [SynModuleOrNamespaceSig ([Module], false, NamedModule, [Val @@ -26,6 +26,7 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,13)-(3,15) parse error Unexpected symbol '->' in value signature diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs.bsl index 11fc84ec748..b54f5371d0e 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 01.fs.bsl @@ -1,12 +1,13 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Anon module 01.fs", false, - QualifiedNameOfFile Anon module 01, [], [], + QualifiedNameOfFile Anon module 01, [], [SynModuleOrNamespace ([Anon module 01], false, AnonModule, [Expr (Const (Unit, (1,0--1,2)), (1,0--1,2))], PreXmlDocEmpty, [], None, (1,0--1,2), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,2) parse warning The declarations in this file will be placed in an implicit module 'Anon module 01' based on the file name 'Anon module 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx.bsl index 448d9bae968..bf0721e59b7 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Anon module 02.fsx.bsl @@ -1,10 +1,11 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Anon module 02.fsx", true, - QualifiedNameOfFile Anon module 02$fsx, [], [], + QualifiedNameOfFile Anon module 02$fsx, [], [SynModuleOrNamespace ([Anon module 02], false, AnonModule, [Expr (Const (Unit, (1,0--1,2)), (1,0--1,2))], PreXmlDocEmpty, [], None, (1,0--1,2), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl index e45507b4a0d..da840787205 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs", false, QualifiedNameOfFile DeclaredNamespaceRangeShouldStartAtNamespaceKeyword, - [], [], + [], [SynModuleOrNamespace ([TypeEquality], false, DeclaredNamespace, [Types @@ -27,4 +27,5 @@ ImplFile WithKeyword = None })], (4,0--5,8))], PreXmlDocEmpty, [], None, (2,0--5,8), { LeadingKeyword = Namespace (2,0--2,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalInOpenPathShouldContainTrivia.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalInOpenPathShouldContainTrivia.fs.bsl index 0d822c247fb..699f0ac585f 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalInOpenPathShouldContainTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalInOpenPathShouldContainTrivia.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/GlobalInOpenPathShouldContainTrivia.fs", false, - QualifiedNameOfFile GlobalInOpenPathShouldContainTrivia, [], [], + QualifiedNameOfFile GlobalInOpenPathShouldContainTrivia, [], [SynModuleOrNamespace ([Ionide; VSCode; FSharp], false, DeclaredNamespace, [Open @@ -12,4 +12,5 @@ ImplFile (4,0--4,16))], PreXmlDocEmpty, [], None, (2,0--4,16), { LeadingKeyword = Namespace (2,0--2,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl index ab4611ba1fc..34dfdc36a77 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs", false, QualifiedNameOfFile GlobalNamespaceShouldStartAtNamespaceKeyword, - [], [], + [], [SynModuleOrNamespace ([], false, GlobalNamespace, [Types @@ -21,5 +21,6 @@ ImplFile None, (4,0--6,12), { LeadingKeyword = Namespace (4,0--4,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,0--2,6); LineComment (3,0--3,6)] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module - Attribute 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module - Attribute 01.fs.bsl index 70ca7f64fdb..d4b48f2982d 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module - Attribute 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module - Attribute 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module - Attribute 01.fs", false, - QualifiedNameOfFile Bar, [], [], + QualifiedNameOfFile Bar, [], [SynModuleOrNamespace ([Bar], false, NamedModule, [Let @@ -32,4 +32,5 @@ ImplFile Range = (2,0--2,11) }], None, (2,0--5,20), { LeadingKeyword = Module (3,0--3,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 01.fs.bsl index 253b83115a7..bc44e7a4541 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 01.fs.bsl @@ -1,10 +1,11 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 01.fs", false, QualifiedNameOfFile A.B.C, - [], [], + [], [SynModuleOrNamespace ([A; B; C], false, NamedModule, [], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--1,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 02.fs.bsl index 1ca7710dfcb..ead7d2d8485 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 02.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 02.fs", false, QualifiedNameOfFile A.B.C, - [], [], + [], [SynModuleOrNamespace ([A; B; C], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 03.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 03.fs.bsl index f71a5daa644..50121eb7488 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 03.fs.bsl @@ -1,11 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 03.fs", false, QualifiedNameOfFile A.B.C, - [], [], + [], [SynModuleOrNamespace ([A; B; C], false, NamedModule, [Expr (Const (Unit, (3,2--3,4)), (3,2--3,4))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 04.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 04.fs.bsl index 226e6492957..ec78caa48c3 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 04.fs.bsl @@ -1,13 +1,14 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 04.fs", false, QualifiedNameOfFile A.B.C, - [], [], + [], [SynModuleOrNamespace ([A; B; C], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDoc ((1,2), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,2--3,2), { LeadingKeyword = Module (1,2--1,8) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (1:3). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 05.fs.bsl index 6f4c8c701d5..27186b63cb7 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 05.fs.bsl @@ -1,12 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 05.fs", false, QualifiedNameOfFile A, [], - [], [SynModuleOrNamespace ([A], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected start of structured construct in definition diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 06.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 06.fs.bsl index ec0cd02e4ce..d89b334db26 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 06.fs.bsl @@ -1,12 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 06.fs", false, QualifiedNameOfFile , [], - [], [SynModuleOrNamespace ([], false, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected start of structured construct in definition. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 07.fs.bsl index b52a7bcdbf4..494bca7af64 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Module 07.fs.bsl @@ -1,12 +1,12 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Module 07.fs", false, QualifiedNameOfFile , [], - [], [SynModuleOrNamespace ([], true, NamedModule, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected start of structured construct in definition. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl index 7e55d2eb57d..e020cf20444 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs", false, - QualifiedNameOfFile FsAutoComplete.FCSPatches, [], [], + QualifiedNameOfFile FsAutoComplete.FCSPatches, [], [SynModuleOrNamespace ([FsAutoComplete; FCSPatches], false, NamedModule, [Open @@ -49,4 +49,5 @@ ImplFile PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--13,14), { LeadingKeyword = Module (5,0--5,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl index 09880fab704..023212b2912 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl @@ -4,7 +4,7 @@ ImplFile false, QualifiedNameOfFile MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword, - [], [], + [], [SynModuleOrNamespace ([TypeEquality], false, DeclaredNamespace, [Types @@ -35,4 +35,5 @@ ImplFile PreXmlDocEmpty, [], None, (7,0--9,10), { LeadingKeyword = Namespace (7,0--7,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs.bsl index d4bb61b979b..e7c2d6c6d03 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 01.fs", false, - QualifiedNameOfFile Namespace 01, [], [], + QualifiedNameOfFile Namespace 01, [], [SynModuleOrNamespace ([Ns1], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], @@ -11,4 +11,5 @@ ImplFile [Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs.bsl index 1e5985485f2..a1538de84fe 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 02.fs", false, - QualifiedNameOfFile Namespace 02, [], [], + QualifiedNameOfFile Namespace 02, [], [SynModuleOrNamespace ([Ns1], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], @@ -11,6 +11,7 @@ ImplFile [Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs.bsl index c822d41e48f..5c442eb837d 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 03.fs", false, - QualifiedNameOfFile Namespace 03, [], [], + QualifiedNameOfFile Namespace 03, [], [SynModuleOrNamespace ([Ns1], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], @@ -11,6 +11,7 @@ ImplFile [Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected start of structured construct in implementation file diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs.bsl index e012c095c25..bb006d2aaf8 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 04.fs", false, - QualifiedNameOfFile Namespace 04, [], [], + QualifiedNameOfFile Namespace 04, [], [SynModuleOrNamespace ([Ns1], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], @@ -11,6 +11,7 @@ ImplFile [Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs.bsl index a41e32b6583..5f412ee2221 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 05.fs.bsl @@ -1,9 +1,10 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 05.fs", false, - QualifiedNameOfFile Namespace 05, [], [], + QualifiedNameOfFile Namespace 05, [], [SynModuleOrNamespace ([], false, DeclaredNamespace, [], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs.bsl index 06fd6804862..f63106c9620 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 06.fs.bsl @@ -1,12 +1,13 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 06.fs", false, - QualifiedNameOfFile Namespace 06, [], [], + QualifiedNameOfFile Namespace 06, [], [SynModuleOrNamespace ([], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], None, (1,0--3,2), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl index 904371c96d7..4afb0f52f03 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 07.fs", false, - QualifiedNameOfFile Namespace 07, [], [], + QualifiedNameOfFile Namespace 07, [], [SynModuleOrNamespace ([], false, DeclaredNamespace, [Types @@ -19,6 +19,7 @@ ImplFile WithKeyword = None })], (3,0--3,12))], PreXmlDocEmpty, [], None, (1,0--3,12), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,4) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs.bsl index 35984038851..36b919a7f82 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 08.fs.bsl @@ -1,9 +1,10 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 08.fs", false, - QualifiedNameOfFile Namespace 08, [], [], + QualifiedNameOfFile Namespace 08, [], [SynModuleOrNamespace ([], true, DeclaredNamespace, [], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs.bsl index c6f1e667ff6..9db89162a52 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Namespace 09.fs", false, - QualifiedNameOfFile Namespace 09, [], [], + QualifiedNameOfFile Namespace 09, [], [SynModuleOrNamespace ([], false, DeclaredNamespace, [Expr (Const (Unit, (3,0--3,2)), (3,0--3,2))], PreXmlDocEmpty, [], @@ -11,6 +11,7 @@ ImplFile [Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], PreXmlDocEmpty, [], None, (5,0--7,2), { LeadingKeyword = Namespace (5,0--5,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,0)-(3,1) parse error Unexpected start of structured construct in implementation file. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl index fddeeca8a03..885b0b117c8 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs", false, - QualifiedNameOfFile NamespaceShouldContainNamespaceKeyword, [], [], + QualifiedNameOfFile NamespaceShouldContainNamespaceKeyword, [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [NestedModule @@ -27,4 +27,5 @@ ImplFile EqualsRange = Some (3,11--3,12) })], PreXmlDocEmpty, [], None, (2,0--4,14), { LeadingKeyword = Namespace (2,0--2,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl index 8b74425f9b6..e12ac1da401 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -16,4 +16,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl index e7761029d97..9724fa99d55 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl index 44ab73f81ad..a37acb38fda 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(5,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl index 4208cc94225..94a68e469af 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(5,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl index 53b4a1f12df..2b38fecef1e 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,11)-(5,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl index d6875779d2f..92a0fd598cf 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 06.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,13)-(5,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl index 569bdfe5811..bf4b8207050 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 07.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl index 1b6fcc1a41c..f2411c2682b 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 08.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,13)-(6,4) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl index 175f01fc0e0..c4e7b8b3451 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 09.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl index 4605fc9a35d..9cf96516449 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 10.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(6,4) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl index 181836a8b7f..135e3df2d10 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 11.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(5,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl index eb79389bb5c..7d45479cb57 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 12.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,0), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl index c57a57743cb..96edfc00dee 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 13.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl index 708fae6dee0..d79064e294f 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 14.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [NestedModule @@ -14,6 +14,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl index e7aaa7fbdbc..f837a3cf675 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 15.fs", false, - QualifiedNameOfFile Nested module 15, [], [], + QualifiedNameOfFile Nested module 15, [], [SynModuleOrNamespace ([Ns], false, DeclaredNamespace, [NestedModule @@ -13,6 +13,7 @@ ImplFile EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--3,10), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl index 2ce127eef5d..c7401f2e650 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 16.fs", false, - QualifiedNameOfFile Nested module 16, [], [], + QualifiedNameOfFile Nested module 16, [], [SynModuleOrNamespace ([Ns], false, DeclaredNamespace, [NestedModule @@ -13,6 +13,7 @@ ImplFile EqualsRange = None })], PreXmlDocEmpty, [], None, (1,0--3,8), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl index 4e5dd1a1914..c48299a6150 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/ModuleOrNamespace/Nested module 17.fs", false, - QualifiedNameOfFile Nested module 17, [], [], + QualifiedNameOfFile Nested module 17, [], [SynModuleOrNamespace ([Ns], false, DeclaredNamespace, [NestedModule @@ -13,6 +13,7 @@ ImplFile EqualsRange = None })], PreXmlDocEmpty, [], None, (1,0--4,0), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl index 13f845e312a..785521f5d0d 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi", - QualifiedNameOfFile GlobalNamespaceShouldStartAtNamespaceKeyword, [], [], + QualifiedNameOfFile GlobalNamespaceShouldStartAtNamespaceKeyword, [], [SynModuleOrNamespaceSig ([], false, GlobalNamespace, [Types @@ -38,5 +38,6 @@ SigFile WithKeyword = None })], (6,0--6,32))], PreXmlDocEmpty, [], None, (4,0--6,32), { LeadingKeyword = Namespace (4,0--4,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,0--2,6); LineComment (3,0--3,6)] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl index 045e4931a62..fbd3308bd1f 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/ModuleAbbreviation.fsi", - QualifiedNameOfFile Foo, [], [], + QualifiedNameOfFile Foo, [], [SynModuleOrNamespaceSig ([Foo], false, NamedModule, [Open @@ -49,4 +49,5 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--12,13), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl index 833995c7304..7455aeeea52 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/ModuleRangeShouldStartAtFirstAttribute.fsi", - QualifiedNameOfFile Bar, [], [], + QualifiedNameOfFile Bar, [], [SynModuleOrNamespaceSig ([Bar], false, NamedModule, [Val @@ -23,5 +23,6 @@ SigFile Range = (2,4--2,7) }] Range = (2,0--2,11) }], None, (2,0--5,14), { LeadingKeyword = Module (3,0--3,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl index 9c4dbafc6cd..8544b0f17b5 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/ModuleShouldContainModuleKeyword.fsi", - QualifiedNameOfFile Bar, [], [], + QualifiedNameOfFile Bar, [], [SynModuleOrNamespaceSig ([Bar], false, NamedModule, [Val @@ -18,4 +18,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--4,10), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl index a2d8deea5fe..33b397cbffe 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi", - QualifiedNameOfFile Namespace - Keyword 01, [], [], + QualifiedNameOfFile Namespace - Keyword 01, [], [SynModuleOrNamespaceSig ([Foo], false, DeclaredNamespace, [NestedModule @@ -24,4 +24,5 @@ SigFile EqualsRange = Some (3,11--3,12) })], PreXmlDocEmpty, [], None, (1,0--4,14), { LeadingKeyword = Namespace (1,0--1,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl index 2ca7d9b108a..a987306bfc6 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/Nested module 01.fsi", - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespaceSig ([Module], false, NamedModule, [NestedModule @@ -36,4 +36,5 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,10), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl index 8a0f981091f..46bc6ef7b84 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi", QualifiedNameOfFile RangeMemberReturnsRangeOfSynModuleOrNamespaceSig, [], - [], [SynModuleOrNamespaceSig ([Foobar], false, DeclaredNamespace, [Types @@ -39,4 +38,5 @@ SigFile WithKeyword = None })], (4,0--4,32))], PreXmlDocEmpty, [], None, (2,0--4,32), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl index d9d1e49ae74..7cd76d669db 100644 --- a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi", - QualifiedNameOfFile A.B, [], [], + QualifiedNameOfFile A.B, [], [SynModuleOrNamespaceSig ([A; B], false, NamedModule, [NestedModule @@ -25,6 +25,7 @@ SigFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,11), { LeadingKeyword = Module (1,0--1,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(5,0) parse error Incomplete structured construct at or before this point in signature file. Expected ':', '=' or other token. diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl index 24837f66d09..23937834db6 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/NestedModule/NestedModuleWithBeginEndAndDecls.fs", false, - QualifiedNameOfFile NestedModuleWithBeginEndAndDecls, [], [], + QualifiedNameOfFile NestedModuleWithBeginEndAndDecls, [], [SynModuleOrNamespace ([X], false, DeclaredNamespace, [NestedModule @@ -27,4 +27,5 @@ ImplFile EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--6,7), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl index 878125cde66..ca093b12f75 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/NestedModule/NestedModuleWithBeginEndAndDecls.fsi", - QualifiedNameOfFile NestedModuleWithBeginEndAndDecls, [], [], + QualifiedNameOfFile NestedModuleWithBeginEndAndDecls, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [NestedModule @@ -37,4 +37,5 @@ SigFile EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--7,7), { LeadingKeyword = Namespace (1,0--1,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl index 0160f4068bf..8538ab3d4cc 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs", - false, QualifiedNameOfFile TopLevel, [], [], + false, QualifiedNameOfFile TopLevel, [], [SynModuleOrNamespace ([TopLevel], false, NamedModule, [NestedModule @@ -20,4 +20,5 @@ ImplFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--6,6), { LeadingKeyword = Module (2,0--2,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl index 2d2eb425be6..eaac7dbed8e 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi", QualifiedNameOfFile - RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule, [], [], + RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule, [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [NestedModule @@ -30,4 +30,5 @@ SigFile EqualsRange = Some (5,14--5,15) })], PreXmlDocEmpty, [], None, (2,0--6,15), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl index 45d8f088c57..dfecd0d9c4d 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/NestedModule/RangeOfBeginEnd.fs", false, - QualifiedNameOfFile RangeOfBeginEnd, [], [], + QualifiedNameOfFile RangeOfBeginEnd, [], [SynModuleOrNamespace ([X], false, DeclaredNamespace, [NestedModule @@ -13,4 +13,5 @@ ImplFile EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--4,13), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl index 33815671eb9..1e08843a84a 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/NestedModule/RangeOfBeginEnd.fsi", - QualifiedNameOfFile RangeOfBeginEnd, [], [], + QualifiedNameOfFile RangeOfBeginEnd, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [NestedModule @@ -13,4 +13,5 @@ SigFile EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--4,13), { LeadingKeyword = Namespace (1,0--1,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl index da9c0e154f4..5b493568519 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/NestedModule/RangeOfEqualSignShouldBePresent.fs", false, - QualifiedNameOfFile RangeOfEqualSignShouldBePresent, [], [], + QualifiedNameOfFile RangeOfEqualSignShouldBePresent, [], [SynModuleOrNamespace ([RangeOfEqualSignShouldBePresent], false, AnonModule, [NestedModule @@ -14,4 +14,5 @@ ImplFile EqualsRange = Some (2,9--2,10) })], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl index d9575b21a86..627b1b608b9 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi", - QualifiedNameOfFile RangeOfEqualSignShouldBePresentSignatureFile, [], [], + QualifiedNameOfFile RangeOfEqualSignShouldBePresentSignatureFile, [], [SynModuleOrNamespaceSig ([Foo], false, DeclaredNamespace, [NestedModule @@ -24,4 +24,5 @@ SigFile EqualsRange = Some (4,9--4,10) })], PreXmlDocEmpty, [], None, (2,0--5,17), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl index d1d8882f2a0..fc0b13845c2 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl @@ -3,7 +3,6 @@ SigFile ("/root/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi", QualifiedNameOfFile RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl, [], - [], [SynModuleOrNamespaceSig ([Microsoft; FSharp; Core], false, DeclaredNamespace, [Open @@ -549,4 +548,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--61,26), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl index fa15e544c36..d544fd6cd7b 100644 --- a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/AbstractClassProperty.fs", false, - QualifiedNameOfFile AbstractClassProperty, [], [], + QualifiedNameOfFile AbstractClassProperty, [], [SynModuleOrNamespace ([AbstractClassProperty], false, AnonModule, [Types @@ -57,4 +57,5 @@ ImplFile WithKeyword = None })], (1,0--3,51))], PreXmlDocEmpty, [], None, (1,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl index e60a05e853d..13161fa49f4 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/DuCaseStringOrNull.fs", false, - QualifiedNameOfFile DuCaseStringOrNull, [], [], + QualifiedNameOfFile DuCaseStringOrNull, [], [SynModuleOrNamespace ([DuCaseStringOrNull], false, AnonModule, [Types @@ -36,4 +36,5 @@ ImplFile WithKeyword = None })], (1,0--1,35))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl index 1ae968787e3..51050a8e198 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/DuCaseTuplePrecedence.fs", false, - QualifiedNameOfFile DuCaseTuplePrecedence, [], [], + QualifiedNameOfFile DuCaseTuplePrecedence, [], [SynModuleOrNamespace ([DuCaseTuplePrecedence], false, AnonModule, [Types @@ -43,4 +43,5 @@ ImplFile WithKeyword = None })], (1,0--1,41))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl index b590e85bce5..8626a3204af 100644 --- a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/ExplicitField.fs", false, - QualifiedNameOfFile ExplicitField, [], [], + QualifiedNameOfFile ExplicitField, [], [SynModuleOrNamespace ([ExplicitField], false, AnonModule, [Types @@ -29,4 +29,5 @@ ImplFile WithKeyword = None })], (1,0--4,7))], PreXmlDocEmpty, [], None, (1,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/FunctionArgAsPatternWithNullCase.fs.bsl b/tests/service/data/SyntaxTree/Nullness/FunctionArgAsPatternWithNullCase.fs.bsl index 1d72ceec00a..9c06341d4c1 100644 --- a/tests/service/data/SyntaxTree/Nullness/FunctionArgAsPatternWithNullCase.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/FunctionArgAsPatternWithNullCase.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/FunctionArgAsPatternWithNullCase.fs", false, - QualifiedNameOfFile FunctionArgAsPatternWithNullCase, [], [], + QualifiedNameOfFile FunctionArgAsPatternWithNullCase, [], [SynModuleOrNamespace ([FunctionArgAsPatternWithNullCase], false, AnonModule, [Let @@ -45,4 +45,5 @@ ImplFile (1,0--1,52))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericFunctionReturnTypeNotStructNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericFunctionReturnTypeNotStructNull.fs.bsl index d155f74abba..bc7e62dbcf8 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericFunctionReturnTypeNotStructNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericFunctionReturnTypeNotStructNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericFunctionReturnTypeNotStructNull.fs", false, - QualifiedNameOfFile GenericFunctionReturnTypeNotStructNull, [], [], + QualifiedNameOfFile GenericFunctionReturnTypeNotStructNull, [], [SynModuleOrNamespace ([GenericFunctionReturnTypeNotStructNull], false, AnonModule, [Let @@ -39,4 +39,5 @@ ImplFile EqualsRange = Some (1,51--1,52) })], (1,0--1,57))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNotNull.fs.bsl index f03151197dd..93b7e56d1ec 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNotNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericFunctionTyparNotNull.fs", false, - QualifiedNameOfFile GenericFunctionTyparNotNull, [], [], + QualifiedNameOfFile GenericFunctionTyparNotNull, [], [SynModuleOrNamespace ([GenericFunctionTyparNotNull], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (1,37--1,38) })], (1,0--1,41))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNull.fs.bsl index db83d1ddcbf..07032a6b6a8 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericFunctionTyparNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericFunctionTyparNull.fs", false, - QualifiedNameOfFile GenericFunctionTyparNull, [], [], + QualifiedNameOfFile GenericFunctionTyparNull, [], [SynModuleOrNamespace ([GenericFunctionTyparNull], false, AnonModule, [Let @@ -33,4 +33,5 @@ ImplFile (1,0--1,37))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl index 92d0d1a136c..2e217784614 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericTypeNotNull.fs", false, - QualifiedNameOfFile GenericTypeNotNull, [], [], + QualifiedNameOfFile GenericTypeNotNull, [], [SynModuleOrNamespace ([GenericTypeNotNull], false, AnonModule, [Types @@ -25,4 +25,5 @@ ImplFile WithKeyword = None })], (1,0--1,40))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl index 0906d86df22..4f47caa397c 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericTypeNotNullAndOtherConstraint.fs", false, - QualifiedNameOfFile GenericTypeNotNullAndOtherConstraint, [], [], + QualifiedNameOfFile GenericTypeNotNullAndOtherConstraint, [], [SynModuleOrNamespace ([GenericTypeNotNullAndOtherConstraint], false, AnonModule, [Types @@ -28,4 +28,5 @@ ImplFile WithKeyword = None })], (1,0--1,56))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs.bsl index 6ebe197154b..0ea0210a109 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Nullness/GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs", false, QualifiedNameOfFile GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane, - [], [], + [], [SynModuleOrNamespace ([GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane], false, AnonModule, @@ -29,6 +29,7 @@ ImplFile WithKeyword = None })], (1,0--1,58))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane' based on the file name 'GenericTypeNotStructAndOtherConstraint-I_am_Still_Sane.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl index 184b29d69d3..59936ebce22 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericTypeNull.fs", false, - QualifiedNameOfFile GenericTypeNull, [], [], + QualifiedNameOfFile GenericTypeNull, [], [SynModuleOrNamespace ([GenericTypeNull], false, AnonModule, [Types @@ -24,4 +24,5 @@ ImplFile WithKeyword = None })], (1,0--1,36))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl index c6f6f52d871..59b59562625 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs", false, - QualifiedNameOfFile GenericTypeOtherConstraintAndThenNotNull, [], [], + QualifiedNameOfFile GenericTypeOtherConstraintAndThenNotNull, [], [SynModuleOrNamespace ([GenericTypeOtherConstraintAndThenNotNull], false, AnonModule, [Types @@ -27,4 +27,5 @@ ImplFile WithKeyword = None })], (1,0--1,56))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/IntListOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/IntListOrNull.fs.bsl index c678aa83577..89aba46b669 100644 --- a/tests/service/data/SyntaxTree/Nullness/IntListOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/IntListOrNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/IntListOrNull.fs", false, - QualifiedNameOfFile IntListOrNull, [], [], + QualifiedNameOfFile IntListOrNull, [], [SynModuleOrNamespace ([IntListOrNull], false, AnonModule, [Let @@ -36,4 +36,5 @@ ImplFile (1,0--1,28))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/IntListOrNullOrNullOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/IntListOrNullOrNullOrNull.fs.bsl index 2ba94607f41..73acd0cd00d 100644 --- a/tests/service/data/SyntaxTree/Nullness/IntListOrNullOrNullOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/IntListOrNullOrNullOrNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/IntListOrNullOrNullOrNull.fs", false, - QualifiedNameOfFile IntListOrNullOrNullOrNull, [], [], + QualifiedNameOfFile IntListOrNullOrNullOrNull, [], [SynModuleOrNamespace ([IntListOrNullOrNullOrNull], false, AnonModule, [Let @@ -35,6 +35,7 @@ ImplFile EqualsRange = None })], (1,0--1,23))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,24)-(1,25) parse error Unexpected symbol '|' (directly before 'null') in binding. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCast.fs.bsl b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCast.fs.bsl index 86094715714..773ff445618 100644 --- a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCast.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCast.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/MatchWithTypeCast.fs", false, - QualifiedNameOfFile MatchWithTypeCast, [], [], + QualifiedNameOfFile MatchWithTypeCast, [], [SynModuleOrNamespace ([MatchWithTypeCast], false, AnonModule, [Expr @@ -20,4 +20,5 @@ ImplFile WithKeyword = (1,8--1,12) }), (1,0--2,24))], PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParens.fs.bsl b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParens.fs.bsl index 2c465e58091..9576ea6b023 100644 --- a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParens.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParens.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/MatchWithTypeCastParens.fs", false, - QualifiedNameOfFile MatchWithTypeCastParens, [], [], + QualifiedNameOfFile MatchWithTypeCastParens, [], [SynModuleOrNamespace ([MatchWithTypeCastParens], false, AnonModule, [Expr @@ -21,4 +21,5 @@ ImplFile WithKeyword = (1,8--1,12) }), (1,0--2,26))], PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParensAndSeparateNullCase.fs.bsl b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParensAndSeparateNullCase.fs.bsl index aa2e5f0787c..00f7882ac7f 100644 --- a/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParensAndSeparateNullCase.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/MatchWithTypeCastParensAndSeparateNullCase.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/MatchWithTypeCastParensAndSeparateNullCase.fs", false, - QualifiedNameOfFile MatchWithTypeCastParensAndSeparateNullCase, [], [], + QualifiedNameOfFile MatchWithTypeCastParensAndSeparateNullCase, [], [SynModuleOrNamespace ([MatchWithTypeCastParensAndSeparateNullCase], false, AnonModule, [Expr @@ -23,4 +23,5 @@ ImplFile WithKeyword = (1,8--1,12) }), (1,0--2,33))], PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/NullAnnotatedExpression.fs.bsl b/tests/service/data/SyntaxTree/Nullness/NullAnnotatedExpression.fs.bsl index 207a76250e4..1b3916e4190 100644 --- a/tests/service/data/SyntaxTree/Nullness/NullAnnotatedExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/NullAnnotatedExpression.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/NullAnnotatedExpression.fs", false, - QualifiedNameOfFile NullAnnotatedExpression, [], [], + QualifiedNameOfFile NullAnnotatedExpression, [], [SynModuleOrNamespace ([NullAnnotatedExpression], false, AnonModule, [Let @@ -70,4 +70,5 @@ ImplFile EqualsRange = Some (1,64--1,65) })], (1,0--1,70))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionAnnotatedInlinePatternMatch.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionAnnotatedInlinePatternMatch.fs.bsl index aaa2b2bafc3..2670129859e 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionAnnotatedInlinePatternMatch.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionAnnotatedInlinePatternMatch.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionAnnotatedInlinePatternMatch.fs", false, - QualifiedNameOfFile RegressionAnnotatedInlinePatternMatch, [], [], + QualifiedNameOfFile RegressionAnnotatedInlinePatternMatch, [], [SynModuleOrNamespace ([RegressionAnnotatedInlinePatternMatch], false, AnonModule, [Expr @@ -26,4 +26,5 @@ ImplFile WithKeyword = (1,8--1,12) }), (1,0--2,37))], PreXmlDocEmpty, [], None, (1,0--2,37), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl index aa2b6752d76..79d2dfce12c 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionChoiceType.fs", false, - QualifiedNameOfFile RegressionChoiceType, [], [], + QualifiedNameOfFile RegressionChoiceType, [], [SynModuleOrNamespace ([RegressionChoiceType], false, AnonModule, [Types @@ -52,4 +52,5 @@ ImplFile WithKeyword = None })], (1,0--7,19))], PreXmlDocEmpty, [], None, (1,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl index 5b1a914a438..749078efa17 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionListType.fs", false, - QualifiedNameOfFile RegressionListType, [], [], + QualifiedNameOfFile RegressionListType, [], [SynModuleOrNamespace ([RegressionListType], false, AnonModule, [Types @@ -62,4 +62,5 @@ ImplFile WithKeyword = None })], (1,0--3,41))], PreXmlDocEmpty, [], None, (1,0--3,41), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl index 7a062070cb7..8d6a085bc09 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionOneLinerOptionType.fs", false, - QualifiedNameOfFile RegressionOneLinerOptionType, [], [], + QualifiedNameOfFile RegressionOneLinerOptionType, [], [SynModuleOrNamespace ([RegressionOneLinerOptionType], false, AnonModule, [Types @@ -35,4 +35,5 @@ ImplFile WithKeyword = None })], (1,0--1,41))], PreXmlDocEmpty, [], None, (1,0--1,41), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl index 5491684ccaa..502b1ba39e7 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionOptionType.fs", false, - QualifiedNameOfFile RegressionOptionType, [], [], + QualifiedNameOfFile RegressionOptionType, [], [SynModuleOrNamespace ([RegressionOptionType], false, AnonModule, [Types @@ -58,6 +58,7 @@ ImplFile WithKeyword = None })], (1,0--3,33))], PreXmlDocEmpty, [], None, (1,0--3,34), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (2,6)-(2,27) parse warning This construct is deprecated: it is only for use in the F# library diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOrPattern.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOrPattern.fs.bsl index 82fe5cb33d5..be820f4de6c 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOrPattern.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOrPattern.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionOrPattern.fs", false, - QualifiedNameOfFile RegressionOrPattern, [], [], + QualifiedNameOfFile RegressionOrPattern, [], [SynModuleOrNamespace ([RegressionOrPattern], false, AnonModule, [Expr @@ -37,4 +37,5 @@ ImplFile WithKeyword = (1,10--1,14) }), (1,0--3,24))], PreXmlDocEmpty, [], None, (1,0--3,24), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl index c36213899e7..e7de7e51e35 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/RegressionResultType.fs", false, - QualifiedNameOfFile RegressionResultType, [], [], + QualifiedNameOfFile RegressionResultType, [], [SynModuleOrNamespace ([RegressionResultType], false, AnonModule, [Types @@ -53,4 +53,5 @@ ImplFile WithKeyword = None })], (1,4--7,35))], PreXmlDocEmpty, [], None, (1,4--7,35), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl index f1ba6080294..317752b3425 100644 --- a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/SignatureInAbstractMember.fs", false, - QualifiedNameOfFile SignatureInAbstractMember, [], [], + QualifiedNameOfFile SignatureInAbstractMember, [], [SynModuleOrNamespace ([SignatureInAbstractMember], false, AnonModule, [Types @@ -57,4 +57,5 @@ ImplFile WithKeyword = None })], (1,0--2,61))], PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/StringOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/StringOrNull.fs.bsl index 4e8240dd5fb..14b3dde2c67 100644 --- a/tests/service/data/SyntaxTree/Nullness/StringOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/StringOrNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/StringOrNull.fs", false, QualifiedNameOfFile StringOrNull, - [], [], + [], [SynModuleOrNamespace ([StringOrNull], false, AnonModule, [Let @@ -29,4 +29,5 @@ ImplFile EqualsRange = Some (1,22--1,23) })], (1,0--1,28))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/StringOrNullInFunctionArg.fs.bsl b/tests/service/data/SyntaxTree/Nullness/StringOrNullInFunctionArg.fs.bsl index 864e6e38365..162ebbfbdf3 100644 --- a/tests/service/data/SyntaxTree/Nullness/StringOrNullInFunctionArg.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/StringOrNullInFunctionArg.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/StringOrNullInFunctionArg.fs", false, - QualifiedNameOfFile StringOrNullInFunctionArg, [], [], + QualifiedNameOfFile StringOrNullInFunctionArg, [], [SynModuleOrNamespace ([StringOrNullInFunctionArg], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (1,32--1,33) })], (1,0--1,36))], PreXmlDocEmpty, [], None, (1,0--2,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl index 61d17ea291a..20af4b08c2e 100644 --- a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Nullness/TypeAbbreviationAddingWithNull.fs", false, - QualifiedNameOfFile TypeAbbreviationAddingWithNull, [], [], + QualifiedNameOfFile TypeAbbreviationAddingWithNull, [], [SynModuleOrNamespace ([TypeAbbreviationAddingWithNull], false, AnonModule, [Types @@ -22,4 +22,5 @@ ImplFile WithKeyword = None })], (1,0--1,33))], PreXmlDocEmpty, [], None, (1,0--1,33), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 01.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 01.fs.bsl index 43d64f45a98..d181dbabbb8 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 01.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 01.fs", false, - QualifiedNameOfFile ActivePatternAnd 01, [], [], + QualifiedNameOfFile ActivePatternAnd 01, [], [SynModuleOrNamespace ([ActivePatternAnd 01], false, AnonModule, [Let @@ -29,6 +29,7 @@ ImplFile EqualsRange = Some (1,26--1,27) })], (1,0--1,34))], PreXmlDocEmpty, [], None, (1,0--1,34), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,34) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 01' based on the file name 'ActivePatternAnd 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 02.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 02.fs.bsl index 23ebdc7c8da..2197d608c40 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 02.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 02.fs", false, - QualifiedNameOfFile ActivePatternAnd 02, [], [], + QualifiedNameOfFile ActivePatternAnd 02, [], [SynModuleOrNamespace ([ActivePatternAnd 02], false, AnonModule, [Let @@ -30,6 +30,7 @@ ImplFile EqualsRange = Some (1,28--1,29) })], (1,0--1,36))], PreXmlDocEmpty, [], None, (1,0--1,36), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,36) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 02' based on the file name 'ActivePatternAnd 02.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 03.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 03.fs.bsl index f59e50d9403..bf6cf297f48 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 03.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 03.fs", false, - QualifiedNameOfFile ActivePatternAnd 03, [], [], + QualifiedNameOfFile ActivePatternAnd 03, [], [SynModuleOrNamespace ([ActivePatternAnd 03], false, AnonModule, [Let @@ -30,6 +30,7 @@ ImplFile EqualsRange = Some (1,28--1,29) })], (1,0--1,36))], PreXmlDocEmpty, [], None, (1,0--1,36), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,36) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 03' based on the file name 'ActivePatternAnd 03.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 04.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 04.fs.bsl index 37b343fad98..8da67b53c6f 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 04.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 04.fs", false, - QualifiedNameOfFile ActivePatternAnd 04, [], [], + QualifiedNameOfFile ActivePatternAnd 04, [], [SynModuleOrNamespace ([ActivePatternAnd 04], false, AnonModule, [Let @@ -31,6 +31,7 @@ ImplFile EqualsRange = Some (1,30--1,31) })], (1,0--1,38))], PreXmlDocEmpty, [], None, (1,0--1,38), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,38) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 04' based on the file name 'ActivePatternAnd 04.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 05.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 05.fs.bsl index 062a413ccde..290c17827df 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 05.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 05.fs", false, - QualifiedNameOfFile ActivePatternAnd 05, [], [], + QualifiedNameOfFile ActivePatternAnd 05, [], [SynModuleOrNamespace ([ActivePatternAnd 05], false, AnonModule, [Let @@ -31,6 +31,7 @@ ImplFile EqualsRange = Some (1,30--1,31) })], (1,0--1,38))], PreXmlDocEmpty, [], None, (1,0--1,38), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,38) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 05' based on the file name 'ActivePatternAnd 05.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 06.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 06.fs.bsl index 7c8649824d5..b4226cc1f83 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 06.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 06.fs", false, - QualifiedNameOfFile ActivePatternAnd 06, [], [], + QualifiedNameOfFile ActivePatternAnd 06, [], [SynModuleOrNamespace ([ActivePatternAnd 06], false, AnonModule, [Let @@ -34,6 +34,7 @@ ImplFile EqualsRange = Some (1,36--1,37) })], (1,0--1,44))], PreXmlDocEmpty, [], None, (1,0--1,44), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,44) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 06' based on the file name 'ActivePatternAnd 06.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 07.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 07.fs.bsl index 71db7cf842c..c4970b53599 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 07.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 07.fs", false, - QualifiedNameOfFile ActivePatternAnd 07, [], [], + QualifiedNameOfFile ActivePatternAnd 07, [], [SynModuleOrNamespace ([ActivePatternAnd 07], false, AnonModule, [Let @@ -33,6 +33,7 @@ ImplFile EqualsRange = Some (1,32--1,33) })], (1,0--1,40))], PreXmlDocEmpty, [], None, (1,0--1,40), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,40) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 07' based on the file name 'ActivePatternAnd 07.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 08.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 08.fs.bsl index c2c958503a8..277fb1aeac1 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 08.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAnd 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAnd 08.fs", false, - QualifiedNameOfFile ActivePatternAnd 08, [], [], + QualifiedNameOfFile ActivePatternAnd 08, [], [SynModuleOrNamespace ([ActivePatternAnd 08], false, AnonModule, [Let @@ -33,6 +33,7 @@ ImplFile EqualsRange = Some (1,34--1,35) })], (1,0--1,42))], PreXmlDocEmpty, [], None, (1,0--1,42), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(1,42) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternAnd 08' based on the file name 'ActivePatternAnd 08.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAsFunction.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAsFunction.fs.bsl index 83e6005fd33..6775b6d1846 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternAsFunction.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternAsFunction.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternAsFunction.fs", false, - QualifiedNameOfFile ActivePatternAsFunction, [], [], + QualifiedNameOfFile ActivePatternAsFunction, [], [SynModuleOrNamespace ([ActivePatternAsFunction], false, AnonModule, [Expr @@ -16,4 +16,5 @@ ImplFile (2,0--2,14))], PreXmlDocEmpty, [], None, (2,0--2,14), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternDefinition.fs.bsl index 9741e505625..c4b9f6a0919 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternDefinition.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternDefinition.fs", false, - QualifiedNameOfFile ActivePatternDefinition, [], [], + QualifiedNameOfFile ActivePatternDefinition, [], [SynModuleOrNamespace ([ActivePatternDefinition], false, AnonModule, [Let @@ -62,4 +62,5 @@ ImplFile EqualsRange = Some (2,26--2,27) })], (2,0--2,59))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 01.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 01.fs.bsl index f90393a139b..5862ca0ad2b 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 01.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 01.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 01, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 01, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 01], false, AnonModule, [Exception @@ -38,6 +38,7 @@ ImplFile EqualsRange = Some (3,22--3,23) })], (3,0--3,30))], PreXmlDocEmpty, [], None, (1,0--3,30), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 01' based on the file name 'ActivePatternExceptionAnd 01.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 02.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 02.fs.bsl index ad1420869f1..8ebb6648227 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 02.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 02.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 02, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 02, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 02], false, AnonModule, [Exception @@ -39,6 +39,7 @@ ImplFile EqualsRange = Some (3,24--3,25) })], (3,0--3,32))], PreXmlDocEmpty, [], None, (1,0--3,32), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 02' based on the file name 'ActivePatternExceptionAnd 02.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 03.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 03.fs.bsl index 1b4bdf7dfd9..2574d438123 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 03.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 03.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 03, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 03, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 03], false, AnonModule, [Exception @@ -39,6 +39,7 @@ ImplFile EqualsRange = Some (3,24--3,25) })], (3,0--3,32))], PreXmlDocEmpty, [], None, (1,0--3,32), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 03' based on the file name 'ActivePatternExceptionAnd 03.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 04.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 04.fs.bsl index ea96f1966b4..74cdc1226cb 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 04.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 04.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 04, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 04, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 04], false, AnonModule, [Exception @@ -40,6 +40,7 @@ ImplFile EqualsRange = Some (3,26--3,27) })], (3,0--3,34))], PreXmlDocEmpty, [], None, (1,0--3,34), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 04' based on the file name 'ActivePatternExceptionAnd 04.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 05.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 05.fs.bsl index 2517eb3918d..53656ca36c6 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 05.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 05.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 05, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 05, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 05], false, AnonModule, [Exception @@ -40,6 +40,7 @@ ImplFile EqualsRange = Some (3,26--3,27) })], (3,0--3,34))], PreXmlDocEmpty, [], None, (1,0--3,34), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 05' based on the file name 'ActivePatternExceptionAnd 05.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 06.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 06.fs.bsl index 91e95536c83..e96412948a7 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 06.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 06.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 06, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 06, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 06], false, AnonModule, [Exception @@ -43,6 +43,7 @@ ImplFile EqualsRange = Some (3,32--3,33) })], (3,0--3,40))], PreXmlDocEmpty, [], None, (1,0--3,40), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 06' based on the file name 'ActivePatternExceptionAnd 06.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 07.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 07.fs.bsl index 35c7d986cf3..5da96ee160d 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 07.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 07.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 07, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 07, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 07], false, AnonModule, [Exception @@ -41,6 +41,7 @@ ImplFile EqualsRange = Some (3,28--3,29) })], (3,0--3,36))], PreXmlDocEmpty, [], None, (1,0--3,36), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 07' based on the file name 'ActivePatternExceptionAnd 07.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 08.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 08.fs.bsl index d61d4fa3ef0..b9c67aaa65a 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 08.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternExceptionAnd 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternExceptionAnd 08.fs", false, - QualifiedNameOfFile ActivePatternExceptionAnd 08, [], [], + QualifiedNameOfFile ActivePatternExceptionAnd 08, [], [SynModuleOrNamespace ([ActivePatternExceptionAnd 08], false, AnonModule, [Exception @@ -41,6 +41,7 @@ ImplFile EqualsRange = Some (3,30--3,31) })], (3,0--3,38))], PreXmlDocEmpty, [], None, (1,0--3,38), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'ActivePatternExceptionAnd 08' based on the file name 'ActivePatternExceptionAnd 08.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl index a91a973e4e5..faa01ee9c32 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ActivePatternIdentifierInPrivateMember.fs", false, - QualifiedNameOfFile ActivePatternIdentifierInPrivateMember, [], [], + QualifiedNameOfFile ActivePatternIdentifierInPrivateMember, [], [SynModuleOrNamespace ([ActivePatternIdentifierInPrivateMember], false, AnonModule, [Types @@ -59,4 +59,5 @@ ImplFile WithKeyword = None })], (2,0--7,6))], PreXmlDocEmpty, [], None, (2,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/CustomOperatorDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/CustomOperatorDefinition.fs.bsl index 33ebeafb08c..af3de67443e 100644 --- a/tests/service/data/SyntaxTree/OperatorName/CustomOperatorDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/CustomOperatorDefinition.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/CustomOperatorDefinition.fs", false, - QualifiedNameOfFile CustomOperatorDefinition, [], [], + QualifiedNameOfFile CustomOperatorDefinition, [], [SynModuleOrNamespace ([CustomOperatorDefinition], false, AnonModule, [Let @@ -40,4 +40,5 @@ ImplFile EqualsRange = Some (2,12--2,13) })], (2,0--2,19))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/DetectDifferenceBetweenCompiledOperators.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/DetectDifferenceBetweenCompiledOperators.fs.bsl index 51389ae62c8..f004ea099bc 100644 --- a/tests/service/data/SyntaxTree/OperatorName/DetectDifferenceBetweenCompiledOperators.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/DetectDifferenceBetweenCompiledOperators.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/DetectDifferenceBetweenCompiledOperators.fs", false, - QualifiedNameOfFile DetectDifferenceBetweenCompiledOperators, [], [], + QualifiedNameOfFile DetectDifferenceBetweenCompiledOperators, [], [SynModuleOrNamespace ([DetectDifferenceBetweenCompiledOperators], false, AnonModule, [Expr @@ -25,4 +25,5 @@ ImplFile Ident b, (3,0--3,15)), (3,0--3,15))], PreXmlDocEmpty, [], None, (2,0--3,15), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/InfixOperation.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/InfixOperation.fs.bsl index 20572a95193..ca7dcac4ee8 100644 --- a/tests/service/data/SyntaxTree/OperatorName/InfixOperation.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/InfixOperation.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/InfixOperation.fs", false, - QualifiedNameOfFile InfixOperation, [], [], + QualifiedNameOfFile InfixOperation, [], [SynModuleOrNamespace ([InfixOperation], false, AnonModule, [Expr @@ -18,4 +18,5 @@ ImplFile (2,0--2,5))], PreXmlDocEmpty, [], None, (2,0--2,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/NamedParameter.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/NamedParameter.fs.bsl index bc0bf9748b4..a7508b0341d 100644 --- a/tests/service/data/SyntaxTree/OperatorName/NamedParameter.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/NamedParameter.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/NamedParameter.fs", false, - QualifiedNameOfFile NamedParameter, [], [], + QualifiedNameOfFile NamedParameter, [], [SynModuleOrNamespace ([NamedParameter], false, AnonModule, [Expr @@ -21,4 +21,5 @@ ImplFile Some (2,5--2,6), (2,1--2,6)), (2,0--2,6)), (2,0--2,6))], PreXmlDocEmpty, [], None, (2,0--2,6), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/NameofOperator.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/NameofOperator.fs.bsl index 49f2b8a4332..6ffa57b4ccb 100644 --- a/tests/service/data/SyntaxTree/OperatorName/NameofOperator.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/NameofOperator.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/NameofOperator.fs", false, - QualifiedNameOfFile NameofOperator, [], [], + QualifiedNameOfFile NameofOperator, [], [SynModuleOrNamespace ([NameofOperator], false, AnonModule, [Expr @@ -17,4 +17,5 @@ ImplFile (2,0--2,9)), (2,0--2,9))], PreXmlDocEmpty, [], None, (2,0--2,9), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl index 760c3f64ca3..c610b0e59d5 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/ObjectModelWithTwoMembers.fs", false, - QualifiedNameOfFile ObjectModelWithTwoMembers, [], [], + QualifiedNameOfFile ObjectModelWithTwoMembers, [], [SynModuleOrNamespace ([ObjectModelWithTwoMembers], false, AnonModule, [Types @@ -111,4 +111,5 @@ ImplFile WithKeyword = None })], (2,0--4,79))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorAsFunction.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorAsFunction.fs.bsl index a18485248e6..205db05cc54 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorAsFunction.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorAsFunction.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/OperatorAsFunction.fs", false, - QualifiedNameOfFile OperatorAsFunction, [], [], + QualifiedNameOfFile OperatorAsFunction, [], [SynModuleOrNamespace ([OperatorAsFunction], false, AnonModule, [Expr @@ -20,4 +20,5 @@ ImplFile Const (Int32 4, (2,6--2,7)), (2,0--2,7)), (2,0--2,7))], PreXmlDocEmpty, [], None, (2,0--2,7), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl index 4e05d9cbd83..5137e642c9a 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/OperatorInMemberDefinition.fs", false, - QualifiedNameOfFile OperatorInMemberDefinition, [], [], + QualifiedNameOfFile OperatorInMemberDefinition, [], [SynModuleOrNamespace ([OperatorInMemberDefinition], false, AnonModule, [Types @@ -60,4 +60,5 @@ ImplFile WithKeyword = None })], (2,0--3,28))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl index b90adbf927e..bc0e4b085c3 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInSynValSig.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/OperatorName/OperatorNameInSynValSig.fsi", - QualifiedNameOfFile IntrinsicOperators, [], [], + QualifiedNameOfFile IntrinsicOperators, [], [SynModuleOrNamespaceSig ([IntrinsicOperators], false, NamedModule, [Val @@ -38,4 +38,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--3,37), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl index d31043ea99c..fe765dd9532 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorNameInValConstraint.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/OperatorName/OperatorNameInValConstraint.fsi", - QualifiedNameOfFile Operators, [], [], + QualifiedNameOfFile Operators, [], [SynModuleOrNamespaceSig ([Operators], false, NamedModule, [Val @@ -79,6 +79,7 @@ SigFile Range = (2,0--2,12) }], None, (2,0--12,94), { LeadingKeyword = Module (3,4--3,10) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (12,79)-(12,94) parse error This construct is deprecated: it is only for use in the F# library diff --git a/tests/service/data/SyntaxTree/OperatorName/OptionalExpression.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/OptionalExpression.fs.bsl index 2db0610b10d..1d2315c9cea 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OptionalExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OptionalExpression.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/OptionalExpression.fs", false, - QualifiedNameOfFile OptionalExpression, [], [], + QualifiedNameOfFile OptionalExpression, [], [SynModuleOrNamespace ([OptionalExpression], false, AnonModule, [Expr @@ -24,4 +24,5 @@ ImplFile Some (2,8--2,9), (2,1--2,9)), (2,0--2,9)), (2,0--2,9))], PreXmlDocEmpty, [], None, (2,0--2,9), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternAsFunction.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternAsFunction.fs.bsl index 81d08cb1074..5a752bc892d 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternAsFunction.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternAsFunction.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/PartialActivePatternAsFunction.fs", false, - QualifiedNameOfFile PartialActivePatternAsFunction, [], [], + QualifiedNameOfFile PartialActivePatternAsFunction, [], [SynModuleOrNamespace ([PartialActivePatternAsFunction], false, AnonModule, [Expr @@ -16,4 +16,5 @@ ImplFile (2,0--2,11))], PreXmlDocEmpty, [], None, (2,0--2,11), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinition.fs.bsl index 6b6c5b59524..1af2f13c764 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinition.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/PartialActivePatternDefinition.fs", false, - QualifiedNameOfFile PartialActivePatternDefinition, [], [], + QualifiedNameOfFile PartialActivePatternDefinition, [], [SynModuleOrNamespace ([PartialActivePatternDefinition], false, AnonModule, [Let @@ -50,4 +50,5 @@ ImplFile EqualsRange = Some (2,35--2,36) })], (2,0--2,88))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl index be0b81e8577..d2f6c09c3a0 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/PartialActivePatternDefinitionWithoutParameters.fs", false, QualifiedNameOfFile PartialActivePatternDefinitionWithoutParameters, - [], [], + [], [SynModuleOrNamespace ([PartialActivePatternDefinitionWithoutParameters], false, AnonModule, [Let @@ -27,4 +27,5 @@ ImplFile EqualsRange = Some (2,18--2,19) })], (2,0--2,33))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/PrefixOperation.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PrefixOperation.fs.bsl index 15193e63278..610d2c0f9f9 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PrefixOperation.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PrefixOperation.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/PrefixOperation.fs", false, - QualifiedNameOfFile PrefixOperation, [], [], + QualifiedNameOfFile PrefixOperation, [], [SynModuleOrNamespace ([PrefixOperation], false, AnonModule, [Expr @@ -15,4 +15,5 @@ ImplFile (2,0--2,5))], PreXmlDocEmpty, [], None, (2,0--2,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/PrefixOperationWithTwoCharacters.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/PrefixOperationWithTwoCharacters.fs.bsl index f73ff914587..c2a4b003dd8 100644 --- a/tests/service/data/SyntaxTree/OperatorName/PrefixOperationWithTwoCharacters.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/PrefixOperationWithTwoCharacters.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/PrefixOperationWithTwoCharacters.fs", false, - QualifiedNameOfFile PrefixOperationWithTwoCharacters, [], [], + QualifiedNameOfFile PrefixOperationWithTwoCharacters, [], [SynModuleOrNamespace ([PrefixOperationWithTwoCharacters], false, AnonModule, [Expr @@ -14,4 +14,5 @@ ImplFile None, (2,0--2,2)), Ident arg, (2,0--2,5)), (2,0--2,5))], PreXmlDocEmpty, [], None, (2,0--2,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/OperatorName/QualifiedOperatorExpression.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/QualifiedOperatorExpression.fs.bsl index b83fc4ecf68..7db9838fe40 100644 --- a/tests/service/data/SyntaxTree/OperatorName/QualifiedOperatorExpression.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/QualifiedOperatorExpression.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/OperatorName/QualifiedOperatorExpression.fs", false, - QualifiedNameOfFile QualifiedOperatorExpression, [], [], + QualifiedNameOfFile QualifiedOperatorExpression, [], [SynModuleOrNamespace ([QualifiedOperatorExpression], false, AnonModule, [Let @@ -42,4 +42,5 @@ ImplFile EqualsRange = Some (2,23--2,24) })], (2,0--2,40))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ParsedHashDirective/RegularStringAsParsedHashDirectiveArgument.fs.bsl b/tests/service/data/SyntaxTree/ParsedHashDirective/RegularStringAsParsedHashDirectiveArgument.fs.bsl index 360f4117e4b..47e19577186 100644 --- a/tests/service/data/SyntaxTree/ParsedHashDirective/RegularStringAsParsedHashDirectiveArgument.fs.bsl +++ b/tests/service/data/SyntaxTree/ParsedHashDirective/RegularStringAsParsedHashDirectiveArgument.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/ParsedHashDirective/RegularStringAsParsedHashDirectiveArgument.fs", false, QualifiedNameOfFile RegularStringAsParsedHashDirectiveArgument, [], - [], [SynModuleOrNamespace ([RegularStringAsParsedHashDirectiveArgument], false, AnonModule, [HashDirective @@ -11,4 +10,5 @@ ImplFile (2,0--2,9))], PreXmlDocEmpty, [], None, (2,0--2,9), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ParsedHashDirective/SourceIdentifierAsParsedHashDirectiveArgument.fs.bsl b/tests/service/data/SyntaxTree/ParsedHashDirective/SourceIdentifierAsParsedHashDirectiveArgument.fs.bsl index 8434a2be591..b833b566ae7 100644 --- a/tests/service/data/SyntaxTree/ParsedHashDirective/SourceIdentifierAsParsedHashDirectiveArgument.fs.bsl +++ b/tests/service/data/SyntaxTree/ParsedHashDirective/SourceIdentifierAsParsedHashDirectiveArgument.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/ParsedHashDirective/SourceIdentifierAsParsedHashDirectiveArgument.fs", false, QualifiedNameOfFile SourceIdentifierAsParsedHashDirectiveArgument, - [], [], + [], [SynModuleOrNamespace ([SourceIdentifierAsParsedHashDirectiveArgument], false, AnonModule, [HashDirective @@ -13,4 +13,5 @@ ImplFile (0,0--0,0))], (0,0--0,0)), (2,0--2,23))], PreXmlDocEmpty, [], None, (2,0--2,23), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs.bsl b/tests/service/data/SyntaxTree/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs.bsl index fd629563d32..6321ae9bfdd 100644 --- a/tests/service/data/SyntaxTree/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs.bsl +++ b/tests/service/data/SyntaxTree/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs.bsl @@ -2,13 +2,10 @@ ImplFile (ParsedImplFileInput ("/root/ParsedHashDirective/TripleQuoteStringAsParsedHashDirectiveArgument.fs", false, QualifiedNameOfFile TripleQuoteStringAsParsedHashDirectiveArgument, - [WarningOff ((2,8--2,16), 40)], [], + [], [SynModuleOrNamespace ([TripleQuoteStringAsParsedHashDirectiveArgument], false, AnonModule, - [HashDirective - (ParsedHashDirective - ("nowarn", [String ("40", TripleQuote, (2,8--2,16))], - (2,0--2,16)), (2,0--2,16))], PreXmlDocEmpty, [], None, - (2,0--2,16), { LeadingKeyword = None })], (true, true), - { ConditionalDirectives = [] - CodeComments = [] }, set [])) + [], PreXmlDocEmpty, [], None, (3,0--3,0), { LeadingKeyword = None })], + (true, true), { ConditionalDirectives = [] + WarnDirectives = [Nowarn ([40], (2,0--2,16))] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/ParsedHashDirective/VerbatimStringAsParsedHashDirectiveArgument.fs.bsl b/tests/service/data/SyntaxTree/ParsedHashDirective/VerbatimStringAsParsedHashDirectiveArgument.fs.bsl index 2dbceeacd80..b6e9cdc8806 100644 --- a/tests/service/data/SyntaxTree/ParsedHashDirective/VerbatimStringAsParsedHashDirectiveArgument.fs.bsl +++ b/tests/service/data/SyntaxTree/ParsedHashDirective/VerbatimStringAsParsedHashDirectiveArgument.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/ParsedHashDirective/VerbatimStringAsParsedHashDirectiveArgument.fs", false, QualifiedNameOfFile VerbatimStringAsParsedHashDirectiveArgument, [], - [], [SynModuleOrNamespace ([VerbatimStringAsParsedHashDirectiveArgument], false, AnonModule, [HashDirective @@ -11,4 +10,5 @@ ImplFile (2,0--2,14))], PreXmlDocEmpty, [], None, (2,0--2,14), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/And 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/And 01.fs.bsl index 679d264dfcc..dfc0b7f79b1 100644 --- a/tests/service/data/SyntaxTree/Pattern/And 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/And 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/And 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/And 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -52,4 +52,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/And 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/And 02.fs.bsl index f533ba83b0a..217728c591c 100644 --- a/tests/service/data/SyntaxTree/Pattern/And 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/And 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/And 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/And 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -54,4 +54,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/And 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/And 03.fs.bsl index b75921e2808..2e65f951157 100644 --- a/tests/service/data/SyntaxTree/Pattern/And 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/And 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/And 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/And 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -53,4 +53,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/And 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/And 04.fs.bsl index 7a0fa1f4c89..f049c2f689c 100644 --- a/tests/service/data/SyntaxTree/Pattern/And 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/And 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/And 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/And 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -55,4 +55,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/As 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 01.fs.bsl index f0277e7a075..eec702d3f47 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/As 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 02.fs.bsl index dc9ff5caae9..bb58c950ff6 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 03.fs.bsl index 87eeb9e821a..95af9d360b3 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/As 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 04.fs.bsl index dbbdbdd9f3e..b7347690d10 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,8) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 05.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 05.fs.bsl index 07a1aac463e..9c877d54029 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 06.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 06.fs.bsl index 5ce6e55db4d..662ca2e2655 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,8) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 07.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 07.fs.bsl index b462b81d90b..0089a35011a 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,8) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 08.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 08.fs.bsl index bfe069db512..0ab7fd548d5 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 09.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 09.fs.bsl index ad9aa2247c1..77bb6b74bf2 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,8) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 10.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 10.fs.bsl index 384bd2c6d06..be2e28d3469 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(3,9) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 11.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 11.fs.bsl index 84773ba8ee6..a7fd1764123 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 11.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 11.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 11.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,8) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/As 12.fs.bsl b/tests/service/data/SyntaxTree/Pattern/As 12.fs.bsl index f77b92aba46..87273a9a75b 100644 --- a/tests/service/data/SyntaxTree/Pattern/As 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/As 12.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/As 12.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/As 12.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,7)-(4,9) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Cons 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Cons 01.fs.bsl index c48f71c8ab2..d9bb73b0b58 100644 --- a/tests/service/data/SyntaxTree/Pattern/Cons 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Cons 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Cons 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Cons 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Cons 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Cons 02.fs.bsl index a88741e666c..9608ac53f4c 100644 --- a/tests/service/data/SyntaxTree/Pattern/Cons 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Cons 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Cons 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Cons 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Cons 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Cons 03.fs.bsl index fda13199e97..954f68dadea 100644 --- a/tests/service/data/SyntaxTree/Pattern/Cons 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Cons 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Cons 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Cons 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Cons 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Cons 04.fs.bsl index 90d727b5f30..1b324a7e582 100644 --- a/tests/service/data/SyntaxTree/Pattern/Cons 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Cons 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Cons 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Cons 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/InHeadPattern.fs.bsl b/tests/service/data/SyntaxTree/Pattern/InHeadPattern.fs.bsl index 13a1e99ea00..8ef79374ffa 100644 --- a/tests/service/data/SyntaxTree/Pattern/InHeadPattern.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/InHeadPattern.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/InHeadPattern.fs", false, QualifiedNameOfFile InHeadPattern, - [], [], + [], [SynModuleOrNamespace ([InHeadPattern], false, AnonModule, [Let @@ -29,4 +29,5 @@ ImplFile EqualsRange = Some (2,11--2,12) })], (2,0--2,24))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/IsInst 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/IsInst 01.fs.bsl index 3b690e54512..d68b03a2446 100644 --- a/tests/service/data/SyntaxTree/Pattern/IsInst 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/IsInst 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/IsInst 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/IsInst 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/IsInst 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/IsInst 02.fs.bsl index dd1e86fabe4..d30e522dc20 100644 --- a/tests/service/data/SyntaxTree/Pattern/IsInst 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/IsInst 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/IsInst 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/IsInst 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in pattern matching. Expected '->' or other token. diff --git a/tests/service/data/SyntaxTree/Pattern/IsInst 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/IsInst 03.fs.bsl index 320a8c97f75..7cd0f86d4eb 100644 --- a/tests/service/data/SyntaxTree/Pattern/IsInst 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/IsInst 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/IsInst 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/IsInst 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,4) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Pattern/IsInst 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/IsInst 04.fs.bsl index 1cf58c17dbc..d26ed1e4af2 100644 --- a/tests/service/data/SyntaxTree/Pattern/IsInst 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/IsInst 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/IsInst 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/IsInst 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,4) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Pattern/IsInst 05.fs.bsl b/tests/service/data/SyntaxTree/Pattern/IsInst 05.fs.bsl index 136e844c2ef..b1a0e756d19 100644 --- a/tests/service/data/SyntaxTree/Pattern/IsInst 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/IsInst 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/IsInst 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/IsInst 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,2)-(4,4) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Pattern/Named field 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Named field 01.fs.bsl index 4a3050eb9f9..caa7e025499 100644 --- a/tests/service/data/SyntaxTree/Pattern/Named field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Named field 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Named field 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Named field 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Named field 02.fs.bsl index b7bfc84c6d6..a571440a741 100644 --- a/tests/service/data/SyntaxTree/Pattern/Named field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Named field 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Named field 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -23,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,15)-(4,16) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Named field 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Named field 03.fs.bsl index 0740dee26d8..4902847118f 100644 --- a/tests/service/data/SyntaxTree/Pattern/Named field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Named field 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Named field 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -23,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,12)-(4,13) parse error Unexpected symbol ')' in pattern. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Pattern/Named field 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Named field 04.fs.bsl index 33a958c138e..8289d0b9bef 100644 --- a/tests/service/data/SyntaxTree/Pattern/Named field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Named field 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Named field 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -21,4 +20,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Named field 05.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Named field 05.fs.bsl index 969fb6c2b32..9e12bc1e850 100644 --- a/tests/service/data/SyntaxTree/Pattern/Named field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Named field 05.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Named field 05.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -22,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,24), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(4,12) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/OperatorInMatchPattern.fs.bsl b/tests/service/data/SyntaxTree/Pattern/OperatorInMatchPattern.fs.bsl index d9f4fc99fd0..53eba0b1b3a 100644 --- a/tests/service/data/SyntaxTree/Pattern/OperatorInMatchPattern.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/OperatorInMatchPattern.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/OperatorInMatchPattern.fs", false, - QualifiedNameOfFile OperatorInMatchPattern, [], [], + QualifiedNameOfFile OperatorInMatchPattern, [], [SynModuleOrNamespace ([OperatorInMatchPattern], false, AnonModule, [Expr @@ -25,4 +25,5 @@ ImplFile WithKeyword = (2,8--2,12) }), (2,0--3,24))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/OperatorInSynPatLongIdent.fs.bsl b/tests/service/data/SyntaxTree/Pattern/OperatorInSynPatLongIdent.fs.bsl index 90a60008ec8..31b3ea1510c 100644 --- a/tests/service/data/SyntaxTree/Pattern/OperatorInSynPatLongIdent.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/OperatorInSynPatLongIdent.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/OperatorInSynPatLongIdent.fs", false, - QualifiedNameOfFile OperatorInSynPatLongIdent, [], [], + QualifiedNameOfFile OperatorInSynPatLongIdent, [], [SynModuleOrNamespace ([OperatorInSynPatLongIdent], false, AnonModule, [Let @@ -32,4 +32,5 @@ ImplFile EqualsRange = Some (2,17--2,18) })], (2,0--2,28))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/ParenthesesOfSynArgPatsNamePatPairs.fs.bsl b/tests/service/data/SyntaxTree/Pattern/ParenthesesOfSynArgPatsNamePatPairs.fs.bsl index e260f077c31..14fd4eb7b5b 100644 --- a/tests/service/data/SyntaxTree/Pattern/ParenthesesOfSynArgPatsNamePatPairs.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/ParenthesesOfSynArgPatsNamePatPairs.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/ParenthesesOfSynArgPatsNamePatPairs.fs", false, - QualifiedNameOfFile ParenthesesOfSynArgPatsNamePatPairs, [], [], + QualifiedNameOfFile ParenthesesOfSynArgPatsNamePatPairs, [], [SynModuleOrNamespace ([ParenthesesOfSynArgPatsNamePatPairs], false, AnonModule, [Expr @@ -31,5 +31,6 @@ ImplFile WithKeyword = (2,11--2,15) }), (2,0--6,22))], PreXmlDocEmpty, [], None, (2,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,15--3,21); BlockComment (5,2--5,11)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Record 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 01.fs.bsl index 9feca15fc45..303bae43f43 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Record 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 02.fs.bsl index 57d597dab55..ad2b42fb23d 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,24), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Record 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 03.fs.bsl index 6ce17ab990c..f4d874a415d 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,8)-(4,9) parse error Unexpected symbol '}' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Record 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 04.fs.bsl index e96ed95a57c..60303d5874d 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,6)-(4,7) parse error Unexpected symbol '}' in pattern. Expected '.', '=' or other token. diff --git a/tests/service/data/SyntaxTree/Pattern/Record 05.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 05.fs.bsl index ef0a9a11727..6438160b535 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,5) parse error Unexpected symbol '}' in pattern. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/Pattern/Record 06.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Record 06.fs.bsl index 7781aa39c9b..447cb1ac2e1 100644 --- a/tests/service/data/SyntaxTree/Pattern/Record 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Record 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Pattern/Record 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Pattern/Record 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,5) parse error Unexpected symbol '_' in pattern. Expected identifier, 'global' or other token. diff --git a/tests/service/data/SyntaxTree/Pattern/SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Pattern/SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign.fs.bsl index 61afba6c7a8..75f26b45484 100644 --- a/tests/service/data/SyntaxTree/Pattern/SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Pattern/SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign.fs", false, QualifiedNameOfFile SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign, - [], [], + [], [SynModuleOrNamespace ([SynArgPatsNamePatPairsContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -25,4 +25,5 @@ ImplFile WithKeyword = (2,8--2,12) }), (2,0--3,16))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/SynPatOrContainsTheRangeOfTheBar.fs.bsl b/tests/service/data/SyntaxTree/Pattern/SynPatOrContainsTheRangeOfTheBar.fs.bsl index 61046ffea4e..4f60ec0e26f 100644 --- a/tests/service/data/SyntaxTree/Pattern/SynPatOrContainsTheRangeOfTheBar.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/SynPatOrContainsTheRangeOfTheBar.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/SynPatOrContainsTheRangeOfTheBar.fs", false, - QualifiedNameOfFile SynPatOrContainsTheRangeOfTheBar, [], [], + QualifiedNameOfFile SynPatOrContainsTheRangeOfTheBar, [], [SynModuleOrNamespace ([SynPatOrContainsTheRangeOfTheBar], false, AnonModule, [Expr @@ -27,4 +27,5 @@ ImplFile WithKeyword = (2,8--2,12) }), (2,0--5,9))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 01.fs.bsl index a81579964af..13e9f682663 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - HeadPat 01.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -42,4 +42,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 02.fs.bsl index 61bc7ef99b7..6ec6d695f22 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - HeadPat 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - HeadPat 02.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -27,4 +27,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 01.fs.bsl index ed30e1a4690..cb624d87691 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - Recover 01.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,0), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 02.fs.bsl index 5a07aa0debc..517795c13dd 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - Recover 02.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,0), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 03.fs.bsl index ada6c9b8de0..c3a138387cb 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - Recover 03.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -47,6 +47,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,25), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,18)-(3,19) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 04.fs.bsl index 98ed45e9cfd..6931a6e0e33 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - Recover 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - Recover 04.fs", false, QualifiedNameOfFile Tuple, - [], [], + [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -55,6 +55,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,4)-(3,5) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Tuple - Struct 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Tuple - Struct 01.fs.bsl index 0b605142320..8a3c5863004 100644 --- a/tests/service/data/SyntaxTree/Pattern/Tuple - Struct 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Tuple - Struct 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Tuple - Struct 01.fs", false, QualifiedNameOfFile Tuple, [], - [], [SynModuleOrNamespace ([Tuple], false, NamedModule, [Let @@ -25,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,25), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 01.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 01.fs.bsl index 39999d8f69c..c3b01295134 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 02.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 02.fs.bsl index b5b4b6e28e2..d90f5c5d863 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(3,8) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 03.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 03.fs.bsl index 609bc09a6fe..303709dc7fd 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,9) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 04.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 04.fs.bsl index 6ac283f7a93..d6aa47ae861 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 04.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,8)-(3,10) parse error Unexpected keyword 'as' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 05.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 05.fs.bsl index 7bd27b958c6..86cac0dc468 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 05.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Incomplete structured construct at or before this point in binding diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 06.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 06.fs.bsl index 6120ff4f5fd..618cbcfcee8 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 06.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -32,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(4,12) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 07.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 07.fs.bsl index c96b5fc8d5e..dc97ca9ea10 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 07.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,4), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 08.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 08.fs.bsl index 394f1e21eac..98734d03de2 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 08.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,6 +19,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,5)-(4,7) parse error Unexpected symbol '->' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 09.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 09.fs.bsl index 0f2e4604d2b..bdac43a6b34 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 09.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(4,12) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 10.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 10.fs.bsl index 5e8ab0f26fd..b18b97bfe76 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 10.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -30,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(4,12) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 11.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 11.fs.bsl index dbf43bcf3b1..be2e2e830c2 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 11.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,13)-(4,14) parse error Unexpected symbol ')' in pattern diff --git a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 12.fs.bsl b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 12.fs.bsl index 416dc67c859..9b2df1c8190 100644 --- a/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Pattern/Typed - Missing type 12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Pattern/Typed - Missing type 12.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -44,6 +44,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,13)-(4,14) parse error Unexpected symbol ',' in pattern diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl index ab9078c270c..a27b46c979c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi", - QualifiedNameOfFile Meh, [], [], + QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Types @@ -38,4 +38,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--5,23), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl index c63121096fa..55bf2f683f4 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/EqualsTokenIsPresentInSynValSigValue.fsi", - QualifiedNameOfFile Meh, [], [], + QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Val @@ -18,4 +18,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--4,15), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl index 8a2cf2cb845..2a904b29554 100644 --- a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/LeadingKeywordInRecursiveTypes.fsi", - QualifiedNameOfFile LeadingKeywordInRecursiveTypes, [], [], + QualifiedNameOfFile LeadingKeywordInRecursiveTypes, [], [SynModuleOrNamespaceSig ([LeadingKeywordInRecursiveTypes], false, AnonModule, [Types @@ -31,4 +31,5 @@ SigFile WithKeyword = None })], (2,0--3,11))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index 493d3b104ad..de5ad0828c3 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -3,7 +3,6 @@ SigFile ("/root/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi", QualifiedNameOfFile MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword, [], - [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -42,4 +41,5 @@ SigFile WithKeyword = None })], (4,0--5,42))], PreXmlDocEmpty, [], None, (2,0--5,42), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl index 1c3c8bc8d23..091be309d37 100644 --- a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi", - QualifiedNameOfFile NestedTypeHasStaticTypeAsLeadingKeyword, [], [], + QualifiedNameOfFile NestedTypeHasStaticTypeAsLeadingKeyword, [], [SynModuleOrNamespaceSig ([NestedTypeHasStaticTypeAsLeadingKeyword], false, AnonModule, [Types @@ -29,4 +29,5 @@ SigFile WithKeyword = None })], (2,0--6,0))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynExceptionDefnReprAndSynExceptionSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynExceptionDefnReprAndSynExceptionSig.fsi.bsl index e92edcc8113..870ef57c940 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynExceptionDefnReprAndSynExceptionSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynExceptionDefnReprAndSynExceptionSig.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfAttributeShouldBeIncludedInSynExceptionDefnReprAndSynExceptionSig.fsi", - QualifiedNameOfFile FSharp.Compiler.ParseHelpers, [], [], + QualifiedNameOfFile FSharp.Compiler.ParseHelpers, [], [SynModuleOrNamespaceSig ([FSharp; Compiler; ParseHelpers], false, NamedModule, [Exception @@ -42,4 +42,5 @@ SigFile Some (Internal (2,7--2,15)), (2,0--6,43), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (4,0--4,90)] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl index 0e7eac31934..e73e3ca6fee 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi", QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynTypeDefnSig, [], - [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -23,4 +22,5 @@ SigFile WithKeyword = None })], (4,0--7,7))], PreXmlDocEmpty, [], None, (2,0--7,7), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl index 920c9e5a472..101ec260450 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi", QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember, - [], [], + [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -45,4 +45,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--6,20), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,13--5,23)] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl index 9788067cd7c..af1c383c20c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi", QualifiedNameOfFile RangeOfAttributesShouldBeIncludedInRecursiveTypes, [], - [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -73,4 +72,5 @@ SigFile WithKeyword = None })], (4,0--12,42))], PreXmlDocEmpty, [], None, (2,0--12,42), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl index 7025f3aadc2..9659f6321f8 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfMembersShouldBeIncludedInSynExceptionSigAndSynModuleSigDeclException.fsi", - QualifiedNameOfFile FSharp.Compiler.ParseHelpers, [], [], + QualifiedNameOfFile FSharp.Compiler.ParseHelpers, [], [SynModuleOrNamespaceSig ([FSharp; Compiler; ParseHelpers], false, NamedModule, [Exception @@ -56,5 +56,6 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], Some (Internal (2,7--2,15)), (2,0--7,8), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl index 0dcb3eb2e73..a38d43e98c3 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi", QualifiedNameOfFile RangeOfSynTypeDefnSigDelegateOfShouldStartFromName, [], - [], [SynModuleOrNamespaceSig ([Y], false, DeclaredNamespace, [Types @@ -49,4 +48,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--4,29), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl index 4ed17f26304..cce6edadb6d 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi", QualifiedNameOfFile RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember, - [], [], + [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -41,4 +41,5 @@ SigFile WithKeyword = None })], (3,0--6,30))], PreXmlDocEmpty, [], None, (2,0--6,30), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl index 553c900522d..bcbb3398842 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi", QualifiedNameOfFile RangeOfSynTypeDefnSigRecordShouldEndAtLastMember, [], - [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -50,4 +49,5 @@ SigFile WithKeyword = None })], (3,0--5,30))], PreXmlDocEmpty, [], None, (2,0--5,30), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl index 7829833143a..6b584fc5717 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi", - QualifiedNameOfFile RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal, [], [], + QualifiedNameOfFile RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal, [], [SynModuleOrNamespaceSig ([Z], false, DeclaredNamespace, [Types @@ -36,4 +36,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--5,37), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl index ebb3921ac38..92a00ceca6b 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi", - QualifiedNameOfFile RangeOfTypeShouldEndAtEndKeyword, [], [], + QualifiedNameOfFile RangeOfTypeShouldEndAtEndKeyword, [], [SynModuleOrNamespaceSig ([GreatProjectThing], false, DeclaredNamespace, [Types @@ -16,4 +16,5 @@ SigFile WithKeyword = None })], (4,0--6,11))], PreXmlDocEmpty, [], None, (2,0--6,11), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (9,0--9,6)] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index ef541678686..9e082007f68 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/SynExceptionSigShouldContainsTheRangeOfTheWithKeyword.fsi", QualifiedNameOfFile SynExceptionSigShouldContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Exception @@ -40,4 +40,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--5,29), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl index ab21d9a361f..313b1d493a0 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi", QualifiedNameOfFile SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign, - [], [], + [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -31,4 +31,5 @@ SigFile WithKeyword = None })], (4,0--6,19))], PreXmlDocEmpty, [], None, (2,0--6,19), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl index d512ca1ef68..6d2eafdbc7c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -3,7 +3,6 @@ SigFile ("/root/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi", QualifiedNameOfFile SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign, [], - [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -18,4 +17,5 @@ SigFile WithKeyword = None })], (4,0--6,7))], PreXmlDocEmpty, [], None, (2,0--6,7), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl index 25b5feb9ae6..a1b964f3ac1 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -3,7 +3,6 @@ SigFile ("/root/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi", QualifiedNameOfFile SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign, [], - [], [SynModuleOrNamespaceSig ([Foo], false, DeclaredNamespace, [Types @@ -50,4 +49,5 @@ SigFile PreXmlDocEmpty, [], None, (2,0--4,37), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl index bfc76db57f5..3afb8f5e0cf 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -2,7 +2,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi", QualifiedNameOfFile SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign, - [], [], + [], [SynModuleOrNamespaceSig ([SomeNamespace], false, DeclaredNamespace, [Types @@ -51,4 +51,5 @@ SigFile WithKeyword = None })], (4,0--6,24))], PreXmlDocEmpty, [], None, (2,0--6,24), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl index edb06fea795..e3b15af4481 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynValSigContainsParameterNames.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/SynValSigContainsParameterNames.fsi", - QualifiedNameOfFile Meh, [], [], + QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Val @@ -67,4 +67,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--6,23), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl index 53962cae2b9..0562bc80619 100644 --- a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi", - QualifiedNameOfFile Meh, [], [], + QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Types @@ -87,4 +87,5 @@ SigFile { ConditionalDirectives = [If (Ident "CHECK_LINE0_TYPES", (8,0--8,21)); Else (10,0--10,5); EndIf (12,0--12,6)] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl index 599315bef28..11d8b8ede65 100644 --- a/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/ValKeywordIsPresentInSynValSig.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SignatureType/ValKeywordIsPresentInSynValSig.fsi", - QualifiedNameOfFile Meh, [], [], + QualifiedNameOfFile Meh, [], [SynModuleOrNamespaceSig ([Meh], false, NamedModule, [Val @@ -24,4 +24,5 @@ SigFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--6,11), { LeadingKeyword = Module (2,0--2,6) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (5,0--5,6)] }, set [])) diff --git a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl index f6ef4571fd9..b51549de53b 100644 --- a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/SignatureType/With 01.fsi", QualifiedNameOfFile With 01, [], [], + ("/root/SignatureType/With 01.fsi", QualifiedNameOfFile With 01, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Types @@ -39,4 +39,5 @@ SigFile PreXmlDocEmpty, [], None, (1,0--4,28), { LeadingKeyword = Namespace (1,0--1,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SimplePats/SimplePats - Recover 01.fs.bsl b/tests/service/data/SyntaxTree/SimplePats/SimplePats - Recover 01.fs.bsl index 9f74ed36236..9b7cc02ee66 100644 --- a/tests/service/data/SyntaxTree/SimplePats/SimplePats - Recover 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SimplePats/SimplePats - Recover 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SimplePats/SimplePats - Recover 01.fs", false, - QualifiedNameOfFile SimplePats, [], [], + QualifiedNameOfFile SimplePats, [], [SynModuleOrNamespace ([SimplePats], false, NamedModule, [Let @@ -202,6 +202,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,19)-(3,20) parse error Expecting pattern diff --git a/tests/service/data/SyntaxTree/SimplePats/SimplePats 01.fs.bsl b/tests/service/data/SyntaxTree/SimplePats/SimplePats 01.fs.bsl index 512fa280b98..22d60a66606 100644 --- a/tests/service/data/SyntaxTree/SimplePats/SimplePats 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SimplePats/SimplePats 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SimplePats/SimplePats 01.fs", false, QualifiedNameOfFile SimplePats, - [], [], + [], [SynModuleOrNamespace ([SimplePats], false, NamedModule, [Let @@ -200,4 +200,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,24), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl index fc92f2e4767..939f5e095d7 100644 --- a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SimplePats/SimplePats 02.fs", false, QualifiedNameOfFile SimplePats, - [], [], + [], [SynModuleOrNamespace ([SimplePats], false, NamedModule, [Types @@ -177,4 +177,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SourceIdentifier/_LINE_.fs.bsl b/tests/service/data/SyntaxTree/SourceIdentifier/_LINE_.fs.bsl index 2ac2c71f433..11526d87b0f 100644 --- a/tests/service/data/SyntaxTree/SourceIdentifier/_LINE_.fs.bsl +++ b/tests/service/data/SyntaxTree/SourceIdentifier/_LINE_.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/SourceIdentifier/_LINE_.fs", false, QualifiedNameOfFile _LINE_, [], - [], [SynModuleOrNamespace ([_LINE_], false, AnonModule, [Expr @@ -9,4 +8,5 @@ ImplFile (2,0--2,8))], PreXmlDocEmpty, [], None, (2,0--2,8), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEDIRECTORY_.fs.bsl b/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEDIRECTORY_.fs.bsl index cc7fb97f4fa..5e1799630fe 100644 --- a/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEDIRECTORY_.fs.bsl +++ b/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEDIRECTORY_.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SourceIdentifier/_SOURCEDIRECTORY_.fs", false, - QualifiedNameOfFile _SOURCEDIRECTORY_, [], [], + QualifiedNameOfFile _SOURCEDIRECTORY_, [], [SynModuleOrNamespace ([_SOURCEDIRECTORY_], false, AnonModule, [Expr @@ -11,4 +11,5 @@ ImplFile (0,0--0,0)), (0,0--0,0))], PreXmlDocEmpty, [], None, (2,0--2,20), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEFILE_.fs.bsl b/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEFILE_.fs.bsl index abf6b7aca84..8284c2a2a77 100644 --- a/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEFILE_.fs.bsl +++ b/tests/service/data/SyntaxTree/SourceIdentifier/_SOURCEFILE_.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SourceIdentifier/_SOURCEFILE_.fs", false, - QualifiedNameOfFile _SOURCEFILE_, [], [], + QualifiedNameOfFile _SOURCEFILE_, [], [SynModuleOrNamespace ([_SOURCEFILE_], false, AnonModule, [Expr @@ -11,4 +11,5 @@ ImplFile (2,0--2,15)), (2,0--2,15))], PreXmlDocEmpty, [], None, (2,0--2,15), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl index 7e6563219a6..c042884e24f 100644 --- a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl +++ b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/InterpolatedStringOffsideInModule.fs", false, - QualifiedNameOfFile InterpolatedStringOffsideInModule, [], [], + QualifiedNameOfFile InterpolatedStringOffsideInModule, [], [SynModuleOrNamespace ([InterpolatedStringOffsideInModule], false, AnonModule, [NestedModule @@ -31,4 +31,5 @@ ImplFile EqualsRange = Some (1,9--1,10) })], PreXmlDocEmpty, [], None, (1,0--4,4), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInNestedLet.fs.bsl b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInNestedLet.fs.bsl index 1dfe5586b56..5d675200d7c 100644 --- a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInNestedLet.fs.bsl +++ b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInNestedLet.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/InterpolatedStringOffsideInNestedLet.fs", false, - QualifiedNameOfFile InterpolatedStringOffsideInNestedLet, [], [], + QualifiedNameOfFile InterpolatedStringOffsideInNestedLet, [], [SynModuleOrNamespace ([InterpolatedStringOffsideInNestedLet], false, AnonModule, [Let @@ -38,4 +38,5 @@ ImplFile EqualsRange = Some (1,6--1,7) })], (1,0--5,5))], PreXmlDocEmpty, [], None, (1,0--5,5), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindRegular.fs.bsl b/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindRegular.fs.bsl index be0c3ae5c30..9e98e92eb3b 100644 --- a/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindRegular.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindRegular.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/SynConstBytesWithSynByteStringKindRegular.fs", false, - QualifiedNameOfFile SynConstBytesWithSynByteStringKindRegular, [], [], + QualifiedNameOfFile SynConstBytesWithSynByteStringKindRegular, [], [SynModuleOrNamespace ([SynConstBytesWithSynByteStringKindRegular], false, AnonModule, [Let @@ -20,4 +20,5 @@ ImplFile EqualsRange = Some (2,10--2,11) })], (2,0--2,17))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindVerbatim.fs.bsl b/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindVerbatim.fs.bsl index 178873fb61e..d6108dd914e 100644 --- a/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindVerbatim.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynConstBytesWithSynByteStringKindVerbatim.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/SynConstBytesWithSynByteStringKindVerbatim.fs", false, - QualifiedNameOfFile SynConstBytesWithSynByteStringKindVerbatim, [], [], + QualifiedNameOfFile SynConstBytesWithSynByteStringKindVerbatim, [], [SynModuleOrNamespace ([SynConstBytesWithSynByteStringKindVerbatim], false, AnonModule, [Let @@ -20,4 +20,5 @@ ImplFile EqualsRange = Some (2,10--2,11) })], (2,0--2,18))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindRegular.fs.bsl b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindRegular.fs.bsl index aaba1c57606..fca6ec7f61f 100644 --- a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindRegular.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindRegular.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/SynConstStringWithSynStringKindRegular.fs", false, - QualifiedNameOfFile SynConstStringWithSynStringKindRegular, [], [], + QualifiedNameOfFile SynConstStringWithSynStringKindRegular, [], [SynModuleOrNamespace ([SynConstStringWithSynStringKindRegular], false, AnonModule, [Let @@ -19,4 +19,5 @@ ImplFile (2,0--2,12))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindTripleQuote.fs.bsl b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindTripleQuote.fs.bsl index 2ad18580156..c78c9cbfd83 100644 --- a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindTripleQuote.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindTripleQuote.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/SynConstStringWithSynStringKindTripleQuote.fs", false, - QualifiedNameOfFile SynConstStringWithSynStringKindTripleQuote, [], [], + QualifiedNameOfFile SynConstStringWithSynStringKindTripleQuote, [], [SynModuleOrNamespace ([SynConstStringWithSynStringKindTripleQuote], false, AnonModule, [Let @@ -19,4 +19,5 @@ ImplFile (2,0--2,16))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindVerbatim.fs.bsl b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindVerbatim.fs.bsl index 2bbac831810..48535a0d130 100644 --- a/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindVerbatim.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynConstStringWithSynStringKindVerbatim.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/String/SynConstStringWithSynStringKindVerbatim.fs", false, - QualifiedNameOfFile SynConstStringWithSynStringKindVerbatim, [], [], + QualifiedNameOfFile SynConstStringWithSynStringKindVerbatim, [], [SynModuleOrNamespace ([SynConstStringWithSynStringKindVerbatim], false, AnonModule, [Let @@ -19,4 +19,5 @@ ImplFile (2,0--2,13))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindRegular.fs.bsl b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindRegular.fs.bsl index 601a0e5e9da..70937d3b1a7 100644 --- a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindRegular.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindRegular.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/String/SynExprInterpolatedStringWithSynStringKindRegular.fs", false, QualifiedNameOfFile SynExprInterpolatedStringWithSynStringKindRegular, [], - [], [SynModuleOrNamespace ([SynExprInterpolatedStringWithSynStringKindRegular], false, AnonModule, [Let @@ -23,4 +22,5 @@ ImplFile (2,0--2,18))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindTripleQuote.fs.bsl b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindTripleQuote.fs.bsl index 8eafe3c8745..4810ae97d20 100644 --- a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindTripleQuote.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindTripleQuote.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/String/SynExprInterpolatedStringWithSynStringKindTripleQuote.fs", false, QualifiedNameOfFile SynExprInterpolatedStringWithSynStringKindTripleQuote, - [], [], + [], [SynModuleOrNamespace ([SynExprInterpolatedStringWithSynStringKindTripleQuote], false, AnonModule, @@ -25,4 +25,5 @@ ImplFile (2,0--2,22))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindVerbatim.fs.bsl b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindVerbatim.fs.bsl index 486b527607a..1be7aa3c720 100644 --- a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindVerbatim.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithSynStringKindVerbatim.fs.bsl @@ -3,7 +3,6 @@ ImplFile ("/root/String/SynExprInterpolatedStringWithSynStringKindVerbatim.fs", false, QualifiedNameOfFile SynExprInterpolatedStringWithSynStringKindVerbatim, [], - [], [SynModuleOrNamespace ([SynExprInterpolatedStringWithSynStringKindVerbatim], false, AnonModule, @@ -26,4 +25,5 @@ ImplFile EqualsRange = Some (2,6--2,7) })], (2,0--2,70))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars.fs.bsl b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars.fs.bsl index db6d4bcdc96..69aaf6b57a2 100644 --- a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars.fs", false, QualifiedNameOfFile - SynExprInterpolatedStringWithTripleQuoteMultipleDollars, [], [], + SynExprInterpolatedStringWithTripleQuoteMultipleDollars, [], [SynModuleOrNamespace ([SynExprInterpolatedStringWithTripleQuoteMultipleDollars], false, AnonModule, @@ -27,4 +27,5 @@ ImplFile (2,0--2,43))], PreXmlDocEmpty, [], None, (2,0--2,43), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars2.fs.bsl b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars2.fs.bsl index 152cb27e9b3..ca0ac31fffc 100644 --- a/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars2.fs.bsl +++ b/tests/service/data/SyntaxTree/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars2.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/String/SynExprInterpolatedStringWithTripleQuoteMultipleDollars2.fs", false, QualifiedNameOfFile - SynExprInterpolatedStringWithTripleQuoteMultipleDollars2, [], [], + SynExprInterpolatedStringWithTripleQuoteMultipleDollars2, [], [SynModuleOrNamespace ([SynExprInterpolatedStringWithTripleQuoteMultipleDollars2], false, AnonModule, @@ -15,4 +15,5 @@ ImplFile (2,0--2,16))], PreXmlDocEmpty, [], None, (2,0--2,16), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 01.fs.bsl b/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 01.fs.bsl index 493efcfa2b7..a71035a5e4b 100644 --- a/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynIdent/IncompleteLongIdent 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -10,6 +10,7 @@ ImplFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--4,2), { LeadingKeyword = Module (2,0--2,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,1)-(4,2) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 02.fs.bsl b/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 02.fs.bsl index 9df8951773d..94b81e612c2 100644 --- a/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynIdent/IncompleteLongIdent 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynIdent/IncompleteLongIdent 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -12,6 +12,7 @@ ImplFile PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (2,0--4,4), { LeadingKeyword = Module (2,0--2,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,3)-(4,4) parse error Missing qualification after '.' diff --git a/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl b/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl index 96d2a16e16c..53050c358a9 100644 --- a/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynTyparDecl/Constraint intersection 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -99,4 +99,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,34), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Constraint intersection 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Constraint intersection 01.fs.bsl index 64e8fd7c7a8..406f8286369 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Constraint intersection 01.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -55,4 +55,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,46), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Constraint intersection 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Constraint intersection 02.fs.bsl index 039915cb522..84ad6fcff41 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Constraint intersection 02.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -53,4 +53,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,56), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl index f28ed328e25..aba7c4ea07e 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Constraint intersection 03.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -62,4 +62,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,53), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Div 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 01.fs.bsl index ea6b5ee5e6d..e6cc46f1a92 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Div 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 02.fs.bsl index 2ed151d5ecf..2b17f414619 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Div 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 03.fs.bsl index 411cff73657..9bdbbe2d84d 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,4 +16,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Div 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 04.fs.bsl index 9b036b95e12..f20777ecd5d 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 04.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Div 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 05.fs.bsl index 56f07e3876e..3181899d0e0 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 05.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,13)-(3,14) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Div 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Div 06.fs.bsl index 354ee8e4e9b..b41c0e93917 100644 --- a/tests/service/data/SyntaxTree/SynType/Div 06.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Div 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Div 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Div 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Fun 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 01.fs.bsl index d723fe968b4..a2a0cb6f454 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,4 +15,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Fun 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 02.fs.bsl index 4413b33b2c2..7d821d5f076 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Fun 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 03.fs.bsl index c92a2eaa29a..27e57c94397 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -15,6 +15,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(3,11) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Fun 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 04.fs.bsl index 90cb7ec281f..22e338af3d0 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 04.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,15)-(3,16) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Fun 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 05.fs.bsl index 51bd3d1f6c3..cadbc3cccd8 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 05.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(3,12) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Fun 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 06.fs.bsl index 79fba7f21d4..d9cb647dde9 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 06.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,4 +31,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Fun 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 07.fs.bsl index fc09b3f737f..fb62b6e501f 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 07.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -37,4 +37,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Fun 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 08.fs.bsl index 914be23e3c5..0abcf541d5c 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 08.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +31,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(3,13) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Fun 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 09.fs.bsl index 3a7ecdba3cf..3dff98415d7 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 09.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -37,6 +37,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(3,18) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Fun 10.fs.bsl b/tests/service/data/SyntaxTree/SynType/Fun 10.fs.bsl index 061982252ad..b3cda4839cc 100644 --- a/tests/service/data/SyntaxTree/SynType/Fun 10.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Fun 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Fun 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Fun 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -31,6 +31,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(3,14) parse error Unexpected symbol '->' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl index 0781e30ef03..0d39ab9c888 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -18,4 +18,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl index 524fced7a9a..b81f6b1f3f9 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -20,4 +20,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl index 6cddbf89cae..d28f17a263d 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl index c205d9d5518..38104718dfb 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl index fafa4eb0a3f..828b8de599c 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -27,4 +27,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl index 75f20e20fdd..c2a24350cd2 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -29,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,31), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl index 65e957b2058..45d7be65073 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -28,4 +28,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl index c6f0d6cbd6d..c235cb210ba 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -22,6 +22,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,13)-(3,14) parse error Unexpected integer literal in binding diff --git a/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl index a97b6dd3461..e9fc68b3fd8 100644 --- a/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Named 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Named 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Named 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl index 1c58087b0d8..1f03d7f33ac 100644 --- a/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/NestedSynTypeOrInsideSynExprTraitCall.fs", false, - QualifiedNameOfFile NestedSynTypeOrInsideSynExprTraitCall, [], [], + QualifiedNameOfFile NestedSynTypeOrInsideSynExprTraitCall, [], [SynModuleOrNamespace ([NestedSynTypeOrInsideSynExprTraitCall], false, AnonModule, [Let @@ -102,4 +102,5 @@ ImplFile EqualsRange = Some (2,34--2,35) })], (2,0--2,100))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl index 5c1cd55a5bf..1e3e4c88ac6 100644 --- a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/SingleSynTypeInsideSynExprTraitCall.fs", false, - QualifiedNameOfFile SingleSynTypeInsideSynExprTraitCall, [], [], + QualifiedNameOfFile SingleSynTypeInsideSynExprTraitCall, [], [SynModuleOrNamespace ([SingleSynTypeInsideSynExprTraitCall], false, AnonModule, [Types @@ -191,4 +191,5 @@ ImplFile WithKeyword = None })], (2,0--4,60))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl index 24fb731523f..ea2f15e0487 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynExprTraitCall.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/SynTypeOrInsideSynExprTraitCall.fs", false, - QualifiedNameOfFile SynTypeOrInsideSynExprTraitCall, [], [], + QualifiedNameOfFile SynTypeOrInsideSynExprTraitCall, [], [SynModuleOrNamespace ([SynTypeOrInsideSynExprTraitCall], false, AnonModule, [Let @@ -79,4 +79,5 @@ ImplFile EqualsRange = Some (2,29--2,30) })], (2,0--2,84))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl index c2de9ccff5c..31f3fe5e4c6 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/SynType/SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember.fs", false, QualifiedNameOfFile - SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember, [], [], + SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember, [], [SynModuleOrNamespace ([SynTypeOrInsideSynTypeConstraintWhereTyparSupportsMember], false, AnonModule, @@ -86,4 +86,5 @@ ImplFile (2,0--3,6))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl index f509494f211..3a17a731f00 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/SynTypeOrWithAppTypeOnTheRightHandSide.fs", false, - QualifiedNameOfFile SynTypeOrWithAppTypeOnTheRightHandSide, [], [], + QualifiedNameOfFile SynTypeOrWithAppTypeOnTheRightHandSide, [], [SynModuleOrNamespace ([SynTypeOrWithAppTypeOnTheRightHandSide], false, AnonModule, [Let @@ -60,4 +60,5 @@ ImplFile EqualsRange = Some (2,21--2,22) })], (2,0--2,64))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl index 6d0202252ea..c65846b5121 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl @@ -2,7 +2,6 @@ SigFile (ParsedSigFileInput ("/root/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi", QualifiedNameOfFile SynTypeTupleDoesIncludeLeadingParameterAttributes, [], - [], [SynModuleOrNamespaceSig ([SynTypeTupleDoesIncludeLeadingParameterAttributes], false, AnonModule, [Types @@ -92,4 +91,5 @@ SigFile WithKeyword = None })], (2,0--3,63))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl index 662002f0c87..6519bc1260e 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl @@ -1,7 +1,7 @@ SigFile (ParsedSigFileInput ("/root/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi", - QualifiedNameOfFile SynTypeTupleDoesIncludeLeadingParameterName, [], [], + QualifiedNameOfFile SynTypeTupleDoesIncludeLeadingParameterName, [], [SynModuleOrNamespaceSig ([SynTypeTupleDoesIncludeLeadingParameterName], false, AnonModule, [Types @@ -55,4 +55,5 @@ SigFile WithKeyword = None })], (2,0--3,34))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 01.fs.bsl index cb47bf69176..2ab3f8be161 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -27,4 +27,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 02.fs.bsl index 31c6f32e32e..b2c6071dc34 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 03.fs.bsl index d2a8a234b88..deb1bf19996 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -30,4 +30,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,24), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 04.fs.bsl index 5ceab06a988..4df779116b0 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 04.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,11)-(3,12) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 05.fs.bsl index e72167dde44..86b1794b8ef 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 05.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,15)-(3,16) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 06.fs.bsl index f90be5ac2f2..0eebe72bbd3 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple - Nested 06.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple - Nested 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/SynType/Tuple - Nested 06.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,20)-(3,21) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 01.fs.bsl index 85497901333..4aaaa3906ac 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 02.fs.bsl index b35e5fb5bda..9dff41a4bb0 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 03.fs.bsl index c83be44e69b..861e9ccf2bd 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -21,4 +21,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 04.fs.bsl index de61cb515a6..11516716f00 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 04.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 05.fs.bsl index 7d02d692052..805333cbd6d 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 05.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,6) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 06.fs.bsl index aa3c77a6051..8a787d25260 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 06.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(3,10) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 07.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 07.fs.bsl index af8c1af77d0..a04ebce56b4 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 07.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,16)-(3,17) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 08.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 08.fs.bsl index 658dd4661e2..be8a9c788da 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 08.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -18,6 +18,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,14), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,13)-(3,14) parse error Unexpected symbol ')' in type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 09.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 09.fs.bsl index c0d052bcc9f..65df0ba18f4 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 09.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -39,6 +39,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,16)-(3,17) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 10.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 10.fs.bsl index dc553f72214..d38b3e89d5f 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 10.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 10.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 10.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -39,6 +39,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,11)-(3,13) parse error Unexpected symbol '->' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 11.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 11.fs.bsl index 31ca0e7d595..ed9a34731d9 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 11.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 11.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 11.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 11.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -45,6 +45,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,22)-(3,23) parse error Unexpected symbol '=' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 12.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 12.fs.bsl index 48dd1654f53..aab9c322a38 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 12.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 12.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 12.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 12.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -45,6 +45,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(3,19) parse error Unexpected symbol '->' in binding diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 13.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 13.fs.bsl index 1c4baa1ad5b..c0d6e8ddce2 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 13.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 13.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 13.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 13.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -47,6 +47,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(3,18) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/SynType/Tuple 14.fs.bsl b/tests/service/data/SyntaxTree/SynType/Tuple 14.fs.bsl index 8f40539042b..6a54173ea3e 100644 --- a/tests/service/data/SyntaxTree/SynType/Tuple 14.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Tuple 14.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/SynType/Tuple 14.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/SynType/Tuple 14.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -47,6 +47,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(3,13) parse error Expecting type diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl index f5ca6da29e6..8161ef11d05 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Abbreviation 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Abbreviation 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -19,4 +19,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl index 6d0a7728993..69efd4467a5 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Abbreviation 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Abbreviation 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -23,4 +23,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl index d2fb3a0cb2b..3d81221a098 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Abbreviation 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Abbreviation 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,4 +25,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl index 53dd6bbce50..4b2d945ae86 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Abbreviation 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Abbreviation 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl index a9d16c93758..4c6d6d9d69d 100644 --- a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,3) parse error Unexpected keyword 'and' in type name diff --git a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl index 9c68fa0b125..d8ed54e6278 100644 --- a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +40,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl index 0334d8da564..75c21712b48 100644 --- a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,7) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl index 05c052ddda5..43cdb517f1f 100644 --- a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,6 +28,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,0), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,0) parse error Incomplete structured construct at or before this point in type name diff --git a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl index 60a23a89c19..e830f0923ad 100644 --- a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,4 +28,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl index cb3337443f1..88650dda065 100644 --- a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/And 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/And 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,6 +28,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/As 01.fs.bsl b/tests/service/data/SyntaxTree/Type/As 01.fs.bsl index bec2d3a7121..6ee3982d866 100644 --- a/tests/service/data/SyntaxTree/Type/As 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,4 +27,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,28), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl index f40ff1a13d0..d9175ab67c2 100644 --- a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(3,13) parse error Unexpected symbol '=' in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl index 42c054e0dbf..c6d3679b645 100644 --- a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,26), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(3,14) parse error This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. diff --git a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl index 82bef8fffce..72a2470ba19 100644 --- a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,10)-(3,11) parse error Unexpected symbol '=' in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl index 52ea9524fef..a95fbbe8e9c 100644 --- a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl index ed933552272..9f32f95a557 100644 --- a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl index a491491159b..c984cc41133 100644 --- a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,17)-(5,0) parse error Incomplete structured construct at or before this point in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl index 24254ea6064..949d6732cb3 100644 --- a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/As 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/As 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,12)-(5,0) parse error Incomplete structured construct at or before this point in type definition. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl index 6ed7fe97af5..478489a67f7 100644 --- a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/AttributesInOptionalNamedMemberParameter.fs", false, - QualifiedNameOfFile AttributesInOptionalNamedMemberParameter, [], [], + QualifiedNameOfFile AttributesInOptionalNamedMemberParameter, [], [SynModuleOrNamespace ([AttributesInOptionalNamedMemberParameter], false, AnonModule, [Types @@ -72,4 +72,5 @@ ImplFile WithKeyword = None })], (2,0--3,46))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl index fe8be852708..319b6a1799c 100644 --- a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Class 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Class 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl index f7e959d10a0..b3d84e0003e 100644 --- a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Class 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Class 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -42,4 +42,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl index 77f8ca8cea0..1b1edb27290 100644 --- a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Class 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Class 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,4 +27,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl index 80c75b7d5da..ae98b2f4211 100644 --- a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Class 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Class 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -29,4 +29,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl index 6516bdc8320..a47c0c4fc45 100644 --- a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Class 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Class 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,4 +43,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl index e10f9194831..1d8dfd6a8ff 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,4 +25,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl index e586e137997..f9ea108dd50 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl index 17ed2baa172..7bce3a3aa62 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl index faed14098e3..710fdf83368 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,5) parse error Unexpected symbol '|' in union case diff --git a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl index fd808927027..4d1063812b5 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl index b7fd06cbbd2..3382f753b9f 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,5) parse error Unexpected symbol '|' in type definition diff --git a/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl index 5278e60ecd8..6d424af5776 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 07 - Eof.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 07 - Eof.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl index b715aa57067..40680d4d737 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 08 - Eof.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 08 - Eof.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl index c1756aeb77a..5604912f25c 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 09 - Eof.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 09 - Eof.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,9) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl index 6a6bf175b1d..c85ef4a38c1 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Enum 10 - Eof.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Enum 10 - Eof.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,7) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl index 27d0bc70287..0736baeb450 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Interface 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Interface 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl index 9a516b1a4a4..00f511cf97b 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Interface 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Interface 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl index beaa9fae234..9bd8891abe6 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Interface 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Interface 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -38,4 +38,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl index 3c5776cc025..2f68afd4da1 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Interface 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Interface 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -38,4 +38,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Interface 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 05.fs.bsl index 25c830d341d..e6801e0c2fc 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 05.fs.bsl @@ -1,11 +1,11 @@ ImplFile (ParsedImplFileInput ("/root/Type/Interface 05.fs", false, QualifiedNameOfFile Interface 05, [], - [], [SynModuleOrNamespace ([Interface 05], false, AnonModule, [], PreXmlDocEmpty, [], None, (8,0--8,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,0)-(7,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Interface 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 06.fs.bsl index b8201474aa2..fcb667c6f0a 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 06.fs.bsl @@ -1,11 +1,11 @@ ImplFile (ParsedImplFileInput ("/root/Type/Interface 06.fs", false, QualifiedNameOfFile Interface 06, [], - [], [SynModuleOrNamespace ([Interface 06], false, AnonModule, [], PreXmlDocEmpty, [], None, (7,0--7,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl index 7776c39507b..07799f674ef 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Interface 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Interface 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -39,6 +39,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,14)-(5,4) parse error Incomplete structured construct at or before this point in member definition diff --git a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl index 85c646eae41..26f912fd463 100644 --- a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs", false, - QualifiedNameOfFile MultipleSynEnumCaseContainsRangeOfConstant, [], [], + QualifiedNameOfFile MultipleSynEnumCaseContainsRangeOfConstant, [], [SynModuleOrNamespace ([MultipleSynEnumCaseContainsRangeOfConstant], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--4,13))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl index daea0ab5026..cd9f16db52b 100644 --- a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/NamedParametersInDelegateType.fs", false, - QualifiedNameOfFile NamedParametersInDelegateType, [], [], + QualifiedNameOfFile NamedParametersInDelegateType, [], [SynModuleOrNamespace ([NamedParametersInDelegateType], false, AnonModule, [Types @@ -87,4 +87,5 @@ ImplFile WithKeyword = None })], (2,0--2,46))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl index ae482a08271..536c4cc9e54 100644 --- a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs", false, - QualifiedNameOfFile NestedTypeHasStaticTypeAsLeadingKeyword, [], [], + QualifiedNameOfFile NestedTypeHasStaticTypeAsLeadingKeyword, [], [SynModuleOrNamespace ([NestedTypeHasStaticTypeAsLeadingKeyword], false, AnonModule, [Types @@ -30,4 +30,5 @@ ImplFile WithKeyword = None })], (2,0--6,0))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl index 6717cb55b41..fe0302ab859 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Primary ctor 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Primary ctor 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl index fbb48e2fd0a..72bc51bf468 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Primary ctor 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Primary ctor 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,7) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl index 7bf4dedee58..99c099de787 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Primary ctor 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Primary ctor 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -21,6 +21,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,9)-(5,0) parse error Incomplete structured construct at or before this point in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl index a46c198cdfe..057d2f4c5b5 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Primary ctor 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Primary ctor 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl index 17215f552fc..9a347eecea8 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Primary ctor 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Primary ctor 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -20,6 +20,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Incomplete structured construct at or before this point in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl index 3d954e3c37d..79bbd17b1a6 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs", false, - QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynTypeDefn, [], [], + QualifiedNameOfFile RangeOfAttributeShouldBeIncludedInSynTypeDefn, [], [SynModuleOrNamespace ([RangeOfAttributeShouldBeIncludedInSynTypeDefn], false, AnonModule, [Types @@ -22,4 +22,5 @@ ImplFile WithKeyword = None })], (2,0--5,7))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl index 0b685986fc4..ad592dd5cbb 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs", false, QualifiedNameOfFile RangeOfAttributesShouldBeIncludedInRecursiveTypes, [], - [], [SynModuleOrNamespace ([RangeOfAttributesShouldBeIncludedInRecursiveTypes], false, AnonModule, [Types @@ -112,4 +111,5 @@ ImplFile WithKeyword = None })], (2,0--10,5))], PreXmlDocEmpty, [], None, (2,0--11,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl index 95895538080..e2c49be6c8e 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Access 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '}' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl index dac1c3f6255..3540dbcc68c 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Access 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '}' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl index f819d61d7c4..353570298cd 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Access 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,8)-(5,31) parse error Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. diff --git a/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl index 1bcbe107b49..37ad416ff25 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Access 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,8)-(5,23) parse error Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. diff --git a/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl index 1b629ceaf6f..37da69f67aa 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Mutable 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +26,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '}' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl index 6d7a08f3caa..7b80fa8e08f 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Mutable 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -33,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,5) parse error Unexpected symbol '}' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl index 34b8bfe0d51..64b6dba2775 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Mutable 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -33,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,16)-(6,8) parse error Incomplete structured construct at or before this point in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl index e8067343cd8..c3b99f04619 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Mutable 04.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -39,6 +38,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--10,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,16)-(7,8) parse error Incomplete structured construct at or before this point in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl index 3679671665f..6443e19b43b 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Record - Mutable 05.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +39,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--10,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl index 1eabb2b2f62..ce490f4890d 100644 --- a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Record 01.fs", false, QualifiedNameOfFile Foo, [], [], + ("/root/Type/Record 01.fs", false, QualifiedNameOfFile Foo, [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Types @@ -42,6 +42,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,5) parse error Unexpected symbol '}' in field declaration. Expected ':' or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl index 11cabe541de..2805bef72c4 100644 --- a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Record 02.fs", false, QualifiedNameOfFile Foo, [], [], + ("/root/Type/Record 02.fs", false, QualifiedNameOfFile Foo, [], [SynModuleOrNamespace ([Foo], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,4)-(7,5) parse error Unexpected symbol '}' in field declaration diff --git a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl index 8777aa1b200..e53b6c858d4 100644 --- a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Record 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Record 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,6)-(4,7) parse error Expecting record field diff --git a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl index db457dd8de3..bc34db45a45 100644 --- a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Record 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Record 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -25,6 +25,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,6)-(5,7) parse error Unexpected symbol ';' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl index 19883a9e8c9..65f78f4d5d3 100644 --- a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Record 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Record 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -37,6 +37,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,6)-(5,7) parse error Unexpected symbol ';' in field declaration. Expected identifier or other token. diff --git a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl index e901d3eac2f..eebe5e89043 100644 --- a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/SingleSynEnumCaseContainsRangeOfConstant.fs", false, - QualifiedNameOfFile SingleSynEnumCaseContainsRangeOfConstant, [], [], + QualifiedNameOfFile SingleSynEnumCaseContainsRangeOfConstant, [], [SynModuleOrNamespace ([SingleSynEnumCaseContainsRangeOfConstant], false, AnonModule, [Types @@ -24,4 +24,5 @@ ImplFile WithKeyword = None })], (2,0--2,27))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl index 9996befe9da..7a1e7f126b6 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Struct 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Struct 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,4 +16,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl index 3ca9cf08ae3..50148b6ee14 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Struct 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Struct 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -26,4 +26,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl index cc2e1a3997f..4a03a8854ac 100644 --- a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -65,4 +65,5 @@ ImplFile WithKeyword = None })], (2,0--5,19))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl index 6b465047993..bdf9ec74f42 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs", false, QualifiedNameOfFile - SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword, [], [], + SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword, [], [SynModuleOrNamespace ([SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword], false, AnonModule, @@ -28,4 +28,5 @@ ImplFile WithKeyword = None })], (2,0--4,10))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,0--3,8)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl index 285ecf0975e..200a42bb6be 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile - SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword, [], [], + SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword, [], [SynModuleOrNamespace ([SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -42,4 +42,5 @@ ImplFile WithKeyword = None })], (2,0--3,21))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl index f4a425b596d..4ebef606401 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl @@ -2,7 +2,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs", false, QualifiedNameOfFile SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign, [], - [], [SynModuleOrNamespace ([SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -32,4 +31,5 @@ ImplFile WithKeyword = None })], (2,0--4,19))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl index 3809962658a..ac4171bbf00 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl @@ -4,7 +4,6 @@ ImplFile false, QualifiedNameOfFile SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign, [], - [], [SynModuleOrNamespace ([SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -51,4 +50,5 @@ ImplFile WithKeyword = None })], (2,0--2,37))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl index 35e334478f0..7cb9f5a2af5 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs", false, QualifiedNameOfFile SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword, - [], [], + [], [SynModuleOrNamespace ([SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword], false, AnonModule, @@ -77,4 +77,5 @@ ImplFile (2,0--5,46))], PreXmlDocEmpty, [], None, (2,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl index 5e5b3b7fc3b..561ab54725d 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl @@ -2,7 +2,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs", false, QualifiedNameOfFile SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign, - [], [], + [], [SynModuleOrNamespace ([SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign], false, AnonModule, @@ -52,4 +52,5 @@ ImplFile WithKeyword = None })], (2,0--4,28))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl index 06a95ae7aa5..98690850046 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -3,7 +3,7 @@ ImplFile ("/root/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs", false, QualifiedNameOfFile SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword, - [], [], + [], [SynModuleOrNamespace ([SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword], false, AnonModule, @@ -34,4 +34,5 @@ ImplFile WithKeyword = None })], (2,0--5,9))], PreXmlDocEmpty, [], None, (4,0--6,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (3,0--3,8)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl index 21eb149bb10..18cf4ffe778 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/SynTypeFunHasRangeOfArrow.fs", false, - QualifiedNameOfFile SynTypeFunHasRangeOfArrow, [], [], + QualifiedNameOfFile SynTypeFunHasRangeOfArrow, [], [SynModuleOrNamespace ([SynTypeFunHasRangeOfArrow], false, AnonModule, [Types @@ -23,4 +23,5 @@ ImplFile WithKeyword = None })], (2,0--3,20))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (2,19--2,59)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStruct.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStruct.fs.bsl index e0f51c6ee46..2091682bac4 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStruct.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStruct.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/SynTypeTupleWithStruct.fs", false, - QualifiedNameOfFile SynTypeTupleWithStruct, [], [], + QualifiedNameOfFile SynTypeTupleWithStruct, [], [SynModuleOrNamespace ([SynTypeTupleWithStruct], false, AnonModule, [Let @@ -34,4 +34,5 @@ ImplFile EqualsRange = Some (2,26--2,27) })], (2,0--2,30))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStructRecovery.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStructRecovery.fs.bsl index c69d94938c8..243e4f59db4 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStructRecovery.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeTupleWithStructRecovery.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Type/SynTypeTupleWithStructRecovery.fs", false, - QualifiedNameOfFile SynTypeTupleWithStructRecovery, [], [], + QualifiedNameOfFile SynTypeTupleWithStructRecovery, [], [SynModuleOrNamespace ([SynTypeTupleWithStructRecovery], false, AnonModule, [Let @@ -34,6 +34,7 @@ ImplFile EqualsRange = Some (2,25--2,26) })], (2,0--2,29))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (2,25)-(2,26) parse error Unexpected symbol '=' in binding. Expected ')' or other token. diff --git a/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl index f34d5eb126b..6d2a653d3c3 100644 --- a/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(5,0) parse error Incomplete structured construct at or before this point in type name diff --git a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl index a670186b978..1612c6d364a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,4 +17,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl index 9cb15932e4c..d852d9f5b0c 100644 --- a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,8) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl index 83a744a8417..25829050752 100644 --- a/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -29,6 +29,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,9) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl index ab92f140113..3b6a0da3290 100644 --- a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,6 +28,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,9) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl index c987c0d38f5..9fbbe27cb68 100644 --- a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl index 0eb812102a6..fc4e61c33cd 100644 --- a/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -41,6 +41,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,6) parse error Unexpected symbol '=' in type name diff --git a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl index fea4942c9fa..787da13b0e8 100644 --- a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 08.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 08.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -24,4 +24,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl index c4361033429..0105941f2d9 100644 --- a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 09.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 09.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,1) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl index 979759d4dbf..7cbdc0524f8 100644 --- a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 10.fs", false, QualifiedNameOfFile Type 10, [], [], + ("/root/Type/Type 10.fs", false, QualifiedNameOfFile Type 10, [], [SynModuleOrNamespace ([N], false, DeclaredNamespace, [NestedModule @@ -51,6 +51,7 @@ ImplFile PreXmlDocEmpty, [], None, (4,0--9,16), { LeadingKeyword = Namespace (4,0--4,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [LineComment (1,0--1,25)] }, set [])) (7,9)-(7,10) parse error Unexpected character '�' in type name diff --git a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl index 074cead59e8..18c53db2380 100644 --- a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 11.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 11.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -27,6 +27,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,5)-(3,7) parse error A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. diff --git a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl index 9bacae3a626..49cd0e01aff 100644 --- a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Type 12.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Type 12.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,7)-(3,8) parse error Unexpected symbol '|' in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl index bb78f6b332f..da9b04d91b5 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Union - Field 01.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,4 +31,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl index 4d3b58b4440..d649bbb87ad 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Union - Field 02.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -31,6 +30,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl index 378ecc0220d..45a33b76422 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl @@ -1,7 +1,6 @@ ImplFile (ParsedImplFileInput ("/root/Type/Union - Field 03.fs", false, QualifiedNameOfFile Module, [], - [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -38,6 +37,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,14)-(4,15) parse error Unexpected symbol '*' in union case diff --git a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl index d652bfba1e6..95b3750a979 100644 --- a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -23,4 +23,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl index 55d2c0c07e6..01aad19db35 100644 --- a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -38,4 +38,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl index 2906039ff99..9623dd96ac7 100644 --- a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,16), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl index 65be844f376..a83e76cb5a0 100644 --- a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:5). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl index 36eb5dae412..055cbe1b68b 100644 --- a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,17)-(4,18) parse error Expecting union case field diff --git a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl index 90b09522783..5648e1559f0 100644 --- a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 06.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 06.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -43,6 +43,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,22), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,11)-(4,12) parse error Expecting union case field diff --git a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl index 2f0f76e6131..756c74260c8 100644 --- a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/Union 07.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/Union 07.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,5) parse error Unexpected symbol '|' in union case diff --git a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl index 7fd1e7479f6..5b6217dfe21 100644 --- a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/With 01.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/With 01.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,4 +40,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl index afef8b79973..f319074e37e 100644 --- a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/With 02.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/With 02.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -16,6 +16,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,0)-(4,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl index 690a827af17..197d6d3efc9 100644 --- a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/With 03.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/With 03.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -17,6 +17,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl index 99ddf674425..1eda3d63210 100644 --- a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/With 04.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/With 04.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -47,4 +47,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl index af2e4a0317a..8dedec200dd 100644 --- a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl @@ -1,6 +1,6 @@ ImplFile (ParsedImplFileInput - ("/root/Type/With 05.fs", false, QualifiedNameOfFile Module, [], [], + ("/root/Type/With 05.fs", false, QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -23,6 +23,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,6) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (3:1). Try indenting this further. diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl index 2bac019ca23..88799b9de0d 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing keyword of.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -83,6 +83,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--11,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (7,6)-(7,18) parse error Missing keyword 'of' diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl index a67e4eb8783..f4722cd1688 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 01.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -24,6 +24,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,0)-(5,0) parse error Incomplete structured construct at or before this point in union case diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl index 02c674e6a1f..1d96591c282 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 02.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '|' in union case diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl index 4a272764df0..acbcf5624b1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 03.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -45,6 +45,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (4,4)-(4,6) parse error Missing union case name diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl index 8913b904cea..f7225a0927b 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 04.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,6)-(5,8) parse error Missing union case name diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl index 9d7a69011ef..d1d8fe0cce1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 05.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -40,6 +40,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,15)-(5,17) parse error Missing union case name diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl index 27516955a99..44085d99dcf 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 06.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -32,6 +32,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '|' in union case diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl index c4d3efa237f..86769a68dd1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 07.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--7,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,4)-(6,5) parse error Unexpected symbol '|' in union case diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl index 238d9916e07..1f0a8ebdcac 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 08.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -37,6 +37,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--6,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (6,0)-(6,4) parse error Incomplete structured construct at or before this point in type definition diff --git a/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl index 47c92aa67e0..458228278e4 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Missing name 09.fs", false, QualifiedNameOfFile Module, - [], [], + [], [SynModuleOrNamespace ([Module], false, NamedModule, [Types @@ -28,6 +28,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,4)-(5,5) parse error Unexpected symbol '|' in type definition diff --git a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl index 8691d476cc6..7b2aafa30de 100644 --- a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/MultipleSynUnionCasesHaveBarRange.fs", false, - QualifiedNameOfFile MultipleSynUnionCasesHaveBarRange, [], [], + QualifiedNameOfFile MultipleSynUnionCasesHaveBarRange, [], [SynModuleOrNamespace ([MultipleSynUnionCasesHaveBarRange], false, AnonModule, [Types @@ -43,4 +43,5 @@ ImplFile WithKeyword = None })], (2,0--4,17))], PreXmlDocEmpty, [], None, (2,0--5,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl index 21d1081b55d..732c0e0b8bf 100644 --- a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/PrivateKeywordHasRange.fs", false, - QualifiedNameOfFile PrivateKeywordHasRange, [], [], + QualifiedNameOfFile PrivateKeywordHasRange, [], [SynModuleOrNamespace ([PrivateKeywordHasRange], false, AnonModule, [Types @@ -32,5 +32,6 @@ ImplFile None, (2,0--10,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [If (Not (Ident "FABLE_COMPILER"), (6,0--6,19)); EndIf (8,0--8,6)] + WarnDirectives = [] CodeComments = [LineComment (3,4--3,67); LineComment (4,4--4,56)] }, set [])) diff --git a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 01.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 01.fs.bsl index 4817546864d..ff412468614 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 01.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Recover Function Type 01.fs", false, - QualifiedNameOfFile Recover Function Type 01, [], [], + QualifiedNameOfFile Recover Function Type 01, [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Types @@ -49,6 +49,7 @@ ImplFile WithKeyword = None })], (4,0--4,16))], PreXmlDocEmpty, [], None, (1,0--4,16), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,20)-(3,30) parse error Unexpected function type in union case field definition. If you intend the field to be a function, consider wrapping the function signature with parens, e.g. | Case of a -> b into | Case of (a -> b). diff --git a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 02.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 02.fs.bsl index 0b908ef60f6..e1c73af2833 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 02.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Recover Function Type 02.fs", false, - QualifiedNameOfFile Recover Function Type 02, [], [], + QualifiedNameOfFile Recover Function Type 02, [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Types @@ -49,6 +49,7 @@ ImplFile WithKeyword = None })], (4,0--4,16))], PreXmlDocEmpty, [], None, (1,0--4,16), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,19)-(3,29) parse error Unexpected function type in union case field definition. If you intend the field to be a function, consider wrapping the function signature with parens, e.g. | Case of a -> b into | Case of (a -> b). diff --git a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 03.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 03.fs.bsl index 97defcda3ce..32f2f4bb2a1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Recover Function Type 03.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/Recover Function Type 03.fs", false, - QualifiedNameOfFile Recover Function Type 03, [], [], + QualifiedNameOfFile Recover Function Type 03, [], [SynModuleOrNamespace ([Foo], false, DeclaredNamespace, [Types @@ -54,6 +54,7 @@ ImplFile WithKeyword = None })], (4,0--4,16))], PreXmlDocEmpty, [], None, (1,0--4,16), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,16)-(3,33) parse error Unexpected function type in union case field definition. If you intend the field to be a function, consider wrapping the function signature with parens, e.g. | Case of a -> b into | Case of (a -> b). diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl index d5c4b3f2f80..7ed7778c9c9 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/SingleSynUnionCaseHasBarRange.fs", false, - QualifiedNameOfFile SingleSynUnionCaseHasBarRange, [], [], + QualifiedNameOfFile SingleSynUnionCaseHasBarRange, [], [SynModuleOrNamespace ([SingleSynUnionCaseHasBarRange], false, AnonModule, [Types @@ -31,4 +31,5 @@ ImplFile WithKeyword = None })], (2,0--2,26))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl index 32910732a1c..a2888b02b10 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/SingleSynUnionCaseWithoutBar.fs", false, - QualifiedNameOfFile SingleSynUnionCaseWithoutBar, [], [], + QualifiedNameOfFile SingleSynUnionCaseWithoutBar, [], [SynModuleOrNamespace ([SingleSynUnionCaseWithoutBar], false, AnonModule, [Types @@ -31,4 +31,5 @@ ImplFile WithKeyword = None })], (2,0--2,24))], PreXmlDocEmpty, [], None, (2,0--3,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl index 20e3a15d262..cd3e454e196 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/SynUnionCaseKindFullType.fs", false, - QualifiedNameOfFile SynUnionCaseKindFullType, [], [], + QualifiedNameOfFile SynUnionCaseKindFullType, [], [SynModuleOrNamespace ([SynUnionCaseKindFullType], false, AnonModule, [Types @@ -37,6 +37,7 @@ ImplFile WithKeyword = None })], (2,0--3,20))], PreXmlDocEmpty, [], None, (2,0--4,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (3,6)-(3,20) parse warning This construct is deprecated: it is only for use in the F# library diff --git a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl index 51363b02c37..57c3921ba18 100644 --- a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/UnionCase/UnionCaseFieldsCanHaveComments.fs", false, - QualifiedNameOfFile UnionCaseFieldsCanHaveComments, [], [], + QualifiedNameOfFile UnionCaseFieldsCanHaveComments, [], [SynModuleOrNamespace ([UnionCaseFieldsCanHaveComments], false, AnonModule, [Types @@ -38,4 +38,5 @@ ImplFile WithKeyword = None })], (2,0--8,6))], PreXmlDocEmpty, [], None, (2,0--9,0), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl b/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl index 8c04d7ba275..32c245bd262 100644 --- a/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/Val/InlineKeyword.fsi.bsl @@ -1,6 +1,6 @@ SigFile (ParsedSigFileInput - ("/root/Val/InlineKeyword.fsi", QualifiedNameOfFile InlineKeyword, [], [], + ("/root/Val/InlineKeyword.fsi", QualifiedNameOfFile InlineKeyword, [], [SynModuleOrNamespaceSig ([X], false, DeclaredNamespace, [Val @@ -21,4 +21,5 @@ SigFile EqualsRange = None }), (4,0--4,26))], PreXmlDocEmpty, [], None, (2,0--4,26), { LeadingKeyword = Namespace (2,0--2,9) })], { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs b/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs new file mode 100644 index 00000000000..5192d49c270 --- /dev/null +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs @@ -0,0 +1,4 @@ +#nowarn 20 +() +#warnon 20 // a comment +() \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs.bsl b/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs.bsl new file mode 100644 index 00000000000..ae8bcd1dbd2 --- /dev/null +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScope.fs.bsl @@ -0,0 +1,12 @@ +ImplFile + (ParsedImplFileInput + ("/root/WarnScope/WarnScope.fs", false, QualifiedNameOfFile WarnScope, [], + [SynModuleOrNamespace + ([WarnScope], false, AnonModule, + [Expr (Const (Unit, (2,0--2,2)), (2,0--2,2)); + Expr (Const (Unit, (4,0--4,2)), (4,0--4,2))], PreXmlDocEmpty, [], + None, (2,0--4,2), { LeadingKeyword = None })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = + [Nowarn ([20], (1,0--1,10)); Warnon ([20], (3,0--3,10))] + CodeComments = [LineComment (3,12--3,24)] }, set [])) diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs new file mode 100644 index 00000000000..5140c05731b --- /dev/null +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs @@ -0,0 +1,7 @@ +module M +module N = + #nowarn 20 25 + () + #warnon 20 25 // a comment + () +() \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl new file mode 100644 index 00000000000..40470a3603c --- /dev/null +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl @@ -0,0 +1,22 @@ +ImplFile + (ParsedImplFileInput + ("/root/WarnScope/WarnScopeInSubmodule.fs", false, QualifiedNameOfFile M, + [], + [SynModuleOrNamespace + ([M], false, NamedModule, + [NestedModule + (SynComponentInfo + ([], None, [], [N], + PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, + None, (2,0--2,8)), false, + [Expr (Const (Unit, (4,4--4,6)), (4,4--4,6)); + Expr (Const (Unit, (6,4--6,6)), (6,4--6,6))], false, (2,0--6,6), + { ModuleKeyword = Some (2,0--2,6) + EqualsRange = Some (2,9--2,10) }); + Expr (Const (Unit, (7,0--7,2)), (7,0--7,2))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,2), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = + [Nowarn ([20; 25], (3,4--3,17)); Warnon ([20; 25], (5,4--5,17))] + CodeComments = [LineComment (5,18--5,30)] }, set [])) diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index b5cc13f4501..85182b0ca5f 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -519,7 +519,7 @@ type staticInInterface = |> List.exists(fun error -> (error.ToString().Contains("新規baProgram")))) // In this bug, particular warns were still present after nowarn - [] + [] member public this.``NoWarn.Bug5424``() = let fileContent = """ #nowarn "67" // this type test or downcast will always hold diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index 852758363c5..cef4a0e71aa 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -517,8 +517,9 @@ type UsingMSBuild() as this = let script1 = OpenFile(project,"Script1.fsx") MoveCursorToEndOfMarker(script1,"let y = f") - TakeCoffeeBreak(this.VS) - AssertNoErrorsOrWarnings(project) + TakeCoffeeBreak(this.VS) + AssertNoErrorsOrWarnings(project) + // AssertExactlyOneErrorSeenContaining(project, "This construct is deprecated. x") // This is expected for langVersion >= 10.0 /// FEATURE: #r in .fsx to a .dll name works. [] From 230df0ca7dc10aef62f9ea72ec44c086536a8ef3 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 14 May 2025 08:54:24 +0100 Subject: [PATCH 088/134] Make attribute target mismatch a warning and not an error. (#18492) * make attribute targets mismatches a warning and not an error. * release notes * update tests * update baselines * Update baselines * Move attribute form logic to an AP * Fix merge --- .../.FSharp.Compiler.Service/9.0.300.md | 1 + .../Checking/Expressions/CheckExpressions.fs | 57 +++-- .../AttributeUsage/AttributeUsage.fs | 215 +++++++++--------- .../CustomAttributes/Basic/Basic.fs | 7 +- .../EntryPoint/EntryPoint.fs | 2 +- .../LetBindings/Basic/Basic.fs | 4 +- .../UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx | 2 +- .../UnitsOfMeasure/WithOOP/WithOOP.fs | 2 +- .../ErrorMessages/TailCallAttribute.fs | 32 +-- .../PatternMatchCompilationTests.fs | 1 + .../Language/StructActivePatternTests.fs | 2 +- 11 files changed, 162 insertions(+), 163 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 14bb14be5a3..a3bda7c0c9c 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -54,6 +54,7 @@ * Warning for "useless null handling" works with piped syntax constructs now ([PR #18331](https://github.com/dotnet/fsharp/pull/18331)) * Make indent in generated overridden member code depend on the context, not fix to 4. ([PR #18341](https://github.com/dotnet/fsharp/pull/18341)) * Adjust caller info attribute error message range ([PR #18388](https://github.com/dotnet/fsharp/pull/18388)) +* Make attribute targets mismatch a warning and not an error ([PR #18492](https://github.com/dotnet/fsharp/pull/18492)) ### Breaking Changes * Struct unions with overlapping fields now generate mappings needed for reading via reflection ([Issue #18121](https://github.com/dotnet/fsharp/issues/17797), [PR #18274](https://github.com/dotnet/fsharp/pull/17877)) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 5f390038e35..567e1da0310 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -3187,6 +3187,24 @@ let BuildRecdFieldSet g m objExpr (rfinfo: RecdFieldInfo) argExpr = let wrap, objExpr, _readonly, _writeonly = mkExprAddrOfExpr g boxity false DefinitelyMutates objExpr None m wrap (mkRecdFieldSetViaExprAddr (objExpr, rfinfo.RecdFieldRef, rfinfo.TypeInst, argExpr, m) ) +// This is used to check the target of an attribute with the form of +// Long Form: [] +// Short Form: [] +let (|LongFormAttrTarget|UnrecognizedLongAttrTarget|ShortFormAttributeTarget|) (targetIndicator: Ident option) = + match targetIndicator with + | Some id when id.idText = "assembly" -> LongFormAttrTarget AttributeTargets.Assembly + | Some id when id.idText = "module" -> LongFormAttrTarget AttributeTargets.Module + | Some id when id.idText = "return" -> LongFormAttrTarget AttributeTargets.ReturnValue + | Some id when id.idText = "field" -> LongFormAttrTarget AttributeTargets.Field + | Some id when id.idText = "property" -> LongFormAttrTarget AttributeTargets.Property + | Some id when id.idText = "method" -> LongFormAttrTarget AttributeTargets.Method + | Some id when id.idText = "param" -> LongFormAttrTarget AttributeTargets.Parameter + | Some id when id.idText = "type" -> LongFormAttrTarget AttributeTargets.TyconDecl + | Some id when id.idText = "constructor" -> LongFormAttrTarget AttributeTargets.Constructor + | Some id when id.idText = "event" -> LongFormAttrTarget AttributeTargets.Event + | Some id -> UnrecognizedLongAttrTarget id + | None -> ShortFormAttributeTarget + //------------------------------------------------------------------------- // Helpers dealing with named and optional args at callsites //------------------------------------------------------------------------- @@ -11344,30 +11362,21 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn (validOnDefault, inheritedDefault) | _ -> (validOnDefault, inheritedDefault) - let possibleTgts = enum validOn &&& attrTgt - let directedTgts = + let attributeTargets = enum validOn &&& attrTgt + let directedTargets = match targetIndicator with - | Some id when id.idText = "assembly" -> AttributeTargets.Assembly - | Some id when id.idText = "module" -> AttributeTargets.Module - | Some id when id.idText = "return" -> AttributeTargets.ReturnValue - | Some id when id.idText = "field" -> AttributeTargets.Field - | Some id when id.idText = "property" -> AttributeTargets.Property - | Some id when id.idText = "method" -> AttributeTargets.Method - | Some id when id.idText = "param" -> AttributeTargets.Parameter - | Some id when id.idText = "type" -> AttributeTargets.TyconDecl - | Some id when id.idText = "constructor" -> AttributeTargets.Constructor - | Some id when id.idText = "event" -> AttributeTargets.Event - | Some id -> - errorR(Error(FSComp.SR.tcUnrecognizedAttributeTarget(), id.idRange)) - possibleTgts - // mask explicit targets - | _ -> possibleTgts &&& ~~~ attrEx - let constrainedTgts = possibleTgts &&& directedTgts - if constrainedTgts = enum 0 then - if (directedTgts = AttributeTargets.Assembly || directedTgts = AttributeTargets.Module) then + | LongFormAttrTarget attrTarget -> attrTarget + | UnrecognizedLongAttrTarget attrTarget -> + errorR(Error(FSComp.SR.tcUnrecognizedAttributeTarget(), attrTarget.idRange)) + attributeTargets + | ShortFormAttributeTarget -> attributeTargets &&& ~~~ attrEx + + let constrainedTargets = attributeTargets &&& directedTargets + if constrainedTargets = enum 0 then + if (directedTargets = AttributeTargets.Assembly || directedTargets = AttributeTargets.Module) then error(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElementUseDo(), mAttr)) else - error(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElement(), mAttr)) + warning(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElement(), mAttr)) match ResolveObjectConstructor cenv.nameResolver env.DisplayEnv mAttr ad ty with | Exception _ when canFail = TcCanFail.IgnoreAllErrors || canFail = TcCanFail.IgnoreMemberResoutionError -> [ ], true @@ -11428,11 +11437,11 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn if isStruct then error (Error(FSComp.SR.tcCustomAttributeMustBeReferenceType(), m)) if args.Length <> ilMethRef.ArgTypes.Length then error (Error(FSComp.SR.tcCustomAttributeArgumentMismatch(), m)) let args = args |> List.map mkAttribExpr - Attrib(tcref, ILAttrib ilMethRef, args, namedAttribArgMap, isAppliedToGetterOrSetter, Some constrainedTgts, m) + Attrib(tcref, ILAttrib ilMethRef, args, namedAttribArgMap, isAppliedToGetterOrSetter, Some constrainedTargets, m) | Expr.App (InnerExprPat(ExprValWithPossibleTypeInst(vref, _, _, _)), _, _, args, _) -> let args = args |> List.collect (function Expr.Const (Const.Unit, _, _) -> [] | expr -> tryDestRefTupleExpr expr) |> List.map mkAttribExpr - Attrib(tcref, FSAttrib vref, args, namedAttribArgMap, isAppliedToGetterOrSetter, Some constrainedTgts, mAttr) + Attrib(tcref, FSAttrib vref, args, namedAttribArgMap, isAppliedToGetterOrSetter, Some constrainedTargets, mAttr) | _ -> error (Error(FSComp.SR.tcCustomAttributeMustInvokeConstructor(), mAttr)) @@ -11440,7 +11449,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn | _ -> error(Error(FSComp.SR.tcAttributeExpressionsMustBeConstructorCalls(), mAttr)) - [ (constrainedTgts, attrib) ], false + [ (constrainedTargets, attrib) ], false and TcAttributesWithPossibleTargetsEx canFail (cenv: cenv) env attrTgt attrEx synAttribs = diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index c7c2cf72eca..f027745b73e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -104,10 +104,10 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 21, Col 21, Line 21, Col 22, "This attribute is not valid for use on this language element") - (Error 842, Line 24, Col 21, Line 24, Col 29, "This attribute is not valid for use on this language element") - (Error 842, Line 27, Col 7, Line 27, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 18, Col 7, Line 18, Col 8, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 21, Line 21, Col 22, "This attribute is not valid for use on this language element") + (Warning 842, Line 24, Col 21, Line 24, Col 29, "This attribute is not valid for use on this language element") + (Warning 842, Line 27, Col 7, Line 27, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 18, Col 7, Line 18, Col 8, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargets02.fs # E_AttributeTargets02.fs @@ -117,9 +117,10 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 14, Col 7, Line 14, Col 34, "This attribute is not valid for use on this language element") - (Error 842, Line 24, Col 7, Line 24, Col 36, "This attribute is not valid for use on this language element") - (Error 842, Line 29, Col 15, Line 29, Col 47, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 7, Line 14, Col 34, "This attribute is not valid for use on this language element") + (Warning 842, Line 24, Col 7, Line 24, Col 36, "This attribute is not valid for use on this language element") + (Warning 842, Line 29, Col 15, Line 29, Col 47, "This attribute is not valid for use on this language element") + (Error 3172, Line 28, Col 14, Line 28, Col 17, "A property's getter and setter must have the same type. Property 'Foo' has getter of type 'int' but setter of type 'obj'.") ] // SOURCE=E_AttributeTargetIsField01.fs # E_AttributeTargetIsField01.fs @@ -140,23 +141,23 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 9, Col 3, Line 9, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 12, Col 3, Line 12, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 15, Col 3, Line 15, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 18, Col 3, Line 18, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 21, Col 3, Line 21, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 24, Col 3, Line 24, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 27, Col 3, Line 27, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 30, Col 3, Line 30, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 33, Col 3, Line 33, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 36, Col 3, Line 36, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 39, Col 3, Line 39, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 42, Col 3, Line 42, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 45, Col 3, Line 45, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 49, Col 3, Line 49, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 56, Col 3, Line 56, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 64, Col 3, Line 64, Col 12, "This attribute is not valid for use on this language element") - (Error 842, Line 66, Col 7, Line 66, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 9, Col 3, Line 9, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 12, Col 3, Line 12, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 3, Line 15, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 18, Col 3, Line 18, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 3, Line 21, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 24, Col 3, Line 24, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 27, Col 3, Line 27, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 30, Col 3, Line 30, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 33, Col 3, Line 33, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 36, Col 3, Line 36, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 39, Col 3, Line 39, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 42, Col 3, Line 42, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 45, Col 3, Line 45, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 49, Col 3, Line 49, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 56, Col 3, Line 56, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 64, Col 3, Line 64, Col 12, "This attribute is not valid for use on this language element") + (Warning 842, Line 66, Col 7, Line 66, Col 16, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsField02.fs # E_AttributeTargetIsField02.fs @@ -194,17 +195,17 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 9, Col 3, Line 9, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 12, Col 3, Line 12, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 15, Col 3, Line 15, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 18, Col 3, Line 18, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 21, Col 3, Line 21, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 24, Col 3, Line 24, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 26, Col 7, Line 26, Col 17, "This attribute is not valid for use on this language element") - (Error 842, Line 28, Col 3, Line 28, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 31, Col 3, Line 31, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 34, Col 3, Line 34, Col 13, "This attribute is not valid for use on this language element") - (Error 842, Line 39, Col 3, Line 39, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 9, Col 3, Line 9, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 12, Col 3, Line 12, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 3, Line 15, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 18, Col 3, Line 18, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 3, Line 21, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 24, Col 3, Line 24, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 26, Col 7, Line 26, Col 17, "This attribute is not valid for use on this language element") + (Warning 842, Line 28, Col 3, Line 28, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 31, Col 3, Line 31, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 34, Col 3, Line 34, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 39, Col 3, Line 39, Col 13, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsMethod03.fs # E_AttributeTargetIsMethod03.fs @@ -225,21 +226,21 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 12, Col 6, Line 12, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 15, Col 6, Line 15, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 18, Col 6, Line 18, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 20, Col 10, Line 20, Col 20, "This attribute is not valid for use on this language element") - (Error 842, Line 22, Col 6, Line 22, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 25, Col 6, Line 25, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 28, Col 6, Line 28, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 31, Col 6, Line 31, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 34, Col 6, Line 34, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 37, Col 6, Line 37, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 39, Col 10, Line 39, Col 20, "This attribute is not valid for use on this language element") - (Error 842, Line 41, Col 6, Line 41, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 44, Col 6, Line 44, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 47, Col 6, Line 47, Col 16, "This attribute is not valid for use on this language element") - (Error 842, Line 52, Col 6, Line 52, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 12, Col 6, Line 12, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 6, Line 15, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 18, Col 6, Line 18, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 20, Col 10, Line 20, Col 20, "This attribute is not valid for use on this language element") + (Warning 842, Line 22, Col 6, Line 22, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 25, Col 6, Line 25, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 28, Col 6, Line 28, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 31, Col 6, Line 31, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 34, Col 6, Line 34, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 37, Col 6, Line 37, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 39, Col 10, Line 39, Col 20, "This attribute is not valid for use on this language element") + (Warning 842, Line 41, Col 6, Line 41, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 44, Col 6, Line 44, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 47, Col 6, Line 47, Col 16, "This attribute is not valid for use on this language element") + (Warning 842, Line 52, Col 6, Line 52, Col 16, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsMethod04.fs # E_AttributeTargetIsMethod04.fs @@ -250,8 +251,8 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 10, Col 3, Line 10, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 10, Col 3, Line 10, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") ] // SOURCE=E_ConditionalAttribute.fs SCFLAGS="--test:ErrorRanges" # E_ConditionalAttribute.fs @@ -293,7 +294,7 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 12, Col 3, Line 12, Col 6, "This attribute is not valid for use on this language element") + (Warning 842, Line 12, Col 3, Line 12, Col 6, "This attribute is not valid for use on this language element") ] // SOURCE=AttributeTargetIsStruct.fs # AttributeTargetIsStruct.fs @@ -342,18 +343,18 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 13, Col 3, Line 13, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 19, Col 3, Line 19, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 22, Col 11, Line 22, Col 22, "This attribute is not valid for use on this language element") - (Error 842, Line 25, Col 3, Line 25, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 34, Col 3, Line 34, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 35, Col 3, Line 35, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 40, Col 3, Line 40, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 41, Col 3, Line 41, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 49, Col 3, Line 49, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 50, Col 3, Line 50, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 53, Col 3, Line 53, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 54, Col 3, Line 54, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 13, Col 3, Line 13, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 19, Col 3, Line 19, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 22, Col 11, Line 22, Col 22, "This attribute is not valid for use on this language element") + (Warning 842, Line 25, Col 3, Line 25, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 34, Col 3, Line 34, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 35, Col 3, Line 35, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 40, Col 3, Line 40, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 41, Col 3, Line 41, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 49, Col 3, Line 49, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 50, Col 3, Line 50, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 53, Col 3, Line 53, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 54, Col 3, Line 54, Col 18, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsClass.fs # E_AttributeTargetIsClass.fs @@ -372,9 +373,9 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 22, Col 10, Line 22, Col 22, "This attribute is not valid for use on this language element") + (Warning 842, Line 13, Col 3, Line 13, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 22, Col 10, Line 22, Col 22, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsClass01.fs # E_AttributeTargetIsClass01.fs @@ -393,8 +394,8 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 7, Col 3, Line 7, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 10, Col 10, Line 10, Col 25, "This attribute is not valid for use on this language element") + (Warning 842, Line 7, Col 3, Line 7, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 10, Col 10, Line 10, Col 25, "This attribute is not valid for use on this language element") ] // SOURCE=MarshalAsAttribute.fs # MarshalAsAttribute.fs @@ -480,7 +481,7 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsField03.fs # E_AttributeTargetIsField03.fs @@ -491,8 +492,8 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsProperty01.fs # E_AttributeTargetIsField03.fs @@ -511,8 +512,8 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 14, Col 5, Line 14, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 5, Line 14, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeTargetIsCtor01.fs # E_AttributeTargetIsCtor01.fs @@ -531,10 +532,10 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 9, Col 15, Line 9, Col 27, "This attribute is not valid for use on this language element") - (Error 842, Line 11, Col 16, Line 11, Col 28, "This attribute is not valid for use on this language element") - (Error 842, Line 14, Col 15, Line 14, Col 27, "This attribute is not valid for use on this language element") - (Error 842, Line 17, Col 16, Line 17, Col 28, "This attribute is not valid for use on this language element") + (Warning 842, Line 9, Col 15, Line 9, Col 27, "This attribute is not valid for use on this language element") + (Warning 842, Line 11, Col 16, Line 11, Col 28, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 15, Line 14, Col 27, "This attribute is not valid for use on this language element") + (Warning 842, Line 17, Col 16, Line 17, Col 28, "This attribute is not valid for use on this language element") ] // SOURCE=AttributeTargetsIsEnum01.fs # AttributeTargetsIsEnum01.fs @@ -568,10 +569,10 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 20, Col 3, Line 20, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 22, Col 3, Line 22, Col 17, "This attribute is not valid for use on this language element") + (Warning 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 20, Col 3, Line 20, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 22, Col 3, Line 22, Col 17, "This attribute is not valid for use on this language element") ] // SOURCE=AttributeTargetsIsDelegate01.fs # AttributeTargetsIsDelegate01.fs @@ -605,10 +606,10 @@ module CustomAttributes_AttributeUsage = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 19, Col 3, Line 19, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 20, Col 3, Line 20, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 22, Col 3, Line 22, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 19, Col 3, Line 19, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 20, Col 3, Line 20, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 22, Col 3, Line 22, Col 13, "This attribute is not valid for use on this language element") ] [] @@ -654,10 +655,10 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 11, Col 3, Line 11, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 14, Col 3, Line 14, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 18, Col 3, Line 18, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 11, Col 3, Line 11, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 3, Line 14, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 18, Col 3, Line 18, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 19, Col 3, Line 19, Col 15, "This attribute is not valid for use on this language element") ] // SOURCE= E_AttributeTargetIsClass02.fs # E_AttributeTargetIsClass02.fs @@ -676,18 +677,18 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 15, Col 3, Line 15, Col 18, "This attribute is not valid for use on this language element"); - (Error 842, Line 16, Col 3, Line 16, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 20, Col 3, Line 20, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 26, Col 3, Line 26, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 27, Col 3, Line 27, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 34, Col 3, Line 34, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 35, Col 3, Line 35, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 43, Col 3, Line 43, Col 18, "This attribute is not valid for use on this language element") - (Error 842, Line 44, Col 3, Line 44, Col 15, "This attribute is not valid for use on this language element") - (Error 842, Line 47, Col 3, Line 47, Col 14, "This attribute is not valid for use on this language element") - (Error 842, Line 48, Col 3, Line 48, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 3, Line 15, Col 18, "This attribute is not valid for use on this language element"); + (Warning 842, Line 16, Col 3, Line 16, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 20, Col 3, Line 20, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 21, Col 3, Line 21, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 26, Col 3, Line 26, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 27, Col 3, Line 27, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 34, Col 3, Line 34, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 35, Col 3, Line 35, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 43, Col 3, Line 43, Col 18, "This attribute is not valid for use on this language element") + (Warning 842, Line 44, Col 3, Line 44, Col 15, "This attribute is not valid for use on this language element") + (Warning 842, Line 47, Col 3, Line 47, Col 14, "This attribute is not valid for use on this language element") + (Warning 842, Line 48, Col 3, Line 48, Col 18, "This attribute is not valid for use on this language element") ] // SOURCE= CLIMutableAttribute01.fs # CLIMutableAttribute01.fs @@ -756,8 +757,8 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = (Error 934, Line 33, Col 10, Line 33, Col 11, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") (Error 934, Line 36, Col 10, Line 36, Col 11, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") (Error 934, Line 39, Col 10, Line 39, Col 13, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") - (Error 842, Line 41, Col 7, Line 41, Col 23, "This attribute is not valid for use on this language element") - (Error 842, Line 44, Col 7, Line 44, Col 23, "This attribute is not valid for use on this language element") + (Warning 842, Line 41, Col 7, Line 41, Col 23, "This attribute is not valid for use on this language element") + (Warning 842, Line 44, Col 7, Line 44, Col 23, "This attribute is not valid for use on this language element") (Error 935, Line 54, Col 10, Line 54, Col 11, "Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal") ] @@ -775,8 +776,8 @@ type InterruptibleLazy<'T> private (valueFactory: unit -> 'T) = (Error 934, Line 33, Col 10, Line 33, Col 11, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") (Error 934, Line 36, Col 10, Line 36, Col 11, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") (Error 934, Line 39, Col 10, Line 39, Col 13, "Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute") - (Error 842, Line 41, Col 7, Line 41, Col 23, "This attribute is not valid for use on this language element") - (Error 842, Line 44, Col 7, Line 44, Col 23, "This attribute is not valid for use on this language element") + (Warning 842, Line 41, Col 7, Line 41, Col 23, "This attribute is not valid for use on this language element") + (Warning 842, Line 44, Col 7, Line 44, Col 23, "This attribute is not valid for use on this language element") (Error 935, Line 54, Col 10, Line 54, Col 11, "Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs index 1e3c99dc8a5..44ee388af9d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/Basic/Basic.fs @@ -61,7 +61,7 @@ module CustomAttributes_Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 15, Col 7, Line 15, Col 17, "This attribute is not valid for use on this language element") + (Warning 842, Line 15, Col 7, Line 15, Col 17, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeApplication04.fs SCFLAGS="--test:ErrorRanges" # E_AttributeApplication04.fs @@ -71,7 +71,7 @@ module CustomAttributes_Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 14, Col 3, Line 14, Col 13, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 3, Line 14, Col 13, "This attribute is not valid for use on this language element") ] // SOURCE=E_AttributeApplication05.fs SCFLAGS="--test:ErrorRanges" # E_AttributeApplication05.fs @@ -81,7 +81,8 @@ module CustomAttributes_Basic = |> verifyCompile |> shouldFail |> withDiagnostics [ - (Error 842, Line 8, Col 7, Line 8, Col 8, "This attribute is not valid for use on this language element") + (Warning 842, Line 8, Col 7, Line 8, Col 8, "This attribute is not valid for use on this language element") + (Error 824, Line 8, Col 7, Line 8, Col 8, "Attributes are not permitted on 'let' bindings in expressions") (Warning 20, Line 8, Col 1, Line 8, Col 31, "The result of this expression has type 'int' and 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'.") ] diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/EntryPoint/EntryPoint.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/EntryPoint/EntryPoint.fs index ce51bcf6c14..38b84fb6498 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/EntryPoint/EntryPoint.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/EntryPoint/EntryPoint.fs @@ -75,7 +75,7 @@ module EntryPoint = |> compile |> shouldFail |> withDiagnostics [ - (Error 842, Line 9, Col 3, Line 9, Col 13, """This attribute is not valid for use on this language element""") + (Warning 842, Line 9, Col 3, Line 9, Col 13, """This attribute is not valid for use on this language element""") ] // SOURCE=E_twoattributesonsamefunction001.fs SCFLAGS="--test:ErrorRanges" # E_twoattributesonsamefunction001.fs diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs index c0a19c9ad3e..b59d28cbdd2 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/LetBindings/Basic/Basic.fs @@ -53,9 +53,9 @@ module LetBindings_Basic = |> shouldFail |> withDiagnostics [ (Error 683, Line 14, Col 6, Line 14, Col 27, "Attributes are not allowed within patterns") - (Error 842, Line 14, Col 8, Line 14, Col 25, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 8, Line 14, Col 25, "This attribute is not valid for use on this language element") (Error 683, Line 14, Col 42, Line 14, Col 63, "Attributes are not allowed within patterns") - (Error 842, Line 14, Col 44, Line 14, Col 61, "This attribute is not valid for use on this language element") + (Warning 842, Line 14, Col 44, Line 14, Col 61, "This attribute is not valid for use on this language element") ] // SOURCE=E_ErrorsForInlineValue.fs SCFLAGS="--test:ErrorRanges" # E_ErrorsForInlineValue.fs diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx index 369697935e3..0f27193b5a7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/E_GenericUOM01.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #ObjectOrientedTypes // Verify error when putting invalid attributes on type arguments // (We should only allow [].) -//This attribute is not valid for use on this language element +//This attribute is not valid for use on this language element open System diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs index 3b416979e43..b915fe62341 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/UnitsOfMeasure/WithOOP/WithOOP.fs @@ -48,7 +48,7 @@ module WithOOP = compilation |> getCompilation |> shouldFailWithDiagnostics [ - (Error 842, Line 8, Col 36, Line 8, Col 51, "This attribute is not valid for use on this language element") + (Warning 842, Line 8, Col 36, Line 8, Col 51, "This attribute is not valid for use on this language element") ] [] diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs index 1b68505ab1e..81ce04fc05a 100644 --- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs @@ -245,7 +245,7 @@ namespace N [] let ``Warn successfully for invalid tailcalls in type methods`` () = - """ + FSharp """ namespace N module M = @@ -261,29 +261,12 @@ namespace N printfn "M2 called" this.M1() + 2 // should warn """ - |> FSharp |> withLangVersion80 |> compile |> shouldFail - |> withResults [ - { Error = Warning 3569 - Range = { StartLine = 10 - StartColumn = 17 - EndLine = 10 - EndColumn = 26 } - Message = - "The member or function 'M2' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } - { Error = Warning 3569 - Range = { StartLine = 15 - StartColumn = 17 - EndLine = 15 - EndColumn = 26 } - Message = -#if Debug - "The member or function 'M2' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } -#else - "The member or function 'M1' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way." } -#endif + |> withDiagnostics [ + (Warning 3569, Line 10, Col 17, Line 10, Col 26, "The member or function 'M2' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way."); + (Warning 3569, Line 15, Col 17, Line 15, Col 26, "The member or function 'M1' has the 'TailCallAttribute' attribute, but is not being used in a tail recursive way.") ] [] @@ -1481,7 +1464,10 @@ namespace N |> withLangVersionPreview |> compile |> shouldFail - |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element") + |> withDiagnostics [ + (Warning 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element") + (Warning 3861, Line 7, Col 13, Line 7, Col 18, "The TailCall attribute should only be applied to recursive functions.") + ] [] let ``Error about attribute on recursive let-bound value`` () = @@ -1497,7 +1483,7 @@ namespace N |> withLangVersionPreview |> compile |> shouldFail - |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element") + |> withSingleDiagnostic (Warning 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element") [] let ``Warn about self-defined attribute`` () = // is the analysis available for users of older FSharp.Core versions diff --git a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs index 1b6d54d3577..cf870698077 100644 --- a/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/PatternMatchCompilationTests.fs @@ -41,6 +41,7 @@ match () with dumpDiagnostics checkResults |> shouldEqual [ "(3,2--3,25): Attributes are not allowed within patterns" "(3,4--3,23): This attribute is not valid for use on this language element" + "(3,17--3,22): This is not a valid constant expression or custom attribute value" ] diff --git a/tests/fsharp/Compiler/Language/StructActivePatternTests.fs b/tests/fsharp/Compiler/Language/StructActivePatternTests.fs index aac654f549c..4c2451142fa 100644 --- a/tests/fsharp/Compiler/Language/StructActivePatternTests.fs +++ b/tests/fsharp/Compiler/Language/StructActivePatternTests.fs @@ -176,7 +176,7 @@ let (|Foo|_|) x = ValueNone [] let (|Foo|_|) x = ValueNone """ - [|(FSharpDiagnosticSeverity.Error, 842, (2, 3, 2, 9), + [|(FSharpDiagnosticSeverity.Warning, 842, (2, 3, 2, 9), "This attribute is not valid for use on this language element"); (FSharpDiagnosticSeverity.Error, 3350, (3, 6, 3, 13), "Feature 'Boolean-returning and return-type-directed partial active patterns' is not available in F# 8.0. Please use language version 9.0 or greater.")|] From 9e74c0eeac1491cede0a95612d964aaea16d24f6 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 14 May 2025 10:18:40 +0200 Subject: [PATCH 089/134] Fix race in cache eviction (#18528) --- src/Compiler/Utilities/Caches.fs | 88 ++++++++++++++------------------ 1 file changed, 38 insertions(+), 50 deletions(-) diff --git a/src/Compiler/Utilities/Caches.fs b/src/Compiler/Utilities/Caches.fs index 04829d4d1f3..a3cebd93161 100644 --- a/src/Compiler/Utilities/Caches.fs +++ b/src/Compiler/Utilities/Caches.fs @@ -29,29 +29,27 @@ type CacheOptions = [] [] type CachedEntity<'Key, 'Value> = - val mutable Key: 'Key - val mutable Value: 'Value - val mutable AccessCount: int64 - val mutable Node: LinkedListNode> voption + val mutable private key: 'Key + val mutable private value: 'Value - new(key, value) = - { - Key = key - Value = value - AccessCount = 0L - Node = ValueNone - } + [] + val mutable private node: LinkedListNode> - // This is one time initialization, outside of the constructor because of circular reference. - // The contract is that each CachedEntity that the EntityPool produces, has Node assigned. - member this.WithNode() = - this.Node <- ValueSome(LinkedListNode this) - this + private new(key, value) = { key = key; value = value } + + member this.Node = this.node + member this.Key = this.key + member this.Value = this.value + + static member Create(key: 'Key, value: 'Value) = + let entity = CachedEntity(key, value) + // The contract is that each CachedEntity produced by the EntityPool always has Node referencing itself. + entity.node <- LinkedListNode(entity) + entity member this.ReUse(key, value) = - this.Key <- key - this.Value <- value - this.AccessCount <- 0L + this.key <- key + this.value <- value this override this.ToString() = $"{this.Key}" @@ -142,21 +140,15 @@ type CacheMetrics(cacheId) = // More than totalCapacity can be created, but it will hold for reuse at most totalCapacity. type EntityPool<'Key, 'Value>(totalCapacity, cacheId) = let pool = ConcurrentBag>() - let mutable created = 0 - let overCapacity = - CacheMetrics.Meter.CreateCounter("over-capacity", "count", cacheId) + let created = CacheMetrics.Meter.CreateCounter("created", "count", cacheId) member _.Acquire(key, value) = match pool.TryTake() with | true, entity -> entity.ReUse(key, value) | _ -> - if Interlocked.Increment &created > totalCapacity then - overCapacity.Add 1L - - // Associate a LinkedListNode with freshly created entity. - // This is a one time initialization. - CachedEntity(key, value).WithNode() + created.Add 1L + CachedEntity.Create(key, value) member _.Reclaim(entity: CachedEntity<'Key, 'Value>) = if pool.Count < totalCapacity then @@ -223,13 +215,10 @@ type Cache<'Key, 'Value when 'Key: not null and 'Key: equality> internal (totalC async { match! mb.Receive() with | EvictionQueueMessage.Add entity -> - - assert entity.Node.IsSome - - evictionQueue.AddLast(entity.Node.Value) + evictionQueue.AddLast(entity.Node) // Evict one immediately if necessary. - while evictionQueue.Count > capacity do + if evictionQueue.Count > capacity then let first = nonNull evictionQueue.First match store.TryRemove(first.Value.Key) with @@ -240,16 +229,13 @@ type Cache<'Key, 'Value when 'Key: not null and 'Key: equality> internal (totalC evicted.Trigger() | _ -> evictionFails.Add 1L - | EvictionQueueMessage.Update entity -> - entity.AccessCount <- entity.AccessCount + 1L - - assert entity.Node.IsSome + // Store updates are not synchronized. It is possible the entity is no longer in the queue. + | EvictionQueueMessage.Update entity when isNull entity.Node.List -> () - let node = entity.Node.Value - assert (node.List = evictionQueue) + | EvictionQueueMessage.Update entity -> // Just move this node to the end of the list. - evictionQueue.Remove(node) - evictionQueue.AddLast(node) + evictionQueue.Remove(entity.Node) + evictionQueue.AddLast(entity.Node) return! processNext () } @@ -264,10 +250,10 @@ type Cache<'Key, 'Value when 'Key: not null and 'Key: equality> internal (totalC member _.TryGetValue(key: 'Key, value: outref<'Value>) = match store.TryGetValue(key) with - | true, cachedEntity -> + | true, entity -> hits.Add 1L - evictionProcessor.Post(EvictionQueueMessage.Update cachedEntity) - value <- cachedEntity.Value + evictionProcessor.Post(EvictionQueueMessage.Update entity) + value <- entity.Value true | _ -> misses.Add 1L @@ -275,14 +261,16 @@ type Cache<'Key, 'Value when 'Key: not null and 'Key: equality> internal (totalC false member _.TryAdd(key: 'Key, value: 'Value) = - let cachedEntity = pool.Acquire(key, value) + let entity = pool.Acquire(key, value) - if store.TryAdd(key, cachedEntity) then - evictionProcessor.Post(EvictionQueueMessage.Add cachedEntity) - true + let added = store.TryAdd(key, entity) + + if added then + evictionProcessor.Post(EvictionQueueMessage.Add entity) else - pool.Reclaim(cachedEntity) - false + pool.Reclaim(entity) + + added interface IDisposable with member this.Dispose() = From 29bcaf10b50912fba7f87be28a534ac58957cbc7 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 14 May 2025 10:20:04 +0200 Subject: [PATCH 090/134] Cancellable: always catch internal cancellations (#18531) --- src/Compiler/Utilities/Cancellable.fs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Compiler/Utilities/Cancellable.fs b/src/Compiler/Utilities/Cancellable.fs index 20e220b7e9f..bae9c6f8299 100644 --- a/src/Compiler/Utilities/Cancellable.fs +++ b/src/Compiler/Utilities/Cancellable.fs @@ -73,7 +73,11 @@ module Cancellable = if ct.IsCancellationRequested then ValueOrCancelled.Cancelled(OperationCanceledException ct) else - oper ct + try + oper ct + with + | :? OperationCanceledException as e when ct.IsCancellationRequested -> ValueOrCancelled.Cancelled e + | :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> raise let fold f acc seq = Cancellable(fun ct -> @@ -101,14 +105,10 @@ module Cancellable = let! ct = Async.CancellationToken return! - Async.FromContinuations(fun (cont, econt, ccont) -> - try - match run ct c with - | ValueOrCancelled.Value v -> cont v - | ValueOrCancelled.Cancelled ce -> ccont ce - with - | :? OperationCanceledException as ce when ct.IsCancellationRequested -> ccont ce - | :? OperationCanceledException as e -> InvalidOperationException("Wrong cancellation token", e) |> econt) + Async.FromContinuations(fun (cont, _econt, ccont) -> + match run ct c with + | ValueOrCancelled.Value v -> cont v + | ValueOrCancelled.Cancelled ce -> ccont ce) } let token () = Cancellable(ValueOrCancelled.Value) From c77db373104d62b80e1f42320e9891135694686d Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 15 May 2025 15:03:32 +0200 Subject: [PATCH 091/134] VS Insertion pipeline update - main (#18548) * VS Insertion pipeline update * fs version changed --- azure-pipelines.yml | 2 +- eng/Versions.props | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 08c20d1ef4f..dae90331bba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ variables: # Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9 # Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice. - name: FSharpReleaseBranchName - value: release/dev17.14 + value: release/dev18.0 # VS Insertion branch name (NOT the same as F# branch) # Should be previous release branch or 'main' in 'main' and 'main' in release branch # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), diff --git a/eng/Versions.props b/eng/Versions.props index 2bbd93c22ac..624e01fe94c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,9 +12,9 @@ beta - 9 + 10 0 - 300 + 100 0 @@ -29,7 +29,7 @@ 43 - 9 + 10 $(FSBuildVersion) $(FSRevisionVersion) $(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion) From 1a76355d413133b7cd3a8c63cc755b9f84d68942 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 09:04:06 +0200 Subject: [PATCH 092/134] [main] Update dependencies from dotnet/arcade (#18559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/arcade build 20250513.5 Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25255.5 -> To Version 9.0.0-beta.25263.5 * Delete wrong src/arcade folder See https://github.com/dotnet/arcade-services/issues/4837 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Alexander Köplinger --- eng/Version.Details.xml | 4 +- global.json | 2 +- .../build-configuration.json | 4 - .../eng/common/PSScriptAnalyzerSettings.psd1 | 11 - src/arcade/eng/common/README.md | 28 -- src/arcade/eng/common/SetupNugetSources.ps1 | 171 -------- src/arcade/eng/common/SetupNugetSources.sh | 167 -------- src/arcade/eng/common/build.cmd | 3 - .../common/core-templates/job/onelocbuild.yml | 121 ------ .../core-templates/jobs/source-build.yml | 58 --- .../post-build/common-variables.yml | 22 - .../post-build/setup-maestro-vars.yml | 74 ---- .../steps/component-governance.yml | 16 - .../steps/enable-internal-runtimes.yml | 32 -- .../steps/enable-internal-sources.yml | 47 -- .../steps/get-federated-access-token.yml | 42 -- .../steps/publish-build-artifacts.yml | 20 - .../steps/publish-pipeline-artifacts.yml | 20 - .../core-templates/steps/retain-build.yml | 28 -- .../core-templates/steps/send-to-helix.yml | 93 ---- .../variables/pool-providers.yml | 8 - .../eng/common/cross/arm/tizen/tizen.patch | 9 - .../eng/common/cross/armel/tizen/tizen.patch | 9 - .../common/cross/riscv64/tizen/tizen.patch | 9 - .../eng/common/cross/tizen-build-rootfs.sh | 82 ---- .../eng/common/cross/x64/tizen/tizen.patch | 9 - .../eng/common/cross/x86/tizen/tizen.patch | 9 - src/arcade/eng/common/darc-init.ps1 | 47 -- src/arcade/eng/common/darc-init.sh | 82 ---- src/arcade/eng/common/dotnet-install.cmd | 2 - src/arcade/eng/common/dotnet-install.ps1 | 28 -- src/arcade/eng/common/dotnet-install.sh | 94 ---- .../common/enable-cross-org-publishing.ps1 | 13 - src/arcade/eng/common/generate-locproject.ps1 | 189 --------- src/arcade/eng/common/generate-sbom-prep.ps1 | 29 -- src/arcade/eng/common/generate-sbom-prep.sh | 39 -- src/arcade/eng/common/helixpublish.proj | 27 -- src/arcade/eng/common/init-tools-native.ps1 | 203 --------- src/arcade/eng/common/init-tools-native.sh | 238 ----------- .../eng/common/internal-feed-operations.ps1 | 132 ------ .../eng/common/internal-feed-operations.sh | 141 ------ .../eng/common/internal/Directory.Build.props | 11 - src/arcade/eng/common/internal/NuGet.config | 7 - src/arcade/eng/common/internal/Tools.csproj | 22 - .../common/loc/P22DotNetHtmlLocalization.lss | 29 -- src/arcade/eng/common/msbuild.ps1 | 28 -- src/arcade/eng/common/msbuild.sh | 58 --- .../eng/common/native/CommonLibrary.psm1 | 401 ------------------ .../eng/common/native/common-library.sh | 172 -------- src/arcade/eng/common/native/init-compiler.sh | 146 ------- .../eng/common/native/init-distro-rid.sh | 110 ----- .../eng/common/native/init-os-and-arch.sh | 85 ---- .../eng/common/native/install-cmake-test.sh | 117 ----- src/arcade/eng/common/native/install-cmake.sh | 117 ----- src/arcade/eng/common/native/install-tool.ps1 | 132 ------ .../eng/common/pipeline-logging-functions.ps1 | 260 ------------ .../eng/common/pipeline-logging-functions.sh | 206 --------- .../post-build/check-channel-consistency.ps1 | 48 --- .../common/post-build/nuget-validation.ps1 | 22 - .../common/post-build/nuget-verification.ps1 | 121 ------ .../eng/common/post-build/redact-logs.ps1 | 89 ---- .../post-build/sourcelink-validation.ps1 | 327 -------------- .../common/post-build/symbols-validation.ps1 | 337 --------------- src/arcade/eng/common/retain-build.ps1 | 45 -- src/arcade/eng/common/sdl/NuGet.config | 18 - .../eng/common/sdl/configure-sdl-tool.ps1 | 130 ------ .../eng/common/sdl/execute-all-sdl-tools.ps1 | 167 -------- .../common/sdl/extract-artifact-archives.ps1 | 63 --- .../common/sdl/extract-artifact-packages.ps1 | 82 ---- src/arcade/eng/common/sdl/init-sdl.ps1 | 55 --- src/arcade/eng/common/sdl/run-sdl.ps1 | 49 --- src/arcade/eng/common/sdl/sdl.ps1 | 38 -- .../eng/common/sdl/trim-assets-version.ps1 | 75 ---- src/arcade/eng/common/template-guidance.md | 133 ------ .../templates-official/job/onelocbuild.yml | 7 - .../job/publish-build-assets.yml | 7 - .../templates-official/job/source-build.yml | 7 - .../job/source-index-stage1.yml | 7 - .../templates-official/jobs/codeql-build.yml | 7 - .../common/templates-official/jobs/jobs.yml | 7 - .../templates-official/jobs/source-build.yml | 7 - .../post-build/common-variables.yml | 8 - .../post-build/post-build.yml | 8 - .../post-build/setup-maestro-vars.yml | 8 - .../steps/component-governance.yml | 7 - .../steps/enable-internal-runtimes.yml | 9 - .../steps/enable-internal-sources.yml | 7 - .../steps/generate-sbom.yml | 7 - .../steps/get-delegation-sas.yml | 7 - .../steps/get-federated-access-token.yml | 7 - .../templates-official/steps/publish-logs.yml | 7 - .../steps/publish-pipeline-artifacts.yml | 28 -- .../templates-official/steps/retain-build.yml | 7 - .../steps/send-to-helix.yml | 7 - .../templates-official/steps/source-build.yml | 7 - .../variables/pool-providers.yml | 45 -- .../variables/sdl-variables.yml | 7 - .../eng/common/templates/job/onelocbuild.yml | 7 - .../templates/job/publish-build-assets.yml | 7 - .../eng/common/templates/job/source-build.yml | 7 - .../templates/job/source-index-stage1.yml | 7 - .../common/templates/jobs/codeql-build.yml | 7 - src/arcade/eng/common/templates/jobs/jobs.yml | 7 - .../common/templates/jobs/source-build.yml | 7 - .../templates/post-build/common-variables.yml | 8 - .../templates/post-build/post-build.yml | 8 - .../post-build/setup-maestro-vars.yml | 8 - .../templates/steps/component-governance.yml | 7 - .../steps/enable-internal-runtimes.yml | 10 - .../steps/enable-internal-sources.yml | 7 - .../common/templates/steps/generate-sbom.yml | 7 - .../templates/steps/get-delegation-sas.yml | 7 - .../steps/get-federated-access-token.yml | 7 - .../common/templates/steps/publish-logs.yml | 7 - .../steps/publish-pipeline-artifacts.yml | 34 -- .../common/templates/steps/retain-build.yml | 7 - .../common/templates/steps/send-to-helix.yml | 7 - .../common/templates/steps/source-build.yml | 7 - .../templates/variables/pool-providers.yml | 59 --- 119 files changed, 3 insertions(+), 6523 deletions(-) delete mode 100644 src/arcade/eng/common/BuildConfiguration/build-configuration.json delete mode 100644 src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 delete mode 100644 src/arcade/eng/common/README.md delete mode 100644 src/arcade/eng/common/SetupNugetSources.ps1 delete mode 100644 src/arcade/eng/common/SetupNugetSources.sh delete mode 100644 src/arcade/eng/common/build.cmd delete mode 100644 src/arcade/eng/common/core-templates/job/onelocbuild.yml delete mode 100644 src/arcade/eng/common/core-templates/jobs/source-build.yml delete mode 100644 src/arcade/eng/common/core-templates/post-build/common-variables.yml delete mode 100644 src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/component-governance.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/retain-build.yml delete mode 100644 src/arcade/eng/common/core-templates/steps/send-to-helix.yml delete mode 100644 src/arcade/eng/common/core-templates/variables/pool-providers.yml delete mode 100644 src/arcade/eng/common/cross/arm/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/armel/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/riscv64/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/tizen-build-rootfs.sh delete mode 100644 src/arcade/eng/common/cross/x64/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/cross/x86/tizen/tizen.patch delete mode 100644 src/arcade/eng/common/darc-init.ps1 delete mode 100644 src/arcade/eng/common/darc-init.sh delete mode 100644 src/arcade/eng/common/dotnet-install.cmd delete mode 100644 src/arcade/eng/common/dotnet-install.ps1 delete mode 100644 src/arcade/eng/common/dotnet-install.sh delete mode 100644 src/arcade/eng/common/enable-cross-org-publishing.ps1 delete mode 100644 src/arcade/eng/common/generate-locproject.ps1 delete mode 100644 src/arcade/eng/common/generate-sbom-prep.ps1 delete mode 100644 src/arcade/eng/common/generate-sbom-prep.sh delete mode 100644 src/arcade/eng/common/helixpublish.proj delete mode 100644 src/arcade/eng/common/init-tools-native.ps1 delete mode 100644 src/arcade/eng/common/init-tools-native.sh delete mode 100644 src/arcade/eng/common/internal-feed-operations.ps1 delete mode 100644 src/arcade/eng/common/internal-feed-operations.sh delete mode 100644 src/arcade/eng/common/internal/Directory.Build.props delete mode 100644 src/arcade/eng/common/internal/NuGet.config delete mode 100644 src/arcade/eng/common/internal/Tools.csproj delete mode 100644 src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss delete mode 100644 src/arcade/eng/common/msbuild.ps1 delete mode 100644 src/arcade/eng/common/msbuild.sh delete mode 100644 src/arcade/eng/common/native/CommonLibrary.psm1 delete mode 100644 src/arcade/eng/common/native/common-library.sh delete mode 100644 src/arcade/eng/common/native/init-compiler.sh delete mode 100644 src/arcade/eng/common/native/init-distro-rid.sh delete mode 100644 src/arcade/eng/common/native/init-os-and-arch.sh delete mode 100644 src/arcade/eng/common/native/install-cmake-test.sh delete mode 100644 src/arcade/eng/common/native/install-cmake.sh delete mode 100644 src/arcade/eng/common/native/install-tool.ps1 delete mode 100644 src/arcade/eng/common/pipeline-logging-functions.ps1 delete mode 100644 src/arcade/eng/common/pipeline-logging-functions.sh delete mode 100644 src/arcade/eng/common/post-build/check-channel-consistency.ps1 delete mode 100644 src/arcade/eng/common/post-build/nuget-validation.ps1 delete mode 100644 src/arcade/eng/common/post-build/nuget-verification.ps1 delete mode 100644 src/arcade/eng/common/post-build/redact-logs.ps1 delete mode 100644 src/arcade/eng/common/post-build/sourcelink-validation.ps1 delete mode 100644 src/arcade/eng/common/post-build/symbols-validation.ps1 delete mode 100644 src/arcade/eng/common/retain-build.ps1 delete mode 100644 src/arcade/eng/common/sdl/NuGet.config delete mode 100644 src/arcade/eng/common/sdl/configure-sdl-tool.ps1 delete mode 100644 src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 delete mode 100644 src/arcade/eng/common/sdl/extract-artifact-archives.ps1 delete mode 100644 src/arcade/eng/common/sdl/extract-artifact-packages.ps1 delete mode 100644 src/arcade/eng/common/sdl/init-sdl.ps1 delete mode 100644 src/arcade/eng/common/sdl/run-sdl.ps1 delete mode 100644 src/arcade/eng/common/sdl/sdl.ps1 delete mode 100644 src/arcade/eng/common/sdl/trim-assets-version.ps1 delete mode 100644 src/arcade/eng/common/template-guidance.md delete mode 100644 src/arcade/eng/common/templates-official/job/onelocbuild.yml delete mode 100644 src/arcade/eng/common/templates-official/job/publish-build-assets.yml delete mode 100644 src/arcade/eng/common/templates-official/job/source-build.yml delete mode 100644 src/arcade/eng/common/templates-official/job/source-index-stage1.yml delete mode 100644 src/arcade/eng/common/templates-official/jobs/codeql-build.yml delete mode 100644 src/arcade/eng/common/templates-official/jobs/jobs.yml delete mode 100644 src/arcade/eng/common/templates-official/jobs/source-build.yml delete mode 100644 src/arcade/eng/common/templates-official/post-build/common-variables.yml delete mode 100644 src/arcade/eng/common/templates-official/post-build/post-build.yml delete mode 100644 src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/component-governance.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/generate-sbom.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/publish-logs.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/retain-build.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/send-to-helix.yml delete mode 100644 src/arcade/eng/common/templates-official/steps/source-build.yml delete mode 100644 src/arcade/eng/common/templates-official/variables/pool-providers.yml delete mode 100644 src/arcade/eng/common/templates-official/variables/sdl-variables.yml delete mode 100644 src/arcade/eng/common/templates/job/onelocbuild.yml delete mode 100644 src/arcade/eng/common/templates/job/publish-build-assets.yml delete mode 100644 src/arcade/eng/common/templates/job/source-build.yml delete mode 100644 src/arcade/eng/common/templates/job/source-index-stage1.yml delete mode 100644 src/arcade/eng/common/templates/jobs/codeql-build.yml delete mode 100644 src/arcade/eng/common/templates/jobs/jobs.yml delete mode 100644 src/arcade/eng/common/templates/jobs/source-build.yml delete mode 100644 src/arcade/eng/common/templates/post-build/common-variables.yml delete mode 100644 src/arcade/eng/common/templates/post-build/post-build.yml delete mode 100644 src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml delete mode 100644 src/arcade/eng/common/templates/steps/component-governance.yml delete mode 100644 src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml delete mode 100644 src/arcade/eng/common/templates/steps/enable-internal-sources.yml delete mode 100644 src/arcade/eng/common/templates/steps/generate-sbom.yml delete mode 100644 src/arcade/eng/common/templates/steps/get-delegation-sas.yml delete mode 100644 src/arcade/eng/common/templates/steps/get-federated-access-token.yml delete mode 100644 src/arcade/eng/common/templates/steps/publish-logs.yml delete mode 100644 src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml delete mode 100644 src/arcade/eng/common/templates/steps/retain-build.yml delete mode 100644 src/arcade/eng/common/templates/steps/send-to-helix.yml delete mode 100644 src/arcade/eng/common/templates/steps/source-build.yml delete mode 100644 src/arcade/eng/common/templates/variables/pool-providers.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 08868123018..e49b408685d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -31,9 +31,9 @@ - + https://github.com/dotnet/arcade - 1cfa39f82d00b3659a3d367bc344241946e10681 + 93823d49ca01742464ad1c0b49ea940e693b1be3 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/global.json b/global.json index 809fed994d0..d599c421142 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25255.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25263.5", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/src/arcade/eng/common/BuildConfiguration/build-configuration.json b/src/arcade/eng/common/BuildConfiguration/build-configuration.json deleted file mode 100644 index 3d1cc89894c..00000000000 --- a/src/arcade/eng/common/BuildConfiguration/build-configuration.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "RetryCountLimit": 1, - "RetryByAnyError": false -} diff --git a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 b/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 deleted file mode 100644 index 4c1ea7c98ea..00000000000 --- a/src/arcade/eng/common/PSScriptAnalyzerSettings.psd1 +++ /dev/null @@ -1,11 +0,0 @@ -@{ - IncludeRules=@('PSAvoidUsingCmdletAliases', - 'PSAvoidUsingWMICmdlet', - 'PSAvoidUsingPositionalParameters', - 'PSAvoidUsingInvokeExpression', - 'PSUseDeclaredVarsMoreThanAssignments', - 'PSUseCmdletCorrectly', - 'PSStandardDSCFunctionsInResource', - 'PSUseIdenticalMandatoryParametersForDSC', - 'PSUseIdenticalParametersForDSC') -} \ No newline at end of file diff --git a/src/arcade/eng/common/README.md b/src/arcade/eng/common/README.md deleted file mode 100644 index ff49c371527..00000000000 --- a/src/arcade/eng/common/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Don't touch this folder - - uuuuuuuuuuuuuuuuuuuu - u" uuuuuuuuuuuuuuuuuu "u - u" u$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ - $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ - $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ - $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ - $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ - $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" - "u "$$$$$$$$$$$$$$$$$$$$" u" - "u """""""""""""""""" u" - """""""""""""""""""" - -!!! Changes made in this directory are subject to being overwritten by automation !!! - -The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. diff --git a/src/arcade/eng/common/SetupNugetSources.ps1 b/src/arcade/eng/common/SetupNugetSources.ps1 deleted file mode 100644 index 5db4ad71ee2..00000000000 --- a/src/arcade/eng/common/SetupNugetSources.ps1 +++ /dev/null @@ -1,171 +0,0 @@ -# This script adds internal feeds required to build commits that depend on internal package sources. For instance, -# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables -# disabled internal Maestro (darc-int*) feeds. -# -# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. -# -# See example call for this script below. -# -# - task: PowerShell@2 -# displayName: Setup Private Feeds Credentials -# condition: eq(variables['Agent.OS'], 'Windows_NT') -# inputs: -# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 -# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token -# env: -# Token: $(dn-bot-dnceng-artifact-feeds-rw) -# -# Note that the NuGetAuthenticate task should be called after SetupNugetSources. -# This ensures that: -# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) -# - The credential provider is installed. -# -# This logic is also abstracted into enable-internal-sources.yml. - -[CmdletBinding()] -param ( - [Parameter(Mandatory = $true)][string]$ConfigFile, - $Password -) - -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - -. $PSScriptRoot\tools.ps1 - -# Add source entry to PackageSources -function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { - $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") - - if ($packageSource -eq $null) - { - $packageSource = $doc.CreateElement("add") - $packageSource.SetAttribute("key", $SourceName) - $packageSource.SetAttribute("value", $SourceEndPoint) - $sources.AppendChild($packageSource) | Out-Null - } - else { - Write-Host "Package source $SourceName already present." - } - - AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd -} - -# Add a credential node for the specified source -function AddCredential($creds, $source, $username, $pwd) { - # If no cred supplied, don't do anything. - if (!$pwd) { - return; - } - - # Looks for credential configuration for the given SourceName. Create it if none is found. - $sourceElement = $creds.SelectSingleNode($Source) - if ($sourceElement -eq $null) - { - $sourceElement = $doc.CreateElement($Source) - $creds.AppendChild($sourceElement) | Out-Null - } - - # Add the node to the credential if none is found. - $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']") - if ($usernameElement -eq $null) - { - $usernameElement = $doc.CreateElement("add") - $usernameElement.SetAttribute("key", "Username") - $sourceElement.AppendChild($usernameElement) | Out-Null - } - $usernameElement.SetAttribute("value", $Username) - - # Add the to the credential if none is found. - # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs. - # -> https://github.com/NuGet/Home/issues/5526 - $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']") - if ($passwordElement -eq $null) - { - $passwordElement = $doc.CreateElement("add") - $passwordElement.SetAttribute("key", "ClearTextPassword") - $sourceElement.AppendChild($passwordElement) | Out-Null - } - - $passwordElement.SetAttribute("value", $pwd) -} - -function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { - $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") - - Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." - - ForEach ($PackageSource in $maestroPrivateSources) { - Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key - AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd - } -} - -function EnablePrivatePackageSources($DisabledPackageSources) { - $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($DisabledPackageSource in $maestroPrivateSources) { - Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" - # Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries - $DisabledPackageSources.RemoveChild($DisabledPackageSource) - } -} - -if (!(Test-Path $ConfigFile -PathType Leaf)) { - Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile" - ExitWithExitCode 1 -} - -# Load NuGet.config -$doc = New-Object System.Xml.XmlDocument -$filename = (Get-Item $ConfigFile).FullName -$doc.Load($filename) - -# Get reference to or create one if none exist already -$sources = $doc.DocumentElement.SelectSingleNode("packageSources") -if ($sources -eq $null) { - $sources = $doc.CreateElement("packageSources") - $doc.DocumentElement.AppendChild($sources) | Out-Null -} - -$creds = $null -if ($Password) { - # Looks for a node. Create it if none is found. - $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials") - if ($creds -eq $null) { - $creds = $doc.CreateElement("packageSourceCredentials") - $doc.DocumentElement.AppendChild($creds) | Out-Null - } -} - -# Check for disabledPackageSources; we'll enable any darc-int ones we find there -$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") -if ($disabledSources -ne $null) { - Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" - EnablePrivatePackageSources -DisabledPackageSources $disabledSources -} - -$userName = "dn-bot" - -# Insert credential nodes for Maestro's private feeds -InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password - -# 3.1 uses a different feed url format so it's handled differently here -$dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") -if ($dotnet31Source -ne $null) { - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password -} - -$dotnetVersions = @('5','6','7','8','9') - -foreach ($dotnetVersion in $dotnetVersions) { - $feedPrefix = "dotnet" + $dotnetVersion; - $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") - if ($dotnetSource -ne $null) { - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password - } -} - -$doc.Save($filename) diff --git a/src/arcade/eng/common/SetupNugetSources.sh b/src/arcade/eng/common/SetupNugetSources.sh deleted file mode 100644 index 4604b61b032..00000000000 --- a/src/arcade/eng/common/SetupNugetSources.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env bash - -# This script adds internal feeds required to build commits that depend on internal package sources. For instance, -# dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables -# disabled internal Maestro (darc-int*) feeds. -# -# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. -# -# See example call for this script below. -# -# - task: Bash@3 -# displayName: Setup Internal Feeds -# inputs: -# filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh -# arguments: $(Build.SourcesDirectory)/NuGet.config -# condition: ne(variables['Agent.OS'], 'Windows_NT') -# - task: NuGetAuthenticate@1 -# -# Note that the NuGetAuthenticate task should be called after SetupNugetSources. -# This ensures that: -# - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) -# - The credential provider is installed. -# -# This logic is also abstracted into enable-internal-sources.yml. - -ConfigFile=$1 -CredToken=$2 -NL='\n' -TB=' ' - -source="${BASH_SOURCE[0]}" - -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. "$scriptroot/tools.sh" - -if [ ! -f "$ConfigFile" ]; then - Write-PipelineTelemetryError -Category 'Build' "Error: Eng/common/SetupNugetSources.sh returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile" - ExitWithExitCode 1 -fi - -if [[ `uname -s` == "Darwin" ]]; then - NL=$'\\\n' - TB='' -fi - -# Ensure there is a ... section. -grep -i "" $ConfigFile -if [ "$?" != "0" ]; then - echo "Adding ... section." - ConfigNodeHeader="" - PackageSourcesTemplate="${TB}${NL}${TB}" - - sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile -fi - -# Ensure there is a ... section. -grep -i "" $ConfigFile -if [ "$?" != "0" ]; then - echo "Adding ... section." - - PackageSourcesNodeFooter="" - PackageSourceCredentialsTemplate="${TB}${NL}${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" $ConfigFile -fi - -PackageSources=() - -# Ensure dotnet3.1-internal and dotnet3.1-internal-transport are in the packageSources if the public dotnet3.1 feeds are present -grep -i "" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet3.1-internal') - - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding dotnet3.1-internal-transport to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=('dotnet3.1-internal-transport') -fi - -DotNetVersions=('5' '6' '7' '8' '9') - -for DotNetVersion in ${DotNetVersions[@]} ; do - FeedPrefix="dotnet${DotNetVersion}"; - grep -i "" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=("$FeedPrefix-internal") - - grep -i "" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding $FeedPrefix-internal-transport to the packageSources." - PackageSourcesNodeFooter="" - PackageSourceTemplate="${TB}" - - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourceTemplate${NL}$PackageSourcesNodeFooter|" $ConfigFile - fi - PackageSources+=("$FeedPrefix-internal-transport") - fi -done - -# I want things split line by line -PrevIFS=$IFS -IFS=$'\n' -PackageSources+="$IFS" -PackageSources+=$(grep -oh '"darc-int-[^"]*"' $ConfigFile | tr -d '"') -IFS=$PrevIFS - -if [ "$CredToken" ]; then - for FeedName in ${PackageSources[@]} ; do - # Check if there is no existing credential for this FeedName - grep -i "<$FeedName>" $ConfigFile - if [ "$?" != "0" ]; then - echo "Adding credentials for $FeedName." - - PackageSourceCredentialsNodeFooter="" - NewCredential="${TB}${TB}<$FeedName>${NL}${NL}${NL}" - - sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile - fi - done -fi - -# Re-enable any entries in disabledPackageSources where the feed name contains darc-int -grep -i "" $ConfigFile -if [ "$?" == "0" ]; then - DisabledDarcIntSources=() - echo "Re-enabling any disabled \"darc-int\" package sources in $ConfigFile" - DisabledDarcIntSources+=$(grep -oh '"darc-int-[^"]*" value="true"' $ConfigFile | tr -d '"') - for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do - if [[ $DisabledSourceName == darc-int* ]] - then - OldDisableValue="" - NewDisableValue="" - sed -i.bak "s|$OldDisableValue|$NewDisableValue|" $ConfigFile - echo "Neutralized disablePackageSources entry for '$DisabledSourceName'" - fi - done -fi diff --git a/src/arcade/eng/common/build.cmd b/src/arcade/eng/common/build.cmd deleted file mode 100644 index 99daf368aba..00000000000 --- a/src/arcade/eng/common/build.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" %*" -exit /b %ErrorLevel% diff --git a/src/arcade/eng/common/core-templates/job/onelocbuild.yml b/src/arcade/eng/common/core-templates/job/onelocbuild.yml deleted file mode 100644 index 00feec8ebbc..00000000000 --- a/src/arcade/eng/common/core-templates/job/onelocbuild.yml +++ /dev/null @@ -1,121 +0,0 @@ -parameters: - # Optional: dependencies of the job - dependsOn: '' - - # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool - pool: '' - - CeapexPat: $(dn-bot-ceapex-package-r) # PAT for the loc AzDO instance https://dev.azure.com/ceapex - GithubPat: $(BotAccount-dotnet-bot-repo-PAT) - - SourcesDirectory: $(Build.SourcesDirectory) - CreatePr: true - AutoCompletePr: false - ReusePr: true - UseLfLineEndings: true - UseCheckedInLocProjectJson: false - SkipLocProjectJsonGeneration: false - LanguageSet: VS_Main_Languages - LclSource: lclFilesInRepo - LclPackageId: '' - RepoType: gitHub - GitHubOrg: dotnet - MirrorRepo: '' - MirrorBranch: main - condition: '' - JobNameSuffix: '' - is1ESPipeline: '' -jobs: -- job: OneLocBuild${{ parameters.JobNameSuffix }} - - dependsOn: ${{ parameters.dependsOn }} - - displayName: OneLocBuild${{ parameters.JobNameSuffix }} - - variables: - - group: OneLocBuildVariables # Contains the CeapexPat and GithubPat - - name: _GenerateLocProjectArguments - value: -SourcesDirectory ${{ parameters.SourcesDirectory }} - -LanguageSet "${{ parameters.LanguageSet }}" - -CreateNeutralXlfs - - ${{ if eq(parameters.UseCheckedInLocProjectJson, 'true') }}: - - name: _GenerateLocProjectArguments - value: ${{ variables._GenerateLocProjectArguments }} -UseCheckedInLocProjectJson - - template: /eng/common/core-templates/variables/pool-providers.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - - ${{ if ne(parameters.pool, '') }}: - pool: ${{ parameters.pool }} - ${{ if eq(parameters.pool, '') }}: - pool: - # We don't use the collection uri here because it might vary (.visualstudio.com vs. dev.azure.com) - ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}: - name: AzurePipelines-EO - image: 1ESPT-Windows2022 - demands: Cmd - os: windows - # If it's not devdiv, it's dnceng - ${{ if ne(variables['System.TeamProject'], 'DevDiv') }}: - name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows - - steps: - - ${{ if eq(parameters.is1ESPipeline, '') }}: - - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error - - - ${{ if ne(parameters.SkipLocProjectJsonGeneration, 'true') }}: - - task: Powershell@2 - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/generate-locproject.ps1 - arguments: $(_GenerateLocProjectArguments) - displayName: Generate LocProject.json - condition: ${{ parameters.condition }} - - - task: OneLocBuild@2 - displayName: OneLocBuild - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - locProj: eng/Localize/LocProject.json - outDir: $(Build.ArtifactStagingDirectory) - lclSource: ${{ parameters.LclSource }} - lclPackageId: ${{ parameters.LclPackageId }} - isCreatePrSelected: ${{ parameters.CreatePr }} - isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }} - ${{ if eq(parameters.CreatePr, true) }}: - isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }} - ${{ if eq(parameters.RepoType, 'gitHub') }}: - isShouldReusePrSelected: ${{ parameters.ReusePr }} - packageSourceAuth: patAuth - patVariable: ${{ parameters.CeapexPat }} - ${{ if eq(parameters.RepoType, 'gitHub') }}: - repoType: ${{ parameters.RepoType }} - gitHubPatVariable: "${{ parameters.GithubPat }}" - ${{ if ne(parameters.MirrorRepo, '') }}: - isMirrorRepoSelected: true - gitHubOrganization: ${{ parameters.GitHubOrg }} - mirrorRepo: ${{ parameters.MirrorRepo }} - mirrorBranch: ${{ parameters.MirrorBranch }} - condition: ${{ parameters.condition }} - - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - args: - displayName: Publish Localization Files - pathToPublish: '$(Build.ArtifactStagingDirectory)/loc' - publishLocation: Container - artifactName: Loc - condition: ${{ parameters.condition }} - - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - args: - displayName: Publish LocProject.json - pathToPublish: '$(Build.SourcesDirectory)/eng/Localize/' - publishLocation: Container - artifactName: Loc - condition: ${{ parameters.condition }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/jobs/source-build.yml b/src/arcade/eng/common/core-templates/jobs/source-build.yml deleted file mode 100644 index a10ccfbee6d..00000000000 --- a/src/arcade/eng/common/core-templates/jobs/source-build.yml +++ /dev/null @@ -1,58 +0,0 @@ -parameters: - # This template adds arcade-powered source-build to CI. A job is created for each platform, as - # well as an optional server job that completes when all platform jobs complete. - - # The name of the "join" job for all source-build platforms. If set to empty string, the job is - # not included. Existing repo pipelines can use this job depend on all source-build jobs - # completing without maintaining a separate list of every single job ID: just depend on this one - # server job. By default, not included. Recommended name if used: 'Source_Build_Complete'. - allCompletedJobId: '' - - # See /eng/common/core-templates/job/source-build.yml - jobNamePrefix: 'Source_Build' - - # This is the default platform provided by Arcade, intended for use by a managed-only repo. - defaultManagedPlatform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' - - # Defines the platforms on which to run build jobs. One job is created for each platform, and the - # object in this array is sent to the job template as 'platform'. If no platforms are specified, - # one job runs on 'defaultManagedPlatform'. - platforms: [] - - is1ESPipeline: '' - - # If set to true and running on a non-public project, - # Internal nuget and blob storage locations will be enabled. - # This is not enabled by default because many repositories do not need internal sources - # and do not need to have the required service connections approved in the pipeline. - enableInternalSources: false - -jobs: - -- ${{ if ne(parameters.allCompletedJobId, '') }}: - - job: ${{ parameters.allCompletedJobId }} - displayName: Source-Build Complete - pool: server - dependsOn: - - ${{ each platform in parameters.platforms }}: - - ${{ parameters.jobNamePrefix }}_${{ platform.name }} - - ${{ if eq(length(parameters.platforms), 0) }}: - - ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }} - -- ${{ each platform in parameters.platforms }}: - - template: /eng/common/core-templates/job/source-build.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ platform }} - enableInternalSources: ${{ parameters.enableInternalSources }} - -- ${{ if eq(length(parameters.platforms), 0) }}: - - template: /eng/common/core-templates/job/source-build.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - jobNamePrefix: ${{ parameters.jobNamePrefix }} - platform: ${{ parameters.defaultManagedPlatform }} - enableInternalSources: ${{ parameters.enableInternalSources }} diff --git a/src/arcade/eng/common/core-templates/post-build/common-variables.yml b/src/arcade/eng/common/core-templates/post-build/common-variables.yml deleted file mode 100644 index d5627a994ae..00000000000 --- a/src/arcade/eng/common/core-templates/post-build/common-variables.yml +++ /dev/null @@ -1,22 +0,0 @@ -variables: - - group: Publish-Build-Assets - - # Whether the build is internal or not - - name: IsInternalBuild - value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} - - # Default Maestro++ API Endpoint and API Version - - name: MaestroApiEndPoint - value: "https://maestro.dot.net" - - name: MaestroApiVersion - value: "2020-02-20" - - - name: SourceLinkCLIVersion - value: 3.0.0 - - name: SymbolToolVersion - value: 1.0.1 - - name: BinlogToolVersion - value: 1.0.11 - - - name: runCodesignValidationInjection - value: false diff --git a/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml deleted file mode 100644 index f7602980dbe..00000000000 --- a/src/arcade/eng/common/core-templates/post-build/setup-maestro-vars.yml +++ /dev/null @@ -1,74 +0,0 @@ -parameters: - BARBuildId: '' - PromoteToChannelIds: '' - is1ESPipeline: '' - -steps: - - ${{ if eq(parameters.is1ESPipeline, '') }}: - - 'Illegal entry point, is1ESPipeline is not defined. Repository yaml should not directly reference templates in core-templates folder.': error - - - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: - - task: DownloadBuildArtifacts@0 - displayName: Download Release Configs - inputs: - buildType: current - artifactName: ReleaseConfigs - checkDownloadedFiles: true - - - task: AzureCLI@2 - name: setReleaseVars - displayName: Set Release Configs Vars - inputs: - azureSubscription: "Darc: Maestro Production" - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - try { - if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { - $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt - - $BarId = $Content | Select -Index 0 - $Channels = $Content | Select -Index 1 - $IsStableBuild = $Content | Select -Index 2 - - $AzureDevOpsProject = $Env:System_TeamProject - $AzureDevOpsBuildDefinitionId = $Env:System_DefinitionId - $AzureDevOpsBuildId = $Env:Build_BuildId - } - else { - . $(Build.SourcesDirectory)\eng\common\tools.ps1 - $darc = Get-Darc - $buildInfo = & $darc get-build ` - --id ${{ parameters.BARBuildId }} ` - --extended ` - --output-format json ` - --ci ` - | convertFrom-Json - - $BarId = ${{ parameters.BARBuildId }} - $Channels = $Env:PromoteToMaestroChannels -split "," - $Channels = $Channels -join "][" - $Channels = "[$Channels]" - - $IsStableBuild = $buildInfo.stable - $AzureDevOpsProject = $buildInfo.azureDevOpsProject - $AzureDevOpsBuildDefinitionId = $buildInfo.azureDevOpsBuildDefinitionId - $AzureDevOpsBuildId = $buildInfo.azureDevOpsBuildId - } - - Write-Host "##vso[task.setvariable variable=BARBuildId]$BarId" - Write-Host "##vso[task.setvariable variable=TargetChannels]$Channels" - Write-Host "##vso[task.setvariable variable=IsStableBuild]$IsStableBuild" - - Write-Host "##vso[task.setvariable variable=AzDOProjectName]$AzureDevOpsProject" - Write-Host "##vso[task.setvariable variable=AzDOPipelineId]$AzureDevOpsBuildDefinitionId" - Write-Host "##vso[task.setvariable variable=AzDOBuildId]$AzureDevOpsBuildId" - } - catch { - Write-Host $_ - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - exit 1 - } - env: - PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/src/arcade/eng/common/core-templates/steps/component-governance.yml b/src/arcade/eng/common/core-templates/steps/component-governance.yml deleted file mode 100644 index cf0649aa956..00000000000 --- a/src/arcade/eng/common/core-templates/steps/component-governance.yml +++ /dev/null @@ -1,16 +0,0 @@ -parameters: - disableComponentGovernance: false - componentGovernanceIgnoreDirectories: '' - is1ESPipeline: false - displayName: 'Component Detection' - -steps: -- ${{ if eq(parameters.disableComponentGovernance, 'true') }}: - - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" - displayName: Set skipComponentGovernanceDetection variable -- ${{ if ne(parameters.disableComponentGovernance, 'true') }}: - - task: ComponentGovernanceComponentDetection@0 - continueOnError: true - displayName: ${{ parameters.displayName }} - inputs: - ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} diff --git a/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml deleted file mode 100644 index 6bdbf62ac50..00000000000 --- a/src/arcade/eng/common/core-templates/steps/enable-internal-runtimes.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' -# variable with the base64-encoded SAS token, by default - -parameters: -- name: federatedServiceConnection - type: string - default: 'dotnetbuilds-internal-read' -- name: outputVariableName - type: string - default: 'dotnetbuilds-internal-container-read-token-base64' -- name: expiryInHours - type: number - default: 1 -- name: base64Encode - type: boolean - default: true -- name: is1ESPipeline - type: boolean - default: false - -steps: -- ${{ if ne(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/core-templates/steps/get-delegation-sas.yml - parameters: - federatedServiceConnection: ${{ parameters.federatedServiceConnection }} - outputVariableName: ${{ parameters.outputVariableName }} - expiryInHours: ${{ parameters.expiryInHours }} - base64Encode: ${{ parameters.base64Encode }} - storageAccount: dotnetbuilds - container: internal - permissions: rl - is1ESPipeline: ${{ parameters.is1ESPipeline }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml b/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml deleted file mode 100644 index 64f881bffc3..00000000000 --- a/src/arcade/eng/common/core-templates/steps/enable-internal-sources.yml +++ /dev/null @@ -1,47 +0,0 @@ -parameters: -# This is the Azure federated service connection that we log into to get an access token. -- name: nugetFederatedServiceConnection - type: string - default: 'dnceng-artifacts-feeds-read' -- name: is1ESPipeline - type: boolean - default: false -# Legacy parameters to allow for PAT usage -- name: legacyCredential - type: string - default: '' - -steps: -- ${{ if ne(variables['System.TeamProject'], 'public') }}: - - ${{ if ne(parameters.legacyCredential, '') }}: - - task: PowerShell@2 - displayName: Setup Internal Feeds - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token - env: - Token: ${{ parameters.legacyCredential }} - # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. - # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that - # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. - - ${{ else }}: - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - task: PowerShell@2 - displayName: Setup Internal Feeds - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config - - ${{ else }}: - - template: /eng/common/templates/steps/get-federated-access-token.yml - parameters: - federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} - outputVariableName: 'dnceng-artifacts-feeds-read-access-token' - - task: PowerShell@2 - displayName: Setup Internal Feeds - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) - # This is required in certain scenarios to install the ADO credential provider. - # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others - # (e.g. dotnet msbuild). - - task: NuGetAuthenticate@1 diff --git a/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml b/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml deleted file mode 100644 index 3a4d4410c48..00000000000 --- a/src/arcade/eng/common/core-templates/steps/get-federated-access-token.yml +++ /dev/null @@ -1,42 +0,0 @@ -parameters: -- name: federatedServiceConnection - type: string -- name: outputVariableName - type: string -- name: is1ESPipeline - type: boolean -- name: stepName - type: string - default: 'getFederatedAccessToken' -- name: condition - type: string - default: '' -# Resource to get a token for. Common values include: -# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps -# - 'https://storage.azure.com/' for storage -# Defaults to Azure DevOps -- name: resource - type: string - default: '499b84ac-1321-427f-aa17-267ca6975798' -- name: isStepOutputVariable - type: boolean - default: false - -steps: -- task: AzureCLI@2 - displayName: 'Getting federated access token for feeds' - name: ${{ parameters.stepName }} - ${{ if ne(parameters.condition, '') }}: - condition: ${{ parameters.condition }} - inputs: - azureSubscription: ${{ parameters.federatedServiceConnection }} - scriptType: 'pscore' - scriptLocation: 'inlineScript' - inlineScript: | - $accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to get access token for resource '${{ parameters.resource }}'" - exit 1 - } - Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml b/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml deleted file mode 100644 index f24ce346684..00000000000 --- a/src/arcade/eng/common/core-templates/steps/publish-build-artifacts.yml +++ /dev/null @@ -1,20 +0,0 @@ -parameters: -- name: is1ESPipeline - type: boolean - default: false -- name: args - type: object - default: {} -steps: -- ${{ if ne(parameters.is1ESPipeline, true) }}: - - template: /eng/common/templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - ${{ each parameter in parameters.args }}: - ${{ parameter.key }}: ${{ parameter.value }} -- ${{ else }}: - - template: /eng/common/templates-official/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - ${{ each parameter in parameters.args }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml deleted file mode 100644 index 2efec04dc2c..00000000000 --- a/src/arcade/eng/common/core-templates/steps/publish-pipeline-artifacts.yml +++ /dev/null @@ -1,20 +0,0 @@ -parameters: -- name: is1ESPipeline - type: boolean - default: false - -- name: args - type: object - default: {} - -steps: -- ${{ if ne(parameters.is1ESPipeline, true) }}: - - template: /eng/common/templates/steps/publish-pipeline-artifacts.yml - parameters: - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} -- ${{ else }}: - - template: /eng/common/templates-official/steps/publish-pipeline-artifacts.yml - parameters: - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/core-templates/steps/retain-build.yml b/src/arcade/eng/common/core-templates/steps/retain-build.yml deleted file mode 100644 index 83d97a26a01..00000000000 --- a/src/arcade/eng/common/core-templates/steps/retain-build.yml +++ /dev/null @@ -1,28 +0,0 @@ -parameters: - # Optional azure devops PAT with build execute permissions for the build's organization, - # only needed if the build that should be retained ran on a different organization than - # the pipeline where this template is executing from - Token: '' - # Optional BuildId to retain, defaults to the current running build - BuildId: '' - # Azure devops Organization URI for the build in the https://dev.azure.com/ format. - # Defaults to the organization the current pipeline is running on - AzdoOrgUri: '$(System.CollectionUri)' - # Azure devops project for the build. Defaults to the project the current pipeline is running on - AzdoProject: '$(System.TeamProject)' - -steps: - - task: powershell@2 - inputs: - targetType: 'filePath' - filePath: eng/common/retain-build.ps1 - pwsh: true - arguments: > - -AzdoOrgUri: ${{parameters.AzdoOrgUri}} - -AzdoProject ${{parameters.AzdoProject}} - -Token ${{coalesce(parameters.Token, '$env:SYSTEM_ACCESSTOKEN') }} - -BuildId ${{coalesce(parameters.BuildId, '$env:BUILD_ID')}} - displayName: Enable permanent build retention - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - BUILD_ID: $(Build.BuildId) \ No newline at end of file diff --git a/src/arcade/eng/common/core-templates/steps/send-to-helix.yml b/src/arcade/eng/common/core-templates/steps/send-to-helix.yml deleted file mode 100644 index 68fa739c4ab..00000000000 --- a/src/arcade/eng/common/core-templates/steps/send-to-helix.yml +++ /dev/null @@ -1,93 +0,0 @@ -# Please remember to update the documentation if you make changes to these parameters! -parameters: - HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ - HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' - HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number - HelixTargetQueues: '' # required -- semicolon-delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues - HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group - HelixProjectPath: 'eng/common/helixpublish.proj' # optional -- path to the project file to build relative to BUILD_SOURCESDIRECTORY - HelixProjectArguments: '' # optional -- arguments passed to the build command - HelixConfiguration: '' # optional -- additional property attached to a job - HelixPreCommands: '' # optional -- commands to run before Helix work item execution - HelixPostCommands: '' # optional -- commands to run after Helix work item execution - WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects - WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects - WorkItemTimeout: '' # optional -- a timeout in TimeSpan.Parse-ready value (e.g. 00:02:00) for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects - CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload - XUnitProjects: '' # optional -- semicolon-delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true - XUnitWorkItemTimeout: '' # optional -- the workitem timeout in seconds for all workitems created from the xUnit projects specified by XUnitProjects - XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects - XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner - XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects - IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion - DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json - DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json - WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." - IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set - HelixBaseUri: 'https://helix.dot.net/' # optional -- sets the Helix API base URI (allows targeting https://helix.int-dot.net ) - Creator: '' # optional -- if the build is external, use this to specify who is sending the job - DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO - condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() - continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false - -steps: - - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' - displayName: ${{ parameters.DisplayNamePrefix }} (Windows) - env: - BuildConfig: $(_BuildConfig) - HelixSource: ${{ parameters.HelixSource }} - HelixType: ${{ parameters.HelixType }} - HelixBuild: ${{ parameters.HelixBuild }} - HelixConfiguration: ${{ parameters.HelixConfiguration }} - HelixTargetQueues: ${{ parameters.HelixTargetQueues }} - HelixAccessToken: ${{ parameters.HelixAccessToken }} - HelixPreCommands: ${{ parameters.HelixPreCommands }} - HelixPostCommands: ${{ parameters.HelixPostCommands }} - WorkItemDirectory: ${{ parameters.WorkItemDirectory }} - WorkItemCommand: ${{ parameters.WorkItemCommand }} - WorkItemTimeout: ${{ parameters.WorkItemTimeout }} - CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} - XUnitProjects: ${{ parameters.XUnitProjects }} - XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }} - XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} - XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} - XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} - IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} - DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} - DotNetCliVersion: ${{ parameters.DotNetCliVersion }} - WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} - HelixBaseUri: ${{ parameters.HelixBaseUri }} - Creator: ${{ parameters.Creator }} - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) - continueOnError: ${{ parameters.continueOnError }} - - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/${{ parameters.HelixProjectPath }} /restore /p:TreatWarningsAsErrors=false ${{ parameters.HelixProjectArguments }} /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog - displayName: ${{ parameters.DisplayNamePrefix }} (Unix) - env: - BuildConfig: $(_BuildConfig) - HelixSource: ${{ parameters.HelixSource }} - HelixType: ${{ parameters.HelixType }} - HelixBuild: ${{ parameters.HelixBuild }} - HelixConfiguration: ${{ parameters.HelixConfiguration }} - HelixTargetQueues: ${{ parameters.HelixTargetQueues }} - HelixAccessToken: ${{ parameters.HelixAccessToken }} - HelixPreCommands: ${{ parameters.HelixPreCommands }} - HelixPostCommands: ${{ parameters.HelixPostCommands }} - WorkItemDirectory: ${{ parameters.WorkItemDirectory }} - WorkItemCommand: ${{ parameters.WorkItemCommand }} - WorkItemTimeout: ${{ parameters.WorkItemTimeout }} - CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} - XUnitProjects: ${{ parameters.XUnitProjects }} - XUnitWorkItemTimeout: ${{ parameters.XUnitWorkItemTimeout }} - XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} - XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} - XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} - IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} - DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} - DotNetCliVersion: ${{ parameters.DotNetCliVersion }} - WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} - HelixBaseUri: ${{ parameters.HelixBaseUri }} - Creator: ${{ parameters.Creator }} - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) - continueOnError: ${{ parameters.continueOnError }} diff --git a/src/arcade/eng/common/core-templates/variables/pool-providers.yml b/src/arcade/eng/common/core-templates/variables/pool-providers.yml deleted file mode 100644 index 41053d382a2..00000000000 --- a/src/arcade/eng/common/core-templates/variables/pool-providers.yml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - is1ESPipeline: false - -variables: - - ${{ if eq(parameters.is1ESPipeline, 'true') }}: - - template: /eng/common/templates-official/variables/pool-providers.yml - - ${{ else }}: - - template: /eng/common/templates/variables/pool-providers.yml \ No newline at end of file diff --git a/src/arcade/eng/common/cross/arm/tizen/tizen.patch b/src/arcade/eng/common/cross/arm/tizen/tizen.patch deleted file mode 100644 index fb12ade7250..00000000000 --- a/src/arcade/eng/common/cross/arm/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf32-littlearm) --GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-armhf.so.3 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) diff --git a/src/arcade/eng/common/cross/armel/tizen/tizen.patch b/src/arcade/eng/common/cross/armel/tizen/tizen.patch deleted file mode 100644 index ca7c7c1ff75..00000000000 --- a/src/arcade/eng/common/cross/armel/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf32-littlearm) --GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) diff --git a/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch b/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch deleted file mode 100644 index eb6d1c07470..00000000000 --- a/src/arcade/eng/common/cross/riscv64/tizen/tizen.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so ---- a/usr/lib64/libc.so 2016-12-30 23:00:08.284951863 +0900 -+++ b/usr/lib64/libc.so 2016-12-30 23:00:32.140951815 +0900 -@@ -2,4 +2,4 @@ - Use the shared library, but some functions are only in - the static library, so try that secondarily. */ - OUTPUT_FORMAT(elf64-littleriscv) --GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-riscv64-lp64d.so.1 ) ) -+GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-riscv64-lp64d.so.1 ) ) diff --git a/src/arcade/eng/common/cross/tizen-build-rootfs.sh b/src/arcade/eng/common/cross/tizen-build-rootfs.sh deleted file mode 100644 index ba31c93285f..00000000000 --- a/src/arcade/eng/common/cross/tizen-build-rootfs.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env bash -set -e - -ARCH=$1 -LINK_ARCH=$ARCH - -case "$ARCH" in - arm) - TIZEN_ARCH="armv7hl" - ;; - armel) - TIZEN_ARCH="armv7l" - LINK_ARCH="arm" - ;; - arm64) - TIZEN_ARCH="aarch64" - ;; - x86) - TIZEN_ARCH="i686" - ;; - x64) - TIZEN_ARCH="x86_64" - LINK_ARCH="x86" - ;; - riscv64) - TIZEN_ARCH="riscv64" - LINK_ARCH="riscv" - ;; - *) - echo "Unsupported architecture for tizen: $ARCH" - exit 1 -esac - -__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -__TIZEN_CROSSDIR="$__CrossDir/${ARCH}/tizen" - -if [[ -z "$ROOTFS_DIR" ]]; then - echo "ROOTFS_DIR is not defined." - exit 1; -fi - -TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp -mkdir -p $TIZEN_TMP_DIR - -# Download files -echo ">>Start downloading files" -VERBOSE=1 $__CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR $TIZEN_ARCH -echo "<>Start constructing Tizen rootfs" -TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` -cd $ROOTFS_DIR -for f in $TIZEN_RPM_FILES; do - rpm2cpio $f | cpio -idm --quiet -done -echo "<>Start configuring Tizen rootfs" -ln -sfn asm-${LINK_ARCH} ./usr/include/asm -patch -p1 < $__TIZEN_CROSSDIR/tizen.patch -if [[ "$TIZEN_ARCH" == "riscv64" ]]; then - echo "Fixing broken symlinks in $PWD" - rm ./usr/lib64/libresolv.so - ln -s ../../lib64/libresolv.so.2 ./usr/lib64/libresolv.so - rm ./usr/lib64/libpthread.so - ln -s ../../lib64/libpthread.so.0 ./usr/lib64/libpthread.so - rm ./usr/lib64/libdl.so - ln -s ../../lib64/libdl.so.2 ./usr/lib64/libdl.so - rm ./usr/lib64/libutil.so - ln -s ../../lib64/libutil.so.1 ./usr/lib64/libutil.so - rm ./usr/lib64/libm.so - ln -s ../../lib64/libm.so.6 ./usr/lib64/libm.so - rm ./usr/lib64/librt.so - ln -s ../../lib64/librt.so.1 ./usr/lib64/librt.so - rm ./lib/ld-linux-riscv64-lp64d.so.1 - ln -s ../lib64/ld-linux-riscv64-lp64d.so.1 ./lib/ld-linux-riscv64-lp64d.so.1 -fi -echo "< 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - --darcversion) - darcVersion=$2 - shift - ;; - --versionendpoint) - versionEndpoint=$2 - shift - ;; - --verbosity) - verbosity=$2 - shift - ;; - --toolpath) - toolpath=$2 - shift - ;; - *) - echo "Invalid argument: $1" - usage - exit 1 - ;; - esac - - shift -done - -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. "$scriptroot/tools.sh" - -if [ -z "$darcVersion" ]; then - darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain") -fi - -function InstallDarcCli { - local darc_cli_package_name="microsoft.dotnet.darc" - - InitializeDotNetCli true - local dotnet_root=$_InitializeDotNetCli - - if [ -z "$toolpath" ]; then - local tool_list=$($dotnet_root/dotnet tool list -g) - if [[ $tool_list = *$darc_cli_package_name* ]]; then - echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) - fi - else - local tool_list=$($dotnet_root/dotnet tool list --tool-path "$toolpath") - if [[ $tool_list = *$darc_cli_package_name* ]]; then - echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name --tool-path "$toolpath") - fi - fi - - local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" - - echo "Installing Darc CLI version $darcVersion..." - echo "You may need to restart your command shell if this is the first dotnet tool you have installed." - if [ -z "$toolpath" ]; then - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) - else - echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity --tool-path "$toolpath") - fi -} - -InstallDarcCli diff --git a/src/arcade/eng/common/dotnet-install.cmd b/src/arcade/eng/common/dotnet-install.cmd deleted file mode 100644 index b1c2642e76f..00000000000 --- a/src/arcade/eng/common/dotnet-install.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" \ No newline at end of file diff --git a/src/arcade/eng/common/dotnet-install.ps1 b/src/arcade/eng/common/dotnet-install.ps1 deleted file mode 100644 index 811f0f717f7..00000000000 --- a/src/arcade/eng/common/dotnet-install.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string] $verbosity = 'minimal', - [string] $architecture = '', - [string] $version = 'Latest', - [string] $runtime = 'dotnet', - [string] $RuntimeSourceFeed = '', - [string] $RuntimeSourceFeedKey = '' -) - -. $PSScriptRoot\tools.ps1 - -$dotnetRoot = Join-Path $RepoRoot '.dotnet' - -$installdir = $dotnetRoot -try { - if ($architecture -and $architecture.Trim() -eq 'x86') { - $installdir = Join-Path $installdir 'x86' - } - InstallDotNet $installdir $version $architecture $runtime $true -RuntimeSourceFeed $RuntimeSourceFeed -RuntimeSourceFeedKey $RuntimeSourceFeedKey -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message $_ - ExitWithExitCode 1 -} - -ExitWithExitCode 0 diff --git a/src/arcade/eng/common/dotnet-install.sh b/src/arcade/eng/common/dotnet-install.sh deleted file mode 100644 index 7b9d97e3bd4..00000000000 --- a/src/arcade/eng/common/dotnet-install.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. "$scriptroot/tools.sh" - -version='Latest' -architecture='' -runtime='dotnet' -runtimeSourceFeed='' -runtimeSourceFeedKey='' -while [[ $# > 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -version|-v) - shift - version="$1" - ;; - -architecture|-a) - shift - architecture="$1" - ;; - -runtime|-r) - shift - runtime="$1" - ;; - -runtimesourcefeed) - shift - runtimeSourceFeed="$1" - ;; - -runtimesourcefeedkey) - shift - runtimeSourceFeedKey="$1" - ;; - *) - Write-PipelineTelemetryError -Category 'Build' -Message "Invalid argument: $1" - exit 1 - ;; - esac - shift -done - -# Use uname to determine what the CPU is, see https://en.wikipedia.org/wiki/Uname#Examples -cpuname=$(uname -m) -case $cpuname in - arm64|aarch64) - buildarch=arm64 - if [ "$(getconf LONG_BIT)" -lt 64 ]; then - # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) - buildarch=arm - fi - ;; - loongarch64) - buildarch=loongarch64 - ;; - amd64|x86_64) - buildarch=x64 - ;; - armv*l) - buildarch=arm - ;; - i[3-6]86) - buildarch=x86 - ;; - riscv64) - buildarch=riscv64 - ;; - *) - echo "Unknown CPU $cpuname detected, treating it as x64" - buildarch=x64 - ;; -esac - -dotnetRoot="${repo_root}.dotnet" -if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then - dotnetRoot="$dotnetRoot/$architecture" -fi - -InstallDotNet "$dotnetRoot" $version "$architecture" $runtime true $runtimeSourceFeed $runtimeSourceFeedKey || { - local exit_code=$? - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2 - ExitWithExitCode $exit_code -} - -ExitWithExitCode 0 diff --git a/src/arcade/eng/common/enable-cross-org-publishing.ps1 b/src/arcade/eng/common/enable-cross-org-publishing.ps1 deleted file mode 100644 index da09da4f1fc..00000000000 --- a/src/arcade/eng/common/enable-cross-org-publishing.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -param( - [string] $token -) - - -. $PSScriptRoot\pipeline-logging-functions.ps1 - -# Write-PipelineSetVariable will no-op if a variable named $ci is not defined -# Since this script is only ever called in AzDO builds, just universally set it -$ci = $true - -Write-PipelineSetVariable -Name 'VSS_NUGET_ACCESSTOKEN' -Value $token -IsMultiJobVariable $false -Write-PipelineSetVariable -Name 'VSS_NUGET_URI_PREFIXES' -Value 'https://dnceng.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/dnceng/;https://devdiv.pkgs.visualstudio.com/;https://pkgs.dev.azure.com/devdiv/' -IsMultiJobVariable $false diff --git a/src/arcade/eng/common/generate-locproject.ps1 b/src/arcade/eng/common/generate-locproject.ps1 deleted file mode 100644 index 524aaa57f2b..00000000000 --- a/src/arcade/eng/common/generate-locproject.ps1 +++ /dev/null @@ -1,189 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here - [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json - [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one - [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally -) - -# Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: -# https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task - -Set-StrictMode -Version 2.0 -$ErrorActionPreference = "Stop" -. $PSScriptRoot\pipeline-logging-functions.ps1 - -$exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" -$exclusions = @{ Exclusions = @() } -if (Test-Path -Path $exclusionsFilePath) -{ - $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json -} - -Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work - -# Template files -$jsonFiles = @() -$jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern -$jsonTemplateFiles | ForEach-Object { - $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json - - $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" - $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru -} - -$jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern - -$wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them -if (-not $wxlFiles) { - $wxlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\1033\\.+\.wxl" } # pick up en files (1033 = en) specifically so we can copy them to use as the neutral xlf files - if ($wxlEnFiles) { - $wxlFiles = @() - $wxlEnFiles | ForEach-Object { - $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" - $wxlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru - } - } -} - -$macosHtmlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\.lproj\\.+\.html$" } # add installer HTML files -$macosHtmlFiles = @() -if ($macosHtmlEnFiles) { - $macosHtmlEnFiles | ForEach-Object { - $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" - $macosHtmlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru - } -} - -$xlfFiles = @() - -$allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" -$langXlfFiles = @() -if ($allXlfFiles) { - $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' - $firstLangCode = $Matches.1 - $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" -} -$langXlfFiles | ForEach-Object { - $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf - - $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" - $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru -} - -$locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles - -$locJson = @{ - Projects = @( - @{ - LanguageSet = $LanguageSet - LocItems = @( - $locFiles | ForEach-Object { - $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) - { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { - Remove-Item -Path $sourceFile - } - if ($continue) - { - if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" - } - } else { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnName" - OutputPath = $outputPath - } - } - } - } - ) - }, - @{ - LanguageSet = $LanguageSet - CloneLanguageSet = "WiX_CloneLanguages" - LssFiles = @( "wxl_loc.lss" ) - LocItems = @( - $wxlFiles | ForEach-Object { - $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - if ($continue) - { - return @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = $outputPath - } - } - } - ) - }, - @{ - LanguageSet = $LanguageSet - CloneLanguageSet = "VS_macOS_CloneLanguages" - LssFiles = @( ".\eng\common\loc\P22DotNetHtmlLocalization.lss" ) - LocItems = @( - $macosHtmlFiles | ForEach-Object { - $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" - $continue = $true - foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) { - $continue = $false - } - } - $sourceFile = ($_.FullName | Resolve-Path -Relative) - $lciFile = $sourceFile + ".lci" - if ($continue) { - $result = @{ - SourceFile = $sourceFile - CopyOption = "LangIDOnPath" - OutputPath = $outputPath - } - if (Test-Path $lciFile -PathType Leaf) { - $result["LciFile"] = $lciFile - } - return $result - } - } - ) - } - ) -} - -$json = ConvertTo-Json $locJson -Depth 5 -Write-Host "LocProject.json generated:`n`n$json`n`n" -Pop-Location - -if (!$UseCheckedInLocProjectJson) { - New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created - Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json -} -else { - New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created - Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json - - if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { - Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." - - exit 1 - } - else { - Write-Host "Generated LocProject.json and current LocProject.json are identical." - } -} diff --git a/src/arcade/eng/common/generate-sbom-prep.ps1 b/src/arcade/eng/common/generate-sbom-prep.ps1 deleted file mode 100644 index a0c7d792a76..00000000000 --- a/src/arcade/eng/common/generate-sbom-prep.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -Param( - [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed -) - -. $PSScriptRoot\pipeline-logging-functions.ps1 - -# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly -# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. -$ArtifactName = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -$SafeArtifactName = $ArtifactName -replace '["/:<>\\|?@*"() ]', '_' -$SbomGenerationDir = Join-Path $ManifestDirPath $SafeArtifactName - -Write-Host "Artifact name before : $ArtifactName" -Write-Host "Artifact name after : $SafeArtifactName" - -Write-Host "Creating dir $ManifestDirPath" - -# create directory for sbom manifest to be placed -if (!(Test-Path -path $SbomGenerationDir)) -{ - New-Item -ItemType Directory -path $SbomGenerationDir - Write-Host "Successfully created directory $SbomGenerationDir" -} -else{ - Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." -} - -Write-Host "Updating artifact name" -Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$SafeArtifactName" diff --git a/src/arcade/eng/common/generate-sbom-prep.sh b/src/arcade/eng/common/generate-sbom-prep.sh deleted file mode 100644 index b8ecca72bbf..00000000000 --- a/src/arcade/eng/common/generate-sbom-prep.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" - -# resolve $SOURCE until the file is no longer a symlink -while [[ -h $source ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -. $scriptroot/pipeline-logging-functions.sh - - -# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. -artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" -safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" -manifest_dir=$1 - -# Normally - we'd listen to the manifest path given, but 1ES templates will overwrite if this level gets uploaded directly -# with their own overwriting ours. So we create it as a sub directory of the requested manifest path. -sbom_generation_dir="$manifest_dir/$safe_artifact_name" - -if [ ! -d "$sbom_generation_dir" ] ; then - mkdir -p "$sbom_generation_dir" - echo "Sbom directory created." $sbom_generation_dir -else - Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." -fi - -echo "Artifact name before : "$artifact_name -echo "Artifact name after : "$safe_artifact_name -export ARTIFACT_NAME=$safe_artifact_name -echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" - -exit 0 diff --git a/src/arcade/eng/common/helixpublish.proj b/src/arcade/eng/common/helixpublish.proj deleted file mode 100644 index c1323bf4121..00000000000 --- a/src/arcade/eng/common/helixpublish.proj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - msbuild - - - - - %(Identity) - - - - - - $(WorkItemDirectory) - $(WorkItemCommand) - $(WorkItemTimeout) - - - - - - - - - diff --git a/src/arcade/eng/common/init-tools-native.ps1 b/src/arcade/eng/common/init-tools-native.ps1 deleted file mode 100644 index 27ccdb9ecc9..00000000000 --- a/src/arcade/eng/common/init-tools-native.ps1 +++ /dev/null @@ -1,203 +0,0 @@ -<# -.SYNOPSIS -Entry point script for installing native tools - -.DESCRIPTION -Reads $RepoRoot\global.json file to determine native assets to install -and executes installers for those tools - -.PARAMETER BaseUri -Base file directory or Url from which to acquire tool archives - -.PARAMETER InstallDirectory -Directory to install native toolset. This is a command-line override for the default -Install directory precedence order: -- InstallDirectory command-line override -- NETCOREENG_INSTALL_DIRECTORY environment variable -- (default) %USERPROFILE%/.netcoreeng/native - -.PARAMETER Clean -Switch specifying to not install anything, but cleanup native asset folders - -.PARAMETER Force -Clean and then install tools - -.PARAMETER DownloadRetries -Total number of retry attempts - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds - -.PARAMETER GlobalJsonFile -File path to global.json file - -.PARAMETER PathPromotion -Optional switch to enable either promote native tools specified in the global.json to the path (in Azure Pipelines) -or break the build if a native tool is not found on the path (on a local dev machine) - -.NOTES -#> -[CmdletBinding(PositionalBinding=$false)] -Param ( - [string] $BaseUri = 'https://netcorenativeassets.blob.core.windows.net/resource-packages/external', - [string] $InstallDirectory, - [switch] $Clean = $False, - [switch] $Force = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30, - [string] $GlobalJsonFile, - [switch] $PathPromotion -) - -if (!$GlobalJsonFile) { - $GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName 'global.json' -} - -Set-StrictMode -version 2.0 -$ErrorActionPreference='Stop' - -. $PSScriptRoot\pipeline-logging-functions.ps1 -Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') - -try { - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq 'Continue' - - $EngCommonBaseDir = Join-Path $PSScriptRoot 'native\' - $NativeBaseDir = $InstallDirectory - if (!$NativeBaseDir) { - $NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory - } - $Env:CommonLibrary_NativeInstallDir = $NativeBaseDir - $InstallBin = Join-Path $NativeBaseDir 'bin' - $InstallerPath = Join-Path $EngCommonBaseDir 'install-tool.ps1' - - # Process tools list - Write-Host "Processing $GlobalJsonFile" - If (-Not (Test-Path $GlobalJsonFile)) { - Write-Host "Unable to find '$GlobalJsonFile'" - exit 0 - } - $NativeTools = Get-Content($GlobalJsonFile) -Raw | - ConvertFrom-Json | - Select-Object -Expand 'native-tools' -ErrorAction SilentlyContinue - if ($NativeTools) { - if ($PathPromotion -eq $True) { - $ArcadeToolsDirectory = "$env:SYSTEMDRIVE\arcade-tools" - if (Test-Path $ArcadeToolsDirectory) { # if this directory exists, we should use native tools on machine - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - $InstalledTools = @{} - - if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { - if ($ToolVersion -eq "latest") { - $ToolVersion = "" - } - $ToolDirectories = (Get-ChildItem -Path "$ArcadeToolsDirectory" -Filter "$ToolName-$ToolVersion*" | Sort-Object -Descending) - if ($ToolDirectories -eq $null) { - Write-Error "Unable to find directory for $ToolName $ToolVersion; please make sure the tool is installed on this image." - exit 1 - } - $ToolDirectory = $ToolDirectories[0] - $BinPathFile = "$($ToolDirectory.FullName)\binpath.txt" - if (-not (Test-Path -Path "$BinPathFile")) { - Write-Error "Unable to find binpath.txt in '$($ToolDirectory.FullName)' ($ToolName $ToolVersion); artifact is either installed incorrectly or is not a bootstrappable tool." - exit 1 - } - $BinPath = Get-Content "$BinPathFile" - $ToolPath = Convert-Path -Path $BinPath - Write-Host "Adding $ToolName to the path ($ToolPath)..." - Write-Host "##vso[task.prependpath]$ToolPath" - $env:PATH = "$ToolPath;$env:PATH" - $InstalledTools += @{ $ToolName = $ToolDirectory.FullName } - } - } - return $InstalledTools - } else { - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - - if ((Get-Command "$ToolName" -ErrorAction SilentlyContinue) -eq $null) { - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "$ToolName not found on path. Please install $ToolName $ToolVersion before proceeding." - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message "If this is running on a build machine, the arcade-tools directory was not found, which means there's an error with the image." - } - } - exit 0 - } - } else { - $NativeTools.PSObject.Properties | ForEach-Object { - $ToolName = $_.Name - $ToolVersion = $_.Value - $LocalInstallerArguments = @{ ToolName = "$ToolName" } - $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } - $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } - $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } - $LocalInstallerArguments += @{ Version = "$ToolVersion" } - - if ($Verbose) { - $LocalInstallerArguments += @{ Verbose = $True } - } - if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { - if($Force) { - $LocalInstallerArguments += @{ Force = $True } - } - } - if ($Clean) { - $LocalInstallerArguments += @{ Clean = $True } - } - - Write-Verbose "Installing $ToolName version $ToolVersion" - Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" - & $InstallerPath @LocalInstallerArguments - if ($LASTEXITCODE -Ne "0") { - $errMsg = "$ToolName installation failed" - if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { - $showNativeToolsWarning = $true - if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { - $showNativeToolsWarning = $false - } - if ($showNativeToolsWarning) { - Write-Warning $errMsg - } - $toolInstallationFailure = $true - } else { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host $errMsg - exit 1 - } - } - } - - if ((Get-Variable 'toolInstallationFailure' -ErrorAction 'SilentlyContinue') -and $toolInstallationFailure) { - # We cannot change this to Write-PipelineTelemetryError because of https://github.com/dotnet/arcade/issues/4482 - Write-Host 'Native tools bootstrap failed' - exit 1 - } - } - } - else { - Write-Host 'No native tools defined in global.json' - exit 0 - } - - if ($Clean) { - exit 0 - } - if (Test-Path $InstallBin) { - Write-Host 'Native tools are available from ' (Convert-Path -Path $InstallBin) - Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" - return $InstallBin - } - elseif (-not ($PathPromotion)) { - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message 'Native tools install directory does not exist, installation failed' - exit 1 - } - exit 0 -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'NativeToolsBootstrap' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/init-tools-native.sh b/src/arcade/eng/common/init-tools-native.sh deleted file mode 100644 index 3e6a8d6acf2..00000000000 --- a/src/arcade/eng/common/init-tools-native.sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external' -install_directory='' -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 -global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json" -declare -a native_assets - -. $scriptroot/pipeline-logging-functions.sh -. $scriptroot/native/common-library.sh - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installdirectory) - install_directory=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --donotabortonfailure) - donotabortonfailure=true - shift 1 - ;; - --donotdisplaywarnings) - donotdisplaywarnings=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --installdirectory Directory to install native toolset." - echo " This is a command-line override for the default" - echo " Install directory precedence order:" - echo " - InstallDirectory command-line override" - echo " - NETCOREENG_INSTALL_DIRECTORY environment variable" - echo " - (default) %USERPROFILE%/.netcoreeng/native" - echo "" - echo " --clean Switch specifying not to install anything, but cleanup native asset folders" - echo " --donotabortonfailure Switch specifiying whether to abort native tools installation on failure" - echo " --donotdisplaywarnings Switch specifiying whether to display warnings during native tools installation on failure" - echo " --force Clean and then install tools" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --baseuri Base URI for where to download native tools from" - echo " --downloadretries Number of times a download should be attempted" - echo " --retrywaittimeseconds Wait time between download attempts" - echo "" - exit 0 - ;; - esac -done - -function ReadGlobalJsonNativeTools { - # happy path: we have a proper JSON parsing tool `jq(1)` in PATH! - if command -v jq &> /dev/null; then - - # jq: read each key/value pair under "native-tools" entry and emit: - # KEY="" VALUE="" - # followed by a null byte. - # - # bash: read line with null byte delimeter and push to array (for later `eval`uation). - - while IFS= read -rd '' line; do - native_assets+=("$line") - done < <(jq -r '. | - select(has("native-tools")) | - ."native-tools" | - keys[] as $k | - @sh "KEY=\($k) VALUE=\(.[$k])\u0000"' "$global_json_file") - - return - fi - - # Warning: falling back to manually parsing JSON, which is not recommended. - - # Following routine matches the output and escaping logic of jq(1)'s @sh formatter used above. - # It has been tested with several weird strings with escaped characters in entries (key and value) - # and results were compared with the output of jq(1) in binary representation using xxd(1); - # just before the assignment to 'native_assets' array (above and below). - - # try to capture the section under "native-tools". - if [[ ! "$(cat "$global_json_file")" =~ \"native-tools\"[[:space:]\:\{]*([^\}]+) ]]; then - return - fi - - section="${BASH_REMATCH[1]}" - - parseStarted=0 - possibleEnd=0 - escaping=0 - escaped=0 - isKey=1 - - for (( i=0; i<${#section}; i++ )); do - char="${section:$i:1}" - if ! ((parseStarted)) && [[ "$char" =~ [[:space:],:] ]]; then continue; fi - - if ! ((escaping)) && [[ "$char" == "\\" ]]; then - escaping=1 - elif ((escaping)) && ! ((escaped)); then - escaped=1 - fi - - if ! ((parseStarted)) && [[ "$char" == "\"" ]]; then - parseStarted=1 - possibleEnd=0 - elif [[ "$char" == "'" ]]; then - token="$token'\\\''" - possibleEnd=0 - elif ((escaping)) || [[ "$char" != "\"" ]]; then - token="$token$char" - possibleEnd=1 - fi - - if ((possibleEnd)) && ! ((escaping)) && [[ "$char" == "\"" ]]; then - # Use printf to unescape token to match jq(1)'s @sh formatting rules. - # do not use 'token="$(printf "$token")"' syntax, as $() eats the trailing linefeed. - printf -v token "'$token'" - - if ((isKey)); then - KEY="$token" - isKey=0 - else - line="KEY=$KEY VALUE=$token" - native_assets+=("$line") - isKey=1 - fi - - # reset for next token - parseStarted=0 - token= - elif ((escaping)) && ((escaped)); then - escaping=0 - escaped=0 - fi - done -} - -native_base_dir=$install_directory -if [[ -z $install_directory ]]; then - native_base_dir=$(GetNativeInstallDirectory) -fi - -install_bin="${native_base_dir}/bin" -installed_any=false - -ReadGlobalJsonNativeTools - -if [[ ${#native_assets[@]} -eq 0 ]]; then - echo "No native tools defined in global.json" - exit 0; -else - native_installer_dir="$scriptroot/native" - for index in "${!native_assets[@]}"; do - eval "${native_assets["$index"]}" - - installer_path="$native_installer_dir/install-$KEY.sh" - installer_command="$installer_path" - installer_command+=" --baseuri $base_uri" - installer_command+=" --installpath $install_bin" - installer_command+=" --version $VALUE" - echo $installer_command - - if [[ $force = true ]]; then - installer_command+=" --force" - fi - - if [[ $clean = true ]]; then - installer_command+=" --clean" - fi - - if [[ -a $installer_path ]]; then - $installer_command - if [[ $? != 0 ]]; then - if [[ $donotabortonfailure = true ]]; then - if [[ $donotdisplaywarnings != true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - fi - else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed" - exit 1 - fi - else - $installed_any = true - fi - else - if [[ $donotabortonfailure == true ]]; then - if [[ $donotdisplaywarnings != true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" - fi - else - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Execution Failed: no install script" - exit 1 - fi - fi - done -fi - -if [[ $clean = true ]]; then - exit 0 -fi - -if [[ -d $install_bin ]]; then - echo "Native tools are available from $install_bin" - echo "##vso[task.prependpath]$install_bin" -else - if [[ $installed_any = true ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Native tools install directory does not exist, installation failed" - exit 1 - fi -fi - -exit 0 diff --git a/src/arcade/eng/common/internal-feed-operations.ps1 b/src/arcade/eng/common/internal-feed-operations.ps1 deleted file mode 100644 index 92b77347d99..00000000000 --- a/src/arcade/eng/common/internal-feed-operations.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $Operation, - [string] $AuthToken, - [string] $CommitSha, - [string] $RepoName, - [switch] $IsFeedPrivate -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -. $PSScriptRoot\tools.ps1 - -# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed -# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in -# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified -# internal builds -function SetupCredProvider { - param( - [string] $AuthToken - ) - - # Install the Cred Provider NuGet plugin - Write-Host 'Setting up Cred Provider NuGet plugin in the agent...' - Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." - - $url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1' - - Write-Host "Writing the contents of 'installcredprovider.ps1' locally..." - Invoke-WebRequest $url -OutFile installcredprovider.ps1 - - Write-Host 'Installing plugin...' - .\installcredprovider.ps1 -Force - - Write-Host "Deleting local copy of 'installcredprovider.ps1'..." - Remove-Item .\installcredprovider.ps1 - - if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) { - Write-PipelineTelemetryError -Category 'Arcade' -Message 'CredProvider plugin was not installed correctly!' - ExitWithExitCode 1 - } - else { - Write-Host 'CredProvider plugin was installed correctly!' - } - - # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable - # feeds successfully - - $nugetConfigPath = Join-Path $RepoRoot "NuGet.config" - - if (-Not (Test-Path -Path $nugetConfigPath)) { - Write-PipelineTelemetryError -Category 'Build' -Message 'NuGet.config file not found in repo root!' - ExitWithExitCode 1 - } - - $endpoints = New-Object System.Collections.ArrayList - $nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value} - - if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) { - foreach ($stableRestoreResource in $nugetConfigPackageSources) { - $trimmedResource = ([string]$stableRestoreResource).Trim() - [void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"}) - } - } - - if (($endpoints | Measure-Object).Count -gt 0) { - $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress - - # Create the environment variables the AzDo way - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{ - 'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' - 'issecret' = 'false' - } - - # We don't want sessions cached since we will be updating the endpoints quite frequently - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{ - 'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' - 'issecret' = 'false' - } - } - else - { - Write-Host 'No internal endpoints found in NuGet.config' - } -} - -#Workaround for https://github.com/microsoft/msbuild/issues/4430 -function InstallDotNetSdkAndRestoreArcade { - $dotnetTempDir = Join-Path $RepoRoot "dotnet" - $dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) - $dotnet = "$dotnetTempDir\dotnet.exe" - $restoreProjPath = "$PSScriptRoot\restore.proj" - - Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." - InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" - - '' | Out-File "$restoreProjPath" - - & $dotnet restore $restoreProjPath - - Write-Host 'Arcade SDK restored!' - - if (Test-Path -Path $restoreProjPath) { - Remove-Item $restoreProjPath - } - - if (Test-Path -Path $dotnetTempDir) { - Remove-Item $dotnetTempDir -Recurse - } -} - -try { - Push-Location $PSScriptRoot - - if ($Operation -like 'setup') { - SetupCredProvider $AuthToken - } - elseif ($Operation -like 'install-restore') { - InstallDotNetSdkAndRestoreArcade - } - else { - Write-PipelineTelemetryError -Category 'Arcade' -Message "Unknown operation '$Operation'!" - ExitWithExitCode 1 - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Arcade' -Message $_ - ExitWithExitCode 1 -} -finally { - Pop-Location -} diff --git a/src/arcade/eng/common/internal-feed-operations.sh b/src/arcade/eng/common/internal-feed-operations.sh deleted file mode 100644 index 9378223ba09..00000000000 --- a/src/arcade/eng/common/internal-feed-operations.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed -# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in -# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. -# This should ONLY be called from identified internal builds -function SetupCredProvider { - local authToken=$1 - - # Install the Cred Provider NuGet plugin - echo "Setting up Cred Provider NuGet plugin in the agent..."... - echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." - - local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" - - echo "Writing the contents of 'installcredprovider.ps1' locally..." - local installcredproviderPath="installcredprovider.sh" - if command -v curl > /dev/null; then - curl $url > "$installcredproviderPath" - else - wget -q -O "$installcredproviderPath" "$url" - fi - - echo "Installing plugin..." - . "$installcredproviderPath" - - echo "Deleting local copy of 'installcredprovider.sh'..." - rm installcredprovider.sh - - if [ ! -d "$HOME/.nuget/plugins" ]; then - Write-PipelineTelemetryError -category 'Build' 'CredProvider plugin was not installed correctly!' - ExitWithExitCode 1 - else - echo "CredProvider plugin was installed correctly!" - fi - - # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable - # feeds successfully - - local nugetConfigPath="{$repo_root}NuGet.config" - - if [ ! "$nugetConfigPath" ]; then - Write-PipelineTelemetryError -category 'Build' "NuGet.config file not found in repo's root!" - ExitWithExitCode 1 - fi - - local endpoints='[' - local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"` - local pattern="value=\"(.*)\"" - - for value in $nugetConfigPackageValues - do - if [[ $value =~ $pattern ]]; then - local endpoint="${BASH_REMATCH[1]}" - endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"}," - fi - done - - endpoints=${endpoints%?} - endpoints+=']' - - if [ ${#endpoints} -gt 2 ]; then - local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" - - echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials" - echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False" - else - echo "No internal endpoints found in NuGet.config" - fi -} - -# Workaround for https://github.com/microsoft/msbuild/issues/4430 -function InstallDotNetSdkAndRestoreArcade { - local dotnetTempDir="$repo_root/dotnet" - local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) - local restoreProjPath="$repo_root/eng/common/restore.proj" - - echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." - echo "" > "$restoreProjPath" - - InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" - - local res=`$dotnetTempDir/dotnet restore $restoreProjPath` - echo "Arcade SDK restored!" - - # Cleanup - if [ "$restoreProjPath" ]; then - rm "$restoreProjPath" - fi - - if [ "$dotnetTempDir" ]; then - rm -r $dotnetTempDir - fi -} - -source="${BASH_SOURCE[0]}" -operation='' -authToken='' -repoName='' - -while [[ $# > 0 ]]; do - opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - --operation) - operation=$2 - shift - ;; - --authtoken) - authToken=$2 - shift - ;; - *) - echo "Invalid argument: $1" - usage - exit 1 - ;; - esac - - shift -done - -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. "$scriptroot/tools.sh" - -if [ "$operation" = "setup" ]; then - SetupCredProvider $authToken -elif [ "$operation" = "install-restore" ]; then - InstallDotNetSdkAndRestoreArcade -else - echo "Unknown operation '$operation'!" -fi diff --git a/src/arcade/eng/common/internal/Directory.Build.props b/src/arcade/eng/common/internal/Directory.Build.props deleted file mode 100644 index f1d041c33da..00000000000 --- a/src/arcade/eng/common/internal/Directory.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - false - false - - - - - diff --git a/src/arcade/eng/common/internal/NuGet.config b/src/arcade/eng/common/internal/NuGet.config deleted file mode 100644 index 19d3d311b16..00000000000 --- a/src/arcade/eng/common/internal/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/arcade/eng/common/internal/Tools.csproj b/src/arcade/eng/common/internal/Tools.csproj deleted file mode 100644 index feaa6d20812..00000000000 --- a/src/arcade/eng/common/internal/Tools.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - net472 - false - false - - - - - - - - - - - - - - - diff --git a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss b/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss deleted file mode 100644 index 5d892d61939..00000000000 --- a/src/arcade/eng/common/loc/P22DotNetHtmlLocalization.lss +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.ps1 b/src/arcade/eng/common/msbuild.ps1 deleted file mode 100644 index f041e5ddd95..00000000000 --- a/src/arcade/eng/common/msbuild.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -[CmdletBinding(PositionalBinding=$false)] -Param( - [string] $verbosity = 'minimal', - [bool] $warnAsError = $true, - [bool] $nodeReuse = $true, - [switch] $ci, - [switch] $prepareMachine, - [switch] $excludePrereleaseVS, - [string] $msbuildEngine = $null, - [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs -) - -. $PSScriptRoot\tools.ps1 - -try { - if ($ci) { - $nodeReuse = $false - } - - MSBuild @extraArgs -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'Build' -Message $_ - ExitWithExitCode 1 -} - -ExitWithExitCode 0 \ No newline at end of file diff --git a/src/arcade/eng/common/msbuild.sh b/src/arcade/eng/common/msbuild.sh deleted file mode 100644 index 20d3dad5435..00000000000 --- a/src/arcade/eng/common/msbuild.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" - -# resolve $source until the file is no longer a symlink -while [[ -h "$source" ]]; do - scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - source="$(readlink "$source")" - # if $source was a relative symlink, we need to resolve it relative to the path where the - # symlink file was located - [[ $source != /* ]] && source="$scriptroot/$source" -done -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -verbosity='minimal' -warn_as_error=true -node_reuse=true -prepare_machine=false -extra_args='' - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --verbosity) - verbosity=$2 - shift 2 - ;; - --warnaserror) - warn_as_error=$2 - shift 2 - ;; - --nodereuse) - node_reuse=$2 - shift 2 - ;; - --ci) - ci=true - shift 1 - ;; - --preparemachine) - prepare_machine=true - shift 1 - ;; - *) - extra_args="$extra_args $1" - shift 1 - ;; - esac -done - -. "$scriptroot/tools.sh" - -if [[ "$ci" == true ]]; then - node_reuse=false -fi - -MSBuild $extra_args -ExitWithExitCode 0 diff --git a/src/arcade/eng/common/native/CommonLibrary.psm1 b/src/arcade/eng/common/native/CommonLibrary.psm1 deleted file mode 100644 index f71f6af6cdb..00000000000 --- a/src/arcade/eng/common/native/CommonLibrary.psm1 +++ /dev/null @@ -1,401 +0,0 @@ -<# -.SYNOPSIS -Helper module to install an archive to a directory - -.DESCRIPTION -Helper module to download and extract an archive to a specified directory - -.PARAMETER Uri -Uri of artifact to download - -.PARAMETER InstallDirectory -Directory to extract artifact contents to - -.PARAMETER Force -Force download / extraction if file or contents already exist. Default = False - -.PARAMETER DownloadRetries -Total number of retry attempts. Default = 5 - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds. Default = 30 - -.NOTES -Returns False if download or extraction fail, True otherwise -#> -function DownloadAndExtract { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Uri, - [Parameter(Mandatory=$True)] - [string] $InstallDirectory, - [switch] $Force = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30 - ) - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq "Continue" - - $TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri - - # Download native tool - $DownloadStatus = CommonLibrary\Get-File -Uri $Uri ` - -Path $TempToolPath ` - -DownloadRetries $DownloadRetries ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Force:$Force ` - -Verbose:$Verbose - - if ($DownloadStatus -Eq $False) { - Write-Error "Download failed from $Uri" - return $False - } - - # Extract native tool - $UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` - -OutputDirectory $InstallDirectory ` - -Force:$Force ` - -Verbose:$Verbose - - if ($UnzipStatus -Eq $False) { - # Retry Download one more time with Force=true - $DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri ` - -Path $TempToolPath ` - -DownloadRetries 1 ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Force:$True ` - -Verbose:$Verbose - - if ($DownloadRetryStatus -Eq $False) { - Write-Error "Last attempt of download failed as well" - return $False - } - - # Retry unzip again one more time with Force=true - $UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` - -OutputDirectory $InstallDirectory ` - -Force:$True ` - -Verbose:$Verbose - if ($UnzipRetryStatus -Eq $False) - { - Write-Error "Last attempt of unzip failed as well" - # Clean up partial zips and extracts - if (Test-Path $TempToolPath) { - Remove-Item $TempToolPath -Force - } - if (Test-Path $InstallDirectory) { - Remove-Item $InstallDirectory -Force -Recurse - } - return $False - } - } - - return $True -} - -<# -.SYNOPSIS -Download a file, retry on failure - -.DESCRIPTION -Download specified file and retry if attempt fails - -.PARAMETER Uri -Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded - -.PARAMETER Path -Path to download or copy uri file to - -.PARAMETER Force -Overwrite existing file if present. Default = False - -.PARAMETER DownloadRetries -Total number of retry attempts. Default = 5 - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds Default = 30 - -#> -function Get-File { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Uri, - [Parameter(Mandatory=$True)] - [string] $Path, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30, - [switch] $Force = $False - ) - $Attempt = 0 - - if ($Force) { - if (Test-Path $Path) { - Remove-Item $Path -Force - } - } - if (Test-Path $Path) { - Write-Host "File '$Path' already exists, skipping download" - return $True - } - - $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent - if (-Not (Test-Path $DownloadDirectory)) { - New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null - } - - $TempPath = "$Path.tmp" - if (Test-Path -IsValid -Path $Uri) { - Write-Verbose "'$Uri' is a file path, copying temporarily to '$TempPath'" - Copy-Item -Path $Uri -Destination $TempPath - Write-Verbose "Moving temporary file to '$Path'" - Move-Item -Path $TempPath -Destination $Path - return $? - } - else { - Write-Verbose "Downloading $Uri" - # Don't display the console progress UI - it's a huge perf hit - $ProgressPreference = 'SilentlyContinue' - while($Attempt -Lt $DownloadRetries) - { - try { - Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $TempPath - Write-Verbose "Downloaded to temporary location '$TempPath'" - Move-Item -Path $TempPath -Destination $Path - Write-Verbose "Moved temporary file to '$Path'" - return $True - } - catch { - $Attempt++ - if ($Attempt -Lt $DownloadRetries) { - $AttemptsLeft = $DownloadRetries - $Attempt - Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" - Start-Sleep -Seconds $RetryWaitTimeInSeconds - } - else { - Write-Error $_ - Write-Error $_.Exception - } - } - } - } - - return $False -} - -<# -.SYNOPSIS -Generate a shim for a native tool - -.DESCRIPTION -Creates a wrapper script (shim) that passes arguments forward to native tool assembly - -.PARAMETER ShimName -The name of the shim - -.PARAMETER ShimDirectory -The directory where shims are stored - -.PARAMETER ToolFilePath -Path to file that shim forwards to - -.PARAMETER Force -Replace shim if already present. Default = False - -.NOTES -Returns $True if generating shim succeeds, $False otherwise -#> -function New-ScriptShim { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $ShimName, - [Parameter(Mandatory=$True)] - [string] $ShimDirectory, - [Parameter(Mandatory=$True)] - [string] $ToolFilePath, - [Parameter(Mandatory=$True)] - [string] $BaseUri, - [switch] $Force - ) - try { - Write-Verbose "Generating '$ShimName' shim" - - if (-Not (Test-Path $ToolFilePath)){ - Write-Error "Specified tool file path '$ToolFilePath' does not exist" - return $False - } - - # WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs - # Many of the checks for installed programs expect a .exe extension for Windows tools, rather - # than a .bat or .cmd file. - # Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer - if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) { - $InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" ` - -InstallDirectory $ShimDirectory\WinShimmer ` - -Force:$Force ` - -DownloadRetries 2 ` - -RetryWaitTimeInSeconds 5 ` - -Verbose:$Verbose - } - - if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) { - Write-Host "$ShimName.exe already exists; replacing..." - Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") - } - - & "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory - return $True - } - catch { - Write-Host $_ - Write-Host $_.Exception - return $False - } -} - -<# -.SYNOPSIS -Returns the machine architecture of the host machine - -.NOTES -Returns 'x64' on 64 bit machines - Returns 'x86' on 32 bit machines -#> -function Get-MachineArchitecture { - $ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE - $ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432 - if($ProcessorArchitecture -Eq "X86") - { - if(($ProcessorArchitectureW6432 -Eq "") -Or - ($ProcessorArchitectureW6432 -Eq "X86")) { - return "x86" - } - $ProcessorArchitecture = $ProcessorArchitectureW6432 - } - if (($ProcessorArchitecture -Eq "AMD64") -Or - ($ProcessorArchitecture -Eq "IA64") -Or - ($ProcessorArchitecture -Eq "ARM64") -Or - ($ProcessorArchitecture -Eq "LOONGARCH64") -Or - ($ProcessorArchitecture -Eq "RISCV64")) { - return "x64" - } - return "x86" -} - -<# -.SYNOPSIS -Get the name of a temporary folder under the native install directory -#> -function Get-TempDirectory { - return Join-Path (Get-NativeInstallDirectory) "temp/" -} - -function Get-TempPathFilename { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $Path - ) - $TempDir = CommonLibrary\Get-TempDirectory - $TempFilename = Split-Path $Path -leaf - $TempPath = Join-Path $TempDir $TempFilename - return $TempPath -} - -<# -.SYNOPSIS -Returns the base directory to use for native tool installation - -.NOTES -Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable -is set, or otherwise returns an install directory under the %USERPROFILE% -#> -function Get-NativeInstallDirectory { - $InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY - if (!$InstallDir) { - $InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/" - } - return $InstallDir -} - -<# -.SYNOPSIS -Unzip an archive - -.DESCRIPTION -Powershell module to unzip an archive to a specified directory - -.PARAMETER ZipPath (Required) -Path to archive to unzip - -.PARAMETER OutputDirectory (Required) -Output directory for archive contents - -.PARAMETER Force -Overwrite output directory contents if they already exist - -.NOTES -- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. -- Returns True if unzip operation is successful -- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory -- Returns False if unable to extract zip archive -#> -function Expand-Zip { - [CmdletBinding(PositionalBinding=$false)] - Param ( - [Parameter(Mandatory=$True)] - [string] $ZipPath, - [Parameter(Mandatory=$True)] - [string] $OutputDirectory, - [switch] $Force - ) - - Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'" - try { - if ((Test-Path $OutputDirectory) -And (-Not $Force)) { - Write-Host "Directory '$OutputDirectory' already exists, skipping extract" - return $True - } - if (Test-Path $OutputDirectory) { - Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory" - Remove-Item $OutputDirectory -Force -Recurse - if ($? -Eq $False) { - Write-Error "Unable to remove '$OutputDirectory'" - return $False - } - } - - $TempOutputDirectory = Join-Path "$(Split-Path -Parent $OutputDirectory)" "$(Split-Path -Leaf $OutputDirectory).tmp" - if (Test-Path $TempOutputDirectory) { - Remove-Item $TempOutputDirectory -Force -Recurse - } - New-Item -Path $TempOutputDirectory -Force -ItemType "Directory" | Out-Null - - Add-Type -assembly "system.io.compression.filesystem" - [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$TempOutputDirectory") - if ($? -Eq $False) { - Write-Error "Unable to extract '$ZipPath'" - return $False - } - - Move-Item -Path $TempOutputDirectory -Destination $OutputDirectory - } - catch { - Write-Host $_ - Write-Host $_.Exception - - return $False - } - return $True -} - -export-modulemember -function DownloadAndExtract -export-modulemember -function Expand-Zip -export-modulemember -function Get-File -export-modulemember -function Get-MachineArchitecture -export-modulemember -function Get-NativeInstallDirectory -export-modulemember -function Get-TempDirectory -export-modulemember -function Get-TempPathFilename -export-modulemember -function New-ScriptShim diff --git a/src/arcade/eng/common/native/common-library.sh b/src/arcade/eng/common/native/common-library.sh deleted file mode 100644 index 080c2c283ae..00000000000 --- a/src/arcade/eng/common/native/common-library.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env bash - -function GetNativeInstallDirectory { - local install_dir - - if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then - install_dir=$HOME/.netcoreeng/native/ - else - install_dir=$NETCOREENG_INSTALL_DIRECTORY - fi - - echo $install_dir - return 0 -} - -function GetTempDirectory { - - echo $(GetNativeInstallDirectory)temp/ - return 0 -} - -function ExpandZip { - local zip_path=$1 - local output_directory=$2 - local force=${3:-false} - - echo "Extracting $zip_path to $output_directory" - if [[ -d $output_directory ]] && [[ $force = false ]]; then - echo "Directory '$output_directory' already exists, skipping extract" - return 0 - fi - - if [[ -d $output_directory ]]; then - echo "'Force flag enabled, but '$output_directory' exists. Removing directory" - rm -rf $output_directory - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to remove '$output_directory'" - return 1 - fi - fi - - echo "Creating directory: '$output_directory'" - mkdir -p $output_directory - - echo "Extracting archive" - tar -xf $zip_path -C $output_directory - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Unable to extract '$zip_path'" - return 1 - fi - - return 0 -} - -function GetCurrentOS { - local unameOut="$(uname -s)" - case $unameOut in - Linux*) echo "Linux";; - Darwin*) echo "MacOS";; - esac - return 0 -} - -function GetFile { - local uri=$1 - local path=$2 - local force=${3:-false} - local download_retries=${4:-5} - local retry_wait_time_seconds=${5:-30} - - if [[ -f $path ]]; then - if [[ $force = false ]]; then - echo "File '$path' already exists. Skipping download" - return 0 - else - rm -rf $path - fi - fi - - if [[ -f $uri ]]; then - echo "'$uri' is a file path, copying file to '$path'" - cp $uri $path - return $? - fi - - echo "Downloading $uri" - # Use curl if available, otherwise use wget - if command -v curl > /dev/null; then - curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail - else - wget -q -O "$path" "$uri" --tries="$download_retries" - fi - - return $? -} - -function GetTempPathFileName { - local path=$1 - - local temp_dir=$(GetTempDirectory) - local temp_file_name=$(basename $path) - echo $temp_dir$temp_file_name - return 0 -} - -function DownloadAndExtract { - local uri=$1 - local installDir=$2 - local force=${3:-false} - local download_retries=${4:-5} - local retry_wait_time_seconds=${5:-30} - - local temp_tool_path=$(GetTempPathFileName $uri) - - echo "downloading to: $temp_tool_path" - - # Download file - GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to download '$uri' to '$temp_tool_path'." - return 1 - fi - - # Extract File - echo "extracting from $temp_tool_path to $installDir" - ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds - if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Failed to extract '$temp_tool_path' to '$installDir'." - return 1 - fi - - return 0 -} - -function NewScriptShim { - local shimpath=$1 - local tool_file_path=$2 - local force=${3:-false} - - echo "Generating '$shimpath' shim" - if [[ -f $shimpath ]]; then - if [[ $force = false ]]; then - echo "File '$shimpath' already exists." >&2 - return 1 - else - rm -rf $shimpath - fi - fi - - if [[ ! -f $tool_file_path ]]; then - # try to see if the path is lower cased - tool_file_path="$(echo $tool_file_path | tr "[:upper:]" "[:lower:]")" - if [[ ! -f $tool_file_path ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' "Specified tool file path:'$tool_file_path' does not exist" - return 1 - fi - fi - - local shim_contents=$'#!/usr/bin/env bash\n' - shim_contents+="SHIMARGS="$'$1\n' - shim_contents+="$tool_file_path"$' $SHIMARGS\n' - - # Write shim file - echo "$shim_contents" > $shimpath - - chmod +x $shimpath - - echo "Finished generating shim '$shimpath'" - - return $? -} - diff --git a/src/arcade/eng/common/native/init-compiler.sh b/src/arcade/eng/common/native/init-compiler.sh deleted file mode 100644 index 9a0e1f2b456..00000000000 --- a/src/arcade/eng/common/native/init-compiler.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/sh -# -# This file detects the C/C++ compiler and exports it to the CC/CXX environment variables -# -# NOTE: some scripts source this file and rely on stdout being empty, make sure -# to not output *anything* here, unless it is an error message that fails the -# build. - -if [ -z "$build_arch" ] || [ -z "$compiler" ]; then - echo "Usage..." - echo "build_arch= compiler= init-compiler.sh" - echo "Specify the target architecture." - echo "Specify the name of compiler (clang or gcc)." - exit 1 -fi - -case "$compiler" in - clang*|-clang*|--clang*) - # clangx.y or clang-x.y - version="$(echo "$compiler" | tr -d '[:alpha:]-=')" - majorVersion="${version%%.*}" - - # LLVM based on v18 released in early 2024, with two releases per year - maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))" - compiler=clang - ;; - - gcc*|-gcc*|--gcc*) - # gccx.y or gcc-x.y - version="$(echo "$compiler" | tr -d '[:alpha:]-=')" - majorVersion="${version%%.*}" - - # GCC based on v14 released in early 2024, with one release per year - maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))" - compiler=gcc - ;; -esac - -cxxCompiler="$compiler++" - -# clear the existing CC and CXX from environment -CC= -CXX= -LDFLAGS= - -if [ "$compiler" = "gcc" ]; then cxxCompiler="g++"; fi - -check_version_exists() { - desired_version=-1 - - # Set up the environment to be used for building with the desired compiler. - if command -v "$compiler-$1" > /dev/null; then - desired_version="-$1" - elif command -v "$compiler$1" > /dev/null; then - desired_version="$1" - fi - - echo "$desired_version" -} - -__baseOS="$(uname)" -set_compiler_version_from_CC() { - if [ "$__baseOS" = "Darwin" ]; then - # On Darwin, the versions from -version/-dumpversion refer to Xcode - # versions, not llvm versions, so we can't rely on them. - return - fi - - version="$("$CC" -dumpversion)" - if [ -z "$version" ]; then - echo "Error: $CC -dumpversion didn't provide a version" - exit 1 - fi - - # gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments. - IFS=. read -r majorVersion _ < /dev/null; then - echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables." - exit 1 - fi - - CC="$(command -v "$compiler" 2> /dev/null)" - CXX="$(command -v "$cxxCompiler" 2> /dev/null)" - set_compiler_version_from_CC - fi - else - desired_version="$(check_version_exists "$majorVersion")" - if [ "$desired_version" = "-1" ]; then - echo "Error: Could not find specific version of $compiler: $majorVersion." - exit 1 - fi - fi - - if [ -z "$CC" ]; then - CC="$(command -v "$compiler$desired_version" 2> /dev/null)" - CXX="$(command -v "$cxxCompiler$desired_version" 2> /dev/null)" - if [ -z "$CXX" ]; then CXX="$(command -v "$cxxCompiler" 2> /dev/null)"; fi - set_compiler_version_from_CC - fi -else - if [ ! -f "$CLR_CC" ]; then - echo "Error: CLR_CC is set but path '$CLR_CC' does not exist" - exit 1 - fi - CC="$CLR_CC" - CXX="$CLR_CXX" - set_compiler_version_from_CC -fi - -if [ -z "$CC" ]; then - echo "Error: Unable to find $compiler." - exit 1 -fi - -if [ "$__baseOS" != "Darwin" ]; then - # On Darwin, we always want to use the Apple linker. - - # Only lld version >= 9 can be considered stable. lld supports s390x starting from 18.0. - if [ "$compiler" = "clang" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -ge 9 ] && { [ "$build_arch" != "s390x" ] || [ "$majorVersion" -ge 18 ]; }; then - if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then - LDFLAGS="-fuse-ld=lld" - fi - fi -fi - -SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version" 2> /dev/null)" - -export CC CXX LDFLAGS SCAN_BUILD_COMMAND diff --git a/src/arcade/eng/common/native/init-distro-rid.sh b/src/arcade/eng/common/native/init-distro-rid.sh deleted file mode 100644 index 83ea7aab0e0..00000000000 --- a/src/arcade/eng/common/native/init-distro-rid.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh - -# getNonPortableDistroRid -# -# Input: -# targetOs: (str) -# targetArch: (str) -# rootfsDir: (str) -# -# Return: -# non-portable rid -getNonPortableDistroRid() -{ - targetOs="$1" - targetArch="$2" - rootfsDir="$3" - nonPortableRid="" - - if [ "$targetOs" = "linux" ]; then - # shellcheck disable=SC1091 - if [ -e "${rootfsDir}/etc/os-release" ]; then - . "${rootfsDir}/etc/os-release" - if echo "${VERSION_ID:-}" | grep -qE '^([[:digit:]]|\.)+$'; then - nonPortableRid="${ID}.${VERSION_ID}-${targetArch}" - else - # Rolling release distros either do not set VERSION_ID, set it as blank or - # set it to non-version looking string (such as TEMPLATE_VERSION_ID on ArchLinux); - # so omit it here to be consistent with everything else. - nonPortableRid="${ID}-${targetArch}" - fi - elif [ -e "${rootfsDir}/android_platform" ]; then - # shellcheck disable=SC1091 - . "${rootfsDir}/android_platform" - nonPortableRid="$RID" - fi - fi - - if [ "$targetOs" = "freebsd" ]; then - # $rootfsDir can be empty. freebsd-version is a shell script and should always work. - __freebsd_major_version=$("$rootfsDir"/bin/freebsd-version | cut -d'.' -f1) - nonPortableRid="freebsd.$__freebsd_major_version-${targetArch}" - elif command -v getprop >/dev/null && getprop ro.product.system.model | grep -qi android; then - __android_sdk_version=$(getprop ro.build.version.sdk) - nonPortableRid="android.$__android_sdk_version-${targetArch}" - elif [ "$targetOs" = "illumos" ]; then - __uname_version=$(uname -v) - nonPortableRid="illumos-${targetArch}" - elif [ "$targetOs" = "solaris" ]; then - __uname_version=$(uname -v) - __solaris_major_version=$(echo "$__uname_version" | cut -d'.' -f1) - nonPortableRid="solaris.$__solaris_major_version-${targetArch}" - elif [ "$targetOs" = "haiku" ]; then - __uname_release="$(uname -r)" - nonPortableRid=haiku.r"$__uname_release"-"$targetArch" - fi - - echo "$nonPortableRid" | tr '[:upper:]' '[:lower:]' -} - -# initDistroRidGlobal -# -# Input: -# os: (str) -# arch: (str) -# rootfsDir?: (nullable:string) -# -# Return: -# None -# -# Notes: -# It is important to note that the function does not return anything, but it -# exports the following variables on success: -# __DistroRid : Non-portable rid of the target platform. -# __PortableTargetOS : OS-part of the portable rid that corresponds to the target platform. -initDistroRidGlobal() -{ - targetOs="$1" - targetArch="$2" - rootfsDir="" - if [ $# -ge 3 ]; then - rootfsDir="$3" - fi - - if [ -n "${rootfsDir}" ]; then - # We may have a cross build. Check for the existence of the rootfsDir - if [ ! -e "${rootfsDir}" ]; then - echo "Error: rootfsDir has been passed, but the location is not valid." - exit 1 - fi - fi - - __DistroRid=$(getNonPortableDistroRid "${targetOs}" "${targetArch}" "${rootfsDir}") - - if [ -z "${__PortableTargetOS:-}" ]; then - __PortableTargetOS="$targetOs" - - STRINGS="$(command -v strings || true)" - if [ -z "$STRINGS" ]; then - STRINGS="$(command -v llvm-strings || true)" - fi - - # Check for musl-based distros (e.g. Alpine Linux, Void Linux). - if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl || - ( [ -n "$STRINGS" ] && "$STRINGS" "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl ); then - __PortableTargetOS="linux-musl" - fi - fi - - export __DistroRid __PortableTargetOS -} diff --git a/src/arcade/eng/common/native/init-os-and-arch.sh b/src/arcade/eng/common/native/init-os-and-arch.sh deleted file mode 100644 index 38921d4338f..00000000000 --- a/src/arcade/eng/common/native/init-os-and-arch.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh - -# Use uname to determine what the OS is. -OSName=$(uname -s | tr '[:upper:]' '[:lower:]') - -if command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then - OSName="android" -fi - -case "$OSName" in -freebsd|linux|netbsd|openbsd|sunos|android|haiku) - os="$OSName" ;; -darwin) - os=osx ;; -*) - echo "Unsupported OS $OSName detected!" - exit 1 ;; -esac - -# On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html -# and `uname -p` returns processor type (e.g. i386 on amd64). -# The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. -if [ "$os" = "sunos" ]; then - if uname -o 2>&1 | grep -q illumos; then - os="illumos" - else - os="solaris" - fi - CPUName=$(isainfo -n) -else - # For the rest of the operating systems, use uname(1) to determine what the CPU is. - CPUName=$(uname -m) -fi - -case "$CPUName" in - arm64|aarch64) - arch=arm64 - if [ "$(getconf LONG_BIT)" -lt 64 ]; then - # This is 32-bit OS running on 64-bit CPU (for example Raspberry Pi OS) - arch=arm - fi - ;; - - loongarch64) - arch=loongarch64 - ;; - - riscv64) - arch=riscv64 - ;; - - amd64|x86_64) - arch=x64 - ;; - - armv7l|armv8l) - # shellcheck disable=SC1091 - if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then - arch=armel - else - arch=arm - fi - ;; - - armv6l) - arch=armv6 - ;; - - i[3-6]86) - echo "Unsupported CPU $CPUName detected, build might not succeed!" - arch=x86 - ;; - - s390x) - arch=s390x - ;; - - ppc64le) - arch=ppc64le - ;; - *) - echo "Unknown CPU $CPUName detected!" - exit 1 - ;; -esac diff --git a/src/arcade/eng/common/native/install-cmake-test.sh b/src/arcade/eng/common/native/install-cmake-test.sh deleted file mode 100644 index 8a5e7cf0db5..00000000000 --- a/src/arcade/eng/common/native/install-cmake-test.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. $scriptroot/common-library.sh - -base_uri= -install_path= -version= -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installpath) - install_path=$2 - shift 2 - ;; - --version) - version=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --baseuri Base file directory or Url wrom which to acquire tool archives" - echo " --installpath Base directory to install native tool to" - echo " --clean Don't install the tool, just clean up the current install of the tool" - echo " --force Force install of tools even if they previously exist" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --downloadretries Total number of retry attempts" - echo " --retrywaittimeseconds Wait time between retry attempts in seconds" - echo "" - exit 0 - ;; - esac -done - -tool_name="cmake-test" -tool_os=$(GetCurrentOS) -tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" -tool_arch="x86_64" -tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" -tool_install_directory="$install_path/$tool_name/$version" -tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" -shim_path="$install_path/$tool_name.sh" -uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" - -# Clean up tool and installers -if [[ $clean = true ]]; then - echo "Cleaning $tool_install_directory" - if [[ -d $tool_install_directory ]]; then - rm -rf $tool_install_directory - fi - - echo "Cleaning $shim_path" - if [[ -f $shim_path ]]; then - rm -rf $shim_path - fi - - tool_temp_path=$(GetTempPathFileName $uri) - echo "Cleaning $tool_temp_path" - if [[ -f $tool_temp_path ]]; then - rm -rf $tool_temp_path - fi - - exit 0 -fi - -# Install tool -if [[ -f $tool_file_path ]] && [[ $force = false ]]; then - echo "$tool_name ($version) already exists, skipping install" - exit 0 -fi - -DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' - exit 1 -fi - -# Generate Shim -# Always rewrite shims so that we are referencing the expected version -NewScriptShim $shim_path $tool_file_path true - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' - exit 1 -fi - -exit 0 diff --git a/src/arcade/eng/common/native/install-cmake.sh b/src/arcade/eng/common/native/install-cmake.sh deleted file mode 100644 index de496beebc5..00000000000 --- a/src/arcade/eng/common/native/install-cmake.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -source="${BASH_SOURCE[0]}" -scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" - -. $scriptroot/common-library.sh - -base_uri= -install_path= -version= -clean=false -force=false -download_retries=5 -retry_wait_time_seconds=30 - -while (($# > 0)); do - lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" - case $lowerI in - --baseuri) - base_uri=$2 - shift 2 - ;; - --installpath) - install_path=$2 - shift 2 - ;; - --version) - version=$2 - shift 2 - ;; - --clean) - clean=true - shift 1 - ;; - --force) - force=true - shift 1 - ;; - --downloadretries) - download_retries=$2 - shift 2 - ;; - --retrywaittimeseconds) - retry_wait_time_seconds=$2 - shift 2 - ;; - --help) - echo "Common settings:" - echo " --baseuri Base file directory or Url wrom which to acquire tool archives" - echo " --installpath Base directory to install native tool to" - echo " --clean Don't install the tool, just clean up the current install of the tool" - echo " --force Force install of tools even if they previously exist" - echo " --help Print help and exit" - echo "" - echo "Advanced settings:" - echo " --downloadretries Total number of retry attempts" - echo " --retrywaittimeseconds Wait time between retry attempts in seconds" - echo "" - exit 0 - ;; - esac -done - -tool_name="cmake" -tool_os=$(GetCurrentOS) -tool_folder="$(echo $tool_os | tr "[:upper:]" "[:lower:]")" -tool_arch="x86_64" -tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" -tool_install_directory="$install_path/$tool_name/$version" -tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" -shim_path="$install_path/$tool_name.sh" -uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" - -# Clean up tool and installers -if [[ $clean = true ]]; then - echo "Cleaning $tool_install_directory" - if [[ -d $tool_install_directory ]]; then - rm -rf $tool_install_directory - fi - - echo "Cleaning $shim_path" - if [[ -f $shim_path ]]; then - rm -rf $shim_path - fi - - tool_temp_path=$(GetTempPathFileName $uri) - echo "Cleaning $tool_temp_path" - if [[ -f $tool_temp_path ]]; then - rm -rf $tool_temp_path - fi - - exit 0 -fi - -# Install tool -if [[ -f $tool_file_path ]] && [[ $force = false ]]; then - echo "$tool_name ($version) already exists, skipping install" - exit 0 -fi - -DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Installation failed' - exit 1 -fi - -# Generate Shim -# Always rewrite shims so that we are referencing the expected version -NewScriptShim $shim_path $tool_file_path true - -if [[ $? != 0 ]]; then - Write-PipelineTelemetryError -category 'NativeToolsBootstrap' 'Shim generation failed' - exit 1 -fi - -exit 0 diff --git a/src/arcade/eng/common/native/install-tool.ps1 b/src/arcade/eng/common/native/install-tool.ps1 deleted file mode 100644 index 78f2d84a4e4..00000000000 --- a/src/arcade/eng/common/native/install-tool.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -<# -.SYNOPSIS -Install native tool - -.DESCRIPTION -Install cmake native tool from Azure blob storage - -.PARAMETER InstallPath -Base directory to install native tool to - -.PARAMETER BaseUri -Base file directory or Url from which to acquire tool archives - -.PARAMETER CommonLibraryDirectory -Path to folder containing common library modules - -.PARAMETER Force -Force install of tools even if they previously exist - -.PARAMETER Clean -Don't install the tool, just clean up the current install of the tool - -.PARAMETER DownloadRetries -Total number of retry attempts - -.PARAMETER RetryWaitTimeInSeconds -Wait time between retry attempts in seconds - -.NOTES -Returns 0 if install succeeds, 1 otherwise -#> -[CmdletBinding(PositionalBinding=$false)] -Param ( - [Parameter(Mandatory=$True)] - [string] $ToolName, - [Parameter(Mandatory=$True)] - [string] $InstallPath, - [Parameter(Mandatory=$True)] - [string] $BaseUri, - [Parameter(Mandatory=$True)] - [string] $Version, - [string] $CommonLibraryDirectory = $PSScriptRoot, - [switch] $Force = $False, - [switch] $Clean = $False, - [int] $DownloadRetries = 5, - [int] $RetryWaitTimeInSeconds = 30 -) - -. $PSScriptRoot\..\pipeline-logging-functions.ps1 - -# Import common library modules -Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1") - -try { - # Define verbose switch if undefined - $Verbose = $VerbosePreference -Eq "Continue" - - $Arch = CommonLibrary\Get-MachineArchitecture - $ToolOs = "win64" - if($Arch -Eq "x32") { - $ToolOs = "win32" - } - $ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch" - $ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\" - $Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip" - $ShimPath = Join-Path $InstallPath "$ToolName.exe" - - if ($Clean) { - Write-Host "Cleaning $ToolInstallDirectory" - if (Test-Path $ToolInstallDirectory) { - Remove-Item $ToolInstallDirectory -Force -Recurse - } - Write-Host "Cleaning $ShimPath" - if (Test-Path $ShimPath) { - Remove-Item $ShimPath -Force - } - $ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri - Write-Host "Cleaning $ToolTempPath" - if (Test-Path $ToolTempPath) { - Remove-Item $ToolTempPath -Force - } - exit 0 - } - - # Install tool - if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) { - Write-Verbose "$ToolName ($Version) already exists, skipping install" - } - else { - $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri ` - -InstallDirectory $ToolInstallDirectory ` - -Force:$Force ` - -DownloadRetries $DownloadRetries ` - -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` - -Verbose:$Verbose - - if ($InstallStatus -Eq $False) { - Write-PipelineTelemetryError "Installation failed" -Category "NativeToolsetBootstrapping" - exit 1 - } - } - - $ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName } - if (@($ToolFilePath).Length -Gt 1) { - Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))" - exit 1 - } elseif (@($ToolFilePath).Length -Lt 1) { - Write-Host "$ToolName was not found in $ToolInstallDirectory." - exit 1 - } - - # Generate shim - # Always rewrite shims so that we are referencing the expected version - $GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName ` - -ShimDirectory $InstallPath ` - -ToolFilePath "$ToolFilePath" ` - -BaseUri $BaseUri ` - -Force:$Force ` - -Verbose:$Verbose - - if ($GenerateShimStatus -Eq $False) { - Write-PipelineTelemetryError "Generate shim failed" -Category "NativeToolsetBootstrapping" - return 1 - } - - exit 0 -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category "NativeToolsetBootstrapping" -Message $_ - exit 1 -} diff --git a/src/arcade/eng/common/pipeline-logging-functions.ps1 b/src/arcade/eng/common/pipeline-logging-functions.ps1 deleted file mode 100644 index 8e422c561e4..00000000000 --- a/src/arcade/eng/common/pipeline-logging-functions.ps1 +++ /dev/null @@ -1,260 +0,0 @@ -# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. - -# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 - -$script:loggingCommandPrefix = '##vso[' -$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? - New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } - New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } - New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } - New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } -) -# TODO: BUG: Escape % ??? -# TODO: Add test to verify don't need to escape "=". - -# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set -function Write-PipelineTelemetryError { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Category, - [Parameter(Mandatory = $true)] - [string]$Message, - [Parameter(Mandatory = $false)] - [string]$Type = 'error', - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput, - [switch]$Force) - - $PSBoundParameters.Remove('Category') | Out-Null - - if ($Force -Or ((Test-Path variable:ci) -And $ci)) { - $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" - } - $PSBoundParameters.Remove('Message') | Out-Null - $PSBoundParameters.Add('Message', $Message) - Write-PipelineTaskError @PSBoundParameters -} - -# Specify "-Force" to force pipeline formatted output even if "$ci" is false or not set -function Write-PipelineTaskError { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Message, - [Parameter(Mandatory = $false)] - [string]$Type = 'error', - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput, - [switch]$Force - ) - - if (!$Force -And (-Not (Test-Path variable:ci) -Or !$ci)) { - if ($Type -eq 'error') { - Write-Host $Message -ForegroundColor Red - return - } - elseif ($Type -eq 'warning') { - Write-Host $Message -ForegroundColor Yellow - return - } - } - - if (($Type -ne 'error') -and ($Type -ne 'warning')) { - Write-Host $Message - return - } - $PSBoundParameters.Remove('Force') | Out-Null - if (-not $PSBoundParameters.ContainsKey('Type')) { - $PSBoundParameters.Add('Type', 'error') - } - Write-LogIssue @PSBoundParameters -} - -function Write-PipelineSetVariable { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Name, - [string]$Value, - [switch]$Secret, - [switch]$AsOutput, - [bool]$IsMultiJobVariable = $true) - - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ - 'variable' = $Name - 'isSecret' = $Secret - 'isOutput' = $IsMultiJobVariable - } -AsOutput:$AsOutput - } -} - -function Write-PipelinePrependPath { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Path, - [switch]$AsOutput) - - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput - } -} - -function Write-PipelineSetResult { - [CmdletBinding()] - param( - [ValidateSet("Succeeded", "SucceededWithIssues", "Failed", "Cancelled", "Skipped")] - [Parameter(Mandatory = $true)] - [string]$Result, - [string]$Message) - if ((Test-Path variable:ci) -And $ci) { - Write-LoggingCommand -Area 'task' -Event 'complete' -Data $Message -Properties @{ - 'result' = $Result - } - } -} - -<######################################## -# Private functions. -########################################> -function Format-LoggingCommandData { - [CmdletBinding()] - param([string]$Value, [switch]$Reverse) - - if (!$Value) { - return '' - } - - if (!$Reverse) { - foreach ($mapping in $script:loggingCommandEscapeMappings) { - $Value = $Value.Replace($mapping.Token, $mapping.Replacement) - } - } - else { - for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { - $mapping = $script:loggingCommandEscapeMappings[$i] - $Value = $Value.Replace($mapping.Replacement, $mapping.Token) - } - } - - return $Value -} - -function Format-LoggingCommand { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [string]$Area, - [Parameter(Mandatory = $true)] - [string]$Event, - [string]$Data, - [hashtable]$Properties) - - # Append the preamble. - [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder - $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) - - # Append the properties. - if ($Properties) { - $first = $true - foreach ($key in $Properties.Keys) { - [string]$value = Format-LoggingCommandData $Properties[$key] - if ($value) { - if ($first) { - $null = $sb.Append(' ') - $first = $false - } - else { - $null = $sb.Append(';') - } - - $null = $sb.Append("$key=$value") - } - } - } - - # Append the tail and output the value. - $Data = Format-LoggingCommandData $Data - $sb.Append(']').Append($Data).ToString() -} - -function Write-LoggingCommand { - [CmdletBinding(DefaultParameterSetName = 'Parameters')] - param( - [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] - [string]$Area, - [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] - [string]$Event, - [Parameter(ParameterSetName = 'Parameters')] - [string]$Data, - [Parameter(ParameterSetName = 'Parameters')] - [hashtable]$Properties, - [Parameter(Mandatory = $true, ParameterSetName = 'Object')] - $Command, - [switch]$AsOutput) - - if ($PSCmdlet.ParameterSetName -eq 'Object') { - Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput - return - } - - $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties - if ($AsOutput) { - $command - } - else { - Write-Host $command - } -} - -function Write-LogIssue { - [CmdletBinding()] - param( - [ValidateSet('warning', 'error')] - [Parameter(Mandatory = $true)] - [string]$Type, - [string]$Message, - [string]$ErrCode, - [string]$SourcePath, - [string]$LineNumber, - [string]$ColumnNumber, - [switch]$AsOutput) - - $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ - 'type' = $Type - 'code' = $ErrCode - 'sourcepath' = $SourcePath - 'linenumber' = $LineNumber - 'columnnumber' = $ColumnNumber - } - if ($AsOutput) { - return $command - } - - if ($Type -eq 'error') { - $foregroundColor = $host.PrivateData.ErrorForegroundColor - $backgroundColor = $host.PrivateData.ErrorBackgroundColor - if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { - $foregroundColor = [System.ConsoleColor]::Red - $backgroundColor = [System.ConsoleColor]::Black - } - } - else { - $foregroundColor = $host.PrivateData.WarningForegroundColor - $backgroundColor = $host.PrivateData.WarningBackgroundColor - if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { - $foregroundColor = [System.ConsoleColor]::Yellow - $backgroundColor = [System.ConsoleColor]::Black - } - } - - Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor -} diff --git a/src/arcade/eng/common/pipeline-logging-functions.sh b/src/arcade/eng/common/pipeline-logging-functions.sh deleted file mode 100644 index 6a0b2255e91..00000000000 --- a/src/arcade/eng/common/pipeline-logging-functions.sh +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env bash - -function Write-PipelineTelemetryError { - local telemetry_category='' - local force=false - local function_args=() - local message='' - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -category|-c) - telemetry_category=$2 - shift - ;; - -force|-f) - force=true - ;; - -*) - function_args+=("$1 $2") - shift - ;; - *) - message=$* - ;; - esac - shift - done - - if [[ $force != true ]] && [[ "$ci" != true ]]; then - echo "$message" >&2 - return - fi - - if [[ $force == true ]]; then - function_args+=("-force") - fi - message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message" - function_args+=("$message") - Write-PipelineTaskError ${function_args[@]} -} - -function Write-PipelineTaskError { - local message_type="error" - local sourcepath='' - local linenumber='' - local columnnumber='' - local error_code='' - local force=false - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -type|-t) - message_type=$2 - shift - ;; - -sourcepath|-s) - sourcepath=$2 - shift - ;; - -linenumber|-ln) - linenumber=$2 - shift - ;; - -columnnumber|-cn) - columnnumber=$2 - shift - ;; - -errcode|-e) - error_code=$2 - shift - ;; - -force|-f) - force=true - ;; - *) - break - ;; - esac - - shift - done - - if [[ $force != true ]] && [[ "$ci" != true ]]; then - echo "$@" >&2 - return - fi - - local message="##vso[task.logissue" - - message="$message type=$message_type" - - if [ -n "$sourcepath" ]; then - message="$message;sourcepath=$sourcepath" - fi - - if [ -n "$linenumber" ]; then - message="$message;linenumber=$linenumber" - fi - - if [ -n "$columnnumber" ]; then - message="$message;columnnumber=$columnnumber" - fi - - if [ -n "$error_code" ]; then - message="$message;code=$error_code" - fi - - message="$message]$*" - echo "$message" -} - -function Write-PipelineSetVariable { - if [[ "$ci" != true ]]; then - return - fi - - local name='' - local value='' - local secret=false - local as_output=false - local is_multi_job_variable=true - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -name|-n) - name=$2 - shift - ;; - -value|-v) - value=$2 - shift - ;; - -secret|-s) - secret=true - ;; - -as_output|-a) - as_output=true - ;; - -is_multi_job_variable|-i) - is_multi_job_variable=$2 - shift - ;; - esac - shift - done - - value=${value/;/%3B} - value=${value/\\r/%0D} - value=${value/\\n/%0A} - value=${value/]/%5D} - - local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" - - if [[ "$as_output" == true ]]; then - $message - else - echo "$message" - fi -} - -function Write-PipelinePrependPath { - local prepend_path='' - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -path|-p) - prepend_path=$2 - shift - ;; - esac - shift - done - - export PATH="$prepend_path:$PATH" - - if [[ "$ci" == true ]]; then - echo "##vso[task.prependpath]$prepend_path" - fi -} - -function Write-PipelineSetResult { - local result='' - local message='' - - while [[ $# -gt 0 ]]; do - opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" - case "$opt" in - -result|-r) - result=$2 - shift - ;; - -message|-m) - message=$2 - shift - ;; - esac - shift - done - - if [[ "$ci" == true ]]; then - echo "##vso[task.complete result=$result;]$message" - fi -} diff --git a/src/arcade/eng/common/post-build/check-channel-consistency.ps1 b/src/arcade/eng/common/post-build/check-channel-consistency.ps1 deleted file mode 100644 index 61208d2d135..00000000000 --- a/src/arcade/eng/common/post-build/check-channel-consistency.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $PromoteToChannels, # List of channels that the build should be promoted to - [Parameter(Mandatory=$true)][array] $AvailableChannelIds # List of channel IDs available in the YAML implementation -) - -try { - $ErrorActionPreference = 'Stop' - Set-StrictMode -Version 2.0 - - # `tools.ps1` checks $ci to perform some actions. Since the post-build - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - $disableConfigureToolsetImport = $true - . $PSScriptRoot\..\tools.ps1 - - if ($PromoteToChannels -eq "") { - Write-PipelineTaskError -Type 'warning' -Message "This build won't publish assets as it's not configured to any Maestro channel. If that wasn't intended use Darc to configure a default channel using add-default-channel for this branch or to promote it to a channel using add-build-to-channel. See https://github.com/dotnet/arcade/blob/main/Documentation/Darc.md#assigning-an-individual-build-to-a-channel for more info." - ExitWithExitCode 0 - } - - # Check that every channel that Maestro told to promote the build to - # is available in YAML - $PromoteToChannelsIds = $PromoteToChannels -split "\D" | Where-Object { $_ } - - $hasErrors = $false - - foreach ($id in $PromoteToChannelsIds) { - if (($id -ne 0) -and ($id -notin $AvailableChannelIds)) { - Write-PipelineTaskError -Message "Channel $id is not present in the post-build YAML configuration! This is an error scenario. Please contact @dnceng." - $hasErrors = $true - } - } - - # The `Write-PipelineTaskError` doesn't error the script and we might report several errors - # in the previous lines. The check below makes sure that we return an error state from the - # script if we reported any validation error - if ($hasErrors) { - ExitWithExitCode 1 - } - - Write-Host 'done.' -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Category 'CheckChannelConsistency' -Message "There was an error while trying to check consistency of Maestro default channels for the build and post-build YAML configuration." - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/post-build/nuget-validation.ps1 b/src/arcade/eng/common/post-build/nuget-validation.ps1 deleted file mode 100644 index e5de00c8983..00000000000 --- a/src/arcade/eng/common/post-build/nuget-validation.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -# This script validates NuGet package metadata information using this -# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage - -param( - [Parameter(Mandatory=$true)][string] $PackagesPath # Path to where the packages to be validated are -) - -# `tools.ps1` checks $ci to perform some actions. Since the post-build -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -$disableConfigureToolsetImport = $true -. $PSScriptRoot\..\tools.ps1 - -try { - & $PSScriptRoot\nuget-verification.ps1 ${PackagesPath}\*.nupkg -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'NuGetValidation' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/post-build/nuget-verification.ps1 b/src/arcade/eng/common/post-build/nuget-verification.ps1 deleted file mode 100644 index a365194a938..00000000000 --- a/src/arcade/eng/common/post-build/nuget-verification.ps1 +++ /dev/null @@ -1,121 +0,0 @@ -<# -.SYNOPSIS - Verifies that Microsoft NuGet packages have proper metadata. -.DESCRIPTION - Downloads a verification tool and runs metadata validation on the provided NuGet packages. This script writes an - error if any of the provided packages fail validation. All arguments provided to this PowerShell script that do not - match PowerShell parameters are passed on to the verification tool downloaded during the execution of this script. -.PARAMETER NuGetExePath - The path to the nuget.exe binary to use. If not provided, nuget.exe will be downloaded into the -DownloadPath - directory. -.PARAMETER PackageSource - The package source to use to download the verification tool. If not provided, nuget.org will be used. -.PARAMETER DownloadPath - The directory path to download the verification tool and nuget.exe to. If not provided, - %TEMP%\NuGet.VerifyNuGetPackage will be used. -.PARAMETER args - Arguments that will be passed to the verification tool. -.EXAMPLE - PS> .\verify.ps1 *.nupkg - Verifies the metadata of all .nupkg files in the currect working directory. -.EXAMPLE - PS> .\verify.ps1 --help - Displays the help text of the downloaded verifiction tool. -.LINK - https://github.com/NuGet/NuGetGallery/blob/master/src/VerifyMicrosoftPackage/README.md -#> - -# This script was copied from https://github.com/NuGet/NuGetGallery/blob/3e25ad135146676bcab0050a516939d9958bfa5d/src/VerifyMicrosoftPackage/verify.ps1 - -[CmdletBinding(PositionalBinding = $false)] -param( - [string]$NuGetExePath, - [string]$PackageSource = "https://api.nuget.org/v3/index.json", - [string]$DownloadPath, - [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$args -) - -# The URL to download nuget.exe. -$nugetExeUrl = "https://dist.nuget.org/win-x86-commandline/v4.9.4/nuget.exe" - -# The package ID of the verification tool. -$packageId = "NuGet.VerifyMicrosoftPackage" - -# The location that nuget.exe and the verification tool will be downloaded to. -if (!$DownloadPath) { - $DownloadPath = (Join-Path $env:TEMP "NuGet.VerifyMicrosoftPackage") -} - -$fence = New-Object -TypeName string -ArgumentList '=', 80 - -# Create the download directory, if it doesn't already exist. -if (!(Test-Path $DownloadPath)) { - New-Item -ItemType Directory $DownloadPath | Out-Null -} -Write-Host "Using download path: $DownloadPath" - -if ($NuGetExePath) { - $nuget = $NuGetExePath -} else { - $downloadedNuGetExe = Join-Path $DownloadPath "nuget.exe" - - # Download nuget.exe, if it doesn't already exist. - if (!(Test-Path $downloadedNuGetExe)) { - Write-Host "Downloading nuget.exe from $nugetExeUrl..." - $ProgressPreference = 'SilentlyContinue' - try { - Invoke-WebRequest $nugetExeUrl -OutFile $downloadedNuGetExe - $ProgressPreference = 'Continue' - } catch { - $ProgressPreference = 'Continue' - Write-Error $_ - Write-Error "nuget.exe failed to download." - exit - } - } - - $nuget = $downloadedNuGetExe -} - -Write-Host "Using nuget.exe path: $nuget" -Write-Host " " - -# Download the latest version of the verification tool. -Write-Host "Downloading the latest version of $packageId from $packageSource..." -Write-Host $fence -& $nuget install $packageId ` - -Prerelease ` - -OutputDirectory $DownloadPath ` - -Source $PackageSource -Write-Host $fence -Write-Host " " - -if ($LASTEXITCODE -ne 0) { - Write-Error "nuget.exe failed to fetch the verify tool." - exit -} - -# Find the most recently downloaded tool -Write-Host "Finding the most recently downloaded verification tool." -$verifyProbePath = Join-Path $DownloadPath "$packageId.*" -$verifyPath = Get-ChildItem -Path $verifyProbePath -Directory ` - | Sort-Object -Property LastWriteTime -Descending ` - | Select-Object -First 1 -$verify = Join-Path $verifyPath "tools\NuGet.VerifyMicrosoftPackage.exe" -Write-Host "Using verification tool: $verify" -Write-Host " " - -# Execute the verification tool. -Write-Host "Executing the verify tool..." -Write-Host $fence -& $verify $args -Write-Host $fence -Write-Host " " - -# Respond to the exit code. -if ($LASTEXITCODE -ne 0) { - Write-Error "The verify tool found some problems." -} else { - Write-Output "The verify tool succeeded." -} diff --git a/src/arcade/eng/common/post-build/redact-logs.ps1 b/src/arcade/eng/common/post-build/redact-logs.ps1 deleted file mode 100644 index b7fc1959150..00000000000 --- a/src/arcade/eng/common/post-build/redact-logs.ps1 +++ /dev/null @@ -1,89 +0,0 @@ -[CmdletBinding(PositionalBinding=$False)] -param( - [Parameter(Mandatory=$true, Position=0)][string] $InputPath, - [Parameter(Mandatory=$true)][string] $BinlogToolVersion, - [Parameter(Mandatory=$false)][string] $DotnetPath, - [Parameter(Mandatory=$false)][string] $PackageFeed = 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json', - # File with strings to redact - separated by newlines. - # For comments start the line with '# ' - such lines are ignored - [Parameter(Mandatory=$false)][string] $TokensFilePath, - [Parameter(ValueFromRemainingArguments=$true)][String[]]$TokensToRedact -) - -try { - $ErrorActionPreference = 'Stop' - Set-StrictMode -Version 2.0 - - # `tools.ps1` checks $ci to perform some actions. Since the post-build - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - $disableConfigureToolsetImport = $true - . $PSScriptRoot\..\tools.ps1 - - $packageName = 'binlogtool' - - $dotnet = $DotnetPath - - if (!$dotnet) { - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - } - - $toolList = & "$dotnet" tool list -g - - if ($toolList -like "*$packageName*") { - & "$dotnet" tool uninstall $packageName -g - } - - $toolPath = "$PSScriptRoot\..\..\..\.tools" - $verbosity = 'minimal' - - New-Item -ItemType Directory -Force -Path $toolPath - - Push-Location -Path $toolPath - - try { - Write-Host "Installing Binlog redactor CLI..." - Write-Host "'$dotnet' new tool-manifest" - & "$dotnet" new tool-manifest - Write-Host "'$dotnet' tool install $packageName --local --add-source '$PackageFeed' -v $verbosity --version $BinlogToolVersion" - & "$dotnet" tool install $packageName --local --add-source "$PackageFeed" -v $verbosity --version $BinlogToolVersion - - if (Test-Path $TokensFilePath) { - Write-Host "Adding additional sensitive data for redaction from file: " $TokensFilePath - $TokensToRedact += Get-Content -Path $TokensFilePath | Foreach {$_.Trim()} | Where { $_ -notmatch "^# " } - } - - $optionalParams = [System.Collections.ArrayList]::new() - - Foreach ($p in $TokensToRedact) - { - if($p -match '^\$\(.*\)$') - { - Write-Host ("Ignoring token {0} as it is probably unexpanded AzDO variable" -f $p) - } - elseif($p) - { - $optionalParams.Add("-p:" + $p) | Out-Null - } - } - - & $dotnet binlogtool redact --input:$InputPath --recurse --in-place ` - @optionalParams - - if ($LastExitCode -ne 0) { - Write-PipelineTelemetryError -Category 'Redactor' -Type 'warning' -Message "Problems using Redactor tool (exit code: $LastExitCode). But ignoring them now." - } - } - finally { - Pop-Location - } - - Write-Host 'done.' -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Category 'Redactor' -Message "There was an error while trying to redact logs. Error: $_" - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/post-build/sourcelink-validation.ps1 b/src/arcade/eng/common/post-build/sourcelink-validation.ps1 deleted file mode 100644 index 1976ef70fb8..00000000000 --- a/src/arcade/eng/common/post-build/sourcelink-validation.ps1 +++ /dev/null @@ -1,327 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored - [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation - [Parameter(Mandatory=$false)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade - [Parameter(Mandatory=$false)][string] $GHCommit, # GitHub commit SHA used to build the packages - [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -# `tools.ps1` checks $ci to perform some actions. Since the post-build -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -$disableConfigureToolsetImport = $true -. $PSScriptRoot\..\tools.ps1 - -# Cache/HashMap (File -> Exist flag) used to consult whether a file exist -# in the repository at a specific commit point. This is populated by inserting -# all files present in the repo at a specific commit point. -$global:RepoFiles = @{} - -# Maximum number of jobs to run in parallel -$MaxParallelJobs = 16 - -$MaxRetries = 5 -$RetryWaitTimeInSeconds = 30 - -# Wait time between check for system load -$SecondsBetweenLoadChecks = 10 - -if (!$InputPath -or !(Test-Path $InputPath)){ - Write-Host "No files to validate." - ExitWithExitCode 0 -} - -$ValidatePackage = { - param( - [string] $PackagePath # Full path to a Symbols.NuGet package - ) - - . $using:PSScriptRoot\..\tools.ps1 - - # Ensure input file exist - if (!(Test-Path $PackagePath)) { - Write-Host "Input file does not exist: $PackagePath" - return [pscustomobject]@{ - result = 1 - packagePath = $PackagePath - } - } - - # Extensions for which we'll look for SourceLink information - # For now we'll only care about Portable & Embedded PDBs - $RelevantExtensions = @('.dll', '.exe', '.pdb') - - Write-Host -NoNewLine 'Validating ' ([System.IO.Path]::GetFileName($PackagePath)) '...' - - $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) - $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId - $FailedFiles = 0 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - - [System.IO.Directory]::CreateDirectory($ExtractPath) | Out-Null - - try { - $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) - - $zip.Entries | - Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | - ForEach-Object { - $FileName = $_.FullName - $Extension = [System.IO.Path]::GetExtension($_.Name) - $FakeName = -Join((New-Guid), $Extension) - $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName - - # We ignore resource DLLs - if ($FileName.EndsWith('.resources.dll')) { - return [pscustomobject]@{ - result = 0 - packagePath = $PackagePath - } - } - - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) - - $ValidateFile = { - param( - [string] $FullPath, # Full path to the module that has to be checked - [string] $RealPath, - [ref] $FailedFiles - ) - - $sourcelinkExe = "$env:USERPROFILE\.dotnet\tools" - $sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe" - $SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String - - if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) { - $NumFailedLinks = 0 - - # We only care about Http addresses - $Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches - - if ($Matches.Count -ne 0) { - $Matches.Value | - ForEach-Object { - $Link = $_ - $CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/" - - $FilePath = $Link.Replace($CommitUrl, "") - $Status = 200 - $Cache = $using:RepoFiles - - $attempts = 0 - - while ($attempts -lt $using:MaxRetries) { - if ( !($Cache.ContainsKey($FilePath)) ) { - try { - $Uri = $Link -as [System.URI] - - if ($Link -match "submodules") { - # Skip submodule links until sourcelink properly handles submodules - $Status = 200 - } - elseif ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match 'github' -or $Uri.Host -match 'githubusercontent')) { - # Only GitHub links are valid - $Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode - } - else { - # If it's not a github link, we want to break out of the loop and not retry. - $Status = 0 - $attempts = $using:MaxRetries - } - } - catch { - Write-Host $_ - $Status = 0 - } - } - - if ($Status -ne 200) { - $attempts++ - - if ($attempts -lt $using:MaxRetries) - { - $attemptsLeft = $using:MaxRetries - $attempts - Write-Warning "Download failed, $attemptsLeft attempts remaining, will retry in $using:RetryWaitTimeInSeconds seconds" - Start-Sleep -Seconds $using:RetryWaitTimeInSeconds - } - else { - if ($NumFailedLinks -eq 0) { - if ($FailedFiles.Value -eq 0) { - Write-Host - } - - Write-Host "`tFile $RealPath has broken links:" - } - - Write-Host "`t`tFailed to retrieve $Link" - - $NumFailedLinks++ - } - } - else { - break - } - } - } - } - - if ($NumFailedLinks -ne 0) { - $FailedFiles.value++ - $global:LASTEXITCODE = 1 - } - } - } - - &$ValidateFile $TargetFile $FileName ([ref]$FailedFiles) - } - } - catch { - Write-Host $_ - } - finally { - $zip.Dispose() - } - - if ($FailedFiles -eq 0) { - Write-Host 'Passed.' - return [pscustomobject]@{ - result = 0 - packagePath = $PackagePath - } - } - else { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links." - return [pscustomobject]@{ - result = 1 - packagePath = $PackagePath - } - } -} - -function CheckJobResult( - $result, - $packagePath, - [ref]$ValidationFailures, - [switch]$logErrors) { - if ($result -ne '0') { - if ($logErrors) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$packagePath has broken SourceLink links." - } - $ValidationFailures.Value++ - } -} - -function ValidateSourceLinkLinks { - if ($GHRepoName -ne '' -and !($GHRepoName -Match '^[^\s\/]+/[^\s\/]+$')) { - if (!($GHRepoName -Match '^[^\s-]+-[^\s]+$')) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHRepoName should be in the format / or -. '$GHRepoName'" - ExitWithExitCode 1 - } - else { - $GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2'; - } - } - - if ($GHCommit -ne '' -and !($GHCommit -Match '^[0-9a-fA-F]{40}$')) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "GHCommit should be a 40 chars hexadecimal string. '$GHCommit'" - ExitWithExitCode 1 - } - - if ($GHRepoName -ne '' -and $GHCommit -ne '') { - $RepoTreeURL = -Join('http://api.github.com/repos/', $GHRepoName, '/git/trees/', $GHCommit, '?recursive=1') - $CodeExtensions = @('.cs', '.vb', '.fs', '.fsi', '.fsx', '.fsscript') - - try { - # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash - $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree - - foreach ($file in $Data) { - $Extension = [System.IO.Path]::GetExtension($file.path) - - if ($CodeExtensions.Contains($Extension)) { - $RepoFiles[$file.path] = 1 - } - } - } - catch { - Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL . Execution will proceed without caching." - } - } - elseif ($GHRepoName -ne '' -or $GHCommit -ne '') { - Write-Host 'For using the http caching mechanism both GHRepoName and GHCommit should be informed.' - } - - if (Test-Path $ExtractPath) { - Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue - } - - $ValidationFailures = 0 - - # Process each NuGet package in parallel - Get-ChildItem "$InputPath\*.symbols.nupkg" | - ForEach-Object { - Write-Host "Starting $($_.FullName)" - Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName | Out-Null - $NumJobs = @(Get-Job -State 'Running').Count - - while ($NumJobs -ge $MaxParallelJobs) { - Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." - sleep $SecondsBetweenLoadChecks - $NumJobs = @(Get-Job -State 'Running').Count - } - - foreach ($Job in @(Get-Job -State 'Completed')) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) -LogErrors - Remove-Job -Id $Job.Id - } - } - - foreach ($Job in @(Get-Job)) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) - Remove-Job -Id $Job.Id - } - if ($ValidationFailures -gt 0) { - Write-PipelineTelemetryError -Category 'SourceLink' -Message "$ValidationFailures package(s) failed validation." - ExitWithExitCode 1 - } -} - -function InstallSourcelinkCli { - $sourcelinkCliPackageName = 'sourcelink' - - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = & "$dotnet" tool list --global - - if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { - Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." - } - else { - Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." - Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' - & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global - } -} - -try { - InstallSourcelinkCli - - foreach ($Job in @(Get-Job)) { - Remove-Job -Id $Job.Id - } - - ValidateSourceLinkLinks -} -catch { - Write-Host $_.Exception - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'SourceLink' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/post-build/symbols-validation.ps1 b/src/arcade/eng/common/post-build/symbols-validation.ps1 deleted file mode 100644 index 7146e593ffa..00000000000 --- a/src/arcade/eng/common/post-build/symbols-validation.ps1 +++ /dev/null @@ -1,337 +0,0 @@ -param( - [Parameter(Mandatory = $true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored - [Parameter(Mandatory = $true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation - [Parameter(Mandatory = $true)][string] $DotnetSymbolVersion, # Version of dotnet symbol to use - [Parameter(Mandatory = $false)][switch] $CheckForWindowsPdbs, # If we should check for the existence of windows pdbs in addition to portable PDBs - [Parameter(Mandatory = $false)][switch] $ContinueOnError, # If we should keep checking symbols after an error - [Parameter(Mandatory = $false)][switch] $Clean, # Clean extracted symbols directory after checking symbols - [Parameter(Mandatory = $false)][string] $SymbolExclusionFile # Exclude the symbols in the file from publishing to symbol server -) - -. $PSScriptRoot\..\tools.ps1 -# Maximum number of jobs to run in parallel -$MaxParallelJobs = 16 - -# Max number of retries -$MaxRetry = 5 - -# Wait time between check for system load -$SecondsBetweenLoadChecks = 10 - -# Set error codes -Set-Variable -Name "ERROR_BADEXTRACT" -Option Constant -Value -1 -Set-Variable -Name "ERROR_FILEDOESNOTEXIST" -Option Constant -Value -2 - -$WindowsPdbVerificationParam = "" -if ($CheckForWindowsPdbs) { - $WindowsPdbVerificationParam = "--windows-pdbs" -} - -$ExclusionSet = New-Object System.Collections.Generic.HashSet[string]; - -if (!$InputPath -or !(Test-Path $InputPath)){ - Write-Host "No symbols to validate." - ExitWithExitCode 0 -} - -#Check if the path exists -if ($SymbolExclusionFile -and (Test-Path $SymbolExclusionFile)){ - [string[]]$Exclusions = Get-Content "$SymbolExclusionFile" - $Exclusions | foreach { if($_ -and $_.Trim()){$ExclusionSet.Add($_)} } -} -else{ - Write-Host "Symbol Exclusion file does not exists. No symbols to exclude." -} - -$CountMissingSymbols = { - param( - [string] $PackagePath, # Path to a NuGet package - [string] $WindowsPdbVerificationParam # If we should check for the existence of windows pdbs in addition to portable PDBs - ) - - Add-Type -AssemblyName System.IO.Compression.FileSystem - - Write-Host "Validating $PackagePath " - - # Ensure input file exist - if (!(Test-Path $PackagePath)) { - Write-PipelineTaskError "Input file does not exist: $PackagePath" - return [pscustomobject]@{ - result = $using:ERROR_FILEDOESNOTEXIST - packagePath = $PackagePath - } - } - - # Extensions for which we'll look for symbols - $RelevantExtensions = @('.dll', '.exe', '.so', '.dylib') - - # How many files are missing symbol information - $MissingSymbols = 0 - - $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) - $PackageGuid = New-Guid - $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageGuid - $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath 'Symbols' - - try { - [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath) - } - catch { - Write-Host "Something went wrong extracting $PackagePath" - Write-Host $_ - return [pscustomobject]@{ - result = $using:ERROR_BADEXTRACT - packagePath = $PackagePath - } - } - - Get-ChildItem -Recurse $ExtractPath | - Where-Object { $RelevantExtensions -contains $_.Extension } | - ForEach-Object { - $FileName = $_.FullName - if ($FileName -Match '\\ref\\') { - Write-Host "`t Ignoring reference assembly file " $FileName - return - } - - $FirstMatchingSymbolDescriptionOrDefault = { - param( - [string] $FullPath, # Full path to the module that has to be checked - [string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols - [string] $WindowsPdbVerificationParam, # Parameter to pass to potential check for windows-pdbs. - [string] $SymbolsPath - ) - - $FileName = [System.IO.Path]::GetFileName($FullPath) - $Extension = [System.IO.Path]::GetExtension($FullPath) - - # Those below are potential symbol files that the `dotnet symbol` might - # return. Which one will be returned depend on the type of file we are - # checking and which type of file was uploaded. - - # The file itself is returned - $SymbolPath = $SymbolsPath + '\' + $FileName - - # PDB file for the module - $PdbPath = $SymbolPath.Replace($Extension, '.pdb') - - # PDB file for R2R module (created by crossgen) - $NGenPdb = $SymbolPath.Replace($Extension, '.ni.pdb') - - # DBG file for a .so library - $SODbg = $SymbolPath.Replace($Extension, '.so.dbg') - - # DWARF file for a .dylib - $DylibDwarf = $SymbolPath.Replace($Extension, '.dylib.dwarf') - - $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" - $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" - - $totalRetries = 0 - - while ($totalRetries -lt $using:MaxRetry) { - - # Save the output and get diagnostic output - $output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String - - if ((Test-Path $PdbPath) -and (Test-path $SymbolPath)) { - return 'Module and PDB for Module' - } - elseif ((Test-Path $NGenPdb) -and (Test-Path $PdbPath) -and (Test-Path $SymbolPath)) { - return 'Dll, PDB and NGen PDB' - } - elseif ((Test-Path $SODbg) -and (Test-Path $SymbolPath)) { - return 'So and DBG for SO' - } - elseif ((Test-Path $DylibDwarf) -and (Test-Path $SymbolPath)) { - return 'Dylib and Dwarf for Dylib' - } - elseif (Test-Path $SymbolPath) { - return 'Module' - } - else - { - $totalRetries++ - } - } - - return $null - } - - $FileRelativePath = $FileName.Replace("$ExtractPath\", "") - if (($($using:ExclusionSet) -ne $null) -and ($($using:ExclusionSet).Contains($FileRelativePath) -or ($($using:ExclusionSet).Contains($FileRelativePath.Replace("\", "/"))))){ - Write-Host "Skipping $FileName from symbol validation" - } - - else { - $FileGuid = New-Guid - $ExpandedSymbolsPath = Join-Path -Path $SymbolsPath -ChildPath $FileGuid - - $SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault ` - -FullPath $FileName ` - -TargetServerParam '--microsoft-symbol-server' ` - -SymbolsPath "$ExpandedSymbolsPath-msdl" ` - -WindowsPdbVerificationParam $WindowsPdbVerificationParam - $SymbolsOnSymWeb = & $FirstMatchingSymbolDescriptionOrDefault ` - -FullPath $FileName ` - -TargetServerParam '--internal-server' ` - -SymbolsPath "$ExpandedSymbolsPath-symweb" ` - -WindowsPdbVerificationParam $WindowsPdbVerificationParam - - Write-Host -NoNewLine "`t Checking file " $FileName "... " - - if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { - Write-Host "Symbols found on MSDL ($SymbolsOnMSDL) and SymWeb ($SymbolsOnSymWeb)" - } - else { - $MissingSymbols++ - - if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) { - Write-Host 'No symbols found on MSDL or SymWeb!' - } - else { - if ($SymbolsOnMSDL -eq $null) { - Write-Host 'No symbols found on MSDL!' - } - else { - Write-Host 'No symbols found on SymWeb!' - } - } - } - } - } - - if ($using:Clean) { - Remove-Item $ExtractPath -Recurse -Force - } - - Pop-Location - - return [pscustomobject]@{ - result = $MissingSymbols - packagePath = $PackagePath - } -} - -function CheckJobResult( - $result, - $packagePath, - [ref]$DupedSymbols, - [ref]$TotalFailures) { - if ($result -eq $ERROR_BADEXTRACT) { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files" - $DupedSymbols.Value++ - } - elseif ($result -eq $ERROR_FILEDOESNOTEXIST) { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath does not exist" - $TotalFailures.Value++ - } - elseif ($result -gt '0') { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $result modules in the package $packagePath" - $TotalFailures.Value++ - } - else { - Write-Host "All symbols verified for package $packagePath" - } -} - -function CheckSymbolsAvailable { - if (Test-Path $ExtractPath) { - Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue - } - - $TotalPackages = 0 - $TotalFailures = 0 - $DupedSymbols = 0 - - Get-ChildItem "$InputPath\*.nupkg" | - ForEach-Object { - $FileName = $_.Name - $FullName = $_.FullName - - # These packages from Arcade-Services include some native libraries that - # our current symbol uploader can't handle. Below is a workaround until - # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. - if ($FileName -Match 'Microsoft\.DotNet\.Darc\.') { - Write-Host "Ignoring Arcade-services file: $FileName" - Write-Host - return - } - elseif ($FileName -Match 'Microsoft\.DotNet\.Maestro\.Tasks\.') { - Write-Host "Ignoring Arcade-services file: $FileName" - Write-Host - return - } - - $TotalPackages++ - - Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList @($FullName,$WindowsPdbVerificationParam) | Out-Null - - $NumJobs = @(Get-Job -State 'Running').Count - - while ($NumJobs -ge $MaxParallelJobs) { - Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." - sleep $SecondsBetweenLoadChecks - $NumJobs = @(Get-Job -State 'Running').Count - } - - foreach ($Job in @(Get-Job -State 'Completed')) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) - Remove-Job -Id $Job.Id - } - Write-Host - } - - foreach ($Job in @(Get-Job)) { - $jobResult = Wait-Job -Id $Job.Id | Receive-Job - CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$DupedSymbols) ([ref]$TotalFailures) - } - - if ($TotalFailures -gt 0 -or $DupedSymbols -gt 0) { - if ($TotalFailures -gt 0) { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Symbols missing for $TotalFailures/$TotalPackages packages" - } - - if ($DupedSymbols -gt 0) { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$DupedSymbols/$TotalPackages packages had duplicated symbol files and could not be extracted" - } - - ExitWithExitCode 1 - } - else { - Write-Host "All symbols validated!" - } -} - -function InstallDotnetSymbol { - $dotnetSymbolPackageName = 'dotnet-symbol' - - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = & "$dotnet" tool list --global - - if (($toolList -like "*$dotnetSymbolPackageName*") -and ($toolList -like "*$dotnetSymbolVersion*")) { - Write-Host "dotnet-symbol version $dotnetSymbolVersion is already installed." - } - else { - Write-Host "Installing dotnet-symbol version $dotnetSymbolVersion..." - Write-Host 'You may need to restart your command window if this is the first dotnet tool you have installed.' - & "$dotnet" tool install $dotnetSymbolPackageName --version $dotnetSymbolVersion --verbosity "minimal" --global - } -} - -try { - InstallDotnetSymbol - - foreach ($Job in @(Get-Job)) { - Remove-Job -Id $Job.Id - } - - CheckSymbolsAvailable -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/retain-build.ps1 b/src/arcade/eng/common/retain-build.ps1 deleted file mode 100644 index e7ba975adeb..00000000000 --- a/src/arcade/eng/common/retain-build.ps1 +++ /dev/null @@ -1,45 +0,0 @@ - -Param( -[Parameter(Mandatory=$true)][int] $buildId, -[Parameter(Mandatory=$true)][string] $azdoOrgUri, -[Parameter(Mandatory=$true)][string] $azdoProject, -[Parameter(Mandatory=$true)][string] $token -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -function Get-AzDOHeaders( - [string] $token) -{ - $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) - $headers = @{"Authorization"="Basic $base64AuthInfo"} - return $headers -} - -function Update-BuildRetention( - [string] $azdoOrgUri, - [string] $azdoProject, - [int] $buildId, - [string] $token) -{ - $headers = Get-AzDOHeaders -token $token - $requestBody = "{ - `"keepForever`": `"true`" - }" - - $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" - write-Host "Attempting to retain build using the following URI: ${requestUri} ..." - - try { - Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" - Write-Host "Updated retention settings for build ${buildId}." - } - catch { - Write-Error "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" - exit 1 - } -} - -Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token -exit 0 diff --git a/src/arcade/eng/common/sdl/NuGet.config b/src/arcade/eng/common/sdl/NuGet.config deleted file mode 100644 index 3849bdb3cf5..00000000000 --- a/src/arcade/eng/common/sdl/NuGet.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 b/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 deleted file mode 100644 index 27f5a4115fc..00000000000 --- a/src/arcade/eng/common/sdl/configure-sdl-tool.ps1 +++ /dev/null @@ -1,130 +0,0 @@ -Param( - [string] $GuardianCliLocation, - [string] $WorkingDirectory, - [string] $TargetDirectory, - [string] $GdnFolder, - # The list of Guardian tools to configure. For each object in the array: - # - If the item is a [hashtable], it must contain these entries: - # - Name = The tool name as Guardian knows it. - # - Scenario = (Optional) Scenario-specific name for this configuration entry. It must be unique - # among all tool entries with the same Name. - # - Args = (Optional) Array of Guardian tool configuration args, like '@("Target > C:\temp")' - # - If the item is a [string] $v, it is treated as '@{ Name="$v" }' - [object[]] $ToolsList, - [string] $GuardianLoggerLevel='Standard', - # Optional: Additional params to add to any tool using CredScan. - [string[]] $CrScanAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using PoliCheck. - [string[]] $PoliCheckAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using CodeQL/Semmle. - [string[]] $CodeQLAdditionalRunConfigParams, - # Optional: Additional params to add to any tool using Binskim. - [string[]] $BinskimAdditionalRunConfigParams -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - # Normalize tools list: all in [hashtable] form with defined values for each key. - $ToolsList = $ToolsList | - ForEach-Object { - if ($_ -is [string]) { - $_ = @{ Name = $_ } - } - - if (-not ($_['Scenario'])) { $_.Scenario = "" } - if (-not ($_['Args'])) { $_.Args = @() } - $_ - } - - Write-Host "List of tools to configure:" - $ToolsList | ForEach-Object { $_ | Out-String | Write-Host } - - # We store config files in the r directory of .gdn - $gdnConfigPath = Join-Path $GdnFolder 'r' - $ValidPath = Test-Path $GuardianCliLocation - - if ($ValidPath -eq $False) - { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." - ExitWithExitCode 1 - } - - foreach ($tool in $ToolsList) { - # Put together the name and scenario to make a unique key. - $toolConfigName = $tool.Name - if ($tool.Scenario) { - $toolConfigName += "_" + $tool.Scenario - } - - Write-Host "=== Configuring $toolConfigName..." - - $gdnConfigFile = Join-Path $gdnConfigPath "$toolConfigName-configure.gdnconfig" - - # For some tools, add default and automatic args. - switch -Exact ($tool.Name) { - 'credscan' { - if ($targetDirectory) { - $tool.Args += "`"TargetDirectory < $TargetDirectory`"" - } - $tool.Args += "`"OutputType < pre`"" - $tool.Args += $CrScanAdditionalRunConfigParams - } - 'policheck' { - if ($targetDirectory) { - $tool.Args += "`"Target < $TargetDirectory`"" - } - $tool.Args += $PoliCheckAdditionalRunConfigParams - } - {$_ -in 'semmle', 'codeql'} { - if ($targetDirectory) { - $tool.Args += "`"SourceCodeDirectory < $TargetDirectory`"" - } - $tool.Args += $CodeQLAdditionalRunConfigParams - } - 'binskim' { - if ($targetDirectory) { - # Binskim crashes due to specific PDBs. GitHub issue: https://github.com/microsoft/binskim/issues/924. - # We are excluding all `_.pdb` files from the scan. - $tool.Args += "`"Target < $TargetDirectory\**;-:file|$TargetDirectory\**\_.pdb`"" - } - $tool.Args += $BinskimAdditionalRunConfigParams - } - } - - # Create variable pointing to the args array directly so we can use splat syntax later. - $toolArgs = $tool.Args - - # Configure the tool. If args array is provided or the current tool has some default arguments - # defined, add "--args" and splat each element on the end. Arg format is "{Arg id} < {Value}", - # one per parameter. Doc page for "guardian configure": - # https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1395/configure - Exec-BlockVerbosely { - & $GuardianCliLocation configure ` - --working-directory $WorkingDirectory ` - --tool $tool.Name ` - --output-path $gdnConfigFile ` - --logger-level $GuardianLoggerLevel ` - --noninteractive ` - --force ` - $(if ($toolArgs) { "--args" }) @toolArgs - Exit-IfNZEC "Sdl" - } - - Write-Host "Created '$toolConfigName' configuration file: $gdnConfigFile" - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 b/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 deleted file mode 100644 index 4715d75e974..00000000000 --- a/src/arcade/eng/common/sdl/execute-all-sdl-tools.ps1 +++ /dev/null @@ -1,167 +0,0 @@ -Param( - [string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified) - [string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified) - [string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified - [string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade) - [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master - [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located - [string] $ArtifactsDirectory = (Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY ('artifacts')), # Required: the directory where build artifacts are located - [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault - - # Optional: list of SDL tools to run on source code. See 'configure-sdl-tool.ps1' for tools list - # format. - [object[]] $SourceToolsList, - # Optional: list of SDL tools to run on built artifacts. See 'configure-sdl-tool.ps1' for tools - # list format. - [object[]] $ArtifactToolsList, - # Optional: list of SDL tools to run without automatically specifying a target directory. See - # 'configure-sdl-tool.ps1' for tools list format. - [object[]] $CustomToolsList, - - [bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs. - [string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs. - [string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber) - [bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed - [bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs. - [string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs. - [string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. alias@microsoft.com); TSA is the automated framework used to upload test results as bugs. - [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. - [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. - [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. - [string] $GuardianLoggerLevel='Standard', # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error - [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") - [string[]] $PoliCheckAdditionalRunConfigParams, # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") - [string[]] $CodeQLAdditionalRunConfigParams, # Optional: Additional Params to custom build a Semmle/CodeQL run config in the format @("xyz < abc","sdf < 1") - [string[]] $BinskimAdditionalRunConfigParams, # Optional: Additional Params to custom build a Binskim run config in the format @("xyz < abc","sdf < 1") - [bool] $BreakOnFailure=$False # Optional: Fail the build if there were errors during the run -) - -try { - $ErrorActionPreference = 'Stop' - Set-StrictMode -Version 2.0 - $disableConfigureToolsetImport = $true - $global:LASTEXITCODE = 0 - - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - #Replace repo names to the format of org/repo - if (!($Repository.contains('/'))) { - $RepoName = $Repository -replace '(.*?)-(.*)', '$1/$2'; - } - else{ - $RepoName = $Repository; - } - - if ($GuardianPackageName) { - $guardianCliLocation = Join-Path $NugetPackageDirectory (Join-Path $GuardianPackageName (Join-Path 'tools' 'guardian.cmd')) - } else { - $guardianCliLocation = $GuardianCliLocation - } - - $workingDirectory = (Split-Path $SourceDirectory -Parent) - $ValidPath = Test-Path $guardianCliLocation - - if ($ValidPath -eq $False) - { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Invalid Guardian CLI Location.' - ExitWithExitCode 1 - } - - Exec-BlockVerbosely { - & $(Join-Path $PSScriptRoot 'init-sdl.ps1') -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $workingDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel - } - $gdnFolder = Join-Path $workingDirectory '.gdn' - - if ($TsaOnboard) { - if ($TsaCodebaseName -and $TsaNotificationEmail -and $TsaCodebaseAdmin -and $TsaBugAreaPath) { - Exec-BlockVerbosely { - & $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel - } - if ($LASTEXITCODE -ne 0) { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-onboard failed with exit code $LASTEXITCODE." - ExitWithExitCode $LASTEXITCODE - } - } else { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not onboard to TSA -- not all required values ($TsaCodebaseName, $TsaNotificationEmail, $TsaCodebaseAdmin, $TsaBugAreaPath) were specified.' - ExitWithExitCode 1 - } - } - - # Configure a list of tools with a default target directory. Populates the ".gdn/r" directory. - function Configure-ToolsList([object[]] $tools, [string] $targetDirectory) { - if ($tools -and $tools.Count -gt 0) { - Exec-BlockVerbosely { - & $(Join-Path $PSScriptRoot 'configure-sdl-tool.ps1') ` - -GuardianCliLocation $guardianCliLocation ` - -WorkingDirectory $workingDirectory ` - -TargetDirectory $targetDirectory ` - -GdnFolder $gdnFolder ` - -ToolsList $tools ` - -AzureDevOpsAccessToken $AzureDevOpsAccessToken ` - -GuardianLoggerLevel $GuardianLoggerLevel ` - -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams ` - -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams ` - -CodeQLAdditionalRunConfigParams $CodeQLAdditionalRunConfigParams ` - -BinskimAdditionalRunConfigParams $BinskimAdditionalRunConfigParams - if ($BreakOnFailure) { - Exit-IfNZEC "Sdl" - } - } - } - } - - # Configure Artifact and Source tools with default Target directories. - Configure-ToolsList $ArtifactToolsList $ArtifactsDirectory - Configure-ToolsList $SourceToolsList $SourceDirectory - # Configure custom tools with no default Target directory. - Configure-ToolsList $CustomToolsList $null - - # At this point, all tools are configured in the ".gdn" directory. Run them all in a single call. - # (If we used "run" multiple times, each run would overwrite data from earlier runs.) - Exec-BlockVerbosely { - & $(Join-Path $PSScriptRoot 'run-sdl.ps1') ` - -GuardianCliLocation $guardianCliLocation ` - -WorkingDirectory $SourceDirectory ` - -UpdateBaseline $UpdateBaseline ` - -GdnFolder $gdnFolder - } - - if ($TsaPublish) { - if ($TsaBranchName -and $BuildNumber) { - if (-not $TsaRepositoryName) { - $TsaRepositoryName = "$($Repository)-$($BranchName)" - } - Exec-BlockVerbosely { - & $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --onboard $True --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $workingDirectory --logger-level $GuardianLoggerLevel - } - if ($LASTEXITCODE -ne 0) { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Guardian tsa-publish failed with exit code $LASTEXITCODE." - ExitWithExitCode $LASTEXITCODE - } - } else { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message 'Could not publish to TSA -- not all required values ($TsaBranchName, $BuildNumber) were specified.' - ExitWithExitCode 1 - } - } - - if ($BreakOnFailure) { - Write-Host "Failing the build in case of breaking results..." - Exec-BlockVerbosely { - & $guardianCliLocation break --working-directory $workingDirectory --logger-level $GuardianLoggerLevel - } - } else { - Write-Host "Letting the build pass even if there were breaking results..." - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - exit 1 -} diff --git a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 b/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 deleted file mode 100644 index 68da4fbf257..00000000000 --- a/src/arcade/eng/common/sdl/extract-artifact-archives.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -# This script looks for each archive file in a directory and extracts it into the target directory. -# For example, the file "$InputPath/bin.tar.gz" extracts to "$ExtractPath/bin.tar.gz.extracted/**". -# Uses the "tar" utility added to Windows 10 / Windows 2019 that supports tar.gz and zip. -param( - # Full path to directory where archives are stored. - [Parameter(Mandatory=$true)][string] $InputPath, - # Full path to directory to extract archives into. May be the same as $InputPath. - [Parameter(Mandatory=$true)][string] $ExtractPath -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -$disableConfigureToolsetImport = $true - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - Measure-Command { - $jobs = @() - - # Find archive files for non-Windows and Windows builds. - $archiveFiles = @( - Get-ChildItem (Join-Path $InputPath "*.tar.gz") - Get-ChildItem (Join-Path $InputPath "*.zip") - ) - - foreach ($targzFile in $archiveFiles) { - $jobs += Start-Job -ScriptBlock { - $file = $using:targzFile - $fileName = [System.IO.Path]::GetFileName($file) - $extractDir = Join-Path $using:ExtractPath "$fileName.extracted" - - New-Item $extractDir -ItemType Directory -Force | Out-Null - - Write-Host "Extracting '$file' to '$extractDir'..." - - # Pipe errors to stdout to prevent PowerShell detecting them and quitting the job early. - # This type of quit skips the catch, so we wouldn't be able to tell which file triggered the - # error. Save output so it can be stored in the exception string along with context. - $output = tar -xf $file -C $extractDir 2>&1 - # Handle NZEC manually rather than using Exit-IfNZEC: we are in a background job, so we - # don't have access to the outer scope. - if ($LASTEXITCODE -ne 0) { - throw "Error extracting '$file': non-zero exit code ($LASTEXITCODE). Output: '$output'" - } - - Write-Host "Extracted to $extractDir" - } - } - - Receive-Job $jobs -Wait - } -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 b/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 deleted file mode 100644 index f031ed5b25e..00000000000 --- a/src/arcade/eng/common/sdl/extract-artifact-packages.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -param( - [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored - [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -$disableConfigureToolsetImport = $true - -function ExtractArtifacts { - if (!(Test-Path $InputPath)) { - Write-Host "Input Path does not exist: $InputPath" - ExitWithExitCode 0 - } - $Jobs = @() - Get-ChildItem "$InputPath\*.nupkg" | - ForEach-Object { - $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName - } - - foreach ($Job in $Jobs) { - Wait-Job -Id $Job.Id | Receive-Job - } -} - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - $ExtractPackage = { - param( - [string] $PackagePath # Full path to a NuGet package - ) - - if (!(Test-Path $PackagePath)) { - Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath" - ExitWithExitCode 1 - } - - $RelevantExtensions = @('.dll', '.exe', '.pdb') - Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...' - - $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) - $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId - - Add-Type -AssemblyName System.IO.Compression.FileSystem - - [System.IO.Directory]::CreateDirectory($ExtractPath); - - try { - $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) - - $zip.Entries | - Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | - ForEach-Object { - $TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName) - [System.IO.Directory]::CreateDirectory($TargetPath); - - $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile) - } - } - catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 - } - finally { - $zip.Dispose() - } - } - Measure-Command { ExtractArtifacts } -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/init-sdl.ps1 b/src/arcade/eng/common/sdl/init-sdl.ps1 deleted file mode 100644 index 3ac1d92b370..00000000000 --- a/src/arcade/eng/common/sdl/init-sdl.ps1 +++ /dev/null @@ -1,55 +0,0 @@ -Param( - [string] $GuardianCliLocation, - [string] $Repository, - [string] $BranchName='master', - [string] $WorkingDirectory, - [string] $AzureDevOpsAccessToken, - [string] $GuardianLoggerLevel='Standard' -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -# `tools.ps1` checks $ci to perform some actions. Since the SDL -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -. $PSScriptRoot\..\tools.ps1 - -# Don't display the console progress UI - it's a huge perf hit -$ProgressPreference = 'SilentlyContinue' - -# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file -$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) -$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") -$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0" -$zipFile = "$WorkingDirectory/gdn.zip" - -Add-Type -AssemblyName System.IO.Compression.FileSystem -$gdnFolder = (Join-Path $WorkingDirectory '.gdn') - -try { - # if the folder does not exist, we'll do a guardian init and push it to the remote repository - Write-Host 'Initializing Guardian...' - Write-Host "$GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel" - & $GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel - if ($LASTEXITCODE -ne 0) { - Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian init failed with exit code $LASTEXITCODE." - ExitWithExitCode $LASTEXITCODE - } - # We create the mainbaseline so it can be edited later - Write-Host "$GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline" - & $GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline - if ($LASTEXITCODE -ne 0) { - Write-PipelineTelemetryError -Force -Category 'Build' -Message "Guardian baseline failed with exit code $LASTEXITCODE." - ExitWithExitCode $LASTEXITCODE - } - ExitWithExitCode 0 -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/run-sdl.ps1 b/src/arcade/eng/common/sdl/run-sdl.ps1 deleted file mode 100644 index 2eac8c78f10..00000000000 --- a/src/arcade/eng/common/sdl/run-sdl.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -Param( - [string] $GuardianCliLocation, - [string] $WorkingDirectory, - [string] $GdnFolder, - [string] $UpdateBaseline, - [string] $GuardianLoggerLevel='Standard' -) - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -try { - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - # We store config files in the r directory of .gdn - $gdnConfigPath = Join-Path $GdnFolder 'r' - $ValidPath = Test-Path $GuardianCliLocation - - if ($ValidPath -eq $False) - { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "Invalid Guardian CLI Location." - ExitWithExitCode 1 - } - - $gdnConfigFiles = Get-ChildItem $gdnConfigPath -Recurse -Include '*.gdnconfig' - Write-Host "Discovered Guardian config files:" - $gdnConfigFiles | Out-String | Write-Host - - Exec-BlockVerbosely { - & $GuardianCliLocation run ` - --working-directory $WorkingDirectory ` - --baseline mainbaseline ` - --update-baseline $UpdateBaseline ` - --logger-level $GuardianLoggerLevel ` - --config @gdnConfigFiles - Exit-IfNZEC "Sdl" - } -} -catch { - Write-Host $_.ScriptStackTrace - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/sdl/sdl.ps1 b/src/arcade/eng/common/sdl/sdl.ps1 deleted file mode 100644 index 648c5068d7d..00000000000 --- a/src/arcade/eng/common/sdl/sdl.ps1 +++ /dev/null @@ -1,38 +0,0 @@ - -function Install-Gdn { - param( - [Parameter(Mandatory=$true)] - [string]$Path, - - # If omitted, install the latest version of Guardian, otherwise install that specific version. - [string]$Version - ) - - $ErrorActionPreference = 'Stop' - Set-StrictMode -Version 2.0 - $disableConfigureToolsetImport = $true - $global:LASTEXITCODE = 0 - - # `tools.ps1` checks $ci to perform some actions. Since the SDL - # scripts don't necessarily execute in the same agent that run the - # build.ps1/sh script this variable isn't automatically set. - $ci = $true - . $PSScriptRoot\..\tools.ps1 - - $argumentList = @("install", "Microsoft.Guardian.Cli", "-Source https://securitytools.pkgs.visualstudio.com/_packaging/Guardian/nuget/v3/index.json", "-OutputDirectory $Path", "-NonInteractive", "-NoCache") - - if ($Version) { - $argumentList += "-Version $Version" - } - - Start-Process nuget -Verbose -ArgumentList $argumentList -NoNewWindow -Wait - - $gdnCliPath = Get-ChildItem -Filter guardian.cmd -Recurse -Path $Path - - if (!$gdnCliPath) - { - Write-PipelineTelemetryError -Category 'Sdl' -Message 'Failure installing Guardian' - } - - return $gdnCliPath.FullName -} \ No newline at end of file diff --git a/src/arcade/eng/common/sdl/trim-assets-version.ps1 b/src/arcade/eng/common/sdl/trim-assets-version.ps1 deleted file mode 100644 index 0daa2a9e946..00000000000 --- a/src/arcade/eng/common/sdl/trim-assets-version.ps1 +++ /dev/null @@ -1,75 +0,0 @@ -<# -.SYNOPSIS -Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name. - -.PARAMETER InputPath -Full path to directory where artifact packages are stored - -.PARAMETER Recursive -Search for NuGet packages recursively - -#> - -Param( - [string] $InputPath, - [bool] $Recursive = $true -) - -$CliToolName = "Microsoft.DotNet.VersionTools.Cli" - -function Install-VersionTools-Cli { - param( - [Parameter(Mandatory=$true)][string]$Version - ) - - Write-Host "Installing the package '$CliToolName' with a version of '$version' ..." - $feed = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" - - $argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version", "--create-manifest-if-needed") - Start-Process "$dotnet" -Verbose -ArgumentList $argumentList -NoNewWindow -Wait -} - -# ------------------------------------------------------------------- - -if (!(Test-Path $InputPath)) { - Write-Host "Input Path '$InputPath' does not exist" - ExitWithExitCode 1 -} - -$ErrorActionPreference = 'Stop' -Set-StrictMode -Version 2.0 - -$disableConfigureToolsetImport = $true -$global:LASTEXITCODE = 0 - -# `tools.ps1` checks $ci to perform some actions. Since the SDL -# scripts don't necessarily execute in the same agent that run the -# build.ps1/sh script this variable isn't automatically set. -$ci = $true -. $PSScriptRoot\..\tools.ps1 - -try { - $dotnetRoot = InitializeDotNetCli -install:$true - $dotnet = "$dotnetRoot\dotnet.exe" - - $toolsetVersion = Read-ArcadeSdkVersion - Install-VersionTools-Cli -Version $toolsetVersion - - $cliToolFound = (& "$dotnet" tool list --local | Where-Object {$_.Split(' ')[0] -eq $CliToolName}) - if ($null -eq $cliToolFound) { - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "The '$CliToolName' tool is not installed." - ExitWithExitCode 1 - } - - Exec-BlockVerbosely { - & "$dotnet" $CliToolName trim-assets-version ` - --assets-path $InputPath ` - --recursive $Recursive - Exit-IfNZEC "Sdl" - } -} -catch { - Write-Host $_ - Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_ - ExitWithExitCode 1 -} diff --git a/src/arcade/eng/common/template-guidance.md b/src/arcade/eng/common/template-guidance.md deleted file mode 100644 index 98bbc1ded0b..00000000000 --- a/src/arcade/eng/common/template-guidance.md +++ /dev/null @@ -1,133 +0,0 @@ -# Overview - -Arcade provides templates for public (`/templates`) and 1ES pipeline templates (`/templates-official`) scenarios. Pipelines which are required to be managed by 1ES pipeline templates should reference `/templates-offical`, all other pipelines may reference `/templates`. - -## How to use - -Basic guidance is: - -- 1ES Pipeline Template or 1ES Microbuild template runs should reference `eng/common/templates-official`. Any internal production-graded pipeline should use these templates. - -- All other runs should reference `eng/common/templates`. - -See [azure-pipelines.yml](../../azure-pipelines.yml) (templates-official example) or [azure-pipelines-pr.yml](../../azure-pipelines-pr.yml) (templates example) for examples. - -#### The `templateIs1ESManaged` parameter - -The `templateIs1ESManaged` is available on most templates and affects which of the variants is used for nested templates. See [Development Notes](#development-notes) below for more information on the `templateIs1ESManaged1 parameter. - -- For templates under `job/`, `jobs/`, `steps`, or `post-build/`, this parameter must be explicitly set. - -## Multiple outputs - -1ES pipeline templates impose a policy where every publish artifact execution results in additional security scans being injected into your pipeline. When using `templates-official/jobs/jobs.yml`, Arcade reduces the number of additional security injections by gathering all publishing outputs into the [Build.ArtifactStagingDirectory](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables-devops-services), and utilizing the [outputParentDirectory](https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs#multiple-outputs) feature of 1ES pipeline templates. When implementing your pipeline, if you ensure publish artifacts are located in the `$(Build.ArtifactStagingDirectory)`, and utilize the 1ES provided template context, then you can reduce the number of security scans for your pipeline. - -Example: -``` yaml -# azure-pipelines.yml -extends: - template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate - parameters: - stages: - - stage: build - jobs: - - template: /eng/common/templates-official/jobs/jobs.yml@self - parameters: - # 1ES makes use of outputs to reduce security task injection overhead - templateContext: - outputs: - - output: pipelineArtifact - displayName: 'Publish logs from source' - continueOnError: true - condition: always() - targetPath: $(Build.ArtifactStagingDirectory)/artifacts/log - artifactName: Logs - jobs: - - job: Windows - steps: - - script: echo "friendly neighborhood" > artifacts/marvel/spiderman.txt - # copy build outputs to artifact staging directory for publishing - - task: CopyFiles@2 - displayName: Gather build output - inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/marvel' - Contents: '**' - TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/marvel' -``` - -Note: Multiple outputs are ONLY applicable to 1ES PT publishing (only usable when referencing `templates-official`). - -## Development notes - -**Folder / file structure** - -``` text -eng\common\ - [templates || templates-official]\ - job\ - job.yml (shim + artifact publishing logic) - onelocbuild.yml (shim) - publish-build-assets.yml (shim) - source-build.yml (shim) - source-index-stage1.yml (shim) - jobs\ - codeql-build.yml (shim) - jobs.yml (shim) - source-build.yml (shim) - post-build\ - post-build.yml (shim) - common-variabls.yml (shim) - setup-maestro-vars.yml (shim) - steps\ - publish-build-artifacts.yml (logic) - publish-pipeline-artifacts.yml (logic) - component-governance.yml (shim) - generate-sbom.yml (shim) - publish-logs.yml (shim) - retain-build.yml (shim) - send-to-helix.yml (shim) - source-build.yml (shim) - variables\ - pool-providers.yml (logic + redirect) # templates/variables/pool-providers.yml will redirect to templates-official/variables/pool-providers.yml if you are running in the internal project - sdl-variables.yml (logic) - core-templates\ - job\ - job.yml (logic) - onelocbuild.yml (logic) - publish-build-assets.yml (logic) - source-build.yml (logic) - source-index-stage1.yml (logic) - jobs\ - codeql-build.yml (logic) - jobs.yml (logic) - source-build.yml (logic) - post-build\ - common-variabls.yml (logic) - post-build.yml (logic) - setup-maestro-vars.yml (logic) - steps\ - component-governance.yml (logic) - generate-sbom.yml (logic) - publish-build-artifacts.yml (redirect) - publish-logs.yml (logic) - publish-pipeline-artifacts.yml (redirect) - retain-build.yml (logic) - send-to-helix.yml (logic) - source-build.yml (logic) - variables\ - pool-providers.yml (redirect) -``` - -In the table above, a file is designated as "shim", "logic", or "redirect". - -- shim - represents a yaml file which is an intermediate step between pipeline logic and .Net Core Engineering's templates (`core-templates`) and defines the `is1ESPipeline` parameter value. - -- logic - represents actual base template logic. - -- redirect- represents a file in `core-templates` which redirects to the "logic" file in either `templates` or `templates-official`. - -Logic for Arcade's templates live **primarily** in the `core-templates` folder. The exceptions to the location of the logic files are around artifact publishing, which is handled differently between 1es pipeline templates and standard templates. `templates` and `templates-official` provide shim entry points which redirect to `core-templates` while also defining the `is1ESPipeline` parameter. If a shim is referenced in `templates`, then `is1ESPipeline` is set to `false`. If a shim is referenced in `templates-official`, then `is1ESPipeline` is set to `true`. - -Within `templates` and `templates-official`, the templates at the "stages", and "jobs" / "job" level have been replaced with shims. Templates at the "steps" and "variables" level are typically too granular to be replaced with shims and instead persist logic which is directly applicable to either scenario. - -Within `core-templates`, there are a handful of places where logic is dependent on which shim entry point was used. In those places, we redirect back to the respective logic file in `templates` or `templates-official`. diff --git a/src/arcade/eng/common/templates-official/job/onelocbuild.yml b/src/arcade/eng/common/templates-official/job/onelocbuild.yml deleted file mode 100644 index 0f0c514b912..00000000000 --- a/src/arcade/eng/common/templates-official/job/onelocbuild.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/onelocbuild.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/publish-build-assets.yml b/src/arcade/eng/common/templates-official/job/publish-build-assets.yml deleted file mode 100644 index d667a70e8de..00000000000 --- a/src/arcade/eng/common/templates-official/job/publish-build-assets.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/publish-build-assets.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/source-build.yml b/src/arcade/eng/common/templates-official/job/source-build.yml deleted file mode 100644 index 1a480034b67..00000000000 --- a/src/arcade/eng/common/templates-official/job/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/source-build.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/job/source-index-stage1.yml b/src/arcade/eng/common/templates-official/job/source-index-stage1.yml deleted file mode 100644 index 6d5ead316f9..00000000000 --- a/src/arcade/eng/common/templates-official/job/source-index-stage1.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/source-index-stage1.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/codeql-build.yml b/src/arcade/eng/common/templates-official/jobs/codeql-build.yml deleted file mode 100644 index a726322ecfe..00000000000 --- a/src/arcade/eng/common/templates-official/jobs/codeql-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/codeql-build.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/jobs.yml b/src/arcade/eng/common/templates-official/jobs/jobs.yml deleted file mode 100644 index 007deddaea0..00000000000 --- a/src/arcade/eng/common/templates-official/jobs/jobs.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/jobs.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/jobs/source-build.yml b/src/arcade/eng/common/templates-official/jobs/source-build.yml deleted file mode 100644 index 483e7b611f3..00000000000 --- a/src/arcade/eng/common/templates-official/jobs/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/source-build.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/post-build/common-variables.yml b/src/arcade/eng/common/templates-official/post-build/common-variables.yml deleted file mode 100644 index c32fc49233f..00000000000 --- a/src/arcade/eng/common/templates-official/post-build/common-variables.yml +++ /dev/null @@ -1,8 +0,0 @@ -variables: -- template: /eng/common/core-templates/post-build/common-variables.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/post-build/post-build.yml b/src/arcade/eng/common/templates-official/post-build/post-build.yml deleted file mode 100644 index 2364c0fd4a5..00000000000 --- a/src/arcade/eng/common/templates-official/post-build/post-build.yml +++ /dev/null @@ -1,8 +0,0 @@ -stages: -- template: /eng/common/core-templates/post-build/post-build.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml deleted file mode 100644 index 024397d8786..00000000000 --- a/src/arcade/eng/common/templates-official/post-build/setup-maestro-vars.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: -- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/component-governance.yml b/src/arcade/eng/common/templates-official/steps/component-governance.yml deleted file mode 100644 index 30bb3985ca2..00000000000 --- a/src/arcade/eng/common/templates-official/steps/component-governance.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/component-governance.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml deleted file mode 100644 index f9dd238c6cd..00000000000 --- a/src/arcade/eng/common/templates-official/steps/enable-internal-runtimes.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' -# variable with the base64-encoded SAS token, by default -steps: -- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml b/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml deleted file mode 100644 index e6d57182284..00000000000 --- a/src/arcade/eng/common/templates-official/steps/enable-internal-sources.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/enable-internal-sources.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/generate-sbom.yml b/src/arcade/eng/common/templates-official/steps/generate-sbom.yml deleted file mode 100644 index 9a89a4706d9..00000000000 --- a/src/arcade/eng/common/templates-official/steps/generate-sbom.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/generate-sbom.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml b/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml deleted file mode 100644 index c5a9c1f8275..00000000000 --- a/src/arcade/eng/common/templates-official/steps/get-delegation-sas.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/get-delegation-sas.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml b/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml deleted file mode 100644 index c8dcf6b8139..00000000000 --- a/src/arcade/eng/common/templates-official/steps/get-federated-access-token.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/get-federated-access-token.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/steps/publish-logs.yml b/src/arcade/eng/common/templates-official/steps/publish-logs.yml deleted file mode 100644 index 579fd531e94..00000000000 --- a/src/arcade/eng/common/templates-official/steps/publish-logs.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/publish-logs.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml deleted file mode 100644 index 172f9f0fdc9..00000000000 --- a/src/arcade/eng/common/templates-official/steps/publish-pipeline-artifacts.yml +++ /dev/null @@ -1,28 +0,0 @@ -parameters: -- name: is1ESPipeline - type: boolean - default: true - -- name: args - type: object - default: {} - -steps: -- ${{ if ne(parameters.is1ESPipeline, true) }}: - - 'eng/common/templates-official cannot be referenced from a non-1ES managed template': error -- task: 1ES.PublishPipelineArtifact@1 - displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} - ${{ if parameters.args.condition }}: - condition: ${{ parameters.args.condition }} - ${{ else }}: - condition: succeeded() - ${{ if parameters.args.continueOnError }}: - continueOnError: ${{ parameters.args.continueOnError }} - inputs: - targetPath: ${{ parameters.args.targetPath }} - ${{ if parameters.args.artifactName }}: - artifactName: ${{ parameters.args.artifactName }} - ${{ if parameters.args.properties }}: - properties: ${{ parameters.args.properties }} - ${{ if parameters.args.sbomEnabled }}: - sbomEnabled: ${{ parameters.args.sbomEnabled }} diff --git a/src/arcade/eng/common/templates-official/steps/retain-build.yml b/src/arcade/eng/common/templates-official/steps/retain-build.yml deleted file mode 100644 index 5594551508a..00000000000 --- a/src/arcade/eng/common/templates-official/steps/retain-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/retain-build.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/send-to-helix.yml b/src/arcade/eng/common/templates-official/steps/send-to-helix.yml deleted file mode 100644 index 6500f21bf84..00000000000 --- a/src/arcade/eng/common/templates-official/steps/send-to-helix.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/send-to-helix.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/steps/source-build.yml b/src/arcade/eng/common/templates-official/steps/source-build.yml deleted file mode 100644 index 8f92c49e7b0..00000000000 --- a/src/arcade/eng/common/templates-official/steps/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/source-build.yml - parameters: - is1ESPipeline: true - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates-official/variables/pool-providers.yml b/src/arcade/eng/common/templates-official/variables/pool-providers.yml deleted file mode 100644 index 1f308b24efc..00000000000 --- a/src/arcade/eng/common/templates-official/variables/pool-providers.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, -# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. - -# Motivation: -# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS -# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing -# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. -# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services -# team needs to move resources around and create new and potentially differently-named pools. Using this template -# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. - -# How to use: -# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). -# If we find alternate naming conventions in broad usage it can be added to the condition below. -# -# First, import the template in an arcade-ified repo to pick up the variables, e.g.: -# -# variables: -# - template: /eng/common/templates-official/variables/pool-providers.yml -# -# ... then anywhere specifying the pool provider use the runtime variables, -# $(DncEngInternalBuildPool) -# -# pool: -# name: $(DncEngInternalBuildPool) -# image: 1es-windows-2022 - -variables: - # Coalesce the target and source branches so we know when a PR targets a release branch - # If these variables are somehow missing, fall back to main (tends to have more capacity) - - # Any new -Svc alternative pools should have variables added here to allow for splitting work - - - name: DncEngInternalBuildPool - value: $[ - replace( - replace( - eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), - True, - 'NetCore1ESPool-Svc-Internal' - ), - False, - 'NetCore1ESPool-Internal' - ) - ] \ No newline at end of file diff --git a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml b/src/arcade/eng/common/templates-official/variables/sdl-variables.yml deleted file mode 100644 index dbdd66d4a4b..00000000000 --- a/src/arcade/eng/common/templates-official/variables/sdl-variables.yml +++ /dev/null @@ -1,7 +0,0 @@ -variables: -# The Guardian version specified in 'eng/common/sdl/packages.config'. This value must be kept in -# sync with the packages.config file. -- name: DefaultGuardianVersion - value: 0.109.0 -- name: GuardianPackagesConfigFile - value: $(Build.SourcesDirectory)\eng\common\sdl\packages.config \ No newline at end of file diff --git a/src/arcade/eng/common/templates/job/onelocbuild.yml b/src/arcade/eng/common/templates/job/onelocbuild.yml deleted file mode 100644 index ff829dc4c70..00000000000 --- a/src/arcade/eng/common/templates/job/onelocbuild.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/onelocbuild.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/publish-build-assets.yml b/src/arcade/eng/common/templates/job/publish-build-assets.yml deleted file mode 100644 index ab2edec2adb..00000000000 --- a/src/arcade/eng/common/templates/job/publish-build-assets.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/publish-build-assets.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/source-build.yml b/src/arcade/eng/common/templates/job/source-build.yml deleted file mode 100644 index e44d47b1d76..00000000000 --- a/src/arcade/eng/common/templates/job/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/source-build.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/job/source-index-stage1.yml b/src/arcade/eng/common/templates/job/source-index-stage1.yml deleted file mode 100644 index 89f3291593c..00000000000 --- a/src/arcade/eng/common/templates/job/source-index-stage1.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/job/source-index-stage1.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/codeql-build.yml b/src/arcade/eng/common/templates/jobs/codeql-build.yml deleted file mode 100644 index 517f24d6a52..00000000000 --- a/src/arcade/eng/common/templates/jobs/codeql-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/codeql-build.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/jobs.yml b/src/arcade/eng/common/templates/jobs/jobs.yml deleted file mode 100644 index 388e9037b3e..00000000000 --- a/src/arcade/eng/common/templates/jobs/jobs.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/jobs.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/jobs/source-build.yml b/src/arcade/eng/common/templates/jobs/source-build.yml deleted file mode 100644 index 818d4c326db..00000000000 --- a/src/arcade/eng/common/templates/jobs/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -jobs: -- template: /eng/common/core-templates/jobs/source-build.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/common-variables.yml b/src/arcade/eng/common/templates/post-build/common-variables.yml deleted file mode 100644 index 7fa10587559..00000000000 --- a/src/arcade/eng/common/templates/post-build/common-variables.yml +++ /dev/null @@ -1,8 +0,0 @@ -variables: -- template: /eng/common/core-templates/post-build/common-variables.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/post-build.yml b/src/arcade/eng/common/templates/post-build/post-build.yml deleted file mode 100644 index 53ede714bdd..00000000000 --- a/src/arcade/eng/common/templates/post-build/post-build.yml +++ /dev/null @@ -1,8 +0,0 @@ -stages: -- template: /eng/common/core-templates/post-build/post-build.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml b/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml deleted file mode 100644 index a79fab5b441..00000000000 --- a/src/arcade/eng/common/templates/post-build/setup-maestro-vars.yml +++ /dev/null @@ -1,8 +0,0 @@ -steps: -- template: /eng/common/core-templates/post-build/setup-maestro-vars.yml - parameters: - # Specifies whether to use 1ES - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/component-governance.yml b/src/arcade/eng/common/templates/steps/component-governance.yml deleted file mode 100644 index c12a5f8d21d..00000000000 --- a/src/arcade/eng/common/templates/steps/component-governance.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/component-governance.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml b/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml deleted file mode 100644 index b21a8038cc1..00000000000 --- a/src/arcade/eng/common/templates/steps/enable-internal-runtimes.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64' -# variable with the base64-encoded SAS token, by default - -steps: -- template: /eng/common/core-templates/steps/enable-internal-runtimes.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/enable-internal-sources.yml b/src/arcade/eng/common/templates/steps/enable-internal-sources.yml deleted file mode 100644 index 5f87e9abb8a..00000000000 --- a/src/arcade/eng/common/templates/steps/enable-internal-sources.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/enable-internal-sources.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/generate-sbom.yml b/src/arcade/eng/common/templates/steps/generate-sbom.yml deleted file mode 100644 index 26dc00a2e0f..00000000000 --- a/src/arcade/eng/common/templates/steps/generate-sbom.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/generate-sbom.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/get-delegation-sas.yml b/src/arcade/eng/common/templates/steps/get-delegation-sas.yml deleted file mode 100644 index 83760c9798e..00000000000 --- a/src/arcade/eng/common/templates/steps/get-delegation-sas.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/get-delegation-sas.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/get-federated-access-token.yml b/src/arcade/eng/common/templates/steps/get-federated-access-token.yml deleted file mode 100644 index 31e151d9d9e..00000000000 --- a/src/arcade/eng/common/templates/steps/get-federated-access-token.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/get-federated-access-token.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/publish-logs.yml b/src/arcade/eng/common/templates/steps/publish-logs.yml deleted file mode 100644 index 4ea86bd8823..00000000000 --- a/src/arcade/eng/common/templates/steps/publish-logs.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/publish-logs.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml b/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml deleted file mode 100644 index 5dd698b212f..00000000000 --- a/src/arcade/eng/common/templates/steps/publish-pipeline-artifacts.yml +++ /dev/null @@ -1,34 +0,0 @@ -parameters: -- name: is1ESPipeline - type: boolean - default: false - -- name: args - type: object - default: {} - -steps: -- ${{ if eq(parameters.is1ESPipeline, true) }}: - - 'eng/common/templates cannot be referenced from a 1ES managed template': error -- task: PublishPipelineArtifact@1 - displayName: ${{ coalesce(parameters.args.displayName, 'Publish to Build Artifact') }} - ${{ if parameters.args.condition }}: - condition: ${{ parameters.args.condition }} - ${{ else }}: - condition: succeeded() - ${{ if parameters.args.continueOnError }}: - continueOnError: ${{ parameters.args.continueOnError }} - inputs: - targetPath: ${{ parameters.args.targetPath }} - ${{ if parameters.args.artifactName }}: - artifactName: ${{ parameters.args.artifactName }} - ${{ if parameters.args.publishLocation }}: - publishLocation: ${{ parameters.args.publishLocation }} - ${{ if parameters.args.fileSharePath }}: - fileSharePath: ${{ parameters.args.fileSharePath }} - ${{ if parameters.args.Parallel }}: - parallel: ${{ parameters.args.Parallel }} - ${{ if parameters.args.parallelCount }}: - parallelCount: ${{ parameters.args.parallelCount }} - ${{ if parameters.args.properties }}: - properties: ${{ parameters.args.properties }} \ No newline at end of file diff --git a/src/arcade/eng/common/templates/steps/retain-build.yml b/src/arcade/eng/common/templates/steps/retain-build.yml deleted file mode 100644 index 8e841ace3d2..00000000000 --- a/src/arcade/eng/common/templates/steps/retain-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/retain-build.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/send-to-helix.yml b/src/arcade/eng/common/templates/steps/send-to-helix.yml deleted file mode 100644 index 39f99fc2762..00000000000 --- a/src/arcade/eng/common/templates/steps/send-to-helix.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/send-to-helix.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/steps/source-build.yml b/src/arcade/eng/common/templates/steps/source-build.yml deleted file mode 100644 index 23c1d6f4e9f..00000000000 --- a/src/arcade/eng/common/templates/steps/source-build.yml +++ /dev/null @@ -1,7 +0,0 @@ -steps: -- template: /eng/common/core-templates/steps/source-build.yml - parameters: - is1ESPipeline: false - - ${{ each parameter in parameters }}: - ${{ parameter.key }}: ${{ parameter.value }} diff --git a/src/arcade/eng/common/templates/variables/pool-providers.yml b/src/arcade/eng/common/templates/variables/pool-providers.yml deleted file mode 100644 index e0b19c14a07..00000000000 --- a/src/arcade/eng/common/templates/variables/pool-providers.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool, -# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches. - -# Motivation: -# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS -# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing -# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS. -# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services -# team needs to move resources around and create new and potentially differently-named pools. Using this template -# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming. - -# How to use: -# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do). -# If we find alternate naming conventions in broad usage it can be added to the condition below. -# -# First, import the template in an arcade-ified repo to pick up the variables, e.g.: -# -# variables: -# - template: /eng/common/templates/variables/pool-providers.yml -# -# ... then anywhere specifying the pool provider use the runtime variables, -# $(DncEngInternalBuildPool) and $ (DncEngPublicBuildPool), e.g.: -# -# pool: -# name: $(DncEngInternalBuildPool) -# demands: ImageOverride -equals windows.vs2019.amd64 -variables: - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - - template: /eng/common/templates-official/variables/pool-providers.yml - - ${{ else }}: - # Coalesce the target and source branches so we know when a PR targets a release branch - # If these variables are somehow missing, fall back to main (tends to have more capacity) - - # Any new -Svc alternative pools should have variables added here to allow for splitting work - - name: DncEngPublicBuildPool - value: $[ - replace( - replace( - eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), - True, - 'NetCore-Svc-Public' - ), - False, - 'NetCore-Public' - ) - ] - - - name: DncEngInternalBuildPool - value: $[ - replace( - replace( - eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'), - True, - 'NetCore1ESPool-Svc-Internal' - ), - False, - 'NetCore1ESPool-Internal' - ) - ] From 5db953fd520a4af9dafd0ad0ed4e1f1254d5f65a Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Fri, 16 May 2025 09:05:44 +0200 Subject: [PATCH 093/134] Update automerge config (#18552) --- .config/service-branch-merge.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/service-branch-merge.json b/.config/service-branch-merge.json index 9eaf6479d45..ec35ec5bcb5 100644 --- a/.config/service-branch-merge.json +++ b/.config/service-branch-merge.json @@ -1,12 +1,16 @@ { "merge-flow-configurations": { // regular branch flow + "release/dev17.12": { + "MergeToBranch": "release/dev17.13", + "ExtraSwitches": "-QuietComments" + }, "release/dev17.13": { - "MergeToBranch": "main", + "MergeToBranch": "release/dev17.14", "ExtraSwitches": "-QuietComments" }, "release/dev17.14": { - "MergeToBranch": "release/dev18.0", + "MergeToBranch": "main", "ExtraSwitches": "-QuietComments" }, "main": { From 8b7bf60d712eb673586231f1e94fe254c3cb0b44 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Fri, 16 May 2025 12:29:35 +0100 Subject: [PATCH 094/134] Allow `let!` and `use!` binding with type annotation without parentheses. (#18508) --- .../.FSharp.Compiler.Service/10.0.100.md | 3 + docs/release-notes/.Language/preview.md | 1 + .../CheckComputationExpressions.fs | 4 + src/Compiler/FSComp.txt | 1 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/pars.fsy | 33 +++++ src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + .../UseBindings/UseBang05.fs | 58 ++++++++ .../UseBindings/UseBangBindings.fs | 22 +++ .../UseBindings/UseBinding01.fs | 7 + .../UseBindings/UseBinding02.fs | 26 ++++ .../UseBindings/UseBindingDiscard03.fs | 26 ++++ .../UseBindings/UseBindings.fs | 23 +++- .../SyntaxTree/SynType/Typed LetBang 01.fs | 6 + .../SynType/Typed LetBang 01.fs.bsl | 36 +++++ .../SyntaxTree/SynType/Typed LetBang 02.fs | 6 + .../SynType/Typed LetBang 02.fs.bsl | 38 ++++++ .../SyntaxTree/SynType/Typed LetBang 03.fs | 7 + .../SynType/Typed LetBang 03.fs.bsl | 125 ++++++++++++++++++ .../SyntaxTree/SynType/Typed LetBang 04.fs | 7 + .../SynType/Typed LetBang 04.fs.bsl | 51 +++++++ .../SyntaxTree/SynType/Typed LetBang 05.fs | 3 + .../SynType/Typed LetBang 05.fs.bsl | 47 +++++++ .../SyntaxTree/SynType/Typed LetBang 06.fs | 3 + .../SynType/Typed LetBang 06.fs.bsl | 47 +++++++ .../SyntaxTree/SynType/Typed UseBang 01.fs | 6 + .../SynType/Typed UseBang 01.fs.bsl | 36 +++++ .../SyntaxTree/SynType/Typed UseBang 02.fs | 6 + .../SynType/Typed UseBang 02.fs.bsl | 38 ++++++ .../SyntaxTree/SynType/Typed UseBang 03.fs | 4 + .../SynType/Typed UseBang 03.fs.bsl | 47 +++++++ .../SyntaxTree/SynType/Typed UseBang 04.fs | 4 + .../SynType/Typed UseBang 04.fs.bsl | 47 +++++++ 46 files changed, 836 insertions(+), 1 deletion(-) create mode 100644 docs/release-notes/.FSharp.Compiler.Service/10.0.100.md create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang05.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding01.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding02.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard03.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs create mode 100644 tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md new file mode 100644 index 00000000000..52228f33b09 --- /dev/null +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -0,0 +1,3 @@ +### Fixed + +* Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 4a420016a14..40775e8dfa6 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -7,6 +7,7 @@ * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) * Scoped Nowarn: added 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)) +* Allow `let!` and `use!` type annotations without requiring parentheses. ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) ### Fixed diff --git a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs index f861665a5fc..0d2404c5b1a 100644 --- a/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckComputationExpressions.fs @@ -1793,6 +1793,9 @@ let rec TryTranslateComputationExpression let supportsUseBangBindingValueDiscard = ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.UseBangBindingValueDiscard + let supportsTypedLetOrUseBang = + ceenv.cenv.g.langVersion.SupportsFeature LanguageFeature.AllowTypedLetOrUseBang + // use! x = ... // use! (x) = ... // use! (__) = ... @@ -1802,6 +1805,7 @@ let rec TryTranslateComputationExpression match pat with | SynPat.Named(ident = SynIdent(id, _); isThisVal = false) -> id, pat | SynPat.LongIdent(longDotId = SynLongIdent(id = [ id ])) -> id, pat + | SynPat.Typed(pat = pat) when supportsTypedLetOrUseBang -> extractIdentifierFromPattern pat | SynPat.Wild(m) when supportsUseBangBindingValueDiscard -> // To properly call the Using(disposable) CE member, we need to convert the wildcard to a SynPat.Named let tmpIdent = mkSynId m "_" diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 010088e958e..1d7e9d6499a 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1800,6 +1800,7 @@ featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid typ featureSupportWarnWhenUnitPassedToObjArg,"Warn when unit is passed to a member accepting `obj` argument, e.g. `Method(o:obj)` will warn if called via `Method()`." featureUseBangBindingValueDiscard,"Allows use! _ = ... in computation expressions" featureScopedNowarn,"Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules" +featureAllowLetOrUseBangTypeAnnotationWithoutParens,"Allow let! and use! type annotations without requiring parentheses" 3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" 3875,lexWarnDirectiveMustHaveArgs,"Warn directives must have warning number(s) as argument(s)" 3876,lexWarnDirectivesMustMatch,"There is another %s for this warning already in line %d." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 763452592a4..fd0f646531b 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -101,6 +101,7 @@ type LanguageFeature = | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard | ScopedNowarn + | AllowTypedLetOrUseBang /// LanguageVersion management type LanguageVersion(versionText) = @@ -233,6 +234,7 @@ type LanguageVersion(versionText) = LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion LanguageFeature.UseBangBindingValueDiscard, previewVersion LanguageFeature.ScopedNowarn, previewVersion + LanguageFeature.AllowTypedLetOrUseBang, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -397,6 +399,7 @@ type LanguageVersion(versionText) = | LanguageFeature.WarnWhenUnitPassedToObjArg -> FSComp.SR.featureSupportWarnWhenUnitPassedToObjArg () | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () | LanguageFeature.ScopedNowarn -> FSComp.SR.featureScopedNowarn () + | LanguageFeature.AllowTypedLetOrUseBang -> FSComp.SR.featureAllowLetOrUseBangTypeAnnotationWithoutParens () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index a452205765e..95bd956e0b7 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -92,6 +92,7 @@ type LanguageFeature = | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard | ScopedNowarn + | AllowTypedLetOrUseBang /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 7326c4a6a12..61f8e2fef86 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -4466,6 +4466,39 @@ declExpr: let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, $2, $4, $7, $8, m, trivia) } + | BINDER headBindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock IN opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let + { // Handle type annotations on patterns in let!/use! bindings + // Examples: let! x: int = async { return 1 } + // use! _: IDisposable = async { return new MemoryStream() } + let spBind = DebugPointAtBinding.Yes(rhs2 parseState 1 7) + let pat = + match $3 with + | None -> $2 + | Some (_, SynReturnInfo((ty, _), _)) -> + SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang pat.Range + let mEquals = rhs parseState 4 + let m = unionRanges (rhs parseState 1) $9.Range + let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } + SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, pat, $5, $8, $9, m, trivia) } + + | OBINDER headBindingPattern opt_topReturnTypeWithTypeConstraints EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let + { // Handle type annotations on patterns in let!/use! bindings (offside-sensitive version) + // This rule maintains consistent handling of binding constructs across different syntactic contexts + let report, mIn, _ = $6 + report (if $1 = "use" then "use!" else "let!") (rhs parseState 1) // report unterminated error + let spBind = DebugPointAtBinding.Yes(unionRanges (rhs parseState 1) $5.Range) + let pat = + match $3 with + | None -> $2 + | Some (_, SynReturnInfo((ty, _), _)) -> + SynPat.Typed($2, ty, unionRanges $2.Range ty.Range) + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang pat.Range + let mEquals = rhs parseState 4 + let m = unionRanges (rhs parseState 1) $9.Range + let trivia: SynExprLetOrUseBangTrivia = { LetOrUseBangKeyword = rhs parseState 1 ; EqualsRange = Some mEquals } + SynExpr.LetOrUseBang(spBind, ($1 = "use"), true, pat, $5, $8, $9, m, trivia) } + | OBINDER headBindingPattern EQUALS typedSequentialExprBlock hardwhiteDefnBindingsTerminator opt_OBLOCKSEP error %prec expr_let { // error recovery that allows intellisense when writing incomplete computation expressions let spBind = DebugPointAtBinding.Yes(unionRanges (rhs parseState 1) $4.Range) diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index de5b2815fdc..caa825a8245 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 53bf24ff3e9..2d193f09a0e 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 483e820ed5c..1e0f79d0124 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index f003166db2d..71a14ff33f0 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index e4c08f83cb2..12f56c30e93 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 7d56499a955..d84ecad7170 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 887f0f199f1..39c3a728b37 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 589e0f8535e..e5f2bda5529 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 5af5b7fcd34..c69f534b10e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index e8747be3f5c..ca41d4affcc 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index a2d6e89305c..17a75ffa27c 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index fce23f29c9a..155480c6314 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index d2563922fc3..3c96310c8a7 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -287,6 +287,11 @@ Allow access modifiers to auto properties getters and setters + + Allow let! and use! type annotations without requiring parentheses + Allow let! and use! type annotations without requiring parentheses + + Allow object expressions without overrides Allow object expressions without overrides diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang05.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang05.fs new file mode 100644 index 00000000000..7bd2b4cd827 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBang05.fs @@ -0,0 +1,58 @@ +open System + +open System + +type Disposable(id: int) = + static let mutable disposedIds = Set.empty + static let mutable constructedIds = Set.empty + + do constructedIds <- constructedIds.Add(id) + + member _.Id = id + + static member GetDisposed() = disposedIds + static member GetConstructed() = constructedIds + static member Reset() = + disposedIds <- Set.empty + constructedIds <- Set.empty + + interface IDisposable with + member this.Dispose() = disposedIds <- disposedIds.Add(this.Id) + +type DisposableBuilder() = + member _.Using(resource: #IDisposable, f) = + async { + use res = resource + return! f res + } + + member _.Bind(disposable: Disposable, f) = async.Bind(async.Return(disposable), f) + member _.Return(x) = async.Return x + member _.ReturnFrom(x) = x + member _.Bind(task, f) = async.Bind(task, f) + +let counterDisposable = DisposableBuilder() + +let testBindingPatterns() = + Disposable.Reset() + + counterDisposable { + use! res:IDisposable = new Disposable(1) + use! __:IDisposable = new Disposable(2) + use! (res1: IDisposable) = new Disposable(3) + use! _: IDisposable = new Disposable(4) + use! (_: IDisposable) = new Disposable(5) + return () + } |> Async.RunSynchronously + + let constructed = Disposable.GetConstructed() + let disposed = Disposable.GetDisposed() + let undisposed = constructed - disposed + + if not undisposed.IsEmpty then + printfn $"Undisposed instances: %A{undisposed}" + failwithf "Not all disposables were properly disposed" + else + printfn $"Success! All %d{constructed.Count} disposables were properly disposed" + +testBindingPatterns() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs index ba0f31bd885..37c1447e89e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBangBindings.fs @@ -50,6 +50,19 @@ module UseBangBindingsVersion9 = |> withDiagnostics [ (Error 1228, Line 47, Col 14, Line 47, Col 15, "'use!' bindings must be of the form 'use! = '") ] + + [] + let ``UseBangBindings - UseBang05_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 43, Col 14, Line 43, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 41, Col 14, Line 41, Col 28, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 40, Col 14, Line 40, Col 29, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] module UseBangBindingsPreview = [] @@ -83,4 +96,13 @@ module UseBangBindingsPreview = |> withLangVersionPreview |> compileAndRun |> shouldSucceed + + [] + let ``UseBangBindings - UseBang05_fs - Preview LangVersion`` compilation = + compilation + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding01.fs new file mode 100644 index 00000000000..4fbe7575b3a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding01.fs @@ -0,0 +1,7 @@ +// #DeclarationElements #LetBindings +// +open System + +let answer = + use x:IDisposable = new System.IO.MemoryStream() + 42 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding02.fs new file mode 100644 index 00000000000..be6cf7b8399 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBinding02.fs @@ -0,0 +1,26 @@ +open System + +type private Disposable() = + [] static val mutable private disposedTimes: int + [] static val mutable private constructedTimes: int + + do Disposable.constructedTimes <- Disposable.constructedTimes + 1 + + static member DisposeCallCount() = Disposable.disposedTimes + static member ConstructorCallCount() = Disposable.constructedTimes + + interface System.IDisposable with + member _.Dispose() = + Disposable.disposedTimes <- Disposable.disposedTimes + 1 + +let _scope = + use x: IDisposable = new Disposable() + () + +let disposeCalls = Disposable.DisposeCallCount() +if disposeCalls <> 1 then + failwith "was not disposed or disposed too many times" + +let ctorCalls = Disposable.ConstructorCallCount() +if ctorCalls <> 1 then + failwithf "unexpected constructor call count: %i" ctorCalls diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard03.fs new file mode 100644 index 00000000000..840870377fe --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindingDiscard03.fs @@ -0,0 +1,26 @@ +open System + +type private Disposable() = + [] static val mutable private disposedTimes: int + [] static val mutable private constructedTimes: int + + do Disposable.constructedTimes <- Disposable.constructedTimes + 1 + + static member DisposeCallCount() = Disposable.disposedTimes + static member ConstructorCallCount() = Disposable.constructedTimes + + interface System.IDisposable with + member _.Dispose() = + Disposable.disposedTimes <- Disposable.disposedTimes + 1 + +let _scope = + use _:IDisposable = new Disposable() + () + +let disposeCalls = Disposable.DisposeCallCount() +if disposeCalls <> 1 then + failwith "was not disposed or disposed too many times" + +let ctorCalls = Disposable.ConstructorCallCount() +if ctorCalls <> 1 then + failwithf "unexpected constructor call count: %i" ctorCalls diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs index 74137286a8a..b1e08869312 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/UseBindings/UseBindings.fs @@ -33,4 +33,25 @@ module UseBindings = |> asExe |> withLangVersion60 |> compileAndRun - |> shouldSucceed \ No newline at end of file + |> shouldSucceed + + [] + let ``UseBindings - UseBindingDiscard03_fs - Current LangVersion`` compilation = + compilation + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``UseBindings - UseBinding01_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> compile + |> shouldSucceed + + [] + let ``UseBindings - UseBinding02_fs - Current LangVersion`` compilation = + compilation + |> asFsx + |> compile + |> shouldSucceed diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs new file mode 100644 index 00000000000..f191f7aee2b --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs @@ -0,0 +1,6 @@ +module Module + +async { + let! res: int = async { return 1 } + return res +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl new file mode 100644 index 00000000000..1aa552d5f05 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl @@ -0,0 +1,36 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,38), false, true, + Typed + (Named (SynIdent (res, None), false, None, (4,9--4,12)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,9--4,17)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,35--4,36)), + (4,28--4,36), + { YieldOrReturnKeyword = (4,28--4,34) }), + (4,26--4,38)), (4,20--4,38)), [], + YieldOrReturn + ((false, true), Ident res, (5,4--5,14), + { YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,18--4,19) }), (3,6--6,1)), + (3,0--6,1)), (3,0--6,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs new file mode 100644 index 00000000000..4d58841b1d6 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs @@ -0,0 +1,6 @@ +module Module + +async { + let! (res: int) = async { return 1 } + return res +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl new file mode 100644 index 00000000000..6046708ca7f --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl @@ -0,0 +1,38 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,40), false, true, + Paren + (Typed + (Named + (SynIdent (res, None), false, None, (4,10--4,13)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,10--4,18)), (4,9--4,19)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,37--4,38)), + (4,30--4,38), + { YieldOrReturnKeyword = (4,30--4,36) }), + (4,28--4,40)), (4,22--4,40)), [], + YieldOrReturn + ((false, true), Ident res, (5,4--5,14), + { YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,20--4,21) }), (3,6--6,1)), + (3,0--6,1)), (3,0--6,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs new file mode 100644 index 00000000000..5c5e72047cc --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs @@ -0,0 +1,7 @@ +module Module + +async { + let (a: int, b: int) = 1, 3 + let! (c: int, d: int) = async { return 1, 3 } + return a + b + c + d +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl new file mode 100644 index 00000000000..c065ea59e32 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl @@ -0,0 +1,125 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUse + (false, false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Paren + (Tuple + (false, + [Typed + (Named + (SynIdent (a, None), false, None, + (4,9--4,10)), + LongIdent + (SynLongIdent ([int], [], [None])), + (4,9--4,15)); + Typed + (Named + (SynIdent (b, None), false, None, + (4,17--4,18)), + LongIdent + (SynLongIdent ([int], [], [None])), + (4,17--4,23))], [(4,15--4,16)], (4,9--4,23)), + (4,8--4,24)), None, + Tuple + (false, + [Const (Int32 1, (4,27--4,28)); + Const (Int32 3, (4,30--4,31))], [(4,28--4,29)], + (4,27--4,31)), (4,8--4,24), Yes (4,4--4,31), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = Some (4,25--4,26) })], + LetOrUseBang + (Yes (5,4--5,49), false, true, + Paren + (Tuple + (false, + [Typed + (Named + (SynIdent (c, None), false, None, + (5,10--5,11)), + LongIdent (SynLongIdent ([int], [], [None])), + (5,10--5,16)); + Typed + (Named + (SynIdent (d, None), false, None, + (5,18--5,19)), + LongIdent (SynLongIdent ([int], [], [None])), + (5,18--5,24))], [(5,16--5,17)], (5,10--5,24)), + (5,9--5,25)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Tuple + (false, + [Const (Int32 1, (5,43--5,44)); + Const (Int32 3, (5,46--5,47))], + [(5,44--5,45)], (5,43--5,47)), + (5,36--5,47), + { YieldOrReturnKeyword = (5,36--5,42) }), + (5,34--5,49)), (5,28--5,49)), [], + YieldOrReturn + ((false, true), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (6,21--6,22)), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), + None, (6,17--6,18)), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some + (OriginalNotation "+")]), + None, (6,13--6,14)), Ident a, + (6,11--6,14)), Ident b, + (6,11--6,16)), (6,11--6,18)), + Ident c, (6,11--6,20)), (6,11--6,22)), + Ident d, (6,11--6,24)), (6,4--6,24), + { YieldOrReturnKeyword = (6,4--6,10) }), + (5,4--6,24), { LetOrUseBangKeyword = (5,4--5,8) + EqualsRange = Some (5,26--5,27) }), + (4,4--6,24), { LetOrUseKeyword = (4,4--4,7) + InKeyword = None }), (3,6--7,1)), + (3,0--7,1)), (3,0--7,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs new file mode 100644 index 00000000000..2a1e0319849 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs @@ -0,0 +1,7 @@ +module Module + +async { + let a: int, b: int = 1, 3 + let! c: int, d: int = async { return 1, 3 } + return a + b + c + d +} \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs.bsl new file mode 100644 index 00000000000..fc39d00e0a5 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs.bsl @@ -0,0 +1,51 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + Tuple + (false, + [LetOrUse + (false, false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, + SynValInfo ([], SynArgInfo ([], false, None)), + None), + Named + (SynIdent (a, None), false, None, (4,8--4,9)), + Some + (SynBindingReturnInfo + (LongIdent + (SynLongIdent ([int], [], [None])), + (4,11--4,14), [], + { ColonRange = Some (4,9--4,10) })), + Typed + (ArbitraryAfterError + ("localBinding2", (4,14--4,14)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,14--4,14)), (4,8--4,9), Yes (4,4--4,14), + { LeadingKeyword = Let (4,4--4,7) + InlineKeyword = None + EqualsRange = None })], + ArbitraryAfterError ("declExpr3", (5,15--5,16)), + (4,4--5,16), { LetOrUseKeyword = (4,4--4,7) + InKeyword = None }); Ident d], + [(5,15--5,16)], (4,4--5,18)), (3,6--5,47)), (3,0--5,47)), + (3,0--5,47))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,47), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(4,14)-(4,15) parse error Unexpected symbol ',' in binding. Expected '=' or other token. +(5,15)-(5,16) parse error Unexpected symbol ',' in expression. Expected '=' or other token. +(6,4)-(6,10) parse error Incomplete structured construct at or before this point in implementation file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs new file mode 100644 index 00000000000..be48e42bb81 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs @@ -0,0 +1,3 @@ +module Module +let! x:int = async { return 1 } +let! (y:int) = async { return 2 } \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs.bsl new file mode 100644 index 00000000000..08008766b4d --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 05.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 05.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUseBang + (Yes (2,0--2,31), false, true, + Typed + (Named (SynIdent (x, None), false, None, (2,5--2,6)), + LongIdent (SynLongIdent ([int], [], [None])), (2,5--2,10)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (2,28--2,29)), + (2,21--2,29), { YieldOrReturnKeyword = (2,21--2,27) }), + (2,19--2,31)), (2,13--2,31)), [], + LetOrUseBang + (Yes (3,0--3,33), false, true, + Paren + (Typed + (Named (SynIdent (y, None), false, None, (3,6--3,7)), + LongIdent (SynLongIdent ([int], [], [None])), + (3,6--3,11)), (3,5--3,12)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (3,30--3,31)), + (3,23--3,31), + { YieldOrReturnKeyword = (3,23--3,29) }), + (3,21--3,33)), (3,15--3,33)), [], + ImplicitZero (3,33--3,33), (3,0--3,33), + { LetOrUseBangKeyword = (3,0--3,4) + EqualsRange = Some (3,13--3,14) }), (2,0--3,33), + { LetOrUseBangKeyword = (2,0--2,4) + EqualsRange = Some (2,11--2,12) }), (2,0--3,33))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(3,0)-(3,33) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs b/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs new file mode 100644 index 00000000000..4dfb5dcf98a --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs @@ -0,0 +1,3 @@ +module Module +let! _:int = async { return 1 } +let! (_:int) = async { return 2 } \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs.bsl new file mode 100644 index 00000000000..591ef048599 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed LetBang 06.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed LetBang 06.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUseBang + (Yes (2,0--2,31), false, true, + Typed + (Wild (2,5--2,6), + LongIdent (SynLongIdent ([int], [], [None])), (2,5--2,10)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (2,28--2,29)), + (2,21--2,29), { YieldOrReturnKeyword = (2,21--2,27) }), + (2,19--2,31)), (2,13--2,31)), [], + LetOrUseBang + (Yes (3,0--3,33), false, true, + Paren + (Typed + (Wild (3,6--3,7), + LongIdent (SynLongIdent ([int], [], [None])), + (3,6--3,11)), (3,5--3,12)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (3,30--3,31)), + (3,23--3,31), + { YieldOrReturnKeyword = (3,23--3,29) }), + (3,21--3,33)), (3,15--3,33)), [], + ImplicitZero (3,33--3,33), (3,0--3,33), + { LetOrUseBangKeyword = (3,0--3,4) + EqualsRange = Some (3,13--3,14) }), (2,0--3,33), + { LetOrUseBangKeyword = (2,0--2,4) + EqualsRange = Some (2,11--2,12) }), (2,0--3,33))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(3,0)-(3,33) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs b/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs new file mode 100644 index 00000000000..840c1678319 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs @@ -0,0 +1,6 @@ +module Module + +async { + use! res: int = async { return 1 } + return res +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs.bsl new file mode 100644 index 00000000000..a49e9a4abf3 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 01.fs.bsl @@ -0,0 +1,36 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed UseBang 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,38), true, true, + Typed + (Named (SynIdent (res, None), false, None, (4,9--4,12)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,9--4,17)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,35--4,36)), + (4,28--4,36), + { YieldOrReturnKeyword = (4,28--4,34) }), + (4,26--4,38)), (4,20--4,38)), [], + YieldOrReturn + ((false, true), Ident res, (5,4--5,14), + { YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,18--4,19) }), (3,6--6,1)), + (3,0--6,1)), (3,0--6,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs b/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs new file mode 100644 index 00000000000..cf1f75dc46c --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs @@ -0,0 +1,6 @@ +module Module + +async { + use! (res: int) = async { return 1 } + return res +} diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs.bsl new file mode 100644 index 00000000000..d402cdf754d --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 02.fs.bsl @@ -0,0 +1,38 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed UseBang 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + LetOrUseBang + (Yes (4,4--4,40), true, true, + Paren + (Typed + (Named + (SynIdent (res, None), false, None, (4,10--4,13)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,10--4,18)), (4,9--4,19)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (4,37--4,38)), + (4,30--4,38), + { YieldOrReturnKeyword = (4,30--4,36) }), + (4,28--4,40)), (4,22--4,40)), [], + YieldOrReturn + ((false, true), Ident res, (5,4--5,14), + { YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), + { LetOrUseBangKeyword = (4,4--4,8) + EqualsRange = Some (4,20--4,21) }), (3,6--6,1)), + (3,0--6,1)), (3,0--6,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs b/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs new file mode 100644 index 00000000000..c0f2a3eb394 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs @@ -0,0 +1,4 @@ +module Module + +use! x:int = async { return 1 } +use! (y:int) = async { return 2 } \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs.bsl new file mode 100644 index 00000000000..a3eda56c6e0 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 03.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed UseBang 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUseBang + (Yes (3,0--3,31), true, true, + Typed + (Named (SynIdent (x, None), false, None, (3,5--3,6)), + LongIdent (SynLongIdent ([int], [], [None])), (3,5--3,10)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (3,28--3,29)), + (3,21--3,29), { YieldOrReturnKeyword = (3,21--3,27) }), + (3,19--3,31)), (3,13--3,31)), [], + LetOrUseBang + (Yes (4,0--4,33), true, true, + Paren + (Typed + (Named (SynIdent (y, None), false, None, (4,6--4,7)), + LongIdent (SynLongIdent ([int], [], [None])), + (4,6--4,11)), (4,5--4,12)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (4,30--4,31)), + (4,23--4,31), + { YieldOrReturnKeyword = (4,23--4,29) }), + (4,21--4,33)), (4,15--4,33)), [], + ImplicitZero (4,33--4,33), (4,0--4,33), + { LetOrUseBangKeyword = (4,0--4,4) + EqualsRange = Some (4,13--4,14) }), (3,0--4,33), + { LetOrUseBangKeyword = (3,0--3,4) + EqualsRange = Some (3,11--3,12) }), (3,0--4,33))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(4,0)-(4,33) parse error Incomplete structured construct at or before this point in expression diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs b/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs new file mode 100644 index 00000000000..9ef3a6a3665 --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs @@ -0,0 +1,4 @@ +module Module + +use! _:int = async { return 1 } +use! (_:int) = async { return 2 } \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs.bsl b/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs.bsl new file mode 100644 index 00000000000..3bf8a0ce44c --- /dev/null +++ b/tests/service/data/SyntaxTree/SynType/Typed UseBang 04.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/SynType/Typed UseBang 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (LetOrUseBang + (Yes (3,0--3,31), true, true, + Typed + (Wild (3,5--3,6), + LongIdent (SynLongIdent ([int], [], [None])), (3,5--3,10)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 1, (3,28--3,29)), + (3,21--3,29), { YieldOrReturnKeyword = (3,21--3,27) }), + (3,19--3,31)), (3,13--3,31)), [], + LetOrUseBang + (Yes (4,0--4,33), true, true, + Paren + (Typed + (Wild (4,6--4,7), + LongIdent (SynLongIdent ([int], [], [None])), + (4,6--4,11)), (4,5--4,12)), + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), Const (Int32 2, (4,30--4,31)), + (4,23--4,31), + { YieldOrReturnKeyword = (4,23--4,29) }), + (4,21--4,33)), (4,15--4,33)), [], + ImplicitZero (4,33--4,33), (4,0--4,33), + { LetOrUseBangKeyword = (4,0--4,4) + EqualsRange = Some (4,13--4,14) }), (3,0--4,33), + { LetOrUseBangKeyword = (3,0--3,4) + EqualsRange = Some (3,11--3,12) }), (3,0--4,33))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--4,33), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(4,0)-(4,33) parse error Incomplete structured construct at or before this point in expression From a82b23db31c3450141d142b6cf366d99fe23ae6c Mon Sep 17 00:00:00 2001 From: Alex Berezhnykh Date: Mon, 19 May 2025 12:21:52 +0300 Subject: [PATCH 095/134] Shorthand lambda: fix completion for chained calls (#18560) --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + src/Compiler/Service/ServiceParsedInputOps.fs | 7 + src/Compiler/SyntaxTree/SyntaxTreeOps.fs | 2 + .../Language/DotLambdaTests.fs | 11 ++ .../CompletionTests.fs | 129 ++++++++++++++++-- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 7 files changed, 143 insertions(+), 11 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 52228f33b09..4273af66f62 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,3 +1,4 @@ ### Fixed * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) +* Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index f5b15936902..b8ffe0d030f 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -320,6 +320,13 @@ module ParsedInput = let _, r = CheckLongIdent longIdent Some r + | SynExpr.DotLambda(SynExpr.LongIdent _, range, _) -> Some range + | SynExpr.DotLambda(synExpr, range, _) -> + let result = traverseSynExpr synExpr + + result + |> Option.map (fun r -> if posEq r.Start synExpr.Range.Start then range else r) + | SynExpr.DotGet(synExpr, _dotm, lid, _) -> let (SynLongIdent(longIdent, _, _)) = lid diff --git a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs index 6633dab2408..616191c9b5a 100644 --- a/src/Compiler/SyntaxTree/SyntaxTreeOps.fs +++ b/src/Compiler/SyntaxTree/SyntaxTreeOps.fs @@ -103,6 +103,8 @@ let rec pushUnaryArg expr arg = SynExpr.TypeApp(innerExpr, mLess, tyargs, mCommas, mGreater, mTypars, m) | SynExpr.ArbitraryAfterError(_, m) when m.Start = m.End -> SynExpr.DiscardAfterMissingQualificationAfterDot(SynExpr.Ident arg, m.StartRange, unionRanges arg.idRange m) + | SynExpr.DiscardAfterMissingQualificationAfterDot(synExpr, dotRange, m) -> + SynExpr.DiscardAfterMissingQualificationAfterDot(pushUnaryArg synExpr arg, dotRange, unionRanges arg.idRange m) | _ -> errorR (Error(FSComp.SR.tcDotLambdaAtNotSupportedExpression (), expr.Range)) expr diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs index ab135a31be0..c8a34da06df 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/DotLambdaTests.fs @@ -105,6 +105,17 @@ let myFunction (x:MyRecord) = x |> _.DoStuff 1 2 3""" Error 72, Line 4, Col 36, Line 4, Col 45, "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." ] +[] +let ``Underscore Dot Lambda - Missing qualification after dot`` () = + Fsx """ +"" |> _.Length. """ + |> withLangVersion80 + |> typecheck + |> shouldFail + |> withDiagnostics [ + Error 599, Line 2, Col 15, Line 2, Col 16, "Missing qualification after '.'" + ] + [] let ``Underscore Dot Length on string`` () = Fsx """ diff --git a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs index 2d70f5c58f6..cfe43453d74 100644 --- a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs @@ -78,29 +78,140 @@ let record = { Field = 1 } assertHasItemWithNames ["Field"; "record"] info [] -let ``Underscore dot lambda - completion`` () = +let ``Underscore dot lambda - completion 01`` () = let info = getCompletionInfo """ -let myFancyFunc (x:string) = - x - |> _.Len{caret}""" +"" |> _.Len{caret}""" + + assertHasItemWithNames ["Length"] info + +[] +let ``Underscore dot lambda - completion 02`` () = + let info = getCompletionInfo """ +System.DateTime.Now |> _.TimeOfDay.Mill{caret}""" + + assertHasItemWithNames ["Milliseconds"] info + +[] +let ``Underscore dot lambda - completion 03`` () = + let info = getCompletionInfo """ +"" |> _.ToString().Len{caret}""" + + assertHasItemWithNames ["Length"] info + +[] +let ``Underscore dot lambda - completion 04`` () = + let info = getCompletionInfo """ +"" |> _.Len{caret}gth.ToString()""" + + assertHasItemWithNames ["Length"] info + +[] +let ``Underscore dot lambda - completion 05`` () = + let info = getCompletionInfo """ +"" |> _.Length.ToString().Chars("".Len{caret})""" + assertHasItemWithNames ["Length"] info [] -let ``Underscore dot lambda - method completion`` () = +let ``Underscore dot lambda - completion 06`` () = + let info = getCompletionInfo """ +"" |> _.Chars(System.DateTime.UtcNow.Tic{caret}).ToString()""" + + assertHasItemWithNames ["Ticks"] info + +[] +let ``Underscore dot lambda - completion 07`` () = + let info = getCompletionInfo """ +"" |> _.Length.ToString().Len{caret}""" + + assertHasItemWithNames ["Length"] info + +[] +let ``Underscore dot lambda - completion 08`` () = + let info = getCompletionInfo """ +System.DateTime.Now |> _.TimeOfDay + .Mill{caret}""" + + assertHasItemWithNames ["Milliseconds"] info + +[] +let ``Underscore dot lambda - completion 09`` () = + let info = getCompletionInfo """ +"" |> _.Length.ToSt{caret}.Length""" + + assertHasItemWithNames ["ToString"] info + +[] +let ``Underscore dot lambda - completion 10`` () = + let info = getCompletionInfo """ +"" |> _.Chars(0).ToStr{caret}.Length""" + + assertHasItemWithNames ["ToString"] info + +[] +let ``Underscore dot lambda - completion 11`` () = + let info = getCompletionInfo """ +open System.Linq + +[[""]] |> _.Select(_.Head.ToL{caret})""" + + assertHasItemWithNames ["ToLower"] info + +[] +let ``Underscore dot lambda - completion 12`` () = + let info = getCompletionInfo """ +open System.Linq + +[[[""]]] |> _.Head.Select(_.Head.ToL{caret})""" + + assertHasItemWithNames ["ToLower"] info + +[] +let ``Underscore dot lambda - completion 13`` () = let info = getCompletionInfo """ -let myFancyFunc (x:string) = - x +let myFancyFunc (x:string) = + x |> _.ToL{caret}""" assertHasItemWithNames ["ToLower"] info [] -let ``Underscore dot lambda - No prefix`` () = +let ``Underscore dot lambda - completion 14`` () = + let info = getCompletionInfo """ +let myFancyFunc (x:System.DateTime) = + x + |> _.TimeOfDay.Mill{caret} + |> id""" + assertHasItemWithNames ["Milliseconds"] info + +[] +let ``Underscore dot lambda - completion 15`` () = + let info = getCompletionInfo """ +let _a = 5 +"" |> _{caret}.Length.ToString() """ + assertHasItemWithNames ["_a"] info + +[] +let ``Underscore dot lambda - No prefix 01`` () = let info = getCompletionInfo """ let s = "" -[s] |> List.map _.{caret} +[s] |> List.map _.{caret} """ assertHasItemWithNames ["Length"] info +[] +let ``Underscore dot lambda - No prefix 02`` () = + let info = getCompletionInfo """ +System.DateTime.Now |> _.TimeOfDay.{caret}""" + + assertHasItemWithNames ["Milliseconds"] info + +[] +let ``Underscore dot lambda - No prefix 03`` () = + let info = getCompletionInfo """ +"" |> _.Length.ToString().{caret}""" + + assertHasItemWithNames ["Length"] info + [] let ``Type decl - Record - Field type 01`` () = let info = getCompletionInfo """ diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index e81c636f402..4f5daf0954d 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -34,7 +34,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index b53d7c7ecc6..e1bc01e19b7 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -33,7 +33,7 @@ [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. From 2e40a2308b24b2f747cda82baed9dea5ec08efee Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 12:43:18 +0200 Subject: [PATCH 096/134] Update dependencies from https://github.com/dotnet/arcade build 20250516.2 (#18566) --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e49b408685d..90822292cd0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -31,9 +31,9 @@ - + https://github.com/dotnet/arcade - 93823d49ca01742464ad1c0b49ea940e693b1be3 + c62eeb5b5432f9eaa034fbd641ccd9fd0d928fb3 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/global.json b/global.json index d599c421142..d9d798e19ce 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25263.5", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25266.2", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From 102c517d95535b187f35a6adb8eb90ff51a711b7 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 19 May 2025 13:55:05 +0200 Subject: [PATCH 097/134] Fix find all references for F# exceptions (#18565) --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + src/Compiler/Symbols/Symbols.fs | 3 ++- .../FSharpChecker/FindReferences.fs | 27 +++++++++++++++++++ ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 4273af66f62..093ff46d163 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,4 +1,5 @@ ### Fixed * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) +* Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 48acdf03dae..5e20f00b48b 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -360,7 +360,8 @@ type FSharpEntity(cenv: SymbolEnv, entity: EntityRef, tyargs: TType list) = inherit FSharpSymbol(cenv, (fun () -> checkEntityIsResolved entity - if entity.IsModuleOrNamespace then Item.ModuleOrNamespaces [entity] + if entity.IsModuleOrNamespace then Item.ModuleOrNamespaces [entity] + elif entity.IsFSharpException then Item.ExnCase entity else Item.UnqualifiedType [entity]), (fun _this thisCcu2 ad -> checkForCrossProjectAccessibility cenv.g.ilg (thisCcu2, ad) (cenv.thisCcu, getApproxFSharpAccessibilityOfEntity entity)) diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs index 727fac9b052..fd98658e884 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/FindReferences.fs @@ -265,6 +265,33 @@ val myFunc2: param: int -> int ]) } +module Exceptions = + let project() = SyntheticProject.Create( + { sourceFile "First" [] with ExtraSource = "exception MyException of string" }, + { sourceFile "Second" [] with ExtraSource = """ +open ModuleFirst +let foo x = raise (MyException "foo")""" }) + + [] + let ``We find exception from definition`` () = + project().Workflow { + placeCursor "First" 6 21 "exception MyException of string" ["MyException"] + findAllReferences (expectToFind [ + "FileFirst.fs", 6, 10, 21 + "FileSecond.fs", 8, 19, 30 + ]) + } + + [] + let ``We find exception from usage`` () = + project().Workflow { + placeCursor "Second" 8 30 "raise (MyException \"foo\")" ["MyException"] + findAllReferences (expectToFind [ + "FileFirst.fs", 6, 10, 21 + "FileSecond.fs", 8, 19, 30 + ]) + } + module Attributes = let project() = SyntheticProject.Create( diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 4f5daf0954d..077663dca21 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -40,7 +40,7 @@ [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index e1bc01e19b7..fd0973324e5 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -39,7 +39,7 @@ [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000010][found Char] Unexpected type on the stack. From 2188ac94533d3b1c97146668051946f6d7529738 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 19 May 2025 14:11:15 +0200 Subject: [PATCH 098/134] GH workflow - use ubuntu latest for cleaning up old runs (#18573) --- .github/workflows/add_to_project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add_to_project.yml b/.github/workflows/add_to_project.yml index 68e5cc454f2..67df3f58a1f 100644 --- a/.github/workflows/add_to_project.yml +++ b/.github/workflows/add_to_project.yml @@ -16,7 +16,7 @@ permissions: jobs: cleanup_old_runs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.event_name != 'pull_request_target' permissions: actions: write From ff1ca8a2f78ff1375998421ee423e2b36b9343e6 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 19 May 2025 14:46:26 +0200 Subject: [PATCH 099/134] Versions props - main (#18550) --- eng/Versions.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 624e01fe94c..0b43b972a69 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -37,7 +37,7 @@ $(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion) - 9.0.201 + 9.0.300 $(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).* @@ -52,8 +52,8 @@ - 17 - 14 + 18 + 0 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 0c942613dd6ac5169551e898af92743124805784 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Tue, 20 May 2025 10:49:43 +0200 Subject: [PATCH 100/134] Use .NET10p3 SDK (#18471) --- .devcontainer/devcontainer.json | 10 +++---- NuGet.config | 2 ++ global.json | 4 +-- src/Compiler/Facilities/CompilerLocation.fs | 1 + .../FSharp.Build.UnitTests.fsproj | 7 +++-- .../FSharp.Test.Utilities.fsproj | 30 +++++++++++-------- ....Compiler.Service_Debug_netstandard2.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- tests/fsharp/FSharpSuite.Tests.fsproj | 7 +++-- 9 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 47927f1f370..db23964cc66 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ // For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: { "name": "F#", - "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", + "image": "mcr.microsoft.com/dotnet/sdk:10.0.100-preview.3", "features": { - "ghcr.io/devcontainers/features/common-utils:2.5.2": {}, - "ghcr.io/devcontainers/features/git:1.3.2": {}, - "ghcr.io/devcontainers/features/github-cli:1.0.13": {}, - "ghcr.io/devcontainers/features/dotnet:2.2.0": {} + "ghcr.io/devcontainers/features/common-utils:2.5.3": {}, + "ghcr.io/devcontainers/features/git:1.3.3": {}, + "ghcr.io/devcontainers/features/github-cli:1.0.14": {}, + "ghcr.io/devcontainers/features/dotnet:2.2.1": {} }, "hostRequirements": { "cpus": 2, diff --git a/NuGet.config b/NuGet.config index bb182ae7ad1..4e7dd1d4e5e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -20,6 +20,8 @@ + + diff --git a/global.json b/global.json index d9d798e19ce..6b8604364e3 100644 --- a/global.json +++ b/global.json @@ -1,10 +1,10 @@ { "sdk": { - "version": "9.0.202", + "version": "10.0.100-preview.3.25201.16", "allowPrerelease": true }, "tools": { - "dotnet": "9.0.202", + "dotnet": "10.0.100-preview.3.25201.16", "vs": { "version": "17.8", "components": [ diff --git a/src/Compiler/Facilities/CompilerLocation.fs b/src/Compiler/Facilities/CompilerLocation.fs index abd436647ae..03251f2109a 100644 --- a/src/Compiler/Facilities/CompilerLocation.fs +++ b/src/Compiler/Facilities/CompilerLocation.fs @@ -123,6 +123,7 @@ module internal FSharpEnvironment = |] elif typeof.Assembly.GetName().Name = "System.Private.CoreLib" then [| + "net10.0" "net9.0" "net8.0" "net7.0" diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index 853737b3ca8..07585566210 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -21,7 +21,7 @@ PreserveNewest - + @@ -30,8 +30,11 @@ - + + + + diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index 7788cbe6520..e25102e9102 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -75,26 +75,32 @@ - - - - - - - - - - - + + + + + + + + + + + + + $(NoWarn);NU1510 + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 077663dca21..5475f43bdc1 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -81,7 +81,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL+parseNamed@5311::Invoke([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x00000087][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@316::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment+probePathForDotnetHost@317::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000028][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+Pipe #6 input at line 68@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x0000034D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000CD][found Char] Unexpected type on the stack. [IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@558::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index fd0973324e5..7a78ab1999a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -108,7 +108,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseNamed@5310(uint8[], [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>, int32, int32)][offset 0x0000007E][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Internal.Utilities.Collections.Utils::shortPath(string)][offset 0x00000016][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@315([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Internal.Utilities.FSharpEnvironment::probePathForDotnetHost@316([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x0000002A][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.SimulatedMSBuildReferenceResolver+SimulatedMSBuildResolver@68::FSharp.Compiler.CodeAnalysis.ILegacyReferenceResolver.Resolve([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyResolutionEnvironment, [S.P.CoreLib]System.Tuple`2[], string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, string, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, string, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>>)][offset 0x000002F5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharp.Compiler.DiagnosticsLogger::.cctor()][offset 0x000000B6][found Char] Unexpected type on the stack. [IL]: Error [CallVirtOnValueType]: : FSharp.Compiler.Text.RangeModule+comparer@558::System.Collections.Generic.IEqualityComparer.GetHashCode([FSharp.Compiler.Service]FSharp.Compiler.Text.Range)][offset 0x00000002] Callvirt on a value type method. diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index dfc4840d0c8..b4540de0b33 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -123,10 +123,13 @@ - - + + + + + From 195e7232ff5d6e45ce3b17bf425d60ac30863d0d Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 20 May 2025 14:19:19 +0200 Subject: [PATCH 101/134] Add GitHub action to update ILVerify baselines via PR comments (#18578) --- .github/workflows/commands.yml | 62 ++++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index 72fa71e6e9c..01203a6c562 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -14,7 +14,7 @@ permissions: jobs: cleanup_old_runs: if: github.event.schedule == '0 13 * * *' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: actions: write env: @@ -33,7 +33,7 @@ jobs: run_command: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/run') - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Extract command to run uses: actions/github-script@v3 @@ -76,13 +76,61 @@ jobs: if: steps.command-extractor.outputs.result == 'fantomas' id: fantomas run: dotnet fantomas . -r - - name: Process fantomas command + - name: Process xlf command if: steps.command-extractor.outputs.result == 'xlf' id: xlf run: dotnet build src/Compiler /t:UpdateXlf + - name: Post ilverify start comment + if: steps.command-extractor.outputs.result == 'ilverify' + uses: actions/github-script@v3 + with: + script: | + const body = `Started to run ilverify baseline update`; + await github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }); + + - name: Process ilverify command (Update ILVerify baselines) + if: steps.command-extractor.outputs.result == 'ilverify' + id: ilverify + env: + TEST_UPDATE_BSL: 1 + run: | + # Run the ilverify script with TEST_UPDATE_BSL=1 + pwsh tests/ILVerify/ilverify.ps1 + + # Calculate the changes per file + echo "Checking for changes in baseline files..." + FILES_CHANGED=0 + CHANGES_OUTPUT="" + + for file in tests/ILVerify/*.bsl; do + if git diff --quiet "$file"; then + continue + else + FILES_CHANGED=$((FILES_CHANGED + 1)) + LINES_CHANGED=$(git diff --numstat "$file" | awk '{print $1 + $2}') + CHANGES_OUTPUT="${CHANGES_OUTPUT}${file}: ${LINES_CHANGED} lines changed\n" + fi + done + + if [ "$FILES_CHANGED" -eq 0 ]; then + echo "result=The ilverify command ran and did not modify any baseline." >> $GITHUB_OUTPUT + else + echo -e "result=The ilverify command ran and triggered the following number of changes per file:\n${CHANGES_OUTPUT}" >> $GITHUB_OUTPUT + fi - name: Commit and push changes - if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' + if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success' run: | + # Only commit if there are actual changes + if git diff --quiet; then + echo "No changes to commit, skipping." + exit 0 + fi + git config --local user.name "github-actions[bot]" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git commit -a -m 'Automated command ran: ${{ steps.command-extractor.outputs.result }} @@ -90,7 +138,7 @@ jobs: Co-authored-by: ${{ github.event.comment.user.login }} <${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com>' git push - name: Post command comment - if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' + if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success' uses: actions/github-script@v3 with: script: | @@ -98,8 +146,10 @@ jobs: var output = "" if ("${{steps.command-extractor.outputs.result}}" == 'fantomas') { output = "${{steps.fantomas.outputs.result}}" - } else if("${{steps.command-extractor.outputs.result}}" == 'xlf') { + } else if ("${{steps.command-extractor.outputs.result}}" == 'xlf') { output = "${{steps.xlf.outputs.result}}" + } else if ("${{steps.command-extractor.outputs.result}}" == 'ilverify') { + output = "${{steps.ilverify.outputs.result}}" } const body = `Ran ${{ steps.command-extractor.outputs.result }}: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${process.env.GITHUB_RUN_ID}\n${output}`; await github.issues.createComment({ From 087ffa2d42579baec3b6adcd9b8f568c7dd14ccb Mon Sep 17 00:00:00 2001 From: Vladimir Shchur Date: Tue, 20 May 2025 05:36:34 -0700 Subject: [PATCH 102/134] Added support for empty case in random collections (#18568) --- docs/release-notes/.FSharp.Core/10.0.100.md | 9 ++ src/FSharp.Core/array.fs | 130 +++++++++------- src/FSharp.Core/array.fsi | 12 +- src/FSharp.Core/list.fs | 146 ++++++++++-------- src/FSharp.Core/list.fsi | 11 +- src/FSharp.Core/seq.fs | 140 +++++++++-------- src/FSharp.Core/seq.fsi | 12 +- .../ArrayModule.fs | 34 +++- .../ListModule.fs | 36 ++++- .../Microsoft.FSharp.Collections/SeqModule.fs | 34 +++- ...erify_FSharp.Core_Debug_netstandard2.0.bsl | 4 +- ...erify_FSharp.Core_Debug_netstandard2.1.bsl | 4 +- ...ify_FSharp.Core_Release_netstandard2.0.bsl | 4 +- ...ify_FSharp.Core_Release_netstandard2.1.bsl | 4 +- 14 files changed, 361 insertions(+), 219 deletions(-) create mode 100644 docs/release-notes/.FSharp.Core/10.0.100.md diff --git a/docs/release-notes/.FSharp.Core/10.0.100.md b/docs/release-notes/.FSharp.Core/10.0.100.md new file mode 100644 index 00000000000..1dc471ef118 --- /dev/null +++ b/docs/release-notes/.FSharp.Core/10.0.100.md @@ -0,0 +1,9 @@ +### Fixed + +### Added + +### Changed + +* Random functions support for zero element chosen/sampled ([PR #18568](https://github.com/dotnet/fsharp/pull/18568)) + +### Breaking Changes \ No newline at end of file diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index ca88e22465d..358836ddf1b 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -2020,15 +2020,18 @@ module Array = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputArrayEmptyString - - let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count + if count = 0 then + [||] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count - for i = 0 to count - 1 do - let j = random.Next(0, inputLength) - result[i] <- source[j] + for i = 0 to count - 1 do + let j = random.Next(0, inputLength) + result[i] <- source[j] - result + result [] let randomChoicesBy (randomizer: unit -> float) (count: int) (source: 'T array) : 'T array = @@ -2040,15 +2043,18 @@ module Array = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputArrayEmptyString - - let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count + if count = 0 then + [||] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count - for i = 0 to count - 1 do - let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - result[i] <- source[j] + for i = 0 to count - 1 do + let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + result[i] <- source[j] - result + result [] let randomChoices (count: int) (source: 'T array) : 'T array = @@ -2065,35 +2071,38 @@ module Array = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputArrayEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) + if count = 0 then + [||] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) - let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count + let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - if inputLength <= setSize then - let pool = copy source + if inputLength <= setSize then + let pool = copy source - for i = 0 to count - 1 do - let j = random.Next(0, inputLength - i) - result[i] <- pool[j] - pool[j] <- pool[inputLength - i - 1] - else - let selected = HashSet() + for i = 0 to count - 1 do + let j = random.Next(0, inputLength - i) + result[i] <- pool[j] + pool[j] <- pool[inputLength - i - 1] + else + let selected = HashSet() - for i = 0 to count - 1 do - let mutable j = random.Next(0, inputLength) + for i = 0 to count - 1 do + let mutable j = random.Next(0, inputLength) - while not (selected.Add j) do - j <- random.Next(0, inputLength) + while not (selected.Add j) do + j <- random.Next(0, inputLength) - result[i] <- source[j] + result[i] <- source[j] - result + result [] let randomSampleBy (randomizer: unit -> float) (count: int) (source: 'T array) : 'T array = @@ -2105,39 +2114,42 @@ module Array = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputArrayEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) + if count = 0 then + [||] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) - let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count + let result = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked count - // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - if inputLength <= setSize then - let pool = copy source + if inputLength <= setSize then + let pool = copy source - for i = 0 to count - 1 do - let j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) + for i = 0 to count - 1 do + let j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) - result[i] <- pool[j] - pool[j] <- pool[inputLength - i - 1] - else - let selected = HashSet() + result[i] <- pool[j] + pool[j] <- pool[inputLength - i - 1] + else + let selected = HashSet() - for i = 0 to count - 1 do - let mutable j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + for i = 0 to count - 1 do + let mutable j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - while not (selected.Add j) do - j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + while not (selected.Add j) do + j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - result[i] <- source[j] + result[i] <- source[j] - result + result [] let randomSample (count: int) (source: 'T array) : 'T array = diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index 151081c300c..ba6274e11c6 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -3282,7 +3282,7 @@ module Array = /// An array of randomly selected elements from the input array. /// /// Thrown when the input array is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty. /// Thrown when count is less than 0. /// /// @@ -3306,7 +3306,7 @@ module Array = /// /// Thrown when the input array is null. /// Thrown when the random argument is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty. /// Thrown when count is less than 0. /// /// @@ -3329,7 +3329,7 @@ module Array = /// An array of randomly selected elements from the input array. /// /// Thrown when the input array is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty. /// Thrown when count is less than 0. /// Thrown when the randomizer function returns a value outside the range [0, 1). /// @@ -3352,7 +3352,7 @@ module Array = /// An array of randomly selected elements from the input array. /// /// Thrown when the input array is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input array. /// @@ -3377,7 +3377,7 @@ module Array = /// /// Thrown when the input array is null. /// Thrown when the random argument is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty.. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input array. /// @@ -3401,7 +3401,7 @@ module Array = /// An array of randomly selected elements from the input array. /// /// Thrown when the input array is null. - /// Thrown when the input array is empty. + /// Thrown when count is more than 0 and the input array is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input array. /// Thrown when the randomizer function returns a value outside the range [0, 1). diff --git a/src/FSharp.Core/list.fs b/src/FSharp.Core/list.fs index d502107a6da..7fc02845d3a 100644 --- a/src/FSharp.Core/list.fs +++ b/src/FSharp.Core/list.fs @@ -1043,13 +1043,16 @@ module List = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - [ - for _ = 0 to count - 1 do - let j = random.Next(0, inputLength) - source[j] - ] + if count = 0 then + [] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + [ + for _ = 0 to count - 1 do + let j = random.Next(0, inputLength) + source[j] + ] [] let randomChoicesBy (randomizer: unit -> float) (count: int) (source: 'T list) : 'T list = @@ -1059,13 +1062,16 @@ module List = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - [ - for _ = 0 to count - 1 do - let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - source[j] - ] + if count = 0 then + [] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + [ + for _ = 0 to count - 1 do + let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + source[j] + ] [] let randomChoices (count: int) (source: 'T list) : 'T list = @@ -1081,37 +1087,40 @@ module List = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) - - // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - - if inputLength <= setSize then - let pool = source |> toArray - - [ - for i = 0 to count - 1 do - let j = random.Next(0, inputLength - i) - let item = pool[j] - pool[j] <- pool[inputLength - i - 1] - item - ] + if count = 0 then + [] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString else - let selected = HashSet() + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) + + // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + + if inputLength <= setSize then + let pool = source |> toArray + + [ + for i = 0 to count - 1 do + let j = random.Next(0, inputLength - i) + let item = pool[j] + pool[j] <- pool[inputLength - i - 1] + item + ] + else + let selected = HashSet() - [ - for _ = 0 to count - 1 do - let mutable j = random.Next(0, inputLength) + [ + for _ = 0 to count - 1 do + let mutable j = random.Next(0, inputLength) - while not (selected.Add j) do - j <- random.Next(0, inputLength) + while not (selected.Add j) do + j <- random.Next(0, inputLength) - source[j] - ] + source[j] + ] [] let randomSampleBy (randomizer: unit -> float) (count: int) (source: 'T list) : 'T list = @@ -1121,39 +1130,42 @@ module List = let inputLength = source.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) + if count = 0 then + [] + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - if inputLength <= setSize then - let pool = source |> toArray + if inputLength <= setSize then + let pool = source |> toArray - [ - for i = 0 to count - 1 do - let j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) + [ + for i = 0 to count - 1 do + let j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) - let item = pool[j] - pool[j] <- pool[inputLength - i - 1] - item - ] - else - let selected = HashSet() + let item = pool[j] + pool[j] <- pool[inputLength - i - 1] + item + ] + else + let selected = HashSet() - [ - for _ = 0 to count - 1 do - let mutable j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + [ + for _ = 0 to count - 1 do + let mutable j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - while not (selected.Add j) do - j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + while not (selected.Add j) do + j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - source[j] - ] + source[j] + ] [] let randomSample (count: int) (source: 'T list) : 'T list = diff --git a/src/FSharp.Core/list.fsi b/src/FSharp.Core/list.fsi index e14fe7eb447..0c69ccc60c7 100644 --- a/src/FSharp.Core/list.fsi +++ b/src/FSharp.Core/list.fsi @@ -2820,7 +2820,7 @@ module List = /// /// A list of randomly selected elements from the input list. /// - /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// /// @@ -2843,7 +2843,7 @@ module List = /// A list of randomly selected elements from the input list. /// /// Thrown when the random argument is null. - /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// /// @@ -2866,6 +2866,7 @@ module List = /// A list of randomly selected elements from the input list. /// /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when the randomizer function returns a value outside the range [0, 1). /// @@ -2887,7 +2888,7 @@ module List = /// /// A list of randomly selected elements from the input list. /// - /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input list. /// @@ -2911,7 +2912,7 @@ module List = /// A list of randomly selected elements from the input list. /// /// Thrown when the random argument is null. - /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input list. /// @@ -2934,7 +2935,7 @@ module List = /// /// A list of randomly selected elements from the input list. /// - /// Thrown when the input list is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input list. /// Thrown when the randomizer function returns a value outside the range [0, 1). diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index 20fcdefb159..ce1bfe6d4ab 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -2002,13 +2002,16 @@ module Seq = let inputLength = tempArray.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - seq { - for _ = 0 to count - 1 do - let j = random.Next(0, inputLength) - tempArray[j] - } + if count = 0 then + empty + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + seq { + for _ = 0 to count - 1 do + let j = random.Next(0, inputLength) + tempArray[j] + } [] let randomChoicesBy (randomizer: unit -> float) (count: int) (source: seq<'T>) : seq<'T> = @@ -2021,13 +2024,16 @@ module Seq = let inputLength = tempArray.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - seq { - for _ = 0 to count - 1 do - let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - tempArray[j] - } + if count = 0 then + empty + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + seq { + for _ = 0 to count - 1 do + let j = Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + tempArray[j] + } [] let randomChoices (count: int) (source: seq<'T>) : seq<'T> = @@ -2045,35 +2051,38 @@ module Seq = let inputLength = tempArray.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) - - // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - - if inputLength <= setSize then - seq { - for i = 0 to count - 1 do - let j = random.Next(0, inputLength - i) - let item = tempArray[j] - tempArray[j] <- tempArray[inputLength - i - 1] - item - } + if count = 0 then + empty + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString else - let selected = HashSet() + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) + + // algorithm taken from https://github.com/python/cpython/blob/69b3e8ea569faabccd74036e3d0e5ec7c0c62a20/Lib/random.py#L363-L456 + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + + if inputLength <= setSize then + seq { + for i = 0 to count - 1 do + let j = random.Next(0, inputLength - i) + let item = tempArray[j] + tempArray[j] <- tempArray[inputLength - i - 1] + item + } + else + let selected = HashSet() - seq { - for _ = 0 to count - 1 do - let mutable j = random.Next(0, inputLength) + seq { + for _ = 0 to count - 1 do + let mutable j = random.Next(0, inputLength) - while not (selected.Add j) do - j <- random.Next(0, inputLength) + while not (selected.Add j) do + j <- random.Next(0, inputLength) - tempArray[j] - } + tempArray[j] + } [] let randomSampleBy (randomizer: unit -> float) (count: int) (source: seq<'T>) : seq<'T> = @@ -2086,37 +2095,40 @@ module Seq = let inputLength = tempArray.Length if inputLength = 0 then - invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString - - if count > inputLength then - invalidArg "count" (SR.GetString(SR.notEnoughElements)) + if count = 0 then + empty + else + invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + else + if count > inputLength then + invalidArg "count" (SR.GetString(SR.notEnoughElements)) - let setSize = - Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count + let setSize = + Microsoft.FSharp.Primitives.Basics.Random.getMaxSetSizeForSampling count - if inputLength <= setSize then - seq { - for i = 0 to count - 1 do - let j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) + if inputLength <= setSize then + seq { + for i = 0 to count - 1 do + let j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 (inputLength - i) - let item = tempArray[j] - tempArray[j] <- tempArray[inputLength - i - 1] - item - } - else - let selected = HashSet() + let item = tempArray[j] + tempArray[j] <- tempArray[inputLength - i - 1] + item + } + else + let selected = HashSet() - seq { - for _ = 0 to count - 1 do - let mutable j = - Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + seq { + for _ = 0 to count - 1 do + let mutable j = + Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - while not (selected.Add j) do - j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength + while not (selected.Add j) do + j <- Microsoft.FSharp.Primitives.Basics.Random.next randomizer 0 inputLength - tempArray[j] - } + tempArray[j] + } [] let randomSample (count: int) (source: seq<'T>) : seq<'T> = diff --git a/src/FSharp.Core/seq.fsi b/src/FSharp.Core/seq.fsi index 790a486e850..19c83624bef 100644 --- a/src/FSharp.Core/seq.fsi +++ b/src/FSharp.Core/seq.fsi @@ -3077,7 +3077,7 @@ module Seq = /// A sequence of randomly selected elements from the input sequence. /// /// Thrown when the input sequence is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// /// @@ -3103,7 +3103,7 @@ module Seq = /// /// Thrown when the input sequence is null. /// Thrown when the random argument is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// /// @@ -3128,7 +3128,7 @@ module Seq = /// A sequence of randomly selected elements from the input sequence. /// /// Thrown when the input sequence is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when the randomizer function returns a number outside the range [0.0..1.0). /// @@ -3153,7 +3153,7 @@ module Seq = /// A sequence of randomly selected elements from the input sequence. /// /// Thrown when the input sequence is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input sequence. /// @@ -3180,7 +3180,7 @@ module Seq = /// /// Thrown when the input sequence is null. /// Thrown when the random argument is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input sequence. /// @@ -3206,7 +3206,7 @@ module Seq = /// A sequence of randomly selected elements from the input sequence. /// /// Thrown when the input sequence is null. - /// Thrown when the input sequence is empty. + /// Thrown when count is more than 0 and the input list is empty. /// Thrown when count is less than 0. /// Thrown when count is greater than the length of the input sequence. /// Thrown when the randomizer function returns a number outside the range [0.0..1.0). diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs index 662a729e28f..16bc5d4fbdf 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs @@ -2226,6 +2226,14 @@ type ArrayModule() = CheckThrowsArgumentException (fun () -> Array.randomChoices choicesLength emptyArr |> ignore) CheckThrowsArgumentException (fun () -> Array.randomChoices negativeChoicesLength arr |> ignore) + [] + member _.RandomChoicesEmpty() = + let emptyArr = [||] + + let choice = emptyArr |> Array.randomChoices 0 + + Assert.AreEqual([||], choice) + [] member _.RandomChoicesWith() = let arr = [| 1..50 |] @@ -2291,6 +2299,14 @@ type ArrayModule() = CheckThrowsArgumentException (fun () -> Array.randomChoicesBy randomizer choicesLength emptyArr |> ignore) CheckThrowsArgumentException (fun () -> Array.randomChoicesBy randomizer negativeChoicesLength arr |> ignore) + [] + member _.RandomChoicesByEmpty() = + let emptyArr = [||] + + let choice = emptyArr |> Array.randomChoicesBy (fun () -> 1.0) 0 + + Assert.AreEqual([||], choice) + [] member _.RandomSample() = let arr = [| 1..50 |] @@ -2319,6 +2335,14 @@ type ArrayModule() = CheckThrowsArgumentException (fun () -> Array.randomSample negativeSampleLength arr |> ignore) CheckThrowsArgumentException (fun () -> Array.randomSample tooBigSampleLength arr |> ignore) + [] + member _.RandomSampleEmpty() = + let emptyArr = [||] + + let choice = emptyArr |> Array.randomSample 0 + + Assert.AreEqual([||], choice) + [] member _.RandomSampleWith() = let arr = [| 1..50 |] @@ -2394,4 +2418,12 @@ type ArrayModule() = CheckThrowsArgumentOutOfRangeException (fun () -> Array.randomSampleBy wrongRandomizer sampleLength arr |> ignore)) CheckThrowsArgumentException (fun () -> Array.randomSampleBy randomizer sampleLength emptyArr |> ignore) CheckThrowsArgumentException (fun () -> Array.randomSampleBy randomizer negativeSampleLength arr |> ignore) - CheckThrowsArgumentException (fun () -> Array.randomSampleBy randomizer tooBigSampleLength arr |> ignore) \ No newline at end of file + CheckThrowsArgumentException (fun () -> Array.randomSampleBy randomizer tooBigSampleLength arr |> ignore) + + [] + member _.RandomSampleByEmpty() = + let emptyArr = [||] + + let choice = emptyArr |> Array.randomSampleBy (fun () -> 1.0) 0 + + Assert.AreEqual([||], choice) \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs index 8b0fcf507e5..64f58ebea5a 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs @@ -1240,6 +1240,14 @@ type ListModule() = CheckThrowsArgumentException (fun () -> List.randomChoices choicesLength emptyList |> ignore) CheckThrowsArgumentException (fun () -> List.randomChoices negativeChoicesLength list |> ignore) + [] + member _.RandomChoicesEmpty() = + let list = [] + + let choice = list |> List.randomChoices 0 + + Assert.AreEqual([], choice) + [] member _.RandomChoicesWith() = let list = [ 1..50 ] @@ -1296,6 +1304,14 @@ type ListModule() = CheckThrowsArgumentException (fun () -> List.randomChoicesBy randomizer choicesLength emptyList |> ignore) CheckThrowsArgumentException (fun () -> List.randomChoicesBy randomizer negativeChoicesLength list |> ignore) + [] + member _.RandomChoicesByEmpty() = + let list = [] + + let choice = list |> List.randomSampleBy (fun () -> 1.0) 0 + + Assert.AreEqual([], choice) + [] member _.RandomSample() = let arr = [ 1..50 ] @@ -1321,7 +1337,15 @@ type ListModule() = CheckThrowsArgumentException (fun () -> List.randomSample sampleLength emptyList |> ignore) CheckThrowsArgumentException (fun () -> List.randomSample negativeSampleLength list |> ignore) CheckThrowsArgumentException (fun () -> List.randomSample tooBigSampleLength list |> ignore) - + + [] + member _.RandomSampleEmpty() = + let list = [] + + let choice = list |> List.randomSample 0 + + Assert.AreEqual([], choice) + [] member _.RandomSampleWith() = let list = [ 1..50 ] @@ -1388,4 +1412,12 @@ type ListModule() = CheckThrowsArgumentOutOfRangeException (fun () -> List.randomSampleBy wrongRandomizer sampleLength list |> ignore) CheckThrowsArgumentException (fun () -> List.randomSampleBy randomizer sampleLength emptyArr |> ignore) CheckThrowsArgumentException (fun () -> List.randomSampleBy randomizer negativeSampleLength list |> ignore) - CheckThrowsArgumentException (fun () -> List.randomSampleBy randomizer tooBigSampleLength list |> ignore) \ No newline at end of file + CheckThrowsArgumentException (fun () -> List.randomSampleBy randomizer tooBigSampleLength list |> ignore) + + [] + member _.RandomSampleByEmpty() = + let list = [] + + let choice = list |> List.randomSampleBy (fun () -> 1.0) 0 + + Assert.AreEqual([], choice) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs index f2f88933506..5d37b1ecdf2 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule.fs @@ -1332,6 +1332,14 @@ type SeqModule() = CheckThrowsArgumentException (fun () -> Seq.randomChoices choicesLength emptySeq |> ignore) CheckThrowsArgumentException (fun () -> Seq.randomChoices negativeChoicesLength intSeq |> ignore) + [] + member _.RandomChoicesEmpty() = + let seq = Seq.empty + + let choice = seq |> Seq.randomChoices 0 + + Assert.AreEqual(0, choice |> Seq.length) + [] member _.RandomChoicesWith() = let seq = seq { 1..50 } @@ -1392,6 +1400,14 @@ type SeqModule() = CheckThrowsArgumentException (fun () -> Seq.randomChoicesBy randomizer choicesLength emptySeq |> ignore) CheckThrowsArgumentException (fun () -> Seq.randomChoicesBy randomizer negativeChoicesLength intSeq |> ignore) + [] + member _.RandomChoicesByEmpty() = + let seq = Seq.empty + + let choice = seq |> Seq.randomChoicesBy (fun () -> 1.0) 0 + + Assert.AreEqual(0, choice |> Seq.length) + [] member _.RandomSample() = let intSeq = seq { 1..50 } @@ -1421,6 +1437,14 @@ type SeqModule() = CheckThrowsArgumentException (fun () -> Seq.randomSample negativeSampleLength intSeq |> ignore) CheckThrowsArgumentException (fun () -> Seq.randomSample tooBigSampleLength intSeq |> ignore) + [] + member _.RandomSampleEmpty() = + let seq = Seq.empty + + let choice = seq |> Seq.randomSample 0 + + Assert.AreEqual(0, choice |> Seq.length) + [] member _.RandomSampleWith() = let intSeq = seq { 1..50 } @@ -1491,4 +1515,12 @@ type SeqModule() = CheckThrowsArgumentOutOfRangeException (fun () -> Seq.randomSampleBy wrongRandomizer sampleLength intSeq |> Seq.toList |> ignore) CheckThrowsArgumentException (fun () -> Seq.randomSampleBy randomizer sampleLength emptySeq |> ignore) CheckThrowsArgumentException (fun () -> Seq.randomSampleBy randomizer negativeSampleLength intSeq |> ignore) - CheckThrowsArgumentException (fun () -> Seq.randomSampleBy randomizer tooBigSampleLength intSeq |> ignore) \ No newline at end of file + CheckThrowsArgumentException (fun () -> Seq.randomSampleBy randomizer tooBigSampleLength intSeq |> ignore) + + [] + member _.RandomSampleByEmpty() = + let seq = Seq.empty + + let choice = seq |> Seq.randomSampleBy (fun () -> 1.0) 0 + + Assert.AreEqual(0, choice |> Seq.length) \ No newline at end of file diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl index 7f00cdfe046..689981e77fd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.0.bsl @@ -21,8 +21,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2238@2242-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2568@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2250@2254-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2580@2584-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl index 7f00cdfe046..689981e77fd 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Debug_netstandard2.1.bsl @@ -21,8 +21,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x000000A0][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2238@2242-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2568@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2250@2254-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Pipe #2 input at line 2580@2584-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000020][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x00000031][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl index 05a10ae7797..afd4bad98c5 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.0.bsl @@ -21,8 +21,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2242-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2254-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2584-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl index 05a10ae7797..afd4bad98c5 100644 --- a/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl +++ b/tests/ILVerify/ilverify_FSharp.Core_Release_netstandard2.1.bsl @@ -21,8 +21,8 @@ [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Choose([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, !!0[])][offset 0x00000081][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Filter([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000029][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel::Partition([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, !!0[])][offset 0x00000038][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2242-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2572-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+Choose@2254-2::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000030][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : Microsoft.FSharp.Collections.ArrayModule+Parallel+countAndCollectTrueItems@2584-1::Invoke(int32, [System.Threading.Tasks.Parallel]System.Threading.Tasks.ParallelLoopState, int32)][offset 0x00000022][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000001E][found Short] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::Map([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, string)][offset 0x0000002D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : Microsoft.FSharp.Core.StringModule::MapIndexed([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, string)][offset 0x00000029][found Short] Unexpected type on the stack. From 7aa39f38d80882ead337ae0d30107bc28f26fdaa Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Thu, 22 May 2025 09:29:15 +0200 Subject: [PATCH 103/134] Multi agent parallel testing in CI (#18523) --- azure-pipelines-PR.yml | 148 ++++++++++++++------ eng/Build.ps1 | 102 ++++++-------- eng/build.sh | 18 ++- tests/FSharp.Test.Utilities/XunitHelpers.fs | 19 +++ 4 files changed, 182 insertions(+), 105 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index bf59708bdb1..cc88c091482 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -14,7 +14,7 @@ trigger: - docs/* - .vscode/* - .devcontainer/* - - tests/scripts/ + - tests/scripts/* - attributions.md - CODE_OF_CONDUCT.md - DEVGUIDE.md @@ -306,11 +306,13 @@ stages: name: $(DncEngPublicBuildPool) demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 + strategy: + parallel: 4 steps: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release + - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -318,9 +320,18 @@ stages: NativeToolsOnMachine: true displayName: Build + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsNoRealsig_testDesktop batch $(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog - condition: always() + condition: eq(variables['System.JobPositionInPhase'], 1) continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' @@ -333,7 +344,7 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'Windows Release WindowsNoRealsig_testDesktop process dumps' + ArtifactName: 'Windows Release WindowsNoRealsig_testDesktop process dumps $(System.JobPositionInPhase)' ArtifactType: Container parallel: true @@ -429,55 +440,36 @@ stages: demands: ImageOverride -equals $(WindowsMachineQueueName) timeoutInMinutes: 120 strategy: - maxParallel: 5 matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop coreclr_release: _configuration: Release _testKind: testCoreclr + transparentCompiler: # Empty display name part. fsharpqa_release: _configuration: Release _testKind: testFSharpQA + transparentCompiler: vs_release: _configuration: Release _testKind: testVs + setupVsHive: true + transparentCompiler: transparent_compiler_release: _configuration: Release _testKind: testCoreclr - - ${{ if eq(variables['Build.Reason'], 'Flaky, disabled, was PullRequest') }}: - inttests_release: - _configuration: Release - _testKind: testIntegration + TEST_TRANSPARENT_COMPILER: 1 # Pipeline variable will map to env var. + transparentCompiler: TransparentCompiler + # inttests_release: + # _configuration: Release + # _testKind: testIntegration + # setupVsHive: true steps: - checkout: self clean: true - powershell: eng\SetupVSHive.ps1 displayName: Setup VS Hive - condition: or(eq(variables['_testKind'], 'testVs'), eq(variables['_testKind'], 'testIntegration')) - - # yes, this is miserable, but - https://github.com/dotnet/arcade/issues/13239 - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp - NativeToolsOnMachine: true - displayName: Build / Test - condition: and( ne(variables['_testKind'], 'testIntegration'), ne(variables['System.JobName'], 'transparent_compiler_release') ) - - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) - env: - DOTNET_DbgEnableMiniDump: 1 - DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. - DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp - TEST_TRANSPARENT_COMPILER: 1 - NativeToolsOnMachine: true - displayName: Build / Test Transparent Compiler - condition: and( eq(variables['System.JobName'], 'transparent_compiler_release'), ne(variables['_testKind'], 'testIntegration') ) + condition: eq(variables.setupVsHive, 'true') - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) env: @@ -485,15 +477,13 @@ stages: DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\$(_configuration)\$(Build.BuildId)-%e-%p-%t.dmp NativeToolsOnMachine: true - displayName: Build / Integration Test - continueOnError: true - condition: eq(variables['_testKind'], 'testIntegration') + displayName: Build and Test $(_testKind) $(transparentCompiler) - task: PublishTestResults@2 displayName: Publish Test Results inputs: testResultsFormat: 'XUnit' - testRunTitle: WindowsCompressedMetadata $(_testKind) + testRunTitle: WindowsCompressedMetadata $(_testKind) $(transparentCompiler) mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' @@ -505,7 +495,7 @@ stages: continueOnError: true inputs: PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/$(_configuration)\Build.VisualFSharp.sln.binlog' - ArtifactName: 'Windows $(_configuration) $(_testKind) test binlogs' + ArtifactName: Windows $(_configuration) $(_testKind) $(transparentCompiler) test binlogs ArtifactType: Container parallel: true - task: PublishBuildArtifacts@1 @@ -521,7 +511,7 @@ stages: displayName: Publish Test Logs inputs: PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' + ArtifactName: Windows $(_configuration) $(_testKind) $(transparentCompilerSuffix) test logs publishLocation: Container continueOnError: true condition: always() @@ -537,6 +527,84 @@ stages: continueOnError: true condition: failed() + # Windows With Compressed Metadata Desktop + - job: WindowsCompressedMetadata_Desktop + variables: + - name: XUNIT_LOGS + value: $(Build.SourcesDirectory)\artifacts\TestResults\Release + - name: __VSNeverShowWhatsNew + value: 1 + pool: + # The PR build definition sets this variable: + # WindowsMachineQueueName=Windows.vs2022.amd64.open + # and there is an alternate build definition that sets this to a queue that is always scouting the + # next preview of Visual Studio. + name: $(DncEngPublicBuildPool) + demands: ImageOverride -equals $(WindowsMachineQueueName) + timeoutInMinutes: 120 + strategy: + parallel: 4 + + steps: + - checkout: self + clean: true + + - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + env: + DOTNET_DbgEnableMiniDump: 1 + DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. + DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp + NativeToolsOnMachine: true + displayName: Build / Test + + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsCompressedMetadata testDesktop batch $(System.JobPositionInPhase) + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true + + - task: PublishBuildArtifacts@1 + displayName: Publish BinLog + condition: eq(variables['System.JobPositionInPhase'], 1) + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log/Release\Build.VisualFSharp.sln.binlog' + ArtifactName: 'Windows testDesktop binlogs' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Dumps + condition: failed() + continueOnError: true + inputs: + PathToPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' + ArtifactName: 'Windows testDesktop process dumps $(System.JobPositionInPhase)' + ArtifactType: Container + parallel: true + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\Release' + ArtifactName: 'Windows testDesktop test logs batch $(System.JobPositionInPhase)' + publishLocation: Container + continueOnError: true + condition: always() + - script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj + displayName: Dump NuGet cache contents + condition: failed() + - task: PublishBuildArtifacts@1 + displayName: Publish NuGet cache contents + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents' + ArtifactName: 'NuGetPackageContents Windows testDesktop $(System.JobPositionInPhase)' + publishLocation: Container + continueOnError: true + condition: failed() + # Mock official build - job: MockOfficial pool: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 146372ecde6..fe2fe5731bd 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -73,6 +73,7 @@ param ( [switch]$compressAllMetadata, [switch]$buildnorealsig = $true, [switch]$verifypackageshipstatus = $false, + [string]$testBatch = "", [parameter(ValueFromRemainingArguments = $true)][string[]]$properties) Set-StrictMode -version 2.0 @@ -356,16 +357,24 @@ function VerifyAssemblyVersionsAndSymbols() { } } -function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") { +function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string] $settings = "") { + $dotnetPath = InitializeDotNetCli $dotnetExe = Join-Path $dotnetPath "dotnet.exe" $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) + + $testBatchSuffix = "" + if ($testBatch) { + $testBatchSuffix = "_batch$testBatch" + } + # {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath # This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution. - $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}.xml" - $testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog" - $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" - $args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=true" + $testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}$testBatchSuffix.xml" + + $testBinLogPath = "$LogDir\${projectName}_$targetFramework$testBatch.binlog" + $args = "test $testProject -c $configuration -f $targetFramework --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" + $args += " --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration" if (-not $noVisualStudio -or $norestore) { $args += " --no-restore" @@ -376,22 +385,12 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str } $args += " $settings" - - if ($asBackgroundJob) { - Write-Host - Write-Host("Starting on the background: $args") - Write-Host("------------------------------------") - Start-Job -ScriptBlock { - $argArray = $using:args -Split " " - & $using:dotnetExe $argArray - if ($LASTEXITCODE -ne 0) { - throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args" - } - } - } else { - Write-Host("$args") - Exec-Console $dotnetExe $args + if ($testBatch) { + $args += " --filter batch=$testBatch" } + + Write-Host("$args") + Exec-Console $dotnetExe $args } function Prepare-TempDir() { @@ -595,34 +594,12 @@ try { $script:BuildCategory = "Test" $script:BuildMessage = "Failure running tests" - function Receive($job) { - while($job.HasMoreData) { - Receive-Job $job | Write-Host - Start-Sleep -Seconds 1 - } - Receive-Job $job -Wait -ErrorAction Stop - } - if ($testCoreClr) { - $cpuLimit = if ($ci) { "-m:1 -- xUnit.MaxParallelThreads=1" } else { "" } - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings $cpuLimit + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework } - if ($testDesktop -and $ci) { - $bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true - - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Test.Utilities\FSharp.Test.Utilities.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Test.Utilities\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - - Receive -job $bgJob - } - - if ($testDesktop -and -not $ci ) { - TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + if ($testDesktop) { + TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework } if ($testFSharpQA) { @@ -653,50 +630,49 @@ try { } if ($testFSharpCore) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompiler) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompilerComponentTests) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCompilerService) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testCambridge) { - TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testScripting) { - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" - TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework + TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testEditor -and -not $noVisualStudio) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.Tests\FSharp.Editor.Tests.fsproj" -targetFramework $script:desktopTargetFramework } if ($testVs -and -not $noVisualStudio) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\VisualFSharp.UnitTests\" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework } - if ($testIntegration) { - TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Editor.IntegrationTests\" + TestUsingMSBuild -testProject "$RepoRoot\vsintegration\tests\FSharp.Editor.IntegrationTests\FSharp.Editor.IntegrationTests.csproj" -targetFramework $script:desktopTargetFramework } if ($testAOT) { diff --git a/eng/build.sh b/eng/build.sh index 3c9404c8161..07c3889f33d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -76,6 +76,7 @@ prepare_machine=false source_build=false product_build=false buildnorealsig=true +testbatch="" properties="" docker=false @@ -104,6 +105,11 @@ while [[ $# > 0 ]]; do args="$args $1" shift ;; + --testbatch) + testbatch=$2 + args="$args $1" + shift + ;; --verbosity|-v) verbosity=$2 args="$args $1" @@ -224,8 +230,16 @@ function Test() { projectname=$(basename -- "$testproject") projectname="${projectname%.*}" - testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" - args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false" + testbatchsuffix="" + if [[ "$testbatch" != "" ]]; then + testbatchsuffix="_batch$testbatch" + fi + testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework$testbatchsuffix.xml" + args="test \"$testproject\" --no-build -c $configuration -f $targetframework --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration" + + if [[ "$testbatch" != "" ]]; then + args="$args --filter batch=$testbatch" + fi "$DOTNET_INSTALL_DIR/dotnet" $args || exit $? } diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs index 50deb42ea68..6f57efef4a4 100644 --- a/tests/FSharp.Test.Utilities/XunitHelpers.fs +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -91,6 +91,23 @@ module TestCaseCustomizations = else testCase.TestMethod + let sha = Security.Cryptography.SHA256.Create() + + // We add extra trait to each test, of the form "batch=n" where n is between 1 and 4. + // It can be used to filter on in multi-agent testing in CI + // with dotnet test filter switch, for example "--filter batch=1" + // That way each agent can run test for a batch of tests. + let NumberOfBatchesInMultiAgentTesting = 4u + + let addBatchTrait (testCase: ITestCase) = + // Get a batch number stable between multiple test runs. + // UniqueID is ideal here, it does not change across many compilations of the same code + // and it will split theories with member data into many batches. + let data = Text.Encoding.UTF8.GetBytes testCase.UniqueID + let hashCode = BitConverter.ToUInt32(sha.ComputeHash(data), 0) + let batch = hashCode % NumberOfBatchesInMultiAgentTesting + 1u + testCase.Traits.Add("batch", ResizeArray [ string batch ]) + type CustomTestCase = inherit XunitTestCase // xUinit demands this constructor for deserialization. @@ -110,6 +127,7 @@ type CustomTestCase = override testCase.Initialize () = base.Initialize() testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase type CustomTheoryTestCase = inherit XunitTheoryTestCase @@ -128,6 +146,7 @@ type CustomTheoryTestCase = override testCase.Initialize () = base.Initialize() testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase #endif From c63e1ee480494a78aa93a3719569ee68dee8df84 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 09:40:14 +0200 Subject: [PATCH 104/134] Update dependencies from https://github.com/dotnet/arcade build 20250521.1 (#18588) Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25266.2 -> To Version 9.0.0-beta.25271.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 90822292cd0..d5fd07440cb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -31,9 +31,9 @@ - + https://github.com/dotnet/arcade - c62eeb5b5432f9eaa034fbd641ccd9fd0d928fb3 + 086a1771875b63404b4a710d27250fe384dc2810 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/global.json b/global.json index 6b8604364e3..a85e3a5fec3 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25266.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25271.1", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } From d67ac13595ff17b0bd7d7fd8fd2c96ee51c417b4 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 22 May 2025 09:02:06 +0100 Subject: [PATCH 105/134] Allow `return|return!` `yield|yield!` and type annotations without parentheses (#18533) --- .../.FSharp.Compiler.Service/10.0.100.md | 2 +- .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/pars.fsy | 36 ++++- .../Language/ComputationExpressionTests.fs | 138 +++++++++++++++++- .../SequenceExpressionTests.fs | 90 ++++++++++++ .../data/SyntaxTree/Expression/Return 01.fs | 7 + .../SyntaxTree/Expression/Return 01.fs.bsl | 37 +++++ .../data/SyntaxTree/Expression/Return 02.fs | 7 + .../SyntaxTree/Expression/Return 02.fs.bsl | 40 +++++ .../data/SyntaxTree/Expression/Return 03.fs | 7 + .../SyntaxTree/Expression/Return 03.fs.bsl | 37 +++++ .../data/SyntaxTree/Expression/Return 04.fs | 7 + .../SyntaxTree/Expression/Return 04.fs.bsl | 40 +++++ .../data/SyntaxTree/Expression/Return 05.fs | 7 + .../SyntaxTree/Expression/Return 05.fs.bsl | 33 +++++ .../data/SyntaxTree/Expression/Return 06.fs | 7 + .../SyntaxTree/Expression/Return 06.fs.bsl | 35 +++++ .../data/SyntaxTree/Expression/Return 07.fs | 6 + .../SyntaxTree/Expression/Return 07.fs.bsl | 37 +++++ .../SyntaxTree/Expression/ReturnBang 01.fs | 7 + .../Expression/ReturnBang 01.fs.bsl | 37 +++++ .../SyntaxTree/Expression/ReturnBang 02.fs | 7 + .../Expression/ReturnBang 02.fs.bsl | 40 +++++ .../SyntaxTree/Expression/ReturnBang 03.fs | 7 + .../Expression/ReturnBang 03.fs.bsl | 38 +++++ .../data/SyntaxTree/Expression/Yield 01.fs | 4 + .../SyntaxTree/Expression/Yield 01.fs.bsl | 25 ++++ .../data/SyntaxTree/Expression/Yield 02.fs | 6 + .../SyntaxTree/Expression/Yield 02.fs.bsl | 32 ++++ .../data/SyntaxTree/Expression/Yield 03.fs | 6 + .../SyntaxTree/Expression/Yield 03.fs.bsl | 35 +++++ .../data/SyntaxTree/Expression/Yield 04.fs | 4 + .../SyntaxTree/Expression/Yield 04.fs.bsl | 27 ++++ .../data/SyntaxTree/Expression/Yield 05.fs | 6 + .../SyntaxTree/Expression/Yield 05.fs.bsl | 31 ++++ .../data/SyntaxTree/Expression/Yield 06.fs | 6 + .../SyntaxTree/Expression/Yield 06.fs.bsl | 31 ++++ .../SyntaxTree/Expression/YieldBang 01.fs | 5 + .../SyntaxTree/Expression/YieldBang 01.fs.bsl | 25 ++++ .../SyntaxTree/Expression/YieldBang 02.fs | 4 + .../SyntaxTree/Expression/YieldBang 02.fs.bsl | 27 ++++ .../SyntaxTree/Expression/YieldBang 03.fs | 6 + .../SyntaxTree/Expression/YieldBang 03.fs.bsl | 32 ++++ .../SyntaxTree/Expression/YieldBang 04.fs | 7 + .../SyntaxTree/Expression/YieldBang 04.fs.bsl | 35 +++++ .../SyntaxTree/Expression/YieldBang 05.fs | 6 + .../SyntaxTree/Expression/YieldBang 05.fs.bsl | 31 ++++ .../SyntaxTree/Expression/YieldBang 06.fs | 4 + .../SyntaxTree/Expression/YieldBang 06.fs.bsl | 24 +++ 49 files changed, 1122 insertions(+), 7 deletions(-) create mode 100644 tests/service/data/SyntaxTree/Expression/Return 01.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 02.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 03.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 04.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 04.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 05.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 05.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 06.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 06.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Return 07.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Return 07.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs create mode 100644 tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 01.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 02.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 03.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 04.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 04.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 05.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 05.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 06.fs create mode 100644 tests/service/data/SyntaxTree/Expression/Yield 06.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 01.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 02.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 03.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 04.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 04.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 05.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 05.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 06.fs create mode 100644 tests/service/data/SyntaxTree/Expression/YieldBang 06.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 093ff46d163..841e49c4c31 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,5 +1,5 @@ ### Fixed - +* Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index a3bda7c0c9c..6999094ccb3 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -31,6 +31,7 @@ * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) * Code completion: fix getting qualifier expression in do statements in type decls ([PR #18524](https://github.com/dotnet/fsharp/pull/18524)) * Fixed: [#18441](https://github.com/dotnet/fsharp/issues/18441) FSI multi-emit unstable. ([PR #18465](https://github.com/dotnet/fsharp/pull/18465)) +* Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) ### Added * Added missing type constraints in FCS. ([PR #18241](https://github.com/dotnet/fsharp/pull/18241)) diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 61f8e2fef86..bbfca699064 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -4426,13 +4426,22 @@ declExpr: let mForLoopAll = rhs2 parseState 1 2 exprFromParseError (SynExpr.ForEach(spFor, spIn, SeqExprOnly false, true, $2, arbExpr ("forLoopCollection", mFor), arbExpr ("forLoopBody3", mForLoopBodyArb), mForLoopAll)) } - | YIELD declExpr + | YIELD declExpr COLON typ { let trivia: SynExprYieldOrReturnTrivia = { YieldOrReturnKeyword = rhs parseState 1 } - SynExpr.YieldOrReturn(($1, not $1), $2, (unionRanges (rhs parseState 1) $2.Range), trivia) } + let typedExpr = SynExpr.Typed($2, $4, unionRanges $2.Range $4.Range) + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang typedExpr.Range + SynExpr.YieldOrReturn(($1, not $1), typedExpr, (unionRanges (rhs parseState 1) $4.Range), trivia) } - | YIELD_BANG declExpr - { let trivia: SynExprYieldOrReturnFromTrivia = { YieldOrReturnFromKeyword = rhs parseState 1 } - SynExpr.YieldOrReturnFrom(($1, not $1), $2, (unionRanges (rhs parseState 1) $2.Range), trivia) } + | YIELD declExpr opt_topReturnTypeWithTypeConstraints + { let trivia: SynExprYieldOrReturnTrivia = { YieldOrReturnKeyword = rhs parseState 1 } + let expr = + match $3 with + | None -> $2 + | Some(_, SynReturnInfo((ty, _), m)) -> + let m = unionRanges $2.Range m + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang m + SynExpr.Typed($2, ty, m) + SynExpr.YieldOrReturn(($1, not $1), expr, (unionRanges (rhs parseState 1) expr.Range), trivia) } | YIELD recover { let mYieldAll = rhs parseState 1 @@ -4444,6 +4453,23 @@ declExpr: let trivia: SynExprYieldOrReturnFromTrivia = { YieldOrReturnFromKeyword = rhs parseState 1 } SynExpr.YieldOrReturnFrom(($1, not $1), arbExpr ("yield!", mYieldAll), mYieldAll, trivia) } + | YIELD_BANG declExpr COLON typ + { let trivia: SynExprYieldOrReturnFromTrivia = { YieldOrReturnFromKeyword = rhs parseState 1 } + let typedExpr = SynExpr.Typed($2, $4, unionRanges $2.Range $4.Range) + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang typedExpr.Range + SynExpr.YieldOrReturnFrom(($1, not $1), typedExpr, (unionRanges (rhs parseState 1) $2.Range), trivia) } + + | YIELD_BANG declExpr opt_topReturnTypeWithTypeConstraints + { let trivia: SynExprYieldOrReturnFromTrivia = { YieldOrReturnFromKeyword = rhs parseState 1 } + let expr = + match $3 with + | None -> $2 + | Some(_, SynReturnInfo((ty, _), m)) -> + let m = unionRanges $2.Range m + parseState.LexBuffer.CheckLanguageFeatureAndRecover LanguageFeature.AllowTypedLetOrUseBang m + SynExpr.Typed($2, ty, m) + SynExpr.YieldOrReturnFrom(($1, not $1), expr, (unionRanges (rhs parseState 1) $2.Range), trivia) } + | BINDER headBindingPattern EQUALS typedSequentialExprBlock IN opt_OBLOCKSEP moreBinders typedSequentialExprBlock %prec expr_let { (* This rule handles the 'use!' and 'let!' binding expressions in computation expressions *) (* The BINDER token represents keywords like 'use!' or 'let!' *) diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 6b0a260a42f..da918ffc00a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. namespace Language @@ -23,6 +23,142 @@ let x = lb {1; 2;} |> shouldSucceed |> ignore + [] + let ``Version 9.0: Allow CE return and type annotations don't play well together needing parentheses``() = + FSharp """ +module ComputationExpressionTests +open System + +type MyType() = + interface IDisposable with + member this.Dispose () = () + +let f () = + async { + return new MyType() : IDisposable + } + +let f1 () = + async { + return new MyType() :> IDisposable + } + +let f2 () : Async = + async { + return new MyType() + } + +let f3 () = + async { + return (new MyType() : IDisposable) + } + """ + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 11, Col 16, Line 11, Col 42, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Version 9.0: Allow CE return! and type annotations don't to play well together needing parentheses``() = + FSharp """ +module ComputationExpressionTests + +type ResultBuilder() = + member _.Return(x) = Ok x + member _.ReturnFrom(x) = x + member _.Bind(m, f) = + match m with + | Ok a -> f a + | Error e -> Error e + +let result = ResultBuilder() + +let f() = + result { + return! Ok 1 : Result + } + +let f1() = + result { + return! (Ok 1 : Result) + } + """ + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 16, Col 17, Line 16, Col 43, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Allow CE return and type annotations to play well together without needing parentheses``() = + FSharp """ +module ComputationExpressionTests +open System + +type MyType() = + interface IDisposable with + member this.Dispose () = () + +let f () = + async { + return new MyType() : IDisposable + } + +let f1 () = + async { + return new MyType() :> IDisposable + } + +let f2 () : Async = + async { + return new MyType() + } + +let f3 () = + async { + return (new MyType() : IDisposable) + } + """ + |> withLangVersionPreview + |> asExe + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + + [] + let ``Preview: Allow CE return! and type annotations to play well together without needing parentheses``() = + FSharp """ +module ComputationExpressionTests + +type ResultBuilder() = + member _.Return(x) = Ok x + member _.ReturnFrom(x) = x + member _.Bind(m, f) = + match m with + | Ok a -> f a + | Error e -> Error e + +let result = ResultBuilder() + +let f() = + result { + return! Ok 1 : Result + } + +let f1() = + result { + return! (Ok 1 : Result) + } + """ + |> withLangVersionPreview + |> asExe + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + [] let ``A CE explicitly using Zero fails without a defined Zero``() = FSharp """ diff --git a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs index d64262e856b..8490b41a750 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/SequenceExpressions/SequenceExpressionTests.fs @@ -644,4 +644,94 @@ let c = [ { 1;10 } ] |> withOptions [ "--nowarn:0020" ] |> withLangVersionPreview |> typecheck + |> shouldSucceed + + [] + let ``Version 9.0: Allow SE yield and type annotations don't play well together needing parentheses``() = + FSharp """ +module SequenceExpressionTests +open System + +let f() = + seq { + yield 1 : int + } + +let f1() = + seq { + yield (1 : int) + } + """ + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 7, Col 15, Line 7, Col 22, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Allow SE yield and type annotations to play well together without needing parentheses``() = + FSharp """ +module SequenceExpressionTests +open System + +let f() = + seq { + yield 1 : int + } + +let f1() = + seq { + yield (1 : int) + } + """ + |> withLangVersionPreview + |> asExe + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + + [] + let ``Version 9.0: Allow SE yield! and type annotations don't play well together needing parentheses``() = + FSharp """ +module SequenceExpressionTests +open System + +let f() = + seq { + yield! [1;2] : int list + } + +let f1() = + seq { + yield! ([1;2] : int list) + } + """ + |> withLangVersion90 + |> typecheck + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 7, Col 16, Line 7, Col 32, "Feature 'Allow let! and use! type annotations without requiring parentheses' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Allow SE yield! and type annotations to play well together without needing parentheses``() = + FSharp """ +module SequenceExpressionTests +open System + +let f() = + seq { + yield! [1;2] : int list + } + +let f1() = + seq { + yield! ([1;2] : int list) + } + """ + |> withLangVersionPreview + |> asExe + |> ignoreWarnings + |> compileAndRun |> shouldSucceed \ No newline at end of file diff --git a/tests/service/data/SyntaxTree/Expression/Return 01.fs b/tests/service/data/SyntaxTree/Expression/Return 01.fs new file mode 100644 index 00000000000..51695776a55 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 01.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return new MyType() : IDisposable + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 01.fs.bsl new file mode 100644 index 00000000000..86c81fa6d87 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 01.fs.bsl @@ -0,0 +1,37 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Typed + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,25--5,27)), (5,15--5,27)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,15--5,41)), (5,8--5,41), + { YieldOrReturnKeyword = (5,8--5,14) }), (4,10--6,5)), + (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 02.fs b/tests/service/data/SyntaxTree/Expression/Return 02.fs new file mode 100644 index 00000000000..2bfa5ecf136 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 02.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return (new MyType() : IDisposable) + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 02.fs.bsl new file mode 100644 index 00000000000..678e228062b --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 02.fs.bsl @@ -0,0 +1,40 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Paren + (Typed + (New + (false, + LongIdent + (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,26--5,28)), (5,16--5,28)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,16--5,42)), (5,15--5,16), Some (5,42--5,43), + (5,15--5,43)), (5,8--5,43), + { YieldOrReturnKeyword = (5,8--5,14) }), (4,10--6,5)), + (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 03.fs b/tests/service/data/SyntaxTree/Expression/Return 03.fs new file mode 100644 index 00000000000..ddf6e531468 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 03.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return new MyType() :> IDisposable + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 03.fs.bsl new file mode 100644 index 00000000000..467a5f86141 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 03.fs.bsl @@ -0,0 +1,37 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Upcast + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,25--5,27)), (5,15--5,27)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,15--5,42)), (5,8--5,42), + { YieldOrReturnKeyword = (5,8--5,14) }), (4,10--6,5)), + (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 04.fs b/tests/service/data/SyntaxTree/Expression/Return 04.fs new file mode 100644 index 00000000000..933a72820cc --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 04.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return (new MyType() :> IDisposable) + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 04.fs.bsl new file mode 100644 index 00000000000..bc6451d72ab --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 04.fs.bsl @@ -0,0 +1,40 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Paren + (Upcast + (New + (false, + LongIdent + (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,26--5,28)), (5,16--5,28)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,16--5,43)), (5,15--5,16), Some (5,43--5,44), + (5,15--5,44)), (5,8--5,44), + { YieldOrReturnKeyword = (5,8--5,14) }), (4,10--6,5)), + (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 05.fs b/tests/service/data/SyntaxTree/Expression/Return 05.fs new file mode 100644 index 00000000000..bd1ef865815 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 05.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return new MyType() + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 05.fs.bsl new file mode 100644 index 00000000000..beaaf365ecc --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 05.fs.bsl @@ -0,0 +1,33 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 05.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,25--5,27)), (5,15--5,27)), + (5,8--5,27), { YieldOrReturnKeyword = (5,8--5,14) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 06.fs b/tests/service/data/SyntaxTree/Expression/Return 06.fs new file mode 100644 index 00000000000..95941f09646 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 06.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return (new MyType()) + } + diff --git a/tests/service/data/SyntaxTree/Expression/Return 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 06.fs.bsl new file mode 100644 index 00000000000..04d0ad024e7 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 06.fs.bsl @@ -0,0 +1,35 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 06.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Paren + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,26--5,28)), (5,16--5,28)), + (5,15--5,16), Some (5,28--5,29), (5,15--5,29)), + (5,8--5,29), { YieldOrReturnKeyword = (5,8--5,14) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Return 07.fs b/tests/service/data/SyntaxTree/Expression/Return 07.fs new file mode 100644 index 00000000000..19e68b27e5c --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 07.fs @@ -0,0 +1,6 @@ +module Module + +let _ = + async { + return new MyType() : + } diff --git a/tests/service/data/SyntaxTree/Expression/Return 07.fs.bsl b/tests/service/data/SyntaxTree/Expression/Return 07.fs.bsl new file mode 100644 index 00000000000..0bf151be5bb --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Return 07.fs.bsl @@ -0,0 +1,37 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Return 07.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturn + ((false, true), + Typed + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,25--5,27)), (5,15--5,27)), + FromParseError (5,29--5,29), (5,15--5,29)), + (5,8--5,29), { YieldOrReturnKeyword = (5,8--5,14) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(6,4)-(6,5) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs b/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs new file mode 100644 index 00000000000..009a45b4c08 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return! new MyType() : IDisposable + } + diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs.bsl new file mode 100644 index 00000000000..4890e673c4c --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 01.fs.bsl @@ -0,0 +1,37 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/ReturnBang 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturnFrom + ((false, true), + Typed + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,26--5,28)), (5,16--5,28)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,16--5,42)), (5,8--5,28), + { YieldOrReturnFromKeyword = (5,8--5,15) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs b/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs new file mode 100644 index 00000000000..91fd750a01b --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return! (new MyType() : IDisposable) + } + diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs.bsl new file mode 100644 index 00000000000..4ff6f08be18 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 02.fs.bsl @@ -0,0 +1,40 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/ReturnBang 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturnFrom + ((false, true), + Paren + (Typed + (New + (false, + LongIdent + (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,27--5,29)), (5,17--5,29)), + LongIdent + (SynLongIdent ([IDisposable], [], [None])), + (5,17--5,43)), (5,16--5,17), Some (5,43--5,44), + (5,16--5,44)), (5,8--5,44), + { YieldOrReturnFromKeyword = (5,8--5,15) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs b/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs new file mode 100644 index 00000000000..dcb7b9c149a --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs @@ -0,0 +1,7 @@ +module Module + +let _ = + async { + return! new MyType() : + } + diff --git a/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs.bsl new file mode 100644 index 00000000000..e23e8ccde38 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/ReturnBang 03.fs.bsl @@ -0,0 +1,38 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/ReturnBang 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + Wild (3,4--3,5), None, + App + (NonAtomic, false, Ident async, + ComputationExpr + (false, + YieldOrReturnFrom + ((false, true), + Typed + (New + (false, + LongIdent (SynLongIdent ([MyType], [], [None])), + Const (Unit, (5,26--5,28)), (5,16--5,28)), + FromParseError (5,30--5,30), (5,16--5,30)), + (5,8--5,28), + { YieldOrReturnFromKeyword = (5,8--5,15) }), + (4,10--6,5)), (4,4--6,5)), (3,4--3,5), NoneAtLet, + { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,6--3,7) })], (3,0--6,5))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--6,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(6,4)-(6,5) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Yield 01.fs b/tests/service/data/SyntaxTree/Expression/Yield 01.fs new file mode 100644 index 00000000000..8f3656d8fcb --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 01.fs @@ -0,0 +1,4 @@ +module Module + +yield [ 1 .. 10 ]: int list + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 01.fs.bsl new file mode 100644 index 00000000000..f6aabb5d447 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 01.fs.bsl @@ -0,0 +1,25 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (YieldOrReturn + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (3,8--3,9))), (3,10--3,12), + Some (Const (Int32 10, (3,13--3,15))), (3,8--3,9), + (3,13--3,15), (3,8--3,15)), (3,6--3,17)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], None, + true, (3,19--3,27)), (3,6--3,27)), (3,0--3,27), + { YieldOrReturnKeyword = (3,0--3,5) }), (3,0--3,27))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Yield 02.fs b/tests/service/data/SyntaxTree/Expression/Yield 02.fs new file mode 100644 index 00000000000..0573f7af70a --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 02.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield [ 1 .. 10 ]: int list +} + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 02.fs.bsl new file mode 100644 index 00000000000..0948c6de6b3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 02.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturn + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,12--4,13))), + (4,14--4,16), + Some (Const (Int32 10, (4,17--4,19))), + (4,12--4,13), (4,17--4,19), (4,12--4,19)), + (4,10--4,21)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (4,23--4,31)), (4,10--4,31)), + (4,4--4,31), { YieldOrReturnKeyword = (4,4--4,9) }), + (3,4--5,1)), (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Yield 03.fs b/tests/service/data/SyntaxTree/Expression/Yield 03.fs new file mode 100644 index 00000000000..d5c1f13e24f --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 03.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield ([ 1 .. 10 ]: int list) +} + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 03.fs.bsl new file mode 100644 index 00000000000..a064eecfdc1 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 03.fs.bsl @@ -0,0 +1,35 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturn + ((true, false), + Paren + (Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,13--4,14))), + (4,15--4,17), + Some (Const (Int32 10, (4,18--4,20))), + (4,13--4,14), (4,18--4,20), (4,13--4,20)), + (4,11--4,22)), + App + (LongIdent (SynLongIdent ([list], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], + [], None, true, (4,24--4,32)), (4,11--4,32)), + (4,10--4,11), Some (4,32--4,33), (4,10--4,33)), + (4,4--4,33), { YieldOrReturnKeyword = (4,4--4,9) }), + (3,4--5,1)), (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Yield 04.fs b/tests/service/data/SyntaxTree/Expression/Yield 04.fs new file mode 100644 index 00000000000..e31740cb322 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 04.fs @@ -0,0 +1,4 @@ +module Module + +yield ([ 1 .. 10 ]: int list) + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 04.fs.bsl new file mode 100644 index 00000000000..d3e1a1510ed --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 04.fs.bsl @@ -0,0 +1,27 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (YieldOrReturn + ((true, false), + Paren + (Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (3,9--3,10))), (3,11--3,13), + Some (Const (Int32 10, (3,14--3,16))), (3,9--3,10), + (3,14--3,16), (3,9--3,16)), (3,7--3,18)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (3,20--3,28)), (3,7--3,28)), (3,6--3,7), + Some (3,28--3,29), (3,6--3,29)), (3,0--3,29), + { YieldOrReturnKeyword = (3,0--3,5) }), (3,0--3,29))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,29), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/Yield 05.fs b/tests/service/data/SyntaxTree/Expression/Yield 05.fs new file mode 100644 index 00000000000..573d3b81cdc --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 05.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield [ 1 .. 10 ] : +} + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 05.fs.bsl new file mode 100644 index 00000000000..1deada75f94 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 05.fs.bsl @@ -0,0 +1,31 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 05.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturn + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,12--4,13))), + (4,14--4,16), + Some (Const (Int32 10, (4,17--4,19))), + (4,12--4,13), (4,17--4,19), (4,12--4,19)), + (4,10--4,21)), FromParseError (4,23--4,23), + (4,10--4,23)), (4,4--4,23), + { YieldOrReturnKeyword = (4,4--4,9) }), (3,4--5,1)), + (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,0)-(5,1) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/Yield 06.fs b/tests/service/data/SyntaxTree/Expression/Yield 06.fs new file mode 100644 index 00000000000..bb699f40621 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 06.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield [ 1 .. 10 ] : +} + diff --git a/tests/service/data/SyntaxTree/Expression/Yield 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Yield 06.fs.bsl new file mode 100644 index 00000000000..ced49e682d6 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/Yield 06.fs.bsl @@ -0,0 +1,31 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/Yield 06.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturn + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,12--4,13))), + (4,14--4,16), + Some (Const (Int32 10, (4,17--4,19))), + (4,12--4,13), (4,17--4,19), (4,12--4,19)), + (4,10--4,21)), FromParseError (4,23--4,23), + (4,10--4,23)), (4,4--4,23), + { YieldOrReturnKeyword = (4,4--4,9) }), (3,4--5,1)), + (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,0)-(5,1) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs new file mode 100644 index 00000000000..dbfd3f4beef --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs @@ -0,0 +1,5 @@ +module Module + +yield! [ 1 .. 10 ]: int list + + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs.bsl new file mode 100644 index 00000000000..3d1e71f4894 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 01.fs.bsl @@ -0,0 +1,25 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 01.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (YieldOrReturnFrom + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (3,9--3,10))), (3,11--3,13), + Some (Const (Int32 10, (3,14--3,16))), (3,9--3,10), + (3,14--3,16), (3,9--3,16)), (3,7--3,18)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], None, + true, (3,20--3,28)), (3,7--3,28)), (3,0--3,18), + { YieldOrReturnFromKeyword = (3,0--3,6) }), (3,0--3,18))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs new file mode 100644 index 00000000000..ed1bd0fea97 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs @@ -0,0 +1,4 @@ +module Module + +yield! ([ 1 .. 10 ]: int list) + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs.bsl new file mode 100644 index 00000000000..08d1db3d26e --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 02.fs.bsl @@ -0,0 +1,27 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 02.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (YieldOrReturnFrom + ((true, false), + Paren + (Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (3,10--3,11))), (3,12--3,14), + Some (Const (Int32 10, (3,15--3,17))), (3,10--3,11), + (3,15--3,17), (3,10--3,17)), (3,8--3,19)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (3,21--3,29)), (3,8--3,29)), (3,7--3,8), + Some (3,29--3,30), (3,7--3,30)), (3,0--3,30), + { YieldOrReturnFromKeyword = (3,0--3,6) }), (3,0--3,30))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs new file mode 100644 index 00000000000..c80ceb053c5 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield! [ 1 .. 10 ]: int list +} + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs.bsl new file mode 100644 index 00000000000..09804abe660 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 03.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 03.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturnFrom + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,13--4,14))), + (4,15--4,17), + Some (Const (Int32 10, (4,18--4,20))), + (4,13--4,14), (4,18--4,20), (4,13--4,20)), + (4,11--4,22)), + App + (LongIdent (SynLongIdent ([list], [], [None])), None, + [LongIdent (SynLongIdent ([int], [], [None]))], [], + None, true, (4,24--4,32)), (4,11--4,32)), + (4,4--4,22), { YieldOrReturnFromKeyword = (4,4--4,10) }), + (3,4--5,1)), (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs new file mode 100644 index 00000000000..e80aee60891 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs @@ -0,0 +1,7 @@ +module Module + +seq { + yield! ([ 1 .. 10 ]: int list) +} + + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs.bsl new file mode 100644 index 00000000000..a5fde092fb8 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 04.fs.bsl @@ -0,0 +1,35 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 04.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturnFrom + ((true, false), + Paren + (Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,14--4,15))), + (4,16--4,18), + Some (Const (Int32 10, (4,19--4,21))), + (4,14--4,15), (4,19--4,21), (4,14--4,21)), + (4,12--4,23)), + App + (LongIdent (SynLongIdent ([list], [], [None])), + None, + [LongIdent (SynLongIdent ([int], [], [None]))], + [], None, true, (4,25--4,33)), (4,12--4,33)), + (4,11--4,12), Some (4,33--4,34), (4,11--4,34)), + (4,4--4,34), { YieldOrReturnFromKeyword = (4,4--4,10) }), + (3,4--5,1)), (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs new file mode 100644 index 00000000000..5870293c0d1 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs @@ -0,0 +1,6 @@ +module Module + +seq { + yield! [ 1 .. 10 ] : +} + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs.bsl new file mode 100644 index 00000000000..595f455632d --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 05.fs.bsl @@ -0,0 +1,31 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 05.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (App + (NonAtomic, false, Ident seq, + ComputationExpr + (false, + YieldOrReturnFrom + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (4,13--4,14))), + (4,15--4,17), + Some (Const (Int32 10, (4,18--4,20))), + (4,13--4,14), (4,18--4,20), (4,13--4,20)), + (4,11--4,22)), FromParseError (4,24--4,24), + (4,11--4,24)), (4,4--4,22), + { YieldOrReturnFromKeyword = (4,4--4,10) }), (3,4--5,1)), + (3,0--5,1)), (3,0--5,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,0)-(5,1) parse error Unexpected symbol '}' in expression diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs b/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs new file mode 100644 index 00000000000..037f709a6e0 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs @@ -0,0 +1,4 @@ +module Module + +yield! [ 1 .. 10 ] : + diff --git a/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs.bsl new file mode 100644 index 00000000000..de83602e2d5 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/YieldBang 06.fs.bsl @@ -0,0 +1,24 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/YieldBang 06.fs", false, QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (YieldOrReturnFrom + ((true, false), + Typed + (ArrayOrListComputed + (false, + IndexRange + (Some (Const (Int32 1, (3,9--3,10))), (3,11--3,13), + Some (Const (Int32 10, (3,14--3,16))), (3,9--3,10), + (3,14--3,16), (3,9--3,16)), (3,7--3,18)), + FromParseError (3,20--3,20), (3,7--3,20)), (3,0--3,18), + { YieldOrReturnFromKeyword = (3,0--3,6) }), (3,0--3,18))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--3,18), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,0)-(5,0) parse error Incomplete structured construct at or before this point in expression From 8e3bb47e6c4d987753c9f977cf06797a1f5cd4cf Mon Sep 17 00:00:00 2001 From: Tuomas Hietanen Date: Thu, 22 May 2025 09:05:12 +0100 Subject: [PATCH 106/134] Minor perf opt: (#18541) - isNull is inline also in FSharp.Core - Lazy load of ILAssemblyRefs - Avoid looping 120 libraries through on most cases --- tests/service/data/TestTP/ProvidedTypes.fs | 57 +++++++++++++--------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/tests/service/data/TestTP/ProvidedTypes.fs b/tests/service/data/TestTP/ProvidedTypes.fs index 1df9d3139d1..218c9738f1a 100644 --- a/tests/service/data/TestTP/ProvidedTypes.fs +++ b/tests/service/data/TestTP/ProvidedTypes.fs @@ -24,9 +24,9 @@ open Microsoft.FSharp.Core.CompilerServices [] module Utils = let K x = (fun () -> x) - let isNull x = match x with null -> true | _ -> false - let isNil x = match x with [] -> true | _ -> false - let isEmpty x = match x with [| |] -> true | _ -> false + let inline isNull x = match x with null -> true | _ -> false + let inline isNil x = match x with [] -> true | _ -> false + let inline isEmpty x = match x with [| |] -> true | _ -> false module Option = let toObj x = match x with None -> null | Some x -> x @@ -6253,11 +6253,11 @@ module internal AssemblyReader = let ilModule = seekReadModule (ilMetadataVersion) 1 - let ilAssemblyRefs = [ for i in 1 .. getNumRows ILTableNames.AssemblyRef do yield seekReadAssemblyRef i ] + let ilAssemblyRefs = lazy [ for i in 1 .. getNumRows ILTableNames.AssemblyRef do yield seekReadAssemblyRef i ] member __.ILGlobals = ilg member __.ILModuleDef = ilModule - member __.ILAssemblyRefs = ilAssemblyRefs + member __.ILAssemblyRefs = ilAssemblyRefs.Force() let sigptr_get_byte (bytes: byte[]) sigptr = int bytes[sigptr], sigptr + 1 @@ -8988,31 +8988,42 @@ namespace ProviderImplementation.ProvidedTypes let asms = (if toTgt then getTargetAssemblies() else getSourceAssemblies()) let fullName = fixName t.FullName - // TODO: this linear search through all available source/target assemblies feels as if it must be too slow in some cases. - // However, we store type translations in various tables (typeTableFwd and typeTableBwd) so perhaps it is not a problem - let rec loop i = - if i < 0 then - let msg = - if toTgt then sprintf "The design-time type '%O' utilized by a type provider was not found in the target reference assembly set '%A'. You may be referencing a profile which contains fewer types than those needed by the type provider you are using." t (getTargetAssemblies() |> Seq.toList) - elif getSourceAssemblies() |> Seq.isEmpty then sprintf "A failure occurred while determining compilation references" - else sprintf "The target type '%O' utilized by a type provider was not found in the design-time assembly set '%A'. Please report this problem to the project site for the type provider." t (getSourceAssemblies() |> Seq.toList) - failwith msg - else - match tryGetTypeFromAssembly toTgt t.Assembly.FullName fullName asms[i] with - | Some (newT, canSave) -> - if canSave then table[t] <- newT - newT - | None -> loop (i - 1) - loop (asms.Count - 1) + let bestGuess = + asms |> Seq.tryFind(fun a -> a.FullName = t.Assembly.FullName) + |> Option.bind(fun a -> tryGetTypeFromAssembly toTgt t.Assembly.FullName fullName a) + + match bestGuess with + | Some (newT, canSave) -> + if canSave then table.[t] <- newT + newT + | None -> + + // TODO: this linear search through all available source/target assemblies feels as if it must be too slow in some cases. + // However, we store type translations in various tables (typeTableFwd and typeTableBwd) so perhaps it is not a problem + let rec loop i = + if i < 0 then + let msg = + if toTgt then sprintf "The design-time type '%O' utilized by a type provider was not found in the target reference assembly set '%A'. You may be referencing a profile which contains fewer types than those needed by the type provider you are using." t (getTargetAssemblies() |> Seq.toList) + elif getSourceAssemblies() |> Seq.isEmpty then sprintf "A failure occurred while determining compilation references" + else sprintf "The target type '%O' utilized by a type provider was not found in the design-time assembly set '%A'. Please report this problem to the project site for the type provider." t (getSourceAssemblies() |> Seq.toList) + failwith msg + else + match tryGetTypeFromAssembly toTgt t.Assembly.FullName fullName asms[i] with + | Some (newT, canSave) -> + if canSave then table[t] <- newT + newT + | None -> loop (i - 1) + loop (asms.Count - 1) and convType toTgt (t:Type) = let table = (if toTgt then typeTableFwd else typeTableBwd) match table.TryGetValue(t) with | true, newT -> newT | false, _ -> - if t :? ProvidedTypeSymbol && (t :?> ProvidedTypeSymbol).IsFSharpTypeAbbreviation then t + let isSymbol = t :? ProvidedTypeSymbol + if isSymbol && (t :?> ProvidedTypeSymbol).IsFSharpTypeAbbreviation then t // Types annotated with units-of-measure - elif t :? ProvidedTypeSymbol && (t :?> ProvidedTypeSymbol).IsFSharpUnitAnnotated then + elif isSymbol && (t :?> ProvidedTypeSymbol).IsFSharpUnitAnnotated then let genericType = t.GetGenericTypeDefinition() let newT = convTypeRef toTgt genericType let typeArguments = t.GetGenericArguments() |> Array.map (convType toTgt) |> Array.toList From ce2d4563ab391ccd480c6173ee1408e09af3ddc2 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 22 May 2025 10:13:36 +0200 Subject: [PATCH 107/134] add contrib.rocks to README.md (#18564) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0def09e17fe..e5fde71496f 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,13 @@ If you're curious about F# itself, check out these links: * [Get started with F#](https://learn.microsoft.com/dotnet/fsharp/get-started/) * [F# Software Foundation](https://fsharp.org) * [F# Testimonials](https://fsharp.org/testimonials) + +## Contributors ✨ + +F# exists because of these wonderful people: + + + + + +Made with [contrib.rocks](https://contrib.rocks). From fb50b56bd085002cb31099b0a8e57775883802a1 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 22 May 2025 04:47:44 -0400 Subject: [PATCH 108/134] Use struct tuple instead of reference tuple for pair ordering (#18513) --- src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs | 4 ++-- src/Compiler/Utilities/lib.fs | 3 +-- src/Compiler/Utilities/lib.fsi | 2 +- src/Compiler/Utilities/range.fs | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index 0e2ced16da4..0b1f58713ba 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -330,8 +330,8 @@ type ReqdItem = let reqdItemOrder = let rep = function - | ReqdSubEnv v -> true, v - | ReqdVal v -> false, v + | ReqdSubEnv v -> struct (true, v) + | ReqdVal v -> struct (false, v) Order.orderOn rep (Pair.order (Bool.order, valOrder)) diff --git a/src/Compiler/Utilities/lib.fs b/src/Compiler/Utilities/lib.fs index 609245f636e..8acde600ec4 100755 --- a/src/Compiler/Utilities/lib.fs +++ b/src/Compiler/Utilities/lib.fs @@ -59,12 +59,11 @@ module Int64 = module Pair = let order (compare1: IComparer<'T1>, compare2: IComparer<'T2>) = - { new IComparer<'T1 * 'T2> with + { new IComparer with member _.Compare((a1, a2), (aa1, aa2)) = let res1 = compare1.Compare (a1, aa1) if res1 <> 0 then res1 else compare2.Compare (a2, aa2) } - type NameSet = Zset module NameSet = diff --git a/src/Compiler/Utilities/lib.fsi b/src/Compiler/Utilities/lib.fsi index 1dfd610d55a..5d82031642f 100644 --- a/src/Compiler/Utilities/lib.fsi +++ b/src/Compiler/Utilities/lib.fsi @@ -52,7 +52,7 @@ module Int64 = val order: IComparer module Pair = - val order: compare1: IComparer<'T1> * compare2: IComparer<'T2> -> IComparer<'T1 * 'T2> + val order: compare1: IComparer<'T1> * compare2: IComparer<'T2> -> IComparer type NameSet = Zset diff --git a/src/Compiler/Utilities/range.fs b/src/Compiler/Utilities/range.fs index 5e13752df0b..0857d7c4d7c 100755 --- a/src/Compiler/Utilities/range.fs +++ b/src/Compiler/Utilities/range.fs @@ -449,7 +449,7 @@ module Range = let posOrder = let pairOrder = Pair.order (Int32.order, Int32.order) - let lineAndColumn = fun (p: pos) -> p.Line, p.Column + let lineAndColumn = fun (p: pos) -> struct (p.Line, p.Column) { new IComparer with member _.Compare(x, xx) = @@ -458,7 +458,7 @@ module Range = let rangeOrder = let tripleOrder = Pair.order (String.order, Pair.order (posOrder, posOrder)) - let fileLineColumn = fun (r: range) -> r.FileName, (r.Start, r.End) + let fileLineColumn = fun (r: range) -> struct (r.FileName, struct (r.Start, r.End)) { new IComparer with member _.Compare(x, xx) = From 10c07b3fafb8b277b6a17ad6e3a5dd65a4647b60 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Thu, 22 May 2025 10:35:17 +0100 Subject: [PATCH 109/134] Fix parsing errors using anonymous records and units of measures (#18543) --- .../.FSharp.Compiler.Service/10.0.100.md | 2 + .../.FSharp.Compiler.Service/9.0.300.md | 1 + docs/release-notes/.Language/preview.md | 1 + src/Compiler/Driver/CompilerDiagnostics.fs | 1 + src/Compiler/FSComp.txt | 1 + src/Compiler/FSStrings.resx | 3 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/Service/ServiceLexing.fs | 3 + src/Compiler/Service/ServiceLexing.fsi | 1 + src/Compiler/SyntaxTree/LexFilter.fs | 7 +- src/Compiler/lex.fsl | 2 + src/Compiler/pars.fsy | 2 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + src/Compiler/xlf/FSStrings.cs.xlf | 5 + src/Compiler/xlf/FSStrings.de.xlf | 5 + src/Compiler/xlf/FSStrings.es.xlf | 5 + src/Compiler/xlf/FSStrings.fr.xlf | 5 + src/Compiler/xlf/FSStrings.it.xlf | 5 + src/Compiler/xlf/FSStrings.ja.xlf | 5 + src/Compiler/xlf/FSStrings.ko.xlf | 5 + src/Compiler/xlf/FSStrings.pl.xlf | 5 + src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 + src/Compiler/xlf/FSStrings.ru.xlf | 5 + src/Compiler/xlf/FSStrings.tr.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 + .../Types/RecordTypes/AnonymousRecords.fs | 132 ++++++++++++++++++ ...ervice.SurfaceArea.netstandard20.debug.bsl | 5 + ...vice.SurfaceArea.netstandard20.release.bsl | 5 + ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 10 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 10 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 10 +- ...ompiler.Service_Release_netstandard2.0.bsl | 10 +- .../Expression/AnonymousRecords-07.fs | 10 ++ .../Expression/AnonymousRecords-07.fs.bsl | 55 ++++++++ .../Expression/AnonymousRecords-08.fs | 9 ++ .../Expression/AnonymousRecords-08.fs.bsl | 83 +++++++++++ .../Expression/AnonymousRecords-09.fs | 10 ++ .../Expression/AnonymousRecords-09.fs.bsl | 47 +++++++ .../Expression/AnonymousRecords-10.fs | 10 ++ .../Expression/AnonymousRecords-10.fs.bsl | 55 ++++++++ .../Expression/AnonymousRecords-11.fs | 10 ++ .../Expression/AnonymousRecords-11.fs.bsl | 127 +++++++++++++++++ .../Expression/AnonymousRecords-12.fs | 10 ++ .../Expression/AnonymousRecords-12.fs.bsl | 47 +++++++ .../Expression/AnonymousRecords-13.fs | 6 + .../Expression/AnonymousRecords-13.fs.bsl | 45 ++++++ 60 files changed, 842 insertions(+), 22 deletions(-) create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 841e49c4c31..067a9d56800 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,4 +1,6 @@ ### Fixed + +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 6999094ccb3..a5341551395 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -30,6 +30,7 @@ * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) * Code completion: fix getting qualifier expression in do statements in type decls ([PR #18524](https://github.com/dotnet/fsharp/pull/18524)) +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fixed: [#18441](https://github.com/dotnet/fsharp/issues/18441) FSI multi-emit unstable. ([PR #18465](https://github.com/dotnet/fsharp/pull/18465)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 40775e8dfa6..687402597c5 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -6,6 +6,7 @@ * Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Scoped Nowarn: added 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)) * Allow `let!` and `use!` type annotations without requiring parentheses. ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 2bdb5fe6923..5f96b1f58c8 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1141,6 +1141,7 @@ type Exception with | Parser.TOKEN_COLON_EQUALS -> SR.GetString("Parser.TOKEN.COLON.EQUALS") | Parser.TOKEN_LARROW -> SR.GetString("Parser.TOKEN.LARROW") | Parser.TOKEN_EQUALS -> SR.GetString("Parser.TOKEN.EQUALS") + | Parser.TOKEN_GREATER_BAR_RBRACE -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACE") | Parser.TOKEN_GREATER_BAR_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACK") | Parser.TOKEN_MINUS -> SR.GetString("Parser.TOKEN.MINUS") | Parser.TOKEN_ADJACENT_PREFIX_OP -> SR.GetString("Parser.TOKEN.ADJACENT.PREFIX.OP") diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 1d7e9d6499a..969b40ae4ff 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1799,6 +1799,7 @@ featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" featureSupportWarnWhenUnitPassedToObjArg,"Warn when unit is passed to a member accepting `obj` argument, e.g. `Method(o:obj)` will warn if called via `Method()`." featureUseBangBindingValueDiscard,"Allows use! _ = ... in computation expressions" +featureBetterAnonymousRecordParsing,"Support for better anonymous record parsing" featureScopedNowarn,"Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules" featureAllowLetOrUseBangTypeAnnotationWithoutParens,"Allow let! and use! type annotations without requiring parentheses" 3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index abb2bb57f55..8453259ea1b 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -357,6 +357,9 @@ symbol '=' + + symbol '>|}' + symbol '>|]' diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index fd0f646531b..246ec741d67 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -100,6 +100,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn | AllowTypedLetOrUseBang @@ -233,6 +234,7 @@ type LanguageVersion(versionText) = LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion LanguageFeature.UseBangBindingValueDiscard, previewVersion + LanguageFeature.BetterAnonymousRecordParsing, previewVersion LanguageFeature.ScopedNowarn, previewVersion LanguageFeature.AllowTypedLetOrUseBang, previewVersion ] @@ -398,6 +400,7 @@ type LanguageVersion(versionText) = | LanguageFeature.SupportValueOptionsAsOptionalParameters -> FSComp.SR.featureSupportValueOptionsAsOptionalParameters () | LanguageFeature.WarnWhenUnitPassedToObjArg -> FSComp.SR.featureSupportWarnWhenUnitPassedToObjArg () | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () + | LanguageFeature.BetterAnonymousRecordParsing -> FSComp.SR.featureBetterAnonymousRecordParsing () | LanguageFeature.ScopedNowarn -> FSComp.SR.featureScopedNowarn () | LanguageFeature.AllowTypedLetOrUseBang -> FSComp.SR.featureAllowLetOrUseBangTypeAnnotationWithoutParens () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 95bd956e0b7..c9e70ce1567 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -91,6 +91,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn | AllowTypedLetOrUseBang diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index bc07224d70b..fb2af965f76 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -283,6 +283,7 @@ module internal TokenClassifications = | LBRACE_BAR -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.MatchBraces) | GREATER_RBRACK + | GREATER_BAR_RBRACE | GREATER_BAR_RBRACK -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.None) | RQUOTE _ @@ -1387,6 +1388,7 @@ type FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or @@ -1598,6 +1600,7 @@ type FSharpToken = | STAR -> FSharpTokenKind.Star | COMMA -> FSharpTokenKind.Comma | RARROW -> FSharpTokenKind.RightArrow + | GREATER_BAR_RBRACE -> FSharpTokenKind.GreaterBarRightBrace | GREATER_BAR_RBRACK -> FSharpTokenKind.GreaterBarRightBracket | LPAREN_STAR_RPAREN -> FSharpTokenKind.LeftParenthesisStarRightParenthesis | OPEN -> FSharpTokenKind.Open diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index 261c7c6764e..1efcf59269d 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -457,6 +457,7 @@ type public FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 20af46524b0..a97fb94d5e4 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1093,7 +1093,7 @@ type LexFilterImpl ( scanAhead nParen else false - | GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK -> + | GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK | GREATER_BAR_RBRACE -> let nParen = nParen - 1 let hasAfterOp = (match lookaheadToken with GREATER _ -> false | _ -> true) if nParen > 0 then @@ -1201,6 +1201,11 @@ type LexFilterImpl ( delayToken (pool.UseShiftedLocation(tokenTup, INFIX_AT_HAT_OP "@", 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) pool.Return tokenTup + | GREATER_BAR_RBRACE -> + lexbuf.CheckLanguageFeatureAndRecover LanguageFeature.BetterAnonymousRecordParsing lexbuf.LexemeRange + delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) + pool.Return tokenTup | GREATER_BAR_RBRACK -> delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index 2d52ec029f7..9abb9408c9e 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -905,6 +905,8 @@ rule token (args: LexArgs) (skip: bool) = parse | ">" { GREATER false } + | ">|}" { GREATER_BAR_RBRACE } + | "[<" { LBRACK_LESS } | "]" { RBRACK } diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index bbfca699064..285a8a0c47e 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -84,7 +84,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) -> %token EXCEPTION FALSE FOR FUN FUNCTION IF IN JOIN_IN FINALLY DO_BANG %token LAZY OLAZY MATCH MATCH_BANG MUTABLE NEW OF %token OPEN OR REC THEN TO TRUE TRY TYPE VAL INLINE INTERFACE INSTANCE CONST -%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK LPAREN_STAR_RPAREN +%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK GREATER_BAR_RBRACE LPAREN_STAR_RPAREN %token QMARK QMARK_QMARK DOT COLON COLON_COLON COLON_GREATER COLON_QMARK_GREATER COLON_QMARK COLON_EQUALS SEMICOLON %token SEMICOLON_SEMICOLON LARROW EQUALS LBRACK LBRACK_BAR LBRACE_BAR LBRACK_LESS %token BAR_RBRACK BAR_RBRACE UNDERSCORE diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index caa825a8245..15516bde9f4 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -312,6 +312,11 @@ atributy napravo od klíčového slova Module + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations automatické generování vlastnosti Message pro deklarace exception diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 2d193f09a0e..98203615481 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -312,6 +312,11 @@ Attribute rechts vom "Module"-Schlüsselwort + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations Automatische Generierung der Eigenschaft „Message“ für „exception“-Deklarationen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 1e0f79d0124..f9a01cc8009 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -312,6 +312,11 @@ atributos a la derecha de la palabra clave “módulo” + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations generación automática de la propiedad 'Message' para declaraciones 'exception' diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 71a14ff33f0..904ce2c3c69 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -312,6 +312,11 @@ attributs à droite du mot clé 'module' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations génération automatique de la propriété « Message » pour les déclarations « exception » diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 12f56c30e93..ea9f636b455 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -312,6 +312,11 @@ attributi a destra della parola chiave 'module' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations generazione automatica della proprietà 'Messaggio' per le dichiarazioni 'eccezione' diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index d84ecad7170..073d2bc0127 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -312,6 +312,11 @@ 'module' キーワードの右側の属性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations `exception` 宣言の `Message` プロパティの自動生成 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 39c3a728b37..ac3e6c95d94 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -312,6 +312,11 @@ 'module' 키워드 오른쪽에 있는 특성 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 'exception' 선언에 대한 'Message' 속성 자동 생성 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index e5f2bda5529..450bc59ad22 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -312,6 +312,11 @@ atrybuty po prawej stronie słowa kluczowego "module" + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations Automatyczne generowanie właściwości „Wiadomość“ dla deklaracji „Wyjątek“ diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index c69f534b10e..8eb539fa237 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -312,6 +312,11 @@ atributos à direita da palavra-chave 'módulo' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations geração automática da propriedade 'Message' para declarações de 'exception' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index ca41d4affcc..27d646c8a9c 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -312,6 +312,11 @@ атрибуты справа от ключевого слова "module" + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations автоматическое создание свойства “Message” для объявлений “exception” diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 17a75ffa27c..ee7db390d59 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -312,6 +312,11 @@ 'modül' anahtar sözcüğünün sağındaki öznitelikler + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 'exception' bildirimleri için 'Message' özelliğinin otomatik olarak oluşturulması diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 155480c6314..0ca3574bbb9 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -312,6 +312,11 @@ "module" 关键字右侧的属性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 自动生成“异常”声明的“消息”属性 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 3c96310c8a7..42aa912d17c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -312,6 +312,11 @@ 'module' 關鍵字右邊的屬性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 自動產生 'exception' 宣告的 'Message' 屬性 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 698e7180ad6..cfa0c8bddb7 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -82,6 +82,11 @@ symbol ..^ + + symbol '>|}' + symbol '>|}' + + interpolated string interpolovaný řetězec diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index ebfb525eb2a..e81e671661a 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -82,6 +82,11 @@ Symbol "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string Interpolierte Zeichenfolge diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 46816a23aba..9e78f3ddd08 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -82,6 +82,11 @@ símbolo "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string cadena interpolada diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7e8f9df4ee3..ccedd3ac360 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -82,6 +82,11 @@ symbole '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string chaîne interpolée diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 004e8d04e13..e5545d56799 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -82,6 +82,11 @@ simbolo '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string stringa interpolata diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index b7e4a21e670..631370c20e9 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -82,6 +82,11 @@ シンボル '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 補間された文字列 diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index edee12a29a2..084e56072c4 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -82,6 +82,11 @@ 기호 '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 보간 문자열 diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index b50fb8fc188..f6e7003e75d 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -82,6 +82,11 @@ symbol „..^” + + symbol '>|}' + symbol '>|}' + + interpolated string ciąg interpolowany diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index f94ce79cd97..72178364b24 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -82,6 +82,11 @@ símbolo '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string cadeia de caracteres interpolada diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 6df88d26d49..6f2c47d0d10 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -82,6 +82,11 @@ символ "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string интерполированная строка diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 59fc6b69625..0c41ee99672 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -82,6 +82,11 @@ '..^' sembolü + + symbol '>|}' + symbol '>|}' + + interpolated string düz metin arasına kod eklenmiş dize diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index f97800458f1..dc22dbeb28b 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -82,6 +82,11 @@ 符号 "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string 内插字符串 diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 2f0181b62d6..bcb553c7de1 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -82,6 +82,11 @@ 符號 '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 插補字串 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 354539ed7c1..ef0b307853a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -19,6 +19,138 @@ module AnonRecd = |> shouldFail |> withErrorCode 3522 |> withMessage "The field 'A' appears multiple times in this record expression." + + [] + let ``Anonymous Record with unit of measures`` () = + FSharp """ +namespace FSharpTest + +[] +type m + +module AnonRecd = + let a = {|a=1|} + let b = {|a=1; b=2|} + let c = {|a=1 |} + let d = {| a=1; b=2; c=3 |} +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 8, Col 20, Line 8, Col 23, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 9, Col 28, Line 9, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview : Anonymous Record with unit of measures`` () = + FSharp """ +namespace FSharpTest + +[] +type m + +module AnonRecd = + let a = {|a=1|} + let b = {|a=1; b=2|} + let c = {|a=1 |} + let d = {| a=1; b=2; c=3 |} +""" + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Anonymous Record with typeof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typeof|} + let b = {|a=typeof |} + let c = {| a=typeof|} + let d = {| a=typeof |} +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 27, Line 4, Col 30, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 28, Line 6, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with typeof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typeof|} + let b = {|a=typeof |} + let c = {| a=typeof|} + let d = {| a=typeof |} +""" + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Anonymous Record with typedefof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typedefof<_ option>|} + let b = {|a=typedefof<_ option> |} + let c = {| a=typedefof<_ option>|} + let d = {| a=typedefof<_ option> |} +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 35, Line 4, Col 38, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 36, Line 6, Col 39, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with typedefof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typedefof<_ option>|} + let b = {|a=typedefof<_ option> |} + let c = {| a=typedefof<_ option>|} + let d = {| a=typedefof<_ option> |} +""" + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Anonymous Record with nameof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a<'T> = {|a=nameof<'T>|} + let b<'T> = {|a=nameof<'T> |} + let c<'T> = {| a=nameof<'T>|} + let d<'T> = {| a=nameof<'T> |} +""" + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 30, Line 4, Col 33, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 31, Line 6, Col 34, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with nameof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a<'T> = {|a=nameof<'T>|} + let b<'T> = {|a=nameof<'T> |} + let c<'T> = {| a=nameof<'T>|} + let d<'T> = {| a=nameof<'T> |} +""" + |> withLangVersionPreview + |> compile + |> shouldSucceed [] let ``Anonymous Record missing single field`` () = diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index bb0389f5021..e2349c44c11 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -11288,6 +11288,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash @@ -11484,6 +11485,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash @@ -11676,6 +11678,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash() @@ -11868,6 +11871,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash @@ -12060,6 +12064,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index bb0389f5021..e2349c44c11 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -11288,6 +11288,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash @@ -11484,6 +11485,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash @@ -11676,6 +11678,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash() @@ -11868,6 +11871,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash @@ -12060,6 +12064,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash() diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 897dd2ac22a..625bad81a15 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -24,11 +24,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 5475f43bdc1..2e1d5680e1d 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -35,11 +35,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 9821dc3dc1a..7a20b934eef 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -23,11 +23,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 7a78ab1999a..b8f7bba8f5f 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -34,11 +34,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs new file mode 100644 index 00000000000..69965ae8be3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs @@ -0,0 +1,10 @@ +module Module + +{|a=1 |} + +{|a=1|} + +{| a=1|} + +{| a=1 |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl new file mode 100644 index 00000000000..a8ff99d1b82 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -0,0 +1,55 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-07.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8)))], + (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8)))], + (5,0--5,10), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9)))], + (7,0--7,11), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9)))], + (9,0--9,12), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs new file mode 100644 index 00000000000..10830a528a3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs @@ -0,0 +1,9 @@ +module Module + +{|a=1; b=2 |} + +{|a=1; b=2|} + +{| a=1; b=2|} + +{| a=1; b=2 |} diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl new file mode 100644 index 00000000000..ed640191c59 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -0,0 +1,83 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-08.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))); + (SynLongIdent ([b], [], [None]), Some (3,11--3,12), + Const + (Measure + (Int32 2, (3,12--3,13), + Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), + { LessRange = (3,13--3,14) + GreaterRange = (3,15--3,16) }), (3,12--3,16)))], + (3,0--3,19), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))); + (SynLongIdent ([b], [], [None]), Some (5,11--5,12), + Const + (Measure + (Int32 2, (5,12--5,13), + Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), + { LessRange = (5,13--5,14) + GreaterRange = (5,15--5,16) }), (5,12--5,16)))], + (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))); + (SynLongIdent ([b], [], [None]), Some (7,12--7,13), + Const + (Measure + (Int32 2, (7,13--7,14), + Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), + { LessRange = (7,14--7,15) + GreaterRange = (7,16--7,17) }), (7,13--7,17)))], + (7,0--7,19), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))); + (SynLongIdent ([b], [], [None]), Some (9,12--9,13), + Const + (Measure + (Int32 2, (9,13--9,14), + Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), + { LessRange = (9,14--9,15) + GreaterRange = (9,16--9,17) }), (9,13--9,17)))], + (9,0--9,20), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs new file mode 100644 index 00000000000..00d316e9d42 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs @@ -0,0 +1,10 @@ +module Module + +{|a=typeof|} + +{|a=typeof |} + +{| a=typeof|} + +{| a=typeof |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl new file mode 100644 index 00000000000..ec7c2e4e312 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-09.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident typeof, (3,10--3,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,14--3,15), (3,10--3,15), (3,4--3,15)))], + (3,0--3,17), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident typeof, (5,10--5,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,14--5,15), (5,10--5,15), (5,4--5,15)))], + (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident typeof, (7,11--7,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,15--7,16), (7,11--7,16), (7,5--7,16)))], + (7,0--7,18), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident typeof, (9,11--9,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,15--9,16), (9,11--9,16), (9,5--9,16)))], + (9,0--9,19), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs new file mode 100644 index 00000000000..f4054ccd7f4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs @@ -0,0 +1,10 @@ +module Module + +{|a=typedefof<_ option>|} + +{|a=typedefof<_ option> |} + +{| a=typedefof<_ option>|} + +{| a=typedefof<_ option> |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl new file mode 100644 index 00000000000..a30127b522f --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -0,0 +1,55 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-10.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident typedefof, (3,13--3,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (3,14--3,15)], [], None, true, (3,14--3,22))], + [], Some (3,22--3,23), (3,13--3,23), (3,4--3,23)))], + (3,0--3,25), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,25)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident typedefof, (5,13--5,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (5,14--5,15)], [], None, true, (5,14--5,22))], + [], Some (5,22--5,23), (5,13--5,23), (5,4--5,23)))], + (5,0--5,26), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,26)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident typedefof, (7,14--7,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (7,15--7,16)], [], None, true, (7,15--7,23))], + [], Some (7,23--7,24), (7,14--7,24), (7,5--7,24)))], + (7,0--7,26), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,26)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident typedefof, (9,14--9,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (9,15--9,16)], [], None, true, (9,15--9,23))], + [], Some (9,23--9,24), (9,14--9,24), (9,5--9,24)))], + (9,0--9,27), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,27))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs new file mode 100644 index 00000000000..f7f786136ba --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs @@ -0,0 +1,10 @@ +module Module + +let f<'T> = {|a=nameof<'T>|} + +let f<'T> = {|a=nameof<'T> |} + +let f<'T> = {| a=nameof<'T>|} + +let f<'T> = {| a=nameof<'T> |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl new file mode 100644 index 00000000000..180ed425c9e --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -0,0 +1,127 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-11.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (3,5--3,9))), + false)), Pats [], None, (3,4--3,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,15--3,16), + TypeApp + (Ident nameof, (3,22--3,23), + [Var (SynTypar (T, None, false), (3,23--3,25))], [], + Some (3,25--3,26), (3,22--3,26), (3,16--3,26)))], + (3,12--3,28), { OpeningBraceRange = (3,12--3,14) }), + (3,4--3,9), NoneAtLet, { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], + (3,0--3,28)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (5,5--5,9))), + false)), Pats [], None, (5,4--5,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,15--5,16), + TypeApp + (Ident nameof, (5,22--5,23), + [Var (SynTypar (T, None, false), (5,23--5,25))], [], + Some (5,25--5,26), (5,22--5,26), (5,16--5,26)))], + (5,12--5,29), { OpeningBraceRange = (5,12--5,14) }), + (5,4--5,9), NoneAtLet, { LeadingKeyword = Let (5,0--5,3) + InlineKeyword = None + EqualsRange = Some (5,10--5,11) })], + (5,0--5,29)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (7,5--7,9))), + false)), Pats [], None, (7,4--7,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,16--7,17), + TypeApp + (Ident nameof, (7,23--7,24), + [Var (SynTypar (T, None, false), (7,24--7,26))], [], + Some (7,26--7,27), (7,23--7,27), (7,17--7,27)))], + (7,12--7,29), { OpeningBraceRange = (7,12--7,14) }), + (7,4--7,9), NoneAtLet, { LeadingKeyword = Let (7,0--7,3) + InlineKeyword = None + EqualsRange = Some (7,10--7,11) })], + (7,0--7,29)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((9,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (9,5--9,9))), + false)), Pats [], None, (9,4--9,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,16--9,17), + TypeApp + (Ident nameof, (9,23--9,24), + [Var (SynTypar (T, None, false), (9,24--9,26))], [], + Some (9,26--9,27), (9,23--9,27), (9,17--9,27)))], + (9,12--9,30), { OpeningBraceRange = (9,12--9,14) }), + (9,4--9,9), NoneAtLet, { LeadingKeyword = Let (9,0--9,3) + InlineKeyword = None + EqualsRange = Some (9,10--9,11) })], + (9,0--9,30))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs new file mode 100644 index 00000000000..4ef04e9a312 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs @@ -0,0 +1,10 @@ +module Module + +{|a=id|} + +{|a=id |} + +{| a=id|} + +{| a=id |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl new file mode 100644 index 00000000000..1de6c8767d2 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -0,0 +1,47 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-12.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident id, (3,6--3,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,10--3,11), (3,6--3,11), (3,4--3,11)))], + (3,0--3,13), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident id, (5,6--5,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,10--5,11), (5,6--5,11), (5,4--5,11)))], + (5,0--5,14), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident id, (7,7--7,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,11--7,12), (7,7--7,12), (7,5--7,12)))], + (7,0--7,14), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident id, (9,7--9,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,11--9,12), (9,7--9,12), (9,5--9,12)))], + (9,0--9,15), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs new file mode 100644 index 00000000000..18ef9d998ab --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs @@ -0,0 +1,6 @@ +module Module + +{|a = <@ 3 @> |} + +{|a = <@ 3 @>|} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl new file mode 100644 index 00000000000..93fd93c0088 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -0,0 +1,45 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-13.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,4--3,5), + Quote + (Ident op_Quotation, false, Const (Int32 3, (3,9--3,10)), + false, (3,6--3,13)))], (3,0--3,16), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,16)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,4--5,5), + FromParseError + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_AtGreaterBar], [], + [Some (OriginalNotation "@>|")]), None, + (5,11--5,14)), Const (Int32 3, (5,9--5,10)), + (5,9--5,14)), + ArbitraryAfterError ("declExprInfix", (5,14--5,14)), + (5,9--5,14)), false, (5,6--5,15)), (5,6--5,15)))], + (5,0--5,15), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(5,11)-(5,14) parse error Unexpected token '@>|' or incomplete expression +(5,14)-(5,15) parse error Unexpected symbol '}' in quotation literal. Expected end of quotation or other token. +(5,6)-(5,8) parse error Unmatched '<@ @>' +(5,0)-(5,2) parse error Unmatched '{|' From 13db6d37f5499603bf1fd1819fb2d4b9f1a3ea85 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 22 May 2025 13:28:21 +0200 Subject: [PATCH 110/134] Create copilot-setup-steps.yml (#18590) --- .github/workflows/copilot-setup-steps.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 00000000000..eb779169137 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,21 @@ +name: "Copilot Setup Steps" + +# Allow testing of the setup steps from your repository's "Actions" tab. +on: workflow_dispatch + +jobs: + # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. + copilot-setup-steps: + runs-on: ubuntu-latest + + permissions: + contents: read + + # You can define any steps you want, and they will run before the agent starts. + # If you do not check out your code, Copilot will do this for you. + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Restore solution + env: + CI: false + run: ./build.sh -c Release From 755e967b502156e048a56811a10147c481dc9542 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 22 May 2025 16:32:08 +0200 Subject: [PATCH 111/134] Run fantomas without `-r` in GH action (#18595) --- .github/workflows/commands.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index 01203a6c562..b3e26cec82a 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -75,7 +75,7 @@ jobs: - name: Process fantomas command if: steps.command-extractor.outputs.result == 'fantomas' id: fantomas - run: dotnet fantomas . -r + run: dotnet fantomas . - name: Process xlf command if: steps.command-extractor.outputs.result == 'xlf' id: xlf From 97200803c1f63d4ac2d5ad788a67200f5f5979c8 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 22 May 2025 16:44:50 +0200 Subject: [PATCH 112/134] Update copilot-setup-steps.yml --- .github/workflows/copilot-setup-steps.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index eb779169137..abef568c5c5 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -15,7 +15,10 @@ jobs: # If you do not check out your code, Copilot will do this for you. steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json - name: Restore solution env: CI: false - run: ./build.sh -c Release + run: dotnet build ./FSharp.Compiler.Service.sln --verbosity quiet From 24208f04c4d67150520405e496c59aac5e598bb8 Mon Sep 17 00:00:00 2001 From: EvgTSV <61620612+evgTSV@users.noreply.github.com> Date: Fri, 23 May 2025 01:43:32 +0500 Subject: [PATCH 113/134] Fix access checking for properies setters in attribute arguments (#18581) --- .../Checking/Expressions/CheckExpressions.fs | 8 ++- src/Compiler/FSComp.txt | 1 + src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.de.xlf | 7 ++- src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ .../Attributes/AttributeCtorSetPropAccess.fs | 51 +++++++++++++++++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + 17 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/Attributes/AttributeCtorSetPropAccess.fs diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 567e1da0310..1e0d3edc889 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -11399,7 +11399,12 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn let mkAttribExpr e = AttribExpr(e, EvalLiteralExprOrAttribArg g e) - + + let checkPropSetterAttribAccess m (pinfo: PropInfo) = + let setterMeth = pinfo.SetterMethod + if not <| IsTypeAndMethInfoAccessible cenv.amap m ad ad setterMeth then + errorR(Error (FSComp.SR.tcPropertyCannotBeSetPrivateSetter(pinfo.PropertyName), m)) + let namedAttribArgMap = attributeAssignedNamedItems |> List.map (fun (CallerNamedArg(id, CallerArg(callerArgTy, m, isOpt, callerArgExpr))) -> if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m)) @@ -11411,6 +11416,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn | Item.Property (info = [pinfo]) -> if not pinfo.HasSetter then errorR(Error(FSComp.SR.tcPropertyCannotBeSet0(), m)) + checkPropSetterAttribAccess m pinfo id.idText, true, pinfo.GetPropertyType(cenv.amap, m) | Item.ILField finfo -> CheckILFieldInfoAccessible g cenv.amap m ad finfo diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 969b40ae4ff..f1c65d5771e 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1526,6 +1526,7 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record" 3246,tcAugmentationsCannotHaveAttributes,"Attributes cannot be applied to type extensions." 3247,couldNotLoadDependencyManagerExtension,"The dependency manager extension %s could not be loaded. Message: %s" +3248,tcPropertyCannotBeSetPrivateSetter,"Property '%s' cannot be set because the setter is private" 3250,expressionHasNoName,"Expression does not have a name." 3251,chkNoFirstClassNameOf,"Using the 'nameof' operator as a first-class function value is not permitted." 3252,tcIllegalByrefsInOpenTypeDeclaration,"Byref types are not allowed in an open type declaration." diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 15516bde9f4..397f1269c6d 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -5152,6 +5152,11 @@ Tato vlastnost se nedá nastavit. + + Property '{0}' cannot be set because the setter is private + Vlastnost '{0}' nelze nastavit, protože setter je soukromý + + This property or field was not found on this custom attribute type Tato vlastnost nebo pole se u tohoto typu vlastního atributu nenašla. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 98203615481..ca308ca9b13 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -5152,9 +5152,14 @@ Diese Eigenschaft kann nicht festgelegt werden. + + Property '{0}' cannot be set because the setter is private + Die Eigenschaft '{0}' kann nicht festgelegt werden, da der Setter privat ist. + + This property or field was not found on this custom attribute type - Diese Eigenschaft bzw. dieses Feld wurde in diesem benutzerdefinierten Attributtyp nicht gefunden. + Diese Eigenschaft bzw. dieses Feld wurde in diesem benutzerdefinierten Attributtyp nicht gefunden diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index f9a01cc8009..4b82afb40de 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -5152,6 +5152,11 @@ Esta propiedad no se puede establecer. + + Property '{0}' cannot be set because the setter is private + No se puede establecer la propiedad '{0}' porque el método set es privado + + This property or field was not found on this custom attribute type No se encontró esta propiedad o campo en este tipo de atributo personalizado. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 904ce2c3c69..88b5c2c8f11 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -5152,6 +5152,11 @@ Impossible de définir cette propriété + + Property '{0}' cannot be set because the setter is private + La propriété '{0}' ne peut pas être définie car le setter est privé + + This property or field was not found on this custom attribute type Impossible de trouver cette propriété ou ce champ dans ce type d'attribut personnalisé diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index ea9f636b455..dc03b73e98a 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -5152,6 +5152,11 @@ Non è possibile impostare questa proprietà + + Property '{0}' cannot be set because the setter is private + La proprietà '{0}' non può essere impostata perché il setter è privato. + + This property or field was not found on this custom attribute type La proprietà o il campo non è stato trovato in questo tipo di attributo personalizzato diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 073d2bc0127..99644e44b11 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -5152,6 +5152,11 @@ このプロパティは設定できません + + Property '{0}' cannot be set because the setter is private + プロパティ '{0}' は setter が private のため設定できません。 + + This property or field was not found on this custom attribute type このカスタム属性型に、このプロパティまたはフィールドが見つかりませんでした diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index ac3e6c95d94..cd439a93768 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -5152,6 +5152,11 @@ 이 속성은 설정할 수 없습니다. + + Property '{0}' cannot be set because the setter is private + '{0}' 속성은 setter가 private이기 때문에 설정할 수 없습니다. + + This property or field was not found on this custom attribute type 이 속성 또는 필드를 이 사용자 지정 특성 형식에서 찾을 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 450bc59ad22..f50063b24f1 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -5152,6 +5152,11 @@ Nie można ustawić tej właściwości + + Property '{0}' cannot be set because the setter is private + Właściwość '{0}' nie może być ustawiona, ponieważ setter jest prywatny. + + This property or field was not found on this custom attribute type Nie odnaleziono tej właściwości pola w tym niestandardowym typie atrybutu diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 8eb539fa237..1e60a4d33b3 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -5152,6 +5152,11 @@ Esta propriedade não pode ser definida + + Property '{0}' cannot be set because the setter is private + A propriedade '{0}' não pode ser definida porque o setter é privado. + + This property or field was not found on this custom attribute type Esta propriedade ou campo não foram encontrados neste tipo de atributo personalizado diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 27d646c8a9c..b1592085f5c 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -5152,6 +5152,11 @@ Это свойство задать нельзя + + Property '{0}' cannot be set because the setter is private + Свойство '{0}' не может быть установлено, так как сеттер является приватным + + This property or field was not found on this custom attribute type Данное свойство или поле не было найдено в этом пользовательском типе атрибута diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index ee7db390d59..3ea96d4b85e 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -5152,6 +5152,11 @@ Bu özellik ayarlanamaz + + Property '{0}' cannot be set because the setter is private + '{0}' özelliği, setter'ı özel olduğu için ayarlanamaz. + + This property or field was not found on this custom attribute type Bu özellik veya alan bu özel öznitelik türünde bulunamadı diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 0ca3574bbb9..cdc91d51daa 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -5152,6 +5152,11 @@ 无法设置此属性 + + Property '{0}' cannot be set because the setter is private + 属性“{0}”无法设置,因为 setter 是私有的。 + + This property or field was not found on this custom attribute type 未在此自定义特性类型中找到此属性或字段 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 42aa912d17c..99dd36c34bc 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -5152,6 +5152,11 @@ 無法設定這個屬性 + + Property '{0}' cannot be set because the setter is private + 屬性「{0}」無法設定,因為 setter 是私有的。 + + This property or field was not found on this custom attribute type 在這個自訂屬性類型上找不到這個屬性或欄位 diff --git a/tests/FSharp.Compiler.ComponentTests/Attributes/AttributeCtorSetPropAccess.fs b/tests/FSharp.Compiler.ComponentTests/Attributes/AttributeCtorSetPropAccess.fs new file mode 100644 index 00000000000..3fdcf10bf52 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Attributes/AttributeCtorSetPropAccess.fs @@ -0,0 +1,51 @@ +namespace FSharp.Compiler.ComponentTests.Attributes + +open Xunit +open FSharp.Test.Compiler + +module AttributeCtorSetPropAccess = + let private csLib = """ + using System; + + namespace TestAttribute + { + [AttributeUsage(AttributeTargets.All, Inherited = false)] + public class FooAttribute : Attribute + { + public int X { get; %s set; } + } + } + """ + + let private fsCode = """ + namespace Other + open System + open TestAttribute + + module TestAttributeModule = + + [] + let myFunction() = () + """ + + [] + [] + [] + [] + [] + [] + let ``Cannot set property outside its accessibility scope``(modifier: string): unit = + FSharp fsCode + |> withReferences [(CSharp <| csLib.Replace("%s", modifier))] + |> compile + |> shouldFail + |> withDiagnostics [ (ErrorType.Error 3248, Line 8, Col 28, Line 8, Col 31, "Property 'X' cannot be set because the setter is private") ] + |> ignore + + [] + let ``Can set property inside its accessibility scope``(): unit = + FSharp fsCode + |> withReferences [(CSharp <| csLib.Replace("%s", ""))] + |> compile + |> shouldSucceed + |> ignore \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 36754f92217..2761c9d56bc 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -345,6 +345,7 @@ + From 2b0e6cd1fc3b0fc34fc3d8bc58fe9986e4c72da2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 09:55:09 +0200 Subject: [PATCH 114/134] Update dependencies from https://github.com/dotnet/msbuild build 20250522.4 (#18599) Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.25 -> To Version 17.13.26 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 2 +- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/NuGet.config b/NuGet.config index 4e7dd1d4e5e..7e0d2c542f5 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d5fd07440cb..6af7b1bc3eb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,21 +1,21 @@ - + https://github.com/dotnet/msbuild - 7ad4e1c76585d0ed6e438da2d4f9394326934399 + c192adbb5252264481e8c046a8e0694f7fc7855b - + https://github.com/dotnet/msbuild - 7ad4e1c76585d0ed6e438da2d4f9394326934399 + c192adbb5252264481e8c046a8e0694f7fc7855b - + https://github.com/dotnet/msbuild - 7ad4e1c76585d0ed6e438da2d4f9394326934399 + c192adbb5252264481e8c046a8e0694f7fc7855b - + https://github.com/dotnet/msbuild - 7ad4e1c76585d0ed6e438da2d4f9394326934399 + c192adbb5252264481e8c046a8e0694f7fc7855b https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 0b43b972a69..da68a27d5c1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -102,7 +102,7 @@ 17.10.40152 17.10.526-pre-g1b474069f5 17.10.41 - 17.13.25 + 17.13.26 $(RoslynVersion) $(RoslynVersion) @@ -138,9 +138,9 @@ 15.0.25123-Dev15Preview - 17.13.25 - 17.13.25 - 17.13.25 + 17.13.26 + 17.13.26 + 17.13.26 $(VisualStudioEditorPackagesVersion) From cad478b9ac46914e4eefdfa0f1d55fbb9a9d10e5 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 26 May 2025 10:55:01 +0200 Subject: [PATCH 115/134] Update CODEOWNERS - keep fsharp-team-msft (#18600) --- .github/CODEOWNERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b40e4b69c5b..a05c971077b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1 @@ * @dotnet/fsharp-team-msft -/eng/DotNetBuild.props @dotnet/product-construction -/eng/SourceBuild* @dotnet/source-build From d18720c0396815471e4128f9f3d5e396112b21db Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 26 May 2025 12:44:44 +0200 Subject: [PATCH 116/134] Fix misleading XML documentation for pairwise functions (#18587) --- src/FSharp.Core/array.fsi | 5 +++-- src/FSharp.Core/list.fsi | 5 +++-- src/FSharp.Core/seq.fsi | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/FSharp.Core/array.fsi b/src/FSharp.Core/array.fsi index ba6274e11c6..18a4463277e 100644 --- a/src/FSharp.Core/array.fsi +++ b/src/FSharp.Core/array.fsi @@ -1919,8 +1919,9 @@ module Array = [] val ofSeq: source: seq<'T> -> 'T array - /// Returns an array of each element in the input array and its predecessor, with the - /// exception of the first element which is only returned as the predecessor of the second element. + /// Returns an array of each element in the input array paired with its predecessor, with the + /// exception of the first element which is only returned as the predecessor of the second element. + /// The predecessor comes first in the returned pairs. /// /// The input array. /// diff --git a/src/FSharp.Core/list.fsi b/src/FSharp.Core/list.fsi index 0c69ccc60c7..c77e26ddaf0 100644 --- a/src/FSharp.Core/list.fsi +++ b/src/FSharp.Core/list.fsi @@ -1613,8 +1613,9 @@ module List = [] val ofSeq: source:seq<'T> -> 'T list - /// Returns a list of each element in the input list and its predecessor, with the - /// exception of the first element which is only returned as the predecessor of the second element. + /// Returns a list of each element in the input list paired with its predecessor, with the + /// exception of the first element which is only returned as the predecessor of the second element. + /// The predecessor comes first in the returned pairs. /// /// The input list. /// diff --git a/src/FSharp.Core/seq.fsi b/src/FSharp.Core/seq.fsi index 19c83624bef..24189d3730c 100644 --- a/src/FSharp.Core/seq.fsi +++ b/src/FSharp.Core/seq.fsi @@ -1852,8 +1852,9 @@ module Seq = [] val ofList: source: 'T list -> seq<'T> - /// Returns a sequence of each element in the input sequence and its predecessor, with the - /// exception of the first element which is only returned as the predecessor of the second element. + /// Returns a sequence of each element in the input sequence paired with its predecessor, with the + /// exception of the first element which is only returned as the predecessor of the second element. + /// The predecessor comes first in the returned pairs. /// /// The input sequence. /// From 644dc238a8c04a3a6b6078c51cfbe0075fbba1c9 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Mon, 26 May 2025 13:18:53 +0200 Subject: [PATCH 117/134] remove deoptimizations to see if things still work (#18606) --- tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index e25102e9102..f651a5dc65f 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -8,8 +8,6 @@ true Library true - false - false xunit true $(OtherFlags) --realsig- From 4bf3bca8f06dc92fd47350c7219d396c0c8d1075 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Mon, 26 May 2025 14:03:29 +0200 Subject: [PATCH 118/134] Update commands.yml (#18608) --- .github/workflows/commands.yml | 41 ---------------------------------- 1 file changed, 41 deletions(-) diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index b3e26cec82a..5d5d97fb146 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -80,48 +80,7 @@ jobs: if: steps.command-extractor.outputs.result == 'xlf' id: xlf run: dotnet build src/Compiler /t:UpdateXlf - - name: Post ilverify start comment - if: steps.command-extractor.outputs.result == 'ilverify' - uses: actions/github-script@v3 - with: - script: | - const body = `Started to run ilverify baseline update`; - await github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body - }); - - name: Process ilverify command (Update ILVerify baselines) - if: steps.command-extractor.outputs.result == 'ilverify' - id: ilverify - env: - TEST_UPDATE_BSL: 1 - run: | - # Run the ilverify script with TEST_UPDATE_BSL=1 - pwsh tests/ILVerify/ilverify.ps1 - - # Calculate the changes per file - echo "Checking for changes in baseline files..." - FILES_CHANGED=0 - CHANGES_OUTPUT="" - - for file in tests/ILVerify/*.bsl; do - if git diff --quiet "$file"; then - continue - else - FILES_CHANGED=$((FILES_CHANGED + 1)) - LINES_CHANGED=$(git diff --numstat "$file" | awk '{print $1 + $2}') - CHANGES_OUTPUT="${CHANGES_OUTPUT}${file}: ${LINES_CHANGED} lines changed\n" - fi - done - - if [ "$FILES_CHANGED" -eq 0 ]; then - echo "result=The ilverify command ran and did not modify any baseline." >> $GITHUB_OUTPUT - else - echo -e "result=The ilverify command ran and triggered the following number of changes per file:\n${CHANGES_OUTPUT}" >> $GITHUB_OUTPUT - fi - name: Commit and push changes if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success' run: | From ceb0350459327d70ed1fed1e5c92b570c32c3b9f Mon Sep 17 00:00:00 2001 From: Martin <29605222+Martin521@users.noreply.github.com> Date: Wed, 28 May 2025 12:02:10 +0200 Subject: [PATCH 119/134] fix release notes regarding #18049 (#18611) --- docs/release-notes/.FSharp.Compiler.Service/10.0.100.md | 4 ++++ docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 067a9d56800..c839dcc3292 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -5,3 +5,7 @@ * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) + +### Breaking Changes + +* 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)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index a5341551395..7f5ab7289d2 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -45,7 +45,6 @@ * Add a switch to determine whether to generate a default implementation body for overridden method when completing. [PR #18341](https://github.com/dotnet/fsharp/pull/18341) * Use a more accurate range for CE Combine methods. [PR #18394](https://github.com/dotnet/fsharp/pull/18394) * Enable TypeSubsumptionCache for IDE use. [PR #18499](https://github.com/dotnet/fsharp/pull/18499) -* 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)) ### Changed * FSharpCheckFileResults.ProjectContext.ProjectOptions will not be available when using the experimental Transparent Compiler feature. ([PR #18205](https://github.com/dotnet/fsharp/pull/18205)) From 13fbacd0cfc1eac9c589ec15e32ab062936f0d45 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 28 May 2025 16:08:35 +0200 Subject: [PATCH 120/134] Update System+Roslyn+VS versions (#18616) --- eng/Version.Details.xml | 32 +++---- eng/Versions.props | 41 ++++----- .../LanguageService/LanguageService.fs | 83 ++++++++++--------- .../FSharp.LanguageService.Base.csproj | 1 + .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 1 + .../Helpers/RoslynHelpers.fs | 4 +- .../tests/UnitTests/Tests.RoslynHelpers.fs | 4 +- 7 files changed, 87 insertions(+), 79 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6af7b1bc3eb..158d160bcc4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,33 +1,37 @@ - + https://github.com/dotnet/msbuild - c192adbb5252264481e8c046a8e0694f7fc7855b + 15d19b96cf826b99925c8e5fd75575f46c60dd4a - + https://github.com/dotnet/msbuild - c192adbb5252264481e8c046a8e0694f7fc7855b + 15d19b96cf826b99925c8e5fd75575f46c60dd4a - + https://github.com/dotnet/msbuild - c192adbb5252264481e8c046a8e0694f7fc7855b + 15d19b96cf826b99925c8e5fd75575f46c60dd4a - + https://github.com/dotnet/msbuild - c192adbb5252264481e8c046a8e0694f7fc7855b + 15d19b96cf826b99925c8e5fd75575f46c60dd4a - + https://github.com/dotnet/runtime - 5535e31a712343a63f5d7d796cd874e563e5ac14 + 9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3 - + https://github.com/dotnet/runtime - 5535e31a712343a63f5d7d796cd874e563e5ac14 + 9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3 - + https://github.com/dotnet/runtime - 5535e31a712343a63f5d7d796cd874e563e5ac14 + 9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3 + + + https://github.com/dotnet/runtime + 9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3 diff --git a/eng/Versions.props b/eng/Versions.props index da68a27d5c1..6d7504f8dd2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,14 +80,14 @@ 4.6.0 - 4.5.5 + 4.6.0 6.1.0 - 8.0.0 + 9.0.0 $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) $(SystemPackageVersionVersion) @@ -97,12 +97,13 @@ $(SystemPackageVersionVersion) 1.6.0 - 4.11.0-2.24264.2 - 17.10.191 - 17.10.40152 - 17.10.526-pre-g1b474069f5 - 17.10.41 - 17.13.26 + 4.15.0-1.25171.14 + 17.14.188 + 17.14.40268 + 17.14.79 + 17.14.40254 + 17.14.15 + 17.15.0-preview-25276-10 $(RoslynVersion) $(RoslynVersion) @@ -117,7 +118,7 @@ $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + $(VisualStudioShellProjectsPackages) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) @@ -127,20 +128,20 @@ $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + $(VisualStudioShellProjectsPackages) + $(VisualStudioShellProjectsPackages) $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + 17.14.40270 $(MicrosoftVisualStudioShellPackagesVersion) - $(MicrosoftVisualStudioShellPackagesVersion) + 17.14.40270 10.0.30319 11.0.50727 15.0.25123-Dev15Preview - 17.13.26 - 17.13.26 - 17.13.26 + 17.15.0-preview-25276-10 + 17.15.0-preview-25276-10 + 17.15.0-preview-25276-10 $(VisualStudioEditorPackagesVersion) @@ -153,7 +154,7 @@ $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) $(VisualStudioEditorPackagesVersion) - $(VisualStudioEditorPackagesVersion) + 17.14.106 5.6.0 0.1.169-beta $(MicrosoftVisualStudioExtensibilityTestingVersion) @@ -168,7 +169,7 @@ 17.10.2179 - 17.10.21 + 17.14.20 17.0.0 17.8.8 12.0.4 @@ -195,8 +196,8 @@ 17.11.1 13.0.3 1.0.0-beta2-dev3 - 2.18.48 - 2.10.69 + 2.22.11 + 2.12.87 2.9.0 2.8.2 3.1.17 diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 4eb399a39f3..4f6136b8db0 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -355,64 +355,65 @@ type internal FSharpPackage() as this = flushTelemetry () #endif - override this.InitializeAsync(cancellationToken: CancellationToken, progress: IProgress) : Tasks.Task = - // `base.` methods can't be called in the `async` builder, so we have to cache it - let baseInitializeAsync = base.InitializeAsync(cancellationToken, progress) + override this.RegisterInitializationWork(packageRegistrationTasks: PackageRegistrationTasks) : unit = + base.RegisterInitializationWork(packageRegistrationTasks: PackageRegistrationTasks) - foregroundCancellableTask { - do! baseInitializeAsync + packageRegistrationTasks.AddTask( + true, + (fun progress _tasks cancellationToken -> + foregroundCancellableTask { + let! commandService = this.GetServiceAsync(typeof) + let commandService = commandService :?> OleMenuCommandService - let! commandService = this.GetServiceAsync(typeof) - let commandService = commandService :?> OleMenuCommandService + // Switch to UI thread + do! this.JoinableTaskFactory.SwitchToMainThreadAsync() - // Switch to UI thread - do! this.JoinableTaskFactory.SwitchToMainThreadAsync() + // FSI-LINKAGE-POINT: sited init + FSharp.Interactive.Hooks.fsiConsoleWindowPackageInitializeSited (this :> Package) commandService - // FSI-LINKAGE-POINT: sited init - FSharp.Interactive.Hooks.fsiConsoleWindowPackageInitializeSited (this :> Package) commandService + // FSI-LINKAGE-POINT: private method GetDialogPage forces fsi options to be loaded + let _fsiPropertyPage = + this.GetDialogPage(typeof) - // FSI-LINKAGE-POINT: private method GetDialogPage forces fsi options to be loaded - let _fsiPropertyPage = - this.GetDialogPage(typeof) + let workspace = this.ComponentModel.GetService() - let workspace = this.ComponentModel.GetService() + let _ = + this.ComponentModel.DefaultExportProvider.GetExport() - let _ = - this.ComponentModel.DefaultExportProvider.GetExport() + let optionsManager = + workspace.Services.GetService().FSharpProjectOptionsManager - let optionsManager = - workspace.Services.GetService().FSharpProjectOptionsManager - - let metadataAsSource = - this.ComponentModel.DefaultExportProvider.GetExport().Value + let metadataAsSource = + this.ComponentModel.DefaultExportProvider.GetExport().Value - let! solution = this.GetServiceAsync(typeof) - let solution = solution :?> IVsSolution + let! solution = this.GetServiceAsync(typeof) + let solution = solution :?> IVsSolution - let solutionEvents = FSharpSolutionEvents(optionsManager, metadataAsSource) + let solutionEvents = FSharpSolutionEvents(optionsManager, metadataAsSource) - let! rdt = this.GetServiceAsync(typeof) - let rdt = rdt :?> IVsRunningDocumentTable + let! rdt = this.GetServiceAsync(typeof) + let rdt = rdt :?> IVsRunningDocumentTable - solutionEventsOpt <- Some(solutionEvents) - solution.AdviseSolutionEvents(solutionEvents) |> ignore + solutionEventsOpt <- Some(solutionEvents) + solution.AdviseSolutionEvents(solutionEvents) |> ignore - let projectContextFactory = - this.ComponentModel.GetService() + let projectContextFactory = + this.ComponentModel.GetService() - let miscFilesWorkspace = - this.ComponentModel.GetService() + let miscFilesWorkspace = + this.ComponentModel.GetService() - do - SingleFileWorkspaceMap(FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory), rdt) - |> ignore + do + SingleFileWorkspaceMap(FSharpMiscellaneousFileService(workspace, miscFilesWorkspace, projectContextFactory), rdt) + |> ignore - do - LegacyProjectWorkspaceMap(solution, optionsManager, projectContextFactory) - |> ignore + do + LegacyProjectWorkspaceMap(solution, optionsManager, projectContextFactory) + |> ignore - } - |> CancellableTask.startAsTask cancellationToken + } + |> CancellableTask.startAsTask cancellationToken) + ) override _.RoslynLanguageName = FSharpConstants.FSharpLanguageName (*override this.CreateWorkspace() = this.ComponentModel.GetService() *) diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 89ca891597a..fead6828567 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -46,6 +46,7 @@ + diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 43e8352845f..0171cdf9b26 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -57,6 +57,7 @@ + diff --git a/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs b/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs index 85ad11c6e2e..25509f14ace 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Helpers/RoslynHelpers.fs @@ -171,7 +171,7 @@ type TestHostWorkspaceServices(hostServices: HostServices, workspace: Workspace) |> System.Collections.Concurrent.ConcurrentDictionary let langServices = - TestHostLanguageServices(this, LanguageNames.FSharp, exportProvider) + new TestHostLanguageServices(this, LanguageNames.FSharp, exportProvider) override _.Workspace = workspace @@ -199,7 +199,7 @@ type TestHostServices() = inherit HostServices() override this.CreateWorkspaceServices(workspace) = - TestHostWorkspaceServices(this, workspace) + new TestHostWorkspaceServices(this, workspace) [] type RoslynTestHelpers private () = diff --git a/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs b/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs index 25ba0ce68dc..ff00a933e26 100644 --- a/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs +++ b/vsintegration/tests/UnitTests/Tests.RoslynHelpers.fs @@ -160,7 +160,7 @@ type TestHostWorkspaceServices(hostServices: HostServices, workspace: Workspace) |> Seq.distinctBy (fun x -> x.Key) |> System.Collections.Concurrent.ConcurrentDictionary - let langServices = TestHostLanguageServices(this, LanguageNames.FSharp, exportProvider) + let langServices = new TestHostLanguageServices(this, LanguageNames.FSharp, exportProvider) override _.Workspace = workspace @@ -191,7 +191,7 @@ type TestHostServices() = inherit HostServices() override this.CreateWorkspaceServices(workspace) = - TestHostWorkspaceServices(this, workspace) :> HostWorkspaceServices + new TestHostWorkspaceServices(this, workspace) :> HostWorkspaceServices [] type RoslynTestHelpers private () = From 4853ba39b82d222a62804940db3f7775506373a3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 21:30:03 +0200 Subject: [PATCH 121/134] Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20250506.1 (#18615) optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime From Version 1.0.0-prerelease.24462.2 -> To Version 1.0.0-prerelease.25256.1 Co-authored-by: dotnet-maestro[bot] --- NuGet.config | 1 - eng/Version.Details.xml | 20 ++++++++++---------- eng/Versions.props | 10 +++++----- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/NuGet.config b/NuGet.config index 7e0d2c542f5..1245da4ae60 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,7 +8,6 @@ - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 158d160bcc4..d3b319f6713 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -39,25 +39,25 @@ https://github.com/dotnet/arcade 086a1771875b63404b4a710d27250fe384dc2810 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 9d7532585ce71e30ab55f0364d3cecccaf0775d1 + a68196f69e40740fce716778138acaa26488b333 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 9d7532585ce71e30ab55f0364d3cecccaf0775d1 + a68196f69e40740fce716778138acaa26488b333 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 9d7532585ce71e30ab55f0364d3cecccaf0775d1 + a68196f69e40740fce716778138acaa26488b333 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 9d7532585ce71e30ab55f0364d3cecccaf0775d1 + a68196f69e40740fce716778138acaa26488b333 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 9d7532585ce71e30ab55f0364d3cecccaf0775d1 + a68196f69e40740fce716778138acaa26488b333 diff --git a/eng/Versions.props b/eng/Versions.props index 6d7504f8dd2..6a4b6813d2f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -204,10 +204,10 @@ 2.2.0 - 1.0.0-prerelease.24462.2 - 1.0.0-prerelease.24462.2 - 1.0.0-prerelease.24462.2 - 1.0.0-prerelease.24462.2 - 1.0.0-prerelease.24462.2 + 1.0.0-prerelease.25256.1 + 1.0.0-prerelease.25256.1 + 1.0.0-prerelease.25256.1 + 1.0.0-prerelease.25256.1 + 1.0.0-prerelease.25256.1 From 8a363c459b8848779182f842b9eecba06accb3a5 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 28 May 2025 20:32:58 +0100 Subject: [PATCH 122/134] Range of SynExprRecordField should include the expression (#18617) --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + .../Checking/CheckRecordSyntaxHelpers.fs | 8 ++- src/Compiler/SyntaxTree/ParseHelpers.fs | 27 ++++++++- src/Compiler/SyntaxTree/SyntaxTree.fs | 1 + src/Compiler/SyntaxTree/SyntaxTree.fsi | 1 + src/Compiler/pars.fsy | 16 ++--- ...ervice.SurfaceArea.netstandard20.debug.bsl | 4 +- ...vice.SurfaceArea.netstandard20.release.bsl | 4 +- ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 6 +- .../Expression/InheritRecord - Field 1.fs | 10 ++++ .../Expression/InheritRecord - Field 1.fs.bsl | 58 +++++++++++++++++++ .../Expression/InheritRecord - Field 2.fs | 8 +++ .../Expression/InheritRecord - Field 2.fs.bsl | 35 +++++++++++ ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 2 +- .../Expression/Record - Field 03.fs.bsl | 4 +- .../Expression/Record - Field 04.fs.bsl | 4 +- .../Expression/Record - Field 05.fs.bsl | 4 +- .../Expression/Record - Field 06.fs.bsl | 4 +- .../Expression/Record - Field 08.fs.bsl | 5 +- .../Expression/Record - Field 09.fs.bsl | 7 ++- .../Expression/Record - Field 11.fs.bsl | 2 +- .../Expression/Record - Field 12.fs.bsl | 4 +- .../Expression/Record - Field 13.fs.bsl | 5 +- .../Expression/Record - Field 14.fs.bsl | 7 ++- ...OfTheEqualsSignInSynExprRecordField.fs.bsl | 8 +-- ...dFieldsContainCorrectAmountOfTrivia.fs.bsl | 6 +- 26 files changed, 195 insertions(+), 46 deletions(-) create mode 100644 tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs create mode 100644 tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs create mode 100644 tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index c839dcc3292..ee16e7fe903 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -2,6 +2,7 @@ * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) +* Range of `SynExprRecordField` should include the expression ([PR #18617](https://github.com/dotnet/fsharp/pull/18617)) * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) diff --git a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs index 8783da1031f..697e9a14623 100644 --- a/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs +++ b/src/Compiler/Checking/CheckRecordSyntaxHelpers.fs @@ -129,7 +129,13 @@ let TransformAstForNestedUpdates (cenv: TcFileState) (env: TcEnv) overallTy (lid | _ -> let fields = [ - SynExprRecordField((LongIdentWithDots([ fieldId ], []), true), None, Some nestedField, None) + SynExprRecordField( + (LongIdentWithDots([ fieldId ], []), true), + None, + Some nestedField, + unionRanges fieldId.idRange nestedField.Range, + None + ) ] SynExpr.Record(None, copyInfo outerFieldId, fields, outerFieldId.idRange) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index 62eb2159081..ea791527851 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -704,10 +704,31 @@ let patFromParseError (e: SynPat) = SynPat.FromParseError(e, e.Range) // to form // binding1*sep1, binding2*sep2 let rebindRanges first fields lastSep = - let rec run (name, mEquals, value) l acc = + let calculateFieldRange (lidwd: SynLongIdent) (mEquals: range option) (value: SynExpr option) = + match lidwd with + | SynLongIdent([], _, _) -> + // Special case used in inherit clause + match mEquals, value with + | Some mEq, Some expr -> unionRanges mEq expr.Range + | Some mEq, None -> mEq + | None, Some expr -> expr.Range + | None, None -> range0 + | _ -> + // Normal case + match value with + | Some expr -> unionRanges lidwd.Range expr.Range + | None -> + match mEquals with + | Some mEq -> unionRanges lidwd.Range mEq + | None -> lidwd.Range + + let rec run (name, mEquals, value: SynExpr option) l acc = + let lidwd, _ = name + let fieldRange = calculateFieldRange lidwd mEquals value + match l with - | [] -> List.rev (SynExprRecordField(name, mEquals, value, lastSep) :: acc) - | (f, m) :: xs -> run f xs (SynExprRecordField(name, mEquals, value, m) :: acc) + | [] -> List.rev (SynExprRecordField(name, mEquals, value, fieldRange, lastSep) :: acc) + | (f, m) :: xs -> run f xs (SynExprRecordField(name, mEquals, value, fieldRange, m) :: acc) run first fields [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 978a75ab6cc..5e3542f6b69 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -896,6 +896,7 @@ type SynExprRecordField = fieldName: RecordFieldName * equalsRange: range option * expr: SynExpr option * + range: range * blockSeparator: BlockSeparator option [] diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 30ecc56c166..15c8cf4a02e 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -999,6 +999,7 @@ type SynExprRecordField = fieldName: RecordFieldName * equalsRange: range option * expr: SynExpr option * + range: range * blockSeparator: BlockSeparator option [] diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 285a8a0c47e..2dd4c5fd697 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -5624,7 +5624,7 @@ recdExpr: let l = List.rev $5 let dummyField = mkRecdField (SynLongIdent([], [], [])) // dummy identifier, it will be discarded let l = rebindRanges (dummyField, None, None) l $6 - let (SynExprRecordField(_, _, _, inheritsSep)) = List.head l + let (SynExprRecordField(_, _, _, _, inheritsSep)) = List.head l let bindings = List.tail l (Some($2, arg, rhs2 parseState 2 4, inheritsSep, rhs parseState 1), None, bindings) } @@ -5666,7 +5666,7 @@ recdExprCore: reportParseErrorAt m (FSComp.SR.parsUnderscoreInvalidFieldName()) reportParseErrorAt m (FSComp.SR.parsFieldBinding()) let f = mkUnderscoreRecdField m - (None, [ SynExprRecordField(f, None, None, None) ]) } + (None, [ SynExprRecordField(f, None, None, m, None) ]) } | UNDERSCORE EQUALS { let m = rhs parseState 1 @@ -5675,7 +5675,7 @@ recdExprCore: let mEquals = rhs parseState 2 reportParseErrorAt (rhs2 parseState 1 2) (FSComp.SR.parsFieldBinding()) - (None, [ SynExprRecordField(f, Some mEquals, None, None) ]) } + (None, [ SynExprRecordField(f, Some mEquals, None, (rhs2 parseState 1 2), None) ]) } | UNDERSCORE EQUALS declExprBlock recdExprBindings opt_seps_recd { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnderscoreInvalidFieldName()) @@ -5860,9 +5860,9 @@ braceBarExprCore: { let orig, flds = $2 let flds = flds |> List.choose (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _) when orig.IsSome -> Some(synLongIdent, mEquals, e) // copy-and-update, long identifier signifies nesting - | SynExprRecordField((SynLongIdent([ _id ], _, _) as synLongIdent, _), mEquals, Some e, _) -> Some(synLongIdent, mEquals, e) // record construction, long identifier not valid - | SynExprRecordField((synLongIdent, _), mEquals, None, _) -> Some(synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range)) + | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) when orig.IsSome -> Some(synLongIdent, mEquals, e) // copy-and-update, long identifier signifies nesting + | SynExprRecordField((SynLongIdent([ _id ], _, _) as synLongIdent, _), mEquals, Some e, _, _) -> Some(synLongIdent, mEquals, e) // record construction, long identifier not valid + | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> Some(synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range)) | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) let mLeftBrace = rhs parseState 1 let mRightBrace = rhs parseState 3 @@ -5875,8 +5875,8 @@ braceBarExprCore: let orig, flds = $2 let flds = flds |> List.map (function - | SynExprRecordField((synLongIdent, _), mEquals, Some e, _) -> (synLongIdent, mEquals, e) - | SynExprRecordField((synLongIdent, _), mEquals, None, _) -> (synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range))) + | SynExprRecordField((synLongIdent, _), mEquals, Some e, _, _) -> (synLongIdent, mEquals, e) + | SynExprRecordField((synLongIdent, _), mEquals, None, _, _) -> (synLongIdent, mEquals, arbExpr ("anonField", synLongIdent.Range))) let mLeftBrace = rhs parseState 1 let mExpr = rhs parseState 2 (fun (mStruct: range option) -> diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index e2349c44c11..1d4eeecfeea 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -7888,7 +7888,9 @@ FSharp.Compiler.Syntax.SynExprAndBang: Int32 Tag FSharp.Compiler.Syntax.SynExprAndBang: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprAndBang: System.String ToString() FSharp.Compiler.Syntax.SynExprModule: Boolean shouldBeParenthesizedInContext(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SyntaxNode], FSharp.Compiler.Syntax.SynExpr) -FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExprRecordField: Int32 Tag FSharp.Compiler.Syntax.SynExprRecordField: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprRecordField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] expr diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index e2349c44c11..1d4eeecfeea 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -7888,7 +7888,9 @@ FSharp.Compiler.Syntax.SynExprAndBang: Int32 Tag FSharp.Compiler.Syntax.SynExprAndBang: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprAndBang: System.String ToString() FSharp.Compiler.Syntax.SynExprModule: Boolean shouldBeParenthesizedInContext(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.String], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SyntaxNode], FSharp.Compiler.Syntax.SynExpr) -FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Syntax.SynExprRecordField NewSynExprRecordField(System.Tuple`2[FSharp.Compiler.Syntax.SynLongIdent,System.Boolean], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Text.Range,Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Position]]]) +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynExprRecordField: FSharp.Compiler.Text.Range range FSharp.Compiler.Syntax.SynExprRecordField: Int32 Tag FSharp.Compiler.Syntax.SynExprRecordField: Int32 get_Tag() FSharp.Compiler.Syntax.SynExprRecordField: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynExpr] expr diff --git a/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index 3fdf51035f5..975d9cc4d21 100644 --- a/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/CopySynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -12,9 +12,9 @@ ImplFile (None, Some (Ident foo, ((2,6--2,10), None)), [SynExprRecordField ((SynLongIdent ([X], [], [None]), true), Some (4,12--4,13), - Some (Const (Int32 12, (5,16--5,18))), None)], (2,0--5,20)), - (2,0--5,20))], PreXmlDocEmpty, [], None, (2,0--5,20), - { LeadingKeyword = None })], (true, true), + Some (Const (Int32 12, (5,16--5,18))), (3,8--5,18), None)], + (2,0--5,20)), (2,0--5,20))], PreXmlDocEmpty, [], None, + (2,0--5,20), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs new file mode 100644 index 00000000000..4530232acf8 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs @@ -0,0 +1,10 @@ +module Foo + +{ inherit Exception( + "This is a " + + "multiline " + + "message" + ) + X = 42 + Y = "test" +} diff --git a/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs.bsl b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs.bsl new file mode 100644 index 00000000000..7c41f9d1d94 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 1.fs.bsl @@ -0,0 +1,58 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/InheritRecord - Field 1.fs", false, + QualifiedNameOfFile Foo, [], + [SynModuleOrNamespace + ([Foo], false, NamedModule, + [Expr + (Record + (Some + (LongIdent (SynLongIdent ([Exception], [], [None])), + Paren + (App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,17--5,18)), + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (4,17--4,18)), + Const + (String + ("This is a ", Regular, (4,4--4,16)), + (4,4--4,16)), (4,4--4,18)), + Const + (String ("multiline ", Regular, (5,4--5,16)), + (5,4--5,16)), (4,4--5,16)), (4,4--5,18)), + Const + (String ("message", Regular, (6,4--6,13)), + (6,4--6,13)), (4,4--6,13)), (3,19--3,20), + Some (7,2--7,3), (3,19--7,3)), (3,10--7,3), + Some ((7,4--8,2), None), (3,2--3,9)), None, + [SynExprRecordField + ((SynLongIdent ([X], [], [None]), true), Some (8,4--8,5), + Some (Const (Int32 42, (8,6--8,8))), (8,2--8,8), + Some ((8,9--9,2), None)); + SynExprRecordField + ((SynLongIdent ([Y], [], [None]), true), Some (9,4--9,5), + Some + (Const + (String ("test", Regular, (9,6--9,12)), (9,6--9,12))), + (9,2--9,12), None)], (3,0--10,1)), (3,0--10,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--10,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs new file mode 100644 index 00000000000..40e0d20d55e --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs @@ -0,0 +1,8 @@ +module Foo + +{ + inherit Exception("test") + Field1 = 1 + Field2 = "two" + Field3 = 3.0 +} diff --git a/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs.bsl b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs.bsl new file mode 100644 index 00000000000..0c8fe61edb4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/InheritRecord - Field 2.fs.bsl @@ -0,0 +1,35 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/InheritRecord - Field 2.fs", false, + QualifiedNameOfFile Foo, [], + [SynModuleOrNamespace + ([Foo], false, NamedModule, + [Expr + (Record + (Some + (LongIdent (SynLongIdent ([Exception], [], [None])), + Paren + (Const + (String ("test", Regular, (4,22--4,28)), (4,22--4,28)), + (4,21--4,22), Some (4,28--4,29), (4,21--4,29)), + (4,12--4,29), Some ((4,30--5,4), None), (4,4--4,11)), None, + [SynExprRecordField + ((SynLongIdent ([Field1], [], [None]), true), + Some (5,11--5,12), Some (Const (Int32 1, (5,13--5,14))), + (5,4--5,14), Some ((5,15--6,4), None)); + SynExprRecordField + ((SynLongIdent ([Field2], [], [None]), true), + Some (6,11--6,12), + Some + (Const + (String ("two", Regular, (6,13--6,18)), (6,13--6,18))), + (6,4--6,18), Some ((6,19--7,4), None)); + SynExprRecordField + ((SynLongIdent ([Field3], [], [None]), true), + Some (7,11--7,12), Some (Const (Double 3.0, (7,13--7,16))), + (7,4--7,16), None)], (3,0--8,1)), (3,0--8,1))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--8,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index 8e2a71ee797..7ad5d76dc22 100644 --- a/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/InheritSynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -18,7 +18,7 @@ ImplFile None, [SynExprRecordField ((SynLongIdent ([X], [], [None]), true), Some (2,28--2,29), - Some (Const (Int32 1, (2,30--2,31))), + Some (Const (Int32 1, (2,30--2,31))), (2,26--2,31), Some ((2,31--2,32), Some (2,32)))], (2,0--2,34)), (2,0--2,34))], PreXmlDocEmpty, [], None, (2,0--2,34), { LeadingKeyword = None })], (true, true), diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl index d15f4c6b78c..253ba19cef9 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 03.fs.bsl @@ -9,8 +9,8 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A], [(3,3--3,4)], [None]), true), - Some (3,5--3,6), Some (Const (Int32 1, (3,7--3,8))), None)], - (3,0--3,10)), (3,0--3,10))], + Some (3,5--3,6), Some (Const (Int32 1, (3,7--3,8))), + (3,2--3,8), None)], (3,0--3,10)), (3,0--3,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl index c395eb014d6..14d2e09eaf1 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 04.fs.bsl @@ -10,8 +10,8 @@ ImplFile [SynExprRecordField ((SynLongIdent ([A; B], [(3,3--3,4); (3,5--3,6)], [None; None]), true), - Some (3,7--3,8), Some (Const (Int32 1, (3,9--3,10))), None)], - (3,0--3,12)), (3,0--3,12))], + Some (3,7--3,8), Some (Const (Int32 1, (3,9--3,10))), + (3,2--3,10), None)], (3,0--3,12)), (3,0--3,12))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl index 8c12002c7d8..f1020c78c2c 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 05.fs.bsl @@ -9,8 +9,8 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A], [], [None]), true), Some (3,4--3,5), - Some (Const (Int32 1, (3,6--3,7))), None)], (3,0--3,9)), - (3,0--3,9))], + Some (Const (Int32 1, (3,6--3,7))), (3,2--3,7), None)], + (3,0--3,9)), (3,0--3,9))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,9), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl index 9126643f0cf..112d7a23329 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 06.fs.bsl @@ -9,8 +9,8 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A; B], [(3,3--3,4)], [None; None]), true), - Some (3,6--3,7), Some (Const (Int32 1, (3,8--3,9))), None)], - (3,0--3,11)), (3,0--3,11))], + Some (3,6--3,7), Some (Const (Int32 1, (3,8--3,9))), + (3,2--3,9), None)], (3,0--3,11)), (3,0--3,11))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,11), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl index a50149dd91b..27b99f20b97 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 08.fs.bsl @@ -9,10 +9,11 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A], [], [None]), true), Some (3,4--3,5), - Some (Const (Int32 1, (3,6--3,7))), Some ((3,8--4,2), None)); + Some (Const (Int32 1, (3,6--3,7))), (3,2--3,7), + Some ((3,8--4,2), None)); SynExprRecordField ((SynLongIdent ([B], [(4,3--4,4)], [None]), true), None, - None, None)], (3,0--4,6)), (3,0--4,6))], + None, (4,2--4,4), None)], (3,0--4,6)), (3,0--4,6))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,6), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl index 19fe3d819a2..8da1bc6096b 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 09.fs.bsl @@ -9,10 +9,11 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A], [], [None]), true), Some (3,4--3,5), - Some (Const (Int32 1, (3,6--3,7))), Some ((3,8--4,2), None)); + Some (Const (Int32 1, (3,6--3,7))), (3,2--3,7), + Some ((3,8--4,2), None)); SynExprRecordField - ((SynLongIdent ([B], [], [None]), true), None, None, None)], - (3,0--4,5)), (3,0--4,5))], + ((SynLongIdent ([B], [], [None]), true), None, None, + (4,2--4,3), None)], (3,0--4,5)), (3,0--4,5))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,5), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl index 1ba251bdb3a..efa568036d4 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 11.fs.bsl @@ -9,7 +9,7 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([A], [], [None]), true), Some (3,4--3,5), - None, None)], (3,0--3,7)), (3,0--3,7))], + None, (3,2--3,5), None)], (3,0--3,7)), (3,0--3,7))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--3,7), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl index 3cdbc54ea47..a2360bb38bd 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 12.fs.bsl @@ -20,8 +20,8 @@ ImplFile ([op_Equality], [], [Some (OriginalNotation "=")]), None, (4,5--4,6)), Ident F2, (4,2--4,6)), - Const (Int32 2, (4,7--4,8)), (4,2--4,8))), None)], - (3,0--4,10)), (3,0--4,10))], + Const (Int32 2, (4,7--4,8)), (4,2--4,8))), (3,2--4,8), + None)], (3,0--4,10)), (3,0--4,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl index f059d4924a4..8ce8d350e90 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 13.fs.bsl @@ -9,10 +9,11 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([F1], [], [None]), true), Some (3,5--3,6), - Some (Const (Int32 1, (3,7--3,8))), Some ((3,9--4,2), None)); + Some (Const (Int32 1, (3,7--3,8))), (3,2--3,8), + Some ((3,9--4,2), None)); SynExprRecordField ((SynLongIdent ([F2], [], [None]), true), Some (4,5--4,6), - None, None)], (3,0--4,8)), (3,0--4,8))], + None, (4,2--4,6), None)], (3,0--4,8)), (3,0--4,8))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--4,8), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl b/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl index a3acec5a7b7..3de711bfbaf 100644 --- a/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/Record - Field 14.fs.bsl @@ -9,7 +9,8 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([F1], [], [None]), true), Some (3,5--3,6), - Some (Const (Int32 1, (3,7--3,8))), Some ((3,9--4,2), None)); + Some (Const (Int32 1, (3,7--3,8))), (3,2--3,8), + Some ((3,9--4,2), None)); SynExprRecordField ((SynLongIdent ([F2], [], [None]), true), Some (4,5--4,6), Some @@ -23,8 +24,8 @@ ImplFile ([op_Equality], [], [Some (OriginalNotation "=")]), None, (5,5--5,6)), Ident F3, (5,2--5,6)), - Const (Int32 3, (5,7--5,8)), (5,2--5,8))), None)], - (3,0--5,10)), (3,0--5,10))], + Const (Int32 3, (5,7--5,8)), (5,2--5,8))), (4,2--5,8), + None)], (3,0--5,10)), (3,0--5,10))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,10), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] diff --git a/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl index 5287fdc598b..f403c248e54 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprRecordContainsTheRangeOfTheEqualsSignInSynExprRecordField.fs.bsl @@ -12,7 +12,7 @@ ImplFile (None, None, [SynExprRecordField ((SynLongIdent ([V], [], [None]), true), Some (2,4--2,5), - Some (Ident v), Some ((2,8--3,2), None)); + Some (Ident v), (2,2--2,7), Some ((2,8--3,2), None)); SynExprRecordField ((SynLongIdent ([X], [], [None]), true), Some (3,9--3,10), Some @@ -23,9 +23,9 @@ ImplFile App (NonAtomic, false, Ident someLongFunctionCall, Ident a, (4,16--5,21)), Ident b, (4,16--6,21)), - Ident c, (4,16--7,21))), None)], (2,0--7,23)), - (2,0--7,23))], PreXmlDocEmpty, [], None, (2,0--7,23), - { LeadingKeyword = None })], (true, true), + Ident c, (4,16--7,21))), (3,2--7,21), None)], + (2,0--7,23)), (2,0--7,23))], PreXmlDocEmpty, [], None, + (2,0--7,23), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [LineComment (3,13--3,28)] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl index 8adb7c8269f..03e2eefdfd4 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprRecordFieldsContainCorrectAmountOfTrivia.fs.bsl @@ -58,9 +58,9 @@ ImplFile (false, SynLongIdent ([args; DryRun], [(5,19--5,20)], [None; None]), - None, (5,15--5,26)), (2,12--5,26))), None)], - (2,0--5,28)), (2,0--5,28))], PreXmlDocEmpty, [], None, - (2,0--5,28), { LeadingKeyword = None })], (true, true), + None, (5,15--5,26)), (2,12--5,26))), (2,2--5,26), + None)], (2,0--5,28)), (2,0--5,28))], PreXmlDocEmpty, [], + None, (2,0--5,28), { LeadingKeyword = None })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [] }, set [])) From 2854dfb07760d1b5793ce79724bc3c3fffbde179 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 28 May 2025 21:33:40 +0200 Subject: [PATCH 123/134] remove XunitSetup linked file that does nothing (#18605) --- vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj | 3 --- vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj | 3 --- 2 files changed, 6 deletions(-) diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index 395400a795e..e1e657a651a 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -16,9 +16,6 @@ - - XunitSetup.fs - diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index c02e6f1bfc7..30a871ad288 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -17,9 +17,6 @@ - - XunitSetup.fs - From a1a156d3b64814ad28d53cc51848f423b0c5bad3 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 28 May 2025 20:35:04 +0100 Subject: [PATCH 124/134] Fix parsing errors using anonymous records and code quotations (#18603) --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + src/Compiler/Driver/CompilerDiagnostics.fs | 1 + src/Compiler/FSStrings.resx | 3 + src/Compiler/Service/ServiceLexing.fs | 3 + src/Compiler/Service/ServiceLexing.fsi | 1 + src/Compiler/SyntaxTree/LexFilter.fs | 12 ++ src/Compiler/lex.fsl | 4 + src/Compiler/pars.fsy | 2 +- src/Compiler/xlf/FSStrings.cs.xlf | 5 + src/Compiler/xlf/FSStrings.de.xlf | 5 + src/Compiler/xlf/FSStrings.es.xlf | 5 + src/Compiler/xlf/FSStrings.fr.xlf | 5 + src/Compiler/xlf/FSStrings.it.xlf | 5 + src/Compiler/xlf/FSStrings.ja.xlf | 5 + src/Compiler/xlf/FSStrings.ko.xlf | 5 + src/Compiler/xlf/FSStrings.pl.xlf | 5 + src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 + src/Compiler/xlf/FSStrings.ru.xlf | 5 + src/Compiler/xlf/FSStrings.tr.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 + src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 + .../Types/RecordTypes/AnonymousRecords.fs | 172 +++++++++++++++++- ...ervice.SurfaceArea.netstandard20.debug.bsl | 5 + ...vice.SurfaceArea.netstandard20.release.bsl | 5 + ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 10 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 10 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 10 +- ...ompiler.Service_Release_netstandard2.0.bsl | 10 +- .../Expression/AnonRecd - Quotation 01.fs | 8 + .../Expression/AnonRecd - Quotation 01.fs.bsl | 68 +++++++ .../Expression/AnonRecd - Quotation 02.fs | 7 + .../Expression/AnonRecd - Quotation 02.fs.bsl | 68 +++++++ .../Expression/AnonRecd - Quotation 03.fs | 7 + .../Expression/AnonRecd - Quotation 03.fs.bsl | 86 +++++++++ .../Expression/AnonRecd - Quotation 04.fs | 7 + .../Expression/AnonRecd - Quotation 04.fs.bsl | 65 +++++++ .../Expression/AnonymousRecords-13.fs.bsl | 26 +-- 37 files changed, 612 insertions(+), 44 deletions(-) create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index ee16e7fe903..28ad607ef9a 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,6 +1,7 @@ ### Fixed * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) +* Fix parsing errors using anonymous records and code quotations ([PR #18603](https://github.com/dotnet/fsharp/pull/18603)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) * Range of `SynExprRecordField` should include the expression ([PR #18617](https://github.com/dotnet/fsharp/pull/18617)) * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 5f96b1f58c8..e615d4ba336 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1168,6 +1168,7 @@ type Exception with | Parser.TOKEN_GREATER_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.RBRACK") | Parser.TOKEN_RQUOTE_DOT | Parser.TOKEN_RQUOTE -> SR.GetString("Parser.TOKEN.RQUOTE") + | Parser.TOKEN_RQUOTE_BAR_RBRACE -> SR.GetString("Parser.TOKEN.RQUOTE.BAR.RBRACE") | Parser.TOKEN_RBRACK -> SR.GetString("Parser.TOKEN.RBRACK") | Parser.TOKEN_RBRACE | Parser.TOKEN_RBRACE_COMING_SOON diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index 8453259ea1b..1b8be22d319 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -360,6 +360,9 @@ symbol '>|}' + + symbol '@>|}' or '@@>|}' + symbol '>|]' diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index fb2af965f76..74141b4805d 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -287,6 +287,7 @@ module internal TokenClassifications = | GREATER_BAR_RBRACK -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.None) | RQUOTE _ + | RQUOTE_BAR_RBRACE _ | RBRACK | RBRACE _ | RBRACE_COMING_SOON @@ -1389,6 +1390,7 @@ type FSharpTokenKind = | RightArrow | GreaterBarRightBracket | GreaterBarRightBrace + | RQuoteBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or @@ -1659,6 +1661,7 @@ type FSharpToken = | LQUOTE _ -> FSharpTokenKind.LeftQuote | RQUOTE _ -> FSharpTokenKind.RightQuote | RQUOTE_DOT _ -> FSharpTokenKind.RightQuoteDot + | RQUOTE_BAR_RBRACE _ -> FSharpTokenKind.RQuoteBarRightBrace | PERCENT_OP _ -> FSharpTokenKind.PercentOperator | BINDER _ -> FSharpTokenKind.Binder | LESS _ -> FSharpTokenKind.Less diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index 1efcf59269d..869b295d338 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -458,6 +458,7 @@ type public FSharpTokenKind = | RightArrow | GreaterBarRightBracket | GreaterBarRightBrace + | RQuoteBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index a97fb94d5e4..e298202d984 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1210,6 +1210,11 @@ type LexFilterImpl ( delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) pool.Return tokenTup + | RQUOTE_BAR_RBRACE x -> + lexbuf.CheckLanguageFeatureAndRecover LanguageFeature.BetterAnonymousRecordParsing lexbuf.LexemeRange + delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, RQUOTE(x), 0, -2)) + pool.Return tokenTup | GREATER_RBRACK -> delayToken (pool.UseShiftedLocation(tokenTup, RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -1)) @@ -2631,6 +2636,13 @@ type LexFilterImpl ( noMerge() true + | RQUOTE_BAR_RBRACE x -> + lexbuf.CheckLanguageFeatureAndRecover LanguageFeature.BetterAnonymousRecordParsing lexbuf.LexemeRange + delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, RQUOTE(x), 0, -2)) + pool.Return tokenTup + true + | _ -> false diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index 9abb9408c9e..c4aa041abc9 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -839,6 +839,10 @@ rule token (args: LexArgs) (skip: bool) = parse | "@@>" { checkExprOp lexbuf; RQUOTE ("<@@ @@>", true) } + | "@>|}" { RQUOTE_BAR_RBRACE ("<@ @>", false) } + + | "@@>|}" { RQUOTE_BAR_RBRACE ("<@@ @@>", true) } + | '#' { HASH } | '&' { AMP } diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 2dd4c5fd697..f4c291ce262 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -78,7 +78,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) -> %token LET YIELD YIELD_BANG AND_BANG %token LESS GREATER /* here the bool indicates if the tokens are part of a type application or type parameter declaration, e.g. C, detected by the lex filter */ %token PERCENT_OP BINDER -%token LQUOTE RQUOTE RQUOTE_DOT +%token LQUOTE RQUOTE RQUOTE_DOT RQUOTE_BAR_RBRACE %token BAR_BAR UPCAST DOWNCAST NULL RESERVED MODULE NAMESPACE DELEGATE CONSTRAINT BASE %token AND AS ASSERT OASSERT ASR BEGIN DO DONE DOWNTO ELSE ELIF END DOT_DOT DOT_DOT_HAT %token EXCEPTION FALSE FOR FUN FUNCTION IF IN JOIN_IN FINALLY DO_BANG diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index cfa0c8bddb7..b7040399218 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -87,6 +87,11 @@ symbol '>|}' + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + interpolated string interpolovaný řetězec diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index e81e671661a..83242b1a2ed 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -107,6 +107,11 @@ Interpolierte Zeichenfolge (Teil) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' Schlüsselwort "while!" diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 9e78f3ddd08..b874728926e 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -107,6 +107,11 @@ cadena interpolada (parte) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' palabra clave “while!” diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index ccedd3ac360..e6d9ea22b80 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -107,6 +107,11 @@ chaîne interpolée (partie) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' mot-clé « pendant ! » diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index e5545d56799..91edb4c9e53 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -107,6 +107,11 @@ stringa interpolata (parte) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' parola chiave "while" diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index 631370c20e9..af62fb0a030 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -107,6 +107,11 @@ 補間された文字列 (部分) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' キーワード 'while!' diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 084e56072c4..d6eebed9afc 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -107,6 +107,11 @@ 보간 문자열(부분) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' 'while!' 키워드 diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index f6e7003e75d..cf4407fa898 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -107,6 +107,11 @@ ciąg interpolowany (część) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' słowo kluczowe „while!” diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 72178364b24..80d7ede40c3 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -107,6 +107,11 @@ cadeia de caracteres interpolada (parte) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' palavra-chave "while!" diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 6f2c47d0d10..28e040426d7 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -107,6 +107,11 @@ интерполированная строка (часть) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' ключевое слово "while!" diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 0c41ee99672..8f81ede3df9 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -107,6 +107,11 @@ düz metin arasına kod eklenmiş dize (parça) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' 'while!' anahtar sözcüğü diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index dc22dbeb28b..21191e552c3 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -107,6 +107,11 @@ 内插字符串(部分) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' 关键字 "while!" diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index bcb553c7de1..5f834c4e1ff 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -107,6 +107,11 @@ 插補字串 (部分) + + symbol '@>|}' or '@@>|}' + symbol '@>|}' or '@@>|}' + + keyword 'while!' 關鍵字 'while!' diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index ef0b307853a..be7d0bf7ee0 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -506,4 +506,174 @@ let v = {| ``A`` = 0; B = 5; A = ""; B = 0 |} |> withDiagnostics [ (Error 3522, Line 2, Col 12, Line 2, Col 17, "The field 'A' appears multiple times in this record expression.") (Error 3522, Line 2, Col 23, Line 2, Col 24, "The field 'B' appears multiple times in this record expression.") - ] \ No newline at end of file + ] + + [] + let ``Preview: Anonymous records with typed quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr1 : {| A: Expr |} = {| A = <@ 1 + 1 @> |} +let expr2 : {| A: Expr |} = {| A = <@ 1 + 1 @>|} +let expr3 : {| A: Expr; B: Expr |} = {| A = <@ "hello" @>; B = <@ 42 @>|} +let expr4 : {| A: Expr; B: Expr |} = {| A = <@ "hello" @>; B = <@ 42 @>|} + +let expr5 : {| A: Expr |} = {| A= <@ 1 + 1 @> |} +let expr6 : {| A: Expr |} = {| A= <@ 1 + 1 @>|} +let expr7 : {| A: Expr |} = {| A = <@ 1 + 1 @> |} +let expr8 : {| A: Expr |} = {| A = <@ 1 + 1 @>|} + +let (=<@) = (@) +let (@>=) = (@) + +[1..2] =<@ [3..4] @>= [5..6] + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Preview: Anonymous records with untyped quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr1 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} +let expr2 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} +let expr3 : {| A: Expr; B: Expr |} = {| A = <@@ "hello" @@>; B = <@@ 42 @@>|} +let expr4 : {| A: Expr; B: Expr |} = {| A = <@@ "hello" @@>; B = <@@ 42 @@>|} + +let expr5 : {| A: Expr |} = {| A= <@@ 1 + 1 @@> |} +let expr6 : {| A: Expr |} = {| A= <@@ 1 + 1 @@>|} +let expr7 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} +let expr8 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Preview: Anonymous records with mixed quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr : {| Typed: Expr; Untyped: Expr |} = + {| Typed = <@ 1 + 1 @>; Untyped = <@@ "test" @@>|} + +let expr2 : {| A: Expr; B: Expr; C: string |} = + {| A = <@ 42 @>; B = <@@ true @@>; C = "normal string"|} + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Preview: Nested anonymous records with quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let nested = + {| Outer = {| Inner = <@ 1 + 1 @>|}; Other = <@@ "test" @@>|} + +let nested2 : {| A: {| B: Expr |}; C: Expr |} = + {| A = {| B = <@ 42 @>|}; C = <@@ true @@>|} + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Version 9: Anonymous records with typed quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr1 : {| A: Expr |} = {| A = <@ 1 + 1 @> |} +let expr2 : {| A: Expr |} = {| A = <@ 1 + 1 @>|} +let expr3 : {| A: Expr; B: Expr |} = {| A = <@ "hello" @>; B = <@ 42 @>|} +let expr4 : {| A: Expr; B: Expr |} = {| A = <@ "hello" @>; B = <@ 42 @>|} + +let expr5 : {| A: Expr |} = {| A= <@ 1 + 1 @> |} +let expr6 : {| A: Expr |} = {| A= <@ 1 + 1 @>|} +let expr7 : {| A: Expr |} = {| A = <@ 1 + 1 @> |} +let expr8 : {| A: Expr |} = {| A = <@ 1 + 1 @>|} + +let (=<@) = (@) +let (@>=) = (@) + +[1..2] =<@ [3..4] @>= [5..6] + """ + |> withLangVersion90 + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 5, Col 48, Line 5, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 80, Line 6, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 80, Line 7, Col 82, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 10, Col 47, Line 10, Col 48, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 12, Col 48, Line 12, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + + ] + + [] + let ``Version 9: Anonymous records with untyped quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr1 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} +let expr2 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} +let expr3 : {| A: Expr; B: Expr |} = {| A = <@@ "hello" @@>; B = <@@ 42 @@>|} +let expr4 : {| A: Expr; B: Expr |} = {| A = <@@ "hello" @@>; B = <@@ 42 @@>|} + +let expr5 : {| A: Expr |} = {| A= <@@ 1 + 1 @@> |} +let expr6 : {| A: Expr |} = {| A= <@@ 1 + 1 @@>|} +let expr7 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} +let expr8 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} + """ + |> withLangVersion90 + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 5, Col 44, Line 5, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 70, Line 6, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 7, Col 70, Line 7, Col 72, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 10, Col 43, Line 10, Col 44, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 12, Col 44, Line 12, Col 45, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Version 9: Anonymous records with mixed quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let expr : {| Typed: Expr; Untyped: Expr |} = + {| Typed = <@ 1 + 1 @>; Untyped = <@@ "test" @@>|} + +let expr2 : {| A: Expr; B: Expr; C: string |} = + {| A = <@ 42 @>; B = <@@ true @@>; C = "normal string"|} + """ + |> withLangVersion90 + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 5, Col 50, Line 5, Col 55, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Version 9: Nested anonymous records with quotations should parse correctly``() = + Fsx """ +open Microsoft.FSharp.Quotations + +let nested = + {| Outer = {| Inner = <@ 1 + 1 @>|}; Other = <@@ "test" @@>|} + +let nested2 : {| A: {| B: Expr |}; C: Expr |} = + {| A = {| B = <@ 42 @>|}; C = <@@ true @@>|} + """ + |> withLangVersion90 + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 5, Col 34, Line 5, Col 35, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 5, Col 61, Line 5, Col 66, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 8, Col 22, Line 8, Col 24, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 8, Col 44, Line 8, Col 49, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl index 1d4eeecfeea..6fccd622eca 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -11388,6 +11388,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Public FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 QuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 QuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Quote +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 RQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Rec FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Reserved FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 RightArrow @@ -11585,6 +11586,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsPublic FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuote +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRec FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsReserved FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRightArrow @@ -11778,6 +11780,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsPublic() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuestionMarkQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuote() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRQuoteBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRec() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsReserved() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRightArrow() @@ -11971,6 +11974,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind QuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind QuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Quote +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind RQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Rec FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Reserved FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind RightArrow @@ -12164,6 +12168,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_QuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_QuestionMarkQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Quote() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_RQuoteBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Rec() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Reserved() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_RightArrow() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl index 1d4eeecfeea..6fccd622eca 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -11388,6 +11388,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Public FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 QuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 QuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Quote +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 RQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Rec FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Reserved FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 RightArrow @@ -11585,6 +11586,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsPublic FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsQuote +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRec FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsReserved FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsRightArrow @@ -11778,6 +11780,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsPublic() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuestionMarkQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsQuote() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRQuoteBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRec() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsReserved() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsRightArrow() @@ -11971,6 +11974,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind QuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind QuestionMarkQuestionMark FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Quote +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind RQuoteBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Rec FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Reserved FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind RightArrow @@ -12164,6 +12168,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_QuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_QuestionMarkQuestionMark() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Quote() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_RQuoteBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Rec() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Reserved() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_RightArrow() diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 625bad81a15..0cdc4d8a63e 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -24,11 +24,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 2e1d5680e1d..4fcd5d91990 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -35,11 +35,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 7a20b934eef..fdc1720553c 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -23,11 +23,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index b8f7bba8f5f..e12c9acca1d 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -34,11 +34,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs new file mode 100644 index 00000000000..317d2257fb0 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs @@ -0,0 +1,8 @@ +module Module + +{| A = <@ 1 + 1 @>|} + +{|A = <@ 1 + 1 @> |} + +{| A = <@ 1 + 1 @> |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl new file mode 100644 index 00000000000..7f3dd8badf2 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 01.fs.bsl @@ -0,0 +1,68 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonRecd - Quotation 01.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18)))], (3,0--3,20), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,20)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17)))], (5,0--5,20), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,20)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18)))], (7,0--7,21), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,21))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,21), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs new file mode 100644 index 00000000000..995c19c6de2 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs @@ -0,0 +1,7 @@ +module Module + +{| A = <@@ 1 + 1 @@>|} + +{|A = <@@ 1 + 1 @@> |} + +{| A = <@@ 1 + 1 @@> |} diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl new file mode 100644 index 00000000000..a17975ba1da --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 02.fs.bsl @@ -0,0 +1,68 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonRecd - Quotation 02.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), + Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,13--3,14)), Const (Int32 1, (3,11--3,12)), + (3,11--3,14)), Const (Int32 1, (3,15--3,16)), + (3,11--3,16)), false, (3,7--3,20)))], (3,0--3,22), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,22)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), + Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,12--5,13)), Const (Int32 1, (5,10--5,11)), + (5,10--5,13)), Const (Int32 1, (5,14--5,15)), + (5,10--5,15)), false, (5,6--5,19)))], (5,0--5,22), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,22)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), + Quote + (Ident op_QuotationUntyped, true, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,13--7,14)), Const (Int32 1, (7,11--7,12)), + (7,11--7,14)), Const (Int32 1, (7,15--7,16)), + (7,11--7,16)), false, (7,7--7,20)))], (7,0--7,23), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,23))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,23), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs new file mode 100644 index 00000000000..cb13fdbeb49 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs @@ -0,0 +1,7 @@ +module Module + +{| A = <@ 1 + 1 @>; B = <@@ "test" @@>|} + +{|A = <@ 1 + 1 @>; B = <@@ "test" @@> |} + +{| A = <@ 1 + 1 @>; B = <@@ "test" @@> |} diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl new file mode 100644 index 00000000000..91f4963b53c --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 03.fs.bsl @@ -0,0 +1,86 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonRecd - Quotation 03.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (3,5--3,6), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (3,12--3,13)), Const (Int32 1, (3,10--3,11)), + (3,10--3,13)), Const (Int32 1, (3,14--3,15)), + (3,10--3,15)), false, (3,7--3,18))); + (SynLongIdent ([B], [], [None]), Some (3,22--3,23), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,28--3,34)), (3,28--3,34)), + false, (3,24--3,38)))], (3,0--3,40), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,40)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (5,4--5,5), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (5,11--5,12)), Const (Int32 1, (5,9--5,10)), + (5,9--5,12)), Const (Int32 1, (5,13--5,14)), + (5,9--5,14)), false, (5,6--5,17))); + (SynLongIdent ([B], [], [None]), Some (5,21--5,22), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,27--5,33)), (5,27--5,33)), + false, (5,23--5,37)))], (5,0--5,40), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,40)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([A], [], [None]), Some (7,5--7,6), + Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_Addition], [], + [Some (OriginalNotation "+")]), None, + (7,12--7,13)), Const (Int32 1, (7,10--7,11)), + (7,10--7,13)), Const (Int32 1, (7,14--7,15)), + (7,10--7,15)), false, (7,7--7,18))); + (SynLongIdent ([B], [], [None]), Some (7,22--7,23), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,28--7,34)), (7,28--7,34)), + false, (7,24--7,38)))], (7,0--7,41), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,41))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,41), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs new file mode 100644 index 00000000000..5972922e4c2 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs @@ -0,0 +1,7 @@ +module Module + +{| Outer = {| Inner = <@ 1 @>|}; Other = <@@ "test" @@>|} + +{|Outer = {| Inner = <@ 1 @>|}; Other = <@@ "test" @@> |} + +{| Outer = {| Inner = <@ 1 @>|}; Other = <@@ "test" @@> |} diff --git a/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl new file mode 100644 index 00000000000..5577001a81e --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonRecd - Quotation 04.fs.bsl @@ -0,0 +1,65 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonRecd - Quotation 04.fs", false, + QualifiedNameOfFile Module, [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([Outer], [], [None]), Some (3,9--3,10), + AnonRecd + (false, None, + [(SynLongIdent ([Inner], [], [None]), Some (3,20--3,21), + Quote + (Ident op_Quotation, false, + Const (Int32 1, (3,25--3,26)), false, (3,22--3,29)))], + (3,11--3,31), { OpeningBraceRange = (3,11--3,13) })); + (SynLongIdent ([Other], [], [None]), Some (3,39--3,40), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (3,45--3,51)), (3,45--3,51)), + false, (3,41--3,55)))], (3,0--3,57), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,57)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([Outer], [], [None]), Some (5,8--5,9), + AnonRecd + (false, None, + [(SynLongIdent ([Inner], [], [None]), Some (5,19--5,20), + Quote + (Ident op_Quotation, false, + Const (Int32 1, (5,24--5,25)), false, (5,21--5,28)))], + (5,10--5,30), { OpeningBraceRange = (5,10--5,12) })); + (SynLongIdent ([Other], [], [None]), Some (5,38--5,39), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (5,44--5,50)), (5,44--5,50)), + false, (5,40--5,54)))], (5,0--5,57), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,57)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([Outer], [], [None]), Some (7,9--7,10), + AnonRecd + (false, None, + [(SynLongIdent ([Inner], [], [None]), Some (7,20--7,21), + Quote + (Ident op_Quotation, false, + Const (Int32 1, (7,25--7,26)), false, (7,22--7,29)))], + (7,11--7,31), { OpeningBraceRange = (7,11--7,13) })); + (SynLongIdent ([Other], [], [None]), Some (7,39--7,40), + Quote + (Ident op_QuotationUntyped, true, + Const + (String ("test", Regular, (7,45--7,51)), (7,45--7,51)), + false, (7,41--7,55)))], (7,0--7,58), + { OpeningBraceRange = (7,0--7,2) }), (7,0--7,58))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--7,58), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl index 93fd93c0088..ede1aa9a366 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -16,30 +16,12 @@ ImplFile (AnonRecd (false, None, [(SynLongIdent ([a], [], [None]), Some (5,4--5,5), - FromParseError - (Quote - (Ident op_Quotation, false, - App - (NonAtomic, false, - App - (NonAtomic, true, - LongIdent - (false, - SynLongIdent - ([op_AtGreaterBar], [], - [Some (OriginalNotation "@>|")]), None, - (5,11--5,14)), Const (Int32 3, (5,9--5,10)), - (5,9--5,14)), - ArbitraryAfterError ("declExprInfix", (5,14--5,14)), - (5,9--5,14)), false, (5,6--5,15)), (5,6--5,15)))], - (5,0--5,15), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], + Quote + (Ident op_Quotation, false, Const (Int32 3, (5,9--5,10)), + false, (5,6--5,13)))], (5,0--5,15), + { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [] }, set [])) - -(5,11)-(5,14) parse error Unexpected token '@>|' or incomplete expression -(5,14)-(5,15) parse error Unexpected symbol '}' in quotation literal. Expected end of quotation or other token. -(5,6)-(5,8) parse error Unmatched '<@ @>' -(5,0)-(5,2) parse error Unmatched '{|' From 261cfdad3de0a7ca026ff63ae0a34e7761e356a8 Mon Sep 17 00:00:00 2001 From: Jakub Majocha <1760221+majocha@users.noreply.github.com> Date: Wed, 28 May 2025 21:35:44 +0200 Subject: [PATCH 125/134] Address CI not always logging test results (#18598) --- azure-pipelines-PR.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index cc88c091482..d73955cdb18 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -278,6 +278,16 @@ stages: NativeToolsOnMachine: true displayName: Build + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'XUnit' + testRunTitle: WindowsNoRealsig_testCoreclr + mergeTestResults: true + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + condition: succeededOrFailed() + - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog condition: always() @@ -328,6 +338,7 @@ stages: mergeTestResults: true testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + condition: succeededOrFailed() continueOnError: true - task: PublishBuildArtifacts@1 displayName: Publish Build BinLog @@ -488,7 +499,7 @@ stages: testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' continueOnError: true - condition: ne(variables['_testKind'], 'testFSharpQA') + condition: succeededOrFailed() # ne(variables['_testKind'], 'testFSharpQA') - task: PublishBuildArtifacts@1 displayName: Publish Tests BinLog condition: always() @@ -566,6 +577,7 @@ stages: testResultsFiles: '*.xml' searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' continueOnError: true + condition: succeededOrFailed() - task: PublishBuildArtifacts@1 displayName: Publish BinLog @@ -638,7 +650,7 @@ stages: mergeTestResults: true searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' continueOnError: true - condition: always() + condition: succeededOrFailed() - task: PublishBuildArtifacts@1 displayName: Publish Test Logs inputs: @@ -683,7 +695,7 @@ stages: mergeTestResults: true searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' continueOnError: true - condition: always() + condition: succeededOrFailed() - task: PublishBuildArtifacts@1 displayName: Publish Test Logs inputs: From 449432c8ceb3c8563f4110e583cfe5fe43b80f58 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 May 2025 21:36:22 +0200 Subject: [PATCH 126/134] WriteCodeFragment should support IsLiteral suffix for parity with MSBuild (#18579) --- src/FSharp.Build/WriteCodeFragment.fs | 55 ++++++- .../WriteCodeFragmentTests.fs | 140 +++++++++++++++++- 2 files changed, 188 insertions(+), 7 deletions(-) diff --git a/src/FSharp.Build/WriteCodeFragment.fs b/src/FSharp.Build/WriteCodeFragment.fs index 7df19fad327..0e5b0457649 100644 --- a/src/FSharp.Build/WriteCodeFragment.fs +++ b/src/FSharp.Build/WriteCodeFragment.fs @@ -9,6 +9,9 @@ open System.Text open Microsoft.Build.Framework open Microsoft.Build.Utilities +[] +type EscapedValue = { Escaped: string; Raw: string } + type WriteCodeFragment() as this = inherit Task() let mutable _outputDirectory: ITaskItem MaybeNull = null @@ -41,7 +44,10 @@ type WriteCodeFragment() as this = | _ -> sb.Append(c)) (StringBuilder().Append("\"")) - sb.Append("\"").ToString() + { + Escaped = sb.Append("\"").ToString() + Raw = str + } member _.GenerateAttribute(item: ITaskItem, language: string) = let attributeName = item.ItemSpec @@ -60,9 +66,11 @@ type WriteCodeFragment() as this = let value = match entry.Value with - | null -> "null" - | :? string as value -> escapeString value - | value -> value.ToString() + | null -> { Escaped = "null"; Raw = "null" } + | :? string as strValue -> escapeString strValue + | value -> + let strValue = value.ToString() + { Escaped = strValue; Raw = strValue } (key, value)) @@ -85,12 +93,47 @@ type WriteCodeFragment() as this = else Array.create (List.last orderedParametersWithIndex |> fst) "null" - List.iter (fun (index, value) -> orderedParametersArray.[index - 1] <- value) orderedParametersWithIndex + List.iter (fun (index, value) -> orderedParametersArray.[index - 1] <- value.Escaped) orderedParametersWithIndex // construct ordered parameter lists let combinedOrderedParameters = String.Join(", ", orderedParametersArray) let combinedNamedParameters = - String.Join(", ", List.map (fun (key, value) -> sprintf "%s = %s" key value) namedParameters) + // Define "_IsLiteral" suffix to match MSBuild behavior + let isLiteralSuffix = "_IsLiteral" + + // Process named parameters to handle IsLiteral suffix + let processedNamedParameters = + // First identify all parameters with _IsLiteral suffix + let isLiteralParams = + namedParameters + |> List.choose (fun (key, value) -> + if key.EndsWith(isLiteralSuffix) && (value.Raw = "true" || value.Raw = "True") then + // Extract the base parameter name by removing the suffix + Some(key.Substring(0, key.Length - isLiteralSuffix.Length)) + else + None) + |> Set.ofList + + // Process all parameters, handling literals appropriately + namedParameters + |> List.choose (fun (key, value) -> + // Skip _IsLiteral metadata entries + if key.EndsWith(isLiteralSuffix) then + None + else + // Check if this parameter should be treated as a literal + let isLiteral = Set.contains key isLiteralParams + + if isLiteral then + // For literals, use the raw value + Some(key, value.Raw) + else + // Regular parameter, use the escaped value + Some(key, value.Escaped)) + // Sort parameters alphabetically by key to match MSBuild behavior + |> List.sortBy fst + + String.Join(", ", List.map (fun (key, value) -> sprintf "%s = %s" key value) processedNamedParameters) // construct the final argument string; positional arguments followed by named match (combinedOrderedParameters.Length, combinedNamedParameters.Length) with | (0, 0) -> "" // no arguments diff --git a/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs b/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs index f8c89bac2ed..56de7ceb197 100644 --- a/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs +++ b/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs @@ -36,6 +36,52 @@ type WriteCodeFragmentFSharpTests() = member _.``Escaped string parameters``() = verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" + [] + member _.``Named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" [("Bool", "true"); ("Bool_IsLiteral", "true")] "SomeAttribute(Bool = true)" + + [] + member _.``Multiple named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(Bool = false, Number = 42)" + + [] + member _.``Mixed named parameters with and without _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Text", "hello") + ] + "SomeAttribute(Number = 42, Text = \"hello\")" + + [] + member _.``Mixed unnamed parameters and named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("_Parameter1", "1"); + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(\"1\", Bool = false, Number = 42)" + + [] + member _.``Enum _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("EnumValue", "System.StringComparison.OrdinalIgnoreCase"); + ("EnumValue_IsLiteral", "true") + ] + "SomeAttribute(EnumValue = System.StringComparison.OrdinalIgnoreCase)" + type WriteCodeFragmentCSharpTests() = let verifyAttribute (attributeName:string) (parameters:(string*string) list) (expectedAttributeText:string) = @@ -44,7 +90,7 @@ type WriteCodeFragmentCSharpTests() = let actualAttributeText = (new WriteCodeFragment()).GenerateAttribute (taskItem :> ITaskItem, "c#") let fullExpectedAttributeText = "[assembly: " + expectedAttributeText + "]" Assert.Equal(fullExpectedAttributeText, actualAttributeText) - + [] member _.``No parameters``() = verifyAttribute "SomeAttribute" [] "SomeAttribute()" @@ -65,6 +111,52 @@ type WriteCodeFragmentCSharpTests() = member _.``Escaped string parameters``() = verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" // this should look like: SomeAttribute("\"uno\"") + + [] + member _.``Named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" [("Bool", "true"); ("Bool_IsLiteral", "true")] "SomeAttribute(Bool = true)" + + [] + member _.``Multiple named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(Bool = false, Number = 42)" + + [] + member _.``Mixed named parameters with and without _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Text", "hello") + ] + "SomeAttribute(Number = 42, Text = \"hello\")" + + [] + member _.``Mixed unnamed parameters and named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("_Parameter1", "1"); + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(\"1\", Bool = false, Number = 42)" + + [] + member _.``Enum _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("EnumValue", "System.StringComparison.OrdinalIgnoreCase"); + ("EnumValue_IsLiteral", "true") + ] + "SomeAttribute(EnumValue = System.StringComparison.OrdinalIgnoreCase)" type WriteCodeFragmentVisualBasicTests() = @@ -96,4 +188,50 @@ type WriteCodeFragmentVisualBasicTests() = member _.``Escaped string parameters``() = verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" // this should look like: SomeAttribute("\"uno\"") + + [] + member _.``Named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" [("Bool", "true"); ("Bool_IsLiteral", "true")] "SomeAttribute(Bool = true)" + + [] + member _.``Multiple named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(Bool = false, Number = 42)" + + [] + member _.``Mixed named parameters with and without _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Text", "hello") + ] + "SomeAttribute(Number = 42, Text = \"hello\")" + + [] + member _.``Mixed unnamed parameters and named parameters with _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("_Parameter1", "1"); + ("Number", "42"); + ("Number_IsLiteral", "true"); + ("Bool", "false"); + ("Bool_IsLiteral", "true") + ] + "SomeAttribute(\"1\", Bool = false, Number = 42)" + + [] + member _.``Enum _IsLiteral suffix``() = + verifyAttribute "SomeAttribute" + [ + ("EnumValue", "System.StringComparison.OrdinalIgnoreCase"); + ("EnumValue_IsLiteral", "true") + ] + "SomeAttribute(EnumValue = System.StringComparison.OrdinalIgnoreCase)" From ec503f9bd9f35fe3a607fd006e544415b541caff Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Wed, 28 May 2025 21:39:34 +0200 Subject: [PATCH 127/134] Checker: report environment before checking namespace (#18609) --- .../.FSharp.Compiler.Service/10.0.100.md | 1 + src/Compiler/Checking/CheckDeclarations.fs | 1 + tests/FSharp.Compiler.Service.Tests/Common.fs | 10 +- .../CompletionTests.fs | 32 ++++- .../ProjectAnalysisTests.fs | 2 +- .../TooltipTests.fs | 109 ++++++++---------- 6 files changed, 88 insertions(+), 67 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 28ad607ef9a..b681f5da2eb 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -7,6 +7,7 @@ * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) +* Completion: fix previous namespace considered opened [PR #18609](https://github.com/dotnet/fsharp/pull/18609) ### Breaking Changes diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 7d8a0e0764e..889c7bb5416 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -5428,6 +5428,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let envNS = LocateEnv kind.IsModule cenv.thisCcu env enclosingNamespacePath let envNS = ImplicitlyOpenOwnNamespace cenv.tcSink g cenv.amap m enclosingNamespacePath envNS + CallEnvSink cenv.tcSink (m, envNS.NameEnv, env.eAccessRights) let modTyNS = envNS.eModuleOrNamespaceTypeAccumulator.Value let modTyRoot, modulNSs = BuildRootModuleType enclosingNamespacePath envNS.eCompPath modTyNS diff --git a/tests/FSharp.Compiler.Service.Tests/Common.fs b/tests/FSharp.Compiler.Service.Tests/Common.fs index f1de5739d47..8bc685b544b 100644 --- a/tests/FSharp.Compiler.Service.Tests/Common.fs +++ b/tests/FSharp.Compiler.Service.Tests/Common.fs @@ -5,9 +5,9 @@ open System open System.Diagnostics open System.IO open System.Collections.Generic -open System.Threading open System.Threading.Tasks open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.EditorServices open FSharp.Compiler.IO open FSharp.Compiler.Symbols open FSharp.Compiler.Syntax @@ -352,6 +352,14 @@ let getCursorPosAndPrepareSource (source: string) : string * string * pos = let lineText = lineText.Replace("{caret}", "") source, lineText, Position.mkPos (line + 1) (column - 1) +let getPartialIdentifierAndPrepareSource source = + let source, lineText, pos = getCursorPosAndPrepareSource source + let _, column, _ = QuickParse.GetCompleteIdentifierIsland false lineText pos.Column |> Option.get + let pos = Position.mkPos pos.Line column + let plid = QuickParse.GetPartialLongNameEx(lineText, column - 1) + let names = plid.QualifyingIdents @ [plid.PartialIdent] + source, lineText, pos, plid, names + let getParseResults (source: string) = parseSourceCode("Test.fsx", source) diff --git a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs index cfe43453d74..76106a92b34 100644 --- a/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/CompletionTests.fs @@ -13,11 +13,17 @@ let getCompletionInfo source = let getCompletionItemNames (completionInfo: DeclarationListInfo) = completionInfo.Items |> Array.map (fun item -> item.NameInCode) -let assertHasItemWithNames names (completionInfo: DeclarationListInfo) = +let private assertItemsWithNames contains names (completionInfo: DeclarationListInfo) = let itemNames = getCompletionItemNames completionInfo |> set for name in names do - Assert.True(Set.contains name itemNames, $"{name} not found in {itemNames}") + Assert.True(Set.contains name itemNames = contains) + +let assertHasItemWithNames names (completionInfo: DeclarationListInfo) = + assertItemsWithNames true names completionInfo + +let assertHasNoItemsWithNames names (completionInfo: DeclarationListInfo) = + assertItemsWithNames false names completionInfo [] let ``Expr - After record decl 01`` () = @@ -353,4 +359,24 @@ module rec M = let _: R{caret} = () """ - assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info \ No newline at end of file + assertHasItemWithNames ["Rec1"; "Rec2"; "Rec3"] info + +[] +let ``Not in scope 01`` () = + let info = + getCompletionInfo """ +namespace Ns1 + +type E = + | A = 1 + | B = 2 + | C = 3 + +namespace Ns2 + +module Module = + match Ns1.E.A with + | {caret} + +""" + assertHasNoItemsWithNames ["E"] info diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index cef9b119c77..c3bd9ca001d 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -4362,7 +4362,7 @@ let ``Test Project32 should be able to find impl symbols`` () = checker.GetBackgroundCheckResultsForFileInProject(Project32.fileName1, Project32.options) |> Async.RunImmediate - let implSymbolUseOpt = implBackgroundTypedParse1.GetSymbolUseAtLocation(3,5,"",["func"]) + let implSymbolUseOpt = implBackgroundTypedParse1.GetSymbolUseAtLocation(3,5,"let func x = x + 1",["func"]) let implSymbol = implSymbolUseOpt.Value.Symbol let usesOfImplSymbol = diff --git a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs index cbc82c6922e..90a74ed3e4e 100644 --- a/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/TooltipTests.fs @@ -9,11 +9,12 @@ open FSharp.Compiler.Text open FSharp.Compiler.Tokenization open FSharp.Compiler.EditorServices open FSharp.Compiler.Symbols -open FSharp.Compiler.Xml open FSharp.Test open Xunit -let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEndOfNames lineText names (expectedContent: string) = +let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource (expectedContent: string) = + let implSource, lineText, pos, plid, names = getPartialIdentifierAndPrepareSource implSource + let files = Map.ofArray [| "A.fsi", @@ -43,7 +44,7 @@ let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEn | _, FSharpCheckFileAnswer.Succeeded(checkResults) -> // Get the tooltip for (line, colAtEndOfNames) in the implementation file let (ToolTipText tooltipElements) = - checkResults.GetToolTip(line, colAtEndOfNames, lineText, names, FSharpTokenTag.Identifier) + checkResults.GetToolTip(pos.Line, pos.Column, lineText, names, FSharpTokenTag.Identifier) match tooltipElements with | ToolTipElement.Group [ element ] :: _ -> @@ -55,14 +56,14 @@ let testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource line colAtEn | elements -> failwith $"Expected at least one tooltip group element, got {elements}" | _ -> failwith "Expected checking to succeed." - + [] let ``Display XML doc of signature file for let if implementation doesn't have one`` () = let sigSource = """ module Foo -/// Great XML doc comment +/// Comment val bar: a: int -> b: int -> int """ @@ -70,11 +71,10 @@ val bar: a: int -> b: int -> int """ module Foo -// No XML doc here because the signature file has one right? -let bar a b = a - b +let bar{caret} a b = a - b """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 4 4 "let bar a b = a - b" [ "bar" ] "Great XML doc comment" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" [] @@ -83,7 +83,7 @@ let ``Display XML doc of signature file for partial AP if implementation doesn't """ module Foo -/// Some Sig Doc on IsThree +/// Comment val (|IsThree|_|): x: int -> int option """ @@ -91,11 +91,10 @@ val (|IsThree|_|): x: int -> int option """ module Foo -// No XML doc here because the signature file has one right? -let (|IsThree|_|) x = if x = 3 then Some x else None +let (|IsThr{caret}ee|_|) x = if x = 3 then Some x else None """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 4 4 "let (|IsThree|_|) x = if x = 3 then Some x else None" [ "IsThree" ] "Some Sig Doc on IsThree" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" [] @@ -104,7 +103,7 @@ let ``Display XML doc of signature file for DU if implementation doesn't have on """ module Foo -/// Some sig comment on the disc union type +/// Comment type Bar = | Case1 of int * string | Case2 of string @@ -114,13 +113,12 @@ type Bar = """ module Foo -// No XML doc here because the signature file has one right? -type Bar = +type Bar{caret} = | Case1 of int * string | Case2 of string """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 4 7 "type Bar =" [ "Bar" ] "Some sig comment on the disc union type" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" [] @@ -131,7 +129,7 @@ module Foo type Bar = | BarCase1 of int * string - /// Some sig comment on the disc union case + /// CommentSig | BarCase2 of string """ @@ -141,11 +139,11 @@ module Foo type Bar = | BarCase1 of int * string - // No XML doc here because the signature file has one right? - | BarCase2 of string + // CommentImpl + | BarCase2{caret} of string """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 7 14 " | BarCase2 of string" [ "BarCase2" ] "Some sig comment on the disc union case" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "CommentSig" [] @@ -154,7 +152,7 @@ let ``Display XML doc of signature file for record type if implementation doesn' """ module Foo -/// Some sig comment on record type +/// Comment type Bar = { SomeField: int } @@ -164,12 +162,12 @@ type Bar = { """ module Foo -type Bar = { +type B{caret}ar = { SomeField: int } """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 3 9 "type Bar = {" [ "Bar" ] "Some sig comment on record type" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" [] @@ -179,7 +177,7 @@ let ``Display XML doc of signature file for record field if implementation doesn module Foo type Bar = { - /// Some sig comment on record field + /// Comment SomeField: int } """ @@ -189,11 +187,11 @@ type Bar = { module Foo type Bar = { - SomeField: int + SomeFiel{caret}d: int } """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 5 13 " SomeField: int" [ "SomeField" ] "Some sig comment on record field" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" [] @@ -212,11 +210,11 @@ type Bar = """ module Foo -type Bar() = +type B{caret}ar() = member val Foo = "bla" with get, set """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 3 9 "type Bar() =" [ "Bar" ] "Some sig comment on class type" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Some sig comment on class type" [] @@ -227,9 +225,9 @@ module Foo type Bar = new: unit -> Bar - /// Some sig comment on auto property + /// Comment1 member Foo: string - /// Some sig comment on class member + /// Comment2 member Func: int -> int -> int """ @@ -239,17 +237,17 @@ module Foo type Bar() = member val Foo = "bla" with get, set - member _.Func x y = x * y + member _.Func{caret} x y = x * y """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 6 30 " member _.Func x y = x * y" [ "_"; "Func" ] "Some sig comment on class member" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment2" [] let ``Display XML doc of signature file for module if implementation doesn't have one`` () = let sigSource = """ -/// Some sig comment on module +/// Comment module Foo val a: int @@ -257,15 +255,16 @@ val a: int let implSource = """ -module Foo +module Fo{caret}o let a = 23 """ - testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource 2 10 "module Foo" [ "Foo" ] "Some sig comment on module" + testXmlDocFallbackToSigFileWhileInImplFile sigSource implSource "Comment" -let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag = +let testToolTipSquashing source = + let source, lineText, pos, plid, names = getPartialIdentifierAndPrepareSource source let files = Map.ofArray [| "A.fs", @@ -292,10 +291,10 @@ let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag = // Get the tooltip for `bar` let (ToolTipText tooltipElements) = - checkResults.GetToolTip(line, colAtEndOfNames, lineText, names, tokenTag) + checkResults.GetToolTip(pos.Line, pos.Column, lineText, names, FSharpTokenTag.Identifier) let (ToolTipText tooltipElementsSquashed) = - checkResults.GetToolTip(line, colAtEndOfNames, lineText, names, tokenTag, 10) + checkResults.GetToolTip(pos.Line, pos.Column, lineText, names, FSharpTokenTag.Identifier, 10) match tooltipElements, tooltipElementsSquashed with | groups, groupsSquashed -> let breaks = @@ -325,71 +324,57 @@ let testToolTipSquashing source line colAtEndOfNames lineText names tokenTag = [] let ``Squashed tooltip of long function signature should have newlines added`` () = - let source = - """ + testToolTipSquashing """ module Foo -let bar (fileName: string) (fileVersion: int) (sourceText: string) (options: int) (userOpName: string) = 0 +let bar{caret} (fileName: string) (fileVersion: int) (sourceText: string) (options: int) (userOpName: string) = 0 """ - testToolTipSquashing source 3 6 "let bar (fileName: string) (fileVersion: int) (sourceText: string) (options: int) (userOpName: string) = 0;" [ "bar" ] FSharpTokenTag.Identifier - [] let ``Squashed tooltip of record with long field signature should have newlines added`` () = - let source = - """ + testToolTipSquashing """ module Foo -type Foo = +type Fo{caret}o = { Field1: string Field2: (string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string) } """ - testToolTipSquashing source 3 7 "type Foo =" [ "Foo" ] FSharpTokenTag.Identifier - [] let ``Squashed tooltip of DU with long case signature should have newlines added`` () = - let source = - """ + testToolTipSquashing """ module Foo -type SomeDiscUnion = +type SomeDis{caret}cUnion = | Case1 of string | Case2 of (string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string * string) """ - testToolTipSquashing source 3 7 "type SomeDiscUnion =" [ "SomeDiscUnion" ] FSharpTokenTag.Identifier - [] let ``Squashed tooltip of constructor with long signature should have newlines added`` () = - let source = - """ + testToolTipSquashing """ module Foo -type SomeClass(a1: int, a2: int, a3: int, a4: int, a5: int, a6: int, a7: int, a8: int, a9: int, a10: int, a11: int, a12: int, a13: int, a14: int, a15: int, a16: int, a17: int, a18: int, a19: int, a20: int) = +type Some{caret}Class(a1: int, a2: int, a3: int, a4: int, a5: int, a6: int, a7: int, a8: int, a9: int, a10: int, a11: int, a12: int, a13: int, a14: int, a15: int, a16: int, a17: int, a18: int, a19: int, a20: int) = member _.A = a1 """ - testToolTipSquashing source 3 7 "type SomeClass(a1: int, a2: int, a3: int, a4: int, a5: int, a6: int, a7: int, a8: int, a9: int, a10: int, a11: int, a12: int, a13: int, a14: int, a15: int, a16: int, a17: int, a18: int, a19: int, a20: int) =" [ "SomeClass" ] FSharpTokenTag.Identifier - [] let ``Squashed tooltip of property with long signature should have newlines added`` () = - let source = - """ + testToolTipSquashing """ module Foo type SomeClass() = member _.Abc: (int * int * int * int * int * int * int * int * int * int * int * int * int * int * int * int * int * int * int * int) = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 let c = SomeClass() -c.Abc +c.Ab{caret}c """ - testToolTipSquashing source 7 5 "c.Abc" [ "c"; "Abc" ] FSharpTokenTag.Identifier let getCheckResults source options = let fileName, options = From ae7ee86d7247616707c6cd157db012d59fe983f8 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Wed, 28 May 2025 20:41:27 +0100 Subject: [PATCH 128/134] opt-in warning attribute not valid for union case with fields (#18532) --- .../.FSharp.Compiler.Service/10.0.100.md | 3 + src/Compiler/Checking/CheckDeclarations.fs | 43 +++--- .../Checking/Expressions/CheckExpressions.fs | 134 ++++++++++-------- .../Checking/Expressions/CheckExpressions.fsi | 2 + src/Compiler/Driver/CompilerDiagnostics.fs | 1 + src/Compiler/FSComp.txt | 3 +- src/Compiler/xlf/FSComp.txt.cs.xlf | 5 + src/Compiler/xlf/FSComp.txt.de.xlf | 5 + src/Compiler/xlf/FSComp.txt.es.xlf | 5 + src/Compiler/xlf/FSComp.txt.fr.xlf | 5 + src/Compiler/xlf/FSComp.txt.it.xlf | 5 + src/Compiler/xlf/FSComp.txt.ja.xlf | 5 + src/Compiler/xlf/FSComp.txt.ko.xlf | 5 + src/Compiler/xlf/FSComp.txt.pl.xlf | 5 + src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 + src/Compiler/xlf/FSComp.txt.ru.xlf | 5 + src/Compiler/xlf/FSComp.txt.tr.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 + .../AttributeUsage/AttributeUsage.fs | 43 +++++- 20 files changed, 210 insertions(+), 84 deletions(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index b681f5da2eb..dbd8a890a7d 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,3 +1,6 @@ +### Added +* Add opt-in warning attribute not valid for union case with fields [PR #18532](https://github.com/dotnet/fsharp/pull/18532)) + ### Fixed * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 889c7bb5416..dd0825f4bb5 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -576,22 +576,33 @@ module TcRecdUnionAndEnumDeclarations = let checkXmlDocs = cenv.diagnosticOptions.CheckXmlDocs let xmlDoc = xmldoc.ToXmlDoc(checkXmlDocs, Some names) - let attrs = - (* - The attributes of a union case decl get attached to the generated "static factory" method. - Enforce union-cases AttributeTargets: - - AttributeTargets.Method - type SomeUnion = - | Case1 of int // Compiles down to a static method - - AttributeTargets.Property - type SomeUnion = - | Case1 // Compiles down to a static property - *) - if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargets) then - let target = if rfields.IsEmpty then AttributeTargets.Property else AttributeTargets.Method - TcAttributes cenv env target synAttrs - else - TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs + let attrs = TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs + (* + The attributes of a union case decl get attached to the generated "static factory" method. + Enforce union-cases AttributeTargets: + - AttributeTargets.Method + type SomeUnion = + | Case1 of int // Compiles down to a static method + - AttributeTargets.Property + type SomeUnion = + | Case1 // Compiles down to a static property + *) + if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargets) then + let attrTargets = + attrs + |> List.collect (fun attr -> + attr.TyconRef.Attribs + |> List.choose (fun attr -> + match attr with + | Attrib(unnamedArgs = [ AttribInt32Arg validOn ]) -> Some validOn + | _ -> None)) + + attrTargets + |> List.iter (fun target -> + // If the union case has fields, and the target is not AttributeTargets.Method || AttributeTargets.All. Then we raise a separate opt-in warning + let hasNotMethodTarget = (enum target &&& AttributeTargets.Method) = enum 0 + if hasNotMethodTarget then + warning(Error(FSComp.SR.tcAttributeIsNotValidForUnionCaseWithFields(), id.idRange))) Construct.NewUnionCase id rfields recordTy attrs xmlDoc vis diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index 1e0d3edc889..4ce2fb1700b 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -11288,6 +11288,75 @@ and TcNonRecursiveBinding declKind cenv env tpenv ty binding = let explicitTyparInfo, tpenv = TcNonrecBindingTyparDecls cenv env tpenv binding TcNormalizedBinding declKind cenv env tpenv ty None NoSafeInitInfo ([], explicitTyparInfo) binding +and ResolveAttributeType (cenv: cenv) (env: TcEnv) (mAttr: range) (tycon: Ident list) = + let tpenv = emptyUnscopedTyparEnv + let ad = env.eAccessRights + + let tyPath, tyId = List.frontAndBack tycon + + let try1 n = + let tyid = mkSynId tyId.idRange n + let tycon = (tyPath @ [tyid]) + + match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurrence.UseInAttribute OpenQualified env.eNameResEnv ad tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with + | Exception err -> raze err + | Result(tinstEnclosing, tcref, inst) -> success(TcTypeApp cenv NoNewTypars CheckCxs ItemOccurrence.UseInAttribute env tpenv mAttr tcref tinstEnclosing [] inst) + + ForceRaise ((try1 (tyId.idText + "Attribute")) |> otherwise (fun () -> (try1 tyId.idText))) + +and CheckAttributeUsage (g: TcGlobals) (mAttr: range) (tcref: TyconRef) (attrTgt: AttributeTargets) (targetIndicator: Ident option) (attrEx: AttributeTargets) = + // REVIEW: take notice of inherited? + let validOn, _inherited = + let validOnDefault = 0x7fff + let inheritedDefault = true + if tcref.IsILTycon then + let tdef = tcref.ILTyconRawMetadata + let tref = g.attrib_AttributeUsageAttribute.TypeRef + + match TryDecodeILAttribute tref tdef.CustomAttrs with + | Some ([ILAttribElem.Int32 validOn ], named) -> + let inherited = + match List.tryPick (function "Inherited", _, _, ILAttribElem.Bool res -> Some res | _ -> None) named with + | None -> inheritedDefault + | Some x -> x + (validOn, inherited) + | Some ([ILAttribElem.Int32 validOn; ILAttribElem.Bool _allowMultiple; ILAttribElem.Bool inherited ], _) -> + (validOn, inherited) + | _ -> + (validOnDefault, inheritedDefault) + else + match (TryFindFSharpAttribute g g.attrib_AttributeUsageAttribute tcref.Attribs) with + | Some(Attrib(unnamedArgs = [ AttribInt32Arg validOn ])) -> + validOn, inheritedDefault + | Some(Attrib(unnamedArgs = [ AttribInt32Arg validOn; AttribBoolArg(_allowMultiple); AttribBoolArg inherited])) -> + validOn, inherited + | Some _ -> + warning(Error(FSComp.SR.tcUnexpectedConditionInImportedAssembly(), mAttr)) + validOnDefault, inheritedDefault + | _ -> + validOnDefault, inheritedDefault + + // Determine valid attribute targets + let attributeTargets = enum validOn &&& attrTgt + let directedTargets = + match targetIndicator with + | LongFormAttrTarget attrTarget -> attrTarget + | UnrecognizedLongAttrTarget attrTarget -> + errorR(Error(FSComp.SR.tcUnrecognizedAttributeTarget(), attrTarget.idRange)) + attributeTargets + | ShortFormAttributeTarget -> attributeTargets &&& ~~~ attrEx + + let constrainedTargets = attributeTargets &&& directedTargets + + // Check if attribute is valid for the target + if constrainedTargets = enum 0 then + if (directedTargets = AttributeTargets.Assembly || directedTargets = AttributeTargets.Module) then + errorR(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElementUseDo(), mAttr)) + else + warning(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElement(), mAttr)) + + constrainedTargets + //------------------------------------------------------------------------- // TcAttribute* // *Ex means the function accepts attribute targets that must be explicit @@ -11302,24 +11371,13 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn let targetIndicator = synAttr.Target let isAppliedToGetterOrSetter = synAttr.AppliesToGetterAndSetter let mAttr = synAttr.Range - let typath, tyid = List.frontAndBack tycon - let tpenv = emptyUnscopedTyparEnv + let _, tyId = List.frontAndBack tycon let ad = env.eAccessRights // if we're checking an attribute that was applied directly to a getter or a setter, then // what we're really checking against is a method, not a property let attrTgt = if isAppliedToGetterOrSetter then ((attrTgt ^^^ AttributeTargets.Property) ||| AttributeTargets.Method) else attrTgt - let ty, tpenv = - let try1 n = - let tyid = mkSynId tyid.idRange n - let tycon = (typath @ [tyid]) - - match ResolveTypeLongIdent cenv.tcSink cenv.nameResolver ItemOccurrence.UseInAttribute OpenQualified env.eNameResEnv ad tycon TypeNameResolutionStaticArgsInfo.DefiniteEmpty PermitDirectReferenceToGeneratedType.No with - | Exception err -> raze err - | Result(tinstEnclosing, tcref, inst) -> success(TcTypeApp cenv NoNewTypars CheckCxs ItemOccurrence.UseInAttribute env tpenv mAttr tcref tinstEnclosing [] inst) - - ForceRaise ((try1 (tyid.idText + "Attribute")) |> otherwise (fun () -> (try1 tyid.idText))) - + let ty, tpenv = ResolveAttributeType cenv env mAttr tycon if not (IsTypeAccessible g cenv.amap mAttr ad ty) then errorR(Error(FSComp.SR.tcTypeIsInaccessible(), mAttr)) let tcref = tcrefOfAppTy g ty @@ -11330,53 +11388,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn | Some d, Some defines when not (List.contains d defines) -> [], false | _ -> - // REVIEW: take notice of inherited? - let validOn, _inherited = - let validOnDefault = 0x7fff - let inheritedDefault = true - if tcref.IsILTycon then - let tdef = tcref.ILTyconRawMetadata - let tref = g.attrib_AttributeUsageAttribute.TypeRef - - match TryDecodeILAttribute tref tdef.CustomAttrs with - | Some ([ILAttribElem.Int32 validOn ], named) -> - let inherited = - match List.tryPick (function "Inherited", _, _, ILAttribElem.Bool res -> Some res | _ -> None) named with - | None -> inheritedDefault - | Some x -> x - (validOn, inherited) - | Some ([ILAttribElem.Int32 validOn; ILAttribElem.Bool _allowMultiple; ILAttribElem.Bool inherited ], _) -> - (validOn, inherited) - | _ -> - (validOnDefault, inheritedDefault) - else - match (TryFindFSharpAttribute g g.attrib_AttributeUsageAttribute tcref.Attribs) with - | Some(Attrib(_, _, [ AttribInt32Arg validOn ], _, _, _, _)) -> - (validOn, inheritedDefault) - | Some(Attrib(_, _, [ AttribInt32Arg validOn - AttribBoolArg(_allowMultiple) - AttribBoolArg inherited], _, _, _, _)) -> - (validOn, inherited) - | Some _ -> - warning(Error(FSComp.SR.tcUnexpectedConditionInImportedAssembly(), mAttr)) - (validOnDefault, inheritedDefault) - | _ -> - (validOnDefault, inheritedDefault) - let attributeTargets = enum validOn &&& attrTgt - let directedTargets = - match targetIndicator with - | LongFormAttrTarget attrTarget -> attrTarget - | UnrecognizedLongAttrTarget attrTarget -> - errorR(Error(FSComp.SR.tcUnrecognizedAttributeTarget(), attrTarget.idRange)) - attributeTargets - | ShortFormAttributeTarget -> attributeTargets &&& ~~~ attrEx - - let constrainedTargets = attributeTargets &&& directedTargets - if constrainedTargets = enum 0 then - if (directedTargets = AttributeTargets.Assembly || directedTargets = AttributeTargets.Module) then - error(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElementUseDo(), mAttr)) - else - warning(Error(FSComp.SR.tcAttributeIsNotValidForLanguageElement(), mAttr)) + let constrainedTargets = CheckAttributeUsage g mAttr tcref attrTgt targetIndicator attrEx match ResolveObjectConstructor cenv.nameResolver env.DisplayEnv mAttr ad ty with | Exception _ when canFail = TcCanFail.IgnoreAllErrors || canFail = TcCanFail.IgnoreMemberResoutionError -> [ ], true @@ -11391,7 +11403,7 @@ and TcAttributeEx canFail (cenv: cenv) (env: TcEnv) attrTgt attrEx (synAttr: Syn match item with | Item.CtorGroup(methodName, minfos) -> let meths = minfos |> List.map (fun minfo -> minfo, None) - let afterResolution = ForNewConstructors cenv.tcSink env tyid.idRange methodName minfos + let afterResolution = ForNewConstructors cenv.tcSink env tyId.idRange methodName minfos let (expr, attributeAssignedNamedItems, _), _ = TcMethodApplication true cenv env tpenv None [] mAttr mAttr methodName None ad PossiblyMutates false meths afterResolution NormalValUse [arg] (MustEqual ty) None [] diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fsi b/src/Compiler/Checking/Expressions/CheckExpressions.fsi index ed18b07a58a..5992a4afc95 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fsi +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fsi @@ -955,6 +955,8 @@ module AttributeTargets = val FieldDeclRestricted: AttributeTargets /// The allowed attribute targets for an F# union case declaration + /// - AttributeTargets.Method: union case with fields + /// - AttributeTargets.Property: union case with no fields val UnionCaseDecl: AttributeTargets /// The allowed attribute targets for an F# type declaration diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index e615d4ba336..9fa8bc73f30 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -402,6 +402,7 @@ type PhasedDiagnostic with | 3579 -> false // alwaysUseTypedStringInterpolation - off by default | 3582 -> false // infoIfFunctionShadowsUnionCase - off by default | 3570 -> false // tcAmbiguousDiscardDotLambda - off by default + | 3878 -> false // tcAttributeIsNotValidForUnionCaseWithFields - off by default | _ -> match x.Exception with | DiagnosticEnabledWithLanguageFeature(_, _, _, enabled) -> enabled diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index f1c65d5771e..78dde5bd148 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1806,4 +1806,5 @@ featureAllowLetOrUseBangTypeAnnotationWithoutParens,"Allow let! and use! type an 3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" 3875,lexWarnDirectiveMustHaveArgs,"Warn directives must have warning number(s) as argument(s)" 3876,lexWarnDirectivesMustMatch,"There is another %s for this warning already in line %d." -3877,lexLineDirectiveMappingIsNotUnique,"The file '%s' was also pointed to in a line directive in '%s'. Proper warn directive application may not be possible." \ No newline at end of file +3877,lexLineDirectiveMappingIsNotUnique,"The file '%s' was also pointed to in a line directive in '%s'. Proper warn directive application may not be possible." +3878,tcAttributeIsNotValidForUnionCaseWithFields,"This attribute is not valid for use on union cases with fields." \ No newline at end of file diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 397f1269c6d..bcd1c3fb0bd 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -1397,6 +1397,11 @@ Pole {0} se v tomto anonymním typu záznamu vyskytuje vícekrát. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Atributy nejde použít pro rozšíření typů. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index ca308ca9b13..0886b9ec60b 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -1397,6 +1397,11 @@ Das Feld "{0}" ist in diesem anonymen Datensatztyp mehrmals vorhanden. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Attribute können nicht auf Typerweiterungen angewendet werden. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 4b82afb40de..bdb43c5e1af 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -1397,6 +1397,11 @@ El campo "{0}" aparece varias veces en este tipo de registro anónimo. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Los atributos no se pueden aplicar a las extensiones de tipo. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 88b5c2c8f11..5344354b3ab 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -1397,6 +1397,11 @@ Le champ '{0}' apparaît plusieurs fois dans ce type d'enregistrement anonyme. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Impossible d'appliquer des attributs aux extensions de type. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index dc03b73e98a..ec472ee00b9 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -1397,6 +1397,11 @@ Il campo '{0}' viene visualizzato più volte in questo tipo di record anonimo. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Gli attributi non possono essere applicati a estensioni di tipo. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 99644e44b11..8db04ab1625 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -1397,6 +1397,11 @@ この匿名レコードの種類に、フィールド '{0}' が複数回出現します。 + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. 属性を型拡張に適用することはできません。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index cd439a93768..a17460ee156 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -1397,6 +1397,11 @@ '{0}' 필드가 이 익명 레코드 형식에서 여러 번 나타납니다. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. 형식 확장에 특성을 적용할 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index f50063b24f1..94416cfb231 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -1397,6 +1397,11 @@ Pole „{0}” występuje wielokrotnie w tym anonimowym typie rekordu. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Atrybutów nie można stosować do rozszerzeń typu. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 1e60a4d33b3..99709def4e0 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -1397,6 +1397,11 @@ O campo '{0}' aparece várias vezes nesse tipo de registro anônimo. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Os atributos não podem ser aplicados às extensões de tipo. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index b1592085f5c..e1e97fdf67e 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -1397,6 +1397,11 @@ Поле "{0}" появляется несколько раз в этом типе анонимной записи. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Атрибуты не могут быть применены к расширениям типа. diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 3ea96d4b85e..cff0f89ef17 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -1397,6 +1397,11 @@ '{0}' alanı bu anonim kayıt türünde birden fazla yerde görünüyor. + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. Öznitelikler tür uzantılarına uygulanamaz. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index cdc91d51daa..5ce3ac9c822 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -1397,6 +1397,11 @@ 字段“{0}”在此匿名记录类型中多次出现。 + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. 属性不可应用于类型扩展。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 99dd36c34bc..ae4eeed6b13 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -1397,6 +1397,11 @@ 欄位 '{0}' 在這個匿名記錄類型中出現多次。 + + This attribute is not valid for use on union cases with fields. + This attribute is not valid for use on union cases with fields. + + Attributes cannot be applied to type extensions. 屬性無法套用到類型延伸模組。 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs index f027745b73e..b0fa891d2b7 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs @@ -64,6 +64,7 @@ module CustomAttributes_AttributeUsage = let ``AttributeTargetsIsMethod01_fs 8.0`` compilation = compilation |> withLangVersion80 + |> withWarnOn 3878 |> verifyCompileAndRun |> shouldSucceed @@ -74,6 +75,15 @@ module CustomAttributes_AttributeUsage = |> verifyCompileAndRun |> shouldSucceed + // SOURCE=AttributeTargetsIsMethod01.fs # AttributeTargetsIsMethod01.fs + [] + let ``Preview: AttributeTargetsIsMethod01_fs opt-in warning`` compilation = + compilation + |> withLangVersionPreview + |> withWarnOn 3878 + |> verifyCompileAndRun + |> shouldSucceed + // SOURCE=AttributeTargetsIsProperty.fs # AttributeTargetsIsProperty.fs [] let ``AttributeTargetsIsProperty_fs 8.0`` compilation = @@ -483,6 +493,18 @@ module CustomAttributes_AttributeUsage = |> withDiagnostics [ (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") ] + + // SOURCE=E_AttributeTargetIsField03.fs # E_AttributeTargetIsField03.fs + [] + let ``E_AttributeTargetIsField03_fs opt-in warning`` compilation = + compilation + |> withLangVersion90 + |> withWarnOn 3878 + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") + ] // SOURCE=E_AttributeTargetIsField03.fs # E_AttributeTargetIsField03.fs [] @@ -493,7 +515,20 @@ module CustomAttributes_AttributeUsage = |> shouldFail |> withDiagnostics [ (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element") - (Warning 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") + ] + + // SOURCE=E_AttributeTargetIsField03.fs # E_AttributeTargetIsField03.fs + [] + let ``Preview: E_AttributeTargetIsField03_fs opt-in warning`` compilation = + compilation + |> withLangVersionPreview + |> withWarnOn 3878 + |> verifyCompile + |> shouldFail + |> withDiagnostics [ + (Warning 842, Line 14, Col 5, Line 14, Col 15, "This attribute is not valid for use on this language element"); + (Warning 3878, Line 14, Col 18, Line 14, Col 23, "This attribute is not valid for use on union cases with fields."); + (Warning 3878, Line 15, Col 28, Line 15, Col 33, "This attribute is not valid for use on union cases with fields.") ] // SOURCE=E_AttributeTargetIsProperty01.fs # E_AttributeTargetIsField03.fs @@ -510,11 +545,7 @@ module CustomAttributes_AttributeUsage = compilation |> withLangVersionPreview |> verifyCompile - |> shouldFail - |> withDiagnostics [ - (Warning 842, Line 14, Col 5, Line 14, Col 18, "This attribute is not valid for use on this language element") - (Warning 842, Line 15, Col 5, Line 15, Col 25, "This attribute is not valid for use on this language element") - ] + |> shouldSucceed // SOURCE=E_AttributeTargetIsCtor01.fs # E_AttributeTargetIsCtor01.fs [] From f853482e645b094d5a025851454eca924b09c337 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 02:51:30 +0000 Subject: [PATCH 129/134] [main] Update dependencies from dotnet/msbuild (#18612) * Update dependencies from https://github.com/dotnet/msbuild build 20250526.10 Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.26 -> To Version 17.15.0-preview-25276-10 * Update dependencies from https://github.com/dotnet/msbuild build 20250527.8 Microsoft.Build , Microsoft.Build.Framework , Microsoft.Build.Tasks.Core , Microsoft.Build.Utilities.Core From Version 17.13.26 -> To Version 17.15.0-preview-25277-08 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Tomas Grosup --- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d3b319f6713..d830fcc959a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,21 +1,21 @@ - + https://github.com/dotnet/msbuild - 15d19b96cf826b99925c8e5fd75575f46c60dd4a + 6de64741f6440bb6730d9a342934ce49d600fcc9 - + https://github.com/dotnet/msbuild - 15d19b96cf826b99925c8e5fd75575f46c60dd4a + 6de64741f6440bb6730d9a342934ce49d600fcc9 - + https://github.com/dotnet/msbuild - 15d19b96cf826b99925c8e5fd75575f46c60dd4a + 6de64741f6440bb6730d9a342934ce49d600fcc9 - + https://github.com/dotnet/msbuild - 15d19b96cf826b99925c8e5fd75575f46c60dd4a + 6de64741f6440bb6730d9a342934ce49d600fcc9 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 6a4b6813d2f..51a79f9d12e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -103,7 +103,7 @@ 17.14.79 17.14.40254 17.14.15 - 17.15.0-preview-25276-10 + 17.15.0-preview-25278-01 $(RoslynVersion) $(RoslynVersion) @@ -139,9 +139,9 @@ 15.0.25123-Dev15Preview - 17.15.0-preview-25276-10 - 17.15.0-preview-25276-10 - 17.15.0-preview-25276-10 + 17.15.0-preview-25278-01 + 17.15.0-preview-25278-01 + 17.15.0-preview-25278-01 $(VisualStudioEditorPackagesVersion) From c80ecabe64fb56c5d40973f381ef2a62305d198c Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 29 May 2025 08:44:43 +0200 Subject: [PATCH 130/134] Update commands.yml (#18630) --- .github/workflows/commands.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commands.yml b/.github/workflows/commands.yml index 5d5d97fb146..328e7c1c889 100644 --- a/.github/workflows/commands.yml +++ b/.github/workflows/commands.yml @@ -9,7 +9,7 @@ on: permissions: contents: write issues: write - pull-requests: write + pull-requests: read jobs: cleanup_old_runs: @@ -95,7 +95,7 @@ jobs: git commit -a -m 'Automated command ran: ${{ steps.command-extractor.outputs.result }} Co-authored-by: ${{ github.event.comment.user.login }} <${{ github.event.comment.user.id }}+${{ github.event.comment.user.login }}@users.noreply.github.com>' - git push + git push origin HEAD:"refs/heads/$PR_HEAD_REF"\ - name: Post command comment if: steps.fantomas.outcome == 'success' || steps.xlf.outcome == 'success' || steps.ilverify.outcome == 'success' uses: actions/github-script@v3 From 942de6083619d8e5c1c3443d65dd9c6fc707661b Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 29 May 2025 08:52:04 +0200 Subject: [PATCH 131/134] Update copilot-instructions.md (#18622) --- .github/copilot-instructions.md | 47 +++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 117da7b8afc..80e2c97c4eb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,20 +1,51 @@ # GitHub Copilot Instructions for F# Compiler -## Language and Environment +## Build and test steps (Linux) + +Always build and test the project before submitting your solution. + +1. As an initial smoke test for a quick build, run `dotnet build ./FSharp.Compiler.Service.sln --verbosity quiet` from the repository root. +Only if this succeeds, move on. +2. From the repository root, run `./build.sh -c Release --norestore`. This creates a prototype compiler, and then the proto compiler builds itself again. +3. Only if two previous steps suceed, run automated tests with `./build.sh -c Release --testcoreclr --norestore`. + + +If the build fails with errors or non-zero exit code, fix it based on the error messages given and repeat the build step. + +If either of the steps 1/2/3 fails, fix the errors and repeat from step 1 - up to 3 times. +After that, report all relevant build errors, error messages and specific details about failing tests and their test test failure details. + +### Fixing tests + +- If any of the tests fail: Check if the test, test expectation (either inline in the test or a reference file configured for the test) or implementation needs updating, and fix it +- If you see test failures for Surface area baselines: Refer to "Updating FCS surface area baselines" in devguide.md +- If you see test failures for IL baselines: Refer to "Updating ILVerify baselines" in devguide.md + + +## Acceptance criteria + +- Code is formatted using `dotnet fantomas .` executed at the repo root. +- Builds without errors. +- Runs tests without errors. If some tests needed adjustments, those test expectations/baseline adjustments were done. +- If the acceptance criteria was not met, collect the error messages (build failures or failing tests) and report them. + +## Coding standards + +### Language and Environment - Use modern F# with functional-first approach - Target .NET Standard 2.0 for compatibility - Avoid external dependencies - the codebase is self-contained -## Code Style and Standards -- Follow [coding standards](docs/coding-standards.md), especially: +### Code Style and Standards +- Follow docs/coding-standards.md, especially: - Prefer immutability and pure functions - Use consistent naming (see abbreviation guide) - Process complex types recursively with pattern matching - Avoid single-character identifiers except in established patterns - This project uses .fsi signature files. When adding a new public API to a namespace/module which will be consumed from other file, add it to the respective .fsi signature file as well -- Follow [overview](docs/overview.md) for key compiler data formats and representations +- Follow docs/overview.md for key compiler data formats and representations -## Type System Handling +### Type System Handling - When working with `TType` instances, use appropriate stripping functions: - `stripTyparEqns` - Removes inference equations from type parameters - `stripTyEqns` - Removes type equations and type abbreviations @@ -22,13 +53,13 @@ - Match the appropriate stripper to the context (e.g., display vs compilation) - Check equality with `typeEquiv` after stripping rather than direct comparison -## Core Data Structures +### Core Data Structures - Use F# discriminated unions for type representations - Respect representation hiding through access control - Use `remapX` functions when transforming types across boundaries - Be aware of performance implications for recursive type operations -## Documentation and Naming +### Documentation and Naming - Document public APIs with XML comments - Use descriptive function names that indicate transformation direction -- Follow established naming conventions in error messages +- Follow established naming conventions for error messages based on FSComp.txt file. Put all error messages into the FSComp.txt file to ensure localisation From 567e53f4b3e5d8661af1863186d0b3e4822e70ee Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Thu, 29 May 2025 02:53:22 -0400 Subject: [PATCH 132/134] More `string` optimizations (#18546) This special-casing allows us to update FSharp.Core to avoid boxing when caling the `string` function on enums and signed integral types going forward while still allowing the updated version of FSharp.Core to be fully compatible with older compilers. Adding support for some form of constraint in library-only static optimizations instead would have been problematic for multiple reasons. Supporting something like `when 'T : enum<'U>` would have required additional modifications to the compiler and would not have been consumable by older compilers. It would also introduce a new type variable. While something like `when 'T : 'T & #Enum` is already syntactically valid, it would add that constraint to the entire `string` function without further modification to the typechecker. It would also not be consumable by older compilers. I think adding a special case for enums is justifiable since (1) enums are a special kind of type to begin with, and (2) static optimization constraints are only allowed in FSharp.Core, so the change to the language itself is quite small. --- .../.FSharp.Compiler.Service/10.0.100.md | 4 + docs/release-notes/.FSharp.Core/10.0.100.md | 4 +- src/Compiler/TypedTree/TcGlobals.fs | 2 + src/Compiler/TypedTree/TcGlobals.fsi | 2 + src/Compiler/TypedTree/TypedTreeOps.fs | 16 +- src/FSharp.Core/prim-types.fs | 61 +- src/FSharp.Core/prim-types.fsi | 16 +- tests/AheadOfTime/Trimming/check.ps1 | 2 +- .../Nullness/ReferenceDU.fs.il.net472.bsl | 40 +- .../Nullness/ReferenceDU.fs.il.netcore.bsl | 40 +- .../StaticOptimizations.fs | 26 + .../StaticOptimizations/String_Enum.fs | 32 ++ .../StaticOptimizations/String_Enum.fs.il.bsl | 543 ++++++++++++++++++ .../String_SignedIntegralTypes.fs | 7 + .../String_SignedIntegralTypes.fs.il.bsl | 114 ++++ .../FSharp.Compiler.ComponentTests.fsproj | 1 + .../FSharp.Core/OperatorsModule2.fs | 48 +- ...y_FSharp.Compiler.Service_Debug_net9.0.bsl | 14 +- ....Compiler.Service_Debug_netstandard2.0.bsl | 14 +- ...FSharp.Compiler.Service_Release_net9.0.bsl | 2 +- ...ompiler.Service_Release_netstandard2.0.bsl | 2 +- 21 files changed, 900 insertions(+), 90 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index dbd8a890a7d..a3949c5b823 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -12,6 +12,10 @@ * Shorthand lambda: fix completion for chained calls and analysis for unfinished expression ([PR #18560](https://github.com/dotnet/fsharp/pull/18560)) * Completion: fix previous namespace considered opened [PR #18609](https://github.com/dotnet/fsharp/pull/18609) +### Added + +* Add support for `when 'T : Enum` library-only library-only static optimization constraint. ([PR #18546](https://github.com/dotnet/fsharp/pull/18546)) + ### Breaking Changes * 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)) diff --git a/docs/release-notes/.FSharp.Core/10.0.100.md b/docs/release-notes/.FSharp.Core/10.0.100.md index 1dc471ef118..10ff967c125 100644 --- a/docs/release-notes/.FSharp.Core/10.0.100.md +++ b/docs/release-notes/.FSharp.Core/10.0.100.md @@ -2,8 +2,10 @@ ### Added +* Enable more `string` optimizations by adding `when 'T : Enum` library-only library-only static optimization constraint. ([PR #18546](https://github.com/dotnet/fsharp/pull/18546)) + ### Changed * Random functions support for zero element chosen/sampled ([PR #18568](https://github.com/dotnet/fsharp/pull/18568)) -### Breaking Changes \ No newline at end of file +### Breaking Changes diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 93dd8905553..8f82eebc078 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1278,6 +1278,8 @@ type TcGlobals( member val ArrayCollector_tcr = mk_MFCompilerServices_tcref fslibCcu "ArrayCollector`1" + member val SupportsWhenTEnum_tcr = mk_MFCompilerServices_tcref fslibCcu "SupportsWhenTEnum" + member _.TryEmbedILType(tref: ILTypeRef, mkEmbeddableType: unit -> ILTypeDef) = if tref.Scope = ILScopeRef.Local && not(embeddedILTypeDefs.ContainsKey(tref.Name)) then embeddedILTypeDefs.TryAdd(tref.Name, mkEmbeddableType()) |> ignore diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index b8c3610ef91..f7a3ca11e0c 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -276,6 +276,8 @@ type internal TcGlobals = member ListCollector_tcr: FSharp.Compiler.TypedTree.EntityRef + member SupportsWhenTEnum_tcr: FSharp.Compiler.TypedTree.EntityRef + member MatchFailureException_tcr: FSharp.Compiler.TypedTree.EntityRef member ResumableCode_tcr: FSharp.Compiler.TypedTree.EntityRef diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index a1258657e78..b14dbd753b1 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -5801,11 +5801,23 @@ type StaticOptimizationAnswer = // ^T : ^T --> used in (+), (-) etc. to guard witness-invoking implementations added in F# 5 // 'T : 'T --> used in FastGenericEqualityComparer, FastGenericComparer to guard struct/tuple implementations // +// For performance and compatibility reasons, 'T when 'T is an enum is handled with its own special hack. +// Unlike for other 'T : tycon constraints, 'T can be any enum; it need not (and indeed must not) be identical to System.Enum itself. +// 'T : Enum +// +// In order to add this hack in a backwards-compatible way, we must hide this capability behind a marker type +// which we use solely as an indicator of whether the compiler understands `when 'T : Enum`. +// 'T : SupportsWhenTEnum +// // canDecideTyparEqn is set to true in IlxGen when the witness-invoking implementation can be used. let decideStaticOptimizationConstraint g c canDecideTyparEqn = match c with | TTyconEqualsTycon (a, b) when canDecideTyparEqn && typeEquiv g a b && isTyparTy g a -> - StaticOptimizationAnswer.Yes + StaticOptimizationAnswer.Yes + | TTyconEqualsTycon (_, b) when tryTcrefOfAppTy g b |> ValueOption.exists (tyconRefEq g g.SupportsWhenTEnum_tcr) -> + StaticOptimizationAnswer.Yes + | TTyconEqualsTycon (a, b) when isEnumTy g a && not (typeEquiv g a g.system_Enum_ty) && typeEquiv g b g.system_Enum_ty -> + StaticOptimizationAnswer.Yes | TTyconEqualsTycon (a, b) -> // Both types must be nominal for a definite result let rec checkTypes a b = @@ -5815,7 +5827,7 @@ let decideStaticOptimizationConstraint g c canDecideTyparEqn = let b = normalizeEnumTy g (stripTyEqnsAndMeasureEqns g b) match b with | AppTy g (tcref2, _) -> - if tyconRefEq g tcref1 tcref2 then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No + if tyconRefEq g tcref1 tcref2 && not (typeEquiv g a g.system_Enum_ty) then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No | RefTupleTy g _ | FunTy g _ -> StaticOptimizationAnswer.No | _ -> StaticOptimizationAnswer.Unknown diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index d9a7e41bf55..0fb2b87a06d 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -391,6 +391,20 @@ namespace Microsoft.FSharp.Core type TailCallAttribute() = inherit System.Attribute() +namespace Microsoft.FSharp.Core.CompilerServices + + open System.ComponentModel + open Microsoft.FSharp.Core + + /// + /// A marker type that only compilers that support the when 'T : Enum + /// library-only static optimization constraint will recognize. + /// + [] + [] + [] + type SupportsWhenTEnum = class end + #if !NET5_0_OR_GREATER namespace System.Diagnostics.CodeAnalysis @@ -5149,11 +5163,10 @@ namespace Microsoft.FSharp.Core when ^T : decimal = (# "conv.i" (int64 (# "" value : decimal #)) : unativeint #) when ^T : ^T = (^T : (static member op_Explicit: ^T -> nativeint) (value)) - [] - let inline string (value: 'T) = - anyToString "" value + let inline defaultString (value : 'T) = + anyToString "" value - when 'T : string = + when 'T : string = if value = unsafeDefault<'T> then "" else (# "" value : string #) // force no-op @@ -5170,10 +5183,9 @@ namespace Microsoft.FSharp.Core when 'T : nativeint = let x = (# "" value : nativeint #) in x.ToString() when 'T : unativeint = let x = (# "" value : unativeint #) in x.ToString() - // Integral types can be enum: - // It is not possible to distinguish statically between Enum and (any type of) int. For signed types we have - // to use IFormattable::ToString, as the minus sign can be overridden. Using boxing we'll print their symbolic - // value if it's an enum, e.g.: 'ConsoleKey.Backspace' gives "Backspace", rather than "8") + // These rules for signed integer types will no longer be used when built with a compiler version that + // supports `when 'T : Enum`, but we must keep them to remain compatible with compiler versions that do not. + // Once all compiler versions that do not understand `when 'T : Enum` are out of support, these four rules can be removed. when 'T : sbyte = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int16 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) when 'T : int32 = (box value :?> IFormattable).ToString(null, CultureInfo.InvariantCulture) @@ -5186,7 +5198,6 @@ namespace Microsoft.FSharp.Core when 'T : uint32 = let x = (# "" value : 'T #) in x.ToString() when 'T : uint64 = let x = (# "" value : 'T #) in x.ToString() - // other common mscorlib System struct types when 'T : DateTime = let x = (# "" value : DateTime #) in x.ToString(null, CultureInfo.InvariantCulture) when 'T : DateTimeOffset = let x = (# "" value : DateTimeOffset #) in x.ToString(null, CultureInfo.InvariantCulture) @@ -5206,6 +5217,38 @@ namespace Microsoft.FSharp.Core if value = unsafeDefault<'T> then "" else let x = (# "" value : IFormattable #) in defaultIfNull "" (x.ToString(null, CultureInfo.InvariantCulture)) + [] + let inline string (value: 'T) = + defaultString value + + // Only compilers that understand `when 'T : SupportsWhenTEnum` will understand `when 'T : Enum`. + when 'T : CompilerServices.SupportsWhenTEnum = + ( + let inline string (value : 'T) = + defaultString value + + // Special handling is required for enums, since: + // + // - The runtime value may be outside the defined members of the enum. + // - Their underlying type may be a signed integral type. + // - The negative sign may be overridden. + // + // For example: + // + // string DayOfWeek.Wednesday → "Wednesday" + // string (enum -3) → "-3" // The negative sign is culture-dependent. + // string (enum -3) → "⁒3" // E.g., the negative sign for the current culture could be overridden to "⁒". + when 'T : Enum = let x = (# "" value : 'T #) in x.ToString() // Use 'T to constrain the call to the specific enum type. + + // For compilers that understand `when 'T : Enum`, we can safely make a constrained call on the integral type itself here. + when 'T : sbyte = let x = (# "" value : sbyte #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : int16 = let x = (# "" value : int16 #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : int32 = let x = (# "" value : int32 #) in x.ToString(null, CultureInfo.InvariantCulture) + when 'T : int64 = let x = (# "" value : int64 #) in x.ToString(null, CultureInfo.InvariantCulture) + + string value + ) + [] [] let inline char (value: ^T) = diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index 7c2f171a600..6697e108d2c 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -994,6 +994,20 @@ namespace Microsoft.FSharp.Core inherit System.Attribute new : unit -> TailCallAttribute +namespace Microsoft.FSharp.Core.CompilerServices + + open System.ComponentModel + open Microsoft.FSharp.Core + + /// + /// A marker type that only compilers that support the when 'T : Enum + /// library-only static optimization constraint will recognize. + /// + [] + [] + [] + type SupportsWhenTEnum = class end + namespace System.Diagnostics.CodeAnalysis open System @@ -4772,7 +4786,7 @@ namespace Microsoft.FSharp.Core /// Converts the argument to a string using ToString. /// - /// For standard integer and floating point values and any type that implements IFormattable + /// For standard integer and floating point values and any type that implements IFormattable, /// ToString conversion uses CultureInfo.InvariantCulture. /// The input value. /// diff --git a/tests/AheadOfTime/Trimming/check.ps1 b/tests/AheadOfTime/Trimming/check.ps1 index 50a8a9e6422..f0aece70cd3 100644 --- a/tests/AheadOfTime/Trimming/check.ps1 +++ b/tests/AheadOfTime/Trimming/check.ps1 @@ -46,4 +46,4 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) { CheckTrim -root "SelfContained_Trimming_Test" -tfm "net9.0" -outputfile "FSharp.Core.dll" -expected_len 300032 # Check net8.0 trimmed assemblies -CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9150976 +CheckTrim -root "StaticLinkedFSharpCore_Trimming_Test" -tfm "net9.0" -outputfile "StaticLinkedFSharpCore_Trimming_Test.dll" -expected_len 9154048 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.net472.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.net472.bsl index fbb185005e8..63458b70509 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.net472.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.net472.bsl @@ -662,8 +662,9 @@ class MyTestModule/MyDu/JustInt V_2, int32 V_3, int32 V_4, - class MyTestModule/MyDu/MaybeString V_5, - string V_6) + int32 V_5, + class MyTestModule/MyDu/MaybeString V_6, + string V_7) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloc.0 @@ -677,7 +678,7 @@ IL_000f: ldloc.1 IL_0010: isinst MyTestModule/MyDu/MaybeString - IL_0015: brtrue.s IL_0048 + IL_0015: brtrue.s IL_0040 IL_0017: br.s IL_001b @@ -696,23 +697,22 @@ IL_002b: ldloc.3 IL_002c: stloc.s V_4 IL_002e: ldloc.s V_4 - IL_0030: box [runtime]System.Int32 - IL_0035: unbox.any [runtime]System.IFormattable - IL_003a: ldnull - IL_003b: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0040: tail. - IL_0042: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0047: ret - - IL_0048: ldloc.0 - IL_0049: castclass MyTestModule/MyDu/MaybeString - IL_004e: stloc.s V_5 - IL_0050: ldloc.s V_5 - IL_0052: ldfld string MyTestModule/MyDu/MaybeString::_nullableString - IL_0057: stloc.s V_6 - IL_0059: ldloc.s V_6 - IL_005b: ret + IL_0030: stloc.s V_5 + IL_0032: ldloca.s V_5 + IL_0034: ldnull + IL_0035: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_003a: call instance string [netstandard]System.Int32::ToString(string, + class [netstandard]System.IFormatProvider) + IL_003f: ret + + IL_0040: ldloc.0 + IL_0041: castclass MyTestModule/MyDu/MaybeString + IL_0046: stloc.s V_6 + IL_0048: ldloc.s V_6 + IL_004a: ldfld string MyTestModule/MyDu/MaybeString::_nullableString + IL_004f: stloc.s V_7 + IL_0051: ldloc.s V_7 + IL_0053: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl index 44ee6d4e2c8..423360aff64 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Nullness/ReferenceDU.fs.il.netcore.bsl @@ -662,8 +662,9 @@ class MyTestModule/MyDu/JustInt V_2, int32 V_3, int32 V_4, - class MyTestModule/MyDu/MaybeString V_5, - string V_6) + int32 V_5, + class MyTestModule/MyDu/MaybeString V_6, + string V_7) IL_0000: ldarg.0 IL_0001: stloc.0 IL_0002: ldloc.0 @@ -677,7 +678,7 @@ IL_000f: ldloc.1 IL_0010: isinst MyTestModule/MyDu/MaybeString - IL_0015: brtrue.s IL_0048 + IL_0015: brtrue.s IL_0040 IL_0017: br.s IL_001b @@ -696,23 +697,22 @@ IL_002b: ldloc.3 IL_002c: stloc.s V_4 IL_002e: ldloc.s V_4 - IL_0030: box [runtime]System.Int32 - IL_0035: unbox.any [runtime]System.IFormattable - IL_003a: ldnull - IL_003b: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() - IL_0040: tail. - IL_0042: callvirt instance string [netstandard]System.IFormattable::ToString(string, - class [netstandard]System.IFormatProvider) - IL_0047: ret - - IL_0048: ldloc.0 - IL_0049: castclass MyTestModule/MyDu/MaybeString - IL_004e: stloc.s V_5 - IL_0050: ldloc.s V_5 - IL_0052: ldfld string MyTestModule/MyDu/MaybeString::_nullableString - IL_0057: stloc.s V_6 - IL_0059: ldloc.s V_6 - IL_005b: ret + IL_0030: stloc.s V_5 + IL_0032: ldloca.s V_5 + IL_0034: ldnull + IL_0035: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_003a: call instance string [netstandard]System.Int32::ToString(string, + class [netstandard]System.IFormatProvider) + IL_003f: ret + + IL_0040: ldloc.0 + IL_0041: castclass MyTestModule/MyDu/MaybeString + IL_0046: stloc.s V_6 + IL_0048: ldloc.s V_6 + IL_004a: ldfld string MyTestModule/MyDu/MaybeString::_nullableString + IL_004f: stloc.s V_7 + IL_0051: ldloc.s V_7 + IL_0053: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs new file mode 100644 index 00000000000..d1099c27c20 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/StaticOptimizations.fs @@ -0,0 +1,26 @@ +namespace EmittedIL + +open FSharp.Test +open FSharp.Test.Compiler +open Xunit + +module StaticOptimizations = + let verifyCompilation compilation = + compilation + |> asExe + |> withEmbeddedPdb + |> withEmbedAllSource + |> ignoreWarnings + |> verifyILBaseline + + [] + let String_Enum_fs compilation = + compilation + |> getCompilation + |> verifyCompilation + + [] + let String_SignedIntegralTypes_fs compilation = + compilation + |> getCompilation + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs new file mode 100644 index 00000000000..ca952d71132 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs @@ -0,0 +1,32 @@ +open System + +module String = + type CharEnum = Char = 'a' + type SByteEnum = SByte = 1y + type Int16Enum = Int16 = 1s + type Int32Enum = Int32 = 1 + type Int64Enum = Int64 = 1L + + type ByteEnum = Byte = 1uy + type UInt16Enum = UInt16 = 1us + type UInt32Enum = UInt32 = 1u + type UInt64Enum = UInt64 = 1UL + + let ``string`` (enum : CharEnum) = string enum + let ``string`` (enum : SByteEnum) = string enum + let ``string`` (enum : Int16Enum) = string enum + let ``string`` (enum : Int32Enum) = string enum + let ``string`` (enum : Int64Enum) = string enum + + let ``string`` (enum : ByteEnum) = string enum + let ``string`` (enum : UInt16Enum) = string enum + let ``string`` (enum : UInt32Enum) = string enum + let ``string`` (enum : UInt64Enum) = string enum + + let ``string<#Enum>`` (enum : #Enum) = string enum + let ``string<'T :> Enum>`` (enum : 'T :> Enum) = string enum + + let ``string<'T when 'T : enum<'U>>`` (enum : 'T when 'T : enum<'U>) = string enum + let ``string<'T when 'T : enum>`` (enum : 'T when 'T : enum) = string enum + + let ``string Unchecked.defaultof`` () = string Unchecked.defaultof diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl new file mode 100644 index 00000000000..740505ce6a7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_Enum.fs.il.bsl @@ -0,0 +1,543 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public String + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class auto ansi serializable sealed nested public CharEnum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname char value__ + .field public static literal valuetype assembly/String/CharEnum Char = char(0x0061) + } + + .class auto ansi serializable sealed nested public SByteEnum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname int8 value__ + .field public static literal valuetype assembly/String/SByteEnum SByte = int8(0x01) + } + + .class auto ansi serializable sealed nested public Int16Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname int16 value__ + .field public static literal valuetype assembly/String/Int16Enum Int16 = int16(0x0001) + } + + .class auto ansi serializable sealed nested public Int32Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype assembly/String/Int32Enum Int32 = int32(0x00000001) + } + + .class auto ansi serializable sealed nested public Int64Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname int64 value__ + .field public static literal valuetype assembly/String/Int64Enum Int64 = int64(0x1) + } + + .class auto ansi serializable sealed nested public ByteEnum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname uint8 value__ + .field public static literal valuetype assembly/String/ByteEnum Byte = uint8(0x01) + } + + .class auto ansi serializable sealed nested public UInt16Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname uint16 value__ + .field public static literal valuetype assembly/String/UInt16Enum UInt16 = uint16(0x0001) + } + + .class auto ansi serializable sealed nested public UInt32Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname uint32 value__ + .field public static literal valuetype assembly/String/UInt32Enum UInt32 = uint32(0x00000001) + } + + .class auto ansi serializable sealed nested public UInt64Enum + extends [runtime]System.Enum + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field public specialname rtspecialname uint64 value__ + .field public static literal valuetype assembly/String/UInt64Enum UInt64 = uint64(0x1) + } + + .method public static string 'string'(valuetype assembly/String/CharEnum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/CharEnum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/CharEnum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/SByteEnum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/SByteEnum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/SByteEnum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/Int16Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/Int16Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int16Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/Int32Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/Int32Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int32Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/Int64Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/Int64Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/Int64Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/ByteEnum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/ByteEnum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/ByteEnum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/UInt16Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/UInt16Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/UInt16Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/UInt32Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/UInt32Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/UInt32Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string'(valuetype assembly/String/UInt64Enum 'enum') cil managed + { + + .maxstack 3 + .locals init (valuetype assembly/String/UInt64Enum V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. assembly/String/UInt64Enum + IL_000a: callvirt instance string [netstandard]System.Object::ToString() + IL_000f: ret + } + + .method public static string 'string<#Enum>'<([runtime]System.Enum) a>(!!a 'enum') cil managed + { + + .maxstack 5 + .locals init (object V_0, + class [runtime]System.IFormattable V_1, + string V_2, + !!a V_3) + IL_0000: ldarg.0 + IL_0001: box !!a + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: isinst [runtime]System.IFormattable + IL_000d: brtrue.s IL_0014 + + IL_000f: ldloc.0 + IL_0010: brfalse.s IL_0033 + + IL_0012: br.s IL_0039 + + IL_0014: ldloc.0 + IL_0015: unbox.any [runtime]System.IFormattable + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldnull + IL_001d: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0022: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0027: stloc.2 + IL_0028: ldloc.2 + IL_0029: brtrue.s IL_0031 + + IL_002b: ldstr "" + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: ret + + IL_0033: ldstr "" + IL_0038: ret + + IL_0039: ldarg.0 + IL_003a: stloc.3 + IL_003b: ldloca.s V_3 + IL_003d: constrained. !!a + IL_0043: callvirt instance string [netstandard]System.Object::ToString() + IL_0048: stloc.2 + IL_0049: ldloc.2 + IL_004a: brtrue.s IL_0052 + + IL_004c: ldstr "" + IL_0051: ret + + IL_0052: ldloc.2 + IL_0053: ret + } + + .method public static string 'string<\'T :> Enum>'<([runtime]System.Enum) T>(!!T 'enum') cil managed + { + + .maxstack 5 + .locals init (object V_0, + class [runtime]System.IFormattable V_1, + string V_2, + !!T V_3) + IL_0000: ldarg.0 + IL_0001: box !!T + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: isinst [runtime]System.IFormattable + IL_000d: brtrue.s IL_0014 + + IL_000f: ldloc.0 + IL_0010: brfalse.s IL_0033 + + IL_0012: br.s IL_0039 + + IL_0014: ldloc.0 + IL_0015: unbox.any [runtime]System.IFormattable + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldnull + IL_001d: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0022: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0027: stloc.2 + IL_0028: ldloc.2 + IL_0029: brtrue.s IL_0031 + + IL_002b: ldstr "" + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: ret + + IL_0033: ldstr "" + IL_0038: ret + + IL_0039: ldarg.0 + IL_003a: stloc.3 + IL_003b: ldloca.s V_3 + IL_003d: constrained. !!T + IL_0043: callvirt instance string [netstandard]System.Object::ToString() + IL_0048: stloc.2 + IL_0049: ldloc.2 + IL_004a: brtrue.s IL_0052 + + IL_004c: ldstr "" + IL_0051: ret + + IL_0052: ldloc.2 + IL_0053: ret + } + + .method public static string 'string<\'T when \'T : enum<\'U>>'(!!T 'enum') cil managed + { + + .maxstack 5 + .locals init (object V_0, + class [runtime]System.IFormattable V_1, + string V_2, + !!T V_3) + IL_0000: ldarg.0 + IL_0001: box !!T + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: isinst [runtime]System.IFormattable + IL_000d: brtrue.s IL_0014 + + IL_000f: ldloc.0 + IL_0010: brfalse.s IL_0033 + + IL_0012: br.s IL_0039 + + IL_0014: ldloc.0 + IL_0015: unbox.any [runtime]System.IFormattable + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldnull + IL_001d: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0022: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0027: stloc.2 + IL_0028: ldloc.2 + IL_0029: brtrue.s IL_0031 + + IL_002b: ldstr "" + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: ret + + IL_0033: ldstr "" + IL_0038: ret + + IL_0039: ldarg.0 + IL_003a: stloc.3 + IL_003b: ldloca.s V_3 + IL_003d: constrained. !!T + IL_0043: callvirt instance string [netstandard]System.Object::ToString() + IL_0048: stloc.2 + IL_0049: ldloc.2 + IL_004a: brtrue.s IL_0052 + + IL_004c: ldstr "" + IL_0051: ret + + IL_0052: ldloc.2 + IL_0053: ret + } + + .method public static string 'string<\'T when \'T : enum>'(!!T 'enum') cil managed + { + + .maxstack 5 + .locals init (object V_0, + class [runtime]System.IFormattable V_1, + string V_2, + !!T V_3) + IL_0000: ldarg.0 + IL_0001: box !!T + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: isinst [runtime]System.IFormattable + IL_000d: brtrue.s IL_0014 + + IL_000f: ldloc.0 + IL_0010: brfalse.s IL_0033 + + IL_0012: br.s IL_0039 + + IL_0014: ldloc.0 + IL_0015: unbox.any [runtime]System.IFormattable + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldnull + IL_001d: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0022: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0027: stloc.2 + IL_0028: ldloc.2 + IL_0029: brtrue.s IL_0031 + + IL_002b: ldstr "" + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: ret + + IL_0033: ldstr "" + IL_0038: ret + + IL_0039: ldarg.0 + IL_003a: stloc.3 + IL_003b: ldloca.s V_3 + IL_003d: constrained. !!T + IL_0043: callvirt instance string [netstandard]System.Object::ToString() + IL_0048: stloc.2 + IL_0049: ldloc.2 + IL_004a: brtrue.s IL_0052 + + IL_004c: ldstr "" + IL_0051: ret + + IL_0052: ldloc.2 + IL_0053: ret + } + + .method public static string 'string Unchecked.defaultof'() cil managed + { + + .maxstack 5 + .locals init (class [runtime]System.Enum V_0, + object V_1, + class [runtime]System.IFormattable V_2, + string V_3, + class [runtime]System.Enum V_4) + IL_0000: ldnull + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: box [runtime]System.Enum + IL_0008: stloc.1 + IL_0009: ldloc.1 + IL_000a: isinst [runtime]System.IFormattable + IL_000f: brtrue.s IL_0016 + + IL_0011: ldloc.1 + IL_0012: brfalse.s IL_0035 + + IL_0014: br.s IL_003b + + IL_0016: ldloc.1 + IL_0017: unbox.any [runtime]System.IFormattable + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldnull + IL_001f: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0024: callvirt instance string [netstandard]System.IFormattable::ToString(string, + class [netstandard]System.IFormatProvider) + IL_0029: stloc.3 + IL_002a: ldloc.3 + IL_002b: brtrue.s IL_0033 + + IL_002d: ldstr "" + IL_0032: ret + + IL_0033: ldloc.3 + IL_0034: ret + + IL_0035: ldstr "" + IL_003a: ret + + IL_003b: ldloc.0 + IL_003c: stloc.s V_4 + IL_003e: ldloca.s V_4 + IL_0040: constrained. [runtime]System.Enum + IL_0046: callvirt instance string [netstandard]System.Object::ToString() + IL_004b: stloc.3 + IL_004c: ldloc.3 + IL_004d: brtrue.s IL_0055 + + IL_004f: ldstr "" + IL_0054: ret + + IL_0055: ldloc.3 + IL_0056: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs new file mode 100644 index 00000000000..984bc4a99f2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs @@ -0,0 +1,7 @@ +open System + +module String = + let ``string sbyte`` (value : sbyte) = string value + let ``string int16`` (value : int16) = string value + let ``string int32`` (value : int32) = string value + let ``string int64`` (value : int64) = string value diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl new file mode 100644 index 00000000000..c1470054a4d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/StaticOptimizations/String_SignedIntegralTypes.fs.il.bsl @@ -0,0 +1,114 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .class abstract auto ansi sealed nested public String + extends [runtime]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static string 'string sbyte'(int8 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.SByte::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret + } + + .method public static string 'string int16'(int16 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int16::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret + } + + .method public static string 'string int32'(int32 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int32::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret + } + + .method public static string 'string int64'(int64 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarga.s 'value' + IL_0002: ldnull + IL_0003: call class [netstandard]System.Globalization.CultureInfo [netstandard]System.Globalization.CultureInfo::get_InvariantCulture() + IL_0008: call instance string [netstandard]System.Int64::ToString(string, + class [netstandard]System.IFormatProvider) + IL_000d: ret + } + + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 2761c9d56bc..952624f9fcd 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -185,6 +185,7 @@ + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs index 3e0ea652746..358c155a3a8 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/OperatorsModule2.fs @@ -33,6 +33,11 @@ type TestFs0670Error<'T> = // See: https://github.com/dotnet/fsharp/issues/7958 Operators.string x +type CultureWithDifferentNegativeSign () as this = + inherit CultureInfo "" + do this.NumberFormat.NegativeSign <- "🙃" + override _.DisplayName = nameof CultureWithDifferentNegativeSign + type OperatorsModule2() = [] @@ -833,7 +838,6 @@ type OperatorsModule2() = [] member _.string() = - let result = Operators.string null Assert.AreEqual("", result) @@ -884,32 +888,36 @@ type OperatorsModule2() = Assert.AreEqual("", result) // Following tests ensure that InvariantCulture is used if type implements IFormattable - - // safe current culture, then switch culture - let currentCI = Thread.CurrentThread.CurrentCulture - Thread.CurrentThread.CurrentCulture <- CultureInfo.GetCultureInfo("de-DE") - // make sure the culture switch happened, and verify - let wrongResult = 123.456M.ToString() - Assert.AreEqual("123,456", wrongResult) + let runWithCulture culture f = + let currentCulture = Thread.CurrentThread.CurrentCulture + Thread.CurrentThread.CurrentCulture <- culture + try f () finally Thread.CurrentThread.CurrentCulture <- currentCulture - // test that culture has no influence on decimals with `string` - let correctResult = Operators.string 123.456M - Assert.AreEqual("123.456", correctResult) + let numbersAndDates () = + // make sure the culture switch happened, and verify + let wrongResult = 123.456M.ToString() + Assert.AreEqual("123,456", wrongResult) - // make sure that the German culture is indeed selected for DateTime - let dttm = DateTime(2020, 6, 23) - let wrongResult = dttm.ToString() - Assert.AreEqual("23.06.2020 00:00:00", wrongResult) + // test that culture has no influence on decimals with `string` + let correctResult = Operators.string 123.456M + Assert.AreEqual("123.456", correctResult) - // test that culture has no influence on DateTime types when used with `string` - let correctResult = Operators.string dttm - Assert.AreEqual("06/23/2020 00:00:00", correctResult) + // make sure that the German culture is indeed selected for DateTime + let dttm = DateTime(2020, 6, 23) + let wrongResult = dttm.ToString() + Assert.AreEqual("23.06.2020 00:00:00", wrongResult) - // reset the culture - Thread.CurrentThread.CurrentCulture <- currentCI + // test that culture has no influence on DateTime types when used with `string` + let correctResult = Operators.string dttm + Assert.AreEqual("06/23/2020 00:00:00", correctResult) + let enums () = + Assert.AreEqual("Wednesday", Operators.string DayOfWeek.Wednesday) + Assert.AreEqual($"%s{Thread.CurrentThread.CurrentCulture.NumberFormat.NegativeSign}1", Operators.string (enum -1)) + numbersAndDates |> runWithCulture (CultureInfo.GetCultureInfo "de-DE") + enums |> runWithCulture (CultureWithDifferentNegativeSign ()) [] member _.``string: don't raise FS0670 anymore``() = diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 0cdc4d8a63e..ddc350b30c8 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -21,14 +21,14 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x00000082][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-811::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. @@ -54,7 +54,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+PortablePdbGenerator::serializeDocumentName(string)][offset 0x00000090][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x00000799][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000007A3][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4445::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x00000021][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 4fcd5d91990..239ffc5ea9a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -28,18 +28,18 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.CodeAnalysis.Hosted.CompilerHelpers::fscCompile([FSharp.Compiler.Service]FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, string, string[])][offset 0x0000008B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiStdinSyphon::GetLine(string, int32)][offset 0x00000039][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-811::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor::CompletionsForPartialLID([FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompilerState, string)][offset 0x0000001B][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@924-515::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. @@ -74,7 +74,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+PortablePdbGenerator::serializeDocumentName(string)][offset 0x00000090][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILPdbWriter+pushShadowedLocals@959::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000232][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadUntaggedIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.BinaryConstants+TableName, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32&)][offset 0x0000000D][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x00000799][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000007A3][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+rowKindSize@4445::Invoke([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+RowKind)][offset 0x00000128][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.NativeRes+VersionHelper::TryParse(string, bool, uint16, bool, [S.P.CoreLib]System.Version&)][offset 0x0000003D][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.IL::parseILVersion(string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index fdc1720553c..cdd91d6dfee 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -75,7 +75,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000058][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadGenericParamConstraintIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32)][offset 0x00000025][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4446(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006BF][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006B6][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadInterfaceImpls@2263-3::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadGenericParamConstraints@2328-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+enclIdx@2357-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index e12c9acca1d..f0ae4b53b2f 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -96,7 +96,7 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadNestedRowUncached([FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1>, int32)][offset 0x00000058][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::seekReadGenericParamConstraintIdx([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+ILMetadataReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, int32)][offset 0x00000025][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::rowKindSize$cont@4446(bool, bool, bool, bool[], bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, bool, [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x000000E5][found Byte] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006BF][found Boolean] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader::openMetadataReader(string, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+BinaryFile, int32, [S.P.CoreLib]System.Tuple`8,bool,bool,bool,bool,bool,System.Tuple`5,bool,int32,int32,int32>>, [FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.ILBinaryReader+PEReader, [FSharp.Compiler.Service]FSharp.Compiler.IO.ReadOnlyByteMemory, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1, bool)][offset 0x000006B6][found Boolean] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadInterfaceImpls@2263-3::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+seekReadGenericParamConstraints@2328-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.AbstractIL.ILBinaryReader+enclIdx@2357-2::Invoke(int32)][offset 0x0000002F][found Byte] Unexpected type on the stack. From 58696a6e32ee8c79ca9e01e73f4f25a2a2598767 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Thu, 29 May 2025 12:36:20 +0200 Subject: [PATCH 133/134] Update copilot-instructions.md - include norestore (#18632) --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 80e2c97c4eb..5fd82f89590 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,7 +4,7 @@ Always build and test the project before submitting your solution. -1. As an initial smoke test for a quick build, run `dotnet build ./FSharp.Compiler.Service.sln --verbosity quiet` from the repository root. +1. As an initial smoke test for a quick build, run `dotnet build ./FSharp.Compiler.Service.sln --verbosity quiet --no-restore` from the repository root. Only if this succeeds, move on. 2. From the repository root, run `./build.sh -c Release --norestore`. This creates a prototype compiler, and then the proto compiler builds itself again. 3. Only if two previous steps suceed, run automated tests with `./build.sh -c Release --testcoreclr --norestore`. From d0196df00e89456abe5fc4330b0426ef3821995a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 14:30:47 +0000 Subject: [PATCH 134/134] [main] Update dependencies from dotnet/arcade (#18614) * Update dependencies from https://github.com/dotnet/arcade build 20250521.2 Microsoft.DotNet.Arcade.Sdk From Version 9.0.0-beta.25271.1 -> To Version 10.0.0-beta.25271.2 * Remove obsolete infra * PR builds - without publish --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Viktor Hofer Co-authored-by: Tomas Grosup Co-authored-by: Tomas Grosup --- azure-pipelines-PR.yml | 14 +- eng/CIBuildNoPublish.cmd | 2 + eng/DotNetBuild.props | 40 --- eng/Version.Details.xml | 4 +- eng/common/CIBuild.cmd | 2 +- eng/common/build.ps1 | 8 +- eng/common/build.sh | 19 +- eng/common/cibuild.sh | 2 +- eng/common/core-templates/job/job.yml | 42 +-- .../job/publish-build-assets.yml | 31 +- .../core-templates/job/source-build.yml | 5 +- .../job/source-index-stage1.yml | 47 +-- .../core-templates/jobs/codeql-build.yml | 1 - eng/common/core-templates/jobs/jobs.yml | 12 +- .../core-templates/jobs/source-build.yml | 2 +- .../core-templates/post-build/post-build.yml | 15 +- .../steps/cleanup-microbuild.yml | 28 ++ .../core-templates/steps/generate-sbom.yml | 2 +- .../steps/get-delegation-sas.yml | 11 +- .../steps/install-microbuild.yml | 50 +++ .../core-templates/steps/publish-logs.yml | 3 + .../core-templates/steps/source-build.yml | 83 +---- .../steps/source-index-stage1-publish.yml | 35 ++ eng/common/cross/arm64/tizen/tizen.patch | 2 +- eng/common/cross/armel/armel.jessie.patch | 43 --- eng/common/cross/build-android-rootfs.sh | 49 ++- eng/common/cross/build-rootfs.sh | 233 +++++++----- eng/common/cross/install-debs.py | 334 ++++++++++++++++++ eng/common/cross/tizen-fetch.sh | 9 +- eng/common/cross/toolchain.cmake | 82 ++--- eng/common/darc-init.sh | 2 +- eng/common/native/install-dependencies.sh | 62 ++++ eng/common/post-build/publish-using-darc.ps1 | 12 +- eng/common/sdk-task.ps1 | 9 +- eng/common/sdk-task.sh | 116 ++++++ eng/common/sdl/packages.config | 2 +- eng/common/templates-official/job/job.yml | 4 +- .../steps/publish-build-artifacts.yml | 7 +- .../steps/source-index-stage1-publish.yml | 7 + eng/common/templates/job/job.yml | 4 +- .../steps/publish-build-artifacts.yml | 8 +- .../steps/source-index-stage1-publish.yml | 7 + eng/common/templates/steps/vmr-sync.yml | 207 +++++++++++ eng/common/templates/vmr-build-pr.yml | 33 ++ eng/common/tools.ps1 | 25 +- eng/common/tools.sh | 30 +- eng/common/vmr-sync.ps1 | 138 ++++++++ eng/common/vmr-sync.sh | 205 +++++++++++ global.json | 2 +- proto.proj | 5 +- 50 files changed, 1603 insertions(+), 492 deletions(-) create mode 100644 eng/CIBuildNoPublish.cmd delete mode 100644 eng/DotNetBuild.props create mode 100644 eng/common/core-templates/steps/cleanup-microbuild.yml create mode 100644 eng/common/core-templates/steps/install-microbuild.yml create mode 100644 eng/common/core-templates/steps/source-index-stage1-publish.yml delete mode 100644 eng/common/cross/armel/armel.jessie.patch create mode 100644 eng/common/cross/install-debs.py create mode 100644 eng/common/native/install-dependencies.sh create mode 100644 eng/common/sdk-task.sh create mode 100644 eng/common/templates-official/steps/source-index-stage1-publish.yml create mode 100644 eng/common/templates/steps/source-index-stage1-publish.yml create mode 100644 eng/common/templates/steps/vmr-sync.yml create mode 100644 eng/common/templates/vmr-build-pr.yml create mode 100644 eng/common/vmr-sync.ps1 create mode 100644 eng/common/vmr-sync.sh diff --git a/azure-pipelines-PR.yml b/azure-pipelines-PR.yml index d73955cdb18..4e7c4394b1b 100644 --- a/azure-pipelines-PR.yml +++ b/azure-pipelines-PR.yml @@ -230,7 +230,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:FSharpLangVersion=preview + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:FSharpLangVersion=preview env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -270,7 +270,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -buildnorealsig -testCoreclr -configuration Release env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -322,7 +322,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -372,7 +372,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation+ + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation+ env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -408,7 +408,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation- + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release /p:AdditionalFscCmdFlags=--strict-indentation- env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -482,7 +482,7 @@ stages: displayName: Setup VS Hive condition: eq(variables.setupVsHive, 'true') - - script: eng\CIBuild.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration $(_configuration) -$(_testKind) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. @@ -560,7 +560,7 @@ stages: - checkout: self clean: true - - script: eng\CIBuild.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) + - script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase) env: DOTNET_DbgEnableMiniDump: 1 DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing. diff --git a/eng/CIBuildNoPublish.cmd b/eng/CIBuildNoPublish.cmd new file mode 100644 index 00000000000..8a38abfc51e --- /dev/null +++ b/eng/CIBuildNoPublish.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -noprofile -executionPolicy RemoteSigned -file "%~dp0\Build.ps1" -ci -restore -build -bootstrap -pack -sign -binaryLog %* diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props deleted file mode 100644 index 8bdf6363873..00000000000 --- a/eng/DotNetBuild.props +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - fsharp - true - $(DotNetBuildOrchestrator) - false - false - - - - - - --tfm $(SourceBuildBootstrapTfm) - false - /p:RestoreConfigFile=$(RestoreConfigFile) - - - - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d830fcc959a..35da69f5a62 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -35,9 +35,9 @@ - + https://github.com/dotnet/arcade - 086a1771875b63404b4a710d27250fe384dc2810 + 12d3a9f5d6138e22270694574e73e4c58a815795 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index 56c2f25ac22..ac1f72bf94e 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,2 +1,2 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" \ No newline at end of file +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 438f9920c43..ae2309e312d 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -7,6 +7,7 @@ Param( [string] $msbuildEngine = $null, [bool] $warnAsError = $true, [bool] $nodeReuse = $true, + [switch] $buildCheck = $false, [switch][Alias('r')]$restore, [switch] $deployDeps, [switch][Alias('b')]$build, @@ -71,6 +72,8 @@ function Print-Usage() { Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." Write-Host " -excludePrereleaseVS Set to exclude build engines in prerelease versions of Visual Studio" Write-Host " -nativeToolsOnMachine Sets the native tools on machine environment variable (indicating that the script should use native tools on machine)" + Write-Host " -nodeReuse Sets nodereuse msbuild parameter ('true' or 'false')" + Write-Host " -buildCheck Sets /check msbuild parameter" Write-Host "" Write-Host "Command line arguments not listed above are passed thru to msbuild." @@ -97,6 +100,7 @@ function Build { $bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' } $platformArg = if ($platform) { "/p:Platform=$platform" } else { '' } + $check = if ($buildCheck) { '/check' } else { '' } if ($projects) { # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons. @@ -113,6 +117,7 @@ function Build { MSBuild $toolsetBuildProj ` $bl ` $platformArg ` + $check ` /p:Configuration=$configuration ` /p:RepoRoot=$RepoRoot ` /p:Restore=$restore ` @@ -122,11 +127,12 @@ function Build { /p:Deploy=$deploy ` /p:Test=$test ` /p:Pack=$pack ` - /p:DotNetBuildRepo=$productBuild ` + /p:DotNetBuild=$productBuild ` /p:IntegrationTest=$integrationTest ` /p:PerformanceTest=$performanceTest ` /p:Sign=$sign ` /p:Publish=$publish ` + /p:RestoreStaticGraphEnableBinaryLogger=$binaryLog ` @properties } diff --git a/eng/common/build.sh b/eng/common/build.sh index ac1ee8620cd..da906da2026 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -42,6 +42,7 @@ usage() echo " --prepareMachine Prepare machine for CI run, clean up processes after build" echo " --nodeReuse Sets nodereuse msbuild parameter ('true' or 'false')" echo " --warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" + echo " --buildCheck Sets /check msbuild parameter" echo "" echo "Command line arguments not listed above are passed thru to msbuild." echo "Arguments can also be passed in with a single hyphen." @@ -76,6 +77,7 @@ clean=false warn_as_error=true node_reuse=true +build_check=false binary_log=false exclude_ci_binary_log=false pipelines_log=false @@ -127,14 +129,14 @@ while [[ $# > 0 ]]; do -pack) pack=true ;; - -sourcebuild|-sb) + -sourcebuild|-source-build|-sb) build=true source_build=true product_build=true restore=true pack=true ;; - -productBuild|-pb) + -productbuild|-product-build|-pb) build=true product_build=true restore=true @@ -173,6 +175,9 @@ while [[ $# > 0 ]]; do node_reuse=$2 shift ;; + -buildcheck) + build_check=true + ;; -runtimesourcefeed) runtime_source_feed=$2 shift @@ -224,14 +229,19 @@ function Build { bl="/bl:\"$log_dir/Build.binlog\"" fi + local check="" + if [[ "$build_check" == true ]]; then + check="/check" + fi + MSBuild $_InitializeToolset \ $bl \ + $check \ /p:Configuration=$configuration \ /p:RepoRoot="$repo_root" \ /p:Restore=$restore \ /p:Build=$build \ - /p:DotNetBuildRepo=$product_build \ - /p:ArcadeBuildFromSource=$source_build \ + /p:DotNetBuild=$product_build \ /p:DotNetBuildSourceOnly=$source_build \ /p:Rebuild=$rebuild \ /p:Test=$test \ @@ -240,6 +250,7 @@ function Build { /p:PerformanceTest=$performance_test \ /p:Sign=$sign \ /p:Publish=$publish \ + /p:RestoreStaticGraphEnableBinaryLogger=$binary_log \ $properties ExitWithExitCode 0 diff --git a/eng/common/cibuild.sh b/eng/common/cibuild.sh index 1a02c0dec8f..66e3b0ac61c 100755 --- a/eng/common/cibuild.sh +++ b/eng/common/cibuild.sh @@ -13,4 +13,4 @@ while [[ -h $source ]]; do done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -. "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@ \ No newline at end of file +. "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@ diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index ba53ebfbd51..6badecba7bc 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -19,10 +19,10 @@ parameters: # publishing defaults artifacts: '' enableMicrobuild: false + enableMicrobuildForMacAndLinux: false enablePublishBuildArtifacts: false enablePublishBuildAssets: false enablePublishTestResults: false - enablePublishUsingPipelines: false enableBuildRetry: false mergeTestResults: false testRunTitle: '' @@ -73,9 +73,6 @@ jobs: - ${{ if ne(parameters.enableTelemetry, 'false') }}: - name: DOTNET_CLI_TELEMETRY_PROFILE value: '$(Build.Repository.Uri)' - - ${{ if eq(parameters.enableRichCodeNavigation, 'true') }}: - - name: EnableRichCodeNavigation - value: 'true' # Retry signature validation up to three times, waiting 2 seconds between attempts. # See https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu3028#retry-untrusted-root-failures - name: NUGET_EXPERIMENTAL_CHAIN_BUILD_RETRY_POLICY @@ -127,18 +124,11 @@ jobs: - ${{ preStep }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - task: MicroBuildSigningPlugin@4 - displayName: Install MicroBuild plugin - inputs: - signType: $(_SignType) - zipSources: false - feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json - env: - TeamName: $(_TeamName) - MicroBuildOutputFolderOverride: '$(Agent.TempDirectory)' + - template: /eng/common/core-templates/steps/install-microbuild.yml + parameters: + enableMicrobuild: ${{ parameters.enableMicrobuild }} + enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} continueOnError: ${{ parameters.continueOnError }} - condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) - ${{ if and(eq(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'internal')) }}: - task: NuGetAuthenticate@1 @@ -154,27 +144,15 @@ jobs: - ${{ each step in parameters.steps }}: - ${{ step }} - - ${{ if eq(parameters.enableRichCodeNavigation, true) }}: - - task: RichCodeNavIndexer@0 - displayName: RichCodeNav Upload - inputs: - languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }} - environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'internal') }} - richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin - uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }} - continueOnError: true - - ${{ each step in parameters.componentGovernanceSteps }}: - ${{ step }} - - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: MicroBuildCleanup@1 - displayName: Execute Microbuild cleanup tasks - condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/common/core-templates/steps/cleanup-microbuild.yml + parameters: + enableMicrobuild: ${{ parameters.enableMicrobuild }} + enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }} continueOnError: ${{ parameters.continueOnError }} - env: - TeamName: $(_TeamName) # Publish test results - ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}: diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 3d3356e3196..4f1dc42e02c 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -20,9 +20,6 @@ parameters: # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. runAsPublic: false - # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing - publishUsingPipelines: false - # Optional: whether the build's artifacts will be published using release pipelines or direct feed publishing publishAssetsImmediately: false @@ -32,6 +29,9 @@ parameters: is1ESPipeline: '' + # Optional: 🌤️ or not the build has assets it wants to publish to BAR + isAssetlessBuild: false + jobs: - job: Asset_Registry_Publish @@ -75,15 +75,15 @@ jobs: - checkout: self fetchDepth: 3 clean: true - - - task: DownloadBuildArtifacts@0 - displayName: Download artifact - inputs: - artifactName: AssetManifests - downloadPath: '$(Build.StagingDirectory)/Download' - checkDownloadedFiles: true - condition: ${{ parameters.condition }} - continueOnError: ${{ parameters.continueOnError }} + + - ${{ if eq(parameters.isAssetlessBuild, 'false') }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Asset Manifests + inputs: + artifactName: AssetManifests + targetPath: '$(Build.StagingDirectory)/AssetManifests' + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} - task: NuGetAuthenticate@1 @@ -95,9 +95,9 @@ jobs: scriptLocation: scriptPath scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet - /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' + /p:ManifestsPath='$(Build.StagingDirectory)/AssetManifests' + /p:IsAssetlessBuild=${{ parameters.isAssetlessBuild }} /p:MaestroApiEndpoint=https://maestro.dot.net - /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} @@ -129,7 +129,7 @@ jobs: publishLocation: Container artifactName: ReleaseConfigs - - ${{ if eq(parameters.publishAssetsImmediately, 'true') }}: + - ${{ if or(eq(parameters.publishAssetsImmediately, 'true'), eq(parameters.isAssetlessBuild, 'true')) }}: - template: /eng/common/core-templates/post-build/setup-maestro-vars.yml parameters: BARBuildId: ${{ parameters.BARBuildId }} @@ -150,6 +150,7 @@ jobs: -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + -SkipAssetsPublishing '${{ parameters.isAssetlessBuild }}' - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - template: /eng/common/core-templates/steps/publish-logs.yml diff --git a/eng/common/core-templates/job/source-build.yml b/eng/common/core-templates/job/source-build.yml index d47f09d58fd..d805d5faeb9 100644 --- a/eng/common/core-templates/job/source-build.yml +++ b/eng/common/core-templates/job/source-build.yml @@ -12,9 +12,10 @@ parameters: # The name of the job. This is included in the job ID. # targetRID: '' # The name of the target RID to use, instead of the one auto-detected by Arcade. - # nonPortable: false + # portableBuild: false # Enables non-portable mode. This means a more specific RID (e.g. fedora.32-x64 rather than - # linux-x64), and compiling against distro-provided packages rather than portable ones. + # linux-x64), and compiling against distro-provided packages rather than portable ones. The + # default is portable mode. # skipPublishValidation: false # Disables publishing validation. By default, a check is performed to ensure no packages are # published by source-build. diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 8b833332b3e..30530359a5d 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -1,8 +1,5 @@ parameters: runAsPublic: false - sourceIndexUploadPackageVersion: 2.0.0-20250425.2 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20250425.2 - sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] binlogPath: artifacts/log/Debug/Build.binlog @@ -16,12 +13,6 @@ jobs: dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.condition }} variables: - - name: SourceIndexUploadPackageVersion - value: ${{ parameters.sourceIndexUploadPackageVersion }} - - name: SourceIndexProcessBinlogPackageVersion - value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }} - - name: SourceIndexPackageSource - value: ${{ parameters.sourceIndexPackageSource }} - name: BinlogPath value: ${{ parameters.binlogPath }} - template: /eng/common/core-templates/variables/pool-providers.yml @@ -34,12 +25,10 @@ jobs: pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngPublicBuildPool) - image: 1es-windows-2022-open - os: windows + image: windows.vs2022.amd64.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: name: $(DncEngInternalBuildPool) - image: 1es-windows-2022 - os: windows + image: windows.vs2022.amd64 steps: - ${{ if eq(parameters.is1ESPipeline, '') }}: @@ -47,35 +36,9 @@ jobs: - ${{ each preStep in parameters.preSteps }}: - ${{ preStep }} - - - task: UseDotNet@2 - displayName: Use .NET 8 SDK - inputs: - packageType: sdk - version: 8.0.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - - script: | - $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - displayName: Download Tools - # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. - workingDirectory: $(Agent.TempDirectory) - - script: ${{ parameters.sourceIndexBuildCommand }} displayName: Build Repository - - script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i $(BinlogPath) -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output - displayName: Process Binlog into indexable sln - - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: AzureCLI@2 - displayName: Log in to Azure and upload stage1 artifacts to source index - inputs: - azureSubscription: 'SourceDotNet Stage1 Publish' - addSpnToEnvironment: true - scriptType: 'ps' - scriptLocation: 'inlineScript' - inlineScript: | - $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 + - template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + binLogPath: ${{ parameters.binLogPath }} \ No newline at end of file diff --git a/eng/common/core-templates/jobs/codeql-build.yml b/eng/common/core-templates/jobs/codeql-build.yml index f2144252cc6..693b00b3704 100644 --- a/eng/common/core-templates/jobs/codeql-build.yml +++ b/eng/common/core-templates/jobs/codeql-build.yml @@ -15,7 +15,6 @@ jobs: enablePublishBuildArtifacts: false enablePublishTestResults: false enablePublishBuildAssets: false - enablePublishUsingPipelines: false enableTelemetry: true variables: diff --git a/eng/common/core-templates/jobs/jobs.yml b/eng/common/core-templates/jobs/jobs.yml index ea69be4341c..bf35b78faa6 100644 --- a/eng/common/core-templates/jobs/jobs.yml +++ b/eng/common/core-templates/jobs/jobs.yml @@ -5,9 +5,6 @@ parameters: # Optional: Include PublishBuildArtifacts task enablePublishBuildArtifacts: false - # Optional: Enable publishing using release pipelines - enablePublishUsingPipelines: false - # Optional: Enable running the source-build jobs to build repo from source enableSourceBuild: false @@ -30,6 +27,9 @@ parameters: # Optional: Publish the assets as soon as the publish to BAR stage is complete, rather doing so in a separate stage. publishAssetsImmediately: false + # Optional: 🌤️ or not the build has assets it wants to publish to BAR + isAssetlessBuild: false + # Optional: If using publishAssetsImmediately and additional parameters are needed, can be used to send along additional parameters (normally sent to post-build.yml) artifactsPublishingAdditionalParameters: '' signingValidationAdditionalParameters: '' @@ -96,7 +96,7 @@ jobs: ${{ parameter.key }}: ${{ parameter.value }} - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if or(eq(parameters.enablePublishBuildAssets, true), eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: + - ${{ if or(eq(parameters.enablePublishBuildAssets, true), eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, ''), eq(parameters.isAssetlessBuild, true)) }}: - template: ../job/publish-build-assets.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} @@ -112,8 +112,8 @@ jobs: - Source_Build_Complete runAsPublic: ${{ parameters.runAsPublic }} - publishUsingPipelines: ${{ parameters.enablePublishUsingPipelines }} - publishAssetsImmediately: ${{ parameters.publishAssetsImmediately }} + publishAssetsImmediately: ${{ or(parameters.publishAssetsImmediately, parameters.isAssetlessBuild) }} + isAssetlessBuild: ${{ parameters.isAssetlessBuild }} enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} signingValidationAdditionalParameters: ${{ parameters.signingValidationAdditionalParameters }} diff --git a/eng/common/core-templates/jobs/source-build.yml b/eng/common/core-templates/jobs/source-build.yml index a10ccfbee6d..df24c948ba1 100644 --- a/eng/common/core-templates/jobs/source-build.yml +++ b/eng/common/core-templates/jobs/source-build.yml @@ -14,7 +14,7 @@ parameters: # This is the default platform provided by Arcade, intended for use by a managed-only repo. defaultManagedPlatform: name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64' # Defines the platforms on which to run build jobs. One job is created for each platform, and the # object in this array is sent to the job template as 'platform'. If no platforms are specified, diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index 454fd75c7af..a151fd811e3 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -44,6 +44,11 @@ parameters: displayName: Publish installers and checksums type: boolean default: true + + - name: requireDefaultChannels + displayName: Fail the build if there are no default channel(s) registrations for the current build + type: boolean + default: false - name: SDLValidationParameters type: object @@ -55,6 +60,11 @@ parameters: artifactNames: '' downloadArtifacts: true + - name: isAssetlessBuild + type: boolean + displayName: Is Assetless Build + default: false + # These parameters let the user customize the call to sdk-task.ps1 for publishing # symbols & general artifacts as well as for signing validation - name: symbolPublishingAdditionalParameters @@ -183,9 +193,6 @@ stages: buildId: $(AzDOBuildId) artifactName: PackageArtifacts checkDownloadedFiles: true - itemPattern: | - ** - !**/Microsoft.SourceBuild.Intermediate.*.nupkg # This is necessary whenever we want to publish/restore to an AzDO private feed # Since sdk-task.ps1 tries to restore packages we need to do this authentication here @@ -312,5 +319,7 @@ stages: -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true + -RequireDefaultChannels ${{ parameters.requireDefaultChannels }} -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' + -SkipAssetsPublishing '${{ parameters.isAssetlessBuild }}' diff --git a/eng/common/core-templates/steps/cleanup-microbuild.yml b/eng/common/core-templates/steps/cleanup-microbuild.yml new file mode 100644 index 00000000000..c0fdcd3379d --- /dev/null +++ b/eng/common/core-templates/steps/cleanup-microbuild.yml @@ -0,0 +1,28 @@ +parameters: + # Enable cleanup tasks for MicroBuild + enableMicrobuild: false + # Enable cleanup tasks for MicroBuild on Mac and Linux + # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' + enableMicrobuildForMacAndLinux: false + continueOnError: false + +steps: + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + - task: MicroBuildCleanup@1 + displayName: Execute Microbuild cleanup tasks + condition: and( + always(), + or( + and( + eq(variables['Agent.Os'], 'Windows_NT'), + in(variables['_SignType'], 'real', 'test') + ), + and( + ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, + ne(variables['Agent.Os'], 'Windows_NT'), + eq(variables['_SignType'], 'real') + ) + )) + continueOnError: ${{ parameters.continueOnError }} + env: + TeamName: $(_TeamName) diff --git a/eng/common/core-templates/steps/generate-sbom.yml b/eng/common/core-templates/steps/generate-sbom.yml index 56a09009482..44a9636cdff 100644 --- a/eng/common/core-templates/steps/generate-sbom.yml +++ b/eng/common/core-templates/steps/generate-sbom.yml @@ -5,7 +5,7 @@ # IgnoreDirectories - Directories to ignore for SBOM generation. This will be passed through to the CG component detector. parameters: - PackageVersion: 9.0.0 + PackageVersion: 10.0.0 BuildDropPath: '$(Build.SourcesDirectory)/artifacts' PackageName: '.NET' ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom diff --git a/eng/common/core-templates/steps/get-delegation-sas.yml b/eng/common/core-templates/steps/get-delegation-sas.yml index 9db5617ea7d..d2901470a7f 100644 --- a/eng/common/core-templates/steps/get-delegation-sas.yml +++ b/eng/common/core-templates/steps/get-delegation-sas.yml @@ -31,16 +31,7 @@ steps: # Calculate the expiration of the SAS token and convert to UTC $expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ") - # Temporarily work around a helix issue where SAS tokens with / in them will cause incorrect downloads - # of correlation payloads. https://github.com/dotnet/dnceng/issues/3484 - $sas = "" - do { - $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv - if ($LASTEXITCODE -ne 0) { - Write-Error "Failed to generate SAS token." - exit 1 - } - } while($sas.IndexOf('/') -ne -1) + $sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv if ($LASTEXITCODE -ne 0) { Write-Error "Failed to generate SAS token." diff --git a/eng/common/core-templates/steps/install-microbuild.yml b/eng/common/core-templates/steps/install-microbuild.yml new file mode 100644 index 00000000000..a3540ba00c7 --- /dev/null +++ b/eng/common/core-templates/steps/install-microbuild.yml @@ -0,0 +1,50 @@ +parameters: + # Enable install tasks for MicroBuild + enableMicrobuild: false + # Enable install tasks for MicroBuild on Mac and Linux + # Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT' + enableMicrobuildForMacAndLinux: false + # Location of the MicroBuild output folder + microBuildOutputFolder: '$(Build.SourcesDirectory)' + continueOnError: false + +steps: + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + - ${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}: + # Needed to download the MicroBuild plugin nupkgs on Mac and Linux when nuget.exe is unavailable + - task: UseDotNet@2 + displayName: Install .NET 8.0 SDK for MicroBuild Plugin + inputs: + packageType: sdk + version: 8.0.x + installationPath: ${{ parameters.microBuildOutputFolder }}/.dotnet + workingDirectory: ${{ parameters.microBuildOutputFolder }} + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + + - task: MicroBuildSigningPlugin@4 + displayName: Install MicroBuild plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + ${{ if and(eq(parameters.enableMicrobuildForMacAndLinux, 'true'), ne(variables['Agent.Os'], 'Windows_NT')) }}: + azureSubscription: 'MicroBuild Signing Task (DevDiv)' + useEsrpCli: true + env: + TeamName: $(_TeamName) + MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + continueOnError: ${{ parameters.continueOnError }} + condition: and( + succeeded(), + or( + and( + eq(variables['Agent.Os'], 'Windows_NT'), + in(variables['_SignType'], 'real', 'test') + ), + and( + ${{ eq(parameters.enableMicrobuildForMacAndLinux, true) }}, + ne(variables['Agent.Os'], 'Windows_NT'), + eq(variables['_SignType'], 'real') + ) + )) diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 80788c52319..de24d0087c5 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -34,7 +34,9 @@ steps: '$(akams-client-id)' '$(microsoft-symbol-server-pat)' '$(symweb-symbol-server-pat)' + '$(dnceng-symbol-server-pat)' '$(dn-bot-all-orgs-build-rw-code-rw)' + '$(System.AccessToken)' ${{parameters.CustomSensitiveDataList}} continueOnError: true condition: always() @@ -45,6 +47,7 @@ steps: SourceFolder: '$(Build.SourcesDirectory)/PostBuildLogs' Contents: '**' TargetFolder: '$(Build.ArtifactStagingDirectory)/PostBuildLogs' + condition: always() - template: /eng/common/core-templates/steps/publish-build-artifacts.yml parameters: diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index 37133b55b75..0dde553c3eb 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -19,25 +19,12 @@ steps: set -x df -h - # If file changes are detected, set CopyWipIntoInnerSourceBuildRepo to copy the WIP changes into the inner source build repo. - internalRestoreArgs= - if ! git diff --quiet; then - internalRestoreArgs='/p:CopyWipIntoInnerSourceBuildRepo=true' - # The 'Copy WIP' feature of source build uses git stash to apply changes from the original repo. - # This only works if there is a username/email configured, which won't be the case in most CI runs. - git config --get user.email - if [ $? -ne 0 ]; then - git config user.email dn-bot@microsoft.com - git config user.name dn-bot - fi - fi - # If building on the internal project, the internal storage variable may be available (usually only if needed) # In that case, add variables to allow the download of internal runtimes if the specified versions are not found # in the default public locations. internalRuntimeDownloadArgs= if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then - internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://dotnetbuilds.blob.core.windows.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' + internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://ci.dot.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://ci.dot.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)' fi buildConfig=Release @@ -46,85 +33,39 @@ steps: buildConfig='$(_BuildConfig)' fi - officialBuildArgs= - if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then - officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' - fi - targetRidArgs= if [ '${{ parameters.platform.targetRID }}' != '' ]; then targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi - publishArgs= - if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then - publishArgs='--publish' - fi - - assetManifestFileName=SourceBuild_RidSpecific.xml - if [ '${{ parameters.platform.name }}' != '' ]; then - assetManifestFileName=SourceBuild_${{ parameters.platform.name }}.xml + portableBuildArgs= + if [ '${{ parameters.platform.portableBuild }}' != '' ]; then + portableBuildArgs='/p:PortableBuild=${{ parameters.platform.portableBuild }}' fi ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ - --restore --build --pack $publishArgs -bl \ + --restore --build --pack -bl \ + --source-build \ ${{ parameters.platform.buildArguments }} \ - $officialBuildArgs \ $internalRuntimeDownloadArgs \ - $internalRestoreArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ - /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ - /p:ArcadeBuildFromSource=true \ - /p:DotNetBuildSourceOnly=true \ - /p:DotNetBuildRepo=true \ - /p:AssetManifestFileName=$assetManifestFileName + $baseRidArgs \ + $portableBuildArgs \ displayName: Build -# Upload build logs for diagnosis. -- task: CopyFiles@2 - displayName: Prepare BuildLogs staging directory - inputs: - SourceFolder: '$(Build.SourcesDirectory)' - Contents: | - **/*.log - **/*.binlog - artifacts/sb/prebuilt-report/** - TargetFolder: '$(Build.StagingDirectory)/BuildLogs' - CleanTargetFolder: true - continueOnError: true - condition: succeededOrFailed() - - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish BuildLogs - targetPath: '$(Build.StagingDirectory)/BuildLogs' + targetPath: artifacts/log/${{ coalesce(variables._BuildConfig, 'Release') }} artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed() sbomEnabled: false # we don't need SBOM for logs - -# Manually inject component detection so that we can ignore the source build upstream cache, which contains -# a nupkg cache of input packages (a local feed). -# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir' -# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets -- template: /eng/common/core-templates/steps/component-governance.yml - parameters: - displayName: Component Detection (Exclude upstream cache) - is1ESPipeline: ${{ parameters.is1ESPipeline }} - componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache' - disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }} diff --git a/eng/common/core-templates/steps/source-index-stage1-publish.yml b/eng/common/core-templates/steps/source-index-stage1-publish.yml new file mode 100644 index 00000000000..99c2326fc19 --- /dev/null +++ b/eng/common/core-templates/steps/source-index-stage1-publish.yml @@ -0,0 +1,35 @@ +parameters: + sourceIndexUploadPackageVersion: 2.0.0-20250425.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20250425.2 + sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json + binlogPath: artifacts/log/Debug/Build.binlog + +steps: +- task: UseDotNet@2 + displayName: "Source Index: Use .NET 8 SDK" + inputs: + packageType: sdk + version: 8.0.x + installationPath: $(Agent.TempDirectory)/dotnet + workingDirectory: $(Agent.TempDirectory) + +- script: | + $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version ${{parameters.sourceIndexProcessBinlogPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version ${{parameters.sourceIndexUploadPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + displayName: "Source Index: Download netsourceindex Tools" + # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. + workingDirectory: $(Agent.TempDirectory) + +- script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i ${{parameters.BinlogPath}} -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output + displayName: "Source Index: Process Binlog into indexable sln" + +- ${{ if and(ne(parameters.runAsPublic, 'true'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: AzureCLI@2 + displayName: "Source Index: Upload Source Index stage1 artifacts to Azure" + inputs: + azureSubscription: 'SourceDotNet Stage1 Publish' + addSpnToEnvironment: true + scriptType: 'ps' + scriptLocation: 'inlineScript' + inlineScript: | + $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 diff --git a/eng/common/cross/arm64/tizen/tizen.patch b/eng/common/cross/arm64/tizen/tizen.patch index af7c8be0590..2cebc547382 100644 --- a/eng/common/cross/arm64/tizen/tizen.patch +++ b/eng/common/cross/arm64/tizen/tizen.patch @@ -5,5 +5,5 @@ diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-littleaarch64) --GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib/ld-linux-aarch64.so.1 ) ) +-GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-aarch64.so.1 ) ) +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-aarch64.so.1 ) ) diff --git a/eng/common/cross/armel/armel.jessie.patch b/eng/common/cross/armel/armel.jessie.patch deleted file mode 100644 index 2d261561935..00000000000 --- a/eng/common/cross/armel/armel.jessie.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -u -r a/usr/include/urcu/uatomic/generic.h b/usr/include/urcu/uatomic/generic.h ---- a/usr/include/urcu/uatomic/generic.h 2014-10-22 15:00:58.000000000 -0700 -+++ b/usr/include/urcu/uatomic/generic.h 2020-10-30 21:38:28.550000000 -0700 -@@ -69,10 +69,10 @@ - #endif - #ifdef UATOMIC_HAS_ATOMIC_SHORT - case 2: -- return __sync_val_compare_and_swap_2(addr, old, _new); -+ return __sync_val_compare_and_swap_2((uint16_t*) addr, old, _new); - #endif - case 4: -- return __sync_val_compare_and_swap_4(addr, old, _new); -+ return __sync_val_compare_and_swap_4((uint32_t*) addr, old, _new); - #if (CAA_BITS_PER_LONG == 64) - case 8: - return __sync_val_compare_and_swap_8(addr, old, _new); -@@ -109,7 +109,7 @@ - return; - #endif - case 4: -- __sync_and_and_fetch_4(addr, val); -+ __sync_and_and_fetch_4((uint32_t*) addr, val); - return; - #if (CAA_BITS_PER_LONG == 64) - case 8: -@@ -148,7 +148,7 @@ - return; - #endif - case 4: -- __sync_or_and_fetch_4(addr, val); -+ __sync_or_and_fetch_4((uint32_t*) addr, val); - return; - #if (CAA_BITS_PER_LONG == 64) - case 8: -@@ -187,7 +187,7 @@ - return __sync_add_and_fetch_2(addr, val); - #endif - case 4: -- return __sync_add_and_fetch_4(addr, val); -+ return __sync_add_and_fetch_4((uint32_t*) addr, val); - #if (CAA_BITS_PER_LONG == 64) - case 8: - return __sync_add_and_fetch_8(addr, val); diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh index 7e9ba2b75ed..fbd8d80848a 100755 --- a/eng/common/cross/build-android-rootfs.sh +++ b/eng/common/cross/build-android-rootfs.sh @@ -6,10 +6,11 @@ usage() { echo "Creates a toolchain and sysroot used for cross-compiling for Android." echo - echo "Usage: $0 [BuildArch] [ApiLevel]" + echo "Usage: $0 [BuildArch] [ApiLevel] [--ndk NDKVersion]" echo echo "BuildArch is the target architecture of Android. Currently only arm64 is supported." echo "ApiLevel is the target Android API level. API levels usually match to Android releases. See https://source.android.com/source/build-numbers.html" + echo "NDKVersion is the version of Android NDK. The default is r21. See https://developer.android.com/ndk/downloads/revision_history" echo echo "By default, the toolchain and sysroot will be generated in cross/android-rootfs/toolchain/[BuildArch]. You can change this behavior" echo "by setting the TOOLCHAIN_DIR environment variable" @@ -25,10 +26,15 @@ __BuildArch=arm64 __AndroidArch=aarch64 __AndroidToolchain=aarch64-linux-android -for i in "$@" - do - lowerI="$(echo $i | tr "[:upper:]" "[:lower:]")" - case $lowerI in +while :; do + if [[ "$#" -le 0 ]]; then + break + fi + + i=$1 + + lowerI="$(echo $i | tr "[:upper:]" "[:lower:]")" + case $lowerI in -?|-h|--help) usage exit 1 @@ -43,6 +49,10 @@ for i in "$@" __AndroidArch=arm __AndroidToolchain=arm-linux-androideabi ;; + --ndk) + shift + __NDK_Version=$1 + ;; *[0-9]) __ApiLevel=$i ;; @@ -50,8 +60,17 @@ for i in "$@" __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i" ;; esac + shift done +if [[ "$__NDK_Version" == "r21" ]] || [[ "$__NDK_Version" == "r22" ]]; then + __NDK_File_Arch_Spec=-x86_64 + __SysRoot=sysroot +else + __NDK_File_Arch_Spec= + __SysRoot=toolchains/llvm/prebuilt/linux-x86_64/sysroot +fi + # Obtain the location of the bash script to figure out where the root of the repo is. __ScriptBaseDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -78,6 +97,7 @@ fi echo "Target API level: $__ApiLevel" echo "Target architecture: $__BuildArch" +echo "NDK version: $__NDK_Version" echo "NDK location: $__NDK_Dir" echo "Target Toolchain location: $__ToolchainDir" @@ -85,8 +105,8 @@ echo "Target Toolchain location: $__ToolchainDir" if [ ! -d $__NDK_Dir ]; then echo Downloading the NDK into $__NDK_Dir mkdir -p $__NDK_Dir - wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux-x86_64.zip -O $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip - unzip -q $__CrossDir/android-ndk-$__NDK_Version-linux-x86_64.zip -d $__CrossDir + wget -q --progress=bar:force:noscroll --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux$__NDK_File_Arch_Spec.zip -O $__CrossDir/android-ndk-$__NDK_Version-linux.zip + unzip -q $__CrossDir/android-ndk-$__NDK_Version-linux.zip -d $__CrossDir fi if [ ! -d $__lldb_Dir ]; then @@ -116,16 +136,11 @@ for path in $(wget -qO- https://packages.termux.dev/termux-main-21/dists/stable/ fi done -cp -R "$__TmpDir/data/data/com.termux/files/usr/"* "$__ToolchainDir/sysroot/usr/" +cp -R "$__TmpDir/data/data/com.termux/files/usr/"* "$__ToolchainDir/$__SysRoot/usr/" # Generate platform file for build.sh script to assign to __DistroRid echo "Generating platform file..." -echo "RID=android.${__ApiLevel}-${__BuildArch}" > $__ToolchainDir/sysroot/android_platform - -echo "Now to build coreclr, libraries and installers; run:" -echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \ - --subsetCategory coreclr -echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \ - --subsetCategory libraries -echo ROOTFS_DIR=\$\(realpath $__ToolchainDir/sysroot\) ./build.sh --cross --arch $__BuildArch \ - --subsetCategory installer +echo "RID=android.${__ApiLevel}-${__BuildArch}" > $__ToolchainDir/$__SysRoot/android_platform + +echo "Now to build coreclr, libraries and host; run:" +echo ROOTFS_DIR=$(realpath $__ToolchainDir/$__SysRoot) ./build.sh clr+libs+host --cross --arch $__BuildArch diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 4b5e8d7166b..d6f005b5dab 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -5,7 +5,7 @@ set -e usage() { echo "Usage: $0 [BuildArch] [CodeName] [lldbx.y] [llvmx[.y]] [--skipunmount] --rootfsdir ]" - echo "BuildArch can be: arm(default), arm64, armel, armv6, ppc64le, riscv64, s390x, x64, x86" + echo "BuildArch can be: arm(default), arm64, armel, armv6, loongarch64, ppc64le, riscv64, s390x, x64, x86" echo "CodeName - optional, Code name for Linux, can be: xenial(default), zesty, bionic, alpine" echo " for alpine can be specified with version: alpineX.YY or alpineedge" echo " for FreeBSD can be: freebsd13, freebsd14" @@ -15,6 +15,7 @@ usage() echo "llvmx[.y] - optional, LLVM version for LLVM related packages." echo "--skipunmount - optional, will skip the unmount of rootfs folder." echo "--skipsigcheck - optional, will skip package signature checks (allowing untrusted packages)." + echo "--skipemulation - optional, will skip qemu and debootstrap requirement when building environment for debian based systems." echo "--use-mirror - optional, use mirror URL to fetch resources, when available." echo "--jobs N - optional, restrict to N jobs." exit 1 @@ -52,28 +53,27 @@ __UbuntuPackages+=" symlinks" __UbuntuPackages+=" libicu-dev" __UbuntuPackages+=" liblttng-ust-dev" __UbuntuPackages+=" libunwind8-dev" -__UbuntuPackages+=" libnuma-dev" __AlpinePackages+=" gettext-dev" __AlpinePackages+=" icu-dev" __AlpinePackages+=" libunwind-dev" __AlpinePackages+=" lttng-ust-dev" __AlpinePackages+=" compiler-rt" -__AlpinePackages+=" numactl-dev" # runtime libraries' dependencies __UbuntuPackages+=" libcurl4-openssl-dev" __UbuntuPackages+=" libkrb5-dev" __UbuntuPackages+=" libssl-dev" __UbuntuPackages+=" zlib1g-dev" +__UbuntuPackages+=" libbrotli-dev" __AlpinePackages+=" curl-dev" __AlpinePackages+=" krb5-dev" __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" -__FreeBSDBase="13.3-RELEASE" -__FreeBSDPkg="1.17.0" +__FreeBSDBase="13.4-RELEASE" +__FreeBSDPkg="1.21.3" __FreeBSDABI="13" __FreeBSDPackages="libunwind" __FreeBSDPackages+=" icu" @@ -91,18 +91,18 @@ __HaikuPackages="gcc_syslibs" __HaikuPackages+=" gcc_syslibs_devel" __HaikuPackages+=" gmp" __HaikuPackages+=" gmp_devel" -__HaikuPackages+=" icu66" -__HaikuPackages+=" icu66_devel" +__HaikuPackages+=" icu[0-9]+" +__HaikuPackages+=" icu[0-9]*_devel" __HaikuPackages+=" krb5" __HaikuPackages+=" krb5_devel" __HaikuPackages+=" libiconv" __HaikuPackages+=" libiconv_devel" -__HaikuPackages+=" llvm12_libunwind" -__HaikuPackages+=" llvm12_libunwind_devel" +__HaikuPackages+=" llvm[0-9]*_libunwind" +__HaikuPackages+=" llvm[0-9]*_libunwind_devel" __HaikuPackages+=" mpfr" __HaikuPackages+=" mpfr_devel" -__HaikuPackages+=" openssl" -__HaikuPackages+=" openssl_devel" +__HaikuPackages+=" openssl3" +__HaikuPackages+=" openssl3_devel" __HaikuPackages+=" zlib" __HaikuPackages+=" zlib_devel" @@ -128,10 +128,12 @@ __AlpineKeys=' 616adfeb:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq0BFD1D4lIxQcsqEpQzU\npNCYM3aP1V/fxxVdT4DWvSI53JHTwHQamKdMWtEXetWVbP5zSROniYKFXd/xrD9X\n0jiGHey3lEtylXRIPxe5s+wXoCmNLcJVnvTcDtwx/ne2NLHxp76lyc25At+6RgE6\nADjLVuoD7M4IFDkAsd8UQ8zM0Dww9SylIk/wgV3ZkifecvgUQRagrNUdUjR56EBZ\nraQrev4hhzOgwelT0kXCu3snbUuNY/lU53CoTzfBJ5UfEJ5pMw1ij6X0r5S9IVsy\nKLWH1hiO0NzU2c8ViUYCly4Fe9xMTFc6u2dy/dxf6FwERfGzETQxqZvSfrRX+GLj\n/QZAXiPg5178hT/m0Y3z5IGenIC/80Z9NCi+byF1WuJlzKjDcF/TU72zk0+PNM/H\nKuppf3JT4DyjiVzNC5YoWJT2QRMS9KLP5iKCSThwVceEEg5HfhQBRT9M6KIcFLSs\nmFjx9kNEEmc1E8hl5IR3+3Ry8G5/bTIIruz14jgeY9u5jhL8Vyyvo41jgt9sLHR1\n/J1TxKfkgksYev7PoX6/ZzJ1ksWKZY5NFoDXTNYUgzFUTOoEaOg3BAQKadb3Qbbq\nXIrxmPBdgrn9QI7NCgfnAY3Tb4EEjs3ON/BNyEhUENcXOH6I1NbcuBQ7g9P73kE4\nVORdoc8MdJ5eoKBpO8Ww8HECAwEAAQ== 616ae350:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyduVzi1mWm+lYo2Tqt/0\nXkCIWrDNP1QBMVPrE0/ZlU2bCGSoo2Z9FHQKz/mTyMRlhNqTfhJ5qU3U9XlyGOPJ\npiM+b91g26pnpXJ2Q2kOypSgOMOPA4cQ42PkHBEqhuzssfj9t7x47ppS94bboh46\nxLSDRff/NAbtwTpvhStV3URYkxFG++cKGGa5MPXBrxIp+iZf9GnuxVdST5PGiVGP\nODL/b69sPJQNbJHVquqUTOh5Ry8uuD2WZuXfKf7/C0jC/ie9m2+0CttNu9tMciGM\nEyKG1/Xhk5iIWO43m4SrrT2WkFlcZ1z2JSf9Pjm4C2+HovYpihwwdM/OdP8Xmsnr\nDzVB4YvQiW+IHBjStHVuyiZWc+JsgEPJzisNY0Wyc/kNyNtqVKpX6dRhMLanLmy+\nf53cCSI05KPQAcGj6tdL+D60uKDkt+FsDa0BTAobZ31OsFVid0vCXtsbplNhW1IF\nHwsGXBTVcfXg44RLyL8Lk/2dQxDHNHzAUslJXzPxaHBLmt++2COa2EI1iWlvtznk\nOk9WP8SOAIj+xdqoiHcC4j72BOVVgiITIJNHrbppZCq6qPR+fgXmXa+sDcGh30m6\n9Wpbr28kLMSHiENCWTdsFij+NQTd5S47H7XTROHnalYDuF1RpS+DpQidT5tUimaT\nJZDr++FjKrnnijbyNF8b98UCAwEAAQ== 616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ== +66ba20fe:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtfB12w4ZgqsXWZDfUAV/\n6Y4aHUKIu3q4SXrNZ7CXF9nXoAVYrS7NAxJdAodsY3vPCN0g5O8DFXR+390LdOuQ\n+HsGKCc1k5tX5ZXld37EZNTNSbR0k+NKhd9h6X3u6wqPOx7SIKxwAQR8qeeFq4pP\nrt9GAGlxtuYgzIIcKJPwE0dZlcBCg+GnptCUZXp/38BP1eYC+xTXSL6Muq1etYfg\nodXdb7Yl+2h1IHuOwo5rjgY5kpY7GcAs8AjGk3lDD/av60OTYccknH0NCVSmPoXK\nvrxDBOn0LQRNBLcAfnTKgHrzy0Q5h4TNkkyTgxkoQw5ObDk9nnabTxql732yy9BY\ns+hM9+dSFO1HKeVXreYSA2n1ndF18YAvAumzgyqzB7I4pMHXq1kC/8bONMJxwSkS\nYm6CoXKyavp7RqGMyeVpRC7tV+blkrrUml0BwNkxE+XnwDRB3xDV6hqgWe0XrifD\nYTfvd9ScZQP83ip0r4IKlq4GMv/R5shcCRJSkSZ6QSGshH40JYSoiwJf5FHbj9ND\n7do0UAqebWo4yNx63j/wb2ULorW3AClv0BCFSdPsIrCStiGdpgJDBR2P2NZOCob3\nG9uMj+wJD6JJg2nWqNJxkANXX37Qf8plgzssrhrgOvB0fjjS7GYhfkfmZTJ0wPOw\nA8+KzFseBh4UFGgue78KwgkCAwEAAQ== ' __Keyring= __KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg" __SkipSigCheck=0 +__SkipEmulation=0 __UseMirror=0 __UnprocessedBuildArgs= @@ -162,9 +164,13 @@ while :; do armel) __BuildArch=armel __UbuntuArch=armel - __UbuntuRepo="http://ftp.debian.org/debian/" - __CodeName=jessie + __UbuntuRepo="http://archive.debian.org/debian/" + __CodeName=buster __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" + __LLDB_Package="liblldb-6.0-dev" + __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" + __UbuntuPackages="${__UbuntuPackages// libomp5/}" + __UbuntuSuites= ;; armv6) __BuildArch=armv6 @@ -180,6 +186,18 @@ while :; do __Keyring="--keyring $__KeyringFile" fi ;; + loongarch64) + __BuildArch=loongarch64 + __AlpineArch=loongarch64 + __QEMUArch=loongarch64 + __UbuntuArch=loong64 + __UbuntuSuites=unreleased + __LLDB_Package="liblldb-19-dev" + + if [[ "$__CodeName" == "sid" ]]; then + __UbuntuRepo="http://ftp.ports.debian.org/debian-ports/" + fi + ;; riscv64) __BuildArch=riscv64 __AlpineArch=riscv64 @@ -264,46 +282,23 @@ while :; do ;; xenial) # Ubuntu 16.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=xenial - fi - ;; - zesty) # Ubuntu 17.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=zesty - fi + __CodeName=xenial ;; bionic) # Ubuntu 18.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=bionic - fi + __CodeName=bionic ;; focal) # Ubuntu 20.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=focal - fi + __CodeName=focal ;; jammy) # Ubuntu 22.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=jammy - fi + __CodeName=jammy ;; noble) # Ubuntu 24.04 - if [[ "$__CodeName" != "jessie" ]]; then - __CodeName=noble - fi + __CodeName=noble if [[ -n "$__LLDB_Package" ]]; then __LLDB_Package="liblldb-18-dev" fi ;; - jessie) # Debian 8 - __CodeName=jessie - __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" - - if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" - fi - ;; stretch) # Debian 9 __CodeName=stretch __LLDB_Package="liblldb-6.0-dev" @@ -319,7 +314,7 @@ while :; do __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + __UbuntuRepo="http://archive.debian.org/debian/" fi ;; bullseye) # Debian 11 @@ -340,10 +335,28 @@ while :; do ;; sid) # Debian sid __CodeName=sid - __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" + __UbuntuSuites= - if [[ -z "$__UbuntuRepo" ]]; then - __UbuntuRepo="http://ftp.debian.org/debian/" + # Debian-Ports architectures need different values + case "$__UbuntuArch" in + amd64|arm64|armel|armhf|i386|mips64el|ppc64el|riscv64|s390x) + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.debian.org/debian/" + fi + ;; + *) + __KeyringFile="/usr/share/keyrings/debian-ports-archive-keyring.gpg" + + if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ftp.ports.debian.org/debian-ports/" + fi + ;; + esac + + if [[ -e "$__KeyringFile" ]]; then + __Keyring="--keyring $__KeyringFile" fi ;; tizen) @@ -370,7 +383,7 @@ while :; do ;; freebsd14) __CodeName=freebsd - __FreeBSDBase="14.0-RELEASE" + __FreeBSDBase="14.2-RELEASE" __FreeBSDABI="14" __SkipUnmount=1 ;; @@ -388,6 +401,9 @@ while :; do --skipsigcheck) __SkipSigCheck=1 ;; + --skipemulation) + __SkipEmulation=1 + ;; --rootfsdir|-rootfsdir) shift __RootfsDir="$1" @@ -420,16 +436,15 @@ case "$__AlpineVersion" in elif [[ "$__AlpineArch" == "x86" ]]; then __AlpineVersion=3.17 # minimum version that supports lldb-dev __AlpinePackages+=" llvm15-libs" - elif [[ "$__AlpineArch" == "riscv64" ]]; then + elif [[ "$__AlpineArch" == "riscv64" || "$__AlpineArch" == "loongarch64" ]]; then + __AlpineVersion=3.21 # minimum version that supports lldb-dev + __AlpinePackages+=" llvm19-libs" + elif [[ -n "$__AlpineMajorVersion" ]]; then + # use whichever alpine version is provided and select the latest toolchain libs __AlpineLlvmLibsLookup=1 - __AlpineVersion=edge # minimum version with APKINDEX.tar.gz (packages archive) else __AlpineVersion=3.13 # 3.13 to maximize compatibility __AlpinePackages+=" llvm10-libs" - - if [[ "$__AlpineArch" == "armv7" ]]; then - __AlpinePackages="${__AlpinePackages//numactl-dev/}" - fi fi esac @@ -439,15 +454,6 @@ if [[ "$__AlpineVersion" =~ 3\.1[345] ]]; then __AlpinePackages="${__AlpinePackages/compiler-rt/compiler-rt-static}" fi -if [[ "$__BuildArch" == "armel" ]]; then - __LLDB_Package="lldb-3.5-dev" -fi - -if [[ "$__CodeName" == "xenial" && "$__UbuntuArch" == "armhf" ]]; then - # libnuma-dev is not available on armhf for xenial - __UbuntuPackages="${__UbuntuPackages//libnuma-dev/}" -fi - __UbuntuPackages+=" ${__LLDB_Package:-}" if [[ -z "$__UbuntuRepo" ]]; then @@ -496,7 +502,7 @@ if [[ "$__CodeName" == "alpine" ]]; then arch="$(uname -m)" ensureDownloadTool - + if [[ "$__hasWget" == 1 ]]; then wget -P "$__ApkToolsDir" "https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v$__ApkToolsVersion/$arch/apk.static" else @@ -512,11 +518,6 @@ if [[ "$__CodeName" == "alpine" ]]; then echo "$__ApkToolsSHA512SUM $__ApkToolsDir/apk.static" | sha512sum -c chmod +x "$__ApkToolsDir/apk.static" - if [[ -f "/usr/bin/qemu-$__QEMUArch-static" ]]; then - mkdir -p "$__RootfsDir"/usr/bin - cp -v "/usr/bin/qemu-$__QEMUArch-static" "$__RootfsDir/usr/bin" - fi - if [[ "$__AlpineVersion" == "edge" ]]; then version=edge else @@ -536,6 +537,10 @@ if [[ "$__CodeName" == "alpine" ]]; then __ApkSignatureArg="--keys-dir $__ApkKeysDir" fi + if [[ "$__SkipEmulation" == "1" ]]; then + __NoEmulationArg="--no-scripts" + fi + # initialize DB # shellcheck disable=SC2086 "$__ApkToolsDir/apk.static" \ @@ -557,7 +562,7 @@ if [[ "$__CodeName" == "alpine" ]]; then "$__ApkToolsDir/apk.static" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/main" \ -X "http://dl-cdn.alpinelinux.org/alpine/$version/community" \ - -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" \ + -U $__ApkSignatureArg --root "$__RootfsDir" --arch "$__AlpineArch" $__NoEmulationArg \ add $__AlpinePackages rm -r "$__ApkToolsDir" @@ -573,7 +578,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then curl -SL "https://download.freebsd.org/ftp/releases/${__FreeBSDArch}/${__FreeBSDMachineArch}/${__FreeBSDBase}/base.txz" | tar -C "$__RootfsDir" -Jxf - ./lib ./usr/lib ./usr/libdata ./usr/include ./usr/share/keys ./etc ./bin/freebsd-version fi echo "ABI = \"FreeBSD:${__FreeBSDABI}:${__FreeBSDMachineArch}\"; FINGERPRINTS = \"${__RootfsDir}/usr/share/keys\"; REPOS_DIR = [\"${__RootfsDir}/etc/pkg\"]; REPO_AUTOUPDATE = NO; RUN_SCRIPTS = NO;" > "${__RootfsDir}"/usr/local/etc/pkg.conf - echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"${__RootfsDir}/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf + echo "FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", signature_type: \"fingerprints\", fingerprints: \"/usr/share/keys/pkg\", enabled: yes }" > "${__RootfsDir}"/etc/pkg/FreeBSD.conf mkdir -p "$__RootfsDir"/tmp # get and build package manager if [[ "$__hasWget" == 1 ]]; then @@ -681,7 +686,7 @@ elif [[ "$__CodeName" == "haiku" ]]; then ensureDownloadTool - echo "Downloading Haiku package tool" + echo "Downloading Haiku package tools" git clone https://github.com/haiku/haiku-toolchains-ubuntu --depth 1 "$__RootfsDir/tmp/script" if [[ "$__hasWget" == 1 ]]; then wget -O "$__RootfsDir/tmp/download/hosttools.zip" "$("$__RootfsDir/tmp/script/fetch.sh" --hosttools)" @@ -691,34 +696,42 @@ elif [[ "$__CodeName" == "haiku" ]]; then unzip -o "$__RootfsDir/tmp/download/hosttools.zip" -d "$__RootfsDir/tmp/bin" - DepotBaseUrl="https://depot.haiku-os.org/__api/v2/pkg/get-pkg" - HpkgBaseUrl="https://eu.hpkg.haiku-os.org/haiku/master/$__HaikuArch/current" + HaikuBaseUrl="https://eu.hpkg.haiku-os.org/haiku/master/$__HaikuArch/current" + HaikuPortsBaseUrl="https://eu.hpkg.haiku-os.org/haikuports/master/$__HaikuArch/current" + + echo "Downloading HaikuPorts package repository index..." + if [[ "$__hasWget" == 1 ]]; then + wget -P "$__RootfsDir/tmp/download" "$HaikuPortsBaseUrl/repo" + else + curl -SLO --create-dirs --output-dir "$__RootfsDir/tmp/download" "$HaikuPortsBaseUrl/repo" + fi - # Download Haiku packages echo "Downloading Haiku packages" read -ra array <<<"$__HaikuPackages" for package in "${array[@]}"; do echo "Downloading $package..." - # API documented here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L60 - # The schema here: https://github.com/haiku/haikudepotserver/blob/master/haikudepotserver-api2/src/main/resources/api2/pkg.yaml#L598 + hpkgFilename="$(LD_LIBRARY_PATH="$__RootfsDir/tmp/bin" "$__RootfsDir/tmp/bin/package_repo" list -f "$__RootfsDir/tmp/download/repo" | + grep -E "${package}-" | sort -V | tail -n 1 | xargs)" + if [ -z "$hpkgFilename" ]; then + >&2 echo "ERROR: package $package missing." + exit 1 + fi + echo "Resolved filename: $hpkgFilename..." + hpkgDownloadUrl="$HaikuPortsBaseUrl/packages/$hpkgFilename" if [[ "$__hasWget" == 1 ]]; then - hpkgDownloadUrl="$(wget -qO- --post-data '{"name":"'"$package"'","repositorySourceCode":"haikuports_'$__HaikuArch'","versionType":"LATEST","naturalLanguageCode":"en"}' \ - --header 'Content-Type:application/json' "$DepotBaseUrl" | jq -r '.result.versions[].hpkgDownloadURL')" wget -P "$__RootfsDir/tmp/download" "$hpkgDownloadUrl" else - hpkgDownloadUrl="$(curl -sSL -XPOST --data '{"name":"'"$package"'","repositorySourceCode":"haikuports_'$__HaikuArch'","versionType":"LATEST","naturalLanguageCode":"en"}' \ - --header 'Content-Type:application/json' "$DepotBaseUrl" | jq -r '.result.versions[].hpkgDownloadURL')" curl -SLO --create-dirs --output-dir "$__RootfsDir/tmp/download" "$hpkgDownloadUrl" fi done for package in haiku haiku_devel; do echo "Downloading $package..." if [[ "$__hasWget" == 1 ]]; then - hpkgVersion="$(wget -qO- "$HpkgBaseUrl" | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')" - wget -P "$__RootfsDir/tmp/download" "$HpkgBaseUrl/packages/$package-$hpkgVersion-1-$__HaikuArch.hpkg" + hpkgVersion="$(wget -qO- "$HaikuBaseUrl" | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')" + wget -P "$__RootfsDir/tmp/download" "$HaikuBaseUrl/packages/$package-$hpkgVersion-1-$__HaikuArch.hpkg" else - hpkgVersion="$(curl -sSL "$HpkgBaseUrl" | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')" - curl -SLO --create-dirs --output-dir "$__RootfsDir/tmp/download" "$HpkgBaseUrl/packages/$package-$hpkgVersion-1-$__HaikuArch.hpkg" + hpkgVersion="$(curl -sSL "$HaikuBaseUrl" | sed -n 's/^.*version: "\([^"]*\)".*$/\1/p')" + curl -SLO --create-dirs --output-dir "$__RootfsDir/tmp/download" "$HaikuBaseUrl/packages/$package-$hpkgVersion-1-$__HaikuArch.hpkg" fi done @@ -744,25 +757,67 @@ elif [[ "$__CodeName" == "haiku" ]]; then popd rm -rf "$__RootfsDir/tmp" elif [[ -n "$__CodeName" ]]; then + __Suites="$__CodeName $(for suite in $__UbuntuSuites; do echo -n "$__CodeName-$suite "; done)" + + if [[ "$__SkipEmulation" == "1" ]]; then + if [[ -z "$AR" ]]; then + if command -v ar &>/dev/null; then + AR="$(command -v ar)" + elif command -v llvm-ar &>/dev/null; then + AR="$(command -v llvm-ar)" + else + echo "Unable to find ar or llvm-ar on PATH, add them to PATH or set AR environment variable pointing to the available AR tool" + exit 1 + fi + fi + + PYTHON=${PYTHON_EXECUTABLE:-python3} + + # shellcheck disable=SC2086,SC2046 + echo running "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ + $(for suite in $__Suites; do echo -n "--suite $suite "; done) \ + $__UbuntuPackages + + # shellcheck disable=SC2086,SC2046 + "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \ + $(for suite in $__Suites; do echo -n "--suite $suite "; done) \ + $__UbuntuPackages + exit 0 + fi + + __UpdateOptions= if [[ "$__SkipSigCheck" == "0" ]]; then __Keyring="$__Keyring --force-check-gpg" + else + __Keyring= + __UpdateOptions="--allow-unauthenticated --allow-insecure-repositories" fi # shellcheck disable=SC2086 echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" - debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + # shellcheck disable=SC2086 + if ! debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo"; then + echo "debootstrap failed! dumping debootstrap.log" + cat "$__RootfsDir/debootstrap/debootstrap.log" + exit 1 + fi + + rm -rf "$__RootfsDir"/etc/apt/*.{sources,list} "$__RootfsDir"/etc/apt/sources.list.d mkdir -p "$__RootfsDir/etc/apt/sources.list.d/" + + # shellcheck disable=SC2086 cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" < token2) - (token1 < token2) + else: + return -1 if isinstance(token1, str) else 1 + + return len(tokens1) - len(tokens2) + +def compare_debian_versions(version1, version2): + """Compare two Debian package versions.""" + epoch1, upstream1, revision1 = parse_debian_version(version1) + epoch2, upstream2, revision2 = parse_debian_version(version2) + + if epoch1 != epoch2: + return epoch1 - epoch2 + + result = compare_upstream_version(upstream1, upstream2) + if result != 0: + return result + + return compare_upstream_version(revision1, revision2) + +def resolve_dependencies(packages, aliases, desired_packages): + """Recursively resolves dependencies for the desired packages.""" + resolved = [] + to_process = deque(desired_packages) + + while to_process: + current = to_process.popleft() + resolved_package = current if current in packages else aliases.get(current, [None])[0] + + if not resolved_package: + print(f"Error: Package '{current}' was not found in the available packages.") + sys.exit(1) + + if resolved_package not in resolved: + resolved.append(resolved_package) + + deps = packages.get(resolved_package, {}).get("Depends", "") + if deps: + deps = [dep.split(' ')[0] for dep in deps.split(', ') if dep] + for dep in deps: + if dep not in resolved and dep not in to_process and dep in packages: + to_process.append(dep) + + return resolved + +def parse_package_index(content): + """Parses the Packages.gz file and returns package information.""" + packages = {} + aliases = {} + entries = re.split(r'\n\n+', content) + + for entry in entries: + fields = dict(re.findall(r'^(\S+): (.+)$', entry, re.MULTILINE)) + if "Package" in fields: + package_name = fields["Package"] + version = fields.get("Version") + filename = fields.get("Filename") + depends = fields.get("Depends") + provides = fields.get("Provides", None) + + # Only update if package_name is not in packages or if the new version is higher + if package_name not in packages or compare_debian_versions(version, packages[package_name]["Version"]) > 0: + packages[package_name] = { + "Version": version, + "Filename": filename, + "Depends": depends + } + + # Update aliases if package provides any alternatives + if provides: + provides_list = [x.strip() for x in provides.split(",")] + for alias in provides_list: + # Strip version specifiers + alias_name = re.sub(r'\s*\(=.*\)', '', alias) + if alias_name not in aliases: + aliases[alias_name] = [] + if package_name not in aliases[alias_name]: + aliases[alias_name].append(package_name) + + return packages, aliases + +def install_packages(mirror, packages_info, aliases, tmp_dir, extract_dir, ar_tool, desired_packages): + """Downloads .deb files and extracts them.""" + resolved_packages = resolve_dependencies(packages_info, aliases, desired_packages) + print(f"Resolved packages (including dependencies): {resolved_packages}") + + packages_to_download = {} + + for pkg in resolved_packages: + if pkg in packages_info: + packages_to_download[pkg] = packages_info[pkg] + + if pkg in aliases: + for alias in aliases[pkg]: + if alias in packages_info: + packages_to_download[alias] = packages_info[alias] + + asyncio.run(download_deb_files_parallel(mirror, packages_to_download, tmp_dir)) + + package_to_deb_file_map = {} + for pkg in resolved_packages: + pkg_info = packages_info.get(pkg) + if pkg_info: + deb_filename = pkg_info.get("Filename") + if deb_filename: + deb_file_path = os.path.join(tmp_dir, os.path.basename(deb_filename)) + package_to_deb_file_map[pkg] = deb_file_path + + for pkg in reversed(resolved_packages): + deb_file = package_to_deb_file_map.get(pkg) + if deb_file and os.path.exists(deb_file): + extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool) + + print("All done!") + +def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool): + """Extract .deb file contents""" + + os.makedirs(extract_dir, exist_ok=True) + + with tempfile.TemporaryDirectory(dir=tmp_dir) as tmp_subdir: + result = subprocess.run(f"{ar_tool} t {os.path.abspath(deb_file)}", cwd=tmp_subdir, check=True, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + tar_filename = None + for line in result.stdout.decode().splitlines(): + if line.startswith("data.tar"): + tar_filename = line.strip() + break + + if not tar_filename: + raise FileNotFoundError(f"Could not find 'data.tar.*' in {deb_file}.") + + tar_file_path = os.path.join(tmp_subdir, tar_filename) + print(f"Extracting {tar_filename} from {deb_file}..") + + subprocess.run(f"{ar_tool} p {os.path.abspath(deb_file)} {tar_filename} > {tar_file_path}", check=True, shell=True) + + file_extension = os.path.splitext(tar_file_path)[1].lower() + + if file_extension == ".xz": + mode = "r:xz" + elif file_extension == ".gz": + mode = "r:gz" + elif file_extension == ".zst": + # zstd is not supported by standard library yet + decompressed_tar_path = tar_file_path.replace(".zst", "") + with open(tar_file_path, "rb") as zst_file, open(decompressed_tar_path, "wb") as decompressed_file: + dctx = zstandard.ZstdDecompressor() + dctx.copy_stream(zst_file, decompressed_file) + + tar_file_path = decompressed_tar_path + mode = "r" + else: + raise ValueError(f"Unsupported compression format: {file_extension}") + + with tarfile.open(tar_file_path, mode) as tar: + tar.extractall(path=extract_dir, filter='fully_trusted') + +def finalize_setup(rootfsdir): + lib_dir = os.path.join(rootfsdir, 'lib') + usr_lib_dir = os.path.join(rootfsdir, 'usr', 'lib') + + if os.path.exists(lib_dir): + if os.path.islink(lib_dir): + os.remove(lib_dir) + else: + os.makedirs(usr_lib_dir, exist_ok=True) + + for item in os.listdir(lib_dir): + src = os.path.join(lib_dir, item) + dest = os.path.join(usr_lib_dir, item) + + if os.path.isdir(src): + shutil.copytree(src, dest, dirs_exist_ok=True) + else: + shutil.copy2(src, dest) + + shutil.rmtree(lib_dir) + + os.symlink(usr_lib_dir, lib_dir) + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Generate rootfs for .NET runtime on Debian-like OS") + parser.add_argument("--distro", required=False, help="Distro name (e.g., debian, ubuntu, etc.)") + parser.add_argument("--arch", required=True, help="Architecture (e.g., amd64, loong64, etc.)") + parser.add_argument("--rootfsdir", required=True, help="Destination directory.") + parser.add_argument('--suite', required=True, action='append', help='Specify one or more repository suites to collect index data.') + parser.add_argument("--mirror", required=False, help="Mirror (e.g., http://ftp.debian.org/debian-ports etc.)") + parser.add_argument("--artool", required=False, default="ar", help="ar tool to extract debs (e.g., ar, llvm-ar etc.)") + parser.add_argument("packages", nargs="+", help="List of package names to be installed.") + + args = parser.parse_args() + + if args.mirror is None: + if args.distro == "ubuntu": + args.mirror = "http://archive.ubuntu.com/ubuntu" if args.arch in ["amd64", "i386"] else "http://ports.ubuntu.com/ubuntu-ports" + elif args.distro == "debian": + args.mirror = "http://ftp.debian.org/debian-ports" + else: + raise Exception("Unsupported distro") + + DESIRED_PACKAGES = args.packages + [ # base packages + "dpkg", + "busybox", + "libc-bin", + "base-files", + "base-passwd", + "debianutils" + ] + + print(f"Creating rootfs. rootfsdir: {args.rootfsdir}, distro: {args.distro}, arch: {args.arch}, suites: {args.suite}, mirror: {args.mirror}") + + package_index_content = asyncio.run(download_package_index_parallel(args.mirror, args.arch, args.suite)) + + packages_info, aliases = parse_package_index(package_index_content) + + with tempfile.TemporaryDirectory() as tmp_dir: + install_packages(args.mirror, packages_info, aliases, tmp_dir, args.rootfsdir, args.artool, DESIRED_PACKAGES) + + finalize_setup(args.rootfsdir) diff --git a/eng/common/cross/tizen-fetch.sh b/eng/common/cross/tizen-fetch.sh index 28936ceef3a..37c3a61f1de 100755 --- a/eng/common/cross/tizen-fetch.sh +++ b/eng/common/cross/tizen-fetch.sh @@ -156,13 +156,8 @@ fetch_tizen_pkgs() done } -if [ "$TIZEN_ARCH" == "riscv64" ]; then - BASE="Tizen-Base-RISCV" - UNIFIED="Tizen-Unified-RISCV" -else - BASE="Tizen-Base" - UNIFIED="Tizen-Unified" -fi +BASE="Tizen-Base" +UNIFIED="Tizen-Unified" Inform "Initialize ${TIZEN_ARCH} base" fetch_tizen_pkgs_init standard $BASE diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index 9a7ecfbd42c..0ff85cf0367 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -67,6 +67,13 @@ elseif(TARGET_ARCH_NAME STREQUAL "armv6") else() set(TOOLCHAIN "arm-linux-gnueabihf") endif() +elseif(TARGET_ARCH_NAME STREQUAL "loongarch64") + set(CMAKE_SYSTEM_PROCESSOR "loongarch64") + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/loongarch64-alpine-linux-musl) + set(TOOLCHAIN "loongarch64-alpine-linux-musl") + else() + set(TOOLCHAIN "loongarch64-linux-gnu") + endif() elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") set(CMAKE_SYSTEM_PROCESSOR ppc64le) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/powerpc64le-alpine-linux-musl) @@ -118,7 +125,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu") endif() else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, ppc64le, riscv64, s390x, x64 and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, loongarch64, ppc64le, riscv64, s390x, x64 and x86 are supported!") endif() if(DEFINED ENV{TOOLCHAIN}) @@ -148,6 +155,25 @@ if(TIZEN) include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++/${TIZEN_TOOLCHAIN}) endif() +function(locate_toolchain_exec exec var) + set(TOOLSET_PREFIX ${TOOLCHAIN}-) + string(TOUPPER ${exec} EXEC_UPPERCASE) + if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "") + set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE) + return() + endif() + + find_program(EXEC_LOCATION_${exec} + NAMES + "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}" + "${TOOLSET_PREFIX}${exec}") + + if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") + message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.") + endif() + set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) +endfunction() + if(ANDROID) if(TARGET_ARCH_NAME STREQUAL "arm") set(ANDROID_ABI armeabi-v7a) @@ -178,66 +204,24 @@ elseif(FREEBSD) set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=lld") elseif(ILLUMOS) set(CMAKE_SYSROOT "${CROSS_ROOTFS}") + set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") + set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") include_directories(SYSTEM ${CROSS_ROOTFS}/include) - set(TOOLSET_PREFIX ${TOOLCHAIN}-) - function(locate_toolchain_exec exec var) - string(TOUPPER ${exec} EXEC_UPPERCASE) - if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "") - set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE) - return() - endif() - - find_program(EXEC_LOCATION_${exec} - NAMES - "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}" - "${TOOLSET_PREFIX}${exec}") - - if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") - message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.") - endif() - set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) - endfunction() - - set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") - locate_toolchain_exec(gcc CMAKE_C_COMPILER) locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) - - set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") - set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") elseif(HAIKU) set(CMAKE_SYSROOT "${CROSS_ROOTFS}") set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") - - set(TOOLSET_PREFIX ${TOOLCHAIN}-) - function(locate_toolchain_exec exec var) - string(TOUPPER ${exec} EXEC_UPPERCASE) - if(NOT "$ENV{CLR_${EXEC_UPPERCASE}}" STREQUAL "") - set(${var} "$ENV{CLR_${EXEC_UPPERCASE}}" PARENT_SCOPE) - return() - endif() - - find_program(EXEC_LOCATION_${exec} - NAMES - "${TOOLSET_PREFIX}${exec}${CLR_CMAKE_COMPILER_FILE_NAME_VERSION}" - "${TOOLSET_PREFIX}${exec}") - - if (EXEC_LOCATION_${exec} STREQUAL "EXEC_LOCATION_${exec}-NOTFOUND") - message(FATAL_ERROR "Unable to find toolchain executable. Name: ${exec}, Prefix: ${TOOLSET_PREFIX}.") - endif() - set(${var} ${EXEC_LOCATION_${exec}} PARENT_SCOPE) - endfunction() - set(CMAKE_SYSTEM_PREFIX_PATH "${CROSS_ROOTFS}") + set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") locate_toolchain_exec(gcc CMAKE_C_COMPILER) locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) - set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lssp") - set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lssp") - # let CMake set up the correct search paths include(Platform/Haiku) else() @@ -307,7 +291,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|loongarch64|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index 36dbd45e1ce..e889f439b8d 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -68,7 +68,7 @@ function InstallDarcCli { fi fi - local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" + local arcadeServicesSource="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." diff --git a/eng/common/native/install-dependencies.sh b/eng/common/native/install-dependencies.sh new file mode 100644 index 00000000000..477a44f335b --- /dev/null +++ b/eng/common/native/install-dependencies.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +set -e + +# This is a simple script primarily used for CI to install necessary dependencies +# +# Usage: +# +# ./install-dependencies.sh + +os="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + +if [ -z "$os" ]; then + . "$(dirname "$0")"/init-os-and-arch.sh +fi + +case "$os" in + linux) + if [ -e /etc/os-release ]; then + . /etc/os-release + fi + + if [ "$ID" = "debian" ] || [ "$ID_LIKE" = "debian" ]; then + apt update + + apt install -y build-essential gettext locales cmake llvm clang lld lldb liblldb-dev libunwind8-dev libicu-dev liblttng-ust-dev \ + libssl-dev libkrb5-dev pigz cpio + + localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 + elif [ "$ID" = "fedora" ] || [ "$ID" = "rhel" ] || [ "$ID" = "azurelinux" ]; then + pkg_mgr="$(command -v tdnf 2>/dev/null || command -v dnf)" + $pkg_mgr install -y cmake llvm lld lldb clang python curl libicu-devel openssl-devel krb5-devel lttng-ust-devel pigz cpio + elif [ "$ID" = "alpine" ]; then + apk add build-base cmake bash curl clang llvm-dev lld lldb krb5-dev lttng-ust-dev icu-dev openssl-dev pigz cpio + else + echo "Unsupported distro. distro: $ID" + exit 1 + fi + ;; + + osx|maccatalyst|ios|iossimulator|tvos|tvossimulator) + echo "Installed xcode version: $(xcode-select -p)" + + export HOMEBREW_NO_INSTALL_CLEANUP=1 + export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + # Skip brew update for now, see https://github.com/actions/setup-python/issues/577 + # brew update --preinstall + brew bundle --no-upgrade --file=- < Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." + Write-Host " -excludeCIBinaryLog When running on CI, allow no binary log (short: -nobl)" Write-Host "" Write-Host "Command line arguments not listed above are passed thru to msbuild." } @@ -34,10 +36,11 @@ function Print-Usage() { function Build([string]$target) { $logSuffix = if ($target -eq 'Execute') { '' } else { ".$target" } $log = Join-Path $LogDir "$task$logSuffix.binlog" + $binaryLogArg = if ($binaryLog) { "/bl:$log" } else { "" } $outputPath = Join-Path $ToolsetDir "$task\" MSBuild $taskProject ` - /bl:$log ` + $binaryLogArg ` /t:$target ` /p:Configuration=$configuration ` /p:RepoRoot=$RepoRoot ` @@ -64,7 +67,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.12.0" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.13.0" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/sdk-task.sh b/eng/common/sdk-task.sh new file mode 100644 index 00000000000..2f83adc0269 --- /dev/null +++ b/eng/common/sdk-task.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +show_usage() { + echo "Common settings:" + echo " --task Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)" + echo " --restore Restore dependencies" + echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" + echo " --help Print help and exit" + echo "" + + echo "Advanced settings:" + echo " --excludeCIBinarylog Don't output binary log (short: -nobl)" + echo "" + echo "Command line arguments not listed above are passed thru to msbuild." +} + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +Build() { + local target=$1 + local log_suffix="" + [[ "$target" != "Execute" ]] && log_suffix=".$target" + local log="$log_dir/$task$log_suffix.binlog" + local binaryLogArg="" + [[ $binary_log == true ]] && binaryLogArg="/bl:$log" + local output_path="$toolset_dir/$task/" + + MSBuild "$taskProject" \ + $binaryLogArg \ + /t:"$target" \ + /p:Configuration="$configuration" \ + /p:RepoRoot="$repo_root" \ + /p:BaseIntermediateOutputPath="$output_path" \ + /v:"$verbosity" \ + $properties +} + +binary_log=true +configuration="Debug" +verbosity="minimal" +exclude_ci_binary_log=false +restore=false +help=false +properties='' + +while (($# > 0)); do + lowerI="$(echo $1 | tr "[:upper:]" "[:lower:]")" + case $lowerI in + --task) + task=$2 + shift 2 + ;; + --restore) + restore=true + shift 1 + ;; + --verbosity) + verbosity=$2 + shift 2 + ;; + --excludecibinarylog|--nobl) + binary_log=false + exclude_ci_binary_log=true + shift 1 + ;; + --help) + help=true + shift 1 + ;; + *) + properties="$properties $1" + shift 1 + ;; + esac +done + +ci=true +warnAsError=true + +if $help; then + show_usage + exit 0 +fi + +. "$scriptroot/tools.sh" +InitializeToolset + +if [[ -z "$task" ]]; then + Write-PipelineTelemetryError -Category 'Task' -Name 'MissingTask' -Message "Missing required parameter '-task '" + ExitWithExitCode 1 +fi + +taskProject=$(GetSdkTaskProject "$task") +if [[ ! -e "$taskProject" ]]; then + Write-PipelineTelemetryError -Category 'Task' -Name 'UnknownTask' -Message "Unknown task: $task" + ExitWithExitCode 1 +fi + +if $restore; then + Build "Restore" +fi + +Build "Execute" + + +ExitWithExitCode 0 diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config index 4585cfd6bba..e5f543ea68c 100644 --- a/eng/common/sdl/packages.config +++ b/eng/common/sdl/packages.config @@ -1,4 +1,4 @@ - + diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 817555505aa..a8a94328745 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -31,6 +31,7 @@ jobs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts' ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} condition: always() + retryCountOnTaskFailure: 10 # for any logs being locked continueOnError: true - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - output: pipelineArtifact @@ -39,6 +40,7 @@ jobs: displayName: 'Publish logs' continueOnError: true condition: always() + retryCountOnTaskFailure: 10 # for any logs being locked sbomEnabled: false # we don't need SBOM for logs - ${{ if eq(parameters.enablePublishBuildArtifacts, true) }}: @@ -46,7 +48,7 @@ jobs: displayName: Publish Logs PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts/log/$(_BuildConfig)' publishLocation: Container - ArtifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)' ) }} + ArtifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)_Attempt$(System.JobAttempt)' ) }} continueOnError: true condition: always() sbomEnabled: false # we don't need SBOM for logs diff --git a/eng/common/templates-official/steps/publish-build-artifacts.yml b/eng/common/templates-official/steps/publish-build-artifacts.yml index 100a3fc9849..fcf6637b2eb 100644 --- a/eng/common/templates-official/steps/publish-build-artifacts.yml +++ b/eng/common/templates-official/steps/publish-build-artifacts.yml @@ -24,6 +24,10 @@ parameters: - name: is1ESPipeline type: boolean default: true + +- name: retryCountOnTaskFailure + type: string + default: 10 steps: - ${{ if ne(parameters.is1ESPipeline, true) }}: @@ -38,4 +42,5 @@ steps: PathtoPublish: ${{ parameters.pathToPublish }} ${{ if parameters.artifactName }}: ArtifactName: ${{ parameters.artifactName }} - + ${{ if parameters.retryCountOnTaskFailure }}: + retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} diff --git a/eng/common/templates-official/steps/source-index-stage1-publish.yml b/eng/common/templates-official/steps/source-index-stage1-publish.yml new file mode 100644 index 00000000000..9b8b80942b5 --- /dev/null +++ b/eng/common/templates-official/steps/source-index-stage1-publish.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index d1aeb92fcea..7cbf668c22b 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -46,6 +46,7 @@ jobs: artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} continueOnError: true condition: always() + retryCountOnTaskFailure: 10 # for any logs being locked - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: @@ -56,6 +57,7 @@ jobs: displayName: 'Publish logs' continueOnError: true condition: always() + retryCountOnTaskFailure: 10 # for any logs being locked sbomEnabled: false # we don't need SBOM for logs - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: @@ -66,7 +68,7 @@ jobs: displayName: Publish Logs pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts/log/$(_BuildConfig)' publishLocation: Container - artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)' ) }} + artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)_Attempt$(System.JobAttempt)' ) }} continueOnError: true condition: always() diff --git a/eng/common/templates/steps/publish-build-artifacts.yml b/eng/common/templates/steps/publish-build-artifacts.yml index 6428a98dfef..605e602e94d 100644 --- a/eng/common/templates/steps/publish-build-artifacts.yml +++ b/eng/common/templates/steps/publish-build-artifacts.yml @@ -25,6 +25,10 @@ parameters: type: string default: 'Container' +- name: retryCountOnTaskFailure + type: string + default: 10 + steps: - ${{ if eq(parameters.is1ESPipeline, true) }}: - 'eng/common/templates cannot be referenced from a 1ES managed template': error @@ -37,4 +41,6 @@ steps: PublishLocation: ${{ parameters.publishLocation }} PathtoPublish: ${{ parameters.pathToPublish }} ${{ if parameters.artifactName }}: - ArtifactName: ${{ parameters.artifactName }} \ No newline at end of file + ArtifactName: ${{ parameters.artifactName }} + ${{ if parameters.retryCountOnTaskFailure }}: + retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }} diff --git a/eng/common/templates/steps/source-index-stage1-publish.yml b/eng/common/templates/steps/source-index-stage1-publish.yml new file mode 100644 index 00000000000..182cec33a7b --- /dev/null +++ b/eng/common/templates/steps/source-index-stage1-publish.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/steps/vmr-sync.yml b/eng/common/templates/steps/vmr-sync.yml new file mode 100644 index 00000000000..599afb6186b --- /dev/null +++ b/eng/common/templates/steps/vmr-sync.yml @@ -0,0 +1,207 @@ +### These steps synchronize new code from product repositories into the VMR (https://github.com/dotnet/dotnet). +### They initialize the darc CLI and pull the new updates. +### Changes are applied locally onto the already cloned VMR (located in $vmrPath). + +parameters: +- name: targetRef + displayName: Target revision in dotnet/ to synchronize + type: string + default: $(Build.SourceVersion) + +- name: vmrPath + displayName: Path where the dotnet/dotnet is checked out to + type: string + default: $(Agent.BuildDirectory)/vmr + +- name: additionalSyncs + displayName: Optional list of package names whose repo's source will also be synchronized in the local VMR, e.g. NuGet.Protocol + type: object + default: [] + +steps: +- checkout: vmr + displayName: Clone dotnet/dotnet + path: vmr + clean: true + +- checkout: self + displayName: Clone $(Build.Repository.Name) + path: repo + fetchDepth: 0 + +# This step is needed so that when we get a detached HEAD / shallow clone, +# we still pull the commit into the temporary repo clone to use it during the sync. +# Also unshallow the clone so that forwardflow command would work. +- script: | + git branch repo-head + git rev-parse HEAD + displayName: Label PR commit + workingDirectory: $(Agent.BuildDirectory)/repo + +- script: | + vmr_sha=$(grep -oP '(?<=Sha=")[^"]*' $(Agent.BuildDirectory)/repo/eng/Version.Details.xml) + echo "##vso[task.setvariable variable=vmr_sha]$vmr_sha" + displayName: Obtain the vmr sha from Version.Details.xml (Unix) + condition: ne(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo + +- powershell: | + [xml]$xml = Get-Content -Path $(Agent.BuildDirectory)/repo/eng/Version.Details.xml + $vmr_sha = $xml.SelectSingleNode("//Source").Sha + Write-Output "##vso[task.setvariable variable=vmr_sha]$vmr_sha" + displayName: Obtain the vmr sha from Version.Details.xml (Windows) + condition: eq(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo + +- script: | + git fetch --all + git checkout $(vmr_sha) + displayName: Checkout VMR at correct sha for repo flow + workingDirectory: ${{ parameters.vmrPath }} + +- script: | + git config --global user.name "dotnet-maestro[bot]" + git config --global user.email "dotnet-maestro[bot]@users.noreply.github.com" + displayName: Set git author to dotnet-maestro[bot] + workingDirectory: ${{ parameters.vmrPath }} + +- script: | + ./eng/common/vmr-sync.sh \ + --vmr ${{ parameters.vmrPath }} \ + --tmp $(Agent.TempDirectory) \ + --azdev-pat '$(dn-bot-all-orgs-code-r)' \ + --ci \ + --debug + + if [ "$?" -ne 0 ]; then + echo "##vso[task.logissue type=error]Failed to synchronize the VMR" + exit 1 + fi + displayName: Sync repo into VMR (Unix) + condition: ne(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo + +- script: | + git config --global diff.astextplain.textconv echo + git config --system core.longpaths true + displayName: Configure Windows git (longpaths, astextplain) + condition: eq(variables['Agent.OS'], 'Windows_NT') + +- powershell: | + ./eng/common/vmr-sync.ps1 ` + -vmr ${{ parameters.vmrPath }} ` + -tmp $(Agent.TempDirectory) ` + -azdevPat '$(dn-bot-all-orgs-code-r)' ` + -ci ` + -debugOutput + + if ($LASTEXITCODE -ne 0) { + echo "##vso[task.logissue type=error]Failed to synchronize the VMR" + exit 1 + } + displayName: Sync repo into VMR (Windows) + condition: eq(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo + +- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - task: CopyFiles@2 + displayName: Collect failed patches + condition: failed() + inputs: + SourceFolder: '$(Agent.TempDirectory)' + Contents: '*.patch' + TargetFolder: '$(Build.ArtifactStagingDirectory)/FailedPatches' + + - publish: '$(Build.ArtifactStagingDirectory)/FailedPatches' + artifact: $(System.JobDisplayName)_FailedPatches + displayName: Upload failed patches + condition: failed() + +- ${{ each assetName in parameters.additionalSyncs }}: + # The vmr-sync script ends up staging files in the local VMR so we have to commit those + - script: + git commit --allow-empty -am "Forward-flow $(Build.Repository.Name)" + displayName: Commit local VMR changes + workingDirectory: ${{ parameters.vmrPath }} + + - script: | + set -ex + + echo "Searching for details of asset ${{ assetName }}..." + + # Use darc to get dependencies information + dependencies=$(./.dotnet/dotnet darc get-dependencies --name '${{ assetName }}' --ci) + + # Extract repository URL and commit hash + repository=$(echo "$dependencies" | grep 'Repo:' | sed 's/Repo:[[:space:]]*//' | head -1) + + if [ -z "$repository" ]; then + echo "##vso[task.logissue type=error]Asset ${{ assetName }} not found in the dependency list" + exit 1 + fi + + commit=$(echo "$dependencies" | grep 'Commit:' | sed 's/Commit:[[:space:]]*//' | head -1) + + echo "Updating the VMR from $repository / $commit..." + cd .. + git clone $repository ${{ assetName }} + cd ${{ assetName }} + git checkout $commit + git branch "sync/$commit" + + ./eng/common/vmr-sync.sh \ + --vmr ${{ parameters.vmrPath }} \ + --tmp $(Agent.TempDirectory) \ + --azdev-pat '$(dn-bot-all-orgs-code-r)' \ + --ci \ + --debug + + if [ "$?" -ne 0 ]; then + echo "##vso[task.logissue type=error]Failed to synchronize the VMR" + exit 1 + fi + displayName: Sync ${{ assetName }} into (Unix) + condition: ne(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo + + - powershell: | + $ErrorActionPreference = 'Stop' + + Write-Host "Searching for details of asset ${{ assetName }}..." + + $dependencies = .\.dotnet\dotnet darc get-dependencies --name '${{ assetName }}' --ci + + $repository = $dependencies | Select-String -Pattern 'Repo:\s+([^\s]+)' | Select-Object -First 1 + $repository -match 'Repo:\s+([^\s]+)' | Out-Null + $repository = $matches[1] + + if ($repository -eq $null) { + Write-Error "Asset ${{ assetName }} not found in the dependency list" + exit 1 + } + + $commit = $dependencies | Select-String -Pattern 'Commit:\s+([^\s]+)' | Select-Object -First 1 + $commit -match 'Commit:\s+([^\s]+)' | Out-Null + $commit = $matches[1] + + Write-Host "Updating the VMR from $repository / $commit..." + cd .. + git clone $repository ${{ assetName }} + cd ${{ assetName }} + git checkout $commit + git branch "sync/$commit" + + .\eng\common\vmr-sync.ps1 ` + -vmr ${{ parameters.vmrPath }} ` + -tmp $(Agent.TempDirectory) ` + -azdevPat '$(dn-bot-all-orgs-code-r)' ` + -ci ` + -debugOutput + + if ($LASTEXITCODE -ne 0) { + echo "##vso[task.logissue type=error]Failed to synchronize the VMR" + exit 1 + } + displayName: Sync ${{ assetName }} into (Windows) + condition: ne(variables['Agent.OS'], 'Windows_NT') + workingDirectory: $(Agent.BuildDirectory)/repo diff --git a/eng/common/templates/vmr-build-pr.yml b/eng/common/templates/vmr-build-pr.yml new file mode 100644 index 00000000000..670cf32c3bd --- /dev/null +++ b/eng/common/templates/vmr-build-pr.yml @@ -0,0 +1,33 @@ +trigger: none +pr: + branches: + include: + - main + - release/* + paths: + exclude: + - documentation/* + - README.md + - CODEOWNERS + +variables: +- template: /eng/common/templates/variables/pool-providers.yml@self + +- name: skipComponentGovernanceDetection # we run CG on internal builds only + value: true + +- name: Codeql.Enabled # we run CodeQL on internal builds only + value: false + +resources: + repositories: + - repository: vmr + type: github + name: dotnet/dotnet + endpoint: dotnet + +stages: +- template: /eng/pipelines/templates/stages/vmr-build.yml@vmr + parameters: + isBuiltFromVmr: false + scope: lite diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 22b49e09d09..5f40a3f8238 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -68,8 +68,6 @@ $ErrorActionPreference = 'Stop' # True if the build is a product build [bool]$productBuild = if (Test-Path variable:productBuild) { $productBuild } else { $false } -[String[]]$properties = if (Test-Path variable:properties) { $properties } else { @() } - function Create-Directory ([string[]] $path) { New-Item -Path $path -Force -ItemType 'Directory' | Out-Null } @@ -383,8 +381,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # If the version of msbuild is going to be xcopied, # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.12.0 - $defaultXCopyMSBuildVersion = '17.12.0' + # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.13.0 + $defaultXCopyMSBuildVersion = '17.13.0' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { @@ -604,14 +602,7 @@ function InitializeBuildTool() { } $dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') - # Use override if it exists - commonly set by source-build - if ($null -eq $env:_OverrideArcadeInitializeBuildToolFramework) { - $initializeBuildToolFramework="net9.0" - } else { - $initializeBuildToolFramework=$env:_OverrideArcadeInitializeBuildToolFramework - } - - $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = $initializeBuildToolFramework } + $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net' } } elseif ($msbuildEngine -eq "vs") { try { $msbuildPath = InitializeVisualStudioMSBuild -install:$restore @@ -620,7 +611,7 @@ function InitializeBuildTool() { ExitWithExitCode 1 } - $buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472"; ExcludePrereleaseVS = $excludePrereleaseVS } + $buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "netframework"; ExcludePrereleaseVS = $excludePrereleaseVS } } else { Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Unexpected value of -msbuildEngine: '$msbuildEngine'." ExitWithExitCode 1 @@ -779,8 +770,10 @@ function MSBuild() { # new scripts need to work with old packages, so we need to look for the old names/versions (Join-Path $basePath (Join-Path $buildTool.Framework 'Microsoft.DotNet.ArcadeLogging.dll')), (Join-Path $basePath (Join-Path $buildTool.Framework 'Microsoft.DotNet.Arcade.Sdk.dll')), - (Join-Path $basePath (Join-Path net7.0 'Microsoft.DotNet.ArcadeLogging.dll')), - (Join-Path $basePath (Join-Path net7.0 'Microsoft.DotNet.Arcade.Sdk.dll')), + + # This list doesn't need to be updated anymore and can eventually be removed. + (Join-Path $basePath (Join-Path net9.0 'Microsoft.DotNet.ArcadeLogging.dll')), + (Join-Path $basePath (Join-Path net9.0 'Microsoft.DotNet.Arcade.Sdk.dll')), (Join-Path $basePath (Join-Path net8.0 'Microsoft.DotNet.ArcadeLogging.dll')), (Join-Path $basePath (Join-Path net8.0 'Microsoft.DotNet.Arcade.Sdk.dll')) ) @@ -858,7 +851,7 @@ function MSBuild-Core() { # When running on Azure Pipelines, override the returned exit code to avoid double logging. # Skip this when the build is a child of the VMR orchestrator build. - if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild -and -not($properties -like "*DotNetBuildRepo=true*")) { + if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$productBuild) { Write-PipelineSetResult -Result "Failed" -Message "msbuild execution failed." # Exiting with an exit code causes the azure pipelines task to log yet another "noise" error # The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 01b09b65796..25f5932eee9 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} @@ -339,12 +343,6 @@ function InitializeBuildTool { # return values _InitializeBuildTool="$_InitializeDotNetCli/dotnet" _InitializeBuildToolCommand="msbuild" - # use override if it exists - commonly set by source-build - if [[ "${_OverrideArcadeInitializeBuildToolFramework:-x}" == "x" ]]; then - _InitializeBuildToolFramework="net9.0" - else - _InitializeBuildToolFramework="${_OverrideArcadeInitializeBuildToolFramework}" - fi } # Set RestoreNoHttpCache as a workaround for https://github.com/NuGet/Home/issues/3116 @@ -454,10 +452,12 @@ function MSBuild { # new scripts need to work with old packages, so we need to look for the old names/versions local selectedPath= local possiblePaths=() - possiblePaths+=( "$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.ArcadeLogging.dll" ) - possiblePaths+=( "$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.Arcade.Sdk.dll" ) - possiblePaths+=( "$toolset_dir/net7.0/Microsoft.DotNet.ArcadeLogging.dll" ) - possiblePaths+=( "$toolset_dir/net7.0/Microsoft.DotNet.Arcade.Sdk.dll" ) + possiblePaths+=( "$toolset_dir/net/Microsoft.DotNet.ArcadeLogging.dll" ) + possiblePaths+=( "$toolset_dir/net/Microsoft.DotNet.Arcade.Sdk.dll" ) + + # This list doesn't need to be updated anymore and can eventually be removed. + possiblePaths+=( "$toolset_dir/net9.0/Microsoft.DotNet.ArcadeLogging.dll" ) + possiblePaths+=( "$toolset_dir/net9.0/Microsoft.DotNet.Arcade.Sdk.dll" ) possiblePaths+=( "$toolset_dir/net8.0/Microsoft.DotNet.ArcadeLogging.dll" ) possiblePaths+=( "$toolset_dir/net8.0/Microsoft.DotNet.Arcade.Sdk.dll" ) for path in "${possiblePaths[@]}"; do @@ -507,7 +507,7 @@ function MSBuild-Core { # When running on Azure Pipelines, override the returned exit code to avoid double logging. # Skip this when the build is a child of the VMR orchestrator build. - if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$product_build" != true && "$properties" != *"DotNetBuildRepo=true"* ]]; then + if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$product_build" != true ]]; then Write-PipelineSetResult -result "Failed" -message "msbuild execution failed." # Exiting with an exit code causes the azure pipelines task to log yet another "noise" error # The above Write-PipelineSetResult will cause the task to be marked as failure without adding yet another error @@ -532,6 +532,12 @@ function GetDarc { "$eng_root/common/darc-init.sh" --toolpath "$darc_path" $version } +# Returns a full path to an Arcade SDK task project file. +function GetSdkTaskProject { + taskName=$1 + echo "$(dirname $_InitializeToolset)/SdkTasks/$taskName.proj" +} + ResolvePath "${BASH_SOURCE[0]}" _script_dir=`dirname "$_ResolvePath"` diff --git a/eng/common/vmr-sync.ps1 b/eng/common/vmr-sync.ps1 new file mode 100644 index 00000000000..8c3c91ce8de --- /dev/null +++ b/eng/common/vmr-sync.ps1 @@ -0,0 +1,138 @@ +<# +.SYNOPSIS + +This script is used for synchronizing the current repository into a local VMR. +It pulls the current repository's code into the specified VMR directory for local testing or +Source-Build validation. + +.DESCRIPTION + +The tooling used for synchronization will clone the VMR repository into a temporary folder if +it does not already exist. These clones can be reused in future synchronizations, so it is +recommended to dedicate a folder for this to speed up re-runs. + +.EXAMPLE + Synchronize current repository into a local VMR: + ./vmr-sync.ps1 -vmrDir "$HOME/repos/dotnet" -tmpDir "$HOME/repos/tmp" + +.PARAMETER tmpDir +Required. Path to the temporary folder where repositories will be cloned + +.PARAMETER vmrBranch +Optional. Branch of the 'dotnet/dotnet' repo to synchronize. The VMR will be checked out to this branch + +.PARAMETER azdevPat +Optional. Azure DevOps PAT to use for cloning private repositories. + +.PARAMETER vmrDir +Optional. Path to the dotnet/dotnet repository. When null, gets cloned to the temporary folder + +.PARAMETER debugOutput +Optional. Enables debug logging in the darc vmr command. + +.PARAMETER ci +Optional. Denotes that the script is running in a CI environment. +#> +param ( + [Parameter(Mandatory=$true, HelpMessage="Path to the temporary folder where repositories will be cloned")] + [string][Alias('t', 'tmp')]$tmpDir, + [string][Alias('b', 'branch')]$vmrBranch, + [string]$remote, + [string]$azdevPat, + [string][Alias('v', 'vmr')]$vmrDir, + [switch]$ci, + [switch]$debugOutput +) + +function Fail { + Write-Host "> $($args[0])" -ForegroundColor 'Red' +} + +function Highlight { + Write-Host "> $($args[0])" -ForegroundColor 'Cyan' +} + +$verbosity = 'verbose' +if ($debugOutput) { + $verbosity = 'debug' +} +# Validation + +if (-not $tmpDir) { + Fail "Missing -tmpDir argument. Please specify the path to the temporary folder where the repositories will be cloned" + exit 1 +} + +# Sanitize the input + +if (-not $vmrDir) { + $vmrDir = Join-Path $tmpDir 'dotnet' +} + +if (-not (Test-Path -Path $tmpDir -PathType Container)) { + New-Item -ItemType Directory -Path $tmpDir | Out-Null +} + +# Prepare the VMR + +if (-not (Test-Path -Path $vmrDir -PathType Container)) { + Highlight "Cloning 'dotnet/dotnet' into $vmrDir.." + git clone https://github.com/dotnet/dotnet $vmrDir + + if ($vmrBranch) { + git -C $vmrDir switch -c $vmrBranch + } +} +else { + if ((git -C $vmrDir diff --quiet) -eq $false) { + Fail "There are changes in the working tree of $vmrDir. Please commit or stash your changes" + exit 1 + } + + if ($vmrBranch) { + Highlight "Preparing $vmrDir" + git -C $vmrDir checkout $vmrBranch + git -C $vmrDir pull + } +} + +Set-StrictMode -Version Latest + +# Prepare darc + +Highlight 'Installing .NET, preparing the tooling..' +. .\eng\common\tools.ps1 +$dotnetRoot = InitializeDotNetCli -install:$true +$dotnet = "$dotnetRoot\dotnet.exe" +& "$dotnet" tool restore + +Highlight "Starting the synchronization of VMR.." + +# Synchronize the VMR +$darcArgs = ( + "darc", "vmr", "forwardflow", + "--tmp", $tmpDir, + "--$verbosity", + $vmrDir +) + +if ($ci) { + $darcArgs += ("--ci") +} + +if ($azdevPat) { + $darcArgs += ("--azdev-pat", $azdevPat) +} + +& "$dotnet" $darcArgs + +if ($LASTEXITCODE -eq 0) { + Highlight "Synchronization succeeded" +} +else { + Fail "Synchronization of repo to VMR failed!" + Fail "'$vmrDir' is left in its last state (re-run of this script will reset it)." + Fail "Please inspect the logs which contain path to the failing patch file (use -debugOutput to get all the details)." + Fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script." + exit 1 +} diff --git a/eng/common/vmr-sync.sh b/eng/common/vmr-sync.sh new file mode 100644 index 00000000000..86d77ccf5b4 --- /dev/null +++ b/eng/common/vmr-sync.sh @@ -0,0 +1,205 @@ +#!/bin/bash + +### This script is used for synchronizing the current repository into a local VMR. +### It pulls the current repository's code into the specified VMR directory for local testing or +### Source-Build validation. +### +### The tooling used for synchronization will clone the VMR repository into a temporary folder if +### it does not already exist. These clones can be reused in future synchronizations, so it is +### recommended to dedicate a folder for this to speed up re-runs. +### +### USAGE: +### Synchronize current repository into a local VMR: +### ./vmr-sync.sh --tmp "$HOME/repos/tmp" "$HOME/repos/dotnet" +### +### Options: +### -t, --tmp, --tmp-dir PATH +### Required. Path to the temporary folder where repositories will be cloned +### +### -b, --branch, --vmr-branch BRANCH_NAME +### Optional. Branch of the 'dotnet/dotnet' repo to synchronize. The VMR will be checked out to this branch +### +### --debug +### Optional. Turns on the most verbose logging for the VMR tooling +### +### --remote name:URI +### Optional. Additional remote to use during the synchronization +### This can be used to synchronize to a commit from a fork of the repository +### Example: 'runtime:https://github.com/yourfork/runtime' +### +### --azdev-pat +### Optional. Azure DevOps PAT to use for cloning private repositories. +### +### -v, --vmr, --vmr-dir PATH +### Optional. Path to the dotnet/dotnet repository. When null, gets cloned to the temporary folder + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +function print_help () { + sed -n '/^### /,/^$/p' "$source" | cut -b 5- +} + +COLOR_RED=$(tput setaf 1 2>/dev/null || true) +COLOR_CYAN=$(tput setaf 6 2>/dev/null || true) +COLOR_CLEAR=$(tput sgr0 2>/dev/null || true) +COLOR_RESET=uniquesearchablestring +FAILURE_PREFIX='> ' + +function fail () { + echo "${COLOR_RED}$FAILURE_PREFIX${1//${COLOR_RESET}/${COLOR_RED}}${COLOR_CLEAR}" >&2 +} + +function highlight () { + echo "${COLOR_CYAN}$FAILURE_PREFIX${1//${COLOR_RESET}/${COLOR_CYAN}}${COLOR_CLEAR}" +} + +tmp_dir='' +vmr_dir='' +vmr_branch='' +additional_remotes='' +verbosity=verbose +azdev_pat='' +ci=false + +while [[ $# -gt 0 ]]; do + opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + case "$opt" in + -t|--tmp|--tmp-dir) + tmp_dir=$2 + shift + ;; + -v|--vmr|--vmr-dir) + vmr_dir=$2 + shift + ;; + -b|--branch|--vmr-branch) + vmr_branch=$2 + shift + ;; + --remote) + additional_remotes="$additional_remotes $2" + shift + ;; + --azdev-pat) + azdev_pat=$2 + shift + ;; + --ci) + ci=true + ;; + -d|--debug) + verbosity=debug + ;; + -h|--help) + print_help + exit 0 + ;; + *) + fail "Invalid argument: $1" + print_help + exit 1 + ;; + esac + + shift +done + +# Validation + +if [[ -z "$tmp_dir" ]]; then + fail "Missing --tmp-dir argument. Please specify the path to the temporary folder where the repositories will be cloned" + exit 1 +fi + +# Sanitize the input + +if [[ -z "$vmr_dir" ]]; then + vmr_dir="$tmp_dir/dotnet" +fi + +if [[ ! -d "$tmp_dir" ]]; then + mkdir -p "$tmp_dir" +fi + +if [[ "$verbosity" == "debug" ]]; then + set -x +fi + +# Prepare the VMR + +if [[ ! -d "$vmr_dir" ]]; then + highlight "Cloning 'dotnet/dotnet' into $vmr_dir.." + git clone https://github.com/dotnet/dotnet "$vmr_dir" + + if [[ -n "$vmr_branch" ]]; then + git -C "$vmr_dir" switch -c "$vmr_branch" + fi +else + if ! git -C "$vmr_dir" diff --quiet; then + fail "There are changes in the working tree of $vmr_dir. Please commit or stash your changes" + exit 1 + fi + + if [[ -n "$vmr_branch" ]]; then + highlight "Preparing $vmr_dir" + git -C "$vmr_dir" checkout "$vmr_branch" + git -C "$vmr_dir" pull + fi +fi + +set -e + +# Prepare darc + +highlight 'Installing .NET, preparing the tooling..' +source "./eng/common/tools.sh" +InitializeDotNetCli true +dotnetDir=$( cd ./.dotnet/; pwd -P ) +dotnet=$dotnetDir/dotnet +"$dotnet" tool restore + +highlight "Starting the synchronization of VMR.." +set +e + +if [[ -n "$additional_remotes" ]]; then + additional_remotes="--additional-remotes $additional_remotes" +fi + +if [[ -n "$azdev_pat" ]]; then + azdev_pat="--azdev-pat $azdev_pat" +fi + +ci_arg='' +if [[ "$ci" == "true" ]]; then + ci_arg="--ci" +fi + +# Synchronize the VMR + +"$dotnet" darc vmr forwardflow \ + --tmp "$tmp_dir" \ + $azdev_pat \ + --$verbosity \ + $ci_arg \ + $additional_remotes \ + "$vmr_dir" + +if [[ $? == 0 ]]; then + highlight "Synchronization succeeded" +else + fail "Synchronization of repo to VMR failed!" + fail "'$vmr_dir' is left in its last state (re-run of this script will reset it)." + fail "Please inspect the logs which contain path to the failing patch file (use --debug to get all the details)." + fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script." + exit 1 +fi diff --git a/global.json b/global.json index a85e3a5fec3..d18020f5c59 100644 --- a/global.json +++ b/global.json @@ -17,7 +17,7 @@ "perl": "5.38.2.2" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25271.1", + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25271.2", "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23255.2" } } diff --git a/proto.proj b/proto.proj index eb0814976ea..313cf2efdca 100644 --- a/proto.proj +++ b/proto.proj @@ -4,10 +4,7 @@ Bootstrap - - +