diff --git a/docs/RFC_Changes.md b/docs/RFC_Changes.md new file mode 100644 index 00000000000..6dfff2e47c8 --- /dev/null +++ b/docs/RFC_Changes.md @@ -0,0 +1,472 @@ +> [!NOTE] +> **Review copy.** This is a working copy of +> [RFC FS-1043](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1043-extension-members-for-operators-and-srtp-constraints.md) +> with implementation-specific amendments. Once the feature ships, the +> canonical RFC in [fsharp/fslang-design](https://github.com/fsharp/fslang-design) +> will be updated and this file removed. + +# F# RFC FS-1043 - Extension members become available to solve operator trait constraints + +These design suggestions: +* https://github.com/fsharp/fslang-suggestions/issues/230 +* https://github.com/fsharp/fslang-suggestions/issues/29 +* https://github.com/fsharp/fslang-suggestions/issues/820 + +have been marked "approved in principle". This RFC covers the detailed proposal for these + +* [x] Approved in principle +* [x] [Discussion](https://github.com/fsharp/fslang-design/issues/435) +* [x] [Implementation](https://github.com/dotnet/fsharp/pull/8404) + + +# Summary +[summary]: #summary + +Extension methods are previously ignored by SRTP constraint resolution. This RFC means they are taken into account. + +For example, consider +```fsharp + +type System.String with + static member ( * ) (foo, n: int) = String.replicate n foo + +let r4 = "r" * 4 +let spaces n = " " * n +``` +Prior to this RFC the result is: +``` +foo.fs(2,21): warning FS1215: Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. +foo.fs(4,16): error FS0001: The type 'int' does not match the type 'string' +``` +With this RFC, the code compiles. + +In addition, this RFC adds an attribute `AllowOverloadOnReturnTypeAttribute` to FSharp.Core to implement suggestion [Consider the return type in overload resolution](https://github.com/fsharp/fslang-suggestions/issues/820). If this is present on any applicable overloads in a method overload resolution, then the return type is also checked/unified when determining overload resolution. Previously, only methods named `op_Explicit` and `op_Implicit` where given this treatment. + +In addition, this RFC makes small technical modifications to the process of solving SRTP constraints. These will be documented in further sections of this RFC. + +# Motivation +[motivation]: #motivation + +It is reasonable to use extension methods to retrofit operators and other semantics on to existing types. This "completes the picture" as extension methods in a natural way. + + +# Detailed design +[design]: #detailed-design + + +## Adding extension members to SRTP constraint solving + +The proposed change is as follows, in the internal logic of the constraint solving process: + +1. During constraint solving, the record of each SRTP constraint incorporates the relevant extension methods in-scope at the point the SRTP constraint is asserted. That is, at the point a generic construct is used and "freshened". The accessibility domain (i.e. the information indicating accessible methods) is also noted as part of the constraint. Both of these pieces of information are propagated as part of the constraint. We call these the *trait possible extension solutions* and the *trait accessor domain* + +2. When checking whether one unsolved SRTP constraint A *implies* another B (note: this a process used to avoid asserting duplicate constraints when propagating a constraint from one type parameter to another - see `implies` in `ConstraintSolver.fs`), both the possible extension solutions and the accessor domain of A are ignored, and those of the existing asserted constraint are preferred. + +3. When checking whether one unsolved SRTP constraint is *consistent* with another (note: this is a process used to check for inconsistency errors amongst a set of constraints - see `consistent` in `ConstraintSolver.fs`), the possible extension solutions and accessor domain are ignored. + +4. When attempting to solve the constraint via overload resolution, the possible extension solutions which are accessible from the trait accessor domain are taken into account. + +5. Built-in constraint solutions for things like `op_Addition` constraints are applied if and when the relevant types match precisely, and are applied even if some extension methods of that name are available. + +## Weak resolution no longer forces overload resolution for SRTP constraints prior to generalizing `inline` code + +Prior to this RFC, for generic inline code we apply "weak resolution" to constraints prior to generalization. + +Consider this: +``` +open System +let inline f1 (x: DateTime) y = x + y;; +let inline f2 (x: DateTime) y = x - y;; +``` +The relevant available overloads are: +```fsharp +type System.DateTime with + static member op_Addition: DateTime * TimeSpan -> DateTime + static member op_Subtraction: DateTime * TimeSpan -> DateTime + static member op_Subtraction: DateTime * DateTime -> TimeSpan +``` +Prior to this RFC, `f1` is generalized to **non-generic** code, and `f2` is correctly generalized to generic code, as seen by these types: +``` +val inline f1 : x:DateTime -> y:TimeSpan -> DateTime +val inline f2 : x:DateTime -> y: ^a -> ^b when (DateTime or ^a) : (static member ( - ) : System.DateTime * ^a -> ^b) +``` +Why? Well, prior to this RFC, generalization invokes "weak resolution" for both inline and non-inline code. This caused +overload resolution to be applied even though the second parameter type of "y" is not known. + +* In the first case, overload resolution for `op_Addition` succeeded because there is only one overload. + +* In the second case, overload resolution for `op_Subtraction` failed because there are two overloads. The failure is ignored, and the code is left generic. + +For non-inline code and primitive types this "weak resolution" process is reasonable. But for inline code it was incorrect, especially in the context of this RFC, because future extension methods may now provide additional witnesses for `+` on DateTime and some other type. + +In this RFC, we disable weak resolution for inline code for cases that involve true overload resolution. This changes +inferred types in some situations, e.g. with this RFC the type is now as follows: +``` +> let inline f1 (x: DateTime) y = x + y;; +val inline f1 : x:DateTime -> y: ^a -> ^b when (DateTime or ^a) : (static member ( + ) : DateTime * ^a -> ^b) +``` + +Some signatures files may need to be updated to account for this change. + +### Concrete inference example + +When extension operators are in scope, weak resolution is suppressed for inline code: + +```fsharp +// No extension operators in scope → unchanged behavior: +let inline f x = x + 1 // val inline f : int -> int + +// Extension operator in scope → constraint stays open: +type System.String with + static member (+) (s: string, n: int) = s + string n + +let inline f x = x + 1 // val inline f : x: ^a -> ^b when ( ^a or int) : (static member ( + ) : ^a * int -> ^b) + +// Explicit annotations always pin the type: +let inline f (x: int) = x + 1 // val inline f : int -> int +``` + +Code that binds such a function to a monomorphic type (`let g : int -> int = f`) will need annotation when the inferred type becomes generic. + + + +# Drawbacks +[drawbacks]: #drawbacks + +* This slightly strengthens the "type-class"-like capabilities of SRTP resolution. This means that people may increasingly use SRTP code as a way to write generic, reusable code rather than passing parameters explicitly. While this is reasonable for generic arithmetic code, it has many downsides when applied to other things. + +# Alternatives +[alternatives]: #alternatives + +1. Don't do it + + +# Examples + +## Widening to specific type + +**NOTE: this is an example of what is allowed by this RFC, but is not necessarily recommended for standard F# coding. In particular error messages may degrade for existing code, and extensive further prelude definitions would be required to give a consistent programming model.** + +By default `1 + 2.0` doesn't check in F#. By using extension members to provide additional overloads for addition you can make this check. Note that the set of available extensions determines the "numeric hierarchy" and is used to augment the operators, not the actual numeric types themselves. +```fsharp + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + static member inline widen_to_single (a: int32) : single = single a + static member inline widen_to_double (a: int32) : double = double a + +type System.Single with + static member inline widen_to_double (a: int) : double = double a + +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) +let inline widen_to_single (x: ^T) : single = (^T : (static member widen_to_single : ^T -> single) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen_to_int64 b + static member inline (+)(a: 'T, b: int64) : int64 = widen_to_int64 a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen_to_single b + static member inline (+)(a: 'T, b: single) : single = widen_to_single a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b + +let examples() = + + (1 + 2L) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + (1L + 2) |> ignore + (1L + 2.0) |> ignore +``` + +## Defining safe conversion corresponding to `op_Implicit` + +**NOTE: this is an example of what is allowed by this RFC, but is not necessarily recommended for standard F# coding. In particular compiler performance is poor when resolving heavily overloaded constraints.** + +By default there is no function which captures the notion of .NET's safe `op_Implicit` conversion in F# (though note +the conversion is still explicit in F# code, not implicit). + +You can define one like this: +``` +let inline implicitConv (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) +``` +With this RFC you can then populate this with instances for existing primitive types: +```fsharp +type System.SByte with + static member inline op_Implicit (a: sbyte) : int16 = int16 a + static member inline op_Implicit (a: sbyte) : int32 = int32 a + static member inline op_Implicit (a: sbyte) : int64 = int64 a + static member inline op_Implicit (a: sbyte) : nativeint = nativeint a + static member inline op_Implicit (a: sbyte) : single = single a + static member inline op_Implicit (a: sbyte) : double = double a + +type System.Byte with + static member inline op_Implicit (a: byte) : int16 = int16 a + static member inline op_Implicit (a: byte) : uint16 = uint16 a + static member inline op_Implicit (a: byte) : int32 = int32 a + static member inline op_Implicit (a: byte) : uint32 = uint32 a + static member inline op_Implicit (a: byte) : int64 = int64 a + static member inline op_Implicit (a: byte) : uint64 = uint64 a + static member inline op_Implicit (a: byte) : nativeint = nativeint a + static member inline op_Implicit (a: byte) : unativeint = unativeint a + static member inline op_Implicit (a: byte) : single = single a + static member inline op_Implicit (a: byte) : double = double a + +type System.Int16 with + static member inline op_Implicit (a: int16) : int32 = int32 a + static member inline op_Implicit (a: int16) : int64 = int64 a + static member inline op_Implicit (a: int16) : nativeint = nativeint a + static member inline op_Implicit (a: int16) : single = single a + static member inline op_Implicit (a: int16) : double = double a + +type System.UInt16 with + static member inline op_Implicit (a: uint16) : int32 = int32 a + static member inline op_Implicit (a: uint16) : uint32 = uint32 a + static member inline op_Implicit (a: uint16) : int64 = int64 a + static member inline op_Implicit (a: uint16) : uint64 = uint64 a + static member inline op_Implicit (a: uint16) : nativeint = nativeint a + static member inline op_Implicit (a: uint16) : unativeint = unativeint a + static member inline op_Implicit (a: uint16) : single = single a + static member inline op_Implicit (a: uint16) : double = double a + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + static member inline op_Implicit (a: int32) : nativeint = nativeint a + static member inline op_Implicit (a: int32) : single = single a + static member inline op_Implicit (a: int32) : double = double a + +type System.UInt32 with + static member inline op_Implicit (a: uint32) : int64 = int64 a + static member inline op_Implicit (a: uint32) : uint64 = uint64 a + static member inline op_Implicit (a: uint32) : unativeint = unativeint a + static member inline op_Implicit (a: uint32) : single = single a + static member inline op_Implicit (a: uint32) : double = double a + +type System.Int64 with + static member inline op_Implicit (a: int64) : double = double a + +type System.UInt64 with + static member inline op_Implicit (a: uint64) : double = double a + +type System.IntPtr with + static member inline op_Implicit (a: nativeint) : int64 = int64 a + static member inline op_Implicit (a: nativeint) : double = double a + +type System.UIntPtr with + static member inline op_Implicit (a: unativeint) : uint64 = uint64 a + static member inline op_Implicit (a: unativeint) : double = double a + +type System.Single with + static member inline op_Implicit (a: int) : double = double a +``` + + +# Interop + +* C# consumers see no difference — extension SRTP constraints are an F#-only concept resolved at compile time. The emitted IL is standard .NET. +* Extension members solve structural SRTP constraints but do *not* make a type satisfy nominal static abstract interface constraints (`INumber<'T>`, `IAdditionOperators<'T,'T,'T>`, etc.). IWSAMs ([FS-1124](https://github.com/fsharp/fslang-design/blob/main/FSharp-7.0/FS-1124-interfaces-with-static-abstract-members.md)) and extension SRTP solving are orthogonal resolution mechanisms. + +# Pragmatics + +## Diagnostics + +* **FS1215** ("Extension members cannot provide operator overloads"): no longer emitted when the feature is enabled, because extension operators are now valid SRTP witnesses. Fires as before when the feature is disabled. +* Overload ambiguity introduced by extension methods uses existing error codes; no additional diagnostics for that case. + +## Tooling + +* **Tooltips**: will show the more generic inferred type for inline functions (e.g., `^a -> ^b when ...` instead of `int -> int`). This is correct behavior. +* **Auto-complete**: extension operators now appear in SRTP-resolved member lists when the feature is enabled. +* No changes to debugging, breakpoints, colorization, or brace matching. + +## Performance + +* Extension method lookup during SRTP constraint solving adds overhead proportional to the number of extension methods in scope. The RFC note on `op_Implicit` ("compiler performance is poor when resolving heavily overloaded constraints") applies here as well. +* Resolution cost is proportional to the candidate set size per constraint. Libraries such as FSharpPlus that define many overloads per operator family may observe measurable slowdown; profiling is ongoing. +* No impact on generated code performance — the resolved call sites are identical. + +## Witnesses + +Extension members now participate as witnesses for SRTP constraints (see [RFC FS-1071](https://github.com/fsharp/fslang-design/blob/main/FSharp-5.0/FS-1071-witness-passing-quotations.md)). Quotations of inline SRTP calls may now capture extension methods as witnesses: + +```fsharp +type [] MyNum = { V: int } + +[] +module MyNumExt = + type MyNum with + static member inline (+) (a: MyNum, b: MyNum) = { V = a.V + b.V } + +let inline add x y = x + y +let q = <@ add { V = 1 } { V = 2 } @> // witness is MyNumExt.(+) +``` + +## Binary compatibility (pickling) + +The *trait possible extension solutions* and *trait accessor domain* (design points 1–4) are **not** serialized into compiled DLLs. They exist only during in-process constraint solving and are discarded before metadata emission. Consequently: + +* Cross-version binary compatibility is unaffected — no new fields are added to the pickled SRTP constraint format. +* When an `inline` function is consumed from a compiled DLL, extension operators available at the *consumer's* call site are used for constraint solving, not those that were in scope when the library was compiled. This is consistent with how SRTP constraints are freshened at each use site. + + + +# Compatibility +[compatibility]: #compatibility + +Status: This RFC **is** a breaking change, gated behind `--langversion:preview`. + +**What breaks**: +- Inferred types of inline SRTP functions become more generic when extension operators are in scope (e.g., `val inline f : int -> int` → `val inline f : x: ^a -> ^b when ...`). Signature files need updating. +- `let g : int -> int = f` stops compiling when `f` is now generic — needs annotation. +- Extension methods in SRTP resolution may introduce new overload ambiguity at call sites, including concretely-typed ones where a new extension candidate is in scope. +- The set of functions whose non-inline invocation throws `NotSupportedException` at runtime grows: previously, weak resolution eagerly picked a concrete implementation; now the constraint may stay open, and the non-witness fallback method body throws. +- `AllowOverloadOnReturnTypeAttribute` changes overload resolution behavior: when present on any applicable overload, the return type is unified during resolution. Existing code relying on the current resolution order (which ignores return types except for `op_Explicit`/`op_Implicit`) may select a different overload or become ambiguous. + +**What does NOT break**: +- Call sites with concrete arguments **and no extension operators in scope** are unaffected. +- Call-site operator resolution for primitive types without in-scope extensions. + +**FSharpPlus coordination**: Deferred; see workarounds documented below. + +**Risk mitigation**: + +1. Extension methods are lower priority in overload resolution. +2. For built-in operators like `(+)`, there will be relatively few candidate extension methods in F# code. +3. Nearly all SRTP constraints for built-in operators are on static members, and C# code can't introduce static extension members. + +Weak resolution changes ("Weak Resolution no longer forces overload resolution...") are a significant improvement. However, one case has been identified where complex SRTP code such as found in FSharpPlus no longer compiles under this change. + +### Example + +Here is a standalone repro reduced substantially, and where many types are made more explicit: +```fsharp +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + + // A simulated collection +type Coll<'T>() = + + // A simulated 'Map' witness + static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>() +``` +Now consider this generic inline code: +```fsharp +let inline MapTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + InvokeMap ((+) v) (InvokeMap ((+) v) x) +``` + +### Explanation + +The characteristics are +1. There is no overloading directly, but this code is generic and there is the *potential* for further overloading by adding further extension methods. + +2. The definition of the member constraint allows resolution by **return type**, e.g. `(^I or ^R)` for `Map` . Because of this, the return type of the inner `InvokeMap` call is **not** known to be `Coll` until weak resolution is applied to the constraints. This is because extra overloads could in theory be added via new witnesses mapping the collection to a different collection type. + +3. The resolution of the nested member constraints will eventually imply that the type variable `'a` support the addition operator. + However after this RFC, the generic function `MapTwice` now gets generalized **before** the member constraints are fully solved + and the return types known. The process of generalizing the function makes the type variable `'a` rigid (generalized). The + member constraints are then solved via weak resolution in the final phase of inference, and the return type of `InvokeMap` + is determined to be a `ZipList`, and the `'a` variable now requires an addition operator. Because the code has already + been generalized the process of asserting this constraint fails with an obscure error message. + +### Workarounds + +There are numerous workarounds: + +1. sequentialize the constraint problem rather than combining the resolution of the `Apply` and `Map` methods, e.g. +```fsharp +let inline (+) (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + let f = InvokeMap (+) x + InvokeApply f y +``` + This works because using `let f = InvokeMap (+) x` forces weak resolution of the constraints involved in this construct (whereas passing `InvokeMap (+) x` directly as an argument to `InvokeApply f y` leaves the resolution delayed). + +2. Another approach is to annotate, e.g. +```fsharp +let inline (+) (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + InvokeApply (InvokeMap ((+): 'a -> 'a -> 'a) x) y +``` + This works because the type annotation means the `op_Addition` constraint is immediately associated with the type variable `'a` that is part of the function signature. + +3. Another approach (and likely the best) is to **no longer use return types as support types** in this kind of generic code. (The use of return types as support types in such cases in FSharpPlus was basically "only" to delay weak resolution anyway.) This means using this definition: + +```fsharp +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) +``` +instead of +```fsharp +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I or ^R) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) +``` + + With this change the code compiles. + +This is the only known example of this pattern in FSharpPlus. However, client code of FSharpPlus may also encounter this issue. In general, this may occur whenever there is + +``` + let inline SomeGenericFunction (...) = + ...some composition of FSharpPlus operations that use return types to resolve member constraints.... +``` + +We expect this pattern to happening in client code of FSharpPlus code. The recommendation is: + +1. We keep the change to avoid weak resolution as part of the RFC + +2. We adjust FSharpPlus to no longer use return types as resolvers unless absolutely necessary + +3. We apply workarounds for client code by adding further type annotations + +As part of this RFC we should also deliver a guide on writing SRTP code that documents cases like this and +gives guidelines about their use. + +### Slightly Larger Example + +For completeness here's a longer example of this problem: +```fsharp +module Lib + +let inline CallApplyMethod (input1: ^I1, input2: ^I2, mthd : ^M) : ^R = + ((^M or ^I1 or ^I2 or ^R) : (static member ApplyMethod : ^I1 * ^I2 * ^M -> ^R) input1, input2, mthd) + +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I or ^R) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) + +type Apply = + static member inline ApplyMethod (f: ^AF, x: ^AX, _mthd:Apply) : ^AOut = ((^AF or ^AX) : (static member Apply : ^AF * ^AX -> ^AOut) f, x) + +type Map = + static member inline MapMethod ((x: ^FT, f: 'T->'U), _mthd: Map) : ^R = (^FT : (static member Map : ^FT * ('T -> 'U) -> ^R) x, f) + +let inline InvokeApply (f: ^AF) (x: ^AX) : ^AOut = CallApplyMethod(f, x, Unchecked.defaultof) + +let inline InvokeMap (mapping: 'T->'U) (source: ^FT) : ^FU = CallMapMethod (mapping, source, Unchecked.defaultof< ^FU >, Unchecked.defaultof) + +[] +type ZipList<'s>() = + + static member Map (_xs: ZipList<'a>, _f: 'a->'b) : ZipList<'b> = failwith "" + + static member Apply (_fs: ZipList<'a->'b>, _xs: ZipList<'a>) : ZipList<'b> = failwith "" +``` +The following code fails to compile with this RFC activated: +```fsharp +let inline AddZipLists (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + InvokeApply (InvokeMap (+) x) y +``` + +# Unresolved questions +[unresolved]: #unresolved-questions + +* [x] Points 2 & 3 (`consistent` and `implies`) are subtle. The test cases where constraints flow together from different accessibility +domains were expanded to try to identify a case where this matters. However it is actually very hard and artificial to construct tests where this matters, because SRTP constraints are typically freshened +and solved within quite small scopes where the available methods and accessibility domain is always consistent. + + **Resolution**: Tested with two modules each providing extension operators on the same type; constraints flow correctly when both are opened (see `IWSAMsAndSRTPsTests.fs` and `SRTPExtensionOperatorTests`). The invariant holds because SRTP constraints are freshened locally per use site, so the accessibility domain is always consistent within a single constraint-solving scope. No failing cases found; remaining risk is low. + + diff --git a/docs/RFC_Original.md b/docs/RFC_Original.md new file mode 100644 index 00000000000..4be27a74c20 --- /dev/null +++ b/docs/RFC_Original.md @@ -0,0 +1,391 @@ +> [!NOTE] +> **Unmodified copy.** This is an exact copy of +> [FS-1043 in fsharp/fslang-design](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1043-extension-members-for-operators-and-srtp-constraints.md), +> included here for reviewer convenience. See `RFC_Changes.md` for the amended version. + +# F# RFC FS-1043 - Extension members become available to solve operator trait constraints + +These design suggestions: +* https://github.com/fsharp/fslang-suggestions/issues/230 +* https://github.com/fsharp/fslang-suggestions/issues/29 +* https://github.com/fsharp/fslang-suggestions/issues/820 + +have been marked "approved in principle". This RFC covers the detailed proposal for these + +* [x] Approved in principle +* [x] [Discussion](https://github.com/fsharp/fslang-design/issues/435) +* [x] [Implementation](https://github.com/dotnet/fsharp/pull/8404) + + +# Summary +[summary]: #summary + +Extension methods are previously ignored by SRTP constraint resolution. This RFC means they are taken into account. + +For example, consider +```fsharp + +type System.String with + static member ( * ) (foo, n: int) = String.replicate n foo + +let r4 = "r" * 4 +let spaces n = " " * n +``` +Prior to this RFC the result is: +``` +foo.fs(2,21): warning FS1215: Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. +foo.fs(4,16): error FS0001: The type 'int' does not match the type 'string' +``` +With this RFC, the code compiles. + +In addition, this RFC adds an attribute `AllowOverloadOnReturnTypeAttribute` to FSharp.Core to implement suggestion [Consider the return type in overload resolution](https://github.com/fsharp/fslang-suggestions/issues/820). If this is present on any applicable overloads in a method overload resolution, then the return type is also checked/unified when determining overload resolution. Previously, only methods named `op_Explicit` and `op_Implicit` where given this treatment. + +In addition, this RFC makes small technical modifications to the process of solving SRTP constraints. These will be documented in further sections of this RFC. + +# Motivation +[motivation]: #motivation + +It is reasonable to use extension methods to retrofit operators and other semantics on to existing types. This "completes the picture" as extension methods in a natural way. + + +# Detailed design +[design]: #detailed-design + + +## Adding extension members to SRTP constraint solving + +The proposed change is as follows, in the internal logic of the constraint solving process: + +1. During constraint solving, the record of each SRTP constraint incorporates the relevant extension methods in-scope at the point the SRTP constraint is asserted. That is, at the point a generic construct is used and "freshened". The accessibility domain (i.e. the information indicating accessible methods) is also noted as part of the constraint. Both of these pieces of information are propagated as part of the constraint. We call these the *trait possible extension solutions* and the *trait accessor domain* + +2. When checking whether one unsolved SRTP constraint A *implies* another B (note: this a process used to avoid asserting duplicate constraints when propagating a constraint from one type parameter to another - see `implies` in `ConstraintSolver.fs`), both the possible extension solutions and the accessor domain of A are ignored, and those of the existing asserted constraint are preferred. + +3. When checking whether one unsolved SRTP constraint is *consistent* with another (note: this is a process used to check for inconsistency errors amongst a set of constraints - see `consistent` in `ConstraintSolver.fs`), the possible extension solutions and accessor domain are ignored. + +4. When attempting to solve the constraint via overload resolution, the possible extension solutions which are accessible from the trait accessor domain are taken into account. + +5. Built-in constraint solutions for things like `op_Addition` constraints are applied if and when the relevant types match precisely, and are applied even if some extension methods of that name are available. + +## Weak resolution no longer forces overload resolution for SRTP constraints prior to generalizing `inline` code + +Prior to this RFC, for generic inline code we apply "weak resolution" to constraints prior to generalization. + +Consider this: +``` +open System +let inline f1 (x: DateTime) y = x + y;; +let inline f2 (x: DateTime) y = x - y;; +``` +The relevant available overloads are: +```fsharp +type System.DateTime with + static member op_Addition: DateTime * TimeSpan -> DateTime + static member op_Subtraction: DateTime * TimeSpan -> DateTime + static member op_Subtraction: DateTime * DateTime -> TimeSpan +``` +Prior to this RFC, `f1` is generalized to **non-generic** code, and `f2` is correctly generalized to generic code, as seen by these types: +``` +val inline f1 : x:DateTime -> y:TimeSpan -> DateTime +val inline f2 : x:DateTime -> y: ^a -> ^b when (DateTime or ^a) : (static member ( - ) : System.DateTime * ^a -> ^b) +``` +Why? Well, prior to this RFC, generalization invokes "weak resolution" for both inline and non-inline code. This caused +overload resolution to be applied even though the second parameter type of "y" is not known. + +* In the first case, overload resolution for `op_Addition` succeeded because there is only one overload. + +* In the second case, overload resolution for `op_Subtraction` failed because there are two overloads. The failure is ignored, and the code is left generic. + +For non-inline code and primitive types this "weak resolution" process is reasonable. But for inline code it was incorrect, especially in the context of this RFC, because future extension methods may now provide additional witnesses for `+` on DateTime and some other type. + +In this RFC, we disable weak resolution for inline code for cases that involve true overload resolution. This changes +inferred types in some situations, e.g. with this RFC the type is now as follows: +``` +> let inline f1 (x: DateTime) y = x + y;; +val inline f1 : x:DateTime -> y: ^a -> ^b when (DateTime or ^a) : (static member ( + ) : DateTime * ^a -> ^b) +``` + +Some signatures files may need to be updated to account for this change. + + +# Drawbacks +[drawbacks]: #drawbacks + +* This slightly strengthens the "type-class"-like capabilities of SRTP resolution. This means that people may increasingly use SRTP code as a way to write generic, reusable code rather than passing parameters explicitly. While this is reasonable for generic arithmetic code, it has many downsides when applied to other things. + +# Alternatives +[alternatives]: #alternatives + +1. Don't do it + + +# Examples + +## Widening to specific type + +**NOTE: this is an example of what is allowed by this RFC, but is not necessarily recommended for standard F# coding. In particular error messages may degrade for existing code, and extensive further prelude definitions would be required to give a consistent programming model.** + +By default `1 + 2.0` doesn't check in F#. By using extension members to provide additional overloads for addition you can make this check. Note that the set of available extensions determines the "numeric hierarchy" and is used to augment the operators, not the actual numeric types themselves. +```fsharp + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + static member inline widen_to_single (a: int32) : single = single a + static member inline widen_to_double (a: int32) : double = double a + +type System.Single with + static member inline widen_to_double (a: int) : double = double a + +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) +let inline widen_to_single (x: ^T) : single = (^T : (static member widen_to_single : ^T -> single) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen_to_int64 b + static member inline (+)(a: 'T, b: int64) : int64 = widen_to_int64 a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen_to_single b + static member inline (+)(a: 'T, b: single) : single = widen_to_single a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b + +let examples() = + + (1 + 2L) |> ignore + (1 + 2.0f) |> ignore + (1 + 2.0) |> ignore + + (1L + 2) |> ignore + (1L + 2.0) |> ignore +``` + +## Defining safe conversion corresponding to `op_Implicit` + +**NOTE: this is an example of what is allowed by this RFC, but is not necessarily recommended for standard F# coding. In particular compiler performance is poor when resolving heavily overloaded constraints.** + +By default there is no function which captures the notion of .NET's safe `op_Implicit` conversion in F# (though note +the conversion is still explicit in F# code, not implicit). + +You can define one like this: +``` +let inline implicitConv (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) +``` +With this RFC you can then populate this with instances for existing primitive types: +```fsharp +type System.SByte with + static member inline op_Implicit (a: sbyte) : int16 = int16 a + static member inline op_Implicit (a: sbyte) : int32 = int32 a + static member inline op_Implicit (a: sbyte) : int64 = int64 a + static member inline op_Implicit (a: sbyte) : nativeint = nativeint a + static member inline op_Implicit (a: sbyte) : single = single a + static member inline op_Implicit (a: sbyte) : double = double a + +type System.Byte with + static member inline op_Implicit (a: byte) : int16 = int16 a + static member inline op_Implicit (a: byte) : uint16 = uint16 a + static member inline op_Implicit (a: byte) : int32 = int32 a + static member inline op_Implicit (a: byte) : uint32 = uint32 a + static member inline op_Implicit (a: byte) : int64 = int64 a + static member inline op_Implicit (a: byte) : uint64 = uint64 a + static member inline op_Implicit (a: byte) : nativeint = nativeint a + static member inline op_Implicit (a: byte) : unativeint = unativeint a + static member inline op_Implicit (a: byte) : single = single a + static member inline op_Implicit (a: byte) : double = double a + +type System.Int16 with + static member inline op_Implicit (a: int16) : int32 = int32 a + static member inline op_Implicit (a: int16) : int64 = int64 a + static member inline op_Implicit (a: int16) : nativeint = nativeint a + static member inline op_Implicit (a: int16) : single = single a + static member inline op_Implicit (a: int16) : double = double a + +type System.UInt16 with + static member inline op_Implicit (a: uint16) : int32 = int32 a + static member inline op_Implicit (a: uint16) : uint32 = uint32 a + static member inline op_Implicit (a: uint16) : int64 = int64 a + static member inline op_Implicit (a: uint16) : uint64 = uint64 a + static member inline op_Implicit (a: uint16) : nativeint = nativeint a + static member inline op_Implicit (a: uint16) : unativeint = unativeint a + static member inline op_Implicit (a: uint16) : single = single a + static member inline op_Implicit (a: uint16) : double = double a + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + static member inline op_Implicit (a: int32) : nativeint = nativeint a + static member inline op_Implicit (a: int32) : single = single a + static member inline op_Implicit (a: int32) : double = double a + +type System.UInt32 with + static member inline op_Implicit (a: uint32) : int64 = int64 a + static member inline op_Implicit (a: uint32) : uint64 = uint64 a + static member inline op_Implicit (a: uint32) : unativeint = unativeint a + static member inline op_Implicit (a: uint32) : single = single a + static member inline op_Implicit (a: uint32) : double = double a + +type System.Int64 with + static member inline op_Implicit (a: int64) : double = double a + +type System.UInt64 with + static member inline op_Implicit (a: uint64) : double = double a + +type System.IntPtr with + static member inline op_Implicit (a: nativeint) : int64 = int64 a + static member inline op_Implicit (a: nativeint) : double = double a + +type System.UIntPtr with + static member inline op_Implicit (a: unativeint) : uint64 = uint64 a + static member inline op_Implicit (a: unativeint) : double = double a + +type System.Single with + static member inline op_Implicit (a: int) : double = double a +``` + + +# Compatibility +[compatibility]: #compatibility + +Status: We are trying to determine when/if this RFC is a breaking change. + +We assume it must be a breaking change, because additional methods are taken into account in the overload resolution used in SRTP constraint resolution. That must surely cause it to fail where it would have succeeded before. However, + +1. All the new methods are extension methods, which are lower priority in overload resolution + +Even if it's theoretically a breaking change, we may still decide it's worthwhile because the risk of change is low. This seems plausible because + +1. Taking the extra existing extension methods into account is natural and a lot like an addition to the .NET libraries causing overload resolution to fail. We don't really consider that a breaking change (partly because this is measured differently for C# and F#, as they have different sensitivities to adding overloads). + +2. For the built-in operators like `(+)`, there will be relatively few such candidate extension methods in F# code because we give warnings when users try to add extension methods for these + +3. Nearly all SRTP constraints (at least the ones for built-in operators) are on static members, and C# code can't introduce extension members that are static - just instance ones. So C# extension members will only cause compat concern for F# code using SRTP constraints on instance members, AND where the C# extension methods make a difference to overload resolution. + +Still, we're pretty sure this must be a breaking change. We would appreciate help construct test cases where it is/isn't. + +I'm examining some consequences of the part of this RFC "Weak Resolution no longer forces overload resolution...". In general this seems a great improvement. However, I have found one case where, for the complicated SRTP code such as found in FSharpPlus, existing code no longer compiles. + +### Example + +Here is a standalone repro reduced substantially, and where many types are made more explicit: +```fsharp +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + + // A simulated collection +type Coll<'T>() = + + // A simulated 'Map' witness + static member Map (source: Coll<'a>, mapping: 'a->'b) : Coll<'b> = new Coll<'b>() +``` +Now consider this generic inline code: +```fsharp +let inline MapTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + InvokeMap ((+) v) (InvokeMap ((+) v) x) +``` + +### Explanation + +The characteristics are +1. There is no overloading directly, but this code is generic and there is the *potential* for further overloading by adding further extension methods. + +2. The definition of the member constraint allows resolution by **return type**, e.g. `(^I or ^R)` for `Map` . Because of this, the return type of the inner `InvokeMap` call is **not** known to be `Coll` until weak resolution is applied to the constraints. This is because extra overloads could in theory be added via new witnesses mapping the collection to a different collection type. + +3. The resolution of the nested member constraints will eventually imply that the type variable `'a` support the addition operator. + However after this RFC, the generic function `MapTwice` now gets generalized **before** the member constraints are fully solved + and the return types known. The process of generalizing the function makes the type variable `'a` rigid (generalized). The + member constraints are then solved via weak resolution in the final phase of inference, and the return type of `InvokeMap` + is determined to be a `ZipList`, and the `'a` variable now requires an addition operator. Because the code has already + been generalized the process of asserting this constraint fails with an obscure error message. + +### Workarounds + +There are numerous workarounds: + +1. sequentialize the constraint problem rather than combining the resolution of the `Apply` and `Map` methods, e.g. +```fsharp +let inline (+) (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + let f = InvokeMap (+) x + InvokeApply f y +``` + This works because using `let f = InvokeMap (+) x` forces weak resolution of the constraints involved in this construct (whereas passing `InvokeMap (+) x` directly as an argument to `InvokeApply f y` leaves the resolution delayed). + +2. Another approach is to annotate, e.g. +```fsharp +let inline (+) (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + InvokeApply (InvokeMap ((+): 'a -> 'a -> 'a) x) y +``` + This works because the type annotation means the `op_Addition` constraint is immediately associated with the type variable `'a` that is part of the function signature. + +3. Another approach (and likely the best) is to **no longer use return types as support types** in this kind of generic code. (My understanding is that the use of return types as support types in such cases FSharpPlus was basically "only" to delay weak resolution anyway). This means using this definition: + +```fsharp +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) +``` +instead of +```fsharp +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I or ^R) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) +``` + + With this change the code compiles. + +This is the only example I've found of this in FSharpPlus. However I guess there may be client code of FSharpPlus that hits this problems. In general I suppose it may result whenever we have + +``` + let inline SomeGenericFunction (...) = + ...some composition of FSharpPlus operations that use return types to resolve member constraints.... +``` + +We expect this pattern to happening in client code of FSharpPlus code. The recommendation is: + +1. We keep the change to avoid weak resolution as part of the RFC + +2. We adjust FSharpPlus to no longer use return types as resolvers unless absolutely necessary + +3. We apply workarounds for client code by adding further type annotations + +As part of this RFC we should also deliver a guide on writing SRTP code that documents cases like this and +gives guidelines about their use. + +### Slightly Larger Example + +For completeness here's a longer example of this problem: +```fsharp +module Lib + +let inline CallApplyMethod (input1: ^I1, input2: ^I2, mthd : ^M) : ^R = + ((^M or ^I1 or ^I2 or ^R) : (static member ApplyMethod : ^I1 * ^I2 * ^M -> ^R) input1, input2, mthd) + +let inline CallMapMethod (mapping: ^F, source: ^I, _output: ^R, mthd: ^M) = + ((^M or ^I or ^R) : (static member MapMethod : (^I * ^F) * ^M -> ^R) (source, mapping), mthd) + +type Apply = + static member inline ApplyMethod (f: ^AF, x: ^AX, _mthd:Apply) : ^AOut = ((^AF or ^AX) : (static member Apply : ^AF * ^AX -> ^AOut) f, x) + +type Map = + static member inline MapMethod ((x: ^FT, f: 'T->'U), _mthd: Map) : ^R = (^FT : (static member Map : ^FT * ('T -> 'U) -> ^R) x, f) + +let inline InvokeApply (f: ^AF) (x: ^AX) : ^AOut = CallApplyMethod(f, x, Unchecked.defaultof) + +let inline InvokeMap (mapping: 'T->'U) (source: ^FT) : ^FU = CallMapMethod (mapping, source, Unchecked.defaultof< ^FU >, Unchecked.defaultof) + +[] +type ZipList<'s>() = + + static member Map (_xs: ZipList<'a>, _f: 'a->'b) : ZipList<'b> = failwith "" + + static member Apply (_fs: ZipList<'a->'b>, _xs: ZipList<'a>) : ZipList<'b> = failwith "" +``` +The following code fails to compile with this RFC activated: +```fsharp +let inline AddZipLists (x: ZipList<'a>, y: ZipList<'a>) : ZipList<'a> = + InvokeApply (InvokeMap (+) x) y +``` + +# Unresolved questions +[unresolved]: #unresolved-questions + +* [ ] Points 2 & 3 (`consistent` and `implies`) are subtle and I will attempt to expand the test cases where constraints flow together from different accessibility +domains to try to identify a case where this matters. However it's actually very hard and artificial to construct tests where this matters, because SRTP constraints are typically freshened +and solved within quite small scopes where the available methods and accessibility domain is always consistent. diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index d97ef294125..40ecd20aea5 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -1,8 +1,31 @@ ### Added +* **Extension members for operators and SRTP constraints** ([RFC FS-1043](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1043-extension-members-for-operators-and-srtp-constraints.md), [fslang-suggestions#230](https://github.com/fsharp/fslang-suggestions/issues/230)): Extension methods now participate in SRTP constraint resolution. This allows defining operators on types you don't own via type extensions: + + ```fsharp + type System.String with + static member (*) (s: string, n: int) = String.replicate n s + + let inline multiply (x: ^T) (n: int) = x * n + let result = multiply "ha" 3 // "hahaha" + ``` + + **Feature flag:** `--langversion:preview` (feature name: `ExtensionConstraintSolutions`) + + **Includes:** + - Extension operators resolve via SRTP constraints (suggestion #230) + - Intrinsic members take priority over extension members + - FS1215 warning suppressed when defining extension operators with preview langversion + - Weak resolution disabled for inline code, keeping SRTP constraints generic + - `[]` attribute for defining overloads that differ only by return type (suggestion #820). When applied, return-type information is used during overload resolution to disambiguate call sites. + - Cross-assembly resolution: extension operators defined in referenced assemblies are resolved via SRTP constraints + - Extension members solve SRTP constraints but do *not* satisfy nominal static abstract interface constraints (IWSAMs). These are orthogonal mechanisms. + - Tuple type extensions using syntactic tuple notation: `type ('T1 * 'T2) with` for reference tuples and `type struct ('T1 * 'T2) with` for struct tuples. These are transformed to `System.Tuple<'T1,'T2>` and `System.ValueTuple<'T1,'T2>` extensions respectively. * Warn (FS3884) when a function or delegate value is used as an interpolated string argument, since it will be formatted via `ToString` rather than being applied. ([PR #19289](https://github.com/dotnet/fsharp/pull/19289)) * Added `MethodOverloadsCache` language feature (preview) that caches overload resolution results for repeated method calls, significantly improving compilation performance. ([PR #19072](https://github.com/dotnet/fsharp/pull/19072)) ### Fixed -### Changed \ No newline at end of file +### Changed + +* Inline functions now keep SRTP constraints generic instead of eagerly resolving through weak resolution. This changes inferred types for some inline code — see [RFC FS-1043 compatibility section](https://github.com/fsharp/fslang-design/blob/main/RFCs/FS-1043-extension-members-for-operators-and-srtp-constraints.md) for details and workarounds. diff --git a/docs/srtp-guide.md b/docs/srtp-guide.md new file mode 100644 index 00000000000..0d5024d69a6 --- /dev/null +++ b/docs/srtp-guide.md @@ -0,0 +1,166 @@ +--- +status: draft +target: Microsoft Learn (F# language guide) +notes: > + This document is a draft intended for eventual inclusion in the official + F# documentation on Microsoft Learn. It lives here during development of + RFC FS-1043 so reviewers can evaluate the guidance alongside the implementation. +--- + +# Guide to Writing SRTP Code in F# + +This guide documents best practices for using Statically Resolved Type Parameters (SRTP) in F#, including the new extension constraint solutions feature (RFC FS-1043). + +## What Are SRTPs? + +Statically Resolved Type Parameters (SRTPs) allow you to write generic code that requires types to have specific members, resolved at compile time: + +```fsharp +let inline add (x: ^T) (y: ^T) = x + y +``` + +The `^T` syntax (hat-type) declares a statically resolved type parameter. The use of `(+)` generates a member constraint that the compiler resolves at each call site based on the concrete type. + +## Extension Constraint Solutions (Preview) + +With `--langversion:preview`, extension methods now participate in SRTP constraint resolution. + +### Defining Extension Operators + +```fsharp +open System + +type String with + static member (*) (s: string, n: int) = String.replicate n s + +let inline multiply (x: ^T) (n: int) = x * n +let result = multiply "ha" 3 // "hahaha" +``` + +### Resolution Priority + +When solving an SRTP constraint: +1. **Built-in solutions** for primitive operators (e.g. `int + int`) are applied when the types match precisely, regardless of whether extension methods exist +2. **Overload resolution** considers both intrinsic and extension members. Extension members are lower priority in the resolution order (same as in regular F# overload resolution) +3. Among extensions, standard F# name resolution rules apply (later `open` shadows earlier) + +### Scope Capture + +With `--langversion:preview`, extrinsic extension members (defined on a type from another assembly) participate in SRTP constraint resolution when they are in scope where the inline function is defined: + +```fsharp +module StringOps = + // System.String has no built-in (*) — this extension is extrinsic. + type System.String with + static member (*) (s: string, n: int) = System.String.Concat(Array.replicate n s) + +module GenericLib = + open StringOps + + // multiply captures the SRTP constraint with String.(*) in scope. + // The extension is recorded in the constraint at this definition site. + let inline multiply (x: ^T) (n: int) = x * n + +module Consumer = + open GenericLib + // StringOps is NOT opened here, but the extension was captured when + // multiply was defined. It travels with the constraint and resolves here. + let r = multiply "ha" 3 // "hahaha" +``` + +### Known Limitations + +- **FSharpPlus compatibility**: Code using return types as support types in SRTP constraints may fail to compile. See workarounds below. + +## Weak Resolution Changes + +With `--langversion:preview`, inline code no longer eagerly resolves SRTP constraints via weak resolution when true overload resolution is involved: + +```fsharp +// Before: f1 inferred as DateTime -> TimeSpan -> DateTime (non-generic, because op_Addition +// had only one overload and weak resolution eagerly picked it) +// After: f1 stays generic: DateTime -> ^a -> ^b (because weak resolution no longer forces +// overload resolution for inline code) +let inline f1 (x: DateTime) y = x + y +``` + +### Workarounds for Breaking Changes + +If existing inline code breaks: + +1. **Add explicit type annotations:** + ```fsharp + let inline f1 (x: DateTime) (y: TimeSpan) : DateTime = x + y + ``` + +2. **Use sequentialization** to force resolution order + +3. **Sequentialize nested calls** when using FSharpPlus-style patterns with return types in support types. If nesting `InvokeMap` calls directly produces errors, sequentialize with a let-binding (see the sequentialization example above). Do NOT remove return types from support types unless you understand the impact on overload resolution — return types are the fundamental mechanism for return-type-driven resolution in type-class encodings. + +## Feature Flag + +Enable with: `--langversion:preview` +Feature name: `ExtensionConstraintSolutions` + +This feature is gated at the preview language version and will be stabilized in a future F# release. + +## AllowOverloadOnReturnType Attribute + +The `[]` attribute (in `FSharp.Core`) enables return-type-based overload resolution for any method, extending behavior previously reserved for `op_Explicit` and `op_Implicit`: + +```fsharp +type Converter = + [] + static member Convert(x: string) : int = int x + [] + static member Convert(x: string) : float = float x + +let resultInt: int = Converter.Convert("42") // resolves to int overload +let resultFloat: float = Converter.Convert("42") // resolves to float overload +``` + +Without the attribute, these overloads would produce an ambiguity error. Note that the call site must provide enough type context (e.g., a type annotation) for the compiler to select the correct overload. + +## Design Intent: Aspirational Patterns + +> **⚠️ NOT IMPLEMENTED**: The patterns below are taken from the RFC to illustrate the +> long-term design intent. They do **not** compile with the current implementation. +> Cross-type operator extensions (e.g., `float + int`) interact with built-in operator +> resolution in complex ways that are not yet supported. Do not use these patterns in +> production code. + +### Numeric Widening via Extension Operators (NOT IMPLEMENTED) + +The RFC describes retrofitting widening conversions onto primitive types: + +```fsharp +// ⚠️ ASPIRATIONAL — does not compile +type System.Int32 with + static member inline widen_to_double (a: int32) : double = double a + +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b +``` + +> **Warning**: Defining `(+)` extensions on `System.Double` would shadow built-in +> arithmetic for all `float` operations in scope. This pattern requires careful design +> to avoid degrading error messages and performance for existing code. + +### Defining op_Implicit via Extension Members (NOT IMPLEMENTED) + +The RFC describes populating a generic implicit conversion function: + +```fsharp +// ⚠️ ASPIRATIONAL — does not compile +let inline implicitConv (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + static member inline op_Implicit (a: int32) : double = double a +``` + +> **Note**: Even if implemented, these conversions would be explicit in F# code +> (you must call `implicitConv`), not implicit as in C#. diff --git a/src/Compiler/Checking/CheckBasics.fs b/src/Compiler/Checking/CheckBasics.fs index d8fdd288af3..998368c057d 100644 --- a/src/Compiler/Checking/CheckBasics.fs +++ b/src/Compiler/Checking/CheckBasics.fs @@ -14,6 +14,7 @@ open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.InfoReader +open FSharp.Compiler.Infos open FSharp.Compiler.NameResolution open FSharp.Compiler.PatternMatchCompilation open FSharp.Compiler.Syntax @@ -248,6 +249,15 @@ type TcEnv = member tenv.AccessRights = tenv.eAccessRights + /// Makes this environment available in a form that can be stored into a trait during solving. + member tenv.TraitContext = Some (tenv :> ITraitContext) + + interface ITraitContext with + member tenv.SelectExtensionMethods(traitInfo, m, infoReader) = + SelectExtensionMethInfosForTrait(traitInfo, m, tenv.eNameResEnv, infoReader) + + member tenv.AccessRights = tenv.eAccessRights + override tenv.ToString() = "TcEnv(...)" /// Represents the compilation environment for typechecking a single file in an assembly. @@ -340,7 +350,8 @@ type TcFileState = let niceNameGen = NiceNameGenerator() let infoReader = InfoReader(g, amap) - let instantiationGenerator m tpsorig = FreshenTypars g m tpsorig + // traitCtxtNone: NameResolver construction — trait context flows separately through TcEnv during actual resolution (audited for RFC FS-1043) + let instantiationGenerator m tpsorig = FreshenTypars g traitCtxtNone m tpsorig let nameResolver = NameResolver(g, amap, infoReader, instantiationGenerator) { g = g amap = amap diff --git a/src/Compiler/Checking/CheckBasics.fsi b/src/Compiler/Checking/CheckBasics.fsi index 0191cf018f2..5798a5eb24b 100644 --- a/src/Compiler/Checking/CheckBasics.fsi +++ b/src/Compiler/Checking/CheckBasics.fsi @@ -9,6 +9,7 @@ open Internal.Utilities.Library open Internal.Utilities.Collections open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.CompilerGlobalState +open FSharp.Compiler.Infos open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.Import @@ -141,6 +142,11 @@ type TcEnv = member AccessRights: AccessorDomain + /// Makes this environment available in a form that can be stored into a trait during solving. + member TraitContext: ITraitContext option + + interface ITraitContext + /// Represents the current environment of type variables that have implicit scope /// (i.e. are without explicit declaration). type UnscopedTyparEnv = UnscopedTyparEnv of NameMap diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 149f8217e96..539888ae1ac 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -1052,7 +1052,7 @@ module MutRecBindingChecking = AddLocalTyconRefs true g cenv.amap tcref.Range [tcref] initialEnvForTycon // Make fresh version of the class type for type checking the members and lets * - let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let _, copyOfTyconTypars, _, objTy, thisTy = FreshenObjectArgType cenv envForTycon.TraitContext tcref.Range TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars // The basic iteration over the declarations in a single type definition let initialInnerState = (None, envForTycon, tpenv, recBindIdx, uncheckedBindsRev) @@ -2703,7 +2703,8 @@ module EstablishTypeDefinitionCores = let TypeNamesInMutRecDecls cenv env (compDecls: MutRecShapes) = [ for d in compDecls do match d with - | MutRecShape.Tycon (MutRecDefnsPhase1DataForTycon(SynComponentInfo(typeParams=synTypars; longId=ids), _, _, _, _, isAtOriginalTyconDefn), _) -> + | MutRecShape.Tycon (MutRecDefnsPhase1DataForTycon(SynComponentInfo(typeParams=synTypars) as compInfo, _, _, _, _, isAtOriginalTyconDefn), _) -> + let ids = compInfo.LongIdent if isAtOriginalTyconDefn && TyparsAllHaveMeasureDeclEarlyCheck cenv env synTypars then yield (List.last ids).idText | _ -> () ] @@ -2713,7 +2714,8 @@ module EstablishTypeDefinitionCores = [ for def in defs do match def with | SynModuleDecl.Types (typeSpecs, _) -> - for SynTypeDefn(typeInfo=SynComponentInfo(typeParams=synTypars; longId=ids); typeRepr=trepr) in typeSpecs do + for SynTypeDefn(typeInfo=SynComponentInfo(typeParams=synTypars) as compInfo; typeRepr=trepr) in typeSpecs do + let ids = compInfo.LongIdent if TyparsAllHaveMeasureDeclEarlyCheck cenv env synTypars then match trepr, ids with | SynTypeDefnRepr.ObjectModel(kind=SynTypeDefnKind.Augmentation _), _ -> () @@ -2727,7 +2729,8 @@ module EstablishTypeDefinitionCores = [ for def in defs do match def with | SynModuleSigDecl.Types (typeSpecs, _) -> - for SynTypeDefnSig(typeInfo=SynComponentInfo(typeParams=TyparDecls typars; longId=ids); typeRepr=trepr; members=extraMembers) in typeSpecs do + for SynTypeDefnSig(typeInfo=SynComponentInfo(typeParams=TyparDecls typars) as compInfo; typeRepr=trepr; members=extraMembers) in typeSpecs do + let ids = compInfo.LongIdent if isNil typars then match trepr with | SynTypeDefnSigRepr.Simple(SynTypeDefnSimpleRepr.None _, _) when not (isNil extraMembers) -> () @@ -2737,7 +2740,8 @@ module EstablishTypeDefinitionCores = let TcTyconDefnCore_Phase1A_BuildInitialModule (cenv: cenv) envInitial parent typeNames compInfo decls = let g = cenv.g - let (SynComponentInfo(Attributes attribs, _, _, longPath, xml, _, vis, im)) = compInfo + let (SynComponentInfo(Attributes attribs, _, _, _, xml, _, vis, im)) = compInfo + let longPath = compInfo.LongIdent let id = ComputeModuleName longPath let modAttrs = TcAttributes cenv envInitial AttributeTargets.ModuleDecl attribs let moduleKind = ComputeModuleOrNamespaceKind g true typeNames modAttrs id.idText @@ -2766,7 +2770,8 @@ module EstablishTypeDefinitionCores = /// - we don't yet 'properly' establish constraints on type parameters let private TcTyconDefnCore_Phase1A_BuildInitialTycon (cenv: cenv) env parent (MutRecDefnsPhase1DataForTycon(synTyconInfo, synTyconRepr, _, preEstablishedHasDefaultCtor, hasSelfReferentialCtor, _)) = let g = cenv.g - let (SynComponentInfo (_, TyparDecls synTypars, _, id, xmlDoc, preferPostfix, synVis, _)) = synTyconInfo + let (SynComponentInfo (_, TyparDecls synTypars, _, _, xmlDoc, preferPostfix, synVis, _)) = synTyconInfo + let id = synTyconInfo.LongIdent let checkedTypars = TcTyparDecls cenv env synTypars id |> List.iter (CheckNamespaceModuleOrTypeName g) @@ -2776,7 +2781,7 @@ module EstablishTypeDefinitionCores = | _ -> let id = ComputeTyconName (id, (match synTyconRepr with SynTypeDefnSimpleRepr.TypeAbbrev _ -> false | _ -> true), checkedTypars) - // Augmentations of type definitions are allowed within the same file as long as no new type representation or abbreviation is given + // Augmentations of type definitions are allowed within the same file as long as no new type representation or abbreviation is given CheckForDuplicateConcreteType env id.idText id.idRange let vis, cpath = ComputeAccessAndCompPath g env None id.idRange synVis None parent @@ -4212,8 +4217,8 @@ module TcDeclarations = let private ComputeTyconDeclKind (cenv: cenv) (envForDecls: TcEnv) tyconOpt isAtOriginalTyconDefn inSig m (synTypars: SynTyparDecl list) synTyparCxs longPath = let g = cenv.g let ad = envForDecls.AccessRights - - let tcref = + + let tcref = match tyconOpt with | Some tycon when isAtOriginalTyconDefn -> @@ -4282,7 +4287,7 @@ module TcDeclarations = // For historical reasons we only give a warning for incorrect type parameters on intrinsic extensions if nReqTypars <> synTypars.Length then errorR(Error(FSComp.SR.tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) - if not (checkTyparsForExtension()) then + if not (checkTyparsForExtension()) then warning(Error(FSComp.SR.tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) // Note we return 'reqTypars' for intrinsic extensions since we may only have given warnings IntrinsicExtensionBinding, tcref, reqTypars @@ -4291,7 +4296,7 @@ module TcDeclarations = errorR(Error(FSComp.SR.tcMembersThatExtendInterfaceMustBePlacedInSeparateModule(), tcref.Range)) if nReqTypars <> synTypars.Length then error(Error(FSComp.SR.tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) - if not (checkTyparsForExtension()) then + if not (checkTyparsForExtension()) then errorR(Error(FSComp.SR.tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) ExtrinsicExtensionBinding, tcref, declaredTypars @@ -4605,7 +4610,8 @@ module TcDeclarations = let (MutRecDefnsPhase1DataForTycon(synTyconInfo, _, _, _, _, isAtOriginalTyconDefn)) = typeDefnCore let tyDeclRange = synTyconInfo.Range - let (SynComponentInfo(_, TyparsAndConstraints (typars, cs1), cs2, longPath, _, _, _, _)) = synTyconInfo + let (SynComponentInfo(_, TyparsAndConstraints (typars, cs1), cs2, _, _, _, _, _)) = synTyconInfo + let longPath = synTyconInfo.LongIdent let cs = cs1 @ cs2 let declKind, tcref, declaredTyconTypars = ComputeTyconDeclKind cenv envForDecls tyconOpt isAtOriginalTyconDefn false tyDeclRange typars cs longPath let newslotsOK = (if isAtOriginalTyconDefn && tcref.IsFSharpObjectModelTycon then NewSlotsOK else NoNewSlots) @@ -4615,7 +4621,7 @@ module TcDeclarations = if not (isNil members) && tcref.IsTypeAbbrev then errorR(Error(FSComp.SR.tcTypeAbbreviationsCannotHaveAugmentations(), tyDeclRange)) - + let (SynComponentInfo (attributes, _, _, _, _, _, _, _)) = synTyconInfo if not (List.isEmpty attributes) && (declKind = ExtrinsicExtensionBinding || declKind = IntrinsicExtensionBinding) then let attributeRange = (List.head attributes).Range @@ -4791,7 +4797,8 @@ module TcDeclarations = (fun envForDecls ((tyconCore, (synTyconInfo, members), innerParent), tyconOpt, _fixupFinalAttrs, _, _extraValSpecs) -> let tpenv = emptyUnscopedTyparEnv let (MutRecDefnsPhase1DataForTycon (isAtOriginalTyconDefn=isAtOriginalTyconDefn)) = tyconCore - let (SynComponentInfo(_, TyparsAndConstraints (typars, cs1), cs2, longPath, _, _, _, m)) = synTyconInfo + let (SynComponentInfo(_, TyparsAndConstraints (typars, cs1), cs2, _, _, _, _, m)) = synTyconInfo + let longPath = synTyconInfo.LongIdent let cs = cs1 @ cs2 let declKind, tcref, declaredTyconTypars = ComputeTyconDeclKind cenv envForDecls tyconOpt isAtOriginalTyconDefn true m typars cs longPath @@ -4910,8 +4917,9 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE let env = List.foldBack (AddLocalVal g cenv.tcSink scopem) idvs env return env - | SynModuleSigDecl.NestedModule(SynComponentInfo(attributes=Attributes attribs; longId=longPath; xmlDoc=xml; accessibility=vis; range=im) as compInfo, isRec, moduleDefs, m, trivia) -> - if isRec then + | SynModuleSigDecl.NestedModule(SynComponentInfo(attributes=Attributes attribs; xmlDoc=xml; accessibility=vis; range=im) as compInfo, isRec, moduleDefs, m, trivia) -> + let longPath = compInfo.LongIdent + if isRec then // Treat 'module rec M = ...' as a single mutually recursive definition group 'module M = ...' let modDecl = SynModuleSigDecl.NestedModule(compInfo, false, moduleDefs, m, trivia) @@ -4981,7 +4989,8 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE let enclosingNamespacePath, defs = if kind.IsModule then let nsp, modName = List.frontAndBack longId - let modDecl = [SynModuleSigDecl.NestedModule(SynComponentInfo(attribs, None, [], [modName], xml, false, vis, m), false, defs, m, SynModuleSigDeclNestedModuleTrivia.Zero)] + let synTy = Some(SynType.LongIdent(SynLongIdent([modName], [], []))) + let modDecl = [SynModuleSigDecl.NestedModule(SynComponentInfo(attribs, None, [], synTy, xml, false, vis, m), false, defs, m, SynModuleSigDeclNestedModuleTrivia.Zero)] nsp, modDecl else longId, defs @@ -5073,7 +5082,8 @@ and TcSignatureElementsMutRec cenv parent typeNames m mutRecNSInfo envInitial (d | SynModuleSigDecl.Exception (exnSig=SynExceptionSig(exnRepr=exnRepr; withKeyword=withKeyword; members=members)) -> let ( SynExceptionDefnRepr(synAttrs, SynUnionCase(ident=SynIdent(id,_)), _, xmlDoc, vis, m)) = exnRepr - let compInfo = SynComponentInfo(synAttrs, None, [], [id], xmlDoc, false, vis, id.idRange) + let synTy = Some(SynType.LongIdent(SynLongIdent([id], [], []))) + let compInfo = SynComponentInfo(synAttrs, None, [], synTy, xmlDoc, false, vis, id.idRange) let decls = [ MutRecShape.Tycon(SynTypeDefnSig.SynTypeDefnSig(compInfo, SynTypeDefnSigRepr.Exception exnRepr, members, m, { LeadingKeyword = SynTypeDefnLeadingKeyword.Synthetic; WithKeyword = withKeyword; EqualsRange = None })) ] decls, (false, false) @@ -5213,10 +5223,10 @@ let TcModuleOrNamespaceElementsMutRec (cenv: cenv) parent typeNames m envInitial else List.map (List.singleton >> MutRecShape.Lets) binds binds, (false, false, attrs) - | SynModuleDecl.NestedModule(moduleInfo = (SynComponentInfo(longId = []))) -> + | SynModuleDecl.NestedModule(moduleInfo = (SynComponentInfo(synType = None))) -> [], (openOk, moduleAbbrevOk, attrs) - | SynModuleDecl.NestedModule(moduleInfo=compInfo; isRecursive=isRec; decls=synDefs; range=moduleRange) -> + | SynModuleDecl.NestedModule(moduleInfo=compInfo; isRecursive=isRec; decls=synDefs; range=moduleRange) -> if isRec then warning(Error(FSComp.SR.tcRecImplied(), compInfo.Range)) let mutRecDefs, (_, _, attrs) = loop false moduleRange attrs synDefs let decls = [MutRecShape.Module (compInfo, mutRecDefs)] @@ -5230,7 +5240,8 @@ let TcModuleOrNamespaceElementsMutRec (cenv: cenv) parent typeNames m envInitial | SynModuleDecl.Exception (SynExceptionDefn(repr, _, members, _), _m) -> let members = desugarGetSetMembers members let (SynExceptionDefnRepr(synAttrs, SynUnionCase(ident=SynIdent(id,_)), _repr, xmlDoc, vis, m)) = repr - let compInfo = SynComponentInfo(synAttrs, None, [], [id], xmlDoc, false, vis, id.idRange) + let synTy = Some(SynType.LongIdent(SynLongIdent([id], [], []))) + let compInfo = SynComponentInfo(synAttrs, None, [], synTy, xmlDoc, false, vis, id.idRange) let decls = [ MutRecShape.Tycon(SynTypeDefn(compInfo, SynTypeDefnRepr.Exception repr, members, None, m, SynTypeDefnTrivia.Zero)) ] decls, (false, false, attrs) @@ -5289,7 +5300,90 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem return ([defn], [], []), env, env | SynModuleDecl.Types (typeDefs, m) -> - let typeDefs = typeDefs |> List.filter (function SynTypeDefn(typeInfo = SynComponentInfo(longId = [])) -> false | _ -> true) + // Helper to extract tuple from possibly parenthesized type + let rec tryExtractTuple synTy = + match synTy with + | SynType.Tuple(isStruct, path, tupleRange) -> Some(isStruct, path, tupleRange) + | SynType.Paren(innerTy, _) -> tryExtractTuple innerTy + | _ -> None + + // Helper to extract function type from possibly parenthesized type + let rec tryExtractFun synTy = + match synTy with + | SynType.Fun(argTy, retTy, funRange, _) -> Some(argTy, retTy, funRange) + | SynType.Paren(innerTy, _) -> tryExtractFun innerTy + | _ -> None + + // Helper to check if a type is valid for type extensions + // Valid: named types, tuples, function types, array types + // Invalid: hash constraints, anon types, static constants + let rec isValidTypeExtensionType synTy = + match synTy with + | SynType.LongIdent _ -> true + | SynType.App(SynType.LongIdent _, _, _, _, _, _, _) -> true + | SynType.LongIdentApp _ -> true + | SynType.Tuple _ -> true + | SynType.Fun _ -> true + | SynType.Array _ -> true + | SynType.Paren(innerTy, _) -> isValidTypeExtensionType innerTy + // Reject: hash constraints, anon types, static constants + | SynType.HashConstraint _ -> false + | SynType.Anon _ -> false + | SynType.StaticConstant _ -> false + | SynType.StaticConstantNull _ -> false + | SynType.StaticConstantExpr _ -> false + // For other types, allow them and let type checking catch issues + | _ -> true + + let typeDefs = + typeDefs |> List.choose (fun typeDef -> + match typeDef with + | SynTypeDefn(typeInfo = SynComponentInfo(synType = Some synTy) as compInfo) -> + match tryExtractTuple synTy with + | Some(isStruct, path, tupleRange) -> + // Transform tuple type extensions: type ('T1 * 'T2) with ... -> type System.Tuple<'T1,'T2> with ... + let elemTys = path |> List.choose (function SynTupleTypeSegment.Type t -> Some t | _ -> None) + let tupleName = if isStruct then "ValueTuple" else "Tuple" + let longId = [Ident("System", tupleRange); Ident(tupleName, tupleRange)] + // Create type parameter declarations from the tuple element types + let typarDecls = + elemTys |> List.mapi (fun i elemTy -> + match elemTy with + | SynType.Var(typar, _) -> SynTyparDecl([], typar, [], SynTyparDeclTrivia.Zero) + | _ -> + let typar = SynTypar(Ident("T" + string (i + 1), elemTy.Range), TyparStaticReq.None, false) + SynTyparDecl([], typar, [], SynTyparDeclTrivia.Zero)) + let typars = Some(SynTyparDecls.PostfixList(typarDecls, [], tupleRange)) + let (SynComponentInfo(attrs, _, constraints, _, xmlDoc, fixity, vis, _)) = compInfo + let newSynTy = Some(SynType.LongIdent(SynLongIdent(longId, [], []))) + let newCompInfo = SynComponentInfo(attrs, typars, constraints, newSynTy, xmlDoc, fixity, vis, tupleRange) + let (SynTypeDefn(_, repr, members, implicitCtor, range, trivia)) = typeDef + Some(SynTypeDefn(newCompInfo, repr, members, implicitCtor, range, trivia)) + | None -> + match tryExtractFun synTy with + | Some(argTy, retTy, funRange) -> + // Transform function type extensions: type ('T1 -> 'T2) with ... -> type FSharpFunc<'T1,'T2> with ... + let longId = [Ident("Microsoft", funRange); Ident("FSharp", funRange); Ident("Core", funRange); Ident("FSharpFunc", funRange)] + // Create type parameter declarations from the argument and return types + let makeTyParDecl (idx: int) (ty: SynType) = + match ty with + | SynType.Var(typar, _) -> SynTyparDecl([], typar, [], SynTyparDeclTrivia.Zero) + | _ -> + let typar = SynTypar(Ident("T" + string idx, ty.Range), TyparStaticReq.None, false) + SynTyparDecl([], typar, [], SynTyparDeclTrivia.Zero) + let typarDecls = [makeTyParDecl 1 argTy; makeTyParDecl 2 retTy] + let typars = Some(SynTyparDecls.PostfixList(typarDecls, [], funRange)) + let (SynComponentInfo(attrs, _, constraints, _, xmlDoc, fixity, vis, _)) = compInfo + let newSynTy = Some(SynType.LongIdent(SynLongIdent(longId, [], []))) + let newCompInfo = SynComponentInfo(attrs, typars, constraints, newSynTy, xmlDoc, fixity, vis, funRange) + let (SynTypeDefn(_, repr, members, implicitCtor, range, trivia)) = typeDef + Some(SynTypeDefn(newCompInfo, repr, members, implicitCtor, range, trivia)) + | None -> + // Validate that the type is valid for type extensions + if not (isValidTypeExtensionType synTy) then + errorR(Error(FSComp.SR.tcInvalidTypeForTypeExtension(), synTy.Range)) + Some typeDef + | SynTypeDefn(typeInfo = SynComponentInfo(synType = None)) -> None) let scopem = unionRanges m scopem let mutRecDefns = typeDefs |> List.map MutRecShape.Tycon let mutRecDefnsChecked, envAfter = TcDeclarations.TcMutRecDefinitions cenv env parent typeNames tpenv m scopem None mutRecDefns false @@ -5338,7 +5432,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem | SynModuleDecl.HashDirective _ -> return ([], [], []), env, env - | SynModuleDecl.NestedModule(moduleInfo = (SynComponentInfo(longId = []))) -> + | SynModuleDecl.NestedModule(moduleInfo = (SynComponentInfo(synType = None))) -> return ([], [], []), env, env | SynModuleDecl.NestedModule(compInfo, isRec, moduleDefs, isContinuingModule, m, trivia) -> @@ -5349,8 +5443,8 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let modDecl = SynModuleDecl.NestedModule(compInfo, false, moduleDefs, isContinuingModule, m, trivia) return TcModuleOrNamespaceElementsMutRec cenv parent typeNames m env None [modDecl] else - let (SynComponentInfo(Attributes attribs, _, _, longPath, xml, _, vis, im)) = compInfo - let id = ComputeModuleName longPath + let (SynComponentInfo(Attributes attribs, _, _, _, xml, _, vis, im)) = compInfo + let id = ComputeModuleName compInfo.LongIdent let modAttrs = TcAttributes cenv env AttributeTargets.ModuleDecl attribs let moduleKind = EstablishTypeDefinitionCores.ComputeModuleOrNamespaceKind g true typeNames modAttrs id.idText @@ -5358,7 +5452,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem CheckForDuplicateConcreteType env modName im CheckForDuplicateModule env id.idText id.idRange let vis, _ = ComputeAccessAndCompPath g env None id.idRange vis None parent - + let endm = m.EndRange let id = ident (modName, id.idRange) @@ -5444,7 +5538,8 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem match longId with | [] -> [], mkSynId m.EndRange "" | _ -> List.frontAndBack longId - let modDecl = [SynModuleDecl.NestedModule(SynComponentInfo(attribs, None, [], [modName], xml, false, vis, m), false, defs, true, m, SynModuleDeclNestedModuleTrivia.Zero)] + let synTy = Some(SynType.LongIdent(SynLongIdent([modName], [], []))) + let modDecl = [SynModuleDecl.NestedModule(SynComponentInfo(attribs, None, [], synTy, xml, false, vis, m), false, defs, true, m, SynModuleDeclNestedModuleTrivia.Zero)] nsp, modDecl else longId, defs @@ -5793,7 +5888,7 @@ let CheckOneImplFile cenv.Create (g, isScript, amap, thisCcu, false, Option.isSome rootSigOpt, conditionalDefines, tcSink, - LightweightTcValForUsingInBuildMethodCall g, + LightweightTcValForUsingInBuildMethodCall g (env: TcEnv).TraitContext, isInternalTestSpanStackReferring, diagnosticOptions, tcPat=TcPat, @@ -5881,7 +5976,7 @@ let CheckOneImplFile try let reportErrors = not (checkForErrors()) - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext use _ = Activity.start "PostTypeCheckSemanticChecks.CheckImplFile" [| @@ -5926,7 +6021,7 @@ let CheckOneImplFile /// Check an entire signature file -let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring, diagnosticOptions) tcEnv (sigFile: ParsedSigFileInput) = +let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSink, isInternalTestSpanStackReferring, diagnosticOptions) (tcEnv: TcEnv) (sigFile: ParsedSigFileInput) = cancellable { use _ = Activity.start "CheckDeclarations.CheckOneSigFile" @@ -5938,7 +6033,7 @@ let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSin cenv.Create(g, false, amap, thisCcu, true, false, conditionalDefines, tcSink, - LightweightTcValForUsingInBuildMethodCall g, + LightweightTcValForUsingInBuildMethodCall g tcEnv.TraitContext, isInternalTestSpanStackReferring, diagnosticOptions, tcPat=TcPat, diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index 2021888970f..f4bd9c4af73 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -18,7 +18,8 @@ open FSharp.Compiler.TcGlobals type FormatItem = Simple of TType | FuncAndVal let copyAndFixupFormatTypar g m tp = - let _,_,tinst = FreshenAndFixupTypars g m TyparRigidity.Flexible [] [] [tp] + // traitCtxtNone: format string typars — unrelated to SRTP member constraints (audited for RFC FS-1043) + let _,_,tinst = FreshenAndFixupTypars g traitCtxtNone m TyparRigidity.Flexible [] [] [tp] List.head tinst let lowestDefaultPriority = 0 (* See comment on TyparConstraint.DefaultsTo *) diff --git a/src/Compiler/Checking/ConstraintSolver.fs b/src/Compiler/Checking/ConstraintSolver.fs index 8a567e0ecef..bdabed9da6a 100644 --- a/src/Compiler/Checking/ConstraintSolver.fs +++ b/src/Compiler/Checking/ConstraintSolver.fs @@ -75,6 +75,9 @@ open FSharp.Compiler.TypeRelations open FSharp.Compiler.TypeProviders #endif +/// Concrete ITraitContext used throughout the compiler. +type TraitContext = ITraitContext + //------------------------------------------------------------------------- // Generate type variables and record them in within the scope of the // compilation environment, which currently corresponds to the scope @@ -115,19 +118,19 @@ let FreshenTypar (g: TcGlobals) rigid (tp: Typar) = // abstract generic method slot. But we later check the generalization // condition anyway, so we could get away with a non-rigid typar. This // would sort of be cleaner, though give errors later. -let FreshenAndFixupTypars g m rigid fctps tinst tpsorig = +let FreshenAndFixupTypars g (traitCtxt: ITraitContext option) m rigid fctps tinst tpsorig = let tps = tpsorig |> List.map (FreshenTypar g rigid) - let renaming, tinst = FixupNewTypars m fctps tinst tpsorig tps + let renaming, tinst = FixupNewTypars traitCtxt m fctps tinst tpsorig tps tps, renaming, tinst -let FreshenTypeInst g m tpsorig = - FreshenAndFixupTypars g m TyparRigidity.Flexible [] [] tpsorig +let FreshenTypeInst g traitCtxt m tpsorig = + FreshenAndFixupTypars g traitCtxt m TyparRigidity.Flexible [] [] tpsorig -let FreshMethInst g m fctps tinst tpsorig = - FreshenAndFixupTypars g m TyparRigidity.Flexible fctps tinst tpsorig +let FreshMethInst g traitCtxt m fctps tinst tpsorig = + FreshenAndFixupTypars g traitCtxt m TyparRigidity.Flexible fctps tinst tpsorig -let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tpTys = FreshMethInst minfo.TcGlobals m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars +let FreshenMethInfo g traitCtxt m (minfo: MethInfo) = + let _, _, tpTys = FreshMethInst g traitCtxt m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tpTys //------------------------------------------------------------------------- @@ -1672,7 +1675,7 @@ and SolveDimensionlessNumericType (csenv: ConstraintSolverEnv) ndeep m2 trace ty /// 2. Some additional solutions are forced prior to generalization (permitWeakResolution= Yes or YesDuringCodeGen). See above and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace traitInfo : OperationResult = trackErrors { - let (TTrait(supportTys, nm, memFlags, traitObjAndArgTys, retTy, source, sln)) = traitInfo + let (TTrait(supportTys, nm, memFlags, traitObjAndArgTys, retTy, source, sln, traitCtxt)) = traitInfo // Do not re-solve if already solved if sln.Value.IsSome then return true @@ -1682,6 +1685,17 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let amap = csenv.amap let aenv = csenv.EquivEnv let denv = csenv.DisplayEnv + let extensionsEnabled = g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions + + // traitAD: extension scope access rights, or AccessibleFromEverywhere when disabled + let traitAD = + if extensionsEnabled then + match traitCtxt with + | Some (:? TraitContext as tc) -> tc.AccessRights + | Some _ -> error (InternalError("SolveMemberConstraint: unexpected ITraitContext implementation", m)) + | None -> AccessibleFromEverywhere + else + AccessibleFromEverywhere let ndeep = ndeep + 1 do! DepthCheck ndeep m @@ -1719,9 +1733,16 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let minfos = GetRelevantMethodsForTrait csenv permitWeakResolution nm traitInfo + // Exclude extensions from built-in rules (primitives take precedence) + let intrinsicMinfos = + if extensionsEnabled then + minfos |> List.filter (fun (_, minfo) -> not minfo.IsExtensionMember) + else + minfos + let! res = trackErrors { - match minfos, supportTys, memFlags.IsInstance, nm, argTys with + match intrinsicMinfos, supportTys, memFlags.IsInstance, nm, argTys with | _, _, false, ("op_Division" | "op_Multiply"), [argTy1;argTy2] when // This simulates the existence of @@ -1756,7 +1777,11 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload // - Neither type contributes any methods OR // - We have the special case "decimal<_> * decimal". In this case we have some // possibly-relevant methods from "decimal" but we ignore them in this case. - (isNil minfos || (Option.isSome (getMeasureOfType g argTy1) && isDecimalTy g argTy2)) in + (isNil minfos || (Option.isSome (getMeasureOfType g argTy1) && isDecimalTy g argTy2)) && + // Skip built-in rule for concrete non-numeric types when traitCtxt=None (inlined from FSharp.Core) + (not extensionsEnabled || + not (isNil minfos) || + isTyparTy g argTy2 || IsNumericOrIntegralEnumType g argTy2) in checkRuleAppliesInPreferenceToMethods argTy1 argTy2 || checkRuleAppliesInPreferenceToMethods argTy2 argTy1) -> @@ -1976,11 +2001,11 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload let propName = nm[4..] let props = supportTys |> List.choose (fun ty -> - match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, AccessibleFromEverywhere, false) FindMemberFlag.IgnoreOverrides m ty with + match TryFindIntrinsicNamedItemOfType csenv.InfoReader (propName, traitAD, false) FindMemberFlag.IgnoreOverrides m ty with | Some (RecdFieldItem rfinfo) when (isGetProp || rfinfo.RecdField.IsMutable) && (rfinfo.IsStatic = not memFlags.IsInstance) && - IsRecdFieldAccessible amap m AccessibleFromEverywhere rfinfo.RecdFieldRef && + IsRecdFieldAccessible amap m traitAD rfinfo.RecdFieldRef && not rfinfo.LiteralValue.IsSome && not rfinfo.RecdField.IsCompilerGenerated -> Some (rfinfo, isSetProp) @@ -2060,14 +2085,14 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload Unnamed = [ (argTys |> List.map (fun argTy -> CallerArg(argTy, m, false, dummyExpr))) ] Named = [ [ ] ] } - let minst = FreshenMethInfo m minfo + let minst = FreshenMethInfo g traitCtxt m minfo let objtys = minfo.GetObjArgTypes(amap, m, minst) - Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo, m, AccessibleFromEverywhere, minfo, minst, minst, None, objtys, callerArgs, false, false, None, Some staticTy))) + Some(CalledMeth(csenv.InfoReader, None, false, FreshenMethInfo g traitCtxt, m, traitAD, minfo, minst, minst, None, objtys, callerArgs, false, false, None, Some staticTy))) let methOverloadResult, errors = trace.CollectThenUndoOrCommit (fun (a, _) -> Option.isSome a) - (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) CallerArgs.Empty AccessibleFromEverywhere calledMethGroup false (Some (MustEqual retTy))) + (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) CallerArgs.Empty traitAD calledMethGroup false (Some (MustEqual retTy))) match anonRecdPropSearch, recdPropSearch, methOverloadResult with | Some (anonInfo, tinst, i), None, None -> @@ -2174,6 +2199,9 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst staticTyOpt = // to prevent unused parameter warning ignore css #endif + // Strip typar indirections when ExtensionConstraintSolutions enabled (C#-style extensions need concrete minst) + let g = css.g + let minst = minst |> List.map (stripTyEqnsAndMeasureEqns g) match minfo with | ILMeth(_, ilMeth, _) -> let mref = IL.mkRefToILMethod (ilMeth.DeclaringTyconRef.CompiledRepresentationForNamedType, ilMeth.RawMetadata) @@ -2245,11 +2273,34 @@ and GetRelevantMethodsForTrait (csenv: ConstraintSolverEnv) (permitWeakResolutio /// Check that the available members aren't hiding a member from the parent (depth 1 only) let relevantMinfos = minfos |> List.filter(fun (_, minfo) -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) - minfos - |> List.filter(fun (_, minfo1) -> - not(minfo1.IsDispatchSlot && - relevantMinfos - |> List.exists (fun (_, minfo2) -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) + let minfos = + minfos + |> List.filter(fun (_, minfo1) -> + not(minfo1.IsDispatchSlot && + relevantMinfos + |> List.exists (fun (_, minfo2) -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) + + // Append extensions after intrinsics; filter duplicates by sig + let extensionsEnabled = csenv.g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions + + let extMinfos = + if extensionsEnabled then + match traitInfo.TraitContext with + | Some (:? TraitContext as traitCtxt) -> + traitCtxt.SelectExtensionMethods(traitInfo, m, csenv.SolverState.InfoReader) + // Deduplicate extension methods (same method can appear for multiple support types) + |> ListSet.setify (fun (_, minfo1) (_, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) + // Filter out extension methods that duplicate an intrinsic method + |> List.filter (fun (_, extMinfo) -> + not (minfos |> List.exists (fun (_, intrinsicMinfo) -> + MethInfo.MethInfosUseIdenticalDefinitions intrinsicMinfo extMinfo))) + | Some _ -> + error (InternalError("GetRelevantMethodsForTrait: unexpected ITraitContext implementation", m)) + | None -> [] + else + [] + + minfos @ extMinfos else [] @@ -3486,6 +3537,7 @@ and ResolveOverloadingCore permitOptArgs (reqdRetTyOpt: OverallTy option) isOpConversion + alwaysConsiderReturnType (retTyOpt: TType option) (anyHasOutArgs: bool) (cacheKeyOpt: OverloadResolutionCacheKey voption) @@ -3497,9 +3549,10 @@ and ResolveOverloadingCore // Always take the return type into account for // -- op_Explicit, op_Implicit + // -- methods with AllowOverloadOnReturnType attribute // -- candidate method sets that potentially use tupling of unfilled out args let alwaysCheckReturn = - isOpConversion || anyHasOutArgs + alwaysConsiderReturnType || anyHasOutArgs // Exact match rule. // @@ -3606,12 +3659,18 @@ and ResolveOverloading (methodName = "op_Explicit") || (methodName = "op_Implicit") + // AllowOverloadOnReturnType: attribute-gated, not langversion-gated (RFC FS-1043) + let hasAllowOverloadOnReturnType = + calledMethGroup |> List.exists (fun cmeth -> cmeth.Method.HasAllowOverloadOnReturnType) + + let alwaysConsiderReturnType = isOpConversion || hasAllowOverloadOnReturnType + // See what candidates we have based on name and arity let candidates = calledMethGroup |> List.filter (fun cmeth -> cmeth.IsCandidate(m, ad)) let calledMethOpt, errors, calledMethTrace = match calledMethGroup, candidates with - | _, [calledMeth] when not isOpConversion -> + | _, [calledMeth] when not alwaysConsiderReturnType -> // See what candidates we have based on static/virtual/abstract // If false then is a static method call directly on an interface e.g. @@ -3631,10 +3690,10 @@ and ResolveOverloading None, ErrorD (Error (FSComp.SR.chkStaticAbstractInterfaceMembers(minfo.LogicalName), m)), NoTrace | _ -> Some calledMeth, CompleteD, NoTrace - | [], _ when not isOpConversion -> + | [], _ when not alwaysConsiderReturnType -> None, ErrorD (Error (FSComp.SR.csMethodNotFound(methodName), m)), NoTrace - | _, [] when not isOpConversion -> + | _, [] when not alwaysConsiderReturnType -> None, ReportNoCandidatesErrorExpr csenv callerArgs.CallerArgCounts methodName ad calledMethGroup, NoTrace | _, _ -> @@ -3644,7 +3703,7 @@ and ResolveOverloading let cacheKeyOpt = if g.langVersion.SupportsFeature LanguageFeature.MethodOverloadsCache && - not isOpConversion && cx.IsNone && candidates.Length > 1 then + not alwaysConsiderReturnType && cx.IsNone && candidates.Length > 1 then OverloadResolutionCache.tryComputeOverloadCacheKey g calledMethGroup callerArgs retTyOpt anyHasOutArgs else ValueNone @@ -3671,7 +3730,7 @@ and ResolveOverloading match cachedHit with | Some result -> result | None -> - ResolveOverloadingCore csenv methodName ndeep cx callerArgs ad calledMethGroup candidates permitOptArgs reqdRetTyOpt isOpConversion retTyOpt anyHasOutArgs cacheKeyOpt cache + ResolveOverloadingCore csenv methodName ndeep cx callerArgs ad calledMethGroup candidates permitOptArgs reqdRetTyOpt isOpConversion alwaysConsiderReturnType retTyOpt anyHasOutArgs cacheKeyOpt cache // If we've got a candidate solution: make the final checks - no undo here! // Allow subsumption on arguments. Include the return type. @@ -4275,7 +4334,8 @@ let CodegenWitnessesForTyparInst tcVal g amap m typars tyargs = trackErrors { let css = CreateCodegenState tcVal g amap let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let ftps, _renaming, tinst = FreshenTypeInst g m typars + // traitCtxtNone: codegen witness generation — constraints already resolved at this point (audited for RFC FS-1043) + let ftps, _renaming, tinst = FreshenTypeInst g traitCtxtNone m typars let traitInfos = GetTraitConstraintInfosOfTypars g ftps let! _res = SolveTyparsEqualTypes csenv 0 m NoTrace tinst tyargs return GenWitnessArgs amap g m traitInfos @@ -4324,6 +4384,162 @@ let CanonicalizePartialInferenceProblem css denv m tps = (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult +/// RFC FS-1043: constraints with TraitContext use non-weak resolution; without use weak (preserves existing behavior) +let CanonicalizePartialInferenceProblemForExtensions css denv m tps = + let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m denv + let csenv = { csenv with ErrorOnFailedMemberConstraintResolution = true } + + IgnoreFailedMemberConstraintResolution + (fun () -> + RepeatWhileD + 0 + (fun ndeep -> + tps + |> AtLeastOneD (fun tp -> + let ty = mkTyparTy tp + + match tryAnyParTy csenv.g ty with + | ValueSome tp -> + let cxst = csenv.SolverState.ExtraCxs + let tpn = tp.Stamp + let cxs = cxst.FindAll tpn + + if isNil cxs then + ResultD false + else + // Partition: constraints with extension context vs without + let withCtxt, withoutCtxt = + cxs |> List.partition (fun (traitInfo, _) -> traitInfo.TraitContext.IsSome) + + // Remove all constraints, then solve them with appropriate weak resolution + NoTrace.Exec + (fun () -> cxs |> List.iter (fun _ -> cxst.Remove tpn)) + (fun () -> cxs |> List.iter (fun cx -> cxst.Add(tpn, cx))) + + assert (isNil (cxst.FindAll tpn)) + + trackErrors { + // Solve without-context constraints eagerly (weak=Yes, same as before) + let! r1 = + withoutCtxt + |> AtLeastOneD (fun (traitInfo, m2) -> + let csenv = { csenv with m = m2 } + SolveMemberConstraint csenv true PermitWeakResolution.Yes (ndeep + 1) m2 NoTrace traitInfo) + + // Attempt non-weak resolution on with-context constraints (weak=No) + let! r2 = + withCtxt + |> AtLeastOneD (fun (traitInfo, m2) -> + let csenv = { csenv with m = m2 } + SolveMemberConstraint csenv true PermitWeakResolution.No (ndeep + 1) m2 NoTrace traitInfo) + + return r1 || r2 + } + | ValueNone -> ResultD false))) + (fun res -> ErrorD(ErrorFromAddingConstraint(denv, res, m))) + |> RaiseOperationResult + +/// Create an ITraitContext from the expression tree contents of implementation files. +let CreateImplFileTraitContext (g: TcGlobals) (implFileContents: ModuleOrNamespaceContents list) (referencedCcus: CcuThunk list) : TraitContext = + let extensionVals = + lazy + (let result = HashMultiMap(10, HashIdentity.Structural) + + for contents in implFileContents do + for v in allValsOfModDef contents do + if v.IsExtensionMember && v.MemberInfo.IsSome then + let vref = mkLocalValRef v + let tcref = v.MemberInfo.Value.ApparentEnclosingEntity + result.Add(tcref.Stamp, vref) + + let rec collectFromModuleOrNamespaceType (mty: ModuleOrNamespaceType) = + for v in mty.AllValsAndMembers do + if v.IsExtensionMember && v.MemberInfo.IsSome && v.HasDeclaringEntity then + let vref = mkNestedValRef v.DeclaringEntity v + let tcref = v.MemberInfo.Value.ApparentEnclosingEntity + result.Add(tcref.Stamp, vref) + for entity in mty.AllEntities do + if entity.IsModuleOrNamespace then + collectFromModuleOrNamespaceType entity.ModuleOrNamespaceType + + for ccu in referencedCcus do + try collectFromModuleOrNamespaceType ccu.Contents.ModuleOrNamespaceType + with RecoverableException _ -> () + + result) + + // Collect static operator methods from all types (not just extension members). + // These are needed for 'open type' SRTP resolution where operators are intrinsic + // members of a helper type, not extension members of the target type. + let staticOperatorsByName = + lazy + (let result = HashMultiMap(10, HashIdentity.Structural) + + for contents in implFileContents do + for v in allValsOfModDef contents do + if v.MemberInfo.IsSome && not v.IsInstanceMember && not v.IsExtensionMember && IsLogicalOpName v.LogicalName then + let vref = mkLocalValRef v + let tcref = v.MemberInfo.Value.ApparentEnclosingEntity + result.Add(v.LogicalName, (tcref, vref)) + + let rec collectFromModuleOrNamespaceType (mty: ModuleOrNamespaceType) = + for v in mty.AllValsAndMembers do + if v.MemberInfo.IsSome && not v.IsInstanceMember && not v.IsExtensionMember && v.HasDeclaringEntity && IsLogicalOpName v.LogicalName then + let vref = mkNestedValRef v.DeclaringEntity v + let tcref = v.MemberInfo.Value.ApparentEnclosingEntity + result.Add(v.LogicalName, (tcref, vref)) + for entity in mty.AllEntities do + if entity.IsModuleOrNamespace then + collectFromModuleOrNamespaceType entity.ModuleOrNamespaceType + + for ccu in referencedCcus do + try collectFromModuleOrNamespaceType ccu.Contents.ModuleOrNamespaceType + with RecoverableException _ -> () + + result) + + { new TraitContext with + member _.SelectExtensionMethods(traitInfo, _m, _infoReader) = + let nm = traitInfo.MemberLogicalName + + let extResults = + [ for supportTy in traitInfo.SupportTypes do + match tryTcrefOfAppTy g supportTy with + | ValueSome tcref -> + for vref in extensionVals.Value.FindAll(tcref.Stamp) do + if vref.LogicalName = nm then + let minfo = MethInfo.FSMeth(g, supportTy, vref, None) + yield (supportTy, minfo) + | _ -> () ] + + // For operator names, also search static operator methods on all types. + // Skip operators whose enclosing type is already a support type — those are + // found as intrinsic members by GetIntrinsicMethInfosOfType and must not be + // duplicated here, because returning them as "extension" candidates changes + // resolution priority (extensions beat intrinsics for SRTP). + let opResults = + if IsLogicalOpName nm then + match traitInfo.SupportTypes with + | firstSupportTy :: _ -> + [ for (tcref, vref) in staticOperatorsByName.Value.FindAll(nm) do + let isOnSupportType = + traitInfo.SupportTypes + |> List.exists (fun sty -> + match tryTcrefOfAppTy g sty with + | ValueSome stcref -> tyconRefEq g tcref stcref + | _ -> false) + + if not isOnSupportType then + let enclosingTy = generalizedTyconRef g tcref + let minfo = MethInfo.FSMeth(g, enclosingTy, vref, None) + yield (firstSupportTy, minfo) ] + | [] -> [] + else [] + + extResults @ opResults + + member _.AccessRights = AccessibleFromEverywhere } + /// An approximation used during name resolution for intellisense to eliminate extension members which will not /// apply to a particular object argument. This is given as the isApplicableMeth argument to the partial name resolution /// functions in nameres.fs. @@ -4341,7 +4557,7 @@ let IsApplicableMethApprox g amap m (minfo: MethInfo) availObjTy = PostInferenceChecksFinal = ResizeArray() WarnWhenUsingWithoutNullOnAWithNullTarget = None } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - let minst = FreshenMethInfo m minfo + let minst = FreshenMethInfo g traitCtxtNone m minfo match minfo.GetObjArgTypes(amap, m, minst) with | [reqdObjTy] -> let reqdObjTy = if isByrefTy g reqdObjTy then destByrefTy g reqdObjTy else reqdObjTy // This is to support byref extension methods. diff --git a/src/Compiler/Checking/ConstraintSolver.fsi b/src/Compiler/Checking/ConstraintSolver.fsi index 8d21270f901..d4652dfd4dd 100644 --- a/src/Compiler/Checking/ConstraintSolver.fsi +++ b/src/Compiler/Checking/ConstraintSolver.fsi @@ -16,6 +16,9 @@ open FSharp.Compiler.Text open FSharp.Compiler.TypedTree open FSharp.Compiler.TypedTreeOps +/// Concrete ITraitContext used throughout the compiler. +type TraitContext = ITraitContext + /// Information about the context of a type equation. [] type ContextInfo = @@ -359,3 +362,8 @@ val ChooseTyparSolutionAndSolve: ConstraintSolverState -> DisplayEnv -> Typar -> val IsApplicableMethApprox: TcGlobals -> ImportMap -> range -> MethInfo -> TType -> bool val CanonicalizePartialInferenceProblem: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit + +val CanonicalizePartialInferenceProblemForExtensions: ConstraintSolverState -> DisplayEnv -> range -> Typars -> unit + +/// Create an ITraitContext from implementation file contents for use during optimization/codegen +val CreateImplFileTraitContext: TcGlobals -> ModuleOrNamespaceContents list -> CcuThunk list -> TraitContext diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fs b/src/Compiler/Checking/Expressions/CheckExpressions.fs index f98bc32259f..d28d48a57ed 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fs @@ -1175,7 +1175,8 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(displayName, n), m)) if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments displayName, m)) - if isExtrinsic && IsLogicalOpName id.idText then + // FS1215 suppressed under ExtensionConstraintSolutions (RFC FS-1043) + if isExtrinsic && IsLogicalOpName id.idText && not (g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions) then warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) PrelimMemberInfo(memberInfo, logicalName, compiledName) @@ -1898,7 +1899,7 @@ let MakeAndPublishSimpleValsForMergedScope (cenv: cenv) env m (names: NameMap<_> // to C<_> occurs then generate C for a fresh type inference variable ?ty. //------------------------------------------------------------------------- -let FreshenTyconRef (g: TcGlobals) m rigid (tcref: TyconRef) declaredTyconTypars = +let FreshenTyconRef (g: TcGlobals) (traitCtxt: ITraitContext option) m rigid (tcref: TyconRef) declaredTyconTypars = let origTypars = declaredTyconTypars let clearStaticReq = g.langVersion.SupportsFeature LanguageFeature.InterfacesWithAbstractStaticMembers let freshTypars = copyTypars clearStaticReq origTypars @@ -1906,28 +1907,28 @@ let FreshenTyconRef (g: TcGlobals) m rigid (tcref: TyconRef) declaredTyconTypars for tp in freshTypars do tp.SetRigidity rigid - let renaming, tinst = FixupNewTypars m [] [] origTypars freshTypars + let renaming, tinst = FixupNewTypars traitCtxt m [] [] origTypars freshTypars let origTy = TType_app(tcref, List.map mkTyparTy origTypars, g.knownWithoutNull) let freshTy = TType_app(tcref, tinst, g.knownWithoutNull) origTy, freshTypars, renaming, freshTy -let FreshenPossibleForallTy g m rigid ty = +let FreshenPossibleForallTy g traitCtxt m rigid ty = let origTypars, tau = tryDestForallTy g ty if isNil origTypars then [], [], [], tau else // tps may be have been equated to other tps in equi-recursive type inference and units-of-measure type inference. Normalize them here let origTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g origTypars - let tps, renaming, tinst = CopyAndFixupTypars g m rigid origTypars + let tps, renaming, tinst = CopyAndFixupTypars g traitCtxt m rigid origTypars origTypars, tps, tinst, instType renaming tau -let FreshenTyconRef2 (g: TcGlobals) m (tcref: TyconRef) = - let tps, renaming, tinst = FreshenTypeInst g m (tcref.Typars m) +let FreshenTyconRef2 (g: TcGlobals) (traitCtxt: ITraitContext option) m (tcref: TyconRef) = + let tps, renaming, tinst = FreshenTypeInst g traitCtxt m (tcref.Typars m) tps, renaming, tinst, TType_app (tcref, tinst, g.knownWithoutNull) /// Given a abstract method, which may be a generic method, freshen the type in preparation /// to apply it as a constraint to the method that implements the abstract slot -let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = +let FreshenAbstractSlot g (traitCtxt: ITraitContext option) amap m synTyparDecls absMethInfo = // Work out if an explicit instantiation has been given. If so then the explicit type // parameters will be made rigid and checked for generalization. If not then auto-generalize @@ -1949,7 +1950,7 @@ let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = let ttps = absMethInfo.GetFormalTyparsOfDeclaringType m let ttinst = argsOfAppTy g absMethInfo.ApparentEnclosingType let rigid = if typarsFromAbsSlotAreRigid then TyparRigidity.Rigid else TyparRigidity.Flexible - FreshenAndFixupTypars g m rigid ttps ttinst fmtps + FreshenAndFixupTypars g traitCtxt m rigid ttps ttinst fmtps // Work out the required type of the member let argTysFromAbsSlot = argTys |> List.mapSquared (instType typarInstFromAbsSlot) @@ -2747,11 +2748,11 @@ module EventDeclarationNormalization = /// Make a copy of the "this" type for a generic object type, e.g. List<'T> --> List<'?> for a fresh inference variable. /// Also adjust the "this" type to take into account whether the type is a struct. -let FreshenObjectArgType (cenv: cenv) m rigid tcref isExtrinsic declaredTyconTypars = +let FreshenObjectArgType (cenv: cenv) (traitCtxt: ITraitContext option) m rigid tcref isExtrinsic declaredTyconTypars = let g = cenv.g let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy = - FreshenTyconRef g m rigid tcref declaredTyconTypars + FreshenTyconRef g traitCtxt m rigid tcref declaredTyconTypars // Struct members have a byref 'this' type (unless they are extrinsic extension members) let thisTy = @@ -2841,7 +2842,7 @@ let TcVal (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValRef) instantiatio // The value may still be generic, e.g. // [] // let Null = null - let tpsorig, _, tinst, tauTy = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let tpsorig, _, tinst, tauTy = FreshenPossibleForallTy g env.TraitContext m TyparRigidity.Flexible vTy tpsorig, Expr.Const (c, m, tauTy), isSpecial, tauTy, tinst, tpenv | None -> @@ -2871,7 +2872,7 @@ let TcVal (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValRef) instantiatio tpsorig, NormalValUse, tinst, tau, tpenv | ValInRecScope true | ValNotInRecScope -> - let tpsorig, _, tinst, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let tpsorig, _, tinst, tau = FreshenPossibleForallTy g env.TraitContext m TyparRigidity.Flexible vTy tpsorig, NormalValUse, tinst, tau, tpenv // If we have got an explicit instantiation then use that @@ -2898,7 +2899,7 @@ let TcVal (cenv: cenv) env (tpenv: UnscopedTyparEnv) (vref: ValRef) instantiatio | ValInRecScope true | ValNotInRecScope -> - let vTypars, tps, tpTys, vTauTy = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let vTypars, tps, tpTys, vTauTy = FreshenPossibleForallTy g env.TraitContext m TyparRigidity.Flexible vTy let tinst, tpenv = checkTys tpenv (tps |> List.map (fun tp -> tp.Kind)) @@ -3111,7 +3112,7 @@ let BuildPossiblyConditionalMethodCall (cenv: cenv) env isMutable m isProp minfo // BuildInvokerExpressionForProvidedMethodCall converts references to F# intrinsics back to values // and uses TcVal to do this. However we don't want to check attributes again for provided references to values, // so we pass 'false' for 'checkAttributes'. - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext let _, retExpr, retTy = ProvidedMethodCalls.BuildInvokerExpressionForProvidedMethodCall tcVal (g, cenv.amap, mi, objArgs, isMutable, isProp, valUseFlags, args, m) retExpr, retTy @@ -3362,7 +3363,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result getEnumeratorMethInfo -> - let getEnumeratorMethInst = FreshenMethInfo m getEnumeratorMethInfo + let getEnumeratorMethInst = FreshenMethInfo g env.TraitContext m getEnumeratorMethInfo let getEnumeratorRetTy = getEnumeratorMethInfo.GetFSharpReturnType(cenv.amap, m, getEnumeratorMethInst) if hasArgs getEnumeratorMethInfo getEnumeratorMethInst then err true tyToSearchForGetEnumeratorAndItem else @@ -3370,7 +3371,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result moveNextMethInfo -> - let moveNextMethInst = FreshenMethInfo m moveNextMethInfo + let moveNextMethInst = FreshenMethInfo g env.TraitContext m moveNextMethInfo let moveNextRetTy = moveNextMethInfo.GetFSharpReturnType(cenv.amap, m, moveNextMethInst) if not (typeEquiv g g.bool_ty moveNextRetTy) then err false getEnumeratorRetTy else if hasArgs moveNextMethInfo moveNextMethInst then err false getEnumeratorRetTy else @@ -3379,7 +3380,7 @@ let AnalyzeArbitraryExprAsEnumerable (cenv: cenv) (env: TcEnv) localAlloc m expr | Exception exn -> Exception exn | Result getCurrentMethInfo -> - let getCurrentMethInst = FreshenMethInfo m getCurrentMethInfo + let getCurrentMethInst = FreshenMethInfo g env.TraitContext m getCurrentMethInfo if hasArgs getCurrentMethInfo getCurrentMethInst then err false getEnumeratorRetTy else let enumElemTy = getCurrentMethInfo.GetFSharpReturnType(cenv.amap, m, getCurrentMethInst) @@ -4188,11 +4189,11 @@ let rec TcTyparConstraint ridx (cenv: cenv) newOk checkConstraints occ (env: TcE match checkConstraints with | NoCheckCxs -> //let formalEnclosingTypars = [] - let tpsorig = tcref.Typars(m) //List.map (destTyparTy g) inst //, _, tinst, _ = FreshenTyconRef2 g m tcref - let tps = List.map (destTyparTy g) tinst //, _, tinst, _ = FreshenTyconRef2 g m tcref + let tpsorig = tcref.Typars(m) //List.map (destTyparTy g) inst //, _, tinst, _ = FreshenTyconRef2 g env.TraitContext m tcref + let tps = List.map (destTyparTy g) tinst //, _, tinst, _ = FreshenTyconRef2 g env.TraitContext m tcref let tprefInst, _tptys = mkTyparToTyparRenaming tpsorig tps //let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (tp.Constraints @ CopyTyparConstraints m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (tp.Constraints @ CopyTyparConstraints env.TraitContext m tprefInst tporig)) | CheckCxs -> () | AppTy g (_tcref, selfTy :: _rest) when isTyparTy g selfTy && isInterfaceTy g tyR -> AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css m NoTrace tyR selfTy @@ -4293,7 +4294,7 @@ and TcPseudoMemberSpec cenv newOk env synTypes tpenv synMemberSig m = let item = Item.OtherName (Some id, memberConstraintTy, None, None, id.idRange) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, emptyTyparInst, ItemOccurrence.Use, env.AccessRights) - TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None, ref None), tpenv + TTrait(tys, logicalCompiledName, memberFlags, argTys, returnTy, ref None, ref None, env.TraitContext), tpenv | _ -> error(Error(FSComp.SR.tcInvalidConstraint(), m)) @@ -4311,7 +4312,7 @@ and TcValSpec (cenv: cenv) env declKind newOk containerInfo memFlagsOpt thisTyOp | Some(MemberOrValContainerInfo(tcref, _, _, _, declaredTyconTypars)) -> let isExtrinsic = (declKind = ExtrinsicExtensionBinding) let _, enclosingDeclaredTypars, _, _, thisTy = - FreshenObjectArgType cenv m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars + FreshenObjectArgType cenv env.TraitContext m TyparRigidity.Rigid tcref isExtrinsic declaredTyconTypars // An implemented interface type is in terms of the type's type parameters. // We need a signature in terms of the values' type parameters. @@ -5831,7 +5832,7 @@ and TcAdjustExprForTypeDirectedConversions (cenv: cenv) (overallTy: OverallTy) a match overallTy with | MustConvertTo (isMethodArg, reqdTy) when g.langVersion.SupportsFeature LanguageFeature.AdditionalTypeDirectedConversions || (g.langVersion.SupportsFeature LanguageFeature.NullableOptionalInterop && isMethodArg) -> - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext AdjustExprForTypeDirectedConversions tcVal g cenv.amap cenv.infoReader env.AccessRights reqdTy actualTy m expr | _ -> expr @@ -7166,7 +7167,7 @@ and FreshenObjExprAbstractSlot (cenv: cenv) (env: TcEnv) (implTy: TType) virtNam | [ (_, absSlot) ] -> let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot g cenv.amap mBinding synTyparDecls absSlot + FreshenAbstractSlot g env.TraitContext cenv.amap mBinding synTyparDecls absSlot // Work out the required type of the member let bindingTy = mkFunTy cenv.g implTy (mkMethodTy cenv.g argTysFromAbsSlot retTyFromAbsSlot) @@ -7235,7 +7236,12 @@ and TcObjectExprBinding (cenv: cenv) (env: TcEnv) implTy tpenv (absSlotInfo, bin | _ -> declaredTypars // Canonicalize constraints prior to generalization - CanonicalizePartialInferenceProblem cenv.css denv m declaredTypars + // For inline bindings with extension constraint solutions enabled, use selective canonicalization + // that keeps extension-context constraints open per RFC FS-1043 claim #6. + if g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions && inlineFlag = ValInline.Always then + CanonicalizePartialInferenceProblemForExtensions cenv.css denv m declaredTypars + else + CanonicalizePartialInferenceProblem cenv.css denv m declaredTypars let freeInEnv = GeneralizationHelpers.ComputeUngeneralizableTypars env @@ -8264,7 +8270,7 @@ and TcForEachExpr cenv overallTy env tpenv (seqExprOnly, isFromSource, synPat, s // try optimize 'for i in span do' for span or readonlyspan match tryGetOptimizeSpanMethods g mWholeExpr enumExprTy with | ValueSome(getItemMethInfo, getLengthMethInfo, isReadOnlySpan) -> - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext let spanVar, spanExpr = mkCompGenLocal mEnumExpr "span" enumExprTy let idxVar, idxExpr = mkCompGenLocal mPat "idx" g.int32_ty let _, elemTy = if isReadOnlySpan then destReadOnlySpanTy g mWholeExpr enumExprTy else destSpanTy g mWholeExpr enumExprTy @@ -8960,7 +8966,7 @@ and TcUnionCaseOrExnCaseOrActivePatternResultItemThen (cenv: cenv) overallTy env mkConstrApp, [ucaseAppTy], [ for s, m in apinfo.ActiveTagsWithRanges -> mkSynId m s ] | _ -> let ucref = mkChoiceCaseRef g m aparity n - let _, _, tinst, _ = FreshenTyconRef2 g mItem ucref.TyconRef + let _, _, tinst, _ = FreshenTyconRef2 g env.TraitContext mItem ucref.TyconRef let ucinfo = UnionCaseInfo (tinst, ucref) ApplyUnionCaseOrExnTypes mItem cenv env ucaseAppTy (Item.UnionCase(ucinfo, false)) | _ -> @@ -9197,7 +9203,6 @@ and TcCtorItemThen (cenv: cenv) overallTy env item nm minfos tinstEnclosing tpen match minfos with | minfo :: _ -> minfo.ApparentEnclosingType | [] -> error(Error(FSComp.SR.tcTypeHasNoAccessibleConstructor(), mItem)) - match delayed with | DelayedApp(_, _, _, arg, mExprAndArg) :: otherDelayed -> @@ -9333,7 +9338,7 @@ and TcImplicitOpItemThen (cenv: cenv) overallTy env id sln tpenv mItem delayed = let memberFlags = StaticMemberFlags SynMemberKind.Member let logicalCompiledName = ComputeLogicalName id memberFlags - let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, ref None, sln) + let traitInfo = TTrait(argTys, logicalCompiledName, memberFlags, argTys, Some retTy, ref None, sln, env.TraitContext) let expr = Expr.Op (TOp.TraitCall traitInfo, [], ves, mItem) let expr = mkLambdas g mItem [] vs (expr, retTy) @@ -10215,18 +10220,16 @@ and TcMethodApplication_UniqueOverloadInference let callerArgs = { Unnamed = unnamedCurriedCallerArgs; Named = namedCurriedCallerArgs } - let arityFilteredCandidates = candidateMethsAndProps - let makeOneCalledMeth (minfo, pinfoOpt, usesParamArrayConversion) = - let minst = FreshenMethInfo mItem minfo + let minst = FreshenMethInfo g env.TraitContext mItem minfo let callerTyArgs = match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo g env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt) let preArgumentTypeCheckingCalledMethGroup = - [ for minfo, pinfoOpt in arityFilteredCandidates do + [ for minfo, pinfoOpt in candidateMethsAndProps do let meth = makeOneCalledMeth (minfo, pinfoOpt, true) yield meth if meth.UsesParamArrayConversion then @@ -10452,7 +10455,7 @@ and TcMethodApplication match tyArgsOpt with | Some tyargs -> minfo.AdjustUserTypeInstForFSharpStyleIndexedExtensionMembers tyargs | None -> minst - CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt)) + CalledMeth(cenv.infoReader, Some(env.NameEnv), isCheckingAttributeCall, FreshenMethInfo g env.TraitContext, mMethExpr, ad, minfo, minst, callerTyArgs, pinfoOpt, callerObjArgTys, callerArgs, usesParamArrayConversion, true, objTyOpt, staticTyOpt)) // Commit unassociated constraints prior to member overload resolution where there is ambiguity // about the possible target of the call. @@ -10527,7 +10530,7 @@ and TcMethodApplication /// STEP 5. Build the argument list. Adjust for optional arguments, byref arguments and coercions. let objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds = - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext AdjustCallerArgs tcVal TcFieldInit env.eCallerMemberName cenv.infoReader ad finalCalledMeth objArgs lambdaVars mItem mMethExpr // Record the resolution of the named argument for the Language Service @@ -10657,7 +10660,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo MethInfoChecks g cenv.amap true None [objExpr] ad m pminfo let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let mut = (if isStructTy g (tyOfExpr g objExpr) then DefinitelyMutates else PossiblyMutates) let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] propStaticTyOpt |> fst @@ -10667,7 +10670,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo // Get or set instance IL field ILFieldInstanceChecks g cenv.amap ad m finfo let calledArgTy = finfo.FieldType (cenv.amap, m) - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildILFieldSet g m objExpr finfo argExpr argExprPrebinder, action, Item.ILField finfo @@ -10676,7 +10679,7 @@ and TcSetterArgExpr (cenv: cenv) env denv objExpr ad assignedSetter calledFromCo RecdFieldInstanceChecks g cenv.amap ad m rfinfo let calledArgTy = rfinfo.FieldType CheckRecdFieldMutation m denv rfinfo - let tcVal = LightweightTcValForUsingInBuildMethodCall g + let tcVal = LightweightTcValForUsingInBuildMethodCall g env.TraitContext let argExprPrebinder, argExpr = AdjustCallerArgExpr tcVal g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr let action = BuildRecdFieldSet g m objExpr rfinfo argExpr argExprPrebinder, action, Item.RecdField rfinfo @@ -10982,7 +10985,7 @@ and TcMatchClause cenv inputTy (resultTy: OverallTy) env isFirst tpenv synMatchC | TPat_tuple (_,pats,_,_) -> pats |> List.forall isWild | _ -> false - let rec eliminateNull (ty:TType) (p:Pattern) = + let rec eliminateNull (ty:TType) (p:Pattern) = match p with | TPat_null _ -> removeNull ty | TPat_as (p,_,_) -> eliminateNull ty p @@ -11040,7 +11043,7 @@ and TcAndBuildFixedExpr (cenv: cenv) env (overallPatTy, fixedExpr, overallExprTy | Some mInfo -> checkLanguageFeatureAndRecover g.langVersion LanguageFeature.ExtendedFixedBindings mBinding - let mInst = FreshenMethInfo mBinding mInfo + let mInst = FreshenMethInfo g env.TraitContext mBinding mInfo let pinnableReference, actualRetTy = BuildPossiblyConditionalMethodCall cenv env NeverMutates mBinding false mInfo NormalValUse mInst [ fixedExpr ] [] None let elemTy = destByrefTy g actualRetTy @@ -11826,15 +11829,35 @@ and TcLetBinding (cenv: cenv) isUse env containerInfo declKind tpenv (synBinds, let (ContainerInfo(altActualParent, _)) = containerInfo // Canonicalize constraints prior to generalization + // For inline bindings with extension constraint solutions enabled, use selective canonicalization + // that keeps extension-context constraints open per RFC FS-1043 claim #6. let denv = env.DisplayEnv + let extensionsEnabled = g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions + try - CanonicalizePartialInferenceProblem cenv.css denv synBindsRange - (checkedBinds |> List.collect (fun tbinfo -> - let (CheckedBindingInfo(_, _, _, _, explicitTyparInfo, _, _, _, tauTy, _, _, _, _, _)) = tbinfo - let (ExplicitTyparInfo(_, declaredTypars, _)) = explicitTyparInfo - let maxInferredTypars = (freeInTypeLeftToRight g false tauTy) - declaredTypars @ maxInferredTypars)) - with RecoverableException _ -> () + let nonExtensionTypars, extensionTypars = + checkedBinds + |> List.fold + (fun (nonExt, ext) tbinfo -> + let (CheckedBindingInfo(inlineFlag, _, _, _, explicitTyparInfo, _, _, _, tauTy, _, _, _, _, _)) = + tbinfo + + let (ExplicitTyparInfo(_, declaredTypars, _)) = explicitTyparInfo + let maxInferredTypars = (freeInTypeLeftToRight g false tauTy) + let allTypars = declaredTypars @ maxInferredTypars + + if extensionsEnabled && inlineFlag = ValInline.Always then + (nonExt, ext @ allTypars) + else + (nonExt @ allTypars, ext)) + ([], []) + + CanonicalizePartialInferenceProblem cenv.css denv synBindsRange nonExtensionTypars + + if not (List.isEmpty extensionTypars) then + CanonicalizePartialInferenceProblemForExtensions cenv.css denv synBindsRange extensionTypars + with RecoverableException _ -> + () let lazyFreeInEnv = lazy (GeneralizationHelpers.ComputeUngeneralizableTypars env) @@ -12114,7 +12137,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (_: Val option) (a let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let typarsFromAbsSlotAreRigid, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot g envinner.TraitContext cenv.amap m synTyparDecls uniqueAbstractMeth let declaredTypars = (if typarsFromAbsSlotAreRigid then typarsFromAbsSlot else declaredTypars) @@ -12180,7 +12203,7 @@ and ApplyAbstractSlotInference (cenv: cenv) (envinner: TcEnv) (_: Val option) (a let uniqueAbstractMeth = uniqueAbstractMeth.Instantiate(cenv.amap, m, renaming) let _, typarsFromAbsSlot, argTysFromAbsSlot, retTyFromAbsSlot = - FreshenAbstractSlot g cenv.amap m synTyparDecls uniqueAbstractMeth + FreshenAbstractSlot g envinner.TraitContext cenv.amap m synTyparDecls uniqueAbstractMeth if not (isNil typarsFromAbsSlot) then errorR(InternalError("Unexpected generic property", memberId.idRange)) @@ -12278,7 +12301,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl CheckForNonAbstractInterface g declKind tcref memberFlags true id.idRange let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let tcrefObjTy, enclosingDeclaredTypars, renaming, _, _ = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, _, _ = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic @@ -12303,7 +12326,7 @@ and AnalyzeRecursiveStaticMemberOrValDecl error(Error(FSComp.SR.tcConstructorsDisallowedInExceptionAugmentation(), id.idRange)) let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let _, enclosingDeclaredTypars, _, objTy, thisTy = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner let envinner = MakeInnerEnvForTyconRef envinner tcref isExtrinsic @@ -12389,7 +12412,7 @@ and AnalyzeRecursiveInstanceMemberDecl // The type being augmented tells us the type of 'this' let isExtrinsic = (declKind = ExtrinsicExtensionBinding) - let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars + let tcrefObjTy, enclosingDeclaredTypars, renaming, objTy, thisTy = FreshenObjectArgType cenv envinner.TraitContext mBinding TyparRigidity.WillBeRigid tcref isExtrinsic declaredTyconTypars let envinner = AddDeclaredTypars CheckForDuplicateTypars enclosingDeclaredTypars envinner @@ -12854,8 +12877,27 @@ and TcIncrementalLetRecGeneralization cenv scopem [], tpenv else - let supportForBindings = newGeneralizableBindings |> List.collect (TcLetrecComputeSupportForBinding cenv) - CanonicalizePartialInferenceProblem cenv.css denv scopem supportForBindings + let extensionsEnabled = cenv.g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions + + let nonExtensionSupport, extensionSupport = + newGeneralizableBindings + |> List.fold + (fun (nonExt, ext) pgrbind -> + let (CheckedBindingInfo(inlineFlag, _, _, _, _, _, _, _, _, _, _, _, _, _)) = + pgrbind.CheckedBinding + + let support = TcLetrecComputeSupportForBinding cenv pgrbind + + if extensionsEnabled && inlineFlag = ValInline.Always then + (nonExt, ext @ support) + else + (nonExt @ support, ext)) + ([], []) + + CanonicalizePartialInferenceProblem cenv.css denv scopem nonExtensionSupport + + if not (List.isEmpty extensionSupport) then + CanonicalizePartialInferenceProblemForExtensions cenv.css denv scopem extensionSupport let generalizedTyparsL = newGeneralizableBindings |> List.map (TcLetrecComputeAndGeneralizeGenericTyparsForBinding cenv denv freeInEnv) diff --git a/src/Compiler/Checking/Expressions/CheckExpressions.fsi b/src/Compiler/Checking/Expressions/CheckExpressions.fsi index d8f801c7c5c..d3db71c1fd8 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fsi +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fsi @@ -486,6 +486,7 @@ val FixupLetrecBind: /// inference variables with the given rigidity. val FreshenObjectArgType: cenv: TcFileState -> + traitCtxt: ITraitContext option -> m: range -> rigid: TyparRigidity -> tcref: TyconRef -> diff --git a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs index 0fe8e296b81..c31918ae247 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs +++ b/src/Compiler/Checking/Expressions/CheckExpressionsOps.fs @@ -24,10 +24,10 @@ let TryAllowFlexibleNullnessInControlFlow isFirst (g: TcGlobals.TcGlobals) ty = | true, true, ValueSome tp -> tp.SetSupportsNullFlex(true) | _ -> () -let CopyAndFixupTypars g m rigid tpsorig = - FreshenAndFixupTypars g m rigid [] [] tpsorig +let CopyAndFixupTypars g traitCtxt m rigid tpsorig = + FreshenAndFixupTypars g traitCtxt m rigid [] [] tpsorig -let FreshenPossibleForallTy g m rigid ty = +let FreshenPossibleForallTy g traitCtxt m rigid ty = let origTypars, tau = tryDestForallTy g ty if isNil origTypars then @@ -35,12 +35,12 @@ let FreshenPossibleForallTy g m rigid ty = else // tps may be have been equated to other tps in equi-recursive type inference and units-of-measure type inference. Normalize them here let origTypars = NormalizeDeclaredTyparsForEquiRecursiveInference g origTypars - let tps, renaming, tinst = CopyAndFixupTypars g m rigid origTypars + let tps, renaming, tinst = CopyAndFixupTypars g traitCtxt m rigid origTypars origTypars, tps, tinst, instType renaming tau /// simplified version of TcVal used in calls to BuildMethodCall (typrelns.fs) /// this function is used on typechecking step for making calls to provided methods and on optimization step (for the same purpose). -let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = +let LightweightTcValForUsingInBuildMethodCall g traitCtxt (vref: ValRef) vrefFlags (vrefTypeInst: TTypes) m = let v = vref.Deref let vTy = vref.Type // byref-typed values get dereferenced @@ -49,14 +49,15 @@ let LightweightTcValForUsingInBuildMethodCall g (vref: ValRef) vrefFlags (vrefTy else match v.LiteralValue with | Some literalConst -> - let _, _, _, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let _, _, _, tau = FreshenPossibleForallTy g traitCtxt m TyparRigidity.Flexible vTy Expr.Const(literalConst, m, tau), tau | None -> // Instantiate the value let tau = // If we have got an explicit instantiation then use that - let _, tps, tpTys, tau = FreshenPossibleForallTy g m TyparRigidity.Flexible vTy + let _, tps, tpTys, tau = + FreshenPossibleForallTy g traitCtxt m TyparRigidity.Flexible vTy if tpTys.Length <> vrefTypeInst.Length then error (Error(FSComp.SR.tcTypeParameterArityMismatch (tps.Length, vrefTypeInst.Length), m)) @@ -90,7 +91,7 @@ let CompilePatternForMatch g env.DisplayEnv cenv.amap - (LightweightTcValForUsingInBuildMethodCall g) + (LightweightTcValForUsingInBuildMethodCall g env.TraitContext) cenv.infoReader mExpr mMatch diff --git a/src/Compiler/Checking/MethodCalls.fs b/src/Compiler/Checking/MethodCalls.fs index 07e0e95baed..b560cc00afa 100644 --- a/src/Compiler/Checking/MethodCalls.fs +++ b/src/Compiler/Checking/MethodCalls.fs @@ -1033,7 +1033,14 @@ let TakeObjAddrForMethodCall g amap (minfo: MethInfo) isMutable m staticTyOpt ob /// Build an expression node that is a call to a .NET method. let BuildILMethInfoCall g amap m isProp (minfo: ILMethInfo) valUseFlags minst direct args = - let isStruct = isStructTy g minfo.ApparentEnclosingType + // For C#-style extension methods, the declaring type is the static helper class + // (a reference type), not the apparent/extended type. Use the declaring type for + // isStruct to avoid emitting value-type boxity for a reference-type method spec. + let isStruct = + if minfo.IsILExtensionMethod then + false + else + isStructTy g minfo.ApparentEnclosingType let ctor = minfo.IsConstructor if minfo.IsClassConstructor then error (InternalError (minfo.ILName+": cannot call a class constructor", m)) @@ -1085,7 +1092,22 @@ let BuildFSharpMethodCall g m (ty, vref: ValRef) valUseFlags minst args = let vExpr = Expr.Val (vref, valUseFlags, m) let vExprTy = vref.Type let tpsorig, tau = vref.GeneralizedType - let vtinst = argsOfAppTy g ty @ minst + let vtinst = + if vref.IsExtensionMember then + // For extension members, FormalMethodTypars includes the enclosing type's + // type parameters (AnalyzeTypeOfMemberVal treats all typars as method typars). + // The minst from the trait solution contains fresh type variables for all of them, + // but the enclosing type's type parameters may not be solved through trait matching + // (the trait solver constrains method-level typars, not enclosing-type typars). + // Use argsOfAppTy to get the concrete enclosing type args, then append + // the remaining method-specific type args from minst. + let parentTyArgs = argsOfAppTy g ty + if List.length minst < parentTyArgs.Length then + error(InternalError("BuildFSharpMethodCall: minst shorter than enclosing type args for extension member", m)) + else + parentTyArgs @ List.skip parentTyArgs.Length minst + else + argsOfAppTy g ty @ minst if tpsorig.Length <> vtinst.Length then error(InternalError("BuildFSharpMethodCall: unexpected List.length mismatch", m)) let expr = mkTyAppExpr m (vExpr, vExprTy) vtinst let exprTy = instType (mkTyparInst tpsorig vtinst) tau @@ -2184,14 +2206,56 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = match sln with | ILMethSln(origTy, extOpt, mref, minst, staticTyOpt) -> let metadataTy = convertToTypeWithMetadataIfPossible g origTy - let tcref = tcrefOfAppTy g metadataTy - let mdef = resolveILMethodRef tcref.ILTyconRawMetadata mref + // ILMethSln minst: strip typar indirections. For C#-style extensions, + // unsolved typars from 'this' param (dropped by GetParamTypes) are + // resolved via origTy and IL first-param type variable analysis. + let minst = + let hasUnsolved = minst |> List.exists (fun ty -> match stripTyEqnsAndMeasureEqns g ty with TType_var(tp, _) -> not tp.IsSolved | _ -> false) + if hasUnsolved && extOpt.IsSome then + // Unsolved typars arise when GetParamTypes drops the 'this' parameter + // for C#-style extensions, preventing CanMemberSigsMatchUpToCheck from + // constraining method type parameters that appear only in the 'this' + // parameter (e.g., T in Stringify(this T value)). + // + // Only substitute typars that actually appear in the method's first + // parameter (the 'this' parameter in IL). Typars in other parameters + // should already be solved; if not, leave them as-is. + let thisParamTyVarIndices = + match mref.ArgTypes with + | firstArgTy :: _ -> + // Collect type variable indices used in the 'this' parameter type. + // IL type variables are referenced by index (!!0, !!1, etc.) + let rec collectTyVarIndices acc ilTy = + match ilTy with + | ILType.TypeVar idx -> Set.add (int idx) acc + | ILType.Array(_, elTy) -> collectTyVarIndices acc elTy + | ILType.Boxed tspec | ILType.Value tspec -> + tspec.GenericArgs |> List.fold collectTyVarIndices acc + | ILType.Byref innerTy | ILType.Ptr innerTy -> + collectTyVarIndices acc innerTy + | _ -> acc + collectTyVarIndices Set.empty firstArgTy + | [] -> Set.empty + minst |> List.mapi (fun i ty -> + match stripTyEqnsAndMeasureEqns g ty with + | TType_var(tp, _) when not tp.IsSolved && Set.contains i thisParamTyVarIndices -> + origTy + | other -> other) + else + minst |> List.map (stripTyEqnsAndMeasureEqns g) let ilMethInfo = - match extOpt with - | None -> MethInfo.CreateILMeth(amap, m, origTy, mdef) - | Some ilActualTypeRef -> - let actualTyconRef = ImportILTypeRef amap m ilActualTypeRef - MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef) + match extOpt with + | None -> + let tcref = tcrefOfAppTy g metadataTy + let mdef = resolveILMethodRef tcref.ILTyconRawMetadata mref + MethInfo.CreateILMeth(amap, m, origTy, mdef) + | Some ilActualTypeRef -> + // For C#-style extension methods, the method lives in a static helper + // class (ilActualTypeRef), not on the apparent/extended type (origTy). + // Resolve the method reference against the declaring type's metadata. + let actualTyconRef = ImportILTypeRef amap m ilActualTypeRef + let mdef = resolveILMethodRef actualTyconRef.ILTyconRawMetadata mref + MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, Some 0UL, mdef) Choice1Of5 (ilMethInfo, minst, staticTyOpt) | FSMethSln(ty, vref, minst, staticTyOpt) -> @@ -2231,6 +2295,24 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = | argExprs -> None, argExprs else None, argExprs + // C#-style extensions: strip address-taking from receiver (static IL call expects by-value arg) + let receiverArgOpt = + if not minfo.IsCSharpStyleExtensionMember then receiverArgOpt + else + match receiverArgOpt with + | Some (Expr.Op(TOp.LValueOp(LAddrOf _, vref), _, [], m2)) -> + Some (Expr.Val(vref, NormalValUse, m2)) + | Some (Expr.Let(TBind(tmp, innerExpr, _), Expr.Op(TOp.LValueOp(LAddrOf _, vref2), _, [], _), _, _)) + when valRefEq g (mkLocalValRef tmp) vref2 -> + Some innerExpr + | Some receiver when isByrefTy g (tyOfExpr g receiver) -> + // General fallback for other byref forms: bind the byref to a + // compiler-generated local, then dereference via LByrefGet to + // convert byref → T for the static extension method call. + let tmp, _ = mkCompGenLocal m "csExtReceiver" (tyOfExpr g receiver) + Some (mkCompGenLet m tmp receiver (mkAddrGet m (mkLocalValRef tmp))) + | _ -> receiverArgOpt + // For methods taking no arguments, 'argExprs' will be a single unit expression here let argExprs = match argTypes, argExprs with @@ -2244,7 +2326,9 @@ let GenWitnessExpr amap g m (traitInfo: TraitConstraintInfo) argExprs = // Fix bug 1281 / issue #8098: If the receiver needs its address taken for a // constrained call, go do that and re-resolve via TraitCall with the byref receiver. + // Skip for C#-style extension methods: they are static in IL and take the receiver by value. let needsAddrTaken = + not minfo.IsCSharpStyleExtensionMember && minfo.IsInstance && (minfo.IsStruct || (ComputeConstrainedCallInfo g amap m staticTyOpt argExprs minfo).IsSome) diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs index 07d0ea4743b..e85897d2a6d 100644 --- a/src/Compiler/Checking/NameResolution.fs +++ b/src/Compiler/Checking/NameResolution.fs @@ -450,6 +450,9 @@ type NameResolutionEnv = /// Other extension members unindexed by type eUnindexedExtensionMembers: ExtensionMember list + /// Static operator methods from 'open type' declarations, available for SRTP resolution + eOpenedTypeOperators: MethInfo list + /// Typars (always available by unqualified names). Further typars can be /// in the tpenv, a structure folded through each top-level definition. eTypars: NameMap @@ -472,6 +475,7 @@ type NameResolutionEnv = eFullyQualifiedTyconsByDemangledNameAndArity = LayeredMap.Empty eIndexedExtensionMembers = TyconRefMultiMap<_>.Empty eUnindexedExtensionMembers = [] + eOpenedTypeOperators = [] eTypars = Map.empty } member nenv.DisplayEnv = nenv.eDisplayEnv @@ -629,6 +633,8 @@ let IntrinsicPropInfosOfTypeInScope (infoReader: InfoReader) optFilter ad findFl /// Select from a list of extension properties let SelectPropInfosFromExtMembers (infoReader: InfoReader) ad optFilter declaringTy m extMemInfos = + // Fast path: no allocations when the input list is empty. + if isNil extMemInfos then [] else let g = infoReader.g let amap = infoReader.amap // NOTE: multiple "open"'s push multiple duplicate values into eIndexedExtensionMembers, hence use a set. @@ -704,6 +710,9 @@ let rec TrySelectExtensionMethInfoOfILExtMem m amap apparentTy (actualParent, mi /// Select from a list of extension methods let SelectMethInfosFromExtMembers (infoReader: InfoReader) optFilter apparentTy m extMemInfos = + // Fast path: avoid allocating the HashSet and list builder when there are no candidates. + // This is hot under SRTP/extension-member-heavy code where many lookups miss entirely. + if isNil extMemInfos then [] else let g = infoReader.g // NOTE: multiple "open"'s push multiple duplicate values into eIndexedExtensionMembers let seen = HashSet(ExtensionMember.Comparer g) @@ -726,22 +735,69 @@ let SelectMethInfosFromExtMembers (infoReader: InfoReader) optFilter apparentTy | _ -> () ] +/// Look up extension method infos for a single type from indexed extension members only. +/// This does NOT handle function type -> FSharpFunc conversion to avoid issues with SRTP constraint solving. +let private SelectIndexedExtMethInfosForType (infoReader: InfoReader) (nenv: NameResolutionEnv) optFilter m ty = + let g = infoReader.g + + match tryTcrefOfAppTy g ty with + | ValueSome tcref -> + let extMemInfos = nenv.eIndexedExtensionMembers.Find tcref + SelectMethInfosFromExtMembers infoReader optFilter ty m extMemInfos + | _ -> [] + +/// Look up extension method infos for function types by converting to FSharpFunc<_,_>. +let private SelectIndexedExtMethInfosForFunctionType (infoReader: InfoReader) (nenv: NameResolutionEnv) optFilter m ty = + let g = infoReader.g + + match tryDestFunTy g ty with + | ValueSome (domTy, rngTy) -> + let fsharpFuncTy = mkWoNullAppTy g.fastFunc_tcr [domTy; rngTy] + let extMemInfos = nenv.eIndexedExtensionMembers.Find g.fastFunc_tcr + SelectMethInfosFromExtMembers infoReader optFilter fsharpFuncTy m extMemInfos + | ValueNone -> [] + +/// Look up extension method infos for tuple types by converting to System.Tuple<_,...> or System.ValueTuple<_,...>. +let private SelectIndexedExtMethInfosForTupleType (infoReader: InfoReader) (nenv: NameResolutionEnv) optFilter m ty = + let g = infoReader.g + + if isAnyTupleTy g ty then + let compiledTupleTy = convertToTypeWithMetadataIfPossible g ty + match tryTcrefOfAppTy g compiledTupleTy with + | ValueSome tcref -> + let extMemInfos = nenv.eIndexedExtensionMembers.Find tcref + SelectMethInfosFromExtMembers infoReader optFilter compiledTupleTy m extMemInfos + | ValueNone -> [] + else + [] + +/// Look up extension method infos for a single type from both indexed and unindexed extension members. +let private SelectExtMethInfosForType (infoReader: InfoReader) (nenv: NameResolutionEnv) optFilter m ty = + let indexedResults = SelectIndexedExtMethInfosForType infoReader nenv optFilter m ty + let unindexedResults = SelectMethInfosFromExtMembers infoReader optFilter ty m nenv.eUnindexedExtensionMembers + indexedResults @ unindexedResults + /// Query the available extension methods of a type (including extension methods for inherited types) let ExtensionMethInfosOfTypeInScope (collectionSettings: ResultCollectionSettings) (infoReader: InfoReader) (nenv: NameResolutionEnv) optFilter isInstanceFilter m ty = - let extMemsDangling = SelectMethInfosFromExtMembers infoReader optFilter ty m nenv.eUnindexedExtensionMembers - if collectionSettings = ResultCollectionSettings.AtMostOneResult && not (isNil extMemsDangling) then - extMemsDangling - else - let extMemsFromHierarchy = - infoReader.GetEntireTypeHierarchy(AllowMultiIntfInstantiations.Yes, m, ty) - |> List.collect (fun ty -> - let g = infoReader.g - match tryTcrefOfAppTy g ty with - | ValueSome tcref -> - let extValRefs = nenv.eIndexedExtensionMembers.Find tcref - SelectMethInfosFromExtMembers infoReader optFilter ty m extValRefs - | _ -> []) - extMemsDangling @ extMemsFromHierarchy + let rootResults = SelectExtMethInfosForType infoReader nenv optFilter m ty + + // For function types, also look up extensions on FSharpFunc<_,_> + // This enables operators defined on FSharpFunc to work on function values + let funcTypeResults = SelectIndexedExtMethInfosForFunctionType infoReader nenv optFilter m ty + + let combined = + let allRootResults = rootResults @ funcTypeResults + if collectionSettings = ResultCollectionSettings.AtMostOneResult && not (isNil allRootResults) then + allRootResults + else + let baseIndexedResults = + match infoReader.GetEntireTypeHierarchy(AllowMultiIntfInstantiations.Yes, m, ty) with + | _ :: baseTys -> baseTys |> List.collect (SelectIndexedExtMethInfosForType infoReader nenv optFilter m) + | [] -> [] + + allRootResults @ baseIndexedResults + + combined |> List.filter (fun minfo -> match isInstanceFilter with | LookupIsInstance.Ambivalent -> true @@ -1234,7 +1290,22 @@ let rec AddStaticContentOfTypeToNameEnv (g:TcGlobals) (amap: Import.ImportMap) a pair) |> Array.ofList - { nenv with eUnqualifiedItems = nenv.eUnqualifiedItems.AddMany methodGroupItems } + let nenv = { nenv with eUnqualifiedItems = nenv.eUnqualifiedItems.AddMany methodGroupItems } + + // Collect static operator methods for SRTP resolution via 'open type'. + // These are intentionally excluded from eUnqualifiedItems by ChooseMethInfosForNameEnv + // but need to be available for SRTP constraint solving. + let operatorMethods = + IntrinsicMethInfosOfType infoReader None ad AllowMultiIntfInstantiations.Yes PreferOverrides m ty + |> List.filter (fun minfo -> + not (minfo.IsInstance || minfo.IsClassConstructor || minfo.IsConstructor) + && typeEquiv g minfo.ApparentEnclosingType ty + && IsLogicalOpName minfo.LogicalName) + + if operatorMethods.IsEmpty then + nenv + else + { nenv with eOpenedTypeOperators = operatorMethods @ nenv.eOpenedTypeOperators } and private AddNestedTypesOfTypeToNameEnv infoReader (amap: Import.ImportMap) ad m nenv ty = let tinst, tcrefs = GetNestedTyconRefsOfType infoReader amap (ad, None, TypeNameResolutionStaticArgsInfo.Indefinite, true, m) ty @@ -1615,28 +1686,70 @@ let FreshenTypar (g: TcGlobals) rigid (tp: Typar) = // abstract generic method slot. But we later check the generalization // condition anyway, so we could get away with a non-rigid typar. This // would sort of be cleaner, though give errors later. -let FreshenAndFixupTypars g m rigid fctps tinst tpsorig = +let FreshenAndFixupTypars g (traitCtxt: ITraitContext option) m rigid fctps tinst tpsorig = let tps = tpsorig |> List.map (FreshenTypar g rigid) - let renaming, tinst = FixupNewTypars m fctps tinst tpsorig tps + let renaming, tinst = FixupNewTypars traitCtxt m fctps tinst tpsorig tps tps, renaming, tinst -let FreshenTypeInst g m tpsorig = - FreshenAndFixupTypars g m TyparRigidity.Flexible [] [] tpsorig +let FreshenTypeInst g traitCtxt m tpsorig = + FreshenAndFixupTypars g traitCtxt m TyparRigidity.Flexible [] [] tpsorig -let FreshMethInst g m fctps tinst tpsorig = - FreshenAndFixupTypars g m TyparRigidity.Flexible fctps tinst tpsorig +let FreshMethInst g traitCtxt m fctps tinst tpsorig = + FreshenAndFixupTypars g traitCtxt m TyparRigidity.Flexible fctps tinst tpsorig -let FreshenTypars g m tpsorig = +let FreshenTypars g traitCtxt m tpsorig = match tpsorig with | [] -> [] | _ -> - let _, _, tpTys = FreshenTypeInst g m tpsorig + let _, _, tpTys = FreshenTypeInst g traitCtxt m tpsorig tpTys -let FreshenMethInfo m (minfo: MethInfo) = - let _, _, tpTys = FreshMethInst minfo.TcGlobals m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars +let FreshenMethInfo g traitCtxt m (minfo: MethInfo) = + let _, _, tpTys = FreshMethInst g traitCtxt m (minfo.GetFormalTyparsOfDeclaringType m) minfo.DeclaringTypeInst minfo.FormalMethodTypars tpTys +/// Select extension method infos that are relevant to solving a trait constraint. +/// Looks up extension members in the name resolution environment by the TyconRef of each +/// support type, and filters to those matching the trait's member name. +let SelectExtensionMethInfosForTrait (traitInfo: TraitConstraintInfo, m: range, nenv: NameResolutionEnv, infoReader: InfoReader) : (TType * MethInfo) list = + let nm = traitInfo.MemberLogicalName + + // Helper to check if a type contains any rigid type parameters. + // Rigid type parameters appear in inline function definitions and cause IL gen issues + // when used with FSharpFunc extension lookup. + let containsRigidTypar ty = + let freeTypars = (freeInType CollectTyparsNoCaching ty).FreeTypars + freeTypars |> Zset.exists (fun tp -> tp.Rigidity = TyparRigidity.Rigid) + + let extResults = + [ for supportTy in traitInfo.SupportTypes do + for minfo in SelectExtMethInfosForType infoReader nenv (Some nm) m supportTy do + yield (supportTy, minfo) + + // For function types, also look up extensions on FSharpFunc<_,_> + // but skip if the type contains rigid type parameters to avoid IL gen issues + if not (containsRigidTypar supportTy) then + for minfo in SelectIndexedExtMethInfosForFunctionType infoReader nenv (Some nm) m supportTy do + yield (supportTy, minfo) + + // For tuple types, also look up extensions on System.Tuple<_,...> / System.ValueTuple<_,...> + for minfo in SelectIndexedExtMethInfosForTupleType infoReader nenv (Some nm) m supportTy do + yield (supportTy, minfo) ] + + // Also include static operator methods from 'open type' declarations. + // These are not registered as extension members but should participate in SRTP resolution. + // Each method is yielded once (paired with the first support type) to avoid duplicates + // that would confuse overload resolution. + let openTypeResults = + match traitInfo.SupportTypes with + | [] -> [] + | firstSupportTy :: _ -> + [ for minfo in nenv.eOpenedTypeOperators do + if minfo.LogicalName = nm then + yield (firstSupportTy, minfo) ] + + extResults @ openTypeResults + /// This must be called after fetching unqualified items that may need to be freshened /// or have type instantiations let ResolveUnqualifiedItem (ncenv: NameResolver) nenv m res = @@ -3245,7 +3358,8 @@ let rec ResolveExprLongIdentPrim sink (ncenv: NameResolver) first fullyQualified match tyconSearch () with | Result((resInfo, tcref) :: _) -> - let _, _, tyargs = FreshenTypeInst ncenv.g m (tcref.Typars m) + // traitCtxtNone: type freshening for name resolution result — SRTP solving happens later in ConstraintSolver (audited for RFC FS-1043) + let _, _, tyargs = FreshenTypeInst ncenv.g traitCtxtNone m (tcref.Typars m) let item = Item.Types(id.idText, [TType_app(tcref, tyargs, ncenv.g.knownWithoutNull)]) success (resInfo, item) | _ -> @@ -3622,7 +3736,8 @@ let ResolveTypeLongIdentInTyconRef sink (ncenv: NameResolver) nenv typeNameResIn ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref id rest) ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurrence.Use, ad, resInfo, ResultTyparChecker(fun () -> true)) - let _, tinst, tyargs = FreshenTypeInst ncenv.g m (tcref.Typars m) + // traitCtxtNone: type freshening for name resolution result — SRTP solving happens later in ConstraintSolver (audited for RFC FS-1043) + let _, tinst, tyargs = FreshenTypeInst ncenv.g traitCtxtNone m (tcref.Typars m) let item = Item.Types(tcref.DisplayName, [TType_app(tcref, tyargs, ncenv.g.knownWithoutNull)]) CallNameResolutionSink sink (rangeOfLid lid, nenv, item, tinst, ItemOccurrence.UseInType, ad) @@ -3785,7 +3900,8 @@ let ResolveTypeLongIdentAux sink (ncenv: NameResolver) occurrence fullyQualified | Result (resInfo, tcref) -> ResolutionInfo.SendEntityPathToSink(sink, ncenv, nenv, ItemOccurrence.UseInType, ad, resInfo, ResultTyparChecker(fun () -> true)) - let _, tinst, tyargs = FreshenTypeInst ncenv.g m (tcref.Typars m) + // traitCtxtNone: type freshening for name resolution result — SRTP solving happens later in ConstraintSolver (audited for RFC FS-1043) + let _, tinst, tyargs = FreshenTypeInst ncenv.g traitCtxtNone m (tcref.Typars m) let item = Item.Types(tcref.DisplayName, [TType_app(tcref, tyargs, ncenv.g.knownWithoutNull)]) CallNameResolutionSink sink (m, nenv, item, tinst, occurrence, ad) diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi index b5f6a7172aa..889ea1ec365 100755 --- a/src/Compiler/Checking/NameResolution.fsi +++ b/src/Compiler/Checking/NameResolution.fsi @@ -233,6 +233,9 @@ type NameResolutionEnv = /// Other extension members unindexed by type eUnindexedExtensionMembers: ExtensionMember list + /// Static operator methods from 'open type' declarations, available for SRTP resolution + eOpenedTypeOperators: MethInfo list + /// Typars (always available by unqualified names). Further typars can be /// in the tpenv, a structure folded through each top-level definition. eTypars: NameMap @@ -726,13 +729,18 @@ val NewInferenceTypes: TcGlobals -> 'T list -> TType list /// each and ensure that the constraints on the new type variables are adjusted. /// /// Returns the inference type variables as a list of types. -val FreshenTypars: g: TcGlobals -> range -> Typars -> TType list +val FreshenTypars: g: TcGlobals -> traitCtxt: ITraitContext option -> range -> Typars -> TType list /// Given a method, which may be generic, make new inference type variables for /// its generic parameters, and ensure that the constraints the new type variables are adjusted. /// /// Returns the inference type variables as a list of types. -val FreshenMethInfo: range -> MethInfo -> TType list +val FreshenMethInfo: g: TcGlobals -> traitCtxt: ITraitContext option -> range -> MethInfo -> TType list + +/// Select extension method infos that are relevant to solving a trait constraint. +val SelectExtensionMethInfosForTrait: + traitInfo: TraitConstraintInfo * m: range * nenv: NameResolutionEnv * infoReader: InfoReader -> + (TType * MethInfo) list /// Given a set of formal type parameters and their constraints, make new inference type variables for /// each and ensure that the constraints on the new type variables are adjusted to refer to these. @@ -743,6 +751,7 @@ val FreshenMethInfo: range -> MethInfo -> TType list /// 3. the inference type variables as a list of types. val FreshenAndFixupTypars: g: TcGlobals -> + traitCtxt: ITraitContext option -> m: range -> rigid: TyparRigidity -> fctps: Typars -> @@ -757,7 +766,12 @@ val FreshenAndFixupTypars: /// 1. the new type parameters /// 2. the instantiation mapping old type parameters to inference variables /// 3. the inference type variables as a list of types. -val FreshenTypeInst: g: TcGlobals -> m: range -> tpsorig: Typar list -> Typar list * TyparInstantiation * TTypes +val FreshenTypeInst: + g: TcGlobals -> + traitCtxt: ITraitContext option -> + m: range -> + tpsorig: Typar list -> + Typar list * TyparInstantiation * TTypes /// Resolve a long identifier to a namespace, module. val internal ResolveLongIdentAsModuleOrNamespace: diff --git a/src/Compiler/Checking/PostInferenceChecks.fs b/src/Compiler/Checking/PostInferenceChecks.fs index 7924394c743..9a3e27d439f 100644 --- a/src/Compiler/Checking/PostInferenceChecks.fs +++ b/src/Compiler/Checking/PostInferenceChecks.fs @@ -2379,7 +2379,9 @@ let CheckEntityDefn cenv env (tycon: Entity) = | None -> [] let namesOfMethodsThatMayDifferOnlyInReturnType = ["op_Explicit";"op_Implicit"] (* hardwired *) - let methodUniquenessIncludesReturnType (minfo: MethInfo) = List.contains minfo.LogicalName namesOfMethodsThatMayDifferOnlyInReturnType + let methodUniquenessIncludesReturnType (minfo: MethInfo) = + List.contains minfo.LogicalName namesOfMethodsThatMayDifferOnlyInReturnType || + minfo.HasAllowOverloadOnReturnType let MethInfosEquivWrtUniqueness eraseFlag m minfo minfo2 = if methodUniquenessIncludesReturnType minfo then MethInfosEquivByNameAndSig eraseFlag true g cenv.amap m minfo minfo2 diff --git a/src/Compiler/Checking/TypeHierarchy.fs b/src/Compiler/Checking/TypeHierarchy.fs index ec788a3204a..800bd53e4ac 100644 --- a/src/Compiler/Checking/TypeHierarchy.fs +++ b/src/Compiler/Checking/TypeHierarchy.fs @@ -403,7 +403,7 @@ let ImportReturnTypeFromMetadata amap m nullnessSource ilTy scoref tinst minst = /// /// Note: this now looks identical to constraint instantiation. -let CopyTyparConstraints m tprefInst (tporig: Typar) = +let CopyTyparConstraints (traitCtxt: ITraitContext option) m tprefInst (tporig: Typar) = tporig.Constraints // F# does not have escape analysis for authoring 'allows ref struct' generic code. Therefore, typar is not copied, can only come from C# authored code |> List.filter (fun tp -> match tp with | TyparConstraint.AllowsRefStruct _ -> false | _ -> true) @@ -437,11 +437,16 @@ let CopyTyparConstraints m tprefInst (tporig: Typar) = | TyparConstraint.RequiresDefaultConstructor _ -> TyparConstraint.RequiresDefaultConstructor m | TyparConstraint.MayResolveMember(traitInfo, _) -> - TyparConstraint.MayResolveMember (instTrait tprefInst traitInfo, m)) + let traitInfo = instTrait tprefInst traitInfo + let traitInfo = + match traitCtxt, traitInfo with + | Some _, TTrait(a, b, c, d, e, f, g, None) -> TTrait(a, b, c, d, e, f, g, traitCtxt) + | _ -> traitInfo + TyparConstraint.MayResolveMember (traitInfo, m)) /// The constraints for each typar copied from another typar can only be fixed up once /// we have generated all the new constraints, e.g. f List, B :> List> ... -let FixupNewTypars m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = +let FixupNewTypars (traitCtxt: ITraitContext option) m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsorig: Typars) (tps: Typars) = // Checks.. These are defensive programming against early reported errors. let n0 = formalEnclosingTypars.Length let n1 = tinst.Length @@ -453,5 +458,5 @@ let FixupNewTypars m (formalEnclosingTypars: Typars) (tinst: TType list) (tpsori // The real code.. let renaming, tptys = mkTyparToTyparRenaming tpsorig tps let tprefInst = mkTyparInst formalEnclosingTypars tinst @ renaming - (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints m tprefInst tporig)) + (tpsorig, tps) ||> List.iter2 (fun tporig tp -> tp.SetConstraints (CopyTyparConstraints traitCtxt m tprefInst tporig)) renaming, tptys diff --git a/src/Compiler/Checking/TypeHierarchy.fsi b/src/Compiler/Checking/TypeHierarchy.fsi index 88ac64ff5b8..dbb701b14ca 100644 --- a/src/Compiler/Checking/TypeHierarchy.fsi +++ b/src/Compiler/Checking/TypeHierarchy.fsi @@ -168,11 +168,17 @@ val ImportReturnTypeFromMetadata: /// /// Note: this now looks identical to constraint instantiation. -val CopyTyparConstraints: m: range -> tprefInst: TyparInstantiation -> tporig: Typar -> TyparConstraint list +val CopyTyparConstraints: + traitCtxt: ITraitContext option -> + m: range -> + tprefInst: TyparInstantiation -> + tporig: Typar -> + TyparConstraint list /// The constraints for each typar copied from another typar can only be fixed up once /// we have generated all the new constraints, e.g. f List, B :> List> ... val FixupNewTypars: + traitCtxt: ITraitContext option -> m: range -> formalEnclosingTypars: Typars -> tinst: TType list -> diff --git a/src/Compiler/Checking/infos.fs b/src/Compiler/Checking/infos.fs index 1a38e10f42b..1ea61c3ca2b 100644 --- a/src/Compiler/Checking/infos.fs +++ b/src/Compiler/Checking/infos.fs @@ -985,6 +985,17 @@ type MethInfo = | MethInfoWithModifiedReturnType(mi, _) -> mi.IsILMethod | _ -> false + /// Indicates if the method has the AllowOverloadOnReturnType attribute. + member x.HasAllowOverloadOnReturnType = + match x with + | ILMeth(g, ilmeth, _) -> TryFindILAttribute g.attrib_AllowOverloadOnReturnTypeAttribute ilmeth.RawMetadata.CustomAttrs + | FSMeth(g, _, vref, _) -> HasFSharpAttribute g g.attrib_AllowOverloadOnReturnTypeAttribute vref.Attribs + | MethInfoWithModifiedReturnType(mi, _) -> mi.HasAllowOverloadOnReturnType + | DefaultStructCtor _ -> false +#if !NO_TYPEPROVIDERS + | ProvidedMeth _ -> false +#endif + /// Check if this method is an explicit implementation of an interface member member x.IsFSharpExplicitInterfaceImplementation = match x with @@ -1352,9 +1363,11 @@ type MethInfo = let tcref = tcrefOfAppTy g x.ApparentEnclosingAppType let formalEnclosingTyparsOrig = tcref.Typars m let formalEnclosingTypars = copyTypars false formalEnclosingTyparsOrig - let _, formalEnclosingTyparTys = FixupNewTypars m [] [] formalEnclosingTyparsOrig formalEnclosingTypars + // traitCtxtNone: slot signature computation — structural matching, not SRTP constraint solving (audited for RFC FS-1043) + let _, formalEnclosingTyparTys = FixupNewTypars traitCtxtNone m [] [] formalEnclosingTyparsOrig formalEnclosingTypars let formalMethTypars = copyTypars false x.FormalMethodTypars - let _, formalMethTyparTys = FixupNewTypars m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars + // traitCtxtNone: slot signature computation — structural matching, not SRTP constraint solving (audited for RFC FS-1043) + let _, formalMethTyparTys = FixupNewTypars traitCtxtNone m formalEnclosingTypars formalEnclosingTyparTys x.FormalMethodTypars formalMethTypars let formalRetTy, formalParams = match x with diff --git a/src/Compiler/Checking/infos.fsi b/src/Compiler/Checking/infos.fsi index e091834e271..7d6967e281f 100644 --- a/src/Compiler/Checking/infos.fsi +++ b/src/Compiler/Checking/infos.fsi @@ -429,6 +429,9 @@ type MethInfo = /// Indicates if this is an IL method. member IsILMethod: bool + /// Indicates if the method has the AllowOverloadOnReturnType attribute. + member HasAllowOverloadOnReturnType: bool + /// Indicates if the method is a get_IsABC union case tester implied by a union case definition member IsUnionCaseTester: bool diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index b76cc30293f..5e3633a26fd 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -5686,7 +5686,16 @@ and GenTraitCall (cenv: cenv) cgbuf eenv (traitInfo: TraitConstraintInfo, argExp assert not generateWitnesses let exprOpt = - CommitOperationResult(ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.tcVal g cenv.amap m traitInfo argExprs) + match ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.tcVal g cenv.amap m traitInfo argExprs with + | OkResult(warns, res) -> + ReportWarnings warns + res + | ErrorResult(warns, _) -> + ReportWarnings warns + // Resolution may fail for generic inline code with unsolved constraints + // (e.g. rigid typars). The NotSupportedException stub below is emitted as + // fallback IL; inline functions resolve constraints at each call site. + None match exprOpt with | None -> @@ -7520,8 +7529,18 @@ and ExprRequiresWitness cenv m expr = match expr with | Expr.Op(TOp.TraitCall(traitInfo), _, _, _) -> - ConstraintSolver.CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs cenv.tcVal g cenv.amap m traitInfo - |> CommitOperationResult + match ConstraintSolver.CodegenWitnessExprForTraitConstraintWillRequireWitnessArgs cenv.tcVal g cenv.amap m traitInfo with + | OkResult(warns, res) -> + ReportWarnings warns + res + | ErrorResult(warns, _) -> + ReportWarnings warns + // Constraint resolution failed. This means either: + // - All support types are concrete but resolution still failed (shouldn't happen — + // type-checking should have caught it), or + // - Support types contain unsolved typars so we genuinely don't know. + // Either way, return false → don't use witness path → fall back to dynamic invocation. + false | _ -> false /// Generate statically-resolved conditionals used for type-directed optimizations in FSharp.Core only. diff --git a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs index 6f13677025b..c2a4800966f 100644 --- a/src/Compiler/Driver/GraphChecking/FileContentMapping.fs +++ b/src/Compiler/Driver/GraphChecking/FileContentMapping.fs @@ -60,7 +60,9 @@ let visitSynModuleDecl (decl: SynModuleDecl) : FileContentEntry list = | SynModuleDecl.Open(target = SynOpenDeclTarget.Type(typeName, _)) -> yield! visitSynType typeName | SynModuleDecl.Attributes(attributes, _) -> yield! List.collect visitSynAttributeList attributes | SynModuleDecl.Expr(expr, _) -> yield! visitSynExpr expr - | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = [ ident ]; attributes = attributes); decls = decls) -> + | SynModuleDecl.NestedModule(moduleInfo = compInfo; decls = decls) when compInfo.LongIdent.Length = 1 -> + let ident = compInfo.LongIdent.Head + let (SynComponentInfo(attributes = attributes)) = compInfo yield! visitSynAttributes attributes yield FileContentEntry.NestedModule(ident.idText, List.collect visitSynModuleDecl decls) | SynModuleDecl.NestedModule _ -> () // A nested module cannot have multiple identifiers. This will already be a parse error, but we could be working with recovered syntax tree @@ -84,7 +86,9 @@ let visitSynModuleSigDecl (md: SynModuleSigDecl) = | SynModuleSigDecl.Open(target = SynOpenDeclTarget.ModuleOrNamespace(longId, _)) -> yield FileContentEntry.OpenStatement(synLongIdentToPath false longId) | SynModuleSigDecl.Open(target = SynOpenDeclTarget.Type(typeName, _)) -> yield! visitSynType typeName - | SynModuleSigDecl.NestedModule(moduleInfo = SynComponentInfo(longId = [ ident ]; attributes = attributes); moduleDecls = decls) -> + | SynModuleSigDecl.NestedModule(moduleInfo = compInfo; moduleDecls = decls) when compInfo.LongIdent.Length = 1 -> + let ident = compInfo.LongIdent.Head + let (SynComponentInfo(attributes = attributes)) = compInfo yield! visitSynAttributes attributes yield FileContentEntry.NestedModule(ident.idText, List.collect visitSynModuleSigDecl decls) | SynModuleSigDecl.NestedModule _ -> () // A nested module cannot have multiple identifiers. This will already be a parse error, but we could be working with recovered syntax tree @@ -112,12 +116,12 @@ let visitSynUnionCase (SynUnionCase(attributes = attributes; caseType = caseType let visitSynEnumCase (SynEnumCase(attributes = attributes)) = visitSynAttributes attributes -let visitSynTypeDefn - (SynTypeDefn( - typeInfo = SynComponentInfo(attributes = attributes; longId = longId; typeParams = typeParams; constraints = constraints) - typeRepr = typeRepr - members = members)) - : FileContentEntry list = +let visitSynTypeDefn (SynTypeDefn(typeInfo = typeInfo; typeRepr = typeRepr; members = members)) : FileContentEntry list = + let (SynComponentInfo(attributes = attributes; typeParams = typeParams; constraints = constraints)) = + typeInfo + + let longId = typeInfo.LongIdent + [ yield! visitSynAttributes attributes yield! collectFromOption visitSynTyparDecls typeParams @@ -153,12 +157,12 @@ let visitSynTypeDefn yield! List.collect visitSynMemberDefn members ] -let visitSynTypeDefnSig - (SynTypeDefnSig( - typeInfo = SynComponentInfo(attributes = attributes; longId = longId; typeParams = typeParams; constraints = constraints) - typeRepr = typeRepr - members = members)) - = +let visitSynTypeDefnSig (SynTypeDefnSig(typeInfo = typeInfo; typeRepr = typeRepr; members = members)) = + let (SynComponentInfo(attributes = attributes; typeParams = typeParams; constraints = constraints)) = + typeInfo + + let longId = typeInfo.LongIdent + [ yield! visitSynAttributes attributes yield! collectFromOption visitSynTyparDecls typeParams diff --git a/src/Compiler/Driver/GraphChecking/TrieMapping.fs b/src/Compiler/Driver/GraphChecking/TrieMapping.fs index e8b027d8d5b..707f85996b0 100644 --- a/src/Compiler/Driver/GraphChecking/TrieMapping.fs +++ b/src/Compiler/Driver/GraphChecking/TrieMapping.fs @@ -223,7 +223,8 @@ let rec mkTrieNodeFor (file: FileInProject) : FileIndex * TrieNode = and mkTrieForSynModuleDecl (fileIndex: FileIndex) (decl: SynModuleDecl) : KeyValuePair option = match decl with - | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = [ nestedModuleIdent ]); decls = decls) -> + | SynModuleDecl.NestedModule(moduleInfo = compInfo; decls = decls) when compInfo.LongIdent.Length = 1 -> + let nestedModuleIdent = compInfo.LongIdent.Head let name = nestedModuleIdent.idText let children = @@ -244,7 +245,8 @@ and mkTrieForSynModuleDecl (fileIndex: FileIndex) (decl: SynModuleDecl) : KeyVal and mkTrieForSynModuleSigDecl (fileIndex: FileIndex) (decl: SynModuleSigDecl) : KeyValuePair option = match decl with - | SynModuleSigDecl.NestedModule(moduleInfo = SynComponentInfo(longId = [ nestedModuleIdent ]); moduleDecls = decls) -> + | SynModuleSigDecl.NestedModule(moduleInfo = compInfo; moduleDecls = decls) when compInfo.LongIdent.Length = 1 -> + let nestedModuleIdent = compInfo.LongIdent.Head let name = nestedModuleIdent.idText let children = diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 3b6a3bfef18..675a9764e7c 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -836,7 +836,8 @@ let main3 ApplyAllOptimizations( tcConfig, tcGlobals, - (LightweightTcValForUsingInBuildMethodCall tcGlobals), + // traitCtxtNone: post-typecheck codegen — SRTP constraints already resolved, no TcEnv available (audited for RFC FS-1043) + (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), outfile, importMap, false, @@ -953,9 +954,15 @@ let main4 ReportTime tcConfig "TAST -> IL" use _ = UseBuildPhase BuildPhase.IlxGen - // Create the Abstract IL generator + // traitCtxtNone: post-typecheck codegen — SRTP constraints already resolved, no TcEnv available (audited for RFC FS-1043) let ilxGenerator = - CreateIlxAssemblyGenerator(tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), generatedCcu) + CreateIlxAssemblyGenerator( + tcConfig, + tcImports, + tcGlobals, + (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), + generatedCcu + ) let codegenBackend = (if Option.isSome dynamicAssemblyCreator then diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index a42dee0d4e4..ec079b7deaa 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1810,6 +1810,7 @@ featureWarnWhenFunctionValueUsedAsInterpolatedStringArg,"Warn when a function va featureMethodOverloadsCache,"Support for caching method overload resolution results for improved compilation performance." featureImplicitDIMCoverage,"Implicit dispatch slot coverage for default interface member implementations" featurePreprocessorElif,"#elif preprocessor directive" +featureExtensionConstraintSolutions,"Allow extension members to participate in SRTP constraint resolution" 3880,optsLangVersionOutOfSupport,"Language version '%s' is out of support. The last .NET SDK supporting it is available at https://dotnet.microsoft.com/en-us/download/dotnet/%s" 3881,optsUnrecognizedLanguageFeature,"Unrecognized language feature name: '%s'. Use a valid feature name such as 'NameOf' or 'StringInterpolation'." 3882,lexHashElifMustBeFirst,"#elif directive must appear as the first non-whitespace character on a line" @@ -1817,3 +1818,4 @@ featurePreprocessorElif,"#elif preprocessor directive" 3884,tcFunctionValueUsedAsInterpolatedStringArg,"This expression is a function value. When used in an interpolated string it will be formatted using its 'ToString' method, which is likely not the intended behavior. Consider applying the function to its arguments." 3885,parsLetBangCannotBeLastInCE,"'%s' cannot be the final expression in a computation expression. Finish with 'return', 'return!', or a simple expression." 3886,tcListLiteralWithSingleTupleElement,"This list expression contains a single tuple element. Did you mean to use ';' instead of ',' to separate list elements?" +3887,tcInvalidTypeForTypeExtension,"This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 1bc31837052..7288e64a494 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -108,6 +108,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | ExtensionConstraintSolutions /// LanguageVersion management type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) = @@ -257,8 +258,9 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) // F# preview (still preview in 10.0) LanguageFeature.FromEndSlicing, previewVersion // Unfinished features --- needs work - LanguageFeature.MethodOverloadsCache, previewVersion // Performance optimization for overload resolution + LanguageFeature.MethodOverloadsCache, previewVersion LanguageFeature.ImplicitDIMCoverage, languageVersion110 + LanguageFeature.ExtensionConstraintSolutions, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -453,6 +455,7 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.MethodOverloadsCache -> FSComp.SR.featureMethodOverloadsCache () | LanguageFeature.ImplicitDIMCoverage -> FSComp.SR.featureImplicitDIMCoverage () | LanguageFeature.PreprocessorElif -> FSComp.SR.featurePreprocessorElif () + | LanguageFeature.ExtensionConstraintSolutions -> FSComp.SR.featureExtensionConstraintSolutions () /// 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 fd6182c9d3e..b83cf691ac1 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -99,6 +99,7 @@ type LanguageFeature = | MethodOverloadsCache | ImplicitDIMCoverage | PreprocessorElif + | ExtensionConstraintSolutions /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 1ff957e77a8..c4845790665 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2202,7 +2202,8 @@ type internal FsiDynamicCompiler ApplyAllOptimizations( tcConfig, tcGlobals, - LightweightTcValForUsingInBuildMethodCall tcGlobals, + // traitCtxtNone: FSI codegen — SRTP constraints already resolved, no TcEnv available (audited for RFC FS-1043) + LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone, outfile, importMap, isIncrementalFragment, @@ -3120,7 +3121,14 @@ type internal FsiDynamicCompiler GetInitialTcState(rangeStdin0, ccuName, tcConfig, tcGlobals, tcImports, tcEnv, openDecls0) let ilxGenerator = - CreateIlxAssemblyGenerator(tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), tcState.Ccu) + // traitCtxtNone: FSI codegen — SRTP constraints already resolved, no TcEnv available (audited for RFC FS-1043) + CreateIlxAssemblyGenerator( + tcConfig, + tcImports, + tcGlobals, + (LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone), + tcState.Ccu + ) { optEnv = optEnv0 diff --git a/src/Compiler/Optimize/Optimizer.fs b/src/Compiler/Optimize/Optimizer.fs index 3cbb574598c..b266c302443 100644 --- a/src/Compiler/Optimize/Optimizer.fs +++ b/src/Compiler/Optimize/Optimizer.fs @@ -13,6 +13,7 @@ open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AttributeChecking open FSharp.Compiler.CompilerGlobalState open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.Text.Range open FSharp.Compiler.Syntax.PrettyNaming open FSharp.Compiler.Syntax @@ -426,6 +427,9 @@ type cenv = emitTailcalls: bool + /// Fallback trait context for resolving extension method constraints during optimization + traitCtxt: ITraitContext option + /// cache methods with SecurityAttribute applied to them, to prevent unnecessary calls to ExistsInEntireHierarchyOfType casApplied: Dictionary @@ -466,7 +470,10 @@ type IncrementalOptimizationEnv = methEnv: MethodEnv - globalModuleInfos: LayeredMap + globalModuleInfos: LayeredMap + + /// Referenced CCUs collected via BindCcu, used for cross-assembly extension member resolution + referencedCcus: CcuThunk list } static member Empty = @@ -478,7 +485,8 @@ type IncrementalOptimizationEnv = disableMethodSplitting = false localExternalVals = LayeredMap.Empty globalModuleInfos = LayeredMap.Empty - methEnv = { pipelineCount = 0 } } + methEnv = { pipelineCount = 0 } + referencedCcus = [] } override x.ToString() = "" @@ -619,7 +627,9 @@ let BindTyparsToUnknown (tps: Typar list) env = List.fold (fun sofar arg -> BindTypar arg UnknownTypeValue sofar) env tps let BindCcu (ccu: CcuThunk) mval env (_g: TcGlobals) = - { env with globalModuleInfos=env.globalModuleInfos.Add(ccu.AssemblyName, mval) } + { env with + globalModuleInfos = env.globalModuleInfos.Add(ccu.AssemblyName, mval) + referencedCcus = ccu :: env.referencedCcus } /// Lookup information about values let GetInfoForLocalValue cenv env (v: Val) m = @@ -3016,8 +3026,18 @@ and OptimizeTraitCall cenv env (traitInfo, args, m) = let g = cenv.g + // If the trait context is missing (e.g. from inlined FSharp.Core operators) and we have + // a fallback context from the current compilation unit, create a new trait info with it. + let traitInfoForResolution = + match traitInfo.TraitContext, cenv.traitCtxt with + | None, Some tc when g.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions -> + let (TTrait(a, b, c, d, e, f, _, _)) = traitInfo + TTrait(a, b, c, d, e, f, ref None, Some tc) + | _ -> + traitInfo + // Resolve the static overloading early (during the compulsory rewrite phase) so we can inline. - match ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.TcVal g cenv.amap m traitInfo args with + match ConstraintSolver.CodegenWitnessExprForTraitConstraint cenv.TcVal g cenv.amap m traitInfoForResolution args with | OkResult (_, Some expr) -> OptimizeExpr cenv env expr @@ -4390,7 +4410,13 @@ and OptimizeImplFileInternal cenv env isIncrementalFragment hidden implFile = env, implFileR, minfo, hidden /// Entry point -let OptimizeImplFile (settings, ccu, tcGlobals, tcVal, importMap, optEnv, isIncrementalFragment, emitTailcalls, hidden, mimpls) = +let OptimizeImplFile (settings, ccu, tcGlobals: TcGlobals, tcVal, importMap, optEnv, isIncrementalFragment, emitTailcalls, hidden, mimpls: CheckedImplFile) = + let traitCtxt = + if tcGlobals.langVersion.SupportsFeature LanguageFeature.ExtensionConstraintSolutions then + Some(ConstraintSolver.CreateImplFileTraitContext tcGlobals [mimpls.Contents] optEnv.referencedCcus :> ITraitContext) + else + None + let cenv = { settings=settings scope=ccu @@ -4400,6 +4426,7 @@ let OptimizeImplFile (settings, ccu, tcGlobals, tcVal, importMap, optEnv, isIncr optimizing=true localInternalVals=Dictionary(10000) emitTailcalls=emitTailcalls + traitCtxt=traitCtxt casApplied=Dictionary() stackGuard = StackGuard("OptimizerStackGuardDepth") realsig = tcGlobals.realsig diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 59d5773558c..59ce3a02f33 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -3876,7 +3876,8 @@ type FSharpCheckProjectResults let optEnv0 = GetInitialOptimizationEnv(tcImports, tcGlobals) let tcConfig = getTcConfig () let isIncrementalFragment = false - let tcVal = LightweightTcValForUsingInBuildMethodCall tcGlobals + // traitCtxtNone: checker results API — post-typecheck, SRTP constraints already resolved (audited for RFC FS-1043) + let tcVal = LightweightTcValForUsingInBuildMethodCall tcGlobals traitCtxtNone let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations(tcConfig, tcGlobals, tcVal, outfile, importMap, isIncrementalFragment, optEnv0, thisCcu, mimpls) diff --git a/src/Compiler/Service/ServiceNavigation.fs b/src/Compiler/Service/ServiceNavigation.fs index 5c15f756133..64ec3f51286 100755 --- a/src/Compiler/Service/ServiceNavigation.fs +++ b/src/Compiler/Service/ServiceNavigation.fs @@ -240,7 +240,8 @@ module NavigationImpl = and processTycon baseName synTypeDefn = let (SynTypeDefn(typeInfo = typeInfo; typeRepr = repr; members = membDefns; range = m)) = synTypeDefn - let (SynComponentInfo(longId = lid; accessibility = access)) = typeInfo + let lid = typeInfo.LongIdent + let (SynComponentInfo(accessibility = access)) = typeInfo let topMembers = processMembers membDefns NavigationEntityKind.Class |> snd @@ -382,7 +383,9 @@ module NavigationImpl = let mBody = rangeOfLid lid createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Namespace, false, None) - | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = lid; accessibility = access); decls = decls; range = m) -> + | SynModuleDecl.NestedModule(moduleInfo = compInfo; decls = decls; range = m) -> + let lid = compInfo.LongIdent + let (SynComponentInfo(accessibility = access)) = compInfo // Find let bindings (for the right dropdown) let nested = processNestedDeclarations decls @@ -508,8 +511,9 @@ module NavigationImpl = processExnRepr baseName nested repr and processTycon baseName inp = - let (SynTypeDefnSig(typeInfo = SynComponentInfo(longId = lid; accessibility = access); typeRepr = repr; members = membDefns; range = m)) = - inp + let (SynTypeDefnSig(typeInfo = typeInfo; typeRepr = repr; members = membDefns; range = m)) = inp + let lid = typeInfo.LongIdent + let (SynComponentInfo(accessibility = access)) = typeInfo let topMembers = processSigMembers membDefns @@ -607,7 +611,9 @@ module NavigationImpl = let mBody = rangeOfLid lid createDecl (baseName, id, NavigationItemKind.Module, FSharpGlyph.Module, m, mBody, [], NavigationEntityKind.Module, false, None) - | SynModuleSigDecl.NestedModule(moduleInfo = SynComponentInfo(longId = lid; accessibility = access); moduleDecls = decls; range = m) -> + | SynModuleSigDecl.NestedModule(moduleInfo = compInfo; moduleDecls = decls; range = m) -> + let lid = compInfo.LongIdent + let (SynComponentInfo(accessibility = access)) = compInfo // Find let bindings (for the right dropdown) let nested = processNestedSigDeclarations decls @@ -805,8 +811,8 @@ module NavigateTo = addIdent NavigableItemKind.Exception id isSig container NavigableContainer.Container(NavigableContainerType.Exception, [ id.idText ], container) - let addComponentInfo containerType kind info isSig container = - let (SynComponentInfo(longId = lid)) = info + let addComponentInfo containerType kind (info: SynComponentInfo) isSig container = + let lid = info.LongIdent addLongIdent kind lid isSig container NavigableContainer.Container(containerType, pathOfLid lid, container) diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index ed1a4da5bf5..377a13135d3 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -1499,7 +1499,8 @@ module ParsedInput = // detect records usage in constructor match path with | SyntaxNode.SynExpr _ :: SyntaxNode.SynBinding _ :: SyntaxNode.SynMemberDefn _ :: SyntaxNode.SynTypeDefn(SynTypeDefn( - typeInfo = SynComponentInfo(longId = [ id ]))) :: _ -> RecordContext.Constructor(id.idText) + typeInfo = compInfo)) :: _ when compInfo.LongIdent.Length = 1 -> + RecordContext.Constructor(compInfo.LongIdent.Head.idText) | SyntaxNode.SynExpr(SynExpr.Record(None, _, fields, _)) :: _ -> let isFirstField = @@ -1564,10 +1565,11 @@ module ParsedInput = let overrideContext path (mOverride: range) hasThis isStatic isMember = match path with - | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn( - typeInfo = SynComponentInfo(longId = [ enclosingType ]); trivia = { LeadingKeyword = keyword })) :: _ when - not isMember + | _ :: SyntaxNode.SynTypeDefn(SynTypeDefn(typeInfo = compInfo; trivia = { LeadingKeyword = keyword })) :: _ when + not isMember && compInfo.LongIdent.Length = 1 -> + let enclosingType = compInfo.LongIdent.Head + Some( CompletionContext.MethodOverride( MethodOverrideCompletionContext.Class, @@ -1579,9 +1581,11 @@ module ParsedInput = ) ) | SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn( - typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ + typeInfo = compInfo)) :: _ | _ :: SyntaxNode.SynMemberDefn(SynMemberDefn.Interface(interfaceType = ty) as enclosingDefn) :: SyntaxNode.SynTypeDefn(SynTypeDefn( - typeInfo = SynComponentInfo(longId = [ enclosingType ]))) :: _ -> + typeInfo = compInfo)) :: _ when compInfo.LongIdent.Length = 1 -> + let enclosingType = compInfo.LongIdent.Head + let ty = match ty with | SynType.App(typeName = ty) -> ty @@ -1781,7 +1785,10 @@ module ParsedInput = // module Namespace.Top // module Nested - | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = [ ident ])) when rangeContainsPos ident.idRange pos -> + | SynModuleDecl.NestedModule(moduleInfo = compInfo) when + compInfo.LongIdent.Length = 1 + && rangeContainsPos compInfo.LongIdent.Head.idRange pos + -> Some CompletionContext.Invalid | _ -> defaultTraverse decl @@ -2286,7 +2293,7 @@ module ParsedInput = | _ -> () and walkComponentInfo isTypeExtensionOrAlias compInfo = - let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, longIdent, _, _, _, _)) = + let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, _, _, _, _, _)) = compInfo let constraints = cs1 @ cs2 @@ -2295,7 +2302,7 @@ module ParsedInput = List.iter walkTypeConstraint constraints if isTypeExtensionOrAlias then - addLongIdent longIdent + addLongIdent compInfo.LongIdent and walkTypeDefnRepr inp = match inp with @@ -2466,8 +2473,8 @@ module ParsedInput = and walkSynModuleDecl (parent: LongIdent) (decl: SynModuleDecl) = match decl with | SynModuleDecl.NamespaceFragment fragment -> walkSynModuleOrNamespace parent fragment - | SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = ident); decls = decls; range = range; trivia = trivia) -> - + | SynModuleDecl.NestedModule(moduleInfo = compInfo; decls = decls; range = range; trivia = trivia) -> + let ident = compInfo.LongIdent let fullIdent = parent @ ident addModule (fullIdent, range) diff --git a/src/Compiler/Service/ServiceStructure.fs b/src/Compiler/Service/ServiceStructure.fs index 577902a9146..cde6ccb0ab7 100644 --- a/src/Compiler/Service/ServiceStructure.fs +++ b/src/Compiler/Service/ServiceStructure.fs @@ -948,8 +948,8 @@ module Structure = and parseTypeDefnSig typeDefn = let (SynTypeDefnSig(typeInfo = typeInfo; typeRepr = objectModel; members = memberSigs)) = typeDefn - let (SynComponentInfo(attributes = attribs; typeParams = TyparDecls typeArgs; longId = longId; range = r)) = - typeInfo + let (SynComponentInfo(attributes = attribs; typeParams = TyparDecls typeArgs; range = r)) = typeInfo + let longId = typeInfo.LongIdent parseAttributes attribs diff --git a/src/Compiler/Symbols/Symbols.fs b/src/Compiler/Symbols/Symbols.fs index 08252dd76d5..817573dff0f 100644 --- a/src/Compiler/Symbols/Symbols.fs +++ b/src/Compiler/Symbols/Symbols.fs @@ -59,7 +59,8 @@ type FSharpAccessibility(a:Accessibility, ?isProtected) = type SymbolEnv(g: TcGlobals, thisCcu: CcuThunk, thisCcuTyp: ModuleOrNamespaceType option, tcImports: TcImports, amap: Import.ImportMap, infoReader: InfoReader) = - let tcVal = LightweightTcValForUsingInBuildMethodCall g + // traitCtxtNone: IDE symbol API — no TcEnv available, only SymbolEnv (audited for RFC FS-1043) + let tcVal = LightweightTcValForUsingInBuildMethodCall g traitCtxtNone new(g: TcGlobals, thisCcu: CcuThunk, thisCcuTyp: ModuleOrNamespaceType option, tcImports: TcImports) = let amap = tcImports.GetImportMap() @@ -389,7 +390,8 @@ type FSharpEntity(cenv: SymbolEnv, entity: EntityRef, tyargs: TType list) = | Some ccu -> ccuEq ccu cenv.g.fslibCcu new(cenv: SymbolEnv, tcref: TyconRef) = - let _, _, tyargs = FreshenTypeInst cenv.g range0 (tcref.Typars range0) + // traitCtxtNone: IDE symbol API — type freshening for display, not constraint solving (audited for RFC FS-1043) + let _, _, tyargs = FreshenTypeInst cenv.g traitCtxtNone range0 (tcref.Typars range0) FSharpEntity(cenv, tcref, tyargs) member _.Entity = entity diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fs b/src/Compiler/SyntaxTree/SyntaxTree.fs index 7c0030e4f3a..e1f9f82a395 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1386,7 +1386,7 @@ type SynComponentInfo = attributes: SynAttributes * typeParams: SynTyparDecls option * constraints: SynTypeConstraint list * - longId: LongIdent * + synType: SynType option * xmlDoc: PreXmlDoc * preferPostfix: bool * accessibility: SynAccess option * @@ -1396,6 +1396,11 @@ type SynComponentInfo = match this with | SynComponentInfo(range = m) -> m + member this.LongIdent = + match this with + | SynComponentInfo(synType = Some(SynType.LongIdent(SynLongIdent(lid, _, _)))) -> lid + | _ -> [] + [] type SynValSigAccess = | Single of accessibility: SynAccess option diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 2206d199c39..aa3fb3021f0 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1515,7 +1515,7 @@ type SynComponentInfo = attributes: SynAttributes * typeParams: SynTyparDecls option * constraints: SynTypeConstraint list * - longId: LongIdent * + synType: SynType option * xmlDoc: PreXmlDoc * preferPostfix: bool * accessibility: SynAccess option * @@ -1524,6 +1524,9 @@ type SynComponentInfo = /// Gets the syntax range of this construct member Range: range + /// Gets the long identifier from a SynType.LongIdent, or empty list for other types + member LongIdent: LongIdent + /// Represents one or two access modifier(s) in a property signature [] type SynValSigAccess = diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index ef6e00ffb16..abd09a3de05 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -1501,6 +1501,7 @@ type TcGlobals( member val attrib_AutoOpenAttribute = mk_MFCore_attrib "AutoOpenAttribute" member val attrib_CompilationArgumentCountsAttribute = mk_MFCore_attrib "CompilationArgumentCountsAttribute" member val attrib_CompilationMappingAttribute = mk_MFCore_attrib "CompilationMappingAttribute" + member val attrib_AllowOverloadOnReturnTypeAttribute = mk_MFCore_attrib "AllowOverloadOnReturnTypeAttribute" member val attrib_AllowNullLiteralAttribute = mk_MFCore_attrib "AllowNullLiteralAttribute" member val attrib_EqualityConditionalOnAttribute = mk_MFCore_attrib "EqualityConditionalOnAttribute" member val attrib_ComparisonConditionalOnAttribute = mk_MFCore_attrib "ComparisonConditionalOnAttribute" diff --git a/src/Compiler/TypedTree/TcGlobals.fsi b/src/Compiler/TypedTree/TcGlobals.fsi index e27bc1605a2..f9541a4cac0 100644 --- a/src/Compiler/TypedTree/TcGlobals.fsi +++ b/src/Compiler/TypedTree/TcGlobals.fsi @@ -310,6 +310,8 @@ type internal TcGlobals = member attrib_AutoOpenAttribute: BuiltinAttribInfo + member attrib_AllowOverloadOnReturnTypeAttribute: BuiltinAttribInfo + member attrib_ComparisonConditionalOnAttribute: BuiltinAttribInfo member attrib_CompilationArgumentCountsAttribute: BuiltinAttribInfo diff --git a/src/Compiler/TypedTree/TypedTree.fs b/src/Compiler/TypedTree/TypedTree.fs index 733b269b588..0ae49ff26bd 100644 --- a/src/Compiler/TypedTree/TypedTree.fs +++ b/src/Compiler/TypedTree/TypedTree.fs @@ -2596,6 +2596,17 @@ type TraitWitnessInfo = override x.ToString() = "TraitWitnessInfo(" + x.MemberName + ")" +/// Non-generic marker interface for storing in TraitConstraintInfo. +/// The actual typed contract is ITraitContext<'AccessRights, 'MethodInfo, 'InfoReader>. +type ITraitContext = interface end + +/// Generic typed interface for trait context operations. +/// 'AccessRights = AccessorDomain, 'MethodInfo = MethInfo, 'InfoReader = InfoReader at use sites. +type ITraitContext<'AccessRights, 'MethodInfo, 'InfoReader> = + inherit ITraitContext + abstract SelectExtensionMethods: traitInfo: TraitConstraintInfo * range: range * infoReader: 'InfoReader -> (TType * 'MethodInfo) list + abstract AccessRights: 'AccessRights + /// The specification of a member constraint that must be solved [] type TraitConstraintInfo = @@ -2610,7 +2621,8 @@ type TraitConstraintInfo = objAndArgTys: TTypes * returnTyOpt: TType option * source: string option ref * - solution: TraitConstraintSln option ref + solution: TraitConstraintSln option ref * + traitCtxt: ITraitContext option /// Get the types that may provide solutions for the traits member x.SupportTypes = (let (TTrait(tys = tys)) = x in tys) @@ -2631,20 +2643,24 @@ type TraitConstraintInfo = with get() = (let (TTrait(solution = sln)) = x in sln.Value) and set v = (let (TTrait(solution = sln)) = x in sln.Value <- v) + member x.TraitContext = (let (TTrait(traitCtxt = tc)) = x in tc) + member x.CloneWithFreshSolution() = - let (TTrait(a, b, c, d, e, f, sln)) = x - TTrait(a, b, c, d, e, f, ref sln.Value) + let (TTrait(a, b, c, d, e, f, sln, h)) = x + TTrait(a, b, c, d, e, f, ref sln.Value, h) - member x.WithMemberKind(kind) = (let (TTrait(a, b, c, d, e, f, g)) = x in TTrait(a, b, { c with MemberKind=kind }, d, e, f, g)) + member x.WithMemberKind(kind) = (let (TTrait(a, b, c, d, e, f, g, h)) = x in TTrait(a, b, { c with MemberKind=kind }, d, e, f, g, h)) - member x.WithSupportTypes(tys) = (let (TTrait(_, b, c, d, e, f, g)) = x in TTrait(tys, b, c, d, e, f, g)) + member x.WithSupportTypes(tys) = (let (TTrait(_, b, c, d, e, f, g, h)) = x in TTrait(tys, b, c, d, e, f, g, h)) - member x.WithMemberName(name) = (let (TTrait(a, _, c, d, e, f, g)) = x in TTrait(a, name, c, d, e, f, g)) + member x.WithMemberName(name) = (let (TTrait(a, _, c, d, e, f, g, h)) = x in TTrait(a, name, c, d, e, f, g, h)) [] member x.DebugText = x.ToString() override x.ToString() = "TTrait(" + x.MemberLogicalName + ")" + +let traitCtxtNone : ITraitContext option = None /// Represents the solution of a member constraint during inference. [] diff --git a/src/Compiler/TypedTree/TypedTree.fsi b/src/Compiler/TypedTree/TypedTree.fsi index 7fbe446641a..edbd550c047 100644 --- a/src/Compiler/TypedTree/TypedTree.fsi +++ b/src/Compiler/TypedTree/TypedTree.fsi @@ -1747,6 +1747,20 @@ type TraitWitnessInfo = /// Get the return type recorded in the member constraint. member ReturnType: TType option +/// Non-generic marker interface for storing in TraitConstraintInfo. +type ITraitContext = interface end + +/// Generic typed interface for trait context operations. +type ITraitContext<'AccessRights, 'MethodInfo, 'InfoReader> = + inherit ITraitContext + + /// Select extension methods relevant to solving a trait constraint + abstract SelectExtensionMethods: + traitInfo: TraitConstraintInfo * range: Text.range * infoReader: 'InfoReader -> (TType * 'MethodInfo) list + + /// Get the accessibility domain for the trait context + abstract AccessRights: 'AccessRights + /// The specification of a member constraint that must be solved [] type TraitConstraintInfo = @@ -1761,7 +1775,8 @@ type TraitConstraintInfo = objAndArgTys: TTypes * returnTyOpt: TType option * source: string option ref * - solution: TraitConstraintSln option ref + solution: TraitConstraintSln option ref * + traitCtxt: ITraitContext option override ToString: unit -> string @@ -1791,6 +1806,9 @@ type TraitConstraintInfo = /// Get or set the solution of the member constraint during inference member Solution: TraitConstraintSln option with get, set + /// Get the trait context (extension method scope) associated with this constraint + member TraitContext: ITraitContext option + member CloneWithFreshSolution: unit -> TraitConstraintInfo /// The member kind is irrelevant to the logical properties of a trait. However it adjusts @@ -1801,6 +1819,8 @@ type TraitConstraintInfo = member WithMemberName: string -> TraitConstraintInfo +val traitCtxtNone: ITraitContext option + /// Represents the solution of a member constraint during inference. [] type TraitConstraintSln = diff --git a/src/Compiler/TypedTree/TypedTreeOps.Attributes.fs b/src/Compiler/TypedTree/TypedTreeOps.Attributes.fs index a57c6e23804..0f40c488c4e 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.Attributes.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.Attributes.fs @@ -1668,7 +1668,7 @@ module internal DebugPrint = and auxTraitL env (ttrait: TraitConstraintInfo) = #if DEBUG - let (TTrait(tys, nm, memFlags, argTys, retTy, _, _)) = ttrait + let (TTrait(tys, nm, memFlags, argTys, retTy, _, _, _)) = ttrait match global_g with | None -> wordL (tagText "") diff --git a/src/Compiler/TypedTree/TypedTreeOps.FreeVars.fs b/src/Compiler/TypedTree/TypedTreeOps.FreeVars.fs index 054df3371fd..0f97ab3fed6 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.FreeVars.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.FreeVars.fs @@ -280,7 +280,7 @@ module internal FreeTypeVars = | TyparConstraint.AllowsRefStruct _ | TyparConstraint.RequiresDefaultConstructor _ -> acc - and accFreeInTrait opts (TTrait(tys, _, _, argTys, retTy, _, sln)) acc = + and accFreeInTrait opts (TTrait(tys, _, _, argTys, retTy, _, sln, _)) acc = Option.foldBack (accFreeInTraitSln opts) sln.Value @@ -427,7 +427,7 @@ module internal FreeTypeVars = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> acc - and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argTys, retTy, _, _)) = + and accFreeInTraitLeftToRight g cxFlag thruFlag acc (TTrait(tys, _, _, argTys, retTy, _, _, _)) = let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc tys let acc = accFreeInTypesLeftToRight g cxFlag thruFlag acc argTys let acc = Option.fold (accFreeInTypeLeftToRight g cxFlag thruFlag) acc retTy @@ -632,7 +632,7 @@ module internal MemberRepresentation = /// Get the key associated with the member constraint. member traitInfo.GetWitnessInfo() = - let (TTrait(tys, nm, memFlags, objAndArgTys, rty, _, _)) = traitInfo + let (TTrait(tys, nm, memFlags, objAndArgTys, rty, _, _, _)) = traitInfo TraitWitnessInfo(tys, nm, memFlags, objAndArgTys, rty) /// Get information about the trait constraints for a set of typars. diff --git a/src/Compiler/TypedTree/TypedTreeOps.Remap.fs b/src/Compiler/TypedTree/TypedTreeOps.Remap.fs index 605b189ce17..da5d3bde2fb 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.Remap.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.Remap.fs @@ -296,7 +296,7 @@ module internal TypeRemapping = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> Some x) - and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, source, slnCell)) = + and remapTraitInfo tyenv (TTrait(tys, nm, flags, argTys, retTy, source, slnCell, traitCtxt)) = let slnCell = match slnCell.Value with | None -> None @@ -341,7 +341,7 @@ module internal TypeRemapping = // in the same way as types let newSlnCell = ref slnCell - TTrait(tysR, nm, flags, argTysR, retTyR, source, newSlnCell) + TTrait(tysR, nm, flags, argTysR, retTyR, source, newSlnCell, traitCtxt) and bindTypars tps tyargs tpinst = match tps with @@ -1485,8 +1485,8 @@ module internal TypeEquivalence = typeEquivEnvEmpty let rec traitsAEquivAux erasureFlag g aenv traitInfo1 traitInfo2 = - let (TTrait(tys1, nm, mf1, argTys, retTy, _, _)) = traitInfo1 - let (TTrait(tys2, nm2, mf2, argTys2, retTy2, _, _)) = traitInfo2 + let (TTrait(tys1, nm, mf1, argTys, retTy, _, _, _)) = traitInfo1 + let (TTrait(tys2, nm2, mf2, argTys2, retTy2, _, _, _)) = traitInfo2 mf1.IsInstance = mf2.IsInstance && nm = nm2 diff --git a/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs b/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs index de28bc34138..2bc6efdad7d 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.Remapping.fs @@ -1203,7 +1203,7 @@ module internal ExprFreeVars = | TOp.Reraise -> accUsesRethrow true acc - | TOp.TraitCall(TTrait(tys, _, _, argTys, retTy, _, sln)) -> + | TOp.TraitCall(TTrait(tys, _, _, argTys, retTy, _, sln, _)) -> Option.foldBack (accFreeVarsInTraitSln opts) sln.Value diff --git a/src/Compiler/TypedTree/TypedTreePickle.fs b/src/Compiler/TypedTree/TypedTreePickle.fs index 93e277c05b4..5184af10789 100644 --- a/src/Compiler/TypedTree/TypedTreePickle.fs +++ b/src/Compiler/TypedTree/TypedTreePickle.fs @@ -2130,7 +2130,7 @@ let p_trait_sln sln 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 = @@ -2171,7 +2171,7 @@ 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) + TTrait(a, b, c, d, e, ref None, ref f, None) let p_rational q st = p_int32 (GetNumerator q) st diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 3d9967a5724..c39423dae33 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -186,6 +186,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) -> %type moduleDefnsOrExprPossiblyEmptyOrBlock %type path %type pathOp +%type tyconNameAndTyparDecls /* LESS GREATER parsedOk typeArgs m for each mWhole */ %type typeArgsActual /* LESS GREATER typeArgs m for each mWhole */ @@ -693,7 +694,8 @@ moduleSpfn: let xmlDoc = grabXmlDoc(parseState, $1, 1) if not (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleDefnMustBeSimpleName()) if isRec then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsInvalidUseOfRec()) - let info = SynComponentInfo($1 @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3) + let synTy = Some(SynType.LongIdent(SynLongIdent(path, [], []))) + let info = SynComponentInfo($1 @ attribs2, None, [], synTy, xmlDoc, false, vis, rhs parseState 3) if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let decls, mOptEnd = $5 let m = (rhs2 parseState 1 4, decls) @@ -708,7 +710,8 @@ moduleSpfn: let xmlDoc = grabXmlDoc(parseState, $1, 1) if not (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleDefnMustBeSimpleName()) if isRec then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsInvalidUseOfRec()) - let info = SynComponentInfo($1 @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3) + let synTy = Some(SynType.LongIdent(SynLongIdent(path, [], []))) + let info = SynComponentInfo($1 @ attribs2, None, [], synTy, xmlDoc, false, vis, rhs parseState 3) if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let mWhole = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc let trivia: SynModuleSigDeclNestedModuleTrivia = { ModuleKeyword = Some mModule; EqualsRange = None } @@ -717,7 +720,7 @@ moduleSpfn: | opt_attributes opt_access typeKeyword tyconSpfn tyconSpfnList { if Option.isSome $2 then errorR (Error (FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier (), rhs parseState 2)) let leadingKeyword = SynTypeDefnLeadingKeyword.Type(rhs parseState 3) - let (SynTypeDefnSig (SynComponentInfo (cas, a, cs, b, _xmlDoc, d, d2, d3), typeRepr, members, range, trivia)) = $4 leadingKeyword + let (SynTypeDefnSig (SynComponentInfo (cas, a, cs, synTy, _xmlDoc, d, d2, d3), typeRepr, members, range, trivia)) = $4 leadingKeyword _xmlDoc.MarkAsInvalid() let attrs = $1 @ cas let xmlDoc = grabXmlDoc(parseState, $1, 1) @@ -725,7 +728,7 @@ moduleSpfn: (d3, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRanges range |> unionRangeWithXmlDoc xmlDoc - let tc = (SynTypeDefnSig(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), typeRepr, members, mDefn, trivia)) + let tc = (SynTypeDefnSig(SynComponentInfo(attrs, a, cs, synTy, xmlDoc, d, d2, d3), typeRepr, members, mDefn, trivia)) let m = (mDefn, $5) ||> unionRangeWithListBy (fun (a: SynTypeDefnSig) -> a.Range) |> unionRanges (rhs parseState 3) SynModuleSigDecl.Types(tc :: $5, m) } @@ -798,7 +801,7 @@ tyconSpfnList: let tyconSpfn = let leadingKeyword = SynTypeDefnLeadingKeyword.And(rhs parseState 1) let (SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia) as typeDefnSig) = $2 leadingKeyword - let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo + let (SynComponentInfo(a, typars, c, synTy, _xmlDoc, fixity, vis, mRange)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then typeDefnSig else let range = unionRangeWithXmlDoc _xmlDoc range @@ -807,7 +810,7 @@ tyconSpfnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + let componentInfo = SynComponentInfo (a, typars, c, synTy, xmlDoc, fixity, vis, mRange) SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia) tyconSpfn :: $3 } @@ -1328,11 +1331,11 @@ moduleDefn: { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) let xmlDoc = grabXmlDoc(parseState, $1, 1) let leadingKeyword = SynTypeDefnLeadingKeyword.Type(rhs parseState 3) - let (SynTypeDefn(SynComponentInfo(cas, a, cs, b, _xmlDoc, d, d2, d3), e, f, g, h, trivia)) = $4 leadingKeyword + let (SynTypeDefn(SynComponentInfo(cas, a, cs, synTy, _xmlDoc, d, d2, d3), e, f, g, h, trivia)) = $4 leadingKeyword _xmlDoc.MarkAsInvalid() let attrs = $1@cas let mDefn = (h, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) |> unionRangeWithXmlDoc xmlDoc - let tc = SynTypeDefn(SynComponentInfo(attrs, a, cs, b, xmlDoc, d, d2, d3), e, f, g, mDefn, trivia) + let tc = SynTypeDefn(SynComponentInfo(attrs, a, cs, synTy, xmlDoc, d, d2, d3), e, f, g, mDefn, trivia) let types = tc :: $5 [ SynModuleDecl.Types(types, (rhs parseState 3, types) ||> unionRangeWithListBy (fun t -> t.Range)) ] } @@ -1364,7 +1367,8 @@ moduleDefn: [ SynModuleDecl.ModuleAbbrev(List.head path, eqn, (rhs parseState 3, eqn) ||> unionRangeWithListBy (fun id -> id.idRange)) ] | Choice2Of2 (def, mEndOpt) -> if not (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName()) - let info = SynComponentInfo(attribs @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3) + let synTy = Some(SynType.LongIdent(SynLongIdent(path, [], []))) + let info = SynComponentInfo(attribs @ attribs2, None, [], synTy, xmlDoc, false, vis, rhs parseState 3) let mEquals = rhs parseState 4 let trivia: SynModuleDeclNestedModuleTrivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals } let m = @@ -1379,7 +1383,8 @@ moduleDefn: { let xmlDoc = grabXmlDoc(parseState, $1, 1) let mWhole = rhs2 parseState 1 3 |> unionRangeWithXmlDoc xmlDoc let attribs, (mModule, isRec, path, vis, attribs2) = $1, $3 - let info = SynComponentInfo(attribs @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3) + let synTy = Some(SynType.LongIdent(SynLongIdent(path, [], []))) + let info = SynComponentInfo(attribs @ attribs2, None, [], synTy, xmlDoc, false, vis, rhs parseState 3) let trivia: SynModuleDeclNestedModuleTrivia = { ModuleKeyword = Some mModule; EqualsRange = None } [ SynModuleDecl.NestedModule(info, isRec, [], false, mWhole, trivia) ] } @@ -1602,10 +1607,10 @@ memberFlags: /* The name of a type in a signature or implementation, possibly with type parameters and constraints */ typeNameInfo: | opt_attributes tyconNameAndTyparDecls opt_typeConstraints - { let typars, lid, fixity, vis = $2 + { let typars, fixity, vis, synTy = $2 let xmlDoc = grabXmlDoc(parseState, $1, 1) - let m = match lid with [] -> rhs parseState 2 | _ -> rangeOfLid lid - SynComponentInfo ($1, typars, $3, lid, xmlDoc, fixity, vis, m) } + let m = match synTy with | Some ty -> ty.Range | None -> rhs parseState 2 + SynComponentInfo ($1, typars, $3, synTy, xmlDoc, fixity, vis, m) } /* Part of a set of type definitions */ tyconDefnList: @@ -1614,7 +1619,7 @@ tyconDefnList: let tyconDefn = let leadingKeyword = SynTypeDefnLeadingKeyword.And(rhs parseState 1) let (SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia) as typeDefn) = $2 leadingKeyword - let (SynComponentInfo(a, typars, c, lid, _xmlDoc, fixity, vis, mLongId)) = componentInfo + let (SynComponentInfo(a, typars, c, synTy, _xmlDoc, fixity, vis, mRange)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then typeDefn else let range = unionRangeWithXmlDoc _xmlDoc range @@ -1623,7 +1628,7 @@ tyconDefnList: else _xmlDoc.MarkAsInvalid() let range = unionRangeWithXmlDoc xmlDoc range - let componentInfo = SynComponentInfo (a, typars, c, lid, xmlDoc, fixity, vis, mLongId) + let componentInfo = SynComponentInfo (a, typars, c, synTy, xmlDoc, fixity, vis, mRange) SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia) tyconDefn :: $3 } | @@ -1647,7 +1652,7 @@ tyconDefn: { let vis, pat, az = $3, $5, $6 let nameRange = rhs parseState 1 let (tcDefRepr, mWith, members) = $8 nameRange - let (SynComponentInfo(_, _, _, lid, _, _, _, _)) = $1 + let lid = $1.LongIdent let mEquals = rhs parseState 7 // Gets the XML doc comments prior to the implicit constructor let xmlDoc = grabXmlDoc (parseState, $2, 2) @@ -1690,7 +1695,7 @@ tyconDefn: | typeNameInfo opt_attributes opt_access opt_HIGH_PRECEDENCE_APP opt_simplePatterns optAsSpec recover { let vis, pat, az = $3, $5, $6 - let (SynComponentInfo(longId = lid)) = $1 + let lid = $1.LongIdent // Gets the XML doc comments prior to the implicit constructor let xmlDoc = grabXmlDoc (parseState, $2, 2) let m = match lid with [] -> rhs parseState 1 | _ -> rangeOfLid lid @@ -2540,16 +2545,45 @@ interfaceMember: tyconNameAndTyparDecls: | opt_access path - { None, $2.LongIdent, false, $1 } + { None, false, $1, Some(SynType.LongIdent($2)) } | opt_access prefixTyparDecls path - { Some $2, $3.LongIdent, false, $1 } + { Some $2, false, $1, Some(SynType.LongIdent($3)) } | opt_access path postfixTyparDecls - { Some $3, $2.LongIdent, true, $1 } + { Some $3, true, $1, Some(SynType.LongIdent($2)) } + + /* Type extension with general type: type (int * int) with ..., type struct (int * int) with ..., type int[] with ..., etc. + Validation of which types are valid for extension is deferred to CheckDeclarations.fs */ + | opt_access atomType + { None, false, $1, Some $2 } + + /* Recovery: type ('T1) or type ('T1) with ... - single type in parens, not a valid tuple */ + | opt_access LPAREN appTypeCanBeNullable rparen + { None, false, $1, Some $3 } + + /* Recovery: type ('T1 *) or type ('T1 *) with ... - trailing star, missing second type */ + | opt_access LPAREN appTypeCanBeNullable STAR rparen + { let mStar = rhs parseState 4 + let ty2 = SynType.FromParseError(mStar.EndRange) + let path = [SynTupleTypeSegment.Type $3; SynTupleTypeSegment.Star mStar; SynTupleTypeSegment.Type ty2] + let mTuple = rhs2 parseState 2 5 + None, false, $1, Some (SynType.Tuple(false, path, mTuple.MakeSynthetic())) } + + /* Recovery: type struct ('T1) or type struct ('T1) with ... - single type in parens with struct */ + | opt_access STRUCT LPAREN appTypeCanBeNullable rparen + { None, false, $1, Some $4 } + + /* Recovery: type struct ('T1 *) or type struct ('T1 *) with ... - trailing star with struct */ + | opt_access STRUCT LPAREN appTypeCanBeNullable STAR rparen + { let mStar = rhs parseState 5 + let ty2 = SynType.FromParseError(mStar.EndRange) + let path = [SynTupleTypeSegment.Type $4; SynTupleTypeSegment.Star mStar; SynTupleTypeSegment.Type ty2] + let mTuple = rhs2 parseState 2 6 + None, false, $1, Some (SynType.Tuple(true, path, mTuple.MakeSynthetic())) } | opt_access recover - { None, [], false, $1 } + { None, false, $1, None } prefixTyparDecls: | typar @@ -7013,6 +7047,10 @@ opt_rec: | REC { true } | /* EMPTY */ { false } +opt_struct: + | STRUCT { Some(rhs parseState 1) } + | /* EMPTY */ { None } + opt_inline: | INLINE { Some(rhs parseState 1) } | /* EMPTY */ { None } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 6ff9f635bbe..0a3527d020b 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -427,6 +427,11 @@ Rozšířená interpolace řetězců podobná nezpracovaným řetězcovým literálům jazyka C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d řez 3d/4d s pevným indexem @@ -1572,6 +1577,11 @@ Použití [<Struct>] u hodnot, funkcí a metod je povolené jenom u částečných aktivních definic vzorů. + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! se nedá kombinovat s and!. diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index c58944cbfd3..4ac624a8d37 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -427,6 +427,11 @@ Erweiterte Zeichenfolgeninterpolation ähnlich wie bei C#-Rohzeichenfolgenliteralen. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d Segment 3D/4D mit feststehendem Index @@ -1572,6 +1577,11 @@ Die Verwendung von "[<Struct>]" für Werte, Funktionen und Methoden ist nur für partielle aktive Musterdefinitionen zulässig. + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! "use!" darf nicht mit "and!" kombiniert werden. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index aa5cc2a6662..eab5a31ccbb 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -427,6 +427,11 @@ Interpolación de cadena extendida similar a los literales de cadena sin formato de C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d segmento de índice fijo 3d/4d @@ -1572,6 +1577,11 @@ El uso de "[<Struct>]" en valores, funciones y métodos solo se permite en definiciones de modelos activos parciales. + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! No se puede combinar use! con and! diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 6f2b05dbf75..942fc08613b 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -427,6 +427,11 @@ Interpolation de chaîne étendue similaire aux littéraux de chaîne brute C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d section à index fixe 3D/4D @@ -1572,6 +1577,11 @@ L’utilisation de' [<Struct>] 'sur les valeurs, les fonctions et les méthodes n’est autorisée que sur les définitions de modèle actif partiel + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! ne peut pas être combiné avec and! diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index bd614d8cc02..79349122bfe 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -427,6 +427,11 @@ Interpolazione di stringa estesa simile ai valori letterali stringa non elaborati C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d sezione a indice fisso 3D/4D @@ -1572,6 +1577,11 @@ L'utilizzo di '[<Struct>]' su valori, funzioni e metodi è consentito solo per definizioni di criteri attivi parziali + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! Non è possibile combinare use! con and! diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 8fd3b3b0ec2..8fc365f3412 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -427,6 +427,11 @@ C# の生文字列リテラルに似た拡張文字列補間。 + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d 固定インデックス スライス 3d/4d @@ -1572,6 +1577,11 @@ 値、関数、およびメソッドでの '[<Struct>]' は、部分的なアクティブ パターンの定義でのみ使うことができます + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! を and! と組み合わせて使用することはできません diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 26c5c683ba3..d954447be94 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -427,6 +427,11 @@ C# 원시 문자열 리터럴과 유사한 확장 문자열 보간입니다. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d 고정 인덱스 슬라이스 3d/4d @@ -1572,6 +1577,11 @@ 값, 함수 및 메서드에 '[<Struct>]'을(를) 사용하는 것은 부분 활성 패턴 정의에서만 허용됩니다. + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use!는 and!와 함께 사용할 수 없습니다. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 6b9d5f57a57..4a55356b604 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -427,6 +427,11 @@ Rozszerzona interpolacja ciągów podobna do literałów nieprzetworzonych ciągów języka C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d część o stałym indeksie 3d/4d @@ -1572,6 +1577,11 @@ Używanie elementu "[<Struct>]" w przypadku wartości, funkcji i metod jest dozwolone tylko w definicjach częściowo aktywnego wzorca + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! Elementu use! nie można łączyć z elementem and! diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 6863d8190c4..65a91bc822e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -427,6 +427,11 @@ Interpolação de cadeia de caracteres estendida semelhante a literais de cadeia de caracteres bruta C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d fatia de índice fixo 3d/4d @@ -1572,6 +1577,11 @@ O uso de '[<Struct>]' em valores, funções e métodos somente é permitido em definições de padrões ativos parciais + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! não pode ser combinado com and! diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 57ce184fa09..96dbf9ed8b0 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -427,6 +427,11 @@ Расширенная интерполяция строк, аналогичная литералам необработанных строк C#. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d срез с фиксированным индексом 3d/4d @@ -1572,6 +1577,11 @@ Использование '[<Struct>]' для значений, функций и методов разрешено только для определений частичных активных шаблонов + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! запрещено сочетать с and! diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index cd8048fe3f7..93960dde3eb 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -427,6 +427,11 @@ C# ham sabit değerli dizeye benzer genişletilmiş dize ilişkilendirmesi. + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d sabit dizinli dilim 3d/4d @@ -1572,6 +1577,11 @@ Değerler, işlevler ve yöntemler üzerinde '[<Struct>]' kullanımına yalnızca kısmi etkin model tanımlarında izin verilir + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use!, and! ile birleştirilemez diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 732fe4078ec..a8f24521041 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -427,6 +427,11 @@ 扩展字符串内插类似于 C# 原始字符串字面量。 + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d 固定索引切片 3d/4d @@ -1572,6 +1577,11 @@ 只允许在部分活动模式定义中对值、函数和方法使用 "[<Struct>]" + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! 不得与 and! 结合使用 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 5955dc1b050..ebb0580bb64 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -427,6 +427,11 @@ 類似於 C# 原始字串常值的擴充字串插補。 + + Allow extension members to participate in SRTP constraint resolution + Allow extension members to participate in SRTP constraint resolution + + fixed-index slice 3d/4d 固定索引切割 3d/4d @@ -1572,6 +1577,11 @@ 只允許在部分現用模式定義上對值、函式和方法使用 '[<Struct>]' + + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + This type cannot be used for a type extension. Type extensions are only supported for named types and tuple types. + + use! may not be combined with and! use! 不可與 and! 合併 diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 036ba49ce48..a3745d5e8cf 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -91,6 +91,11 @@ namespace Microsoft.FSharp.Core inherit Attribute() member _.Value = value + [] + [] + type AllowOverloadOnReturnTypeAttribute() = + inherit Attribute() + [] [] type CLIEventAttribute() = diff --git a/src/FSharp.Core/prim-types.fsi b/src/FSharp.Core/prim-types.fsi index fb03e49d201..d1e9bc041d8 100644 --- a/src/FSharp.Core/prim-types.fsi +++ b/src/FSharp.Core/prim-types.fsi @@ -292,6 +292,18 @@ namespace Microsoft.FSharp.Core /// LiteralAttribute new: unit -> LiteralAttribute + /// Adding this attribute to a method causes the return type to be considered during overload resolution. + /// + /// Attributes + [] + [] + type AllowOverloadOnReturnTypeAttribute = + inherit Attribute + + /// Creates an instance of the attribute + /// AllowOverloadOnReturnTypeAttribute + new: unit -> AllowOverloadOnReturnTypeAttribute + /// Adding this attribute to a property with event type causes it to be compiled with as a CLI /// metadata event, through a syntactic translation to a pair of 'add_EventName' and /// 'remove_EventName' methods. diff --git a/testcheck.fsx b/testcheck.fsx new file mode 100644 index 00000000000..3ea33b29222 --- /dev/null +++ b/testcheck.fsx @@ -0,0 +1,22 @@ +type List<'t> with + static member (|>>)(x: list<'t>, f: 't -> 'u) : list<'u> = List.map f x + +type Option<'t> with + static member (|>>)(x: option<'t>, f: 't -> 'u) : option<'u> = Option.map f x + +type Microsoft.FSharp.Core.FSharpFunc<'t, 'u> with + static member (|>>)(f: 't -> 'u, g: 'u -> 'v) : 't -> 'v = f >> g + +let inline flip f x y = f y x + +type List<'t> with + static member inline (|>>>)(x: list<'MonadT>, f) = (flip (|>>) >> flip (|>>)) f x + +type List<'t> with + static member inline (|>>>>)(x: list<'Monad2T>, f) = + (flip (|>>) >> flip (|>>) >> flip (|>>)) f x + +let x07 = [ Some 1 ] |>>> string +let x08 = [ [ Some 1 ] ] |>>>> string +let x09 = [ Some [ 1 ] ] |>>>> string +printfn "x07=%A x08=%A x09=%A" x07 x08 x09 diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/PublicSign.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/PublicSign.fs index a753fecac3f..1b5af677538 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/PublicSign.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/misc/PublicSign.fs @@ -5,6 +5,7 @@ namespace CompilerOptions.Fsc open System open System.IO +open System.Runtime.InteropServices open Xunit open FSharp.Test open FSharp.Test.Compiler diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/PreprocessorElif.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/PreprocessorElif.fs new file mode 100644 index 00000000000..b0652456228 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/LexicalAnalysis/PreprocessorElif.fs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.LexicalAnalysis + +open Xunit +open FSharp.Test.Compiler + +module PreprocessorElif = + + [] + let ``elif basic branch selection - first branch taken`` () = + Fsx + """ +#if DEFINED +let x = 1 +#elif NOTDEFINED +let x = 2 +#else +let x = 3 +#endif +printfn "%d" x + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif basic branch selection - elif branch taken`` () = + Fsx + """ +#if NOTDEFINED +let x = 1 +#elif DEFINED +let x = 2 +#else +let x = 3 +#endif +printfn "%d" x + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif basic branch selection - else branch taken`` () = + Fsx + """ +#if NOTDEFINED1 +let x = 1 +#elif NOTDEFINED2 +let x = 2 +#else +let x = 3 +#endif +printfn "%d" x + """ + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif multiple elif chain`` () = + Fsx + """ +#if A +let x = 1 +#elif B +let x = 2 +#elif C +let x = 3 +#elif D +let x = 4 +#else +let x = 5 +#endif +printfn "%d" x + """ + |> withDefines [ "C" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif without else`` () = + Fsx + """ +#if NOTDEFINED +let x = 1 +#elif DEFINED +let x = 2 +#endif +printfn "%d" x + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif after else is an error`` () = + Fsx + """ +#if DEFINED +let x = 1 +#else +let x = 2 +#elif NOTDEFINED +let x = 3 +#endif + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "preview" + |> typecheck + |> shouldFail + |> ignore + + [] + let ``elif with no matching if is an error`` () = + Fsx + """ +#elif DEFINED +let x = 1 +#endif + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "preview" + |> typecheck + |> shouldFail + |> ignore + + [] + let ``elif requires langversion 11 or preview`` () = + Fsx + """ +#if NOTDEFINED +let x = 1 +#elif DEFINED +let x = 2 +#endif +printfn "%d" x + """ + |> withDefines [ "DEFINED" ] + |> withLangVersion "10" + |> typecheck + |> shouldFail + |> ignore + + [] + let ``elif nested in if-elif-endif`` () = + Fsx + """ +#if OUTER + #if NOTDEFINED + let x = 1 + #elif INNER + let x = 2 + #endif +#else + let x = 3 +#endif +printfn "%d" x + """ + |> withDefines [ "OUTER"; "INNER" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore + + [] + let ``elif first true branch wins`` () = + Fsx + """ +#if A +let x = 1 +#elif B +let x = 2 +#elif C +let x = 3 +#endif +printfn "%d" x + """ + |> withDefines [ "A"; "B"; "C" ] + |> withLangVersion "preview" + |> typecheck + |> shouldSucceed + |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Basic.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Basic.fs index e350976383c..ac55b1e0d5d 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Basic.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/Basic.fs @@ -222,3 +222,33 @@ module TypeExtensionsBasic = |> ignoreWarnings |> compile |> shouldSucceed + + [] + let ``TupleTypeExtension01_fs`` compilation = + compilation + |> getCompilation + |> asExe + |> withLangVersionPreview + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + + [] + let ``TupleTypeExtension02_fs`` compilation = + compilation + |> getCompilation + |> asExe + |> withLangVersionPreview + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed + + [] + let ``TupleTypeExtension03_fs`` compilation = + compilation + |> getCompilation + |> asExe + |> withLangVersionPreview + |> ignoreWarnings + |> compileAndRun + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension01.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension01.fs new file mode 100644 index 00000000000..5dcc9e859a5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension01.fs @@ -0,0 +1,23 @@ +// #Conformance #ObjectOrientedTypes #TypeExtensions + +// Verify ability to define and use SRTP extensions on tuple types using syntactic tuple syntax + +open System + +type Int32 with + static member (++) (x1: int, x2: int) = x1 + x2 + +type ('T1 * 'T2) with + static member inline (<*>) ((a, f), (b, x)) = (a ++ b, f x) + +let x1 = (1, string) <*> (2, 3) +if x1 <> (3, "3") then exit 1 + +// Also test with non-inline +type ('T1 * 'T2) with + static member PairFirst ((a, _b)) = a + +let x2 = System.Tuple.PairFirst((42, "hello")) +if x2 <> 42 then exit 1 + +exit 0 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension02.fs new file mode 100644 index 00000000000..ac446ab1baa --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension02.fs @@ -0,0 +1,23 @@ +// #Conformance #ObjectOrientedTypes #TypeExtensions + +// Verify ability to define and use SRTP extensions on struct tuple types using syntactic tuple syntax + +open System + +type Int32 with + static member (++) (x1: int, x2: int) = x1 + x2 + +type struct ('T1 * 'T2) with + static member inline (<*>) (struct (a, f), struct (b, x)) = struct (a ++ b, f x) + +let x1 = struct (1, string) <*> struct (2, 3) +if x1 <> struct (3, "3") then exit 1 + +// Also test with non-inline +type struct ('T1 * 'T2) with + static member PairFirst (struct (a, _b)) = a + +let x2 = System.ValueTuple.PairFirst(struct (42, "hello")) +if x2 <> 42 then exit 1 + +exit 0 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension03.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension03.fs new file mode 100644 index 00000000000..d9302ebe60b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/TupleTypeExtension03.fs @@ -0,0 +1,20 @@ +// #Conformance #ObjectOrientedTypes #TypeExtensions + +// Verify SRTP resolution finds extension methods on tuple types via System.Tuple lookup + +open System + +type System.Tuple<'T1, 'T2> with + static member inline Swap ((a, b)) = (b, a) + +let x1 = System.Tuple.Swap((1, "hello")) +if x1 <> ("hello", 1) then exit 1 + +// SRTP should find this through tuple type extension lookup +type ('T1 * 'T2) with + static member inline (<**>) ((a, f), (b, x)) = (f b, a x) + +let x2 = (string, int) <**> (42, "7") +if x2 <> ("42", 7) then exit 1 + +exit 0 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/ExtensionConstraintsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/ExtensionConstraintsTests.fs new file mode 100644 index 00000000000..57793225f44 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/ExtensionConstraintsTests.fs @@ -0,0 +1,405 @@ +namespace Conformance.Types + +open Xunit +open System.IO +open FSharp.Test +open FSharp.Test.Compiler + +/// Tests for RFC FS-1043: Extension members become available to solve operator trait constraints. +module ExtensionConstraintsTests = + + let private testFileDir = Path.Combine(__SOURCE_DIRECTORY__, "testFiles") + + /// Create a compilation from a test file in the test directory. + let private createTest fileName = + FSharp(loadSourceFromFile (Path.Combine(testFileDir, fileName))) + |> asExe + + /// Compile and run a test file with --langversion:preview. No warnings allowed. + let private compileAndRunPreview fileName = + createTest fileName + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // ======================================================================== + // Positive tests: compile AND run cleanly, zero warnings + // ======================================================================== + + [] + let ``Extension operators solve SRTP constraints`` () = + compileAndRunPreview "BasicExtensionOperators.fs" + + [] + let ``Most recently opened extension wins`` () = + compileAndRunPreview "ExtensionPrecedence.fs" + + [] + let ``Extension operators respect accessibility`` () = + compileAndRunPreview "ExtensionAccessibility.fs" + + [] + let ``Extrinsic extension captured at definition site resolves across modules`` () = + compileAndRunPreview "ScopeCapture.fs" + + [] + let ``Extrinsic extension not captured without ExtensionConstraintSolutions`` () = + createTest "ScopeCapture.fs" + |> withLangVersion80 + |> compile + |> shouldFail + |> withErrorCode 1 + + [] + let ``Sequentialized InvokeMap pattern compiles and runs`` () = + compileAndRunPreview "WeakResolution.fs" + + [] + let ``op_Explicit return type disambiguation`` () = + compileAndRunPreview "OpExplicitReturnType.fs" + + [] + let ``AllowOverloadOnReturnType resolves through SRTP`` () = + createTest "AllowOverloadOnReturnType.fs" + |> withLangVersionPreview + |> compileAndRunOrExpectMissingAttribute "Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute" + + [] + let ``Issue 9382 and 9416 regressions compile and run`` () = + compileAndRunPreview "IssueRegressions.fs" + + [] + let ``DateTime plus y compiles and runs with preview`` () = + // Prior to RFC-1043, weak resolution eagerly resolved this to + // DateTime -> TimeSpan -> DateTime. Now it stays generic because + // weak resolution is deferred for inline code. + // H1: Prove y is truly generic by calling f1 with two different types. + // M4: Exercises a runtime-verified extension operator on DateTime. + FSharp """ +module WeakResDateTime +open System + +type MyOffset = { Hours: float } + +type System.DateTime with + static member (+) (dt: DateTime, off: MyOffset) = dt.AddHours(off.Hours) + +let inline f1 (x: DateTime) y = x + y + +// Call 1: y = TimeSpan (built-in DateTime + TimeSpan) +let r1 = f1 DateTime.MinValue (TimeSpan.FromHours(1.0)) + +// Call 2: y = MyOffset (extension DateTime + MyOffset) +// This ONLY compiles if y is generic — proves weak resolution deferral works +let r2 = f1 DateTime.MinValue { Hours = 2.0 } + +// Verify both calls produce correct results +let expected1 = DateTime.MinValue.Add(TimeSpan.FromHours(1.0)) +if r1 <> expected1 then failwith (sprintf "r1: Expected %A, got %A" expected1 r1) + +let expected2 = DateTime.MinValue.AddHours(2.0) +if r2 <> expected2 then failwith (sprintf "r2: Expected %A, got %A" expected2 r2) + """ + |> asExe + |> withLangVersionPreview + |> withOptions ["--nowarn:52"] + |> compileAndRun + |> shouldSucceed + + [] + let ``FSharpPlus Default1 Default2 priority pattern fails without explicit constraint`` () = + // M3: FSharpPlus inheritance-based overload priority (Default1 inherits Default2). + // Currently, the SRTP constraint on (^T or Default1) does not resolve + // the Default2 fallback overload for non-int types. This test documents + // the limitation: the pattern requires the constraint witness type to + // directly declare the member, inheritance alone is not sufficient. + FSharp """ +module Test + +type Default2 = class end +type Default1 = inherit Default2 + +type Resolver = + static member Resolve(_: 'T, _: Default2) = "default" + static member Resolve(x: int, _: Default1) = sprintf "int:%d" x + +let inline resolve (x: ^T) = + let d = Unchecked.defaultof + ((^T or Default1) : (static member Resolve: ^T * Default1 -> string) (x, d)) + +let r1 = resolve 42 +let r2 = resolve "hello" + """ + |> withLangVersionPreview + |> compile + |> shouldFail + + [] + let ``Built-in operator wins over extension on same type`` () = + FSharp """ +module Test +type System.Int32 with + static member (+) (a: int, b: int) = a * b // deliberately wrong + +let r1 = 1 + 2 // built-in must win, not the extension +if r1 <> 3 then failwith (sprintf "Expected 3, got %d" r1) + +let inline addGeneric (x: ^T) (y: ^T) = x + y +let r2 = addGeneric 1 2 // built-in must win even through SRTP +if r2 <> 3 then failwith (sprintf "Expected 3, got %d" r2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // ======================================================================== + // Negative tests: assert specific diagnostics + // ======================================================================== + + [] + let ``FS1215 warning suppressed when ExtensionConstraintSolutions is active`` () = + Fsx """ +type System.String with + static member (*) (s: string, n: int) = System.String.Concat(Array.replicate n s) + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``FS1215 warning emitted without ExtensionConstraintSolutions`` () = + Fsx """ +type System.String with + static member (*) (s: string, n: int) = System.String.Concat(Array.replicate n s) + """ + |> withLangVersion80 + |> compile + |> withDiagnostics [ + Warning 1215, Line 3, Col 19, Line 3, Col 22, "Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead." + ] + + [] + let ``FSharpPlus Sequence pattern fails to compile`` () = + Fsx """ +let inline CallReturn< ^M, ^R, 'T when (^M or ^R) : (static member Return : unit -> ('T -> ^R))> () = + ((^M or ^R) : (static member Return : unit -> ('T -> ^R)) ()) + +let inline CallApply< ^M, ^I1, ^I2, ^R when (^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R)> (input1: ^I1, input2: ^I2) = + ((^M or ^I1 or ^I2) : (static member Apply : ^I1 * ^I2 -> ^R) input1, input2) + +let inline CallMap< ^M, ^F, ^I, ^R when (^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R)> (mapping: ^F, source: ^I) : ^R = + ((^M or ^I or ^R) : (static member Map : ^F * ^I -> ^R) mapping, source) + +let inline CallSequence< ^M, ^I, ^R when (^M or ^I) : (static member Sequence : ^I -> ^R)> (b: ^I) : ^R = + ((^M or ^I) : (static member Sequence : ^I -> ^R) b) + +type Return = class end +type Apply = class end +type Map = class end +type Sequence = class end + +let inline InvokeReturn (x: 'T) : ^R = CallReturn< Return, ^R, 'T> () x +let inline InvokeApply (f: ^I1) (x: ^I2) : ^R = CallApply(f, x) +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = CallMap (mapping, source) + +type Sequence with + static member inline Sequence (t: list>) : ^R = + List.foldBack (fun (x: 't option) (ys: ^R) -> InvokeApply (InvokeMap (fun x y -> x :: y) x) ys) t (InvokeReturn []) + +type Map with + static member Map (f: 'T->'U, x: option<_>) = Option.map f x + +type Apply with + static member Apply (f: option<_>, x: option<'T>) : option<'U> = failwith "" + +type Return with + static member Return () = fun x -> Some x : option<'a> + +let res = CallSequence [Some 3; Some 2; Some 1] + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + // Weak resolution deferral leaves the inner InvokeMap return type unresolved before + // generalization, triggering the value restriction on `res`. + (Error 30, Line 36, Col 5, Line 36, Col 8, "Value restriction: The value 'res' has an inferred generic type +val res: '_a list option +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 'res' 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 ``Issue 8794 - Shadowing member return type produces ambiguity error`` () = + // When Daughter shadows Mother.Hello() with a different return type, + // the member constraint finds both overloads and reports ambiguity. + // Not directly RFC FS-1043 — documents current member constraint behavior. + Fsx """ +type Mother() = + member this.Hello() = Unchecked.defaultof + +type Daughter() = + inherit Mother() + member this.Hello() = Unchecked.defaultof + +type SomeoneHolder<'Someone when 'Someone: (member Hello : unit -> string)> = + { Someone: 'Someone } + +let someoneHolder = { Someone = Daughter() } + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + // Shadowing Mother.Hello() with Daughter.Hello() (different return type) + // creates overload ambiguity for the member constraint. + (Error 193, Line 12, Col 33, Line 12, Col 43, "A unique overload for method 'Hello' could not be determined based on type information prior to this program point. A type annotation may be needed. + +Known return type: string + +Candidates: + - member Daughter.Hello: unit -> string + - member Mother.Hello: unit -> int") + ] + + [] + let ``Extension does not satisfy IWSAM constraint`` () = + // M1: Extension (+) should NOT make a type satisfy IAdditionOperators. + // SRTP extension solutions and interface implementations are orthogonal. + FSharp """ +module Test +open System.Numerics + +type MyNum = { V: int } + +type MyNum with + static member (+) (a: MyNum, b: MyNum) = { V = a.V + b.V } + +let addViaIWSAM<'T when 'T :> IAdditionOperators<'T,'T,'T>> (a: 'T) (b: 'T) = a + b +let r = addViaIWSAM { V = 1 } { V = 2 } + """ + |> withLangVersionPreview + |> compile + |> shouldFail + + [] + let ``Extension not in scope is not resolved`` () = + FSharp """ +module Exts = + type System.Int32 with + static member Zing(x: int) = x + 999 + +module Consumer = + let inline zing (x: ^T) = (^T : (static member Zing: ^T -> ^T) x) + let r = zing 5 // Exts not opened — should fail + """ + |> withLangVersionPreview + |> compile + |> shouldFail + + [] + let ``Extension operator on FSharpFunc type`` () = + FSharp """ +module Test + +type Microsoft.FSharp.Core.FSharpFunc<'t, 'u> with + static member (|>>) (f: 't -> 'u, g: 'u -> 'v) : 't -> 'v = f >> g + +let composed = string |>> List.singleton +let result = composed 5 +if result <> ["5"] then failwith $"Expected [\"5\"], got {result}" + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on FSharpFunc - piped usage`` () = + FSharp """ +module Test + +type Microsoft.FSharp.Core.FSharpFunc<'t, 'u> with + static member (|>>) (f: 't -> 'u, g: 'u -> 'v) : 't -> 'v = f >> g + +// This tests: 5 |> (string |>> List.singleton) +let x02 = 5 |> (string |>> List.singleton) +if x02 <> ["5"] then failwith $"Expected [\"5\"], got {x02}" + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on FSharpFunc with nested SRTP - map squared`` () = + // Tests |>>> ("map squared") which uses flip and |>> with FSharpFunc extension + // This is the test case from miniFSharpPlus.fsx + FSharp """ +module Test + +type List<'t> with + static member (|>>) (x: list<'t>, f: 't -> 'u) : list<'u> = List.map f x + +type Option<'t> with + static member (|>>) (x: option<'t>, f: 't -> 'u) : option<'u> = Option.map f x + +type Microsoft.FSharp.Core.FSharpFunc<'t, 'u> with + static member (|>>) (f: 't -> 'u, g: 'u -> 'v) : 't -> 'v = f >> g + +let inline flip f x y = f y x + +type List<'t> with + static member inline (|>>>) (x: list<'MonadT>, f) = (flip (|>>) >> flip (|>>)) f x + +// Test: apply |>>> to a list of options +let x07 = [Some 1] |>>> string +if x07 <> [Some "1"] then failwith $"Expected [Some \"1\"], got {x07}" + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on FSharpFunc with deeply nested SRTP - map cubed`` () = + // Tests |>>>> ("map cubed") which uses three levels of flip and |>> + // This previously caused "Undefined or unsolved type variable" regression + FSharp """ +module Test + +type List<'t> with + static member (|>>) (x: list<'t>, f: 't -> 'u) : list<'u> = List.map f x + +type Option<'t> with + static member (|>>) (x: option<'t>, f: 't -> 'u) : option<'u> = Option.map f x + +type Microsoft.FSharp.Core.FSharpFunc<'t, 'u> with + static member (|>>) (f: 't -> 'u, g: 'u -> 'v) : 't -> 'v = f >> g + +let inline flip f x y = f y x + +type List<'t> with + static member inline (|>>>) (x: list<'MonadT>, f) = (flip (|>>) >> flip (|>>)) f x + +type List<'t> with + static member inline (|>>>>) (x: list<'Monad2T>, f) = (flip (|>>) >> flip (|>>) >> flip (|>>)) f x + +// Test: apply |>>>> to a nested structure +let x08 = [[Some 1]] |>>>> string +if x08 <> [[Some "1"]] then failwith $"Expected [[Some \"1\"]], got {x08}" + +let x09 = [Some [1]] |>>>> string +if x09 <> [Some ["1"]] then failwith $"Expected [Some [\"1\"]], got {x09}" + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/AllowOverloadOnReturnType.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/AllowOverloadOnReturnType.fs new file mode 100644 index 00000000000..150eb46fc57 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/AllowOverloadOnReturnType.fs @@ -0,0 +1,40 @@ +// RFC FS-1043: AllowOverloadOnReturnType attribute. +// Enables return-type-based overload resolution for arbitrary methods, +// extending behavior previously reserved for op_Explicit and op_Implicit. + +module AllowOverloadOnReturnType + +type Converter = + [] + static member Convert(x: string) : int = int x + [] + static member Convert(x: string) : float = float x + [] + static member Convert(x: string) : string = x.ToUpper() + +let r1: int = Converter.Convert("42") +if r1 <> 42 then failwith $"Expected 42, got {r1}" + +let r2: float = Converter.Convert("42") +if r2 <> 42.0 then failwith $"Expected 42.0, got {r2}" + +let r3: string = Converter.Convert("hello") +if r3 <> "HELLO" then failwith $"Expected 'HELLO', got '{r3}'" + +// ---- AllowOverloadOnReturnType through SRTP (H2) ---- +// The attribute must also work when resolution goes through an inline SRTP constraint. + +type Converter2 = + [] + static member Convert(x: int) : float = float x + [] + static member Convert(x: int) : string = string x + +let inline convert (x: int) : ^U = + ((^U or Converter2) : (static member Convert: int -> ^U) x) + +let r4: float = convert 42 +if r4 <> 42.0 then failwith $"Expected 42.0, got {r4}" + +let r5: string = convert 42 +if r5 <> "42" then failwith $"Expected '42', got '{r5}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/BasicExtensionOperators.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/BasicExtensionOperators.fs new file mode 100644 index 00000000000..7eb8727e154 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/BasicExtensionOperators.fs @@ -0,0 +1,66 @@ +// RFC FS-1043: Extension members become available to solve SRTP constraints. +// Tests that extension operators on various types are picked up by the constraint solver. + +module BasicExtensionOperators + +// ---- The motivating example from the RFC ---- + +type System.String with + static member (*) (s: string, n: int) = System.String.Concat(Array.replicate n s) + +let r4 = "ha" * 3 + +if r4 <> "hahaha" then failwith $"Expected 'hahaha', got '{r4}'" + +// ---- New operator on Int32 ---- + +type System.Int32 with + static member (++) (a: int, b: int) = a + b + 1 + +let inline incAdd (x: ^T) (y: ^T) = x ++ y + +let r5 = incAdd 3 4 +if r5 <> 8 then failwith $"Expected 8, got {r5}" + +// ---- Extension on a record type ---- + +type MyRec = { X: int; Y: int } + +type MyRec with + static member (+) (a: MyRec, b: MyRec) = { X = a.X + b.X; Y = a.Y + b.Y } + +let inline addThings (a: ^T) (b: ^T) = a + b + +let r7 = addThings { X = 1; Y = 2 } { X = 3; Y = 4 } +if r7 <> { X = 4; Y = 6 } then failwith $"Expected {{X=4;Y=6}}, got {r7}" + +// ---- Extension on a discriminated union ---- + +type Amount = Amount of int + +type Amount with + static member (+) (Amount a, Amount b) = Amount(a + b) + +let r8 = addThings (Amount 10) (Amount 20) +if r8 <> Amount 30 then failwith $"Expected Amount 30, got {r8}" + +// ---- Extension on a struct ---- + +[] +type Vec2 = { Dx: float; Dy: float } + +type Vec2 with + static member (+) (a: Vec2, b: Vec2) = { Dx = a.Dx + b.Dx; Dy = a.Dy + b.Dy } + +let r9 = addThings { Dx = 1.0; Dy = 2.0 } { Dx = 3.0; Dy = 4.0 } +if r9 <> { Dx = 4.0; Dy = 6.0 } then failwith $"Expected {{Dx=4;Dy=6}}, got {r9}" + +// ---- Extension static method via SRTP ---- + +type System.Int32 with + static member Negate(x: int) = -x + +let inline negateIt (x: ^T) = (^T : (static member Negate: ^T -> ^T) x) + +let r10 = negateIt 42 +if r10 <> -42 then failwith $"Expected -42, got {r10}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionAccessibility.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionAccessibility.fs new file mode 100644 index 00000000000..674457c59d1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionAccessibility.fs @@ -0,0 +1,29 @@ +// RFC FS-1043: Extension member accessibility rules. + +module ExtensionAccessibility + +// ---- Public extension operator is visible everywhere ---- + +module PublicExt = + type System.Int32 with + static member Ping(x: int) = x + 100 + +open PublicExt + +let inline ping (x: ^T) = (^T : (static member Ping: ^T -> ^T) x) + +let r1 = ping 5 +if r1 <> 105 then failwith $"Expected 105, got {r1}" + +// ---- Internal module extension: visible within this compilation unit ---- + +module internal InternalExt = + type System.Int32 with + static member Pong(x: int) = x + 200 + +open InternalExt + +let inline pong (x: ^T) = (^T : (static member Pong: ^T -> ^T) x) + +let r2 = pong 5 +if r2 <> 205 then failwith $"Expected 205, got {r2}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionPrecedence.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionPrecedence.fs new file mode 100644 index 00000000000..0a2233740dc --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ExtensionPrecedence.fs @@ -0,0 +1,44 @@ +// RFC FS-1043: Extension member precedence rules. + +module ExtensionPrecedence + +// ---- Most-recently-opened extension wins ---- + +module ExtA = + type System.Int32 with + static member Combine(a: int, b: int) = a + b + +module ExtB = + type System.Int32 with + static member Combine(a: int, b: int) = a * b + +open ExtA +open ExtB // ExtB is opened last, should win + +let inline combine (x: ^T) (y: ^T) = (^T : (static member Combine: ^T * ^T -> ^T) (x, y)) + +let r1 = combine 3 4 +if r1 <> 12 then failwith $"Expected 12 (multiply from ExtB), got {r1}" + +// ---- Multiple extensions on same type with different signatures ---- + +type System.String with + static member Transform(s: string, n: int) = System.String.Concat(Array.replicate n s) + +type System.String with + static member Transform(s: string, prefix: string) = prefix + s + +let inline transformInt (x: ^T) (n: int) = (^T : (static member Transform: ^T * int -> ^T) (x, n)) +let inline transformStr (x: ^T) (p: string) = (^T : (static member Transform: ^T * string -> ^T) (x, p)) + +let r2 = transformInt "ab" 3 +if r2 <> "ababab" then failwith $"Expected 'ababab', got '{r2}'" + +let r3 = transformStr "world" "hello " +if r3 <> "hello world" then failwith $"Expected 'hello world', got '{r3}'" + +// ---- Built-in operators still work ---- +// Sanity check: existing built-in operators are unaffected by extension constraints being active. + +let r4 = 1 + 2 +if r4 <> 3 then failwith $"Expected 3, got {r4}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/IssueRegressions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/IssueRegressions.fs new file mode 100644 index 00000000000..2a9bf1e18e7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/IssueRegressions.fs @@ -0,0 +1,63 @@ +// RFC FS-1043: Regression tests for linked GitHub issues. +// These test the weak resolution changes from the RFC, not extension members directly. +// The issues were fixed by the constraint solver changes that accompany FS-1043. + +module IssueRegressions + +// ---- dotnet/fsharp#9382: Matrix SRTP stress test ---- +// Many statically resolved type parameters, inline record operators. +// Previously produced FS0073 (internal error). Now compiles and runs cleanly. + +type Matrix<'a> = + { m11: 'a; m12: 'a; m13: 'a + m21: 'a; m22: 'a; m23: 'a + m31: 'a; m32: 'a; m33: 'a } + static member inline (/) (m, s) = + { m11 = m.m11 / s; m12 = m.m12 / s; m13 = m.m13 / s + m21 = m.m21 / s; m22 = m.m22 / s; m23 = m.m23 / s + m31 = m.m31 / s; m32 = m.m32 / s; m33 = m.m33 / s } + +let inline determinant m = + m.m11 * m.m22 * m.m33 + + m.m12 * m.m23 * m.m31 + + m.m13 * m.m21 * m.m32 + - m.m31 * m.m22 * m.m13 + - m.m32 * m.m23 * m.m11 + - m.m33 * m.m21 * m.m12 + +let inline inverse m = + { m11 = m.m22 * m.m33 - m.m32 * m.m23; m12 = m.m13 * m.m32 - m.m33 * m.m12; m13 = m.m12 * m.m23 - m.m22 * m.m13 + m21 = m.m23 * m.m31 - m.m33 * m.m21; m22 = m.m11 * m.m33 - m.m31 * m.m13; m23 = m.m13 * m.m21 - m.m23 * m.m11 + m31 = m.m21 * m.m32 - m.m31 * m.m22; m32 = m.m12 * m.m31 - m.m32 * m.m11; m33 = m.m11 * m.m22 - m.m21 * m.m12 } + / (determinant m) + +let identity: Matrix = + { m11 = 1.0; m12 = 0.0; m13 = 0.0 + m21 = 0.0; m22 = 1.0; m23 = 0.0 + m31 = 0.0; m32 = 0.0; m33 = 1.0 } + +let inv = inverse identity +if inv.m11 <> 1.0 then failwith $"Expected identity inverse m11=1.0, got {inv.m11}" + +// M2: Prove inverse actually generalizes — call at decimal, not just float +let identityDecimal: Matrix = + { m11 = 1.0m; m12 = 0.0m; m13 = 0.0m + m21 = 0.0m; m22 = 1.0m; m23 = 0.0m + m31 = 0.0m; m32 = 0.0m; m33 = 1.0m } + +let invDecimal = inverse identityDecimal +if invDecimal.m11 <> 1.0m then failwith $"Expected decimal identity inverse m11=1.0m, got {invDecimal.m11}" + +// ---- dotnet/fsharp#9416: Records with generic type variables and overloaded operators ---- +// Previously produced FS0073 (internal error). Now compiles and runs cleanly. + +type Vector<'T> = + { X: 'T; Y: 'T } + static member inline (+) (u, a) = + { X = u.X + a; Y = u.Y + a } + +module Vector = + let inline add (vector: Vector<'T>) amount = vector + amount + +let v = Vector.add { X = 1; Y = 2 } 10 +if v.X <> 11 then failwith $"Expected 11, got {v.X}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpExplicitReturnType.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpExplicitReturnType.fs new file mode 100644 index 00000000000..b18d110c4e2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpExplicitReturnType.fs @@ -0,0 +1,24 @@ +// RFC FS-1043: Return-type-based overload resolution via op_Explicit. +// op_Explicit/op_Implicit have built-in return-type disambiguation in F#. +// The AllowOverloadOnReturnTypeAttribute (defined in local FSharp.Core) extends +// this to arbitrary methods, but these tests only exercise the op_Explicit path +// since the attribute is not available in the SDK's FSharp.Core. + +module AllowOverloadOnReturnType + +// ---- op_Explicit has built-in return-type disambiguation ---- + +type MyNum = + { Value: int } + static member op_Explicit(x: MyNum) : int = x.Value + static member op_Explicit(x: MyNum) : float = float x.Value + static member op_Explicit(x: MyNum) : string = string x.Value + +let r1: int = MyNum.op_Explicit({ Value = 42 }) +if r1 <> 42 then failwith $"Expected 42, got {r1}" + +let r2: float = MyNum.op_Explicit({ Value = 42 }) +if r2 <> 42.0 then failwith $"Expected 42.0, got {r2}" + +let r3: string = MyNum.op_Explicit({ Value = 42 }) +if r3 <> "42" then failwith $"Expected '42', got '{r3}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ScopeCapture.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ScopeCapture.fs new file mode 100644 index 00000000000..98cc020e4dc --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/ScopeCapture.fs @@ -0,0 +1,31 @@ +// RFC FS-1043: Extrinsic extension members participate in SRTP constraint resolution. +// +// This test uses three modules to demonstrate scope capture: +// +// StringOps – defines an extrinsic (*) extension on System.String (a BCL type). +// GenericLib – opens StringOps, then defines 'multiply'. The extension is in scope +// at the DEFINITION site so it is captured in the SRTP constraint. +// Consumer – opens GenericLib only (not StringOps directly). The captured extension +// travels with the constraint and resolves at the call site. +// +// Without --langversion:preview, extensions do NOT participate in SRTP resolution +// and this code fails to compile (FS0001: string does not support operator '*'). + +module ScopeCapture + +module StringOps = + type System.String with + static member (*)(s: string, n: int) = System.String.Concat(Array.replicate n s) + +module GenericLib = + open StringOps + + let inline multiply (x: ^T) (n: int) = x * n + +module Consumer = + open GenericLib + + let r = multiply "ha" 3 + + if r <> "hahaha" then + failwith $"Expected 'hahaha', got '{r}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/WeakResolution.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/WeakResolution.fs new file mode 100644 index 00000000000..e6d3e7ac192 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/WeakResolution.fs @@ -0,0 +1,30 @@ +// RFC FS-1043: Weak resolution changes for inline code. +// Tests the FSharpPlus-style InvokeMap pattern with sequentialized workaround. + +module WeakResolution + +// When `InvokeMap` uses return types in the support type set (^I or ^R), +// the return type of the inner call isn't known until weak resolution runs. +// With RFC-1043, weak resolution is deferred for inline code, so nesting +// InvokeMap calls directly (InvokeMap f (InvokeMap g x)) fails because +// the inner return type isn't resolved before generalization. +// The workaround is to sequentialize with a let-binding, which forces +// weak resolution of the inner call before the outer call is checked. + +let inline InvokeMap (mapping: ^F) (source: ^I) : ^R = + ((^I or ^R) : (static member Map : ^I * ^F -> ^R) source, mapping) + +type Coll<'T>(x: 'T) = + member _.X = x + static member Map (source: Coll<'a>, mapping: 'a -> 'b) : Coll<'b> = Coll<'b>(mapping source.X) + +// Sequentialized version (RFC-recommended workaround) +let inline AddTwice (x: Coll<'a>) (v: 'a) : Coll<'a> = + let step1 = InvokeMap ((+) v) x + InvokeMap ((+) v) step1 + +let r2 = AddTwice (Coll(3)) 2 +if r2.X <> 7 then failwith $"Expected 7, got {r2.X}" + +let r3 = AddTwice (Coll(10uy)) 5uy +if r3.X <> 20uy then failwith $"Expected 20, got {r3.X}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index 88e29155339..8016e2240d3 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -3,6 +3,7 @@ namespace Conformance.Types open Xunit open System.IO +open FSharp.Compiler.Diagnostics open FSharp.Test open FSharp.Test.Compiler @@ -1831,128 +1832,3274 @@ let _x3 = curryN f3 1 2 3 FSharp "module T\nopen CsLib\nlet _ = IP.Get()" |> asExe |> withOptions iwsamWarnings |> withReferences [csLib] |> compileAndRun |> shouldSucceed + /// Inline F# definition of the string repeat extension operator. + /// Reused across single-file and cross-assembly SRTP tests to avoid duplication. + [] + let private stringRepeatExtDef = + "type System.String with\n static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n))" + + /// Library that adds a string repeat extension operator via (*). + /// Reused across cross-assembly SRTP tests. + let private stringRepeatExtLib = + FSharp $""" +module ExtLib + +{stringRepeatExtDef} + """ + |> withName "ExtLib" + |> withLangVersionPreview + + /// Inline F# definition of the Option map extension operator. + /// Reused across single-file and cross-assembly SRTP tests. + let private optionMapExtDef = """ +type Option<'T> with + static member (|>>) (x, f) = Option.map f x""" + + /// Library that adds an Option map extension operator via (|>>). + /// Reused across cross-assembly SRTP tests. + let private optionMapExtLib = + FSharp $""" +module ExtLib +{optionMapExtDef} + """ + |> withName "ExtLib" + |> withLangVersionPreview + + /// Library that adds an array append extension operator via (++). + let private arrayAppendExtLib = + FSharp """ +module ExtLib + +type 'T ``[]`` with + static member (++) (x1, x2) = Array.append x1 x2 + """ + |> withName "ExtLib" + |> withLangVersionPreview + + /// Library that adds a list append extension operator via (++). + let private listAppendExtLib = + FSharp """ +module ExtLib + +type List<'T> with + static member (++) (x1, x2) = x1 @ x2 + """ + |> withName "ExtLib" + |> withLangVersionPreview + + [] + let ``Extension operator on string resolves with langversion preview`` () = + FSharp $""" +module TestExtOp +{stringRepeatExtDef} + +let r4 = "r" * 4 +if r4 <> "rrrr" then failwith (sprintf "Expected 'rrrr' but got '%%s'" r4) + +let spaces n = " " * n +if spaces 3 <> " " then failwith (sprintf "Expected 3 spaces but got '%%s'" (spaces 3)) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on string fails without langversion preview`` () = + FSharp $""" +module TestExtOp +{stringRepeatExtDef} + +let r4 = "r" * 4 + """ + |> asExe + |> withLangVersion80 + |> typecheck + |> shouldFail + |> withErrorCode 1 + + [] + let ``Built-in numeric operators still work with extension methods in scope`` () = + FSharp $""" +module TestBuiltIn +{stringRepeatExtDef} + +let x = 3 * 4 +if x <> 12 then failwith (sprintf "Expected 12 but got %%d" x) + +let y = 2.0 + 3.0 +if y <> 5.0 then failwith (sprintf "Expected 5.0 but got %%f" y) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension method on custom type resolves via SRTP`` () = + FSharp """ +module TestCustomType + +type Widget = { Name: string; Count: int } + +type Widget with + static member ( + ) (a: Widget, b: Widget) = { Name = a.Name + b.Name; Count = a.Count + b.Count } + +let inline add (a: ^T) (b: ^T) : ^T = a + b + +let w1 = { Name = "A"; Count = 1 } +let w2 = { Name = "B"; Count = 2 } +let w3 = add w1 w2 +if w3.Name <> "AB" then failwith (sprintf "Expected 'AB' but got '%s'" w3.Name) +if w3.Count <> 3 then failwith (sprintf "Expected 3 but got %d" w3.Count) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Intrinsic method takes priority over extension method`` () = + FSharp """ +module TypeDefs = + type MyNum = + { Value: int } + static member ( + ) (a: MyNum, b: MyNum) = { Value = a.Value + b.Value + 1000 } + +module Consumer = + open TypeDefs + + // Extension operator in a different module — this is a genuine optional extension + type MyNum with + static member ( - ) (a: MyNum, b: MyNum) = { Value = a.Value - b.Value } + + let a = { Value = 1 } + let b = { Value = 2 } + // Uses intrinsic (+), result should include the +1000 bias + let c = a + b + if c.Value <> 1003 then failwith (sprintf "Expected 1003 (intrinsic) but got %d" c.Value) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Multiple extension operators with different signatures resolve or error clearly`` () = + FSharp """ +module TestAmbiguity + +module ExtA = + type Widget = { Value: int } + type Widget with + static member (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + +module ExtB = + open ExtA + type Widget with + static member (+) (a: Widget, b: int) = { Value = a.Value + b } + +module Consumer = + open ExtA + open ExtB + // Same-type addition: should resolve to ExtA's (Widget, Widget) -> Widget + let inline add (x: ^T) (y: ^T) = x + y + let r = add { Value = 1 } { Value = 2 } + if r.Value <> 3 then failwith (sprintf "Expected 3 but got %d" r.Value) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Intrinsic operator takes priority over extension with same name and signature`` () = + FSharp """ +module TestIntrinsicPriority + +type Gadget = + { Value: int } + static member (+) (a: Gadget, b: Gadget) = { Value = a.Value + b.Value } + +module GadgetExt = + type Gadget with + static member (+) (a: Gadget, b: Gadget) = { Value = 999 } + +open GadgetExt +let inline add (x: ^T) (y: ^T) = x + y +let result = add { Value = 1 } { Value = 2 } +if result.Value <> 3 then failwith (sprintf "Expected 3 (intrinsic wins) but got %d" result.Value) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``IWSAM extension wins over interface impl for same operator via SRTP`` () = + FSharp """ +module TestIWSAMPriority +open System + +type IAddable<'T> = + static abstract member op_Addition: 'T * 'T -> 'T + +type Bar = + { X: int } + interface IAddable with + static member op_Addition(a, b) = { X = a.X + b.X } + +module BarExt = + type Bar with + static member (+) (a: Bar, b: Bar) = { X = 999 } + +open BarExt +let inline add (x: ^T) (y: ^T) = x + y +let r = add { X = 1 } { X = 2 } +// Extension operator wins over IWSAM interface impl in SRTP resolution +if r.X <> 999 then failwith (sprintf "Expected 999 (extension wins) but got %d" r.X) + """ + |> asExe + |> withLangVersionPreview + |> withOptions ["--nowarn:3535"] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator not visible without opening defining module`` () = + FSharp """ +module TestScopeNotVisible + +module Ext = + type System.String with + static member (*) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + +// Ext is NOT opened — extension should not be visible +let r = "a" * 3 + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 1 + + // Removed: "Inline SRTP function resolves using consumers scope for extensions" + // was a duplicate of ExtensionConstraintsTests/ScopeCapture.fs which covers + // the same System.String (*) extrinsic extension scenario. + + [] + let ``Internal record field resolves via SRTP within same compilation unit`` () = + FSharp """ +module TestInternalField + +module Internal = + type internal Rec = { X: int } + let internal make x = { X = x } + +let inline getX (r: ^T) = (^T : (member X : int) r) +let v = getX (Internal.make 42) +if v <> 42 then failwith (sprintf "Expected 42 but got %d" v) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Cross-assembly extension operator resolves via SRTP`` () = + // True optional extension on System.String (an external type). + // Exercises the cross-assembly path where TTrait.traitCtxt deserializes as None + // from pickled metadata, requiring fallback resolution from the consumer's opens. + let library = stringRepeatExtLib + + FSharp """ +module Consumer + +open ExtLib + +let r4 = "r" * 4 +if r4 <> "rrrr" then failwith (sprintf "Expected 'rrrr' but got '%s'" r4) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Cross-assembly intrinsic augmentation operator resolves via SRTP`` () = + // Intrinsic augmentation: Widget and its (+) operator are in the same module. + // This compiles as a regular method on Widget's type, so it works across assemblies + // without needing traitCtxt - included for contrast with the optional extension test above. + let library = + FSharp """ +module ExtLib + +type Widget = { Value: int } +type Widget with + static member (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let a = { Value = 1 } +let b = { Value = 2 } +let c = a + b +if c.Value <> 3 then failwith (sprintf "Expected 3 but got %d" c.Value) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Transitive cross-assembly extension operator resolves via SRTP`` () = + // A→B→C chain: A defines the extension, B uses it in an inline function, C uses B's inline. + // Tests that traitCtxt injection works through multiple levels of freshening. + let libraryA = stringRepeatExtLib + + let libraryB = + FSharp """ +module MiddleLib + +open ExtLib + +let inline repeat (s: string) (n: int) = s * n + """ + |> withName "MiddleLib" + |> withLangVersionPreview + |> withReferences [libraryA] + + FSharp """ +module Consumer + +open MiddleLib + +let r4 = repeat "r" 4 +if r4 <> "rrrr" then failwith (sprintf "Expected 'rrrr' but got '%s'" r4) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [libraryA; libraryB] + |> compileAndRun + |> shouldSucceed + + [] + let ``Overloads differing only by return type produce ambiguity error without attribute`` () = + // Overloads differing only by return type produce ambiguity errors + // when the [] attribute is NOT applied. + FSharp """ +module TestReturnTypeOverload + +type Converter = + static member Convert(x: string) : int = int x + static member Convert(x: string) : float = float x + +let result: int = Converter.Convert("42") + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 41 + + [] + let ``AllowOverloadOnReturnType without type annotation produces ambiguity error`` () = + // Without the attribute, same-parameter overloads with different return + // types and no type annotation on the call site produce ambiguity error. + FSharp """ +module TestNoAnnotation + +type Converter = + static member Convert(x: string) : int = int x + static member Convert(x: string) : float = float x + +let result = Converter.Convert("42") + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 41 + + [] + let ``AllowOverloadOnReturnType disambiguates at call site with type annotation`` () = + FSharp + """ +module TestAllowOverloadOnReturnType + +type Converter = + [] + static member Convert(x: string) : int = int x + [] + static member Convert(x: string) : float = float x + +let resultInt: int = Converter.Convert("42") +let resultFloat: float = Converter.Convert("42") +if resultInt <> 42 then failwith (sprintf "Expected 42 but got %d" resultInt) +if resultFloat <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" resultFloat) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRunOrExpectMissingAttribute "Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute" + + [] + let ``Overloads with different parameter types resolve without ambiguity`` () = + // Overloads that differ by parameter types (string vs int) resolve + // normally — no [] needed. + FSharp """ +module TestMixed + +type Converter = + static member Convert(x: string) : int = int x + static member Convert(x: int) : string = string x + +let result: int = Converter.Convert("42") +let result2: string = Converter.Convert(42) +if result <> 42 then failwith (sprintf "Expected 42 but got %d" result) +if result2 <> "42" then failwith (sprintf "Expected '42' but got '%s'" result2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // TC5: Ambiguity error messages from extension operators + + [] + let ``Two extension operators with same signature on same type compile without error`` () = + // When two modules define the same extension operator on the same type + // and both are opened, F# resolves without ambiguity (last opened wins). + FSharp """ +module TestAmbigExt + +module A = + type System.Int32 with + static member ( %% ) (x: int, y: int) = x + y + +module B = + type System.Int32 with + static member ( %% ) (x: int, y: int) = x * y + +open A +open B + +let inline useOp (x: ^T) (y: ^T) = x %% y +let r = useOp 3 4 + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Extension vs intrinsic with same operator signature produces ambiguity error`` () = + // When an extension adds an operator with the exact same signature as + // an intrinsic, SRTP resolution sees both and reports ambiguity. + FSharp """ +module TestIntrinsicPriority + +type Num = { V: int } + with static member (+) (a: Num, b: Num) = { V = a.V + b.V } + +type Num with + static member (+) (a: Num, b: Num) = { V = a.V * b.V } + +let inline add (a: ^T) (b: ^T) = a + b +let result = add { V = 2 } { V = 3 } + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 43 + + // AO3: op_Explicit-based SRTP return-type resolution + + [] + let ``op_Explicit SRTP resolution disambiguates by return type`` () = + // op_Explicit overloads differing only by return type are resolved + // via int/float conversion functions which use op_Explicit internally. + FSharp """ +module TestAORT_VsExtension + +type Converter = { V: int } + with + static member op_Explicit (c: Converter) : int = c.V + static member op_Explicit (c: Converter) : float = float c.V + +let c = { V = 42 } +let i : int = int c +let f : float = float c +if i <> 42 then failwith (sprintf "Expected 42 but got %d" i) +if f <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" f) + +// Also verify direct calls with type annotations +let i2 : int = Converter.op_Explicit c +let f2 : float = Converter.op_Explicit c +if i2 <> 42 then failwith (sprintf "Expected 42 but got %d" i2) +if f2 <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" f2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // AO4: op_Explicit return-type resolution in quotations + + [] + let ``op_Explicit return-type resolution is deterministic in quotations`` () = + // Verifies that op_Explicit overloads differing by return type + // resolve correctly inside quotations and produce the right result. + FSharp """ +module TestAORT_Quotation +open Microsoft.FSharp.Quotations + +type Conv = { V: int } + with + static member op_Explicit (c: Conv) : int = c.V + static member op_Explicit (c: Conv) : float = float c.V + +let q1 : Expr = <@ Conv.op_Explicit { V = 42 } : int @> +let q2 : Expr = <@ Conv.op_Explicit { V = 42 } : float @> + +let r1 = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q1 :?> int +let r2 = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q2 :?> float +if r1 <> 42 then failwith (sprintf "Expected 42 but got %d" r1) +if r2 <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" r2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + [] + [] + let ``Inline DateTime operator stays generic with langversion preview`` (op: string, memberOp: string) = + let sign = if op = "-" then "-" else "" + FSharp $""" +module TestWeakRes + +let inline f1 (x: System.DateTime) y = x {op} y + +// Verify f1 is truly generic by calling it with a custom type that has ({op}) with DateTime. +// If f1 were specialized, this would fail to compile. +type MyOffset = {{ Ticks: int64 }} + with static member ({memberOp}) (dt: System.DateTime, offset: MyOffset) = dt.AddTicks({sign}offset.Ticks) + +let dt = System.DateTime(2024, 1, 1) +let r : System.DateTime = f1 dt {{ Ticks = 100L }} + """ + |> withLangVersionPreview + |> typecheck + |> shouldSucceed + + [] + let ``Inline DateTime addition resolves concretely without langversion preview`` () = + FSharp """ +module TestWeakResOld + +let inline f1 (x: System.DateTime) y = x + y +let r = f1 (System.DateTime.Now) (System.TimeSpan.FromHours(1.0)) + """ + |> asExe + |> withLangVersion80 + |> compile + |> shouldSucceed + + [] + let ``Non-inline numeric operators work with langversion preview`` () = + FSharp """ +module TestNumericNonInline + +let f (x: float) y = x * y +let r = f 3.0 4.0 + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Inline numeric operators work with langversion preview`` () = + FSharp """ +module TestNumericInline + +let inline f x y = x + y +let r1 = f 3 4 +let r2 = f 3.0 4.0 + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``FSharpPlus-style InvokeMap pattern compiles with preview langversion`` () = + FSharp """ +module TestFSharpPlusPattern + +type Default1 = class end + +type InvokeMap = + static member inline Invoke (mapping: 'T -> 'U, source: ^Functor) : ^Result = + ((^Functor or ^Result) : (static member Map : ^Functor * ('T -> 'U) -> ^Result) source, mapping) + +type InvokeApply = + static member inline Invoke (f: ^ApplicativeFunctor, x: ^ApplicativeFunctor2) : ^ApplicativeFunctor3 = + ((^ApplicativeFunctor or ^ApplicativeFunctor2 or ^ApplicativeFunctor3) : (static member (<*>) : ^ApplicativeFunctor * ^ApplicativeFunctor2 -> ^ApplicativeFunctor3) f, x) + +type ZipList<'T> = { Values: 'T list } with + static member Map (x: ZipList<'T>, f: 'T -> 'U) : ZipList<'U> = { Values = List.map f x.Values } + static member (<*>) (f: ZipList<'T -> 'U>, x: ZipList<'T>) : ZipList<'U> = + { Values = List.map2 (fun f x -> f x) f.Values x.Values } + +let inline add3 (x: ^T) : ZipList< ^T -> ^T -> ^T> = + InvokeMap.Invoke ((fun a b c -> a + b + c), { Values = [x] }) + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``FSharpPlus-style pattern with explicit type annotation workaround compiles`` () = + FSharp """ +module TestFSharpPlusWorkaround + +type InvokeMap = + static member inline Invoke (mapping: 'T -> 'U, source: ^Functor) : ^Result = + ((^Functor or ^Result) : (static member Map : ^Functor * ('T -> 'U) -> ^Result) source, mapping) + +type ZipList<'T> = { Values: 'T list } with + static member Map (x: ZipList<'T>, f: 'T -> 'U) : ZipList<'U> = { Values = List.map f x.Values } + +// Workaround: explicit type annotation on the call +let inline add3 (x: ^T) : ZipList< ^T -> ^T -> ^T> = + (InvokeMap.Invoke ((fun a b c -> a + b + c), { Values = [x] }) : ZipList< ^T -> ^T -> ^T>) + """ + |> withLangVersionPreview + |> typecheck + |> shouldSucceed + + [] + let ``Non-inline code canonicalization is unaffected by ExtensionConstraintSolutions`` () = + FSharp """ +module TestNonInlineUnaffected + +// Non-inline: weak resolution should still run, resolving y to TimeSpan +let f1 (x: System.DateTime) y = x + y +// This call MUST work — y should be inferred as TimeSpan +let r = f1 (System.DateTime.Now) (System.TimeSpan.FromHours(1.0)) + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Inline numeric operators with multiple overloads stay generic with preview`` () = + FSharp """ +module TestInlineNumericGeneric + +let inline addThenMultiply x y z = (x + y) * z +let r1 = addThenMultiply 3 4 5 +let r2 = addThenMultiply 3.0 4.0 5.0 +if r1 <> 35 then failwith (sprintf "Expected 35 but got %d" r1) +if r2 <> 35.0 then failwith (sprintf "Expected 35.0 but got %f" r2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Instance extension method resolves via SRTP`` () = + FSharp """ +module TestInstanceExtension + +type System.String with + member this.Duplicate() = this + this + +let inline duplicate (x: ^T) : ^T = (^T : (member Duplicate : unit -> ^T) x) +let result = duplicate "hello" +if result <> "hellohello" then failwith (sprintf "Expected 'hellohello' but got '%s'" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Instance extension method with parameter resolves via SRTP`` () = + FSharp """ +module TestInstanceExtensionWithParam + +type System.String with + member this.Foo (x: string) = this + x + +let inline foo (x: ^T) (y: ^R) : ^R = (^T : (member Foo : ^R -> ^R) (x, y)) +let result = foo "foo" "bar" +if result <> "foobar" then failwith (sprintf "Expected 'foobar' but got '%s'" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Instance extension does not satisfy static SRTP constraint`` () = + FSharp """ +module TestInstanceVsStatic + +type System.String with + member this.Transform() = this.ToUpper() + +// This SRTP asks for a STATIC member — instance extension should NOT satisfy it +let inline transform (x: ^T) : ^T = (^T : (static member Transform : ^T -> ^T) x) +let result = transform "hello" + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 1 + + [] + let ``Intrinsic instance method takes priority over instance extension`` () = + FSharp """ +module TestInstancePriority + +type Widget = { Value: int } with + member this.GetValue() = this.Value + +module WidgetExt = + type Widget with + member this.GetValue() = 999 // extension — should lose + +open WidgetExt + +let inline getValue (x: ^T) : int = (^T : (member GetValue : unit -> int) x) +let result = getValue { Value = 42 } +if result <> 42 then failwith (sprintf "Expected 42 but got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Internal type extension in same assembly resolves via SRTP`` () = + FSharp """ +module TestInternalExtension + +type Widget = { Value: int } + with + // Intrinsic augmentation with internal accessibility + static member internal Combine (a: Widget, b: Widget) = { Value = a.Value + b.Value } + +let inline combine (x: ^T) (y: ^T) = (^T : (static member Combine : ^T * ^T -> ^T) (x, y)) +let result = combine { Value = 1 } { Value = 2 } +if result.Value <> 3 then failwith (sprintf "Expected 3 but got %d" result.Value) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``SRTP constraints from different accessibility domains flow together`` () = + FSharp """ +module TestAccessibilityDomains + +type Widget = { Value: int } + +// Public extension in module A +module ExtA = + type Widget with + static member (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + +// Public extension in module B +module ExtB = + type Widget with + static member (-) (a: Widget, b: Widget) = { Value = a.Value - b.Value } + +open ExtA +open ExtB + +// Both extensions should be available via SRTP in the same scope +let inline addThenSub (x: ^T) (y: ^T) (z: ^T) = + let sum = x + y + sum - z + +let result = addThenSub { Value = 10 } { Value = 5 } { Value = 3 } +if result.Value <> 12 then failwith (sprintf "Expected 12 but got %d" result.Value) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Internal record field resolves via SRTP within same assembly`` () = + FSharp """ +module TestInternalRecordField + +module Internal = + type Rec = internal { X: int } + let make x = { X = x } + +open Internal + +let inline getX (r: ^T) = (^T : (member get_X : unit -> int) r) +let v = getX (Internal.make 42) +if v <> 42 then failwith (sprintf "Expected 42 but got %d" v) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Cross-assembly internal extension is not visible via SRTP`` () = + let library = + FSharp """ +module ExtLib + +type Widget = { Value: int } + +type Widget with + static member internal (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let inline add (x: ^T) (y: ^T) = x + y +let result = add { Value = 1 } { Value = 2 } + """ + |> withLangVersionPreview + |> withReferences [library] + |> compile + |> shouldFail + |> withErrorCode 43 + + [] + let ``RFC widening example: extension methods satisfy SRTP constraints`` () = + // From RFC FS-1043: extension members enable widening numeric operations. + // Tests that SRTP constraints like widen_to_double are satisfied by + // extension methods on primitive types. + FSharp """ +module TestWidening + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + static member inline widen_to_double (a: int32) : double = double a + +type System.Int64 with + static member inline widen_to_double (a: int64) : double = double a + +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +let r1: int64 = widen_to_int64 42 +let r2: double = widen_to_double 42 +let r3: double = widen_to_double 42L +if r1 <> 42L then failwith (sprintf "Expected 42L but got %d" r1) +if r2 <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" r2) +if r3 <> 42.0 then failwith (sprintf "Expected 42.0 but got %f" r3) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``RFC op_Implicit extension example compiles with preview langversion`` () = + // From RFC FS-1043: defining op_Implicit via extension methods to + // populate a generic implicitConv function for primitive types. + FSharp """ +module TestImplicitExtension + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + +let inline implicitConv (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) + +let r1: int64 = implicitConv 42 +if r1 <> 42L then failwith (sprintf "Expected 42L but got %d" r1) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // ---- Quotation + runtime witness tests for RFC FS-1043 new functionality ---- + + [] + let ``Witness quotation: extension operator resolved via SRTP is callable in quotation`` () = + // Verifies that an extension operator defined on a custom type can be + // quoted and the quotation evaluated at runtime, exercising witness passing. + FSharp """ +module TestExtOpQuotation + +open Microsoft.FSharp.Quotations + +type Velocity = { MetersPerSecond: float } +type Time = { Seconds: float } +type Distance = { Meters: float } + +type Velocity with + static member (*)(v: Velocity, t: Time) = { Meters = v.MetersPerSecond * t.Seconds } + +let q = <@ { MetersPerSecond = 10.0 } * { Seconds = 5.0 } @> + +// Verify the quotation contains the expected operator call +match q with +| Patterns.Call(None, mi, _) when mi.Name = "op_Multiply" -> () +| _ -> failwith (sprintf "Unexpected quotation shape: %A" q) + +// Verify direct execution gives the correct result +let d = { MetersPerSecond = 10.0 } * { Seconds = 5.0 } +if d.Meters <> 50.0 then failwith (sprintf "Expected 50.0 but got %f" d.Meters) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: inline SRTP function quoted at concrete call site`` () = + // Verifies that an inline function with SRTP constraints, when quoted + // at a concrete call site, produces a quotation that captures the + // resolved witness and can be evaluated. + FSharp """ +module TestInlineSrtpQuotation + +open Microsoft.FSharp.Quotations + +let inline addOne x = x + LanguagePrimitives.GenericOne + +// Quote at int call site +let qInt = <@ addOne 42 @> +// Quote at float call site +let qFloat = <@ addOne 3.14 @> + +// Evaluate via Linq quotation evaluator +let resultInt = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qInt :?> int +let resultFloat = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qFloat :?> float + +if resultInt <> 43 then failwith (sprintf "Expected 43 but got %d" resultInt) +if abs (resultFloat - 4.14) > 0.001 then failwith (sprintf "Expected ~4.14 but got %f" resultFloat) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: chained inline functions pass witnesses correctly`` () = + // Verifies that witness parameters are correctly threaded through + // multiple levels of inline function calls, and the quotation + // evaluates to the right result. + FSharp """ +module TestChainedWitnessQuotation + +let inline myAdd x y = x + y +let inline doubleIt x = myAdd x x + +let q = <@ doubleIt 21 @> + +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> int +if result <> 42 then failwith (sprintf "Expected 42 but got %d" result) + +// Also test with float to verify witness resolves differently +let qf = <@ doubleIt 1.5 @> +let resultF = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qf :?> float +if resultF <> 3.0 then failwith (sprintf "Expected 3.0 but got %f" resultF) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: extension widening in quotation evaluates correctly`` () = + // Verifies that extension methods used for numeric widening (RFC example) + // produce correct quotations that evaluate at runtime. + FSharp """ +module TestWideningQuotation + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) + +let q = <@ widen_to_int64 42 @> + +// Verify the quotation has the right shape +match q with +| Quotations.Patterns.Call(None, mi, _) when mi.Name.Contains("widen") -> () +| _ -> failwith (sprintf "Unexpected quotation shape: %A" q) + +// Verify direct execution +let r = widen_to_int64 42 +if r <> 42L then failwith (sprintf "Expected 42L but got %d" r) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: op_Implicit extension in quotation evaluates correctly`` () = + // Verifies that op_Implicit defined as an extension method produces + // quotations with correct witness resolution and runtime evaluation. + FSharp """ +module TestImplicitQuotation + +type System.Int32 with + static member inline op_Implicit (a: int32) : int64 = int64 a + +let inline implicitConv (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit : ^T -> ^U) (x)) + +let q = <@ implicitConv 42 : int64 @> + +// Verify the quotation captures the conversion +match q with +| Quotations.Patterns.Call(None, mi, _) -> + if not (mi.Name.Contains("implicit") || mi.Name.Contains("Implicit")) then + failwith (sprintf "Expected implicit-related method but got %s" mi.Name) +| _ -> failwith (sprintf "Unexpected quotation shape: %A" q) + +// Verify direct execution +let r : int64 = implicitConv 42 +if r <> 42L then failwith (sprintf "Expected 42L but got %d" r) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: first-class usage of inline SRTP function`` () = + // Verifies that an inline function used as a first-class value + // (witnesses monomorphized) works correctly and can be quoted. + FSharp """ +module TestFirstClassWitness + +let inline myAdd (x: 'T) (y: 'T) : 'T = x + y + +// First-class usage: witnesses are resolved at monomorphization +let intAdd : int -> int -> int = myAdd +let floatAdd : float -> float -> float = myAdd + +if intAdd 3 4 <> 7 then failwith "intAdd failed" +if floatAdd 3.0 4.0 <> 7.0 then failwith "floatAdd failed" + +// Quote the first-class application +let q = <@ intAdd 3 4 @> +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> int +if result <> 7 then failwith (sprintf "Expected 7 but got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: comparison constraint witness in quotation`` () = + // Verifies that comparison-based SRTP constraints produce correct + // witnesses in quotations and evaluate correctly at runtime. + FSharp """ +module TestComparisonWitness + +let inline myMax x y = if x > y then x else y + +let q = <@ myMax 3 5 @> +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> int +if result <> 5 then failwith (sprintf "Expected 5 but got %d" result) + +let qs = <@ myMax "apple" "banana" @> +let resultS = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qs :?> string +if resultS <> "banana" then failwith (sprintf "Expected banana but got %s" resultS) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: abs and sign witnesses evaluate in quotation`` () = + // Verifies that built-in SRTP-resolved operators like abs and sign + // produce correct quotations with witness passing. + FSharp """ +module TestAbsSignWitness + +let qAbs = <@ abs -42 @> +let resultAbs = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qAbs :?> int +if resultAbs <> 42 then failwith (sprintf "abs: Expected 42 but got %d" resultAbs) + +let qSign = <@ sign -3.14 @> +let resultSign = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qSign :?> int +if resultSign <> -1 then failwith (sprintf "sign: Expected -1 but got %d" resultSign) + +let qAbsF = <@ abs -2.5 @> +let resultAbsF = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qAbsF :?> float +if resultAbsF <> 2.5 then failwith (sprintf "absF: Expected 2.5 but got %f" resultAbsF) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: extension operator cross-assembly with quotation`` () = + // Verifies that extension operators defined in one assembly can be + // quoted and evaluated when consumed from another assembly, exercising + // the full cross-assembly witness deserialization path. + let library = + FSharp """ +module ExtLib + +type Widget = { Value: int } + +type Widget with + static member (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let w1 = { Value = 10 } +let w2 = { Value = 32 } + +// Direct execution via extension operator +let result = w1 + w2 +if result.Value <> 42 then failwith (sprintf "Expected 42 but got %d" result.Value) + +// Quote the extension operator usage +let q = <@ w1 + w2 @> + +match q with +| Microsoft.FSharp.Quotations.Patterns.Call(None, mi, _) when mi.Name = "op_Addition" -> () +| _ -> failwith (sprintf "Unexpected quotation shape: %A" q) + """ + |> withLangVersionPreview + |> withReferences [library] + |> asExe + |> compileAndRun + |> shouldSucceed + + // ---- Breaking change regression tests for RFC FS-1043 top 5 scenarios ---- + // These test the most impactful breaking changes identified by the 20-agent council. + + // -- T1: Value capture / partial application of newly-generic inline (S2) -- + + [] + let ``Breaking change S2: value binding of inline SRTP function`` () = + FSharp """ +module Test +let inline f x = x + 1 +let g = f + """ + |> withLangVersionPreview + |> signaturesShouldContain "val g: (int -> int)" + + [] + let ``Breaking change S2: List.map of inline SRTP function compiles`` () = + // When inline SRTP function is reified (passed to List.map), the constraint + // is resolved at the call site via inlining. + FSharp """ +module Test +let inline f x = x + 1 +let result = List.map f [1;2;3] + """ + |> withLangVersionPreview + |> asExe + |> compile + |> shouldSucceed + + [] + let ``Breaking change S2: monomorphic annotation on inline SRTP function compiles`` () = + // When inline SRTP function is assigned to a non-inline binding, + // the constraint is resolved at the assignment site. + FSharp """ +module Test +let inline f x = x + 1 +let g : int -> int = f + """ + |> withLangVersionPreview + |> asExe + |> compile + |> shouldSucceed + + [] + let ``Breaking change S2: control case - x + x was already generic`` () = + FSharp """ +module Test +let inline f x = x + x +let g = f + """ + |> withLangVersionPreview + |> signaturesShouldContain "val g: (int -> int)" + + // -- T2: Non-inline wrapper of inline function (S3) -- + + [] + let ``Breaking change S3: non-inline wrapper monomorphizes`` () = + FSharp """ +module Test +let inline f x = x + 1 +let run x = f x + """ + |> withLangVersionPreview + |> signaturesShouldContain "val run: x: int -> int" + + [] + let ``Breaking change S3: inline wrapper propagates SRTP`` () = + FSharp """ +module Test +let inline f x = x + 1 +let inline run x = f x + """ + |> withLangVersionPreview + |> signaturesShouldContain "val inline run: x: ^a -> 'b when (^a or int) : (static member (+) : ^a * int -> 'b)" + + [] + let ``Breaking change S3: non-inline wrapper with DateTime`` () = + FSharp """ +module Test +open System +let inline f (x: DateTime) y = x + y +let run (d: DateTime) (t: TimeSpan) = f d t + """ + |> withLangVersionPreview + |> signaturesShouldContain "val run: d: System.DateTime -> t: System.TimeSpan -> System.DateTime" + + // -- T3: Inline chain + concrete-typed library call (S6) -- + + [] + let ``Breaking change S6: inline chain with Math.Abs constrains to int`` () = + FSharp """ +module Test +let inline f x = let y = x + 1 in System.Math.Abs(y) +if f -5 <> 4 then failwith (sprintf "Expected 4 but got %d" (f -5)) + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + + + // https://github.com/dotnet/fsharp/issues/8098 + [] + let ``Issue 8098 - ToString on int via inline SRTP does not throw NRE`` () = + FSharp """ +module Test + +let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + +[] +let main _ = + let s = toString 123 + if s <> "123" then failwith (sprintf "Expected '123' but got '%s'" s) + 0 + """ + |> asExe + |> compileExeAndRun + |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/8098 + [] + let ``Issue 8098 - GetHashCode on int via inline SRTP does not throw NRE`` () = + FSharp """ +module Test + +let inline getHash (x: ^a) = (^a : (member GetHashCode : unit -> int) x) + +[] +let main _ = + let h = getHash 42 + if h <> 42 then failwith (sprintf "Expected 42 but got %d" h) + 0 + """ + |> asExe + |> compileExeAndRun + |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/8098 + [] + let ``Issue 8098 - ToString on custom struct via inline SRTP does not throw NRE`` () = + FSharp """ +module Test + +[] +type MyPoint = { X: int; Y: int } + +let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + +[] +let main _ = + let p = { X = 1; Y = 2 } + let s = toString p + if s = null then failwith "Got null" + 0 + """ + |> asExe + |> compileExeAndRun + |> shouldSucceed + + // https://github.com/dotnet/fsharp/issues/8098 + [] + let ``Issue 8098 - ToString on reference type via inline SRTP still works`` () = + FSharp """ +module Test + +let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + +[] +let main _ = + let s = toString "hello" + if s <> "hello" then failwith (sprintf "Expected 'hello' but got '%s'" s) + 0 + """ + |> asExe + |> compileExeAndRun + |> shouldSucceed + // https://github.com/dotnet/fsharp/issues/8098 [] - let ``Issue 8098 - ToString on int via inline SRTP does not throw NRE`` () = + let ``Issue 8098 - ToString on struct without override via inline SRTP does not throw NRE`` () = + FSharp """ +module Test + +[] +type EmptyStruct = + val X: int + new(x) = { X = x } + // No ToString override — inherits Object.ToString() + +let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + +[] +let main _ = + let s = toString (EmptyStruct(42)) + if s = null then failwith "Got null" + 0 + """ + |> asExe + |> compileExeAndRun + + // https://github.com/dotnet/fsharp/issues/15987 + [] + let ``Issue 15987 - SRTP overload resolution returns correct value for typed argument`` () = + FSharp """ +module Test + +type A = A with + static member ($) (A, a: float ) = 0.0 + static member ($) (A, a: decimal) = 0M + static member ($) (A, a: 't ) = 0 + +let inline call x = ($) A x + +// Verify correct overload is selected: float argument should use the float overload +let resultFloat: float = call 42.0 +let resultDecimal: decimal = call 42M +let resultInt: int = call 42 + +if resultFloat <> 0.0 then failwith $"Expected 0.0 but got {resultFloat}" +if resultDecimal <> 0M then failwith $"Expected 0M but got {resultDecimal}" +if resultInt <> 0 then failwith $"Expected 0 but got {resultInt}" +""" + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``Breaking change S6: inline chain with printfn constrains to int`` () = + FSharp """ +module Test +let inline f x = let y = x + 1 in printfn "%d" y +f 41 + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``Breaking change S6: inline chain with string resolves to int`` () = + // string function constrains the result to a concrete type, + // which propagates back through x + 1 and resolves to int. + FSharp """ +module Test +let inline f x = let y = x + 1 in string y + """ + |> withLangVersionPreview + |> signaturesShouldContain "val inline f: x: int -> string" + + // -- Additional operator dimensions -- + + [] + let ``Breaking change: unary negate inline stays generic`` () = + // Unary minus with no literal — single support type, was already generic. + FSharp """ +module Test +let inline f x = -x +let g = f + """ + |> withLangVersionPreview + |> signaturesShouldContain "val g: (int -> int)" + + [] + let ``Breaking change: multiply with literal`` () = + // Same pattern as x + 1 but with *. + FSharp """ +module Test +let inline f x = x * 2 +let g = f + """ + |> withLangVersionPreview + |> signaturesShouldContain "val g: (int -> int)" + + [] + let ``Breaking change: non-inline wrapper of multiply with literal`` () = + FSharp """ +module Test +let inline f x = x * 2 +let run x = f x + """ + |> withLangVersionPreview + |> signaturesShouldContain "val run: x: int -> int" + + [] + let ``Breaking change S4: delegate from inline SRTP compiles`` () = + // When inline SRTP function is wrapped in a delegate, the constraint + // is resolved at the delegate construction site. + FSharp """ +module Test +let inline addOne x = x + 1 +let d = System.Func(addOne) + """ + |> withLangVersionPreview + |> asExe + |> compile + |> shouldSucceed + + [] + let ``Extension operator on string works in FSI with langversion preview`` () = + Fsx $""" +{stringRepeatExtDef} + +let r4 = "r" * 4 +if r4 <> "rrrr" then failwith (sprintf "Expected 'rrrr' but got '%%s'" r4) + +let spaces n = " " * n +if spaces 3 <> " " then failwith (sprintf "Expected 3 spaces but got '%%s'" (spaces 3)) + """ + |> withLangVersionPreview + |> runFsi + |> shouldSucceed + + [] + let ``RFC widening example: 1 + 2.0 with extension plus operators`` () = + FSharp """ +module TestWideningPlus + +type System.Int32 with + static member inline widen_to_int64 (a: int32) : int64 = int64 a + static member inline widen_to_single (a: int32) : single = single a + static member inline widen_to_double (a: int32) : double = double a + +type System.Single with + static member inline widen_to_double (a: int) : double = double a + +let inline widen_to_int64 (x: ^T) : int64 = (^T : (static member widen_to_int64 : ^T -> int64) (x)) +let inline widen_to_single (x: ^T) : single = (^T : (static member widen_to_single : ^T -> single) (x)) +let inline widen_to_double (x: ^T) : double = (^T : (static member widen_to_double : ^T -> double) (x)) + +type System.Int64 with + static member inline (+)(a: int64, b: 'T) : int64 = a + widen_to_int64 b + static member inline (+)(a: 'T, b: int64) : int64 = widen_to_int64 a + b + +type System.Single with + static member inline (+)(a: single, b: 'T) : single = a + widen_to_single b + static member inline (+)(a: 'T, b: single) : single = widen_to_single a + b + +type System.Double with + static member inline (+)(a: double, b: 'T) : double = a + widen_to_double b + static member inline (+)(a: 'T, b: double) : double = widen_to_double a + b + +(1 + 2L) |> ignore +(1 + 2.0f) |> ignore +(1 + 2.0) |> ignore +(1L + 2) |> ignore +(1L + 2.0) |> ignore + """ + |> asExe + |> withLangVersionPreview + |> compile + // The RFC example (docs/RFC_Changes.md) cannot compile: the (+) in each extension operator body + // self-resolves to the operator being defined, constraining 'T to the same numeric type and + // preventing cross-type addition (e.g., int + double). This is a known limitation. + |> shouldFail + |> withDiagnostics [ + (Warning 64, Line 21, Col 61, Line 21, Col 62, "This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type 'single'.") + (Error 1, Line 21, Col 79, Line 21, Col 80, "The type 'single' does not support the operator 'widen_to_single'") + (Warning 64, Line 25, Col 61, Line 25, Col 62, "This construct causes code to be less generic than indicated by the type annotations. The type variable 'T has been constrained to be type 'double'.") + (Error 1, Line 25, Col 79, Line 25, Col 80, "The type 'double' does not support the operator 'widen_to_double'") + (Error 1, Line 28, Col 6, Line 28, Col 8, "The type 'int64' does not match the type 'int'") + (Error 1, Line 28, Col 15, Line 28, Col 28, "Type mismatch. Expecting a + 'int64 -> 'a' +but given a + 'int64 -> unit' +The type 'int64' does not match the type 'int'") + (Error 1, Line 31, Col 7, Line 31, Col 8, "The type 'int' does not match the type 'int64'") + (Error 1, Line 31, Col 15, Line 31, Col 28, "Type mismatch. Expecting a + 'int64 -> 'a' +but given a + 'int64 -> unit' +The type 'int' does not match the type 'int64'") + (Error 1, Line 32, Col 15, Line 32, Col 29, "Type mismatch. Expecting a + 'double -> 'a' +but given a + 'double -> unit' +No overloads match for method 'op_Addition'. + +Known return type: double + +Known type parameters: < int64 , float > + +Available overloads: + - static member System.Double.(+) : a: ^T * b: double -> double when ^T: (static member widen_to_double: ^T -> double) // Argument 'a' doesn't match + - static member System.Double.(+) : a: double * b: double -> double // Argument 'a' doesn't match + - static member System.Int64.(+) : a: ^T * b: int64 -> int64 when ^T: (static member widen_to_int64: ^T -> int64) // Argument 'a' doesn't match + - static member System.Int64.(+) : a: int64 * b: ^T -> int64 when ^T: (static member widen_to_int64: ^T -> int64) // Argument 'b' doesn't match") + ] + + [] + let ``Recursive inline SRTP function with extension constraints`` () = + FSharp """ +module TestRecursiveInline + +type System.Int32 with + static member inline Decrement(x: int) : int = x - 1 + +let inline decrement (x: ^T) : ^T = (^T : (static member Decrement : ^T -> ^T) x) + +// rec inline with SRTP is not supported (error 1114) +let rec inline sumTo (x: ^T) : ^T = + if x = LanguagePrimitives.GenericZero then LanguagePrimitives.GenericZero + else x + sumTo (decrement x) + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 1114 + + [] + let ``SRTP constraint with no matching member produces clear error`` () = + FSharp """ +module TestNoMatch + +type Foo = { X: int } +let inline bar (x: ^T) = (^T : (static member Nope : ^T -> int) x) +let r = bar { X = 1 } + """ + |> asExe + |> withLangVersionPreview + |> typecheck + |> shouldFail + |> withErrorCode 1 + + [] + let ``Inline numeric square stays monomorphic with preview when no extensions in scope`` () = + FSharp """ +module Test +let inline square x = x * x +let result : int = square 5 + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Inline DateTime add resolves eagerly with preview when no extensions in scope`` () = + FSharp """ +module Test +open System +let inline addDay (x: DateTime) = x + TimeSpan.FromDays(1.0) +let result : DateTime = addDay DateTime.Now + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Inline multiply stays generic when extension operator is in scope`` () = + FSharp """ +module Test +type System.String with + static member (*) (s: string, n: int) = System.String(s.[0], n) + +let inline multiply (x: ^T) (n: int) = x * n +let r1 = multiply "a" 3 +let r2 = multiply 5 3 + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Inline multiply resolves to int when no extension operator is in scope`` () = + FSharp """ +module Test +let inline multiply (x: ^T) (n: int) = x * n +let result : int = multiply 5 3 + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Non-operator extension member resolves via SRTP with langversion preview`` () = + FSharp """ +module TestNonOpExtSRTP + +type System.String with + static member DoThing (s: string) = s.ToUpper() + +let inline doThing (x: ^T) = (^T : (static member DoThing : ^T -> string) x) +let result = doThing "hello" +if result <> "HELLO" then failwith (sprintf "Expected 'HELLO' but got '%s'" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``open type brings extension operators into SRTP scope`` () = + FSharp """ +module TestOpenType + +module Ops = + type System.String with + static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + +open Ops + +let inline repeat (x: ^T) (n: int) = x * n +let r = repeat "ha" 3 +if r <> "hahaha" then failwith (sprintf "Expected 'hahaha' but got '%s'" r) + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``open type on class brings extension operators into SRTP scope`` () = + FSharp $""" +module TestOpenTypeClass + +type Extensions = + static member Dummy = 0 + +{stringRepeatExtDef} + +// This test verifies that extension operators defined at module level work with SRTP. +let inline repeat (x: ^T) (n: int) = x * n +let r = repeat "ha" 3 +if r <> "hahaha" then failwith (sprintf "Expected 'hahaha' but got '%%s'" r) + """ + |> withLangVersionPreview + |> asExe + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator works inside async computation expression`` () = + FSharp $""" +module TestCEExtOp + +{stringRepeatExtDef} + +let result = + async {{ + let r = "ha" * 3 + return r + }} + |> Async.RunSynchronously + +if result <> "hahaha" then failwith (sprintf "Expected 'hahaha' but got '%%s'" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on struct type resolves without boxing`` () = + FSharp """ +module TestStructExtOp + +[] +type Vec2 = { X: float; Y: float } + +type Vec2 with + static member (+) (a: Vec2, b: Vec2) = { X = a.X + b.X; Y = a.Y + b.Y } + +let inline add (a: ^T) (b: ^T) = a + b +let v1 = { X = 1.0; Y = 2.0 } +let v2 = { X = 3.0; Y = 4.0 } +let v3 = add v1 v2 +if v3.X <> 4.0 || v3.Y <> 6.0 then failwith (sprintf "Expected {4.0, 6.0} but got {%f, %f}" v3.X v3.Y) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Recursive function using extension operator resolves correctly`` () = + FSharp $""" +module TestRecExtOp + +{stringRepeatExtDef} + +// Non-inline recursive function that uses extension operator at concrete type +let rec repeatAndConcat (s: string) (n: int) : string = + if n <= 0 then "" + elif n = 1 then s + else s * 1 + repeatAndConcat s (n - 1) + +let result = repeatAndConcat "ab" 3 +if result <> "ababab" then failwith (sprintf "Expected 'ababab' but got '%%s'" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Multiple extension operators satisfy combined SRTP constraints`` () = + FSharp """ +module TestMultiExtOp + +type MyNum = { V: int } + +type MyNum with + static member (+) (a: MyNum, b: MyNum) = { V = a.V + b.V } + static member (-) (a: MyNum, b: MyNum) = { V = a.V - b.V } + static member ( * ) (a: MyNum, b: MyNum) = { V = a.V * b.V } + +let inline addAndMultiply (x: ^T) (y: ^T) = + (x + y) * (x - y) + +let a = { V = 5 } +let b = { V = 3 } +let result = addAndMultiply a b +// (5+3) * (5-3) = 8 * 2 = 16 +if result.V <> 16 then failwith (sprintf "Expected 16 but got %d" result.V) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Units of measure with extension operators resolve via SRTP`` () = + FSharp """ +module TestUoMExtension + +[] type kg +[] type m + +type UoMHelper = + static member inline ScaleBy(x: float<'u>, factor: float) : float<'u> = + LanguagePrimitives.FloatWithMeasure(float x * factor) + +type System.Double with + static member inline Scale(x: float<'u>, factor: float) : float<'u> = + LanguagePrimitives.FloatWithMeasure(float x * factor) + +let inline scale (x: float<'u>) (factor: float) : float<'u> = + UoMHelper.ScaleBy(x, factor) + +let mass = 5.0 +let scaled = scale mass 2.0 +if scaled <> 10.0 then failwith (sprintf "Expected 10.0 but got %A" scaled) + +// Also test basic UoM arithmetic works with inline +let inline addMeasured (x: float<'u>) (y: float<'u>) = x + y +let totalMass = addMeasured 3.0 7.0 +if totalMass <> 10.0 then failwith (sprintf "Expected 10.0 but got %A" totalMass) + +let dist1 = 100.0 +let dist2 = 50.0 +let totalDist = addMeasured dist1 dist2 +if totalDist <> 150.0 then failwith (sprintf "Expected 150.0 but got %A" totalDist) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator SRTP resolves correctly under optimization`` () = + // Regression test: this exercises the optimizer's OptimizeTraitCall → + // CodegenWitnessExprForTraitConstraint → GenWitnessExpr code path. + // The optimizer resolves trait calls before IlxGen, so bugs in + // GenWitnessExpr expression construction only manifest with --optimize+. + FSharp """ +module TestOptimizedExtSRTP + +type Gadget = { Value: int } + +module GadgetOps = + type Gadget with + static member (+) (a: Gadget, b: Gadget) = { Value = a.Value + b.Value } + static member (*) (a: Gadget, n: int) = { Value = a.Value * n } + +open GadgetOps + +let inline add a b = a + b +let inline scale a n = a * n + +let g1 = { Value = 3 } +let g2 = { Value = 7 } +let sum = add g1 g2 +if sum.Value <> 10 then failwith (sprintf "Expected 10 but got %d" sum.Value) + +let scaled = scale g1 4 +if scaled.Value <> 12 then failwith (sprintf "Expected 12 but got %d" scaled.Value) + +// Chain operations +let result = add (scale g1 2) g2 +if result.Value <> 13 then failwith (sprintf "Expected 13 but got %d" result.Value) + """ + |> asExe + |> withLangVersionPreview + |> withOptimize + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on generic type augmentation resolves via SRTP — Array append`` () = + // Regression: extension operator (++) on 'T[] caused + // "BuildFSharpMethodCall: unexpected List.length mismatch" during optimization. + // The enclosing type's type parameters were not accounted for in GenWitnessExpr. + // Reported by gusty: https://github.com/dotnet/fsharp/pull/19396 + FSharp """ +module TestArrayExtOp + +type 'T ``[]`` with + static member (++) (x1, x2) = Array.append x1 x2 + +let result = [| 3 |] ++ [| 6 |] +if result <> [| 3; 6 |] then failwith (sprintf "Expected [|3; 6|] but got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on generic type augmentation resolves via SRTP — Option map`` () = + // Regression: extension operator (|>>) on Option<'T> caused + // "BuildFSharpMethodCall: unexpected List.length mismatch" during optimization. + // Same root cause as the Array case — enclosing generic type parameters missing. + // Reported by gusty: https://github.com/dotnet/fsharp/pull/19396 + FSharp $""" +module TestOptionExtOp +{optionMapExtDef} + +let result = Some 1 |>> string +match result with +| Some "1" -> () +| other -> failwith (sprintf "Expected Some \"1\" but got %%A" other) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + // ---- Cross-assembly extrinsic extension operator regression tests ---- + // The bug: extension operators on GENERIC type augmentations from other + // assemblies crashed with "BuildFSharpMethodCall: unexpected List.length + // mismatch" or "Undefined or unsolved type variable" because the enclosing + // type's type parameters were not accounted for in GenWitnessExpr. + + [] + let ``Extension operator on option resolves via SRTP — cross-assembly extrinsic`` () = + let library = optionMapExtLib + + FSharp """ +module Consumer + +open ExtLib + +let result = Some 42 |>> string +match result with +| Some "42" -> () +| other -> failwith (sprintf "Expected Some \"42\" but got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on array resolves via SRTP — cross-assembly extrinsic`` () = + let library = arrayAppendExtLib + + FSharp """ +module Consumer + +open ExtLib + +let result = [| 1; 2 |] ++ [| 3; 4 |] +if result <> [| 1; 2; 3; 4 |] then failwith (sprintf "Expected [|1;2;3;4|] but got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on list resolves via SRTP — cross-assembly extrinsic`` () = + let library = listAppendExtLib + + FSharp """ +module Consumer + +open ExtLib + +let result = [ 1; 2 ] ++ [ 3; 4 ] +if result <> [ 1; 2; 3; 4 ] then failwith (sprintf "Expected [1;2;3;4] but got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on Result resolves via SRTP — cross-assembly extrinsic`` () = + let library = + FSharp """ +module ExtLib + +type Result<'T, 'E> with + static member (|>>) (x, f) = Result.map f x + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let result: Result = Ok 5 |>> (fun n -> n * 2) +match result with +| Ok 10 -> () +| other -> failwith (sprintf "Expected Ok 10 but got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on BCL List resolves via SRTP — cross-assembly extrinsic`` () = + let library = + FSharp """ +module ExtLib + +open System.Collections.Generic + +type List<'T> with + static member (++) (a: List<'T>, b: List<'T>) = + let result = List<'T>(a) + result.AddRange(b) + result + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open System.Collections.Generic +open ExtLib + +let a = List([| 1; 2 |]) +let b = List([| 3; 4 |]) +let result = a ++ b +if result.Count <> 4 then failwith (sprintf "Expected count 4 but got %d" result.Count) +if result.[2] <> 3 then failwith (sprintf "Expected result.[2]=3 but got %d" result.[2]) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on user generic type resolves via SRTP — cross-assembly extrinsic`` () = + let library = + FSharp """ +module TypeLib + +type Box<'T> = { Value: 'T } + """ + |> withName "TypeLib" + |> withLangVersionPreview + + let extLib = + FSharp """ +module ExtLib + +open TypeLib + +type Box<'T> with + static member (+) (a: Box<'T>, b: Box<'T>) : Box<'T list> = + { Value = [ a.Value; b.Value ] } + """ + |> withName "ExtLib" + |> withLangVersionPreview + |> withReferences [library] + + FSharp """ +module Consumer + +open TypeLib +open ExtLib + +let a = { Value = 1 } +let b = { Value = 2 } +let result = a + b +if result.Value <> [ 1; 2 ] then failwith (sprintf "Expected [1; 2] but got %A" result.Value) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library; extLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on generic type resolves via SRTP — multi-module same compilation`` () = + FSharp """ +module TypeDef + +type Wrapper<'T> = { Inner: 'T } + +module Extensions = + type Wrapper<'T> with + static member (++) (a: Wrapper<'T>, b: Wrapper<'T>) : Wrapper<'T list> = + { Inner = [ a.Inner; b.Inner ] } + +module Consumer = + open Extensions + + let a: Wrapper = { Inner = 10 } + let b: Wrapper = { Inner = 20 } + let result = a ++ b + if result.Inner <> [ 10; 20 ] then failwith (sprintf "Expected [10; 20] but got %A" result.Inner) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on option resolves via SRTP — cross-assembly with optimization`` () = + let library = optionMapExtLib + + FSharp """ +module Consumer + +open ExtLib + +let result = Some 7 |>> (fun n -> n * 3) +match result with +| Some 21 -> () +| other -> failwith (sprintf "Expected Some 21 but got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> withOptimize + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator with extra type parameter resolves via SRTP — cross-assembly extrinsic`` () = + // The operator body introduces 'U beyond the enclosing type's 'T. + // This exercises the path where method type parameters and enclosing + // type parameters must both be correctly threaded through. + let library = + FSharp """ +module ExtLib + +type Option<'T> with + static member (?>>) (x: Option<'T>, f: 'T -> 'U) : Result<'U, string> = + match x with + | Some v -> Ok (f v) + | None -> Error "was None" + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let r1 = Some 5 ?>> string +match r1 with +| Ok "5" -> () +| other -> failwith (sprintf "Expected Ok \"5\" but got %A" other) + +let r2: Result = None ?>> string +match r2 with +| Error "was None" -> () +| other -> failwith (sprintf "Expected Error \"was None\" but got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator on Map resolves via SRTP — cross-assembly extrinsic`` () = + let library = + FSharp """ +module ExtLib + +type Map<'Key, 'Value when 'Key: comparison> with + static member (++) (a: Map<'Key, 'Value>, b: Map<'Key, 'Value>) = + Map.fold (fun acc k v -> Map.add k v acc) a b + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let a = Map.ofList [ (1, "a"); (2, "b") ] +let b = Map.ofList [ (3, "c") ] +let result = a ++ b +if result.Count <> 3 then failwith (sprintf "Expected count 3 but got %d" result.Count) +if result.[3] <> "c" then failwith (sprintf "Expected result.[3]=\"c\" but got %s" result.[3]) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + // ----------------------------------------------------------------------- + // C#-style extension methods and SRTP + // ----------------------------------------------------------------------- + // C#-style extension methods go through ILMeth (not FSMeth) in the + // compiler. These tests verify that SRTP constraint resolution finds + // C#-style extension methods, generates correct code, and runs correctly. + + [] + let ``C#-style extension on concrete non-generic type resolves via SRTP — int Double`` () = + let csLib = + CSharp """ +namespace CsExt { + public static class IntExtensions { + public static int Double(this int x) { return x * 2; } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open CsExt + +let inline doubleIt (x: ^T) = (^T : (member Double : unit -> int) x) + +let result = doubleIt 21 +if result <> 42 then failwith (sprintf "Expected 42 but got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension on open generic array resolves via SRTP — Append`` () = + let csLib = + CSharp """ +namespace CsExt { + public static class ArrayExtensions { + public static T[] Append(this T[] a, T[] b) { + var result = new T[a.Length + b.Length]; + a.CopyTo(result, 0); + b.CopyTo(result, a.Length); + return result; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open CsExt + +let inline append (a: ^T) (b: int[]) = (^T : (member Append : int[] -> int[]) (a, b)) + +let result = append [|1; 2|] [|3; 4|] +if result <> [|1; 2; 3; 4|] then failwith (sprintf "Expected [|1;2;3;4|] but got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension on unconstrained generic resolves via SRTP — Stringify`` () = + let csLib = + CSharp """ +namespace CsExt { + public static class GenericExtensions { + public static string Stringify(this T value) { + return value != null ? value.ToString() : ""; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open CsExt + +let inline stringify (x: ^T) = (^T : (member Stringify : unit -> string) x) + +let r1 = stringify 42 +if r1 <> "42" then failwith (sprintf "Expected '42' but got '%s'" r1) +let r2 = stringify "hello" +if r2 <> "hello" then failwith (sprintf "Expected 'hello' but got '%s'" r2) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension with multiple type parameters resolves via SRTP — Select`` () = + let csLib = + CSharp """ +using System; +namespace CsExt { + public static class ArrayProjection { + public static TResult[] Select(this TSource[] arr, Func f) { + var result = new TResult[arr.Length]; + for (int i = 0; i < arr.Length; i++) + result[i] = f(arr[i]); + return result; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open System +open CsExt + +let inline select (arr: ^T) (f: Func) = (^T : (member Select : Func -> string[]) (arr, f)) + +let result = select [|1; 2; 3|] (Func(fun x -> string x)) +if result <> [|"1"; "2"; "3"|] then failwith (sprintf "Expected [|1;2;3|] as strings but got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension on nullable value type resolves via SRTP — OrDefault`` () = + let csLib = + CSharp """ +namespace CsExt { + public static class NullableExtensions { + public static T OrDefault(this T? value, T def) where T : struct { + return value ?? def; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open System +open CsExt + +let inline orDefault (x: ^T) (d: int) = (^T : (member OrDefault : int -> int) (x, d)) + +let v1 = Nullable(7) +let r1 = orDefault v1 0 +if r1 <> 7 then failwith (sprintf "Expected 7 but got %d" r1) + +let v2 = Nullable() +let r2 = orDefault v2 99 +if r2 <> 99 then failwith (sprintf "Expected 99 but got %d" r2) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension on reference type resolves via SRTP — Safe on obj`` () = + let csLib = + CSharp """ +namespace CsExt { + public static class ObjectExtensions { + public static string Safe(this object obj) { + return obj != null ? obj.ToString() : "null"; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open CsExt + +let inline safe (x: ^T) = (^T : (member Safe : unit -> string) x) + +let r1 = safe (box 42) +if r1 <> "42" then failwith (sprintf "Expected '42' but got '%s'" r1) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``C#-style extension on concrete generic instantiation resolves via SRTP — List Sum`` () = + let csLib = + CSharp """ +using System.Collections.Generic; +namespace CsExt { + public static class ListExtensions { + public static int Sum(this List list) { + int s = 0; + foreach (var v in list) s += v; + return s; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open System.Collections.Generic +open CsExt + +let inline sum (x: ^T) = (^T : (member Sum : unit -> int) x) + +let list = List([| 10; 20; 30 |]) +let result = sum list +if result <> 60 then failwith (sprintf "Expected 60 but got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + // ---- Adversarial review gap tests ---- + + [] + let ``adversarial — C#-style extension on user-defined struct resolves via SRTP`` () = + let csLib = + CSharp """ +namespace CsExt { + public struct MyVec { + public int X; + public int Y; + public MyVec(int x, int y) { X = x; Y = y; } + } + public static class VecExtensions { + public static int Magnitude(this MyVec v) { return v.X * v.X + v.Y * v.Y; } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp """ +module Consumer + +open CsExt + +let inline mag (v: ^T) = (^T : (member Magnitude : unit -> int) v) + +let r1 = mag (MyVec(3, 4)) +if r1 <> 25 then failwith (sprintf "Expected 25 but got %d" r1) + +let r2 = mag (MyVec(0, 0)) +if r2 <> 0 then failwith (sprintf "Expected 0 but got %d" r2) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed + + [] + let ``adversarial — Extension operator on DU type resolves via SRTP`` () = + FSharp """ +module TestDUExtOp + +type Tree<'T> = Leaf of 'T | Node of Tree<'T> * Tree<'T> + +type Tree<'T> with + static member (+) (a, b) = Node(a, b) + +let inline combine a b = a + b + +let t1 = Leaf 1 +let t2 = Leaf 2 +let t3 = Leaf 3 + +let combined = combine t1 t2 +match combined with +| Node(Leaf 1, Leaf 2) -> () +| other -> failwith (sprintf "Expected Node(Leaf 1, Leaf 2) but got %A" other) + +// Chain: (t1 + t2) + t3 +let chained = combine (combine t1 t2) t3 +match chained with +| Node(Node(Leaf 1, Leaf 2), Leaf 3) -> () +| other -> failwith (sprintf "Expected Node(Node(Leaf 1, Leaf 2), Leaf 3) but got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``adversarial — Mixed built-in + extension constraints in single inline function`` () = + FSharp $""" +module TestMixedOps + +{stringRepeatExtDef} + +let inline mixedOp x y n = (x + y) * n + +let r1 = mixedOp "hello" " world" 2 +if r1 <> "hello worldhello world" then failwith (sprintf "Expected 'hello worldhello world' but got '%%s'" r1) + +let r2 = mixedOp "ab" "cd" 3 +if r2 <> "abcdabcdabcd" then failwith (sprintf "Expected 'abcdabcdabcd' but got '%%s'" r2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``adversarial — non-inline wrapper of SRTP extension operator resolves concretely`` () = + let library = + FSharp $""" +module ExtLib + +{stringRepeatExtDef} + +let inline repeatInline s n = s * n +let repeatConcrete (s: string) (n: int) = repeatInline s n + """ + |> withName "ExtLib" + |> withLangVersionPreview + + FSharp """ +module Consumer + +open ExtLib + +let r1 = repeatConcrete "ab" 3 +if r1 <> "ababab" then failwith (sprintf "Expected 'ababab' but got '%s'" r1) + +let r2 = repeatConcrete "x" 1 +if r2 <> "x" then failwith (sprintf "Expected 'x' but got '%s'" r2) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``adversarial — Extension operator in task CE`` () = + FSharp $""" +module TestTaskCE + +{stringRepeatExtDef} + +let inline repeatStr s n = s * n + +let result = (task {{ return repeatStr "x" 3 }}).Result +if result <> "xxx" then failwith (sprintf "Expected 'xxx' but got '%%s'" result) + +let result2 = (task {{ return repeatStr "ab" 2 }}).Result +if result2 <> "abab" then failwith (sprintf "Expected 'abab' but got '%%s'" result2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``adversarial — Signature file constraining inline SRTP with extension operator`` () = + let fsiSource = """ +module ExtLib + +val repeatStr: s: string -> n: int -> string +""" + let fsSource = $""" +module ExtLib + +{stringRepeatExtDef} + +let inline repeatInline s n = s * n +let repeatStr (s: string) (n: int) : string = repeatInline s n +""" + Fsi fsiSource + |> withAdditionalSourceFile (FsSource fsSource) + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Extension operators across modules in same compilation — non-generic, generic, multi-generic`` () = + FSharp """ +namespace TestNS + +module Types = + type Widget = { Value: int } + type Wrapper<'T> = { Inner: 'T } + type Pair<'K,'V> = { First: 'K; Second: 'V } + +module Ops = + open Types + type Widget with + static member (+) (a: Widget, b: Widget) = { Value = a.Value + b.Value } + type Wrapper<'T> with + static member (++) (a: Wrapper<'T>, b: Wrapper<'T>) = { Inner = a.Inner } + type Pair<'K,'V> with + static member (++) (a: Pair<'K,'V>, b: Pair<'K,'V>) = { First = a.First; Second = b.Second } + +module Consumer = + open Types + open Ops + + let inline add a b = a + b + let inline combine a b = a ++ b + + // Non-generic + let w = add { Value = 10 } { Value = 20 } + if w.Value <> 30 then failwith (sprintf "Expected 30 but got %d" w.Value) + + // Single-generic + let r = combine { Inner = "hello" } { Inner = "world" } + if r.Inner <> "hello" then failwith (sprintf "Expected 'hello' but got '%s'" r.Inner) + + // Multi-generic + let p = combine { First = 1; Second = "a" } { First = 2; Second = "b" } + if p.First <> 1 then failwith (sprintf "Expected 1 but got %d" p.First) + if p.Second <> "b" then failwith (sprintf "Expected 'b' but got '%s'" p.Second) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``FS1215 interacts correctly with warnaserror under different langversions`` () = + // Under langversion:8.0, FS1215 fires → --warnaserror promotes to error + FSharp """ +module Test +type System.String with + static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + """ + |> asLibrary + |> withOptions ["--warnaserror"] + |> compile + |> shouldFail + |> ignore + + // Under langversion:preview, FS1215 is suppressed → --warnaserror has no effect FSharp """ module Test +type System.String with + static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + """ + |> asLibrary + |> withLangVersionPreview + |> withOptions ["--warnaserror"] + |> compile + |> shouldSucceed -let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + [] + let ``Quotation with true extrinsic extension operator is evaluable`` () = + // True optional extension on external type, used cross-assembly + let library = + FSharp """ +module ExtLib +type System.String with + static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + """ + |> asLibrary + |> withLangVersionPreview -[] -let main _ = - let s = toString 123 - if s <> "123" then failwith (sprintf "Expected '123' but got '%s'" s) - 0 + FSharp """ +module Consumer +open ExtLib + +let inline repeatStr (s: ^T) (n: int) = s * n +let result = repeatStr "ab" 3 +if result <> "ababab" then failwith (sprintf "Direct: expected 'ababab' got '%s'" result) """ |> asExe - |> compileExeAndRun + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun |> shouldSucceed - // https://github.com/dotnet/fsharp/issues/8098 [] - let ``Issue 8098 - GetHashCode on int via inline SRTP does not throw NRE`` () = + let ``Extension operator satisfies multi-support SRTP constraint`` () = FSharp """ module Test +type Celsius = { Degrees: float } +type Fahrenheit = { Degrees: float } -let inline getHash (x: ^a) = (^a : (member GetHashCode : unit -> int) x) +type Celsius with + static member op_Implicit (c: Celsius) : Fahrenheit = { Degrees = c.Degrees * 9.0/5.0 + 32.0 } -[] -let main _ = - let h = getHash 42 - if h <> 42 then failwith (sprintf "Expected 42 but got %d" h) - 0 +let inline convert (x: ^T) : ^U = ((^T or ^U) : (static member op_Implicit: ^T -> ^U) x) +let f = convert { Celsius.Degrees = 100.0 } +if abs (f.Degrees - 212.0) > 0.01 then failwith (sprintf "Expected 212 got %f" f.Degrees) """ |> asExe - |> compileExeAndRun + |> withLangVersionPreview + |> compileAndRun |> shouldSucceed - // https://github.com/dotnet/fsharp/issues/8098 [] - let ``Issue 8098 - ToString on custom struct via inline SRTP does not throw NRE`` () = + let ``Recursive inline and active pattern with extension operators`` () = FSharp """ module Test +type Wrapped = { V: int } +module WOps = + type Wrapped with + static member (+) (a: Wrapped, b: Wrapped) = { V = a.V + b.V } + static member get_Zero() : Wrapped = { V = 0 } + +open WOps + +// Active pattern using extension (+) +let inline (|Positive|Zero|Negative|) (x: ^T) = + let z = LanguagePrimitives.GenericZero< ^T> + if x > z then Positive + elif x < z then Negative + else Zero + +// Inline fold using extension (+) and GenericZero +let inline sumList (xs: ^T list) : ^T = + List.fold (fun acc x -> acc + x) LanguagePrimitives.GenericZero< ^T> xs + +let items = [ {V=1}; {V=2}; {V=3} ] +let total = sumList items +if total.V <> 6 then failwith (sprintf "Expected 6 got %d" total.V) + +// Use active pattern with ints to verify it works +match 42 with +| Positive -> () +| _ -> failwith "Expected Positive" + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed -[] -type MyPoint = { X: int; Y: int } + [] + let ``Extension operator produces identical results with and without optimization`` () = + let library = optionMapExtLib + + let consumer = FSharp """ +module Consumer +open ExtLib +let result = Some 7 |>> (fun n -> n * 3) +match result with +| Some 21 -> () +| other -> failwith (sprintf "Expected Some 21 got %A" other) + """ -let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + // With optimization + consumer + |> asExe |> withLangVersionPreview |> withReferences [library] + |> withOptimize |> compileAndRun |> shouldSucceed + |> ignore -[] -let main _ = - let p = { X = 1; Y = 2 } - let s = toString p - if s = null then failwith "Got null" - 0 + // Without optimization + consumer + |> asExe |> withLangVersionPreview |> withReferences [library] + |> withNoOptimize |> compileAndRun |> shouldSucceed + + [] + let ``Unsolvable SRTP on concrete type still produces compile error`` () = + // Verify that calling a non-existent static member on a concrete type fails + FSharp """ +module Test +type Foo = { X: int } +let result : int = Foo.op_Addition({ X = 1 }, { X = 2 }) """ |> asExe - |> compileExeAndRun + |> withLangVersionPreview + |> compile + |> shouldFail + + [] + let ``Witness quotation: C#-style extension on int evaluates in quotation`` () = + // Q4: C#-style extension resolved via SRTP inside <@ @>. + // The quotation must reference the declaring static class (IntExtensions), + // not System.Int32, so that EvaluateQuotation can find the method via reflection. + let csLib = + CSharp + """ +namespace CsExt { + public static class IntExtensions { + public static int Triple(this int x) { return x * 3; } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + + FSharp + """ +module TestQ4 + +open CsExt + +let inline tripleIt (x: ^T) = (^T : (member Triple : unit -> int) x) + +// Direct call — should work (already tested elsewhere) +let direct = tripleIt 7 +if direct <> 21 then failwith (sprintf "Direct: expected 21 got %d" direct) + +// Quotation — the key test +// The quotation preserves the call to the inline wrapper (tripleIt) with +// witness arguments, consistent with how all inline SRTP functions are quoted. +let q = <@ tripleIt 7 @> + +// Evaluate the quotation at runtime via reflection. +// This exercises witness passing: the witness must resolve to +// IntExtensions.Triple (the C#-style extension declaring type), +// not System.Int32, for reflection to find the method. +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> int +if result <> 21 then failwith (sprintf "Quotation eval: expected 21 got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun |> shouldSucceed - // https://github.com/dotnet/fsharp/issues/8098 [] - let ``Issue 8098 - ToString on reference type via inline SRTP still works`` () = + let ``Witness quotation: C#-style extension on array evaluates in quotation`` () = + // Q5: C#-style generic extension on T[] inside <@ @>. + // Tests minst fix-up for unsolved typars AND quotation encoding of + // the generic method type parameter. + let csLib = + CSharp """ +namespace CsExt { + public static class ArrayExtensions { + public static T[] Append(this T[] a, T[] b) { + var result = new T[a.Length + b.Length]; + a.CopyTo(result, 0); + b.CopyTo(result, a.Length); + return result; + } + } +} + """ + |> withCSharpLanguageVersion CSharpLanguageVersion.Preview + |> withName "csLib" + FSharp """ -module Test +module TestQ5 + +open CsExt +open Microsoft.FSharp.Quotations + +let inline append (a: ^T) (b: int[]) = (^T : (member Append : int[] -> int[]) (a, b)) + +// Direct call +let direct = append [|1; 2|] [|3; 4|] +if direct <> [|1; 2; 3; 4|] then failwith (sprintf "Direct: expected [|1;2;3;4|] got %A" direct) + +// Quotation +let q = <@ append [|1; 2|] [|3; 4|] @> + +// Walk the quotation tree to find any MethodInfo referencing ArrayExtensions. +// For inline SRTP functions, the top-level node is CallWithWitnesses to the +// inline wrapper; the resolved extension method appears inside the witness args. +let rec findArrayExtensions (expr: Expr) = + match expr with + | Patterns.Call(_, mi, args) -> + mi.DeclaringType.Name.Contains("ArrayExtensions") || + args |> List.exists findArrayExtensions + | DerivedPatterns.SpecificCall <@ ignore @> _ -> false + | ExprShape.ShapeCombination(_, args) -> + args |> List.exists findArrayExtensions + | ExprShape.ShapeLambda(_, body) -> + findArrayExtensions body + | ExprShape.ShapeVar _ -> false + +if not (findArrayExtensions q) then + // If no ArrayExtensions found as a nested Call, check if top-level is the inline + // wrapper (expected for witness-based quotations). + match q with + | Patterns.Call(_, mi, _) when mi.Name.Contains("append") -> () + | other -> failwith (sprintf "Unexpected quotation shape: %A" other) + +// Evaluate via reflection +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> int[] +if result <> [|1; 2; 3; 4|] then failwith (sprintf "Quotation eval: expected [|1;2;3;4|] got %A" result) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [csLib] + |> compileAndRun + |> shouldSucceed -let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) + [] + let ``Witness quotation: F# extrinsic extension on String cross-assembly evaluates in quotation`` () = + // Q2: Cross-assembly F# extension operator on System.String inside <@ @>. + // FSMethSln path: quotation must find the method on the library module type. + let library = + FSharp + """ +module ExtLib +type System.String with + static member ( * ) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + """ + |> asLibrary + |> withLangVersionPreview -[] -let main _ = - let s = toString "hello" - if s <> "hello" then failwith (sprintf "Expected 'hello' but got '%s'" s) - 0 + FSharp + """ +module Consumer +open ExtLib + +let inline repeatStr (s: ^T) (n: int) = s * n + +// Direct call +let direct = repeatStr "ha" 3 +if direct <> "hahaha" then failwith (sprintf "Direct: expected 'hahaha' got '%s'" direct) + +// Quotation +let q = <@ repeatStr "ha" 3 @> + +// Evaluate via reflection +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> string +if result <> "hahaha" then failwith (sprintf "Quotation eval: expected 'hahaha' got '%s'" result) """ |> asExe - |> compileExeAndRun + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun |> shouldSucceed - // https://github.com/dotnet/fsharp/issues/8098 [] - let ``Issue 8098 - ToString on struct without override via inline SRTP does not throw NRE`` () = + let ``Witness quotation: F# extrinsic extension on Option evaluates in quotation`` () = + // Q3: F# extension operator on Option<'T> inside <@ @>. + // Tests generic type arg instantiation in quotation tree. + let library = optionMapExtLib + FSharp """ -module Test +module Consumer +open ExtLib -[] -type EmptyStruct = - val X: int - new(x) = { X = x } - // No ToString override — inherits Object.ToString() +let inline mapOpt (x: ^T) (f: int -> string) = (^T : (static member (|>>) : ^T * (int -> string) -> string option) (x, f)) -let inline toString (x: ^a) = (^a : (member ToString : unit -> string) x) +// Direct call +let direct = Some 42 |>> (fun n -> string n) +match direct with +| Some "42" -> () +| other -> failwith (sprintf "Direct: expected Some '42' got %A" other) -[] -let main _ = - let s = toString (EmptyStruct(42)) - if s = null then failwith "Got null" - 0 +// Quotation +let q = <@ Some 7 |>> (fun n -> string n) @> + +// Evaluate +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> string option +match result with +| Some "7" -> () +| other -> failwith (sprintf "Quotation eval: expected Some '7' got %A" other) """ |> asExe - |> compileExeAndRun - - // https://github.com/dotnet/fsharp/issues/15987 + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + [] - let ``Issue 15987 - SRTP overload resolution returns correct value for typed argument`` () = + let ``Witness quotation: F# extrinsic extension on generic Box evaluates in quotation`` () = + // Q6: Cross-assembly user-defined generic type with extension operator in quotation. + // Tests type arg instantiation in quotation tree for non-FSharp.Core generic types. + let library = + FSharp + """ +module ExtLib + +type Box<'T> = { Value: 'T } + +type Box<'T> with + static member (++) (a: Box<'T>, b: Box<'T>) = { Value = a.Value } + """ + |> asLibrary + |> withLangVersionPreview + |> withName "ExtLib" + + FSharp + """ +module Consumer +open ExtLib + +let inline merge (a: ^T) (b: ^T) = a ++ b + +// Direct call +let direct = merge { Value = 42 } { Value = 99 } +if direct.Value <> 42 then failwith (sprintf "Direct: expected 42 got %d" direct.Value) + +// Quotation with int instantiation +let q = <@ merge { Value = 42 } { Value = 99 } @> +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> Box +if result.Value <> 42 then failwith (sprintf "Quotation eval int: expected 42 got %d" result.Value) + +// Quotation with string instantiation — verifies type arg varies correctly +let qs = <@ merge { Value = "hello" } { Value = "world" } @> +let resultS = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation qs :?> Box +if resultS.Value <> "hello" then failwith (sprintf "Quotation eval string: expected 'hello' got '%s'" resultS.Value) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: DU extension operator evaluates in quotation`` () = + // Q7: Extension operator on a discriminated union type inside <@ @>. + // Verifies DU types have no special edge cases in quotation encoding. + FSharp + """ +module TestQ7 + +type Tree<'T> = Leaf of 'T | Node of Tree<'T> * Tree<'T> + +type Tree<'T> with + static member (+) (a, b) = Node(a, b) + +let inline combine a b = a + b + +// Direct call +let direct = combine (Leaf 1) (Leaf 2) +match direct with +| Node(Leaf 1, Leaf 2) -> () +| other -> failwith (sprintf "Direct: expected Node(Leaf 1, Leaf 2) got %A" other) + +// Quotation +let q = <@ combine (Leaf 1) (Leaf 2) @> +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> Tree +match result with +| Node(Leaf 1, Leaf 2) -> () +| other -> failwith (sprintf "Quotation eval: expected Node(Leaf 1, Leaf 2) got %A" other) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Witness quotation: ReflectedDefinition with extension operator`` () = + // Q8: [] + extension operator witness. + // Sub-test (a): non-inline [] calling inline SRTP with ext op + // Sub-test (b): verify the reflected definition is retrievable and evaluable FSharp """ -module Test +module TestQ8 -type A = A with - static member ($) (A, a: float ) = 0.0 - static member ($) (A, a: decimal) = 0M - static member ($) (A, a: 't ) = 0 +open Microsoft.FSharp.Quotations -let inline call x = ($) A x +type Widget = { V: int } -// Verify correct overload is selected: float argument should use the float overload -let resultFloat: float = call 42.0 -let resultDecimal: decimal = call 42M -let resultInt: int = call 42 +type Widget with + static member (+) (a: Widget, b: Widget) = { V = a.V + b.V } -if resultFloat <> 0.0 then failwith $"Expected 0.0 but got {resultFloat}" -if resultDecimal <> 0M then failwith $"Expected 0M but got {resultDecimal}" -if resultInt <> 0 then failwith $"Expected 0 but got {resultInt}" -""" +let inline addWidgets a b = a + b + +// Sub-test (a): non-inline [] calling inline SRTP +[] +let addTwoWidgets (a: Widget) (b: Widget) : Widget = addWidgets a b + +// Verify direct execution +let direct = addTwoWidgets { V = 10 } { V = 20 } +if direct.V <> 30 then failwith (sprintf "Direct: expected 30 got %d" direct.V) + +// Sub-test (b): retrieve the reflected definition +match Expr.TryGetReflectedDefinition(typeof.DeclaringType.GetMethod("addTwoWidgets")) with +| Some _ -> () // ReflectedDefinition is retrievable — good +| None -> + // Try alternative: the method might be on the module type + let moduleType = typeof.Assembly.GetTypes() |> Array.find (fun t -> t.Name = "TestQ8") + match Expr.TryGetReflectedDefinition(moduleType.GetMethod("addTwoWidgets")) with + | Some _ -> () // Found it + | None -> failwith "ReflectedDefinition not found for addTwoWidgets" + +// Also verify via quotation +let q = <@ addTwoWidgets { V = 3 } { V = 4 } @> +let result = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation q :?> Widget +if result.V <> 7 then failwith (sprintf "Quotation eval: expected 7 got %d" result.V) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``Extension operator via open type syntax resolves SRTP constraint`` () = + // C1: Verify that 'open type' makes extension operators visible to SRTP. + FSharp """ +module TestOpenType + +type StringOps = + static member (*) (s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + +open type StringOps + +let inline repeat (s: ^T) (n: int) = s * n + +let r1 = repeat "ha" 3 +if r1 <> "hahaha" then failwith (sprintf "Expected 'hahaha' got '%s'" r1) + +let r2 = repeat "x" 5 +if r2 <> "xxxxx" then failwith (sprintf "Expected 'xxxxx' got '%s'" r2) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``F# Extension attribute method resolves via SRTP`` () = + // C2: F#-authored [] attribute method resolved via SRTP. + // Tests that CreateImplFileTraitContext detects F#-compiled [] types. + FSharp + """ +module TestFSharpExtAttr + +open System.Runtime.CompilerServices + +[] +type IntExt = + [] + static member Triple(x: int) = x * 3 + +let inline tripleIt (x: ^T) = (^T : (member Triple : unit -> int) x) + +let result = tripleIt 7 +if result <> 21 then failwith (sprintf "Expected 21 got %d" result) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed + + [] + let ``F# Extension attribute method resolves via SRTP cross-assembly`` () = + let library = + FSharp + """ +module ExtLib + +open System.Runtime.CompilerServices + +[] +type IntExt = + [] + static member Triple(x: int) = x * 3 + """ + |> asLibrary + |> withLangVersionPreview + |> withName "ExtLib" + + FSharp + """ +module Consumer + +open ExtLib +open System.Runtime.CompilerServices + +let inline tripleIt (x: ^T) = (^T : (member Triple : unit -> int) x) + +let result = tripleIt 7 +if result <> 21 then failwith (sprintf "Expected 21 got %d" result) + """ |> asExe + |> withLangVersionPreview + |> withReferences [library] |> compileAndRun |> shouldSucceed + [] + let ``Internal extension from referenced assembly not resolved via SRTP`` () = + // C3: Verify that internal extension members don't leak across assembly boundaries. + // CreateImplFileTraitContext uses AccessibleFromEverywhere but the constraint solver + // must still filter by actual accessibility. + let library = + FSharp + """ +module ExtLib + +module internal InternalExts = + type System.String with + static member Repeat(s: string, n: int) = System.String.Concat(System.Linq.Enumerable.Repeat(s, n)) + """ + |> withLangVersionPreview + |> withName "ExtLib" + + // Without optimization + FSharp + """ +module Consumer +open ExtLib + +let inline repeatStr (s: ^T) (n: int) = (^T : (static member Repeat: ^T * int -> ^T) (s, n)) +let r = repeatStr "ha" 3 + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> withNoOptimize + |> compile + |> shouldFail + |> ignore + + // With optimization — same result expected + FSharp + """ +module Consumer +open ExtLib + +let inline repeatStr (s: ^T) (n: int) = (^T : (static member Repeat: ^T * int -> ^T) (s, n)) +let r = repeatStr "ha" 3 + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> withOptimize + |> compile + |> shouldFail + + [] + let ``Unsolvable SRTP with natural operator syntax produces compile error not runtime NSE`` () = + // C4: Verify that using an operator on a type without that operator + // produces a compile-time error, not a runtime NotSupportedException. + FSharp + """ +module TestC4 + +type Foo = { X: int } + +// No (+) defined on Foo — this must fail at compile time +let r = { X = 1 } + { X = 2 } + """ + |> asExe + |> withLangVersionPreview + |> compile + |> shouldFail + |> withErrorCode 1 + + [] + let ``Previously unsolvable SRTP becomes solvable with extension operator`` () = + // Companion to C4: adding an extension operator makes the previously + // unsolvable SRTP work — no compile error, correct runtime result. + FSharp + """ +module TestC4Fix + +type Foo = { X: int } + +type Foo with + static member (+) (a: Foo, b: Foo) = { X = a.X + b.X } + +let r = { X = 1 } + { X = 2 } +if r.X <> 3 then failwith (sprintf "Expected 3 but got %d" r.X) + """ + |> asExe + |> withLangVersionPreview + |> compileAndRun + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/MemberConstraints.fs b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/MemberConstraints.fs index d9b31531d15..44ab230dac2 100644 --- a/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/MemberConstraints.fs +++ b/tests/FSharp.Compiler.ComponentTests/ConstraintSolver/MemberConstraints.fs @@ -239,3 +239,23 @@ let inline inverse m = """ |> typecheck |> shouldSucceed + + [] + let ``Extension binary operator does not report duplicate candidates`` () = + // Regression test: binary operators with same support type (e.g., list<_>) should not report duplicates + FSharp """ +open FSharp.Core.CompilerServices + +type List<'t> with + static member (<*>) (f: list<'T -> 'U>, x: list<'T>) : list<'U> = + let mutable coll = ListCollector<'U> () + f |> List.iter (fun f -> + x |> List.iter (fun x -> + coll.Add (f x))) + coll.Close () + +let result = [(+)] <*> [1;10] <*> [2;3] +""" + |> withLangVersionPreview + |> typecheck + |> shouldSucceed diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 2e892f803b0..06495d1cc37 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -141,6 +141,7 @@ + @@ -171,6 +172,7 @@ + diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl index c1b468804d5..8e804e0df3b 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.bsl @@ -6792,7 +6792,7 @@ FSharp.Compiler.Syntax.SynByteStringKind: Int32 get_Tag() FSharp.Compiler.Syntax.SynByteStringKind: System.String ToString() FSharp.Compiler.Syntax.SynComponentInfo: Boolean get_preferPostfix() FSharp.Compiler.Syntax.SynComponentInfo: Boolean preferPostfix -FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Syntax.SynComponentInfo NewSynComponentInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident], FSharp.Compiler.Xml.PreXmlDoc, Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) +FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Syntax.SynComponentInfo NewSynComponentInfo(Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls], Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType], FSharp.Compiler.Xml.PreXmlDoc, Boolean, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess], FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Text.Range Range FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Text.Range get_Range() FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Text.Range get_range() @@ -6801,8 +6801,8 @@ FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Xml.PreXmlDoc get_xmlDo FSharp.Compiler.Syntax.SynComponentInfo: FSharp.Compiler.Xml.PreXmlDoc xmlDoc FSharp.Compiler.Syntax.SynComponentInfo: Int32 Tag FSharp.Compiler.Syntax.SynComponentInfo: Int32 get_Tag() -FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] get_longId() -FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] longId +FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] LongIdent +FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.Ident] get_LongIdent() FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] attributes FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynAttributeList] get_attributes() FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Syntax.SynTypeConstraint] constraints @@ -6811,6 +6811,8 @@ FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FS FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynAccess] get_accessibility() FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls] get_typeParams() FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynTyparDecls] typeParams +FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] get_synType() +FSharp.Compiler.Syntax.SynComponentInfo: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType] synType FSharp.Compiler.Syntax.SynComponentInfo: System.String ToString() FSharp.Compiler.Syntax.SynConst+Bool: Boolean Item FSharp.Compiler.Syntax.SynConst+Bool: Boolean get_Item() diff --git a/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs b/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs index 39e38dfd1a1..d6cb91904de 100644 --- a/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs @@ -19,7 +19,8 @@ let internal identsAndRanges (input: ParsedInput) = let identAndRange ident (range: range) = (ident, rangeToTuple range) let extractFromComponentInfo (componentInfo: SynComponentInfo) = - let (SynComponentInfo.SynComponentInfo(_attrs, _typarDecls, _typarConstraints, longIdent, _, _, _, range)) = componentInfo + let (SynComponentInfo.SynComponentInfo(_attrs, _typarDecls, _typarConstraints, _, _, _, _, range)) = componentInfo + let longIdent = componentInfo.LongIdent // TODO : attrs, typarDecls and typarConstraints [identAndRange (longIdentToString longIdent) range] let extractFromTypeDefn (typeDefn: SynTypeDefn) = diff --git a/tests/FSharp.Compiler.Service.Tests/ParsedInputModuleTests.fs b/tests/FSharp.Compiler.Service.Tests/ParsedInputModuleTests.fs index 2ff0eebe32b..a92dbca677e 100644 --- a/tests/FSharp.Compiler.Service.Tests/ParsedInputModuleTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ParsedInputModuleTests.fs @@ -196,8 +196,8 @@ module N = (mkPos 6 28, parseTree) ||> ParsedInput.tryPick (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> - Some(longIdent |> List.map (fun ident -> ident.idText)) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some(compInfo.LongIdent |> List.map (fun ident -> ident.idText)) | _ -> None) Assert.Equal(Some ["N"], ``module``) @@ -218,8 +218,8 @@ module N = (mkPos 7 30, parseTree) ||> ParsedInput.tryPick (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> - Some(longIdent |> List.map (fun ident -> ident.idText)) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some(compInfo.LongIdent |> List.map (fun ident -> ident.idText)) | _ -> None) Assert.Equal(Some ["N"], ``module``) @@ -240,8 +240,8 @@ module N = (mkPos 6 28, parseTree) ||> ParsedInput.tryPickLast (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> - Some(longIdent |> List.map (fun ident -> ident.idText)) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some(compInfo.LongIdent |> List.map (fun ident -> ident.idText)) | _ -> None) Assert.Equal(Some ["P"], ``module``) @@ -262,8 +262,8 @@ module N = (mkPos 7 30, parseTree) ||> ParsedInput.tryPickLast (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> - Some(longIdent |> List.map (fun ident -> ident.idText)) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some(compInfo.LongIdent |> List.map (fun ident -> ident.idText)) | _ -> None) Assert.Equal(Some ["P"], ``module``) @@ -286,7 +286,7 @@ module N = (mkPos 6 28, parseTree) ||> ParsedInput.exists (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = _compInfo)) -> start <- node.Range.StartLine, node.Range.StartColumn true | _ -> false) @@ -312,7 +312,7 @@ module N = (mkPos 7 30, parseTree) ||> ParsedInput.exists (fun _path node -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = _compInfo)) -> start <- node.Range.StartLine, node.Range.StartColumn true | _ -> false) @@ -337,8 +337,8 @@ module N = |> ParsedInput.tryNode (mkPos 6 28) |> Option.bind (fun (node, _path) -> match node with - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> - Some(longIdent |> List.map (fun ident -> ident.idText)) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some(compInfo.LongIdent |> List.map (fun ident -> ident.idText)) | _ -> None) Assert.Equal(Some ["P"], ``module``) @@ -379,9 +379,10 @@ module Q = ([], parseTree) ||> ParsedInput.fold (fun acc _path node -> match node with - | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> + | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) -> (longIdent |> List.map (fun ident -> ident.idText)) :: acc + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + (compInfo.LongIdent |> List.map (fun ident -> ident.idText)) :: acc | _ -> acc) Assert.Equal( @@ -408,9 +409,10 @@ module Q = ([], parseTree) ||> ParsedInput.foldWhile (fun acc _path node -> match node with - | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> + | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) -> Some((longIdent |> List.map (fun ident -> ident.idText)) :: acc) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some((compInfo.LongIdent |> List.map (fun ident -> ident.idText)) :: acc) | _ -> Some acc) Assert.Equal( @@ -439,9 +441,10 @@ module Q = if posGt node.Range.Start (mkPos 7 0) then None else match node with - | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) - | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = SynComponentInfo(longId = longIdent))) -> + | SyntaxNode.SynModuleOrNamespace(SynModuleOrNamespace(longId = longIdent)) -> Some((longIdent |> List.map (fun ident -> ident.idText)) :: acc) + | SyntaxNode.SynModule(SynModuleDecl.NestedModule(moduleInfo = compInfo)) -> + Some((compInfo.LongIdent |> List.map (fun ident -> ident.idText)) :: acc) | _ -> Some acc) Assert.Equal( diff --git a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs index 551bdf02ea2..c65c74f4b4a 100644 --- a/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/ProjectAnalysisTests.fs @@ -3768,9 +3768,6 @@ let ``Test Project25 symbol uses of type-provided members`` () = ("ErasedWithConstructor.Provided.MyType.DoNothing", "file1", ((10, 8), (10, 26)), [ "member" ]) // line 10: let _ = >MyType().DoNothing<() ("TypeProviderTests", "file1", ((2, 7), (2, 24)), [ "module" ]) |] // line 2: module >TypeProviderTests< - printfn "actual =\n%A" allUses - printfn "expected =\n%A" expected - allUses |> shouldBeEqualCollections expected // Verify the DoNothing method can be found and its uses tracked diff --git a/tests/FSharp.Compiler.Service.Tests/Symbols.fs b/tests/FSharp.Compiler.Service.Tests/Symbols.fs index 69bfb70519a..11409e69bac 100644 --- a/tests/FSharp.Compiler.Service.Tests/Symbols.fs +++ b/tests/FSharp.Compiler.Service.Tests/Symbols.fs @@ -1508,3 +1508,94 @@ let result = 1 -.- 2 let rangeLength = range.EndColumn - range.StartColumn Assert.Equal(3, rangeLength) + +module TupleTypeExtensions = + /// Verifies that GetAllUsesOfAllSymbolsInFile returns only symbols from the original source, + /// not synthetic AST nodes created for tuple type extensions like 'type ('T1 * 'T2) with ...'. + [] + let ``Tuple type extension symbols match original source`` () = + let _, checkResults = + getParseAndCheckResults + """ +module Test + +type ('T1 * 'T2) with + member this.Swap() = (snd this, fst this) +""" + + let allSymbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> Seq.toList + + // Get all symbol ranges - none should have synthetic ranges + let symbolRanges = + allSymbolUses + |> List.map (fun su -> su.Symbol.DisplayName, su.Range) + + // Verify no symbols are reported from synthetic ranges + for (name, range) in symbolRanges do + Assert.False(range.IsSynthetic, $"Symbol '{name}' has synthetic range {range}") + + [] + let ``Struct tuple type extension symbols match original source`` () = + let _, checkResults = + getParseAndCheckResults + """ +module Test + +type struct ('T1 * 'T2) with + member this.Swap() = struct (snd this, fst this) +""" + + let allSymbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> Seq.toList + + // Verify no symbols are reported from synthetic ranges + for symbolUse in allSymbolUses do + Assert.False(symbolUse.Range.IsSynthetic, $"Symbol '{symbolUse.Symbol.DisplayName}' has synthetic range {symbolUse.Range}") + + [] + let ``Tuple type extension does not leak tuple type symbol`` () = + let _, checkResults = + getParseAndCheckResults + """ +module Test + +type ('T1 * 'T2) with + member this.First = fst this +""" + + let typeSymbolUses = + checkResults.GetAllUsesOfAllSymbolsInFile() + |> Seq.filter (fun su -> su.Symbol :? FSharpEntity) + |> Seq.map (fun su -> su.Symbol.DisplayName, su.Range.StartLine, su.Range.StartColumn) + |> Seq.toList + + // The only type entity should be 'Test' module, not a synthetic tuple type + let tupleSymbols = + typeSymbolUses + |> List.filter (fun (name, _, _) -> name.Contains("*") || name.Contains("Tuple")) + + Assert.True(List.isEmpty tupleSymbols, $"Found unexpected tuple type symbols: {tupleSymbols}") + + [] + let ``Multiple tuple type extensions symbols are all non-synthetic`` () = + let _, checkResults = + getParseAndCheckResults + """ +module Test + +type ('T1 * 'T2) with + member this.Swap() = (snd this, fst this) + +type struct ('A * 'B * 'C) with + member this.First = let (a, _, _) = this in a +""" + + let allSymbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> Seq.toList + + // All symbols should come from non-synthetic source locations + let syntheticSymbols = + allSymbolUses + |> List.filter (fun su -> su.Range.IsSynthetic) + |> List.map (fun su -> su.Symbol.DisplayName) + + Assert.True(List.isEmpty syntheticSymbols, $"Found symbols with synthetic ranges: {syntheticSymbols}") + 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 5b6cc0bce4e..09ce52a002e 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl @@ -810,6 +810,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() 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 217d4b7c837..71a2dcbfbaa 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl @@ -810,6 +810,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() 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 43defdb622e..d52a2ef3d40 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl @@ -813,6 +813,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() 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 ed913ea04d3..7f41e6c1252 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl @@ -813,6 +813,7 @@ Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) +Microsoft.FSharp.Core.AllowOverloadOnReturnTypeAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index af1f36ca80f..6a8cc9b1c1e 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -2311,3 +2311,19 @@ Actual: /// Run FSC as a subprocess with the given arguments. For CLI-level tests only (missing files, exit codes, etc.). let runFscProcess (args: string list) : ProcessResult = runToolProcess TestFramework.initialConfig.FSC args + + /// Compile-and-run a compilation unit that depends on a FSharp.Core attribute + /// which may not yet be shipped in the SDK's NuGet package. + /// When the attribute is present, compiles and runs expecting success. + /// When absent, expects compilation failure with error 39 (undefined type). + let compileAndRunOrExpectMissingAttribute (fsharpCoreTypeName: string) (cu: CompilationUnit) = + if + not ( + isNull ( + typeof.Assembly.GetType(fsharpCoreTypeName) + ) + ) + then + cu |> compileAndRun |> shouldSucceed |> ignore + else + cu |> compile |> shouldFail |> withErrorCode 39 |> ignore diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index d09896563e5..1735d67fe96 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -392,6 +392,8 @@ module CompilerAssertHelpers = inherit MarshalByRefObject() member x.ExecuteTestCase assemblyPath isFsx = + // Set console streams for the AppDomain. + TestConsole.install() let assembly = Assembly.LoadFrom assemblyPath executeAssemblyEntryPoint assembly isFsx diff --git a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj index cb5f54ad381..8f2bc503f1f 100644 --- a/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj +++ b/tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj @@ -41,6 +41,7 @@ + diff --git a/tests/FSharp.Test.Utilities/TestConsole.fs b/tests/FSharp.Test.Utilities/TestConsole.fs index add9e7e99c6..00f7bf042b5 100644 --- a/tests/FSharp.Test.Utilities/TestConsole.fs +++ b/tests/FSharp.Test.Utilities/TestConsole.fs @@ -20,16 +20,13 @@ module TestConsole = /// Redirects writes performed on different async execution contexts to the relevant TextWriter held by AsyncLocal. type private RedirectingTextWriter() = inherit TextWriter() - let holder = AsyncLocal<_>() - let original = Console.Out + let holder = AsyncLocal<_>() member _.Writer with get() = holder.Value |> ValueOption.defaultValue TextWriter.Null and set v = holder.Value <- ValueSome v override _.Encoding = Encoding.UTF8 - override this.Write(value: char) = - this.Writer.Write(value) - original.Write(value) + override this.Write(value: char) = this.Writer.Write(value) let private localIn = new RedirectingTextReader() let private localOut = new RedirectingTextWriter() diff --git a/tests/FSharp.Test.Utilities/XunitHelpers.fs b/tests/FSharp.Test.Utilities/XunitHelpers.fs new file mode 100644 index 00000000000..e74e8c38f71 --- /dev/null +++ b/tests/FSharp.Test.Utilities/XunitHelpers.fs @@ -0,0 +1,260 @@ +#if XUNIT_EXTRAS +#nowarn "0044" +#endif + +namespace FSharp.Test + +open System +open System.Reflection +open System.Threading.Tasks +open Xunit.Sdk +open Xunit.v3 + +open TestFramework + +open FSharp.Compiler.Caches +open FSharp.Compiler.Diagnostics + +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. +[] +type RunTestCasesInSequenceAttribute() = inherit Attribute() + +// Helper for stress testing. +// Runs a test case many times in parallel. +// Example usage: [] +type StressAttribute([] data: obj array) = + inherit DataAttributeBase() + member val Count = 1 with get, set + override this.GetData(_testMethod: MethodInfo, _disposalTracker: DisposalTracker) = + let results = Seq.init this.Count (fun i -> [| yield! data; yield box i |]) + DataAttributeBase.WrapRows(results) + +#if XUNIT_EXTRAS + +// To use xUnit means to customize it. The following features are added: +// - Internally parallelize test classes and theories. Test cases and theory cases included in a single class or F# module can execute simultaneously +// - Add batch traits for CI multi-agent testing support +// Note: Console output capturing is now handled by xUnit3's built-in [] attribute + +module TestCaseCustomizations = + // Internally parallelize test classes and theories. + // Based on https://www.meziantou.net/parallelize-test-cases-execution-in-xunit.htm + // The trick is to assign a unique test collection to each case. + // Since test collection is xUnit's unit of parallelization, it will execute everything in parallel including theory cases. + let rewriteTestMethod (testCase: ITestCase) : ITestMethod = + let canFullyParallelize = + // does not belong to a defined collection + isNull testCase.TestMethod.TestClass.TestCollection.CollectionDefinition + && testCase.TestMethod.TestClass.Class.GetCustomAttributes(typeof) |> Seq.isEmpty + // is not marked with `[]` attribute + && testCase.TestMethod.Method.GetCustomAttributes(typeof) |> Seq.isEmpty + && testCase.TestMethod.TestClass.Class.GetCustomAttributes(typeof) |> Seq.isEmpty + + if canFullyParallelize then + let oldTestMethod = testCase.TestMethod + let oldTestClass = oldTestMethod.TestClass + let oldTestCollection = oldTestMethod.TestClass.TestCollection + + // Create a DETERMINISTIC collection ID based on the test case's unique ID + // This ensures the same test case always gets the same collection ID + let collectionId = + use sha = System.Security.Cryptography.SHA256.Create() + let bytes = System.Text.Encoding.UTF8.GetBytes(testCase.UniqueID) + let hash = sha.ComputeHash(bytes) + System.Guid(hash.[0..15]) // Take first 16 bytes for GUID + + let newDisplayName = $"{oldTestCollection.DisplayName}_{collectionId:N}" + + // Create a new collection with a unique id for the test case. + let newTestCollection = + new TestCollection( + oldTestCollection.TestAssembly, + oldTestCollection.CollectionDefinition, + newDisplayName, + collectionId + ) + + let newTestClass = new TestClass(newTestCollection, oldTestClass.Class) + TestMethod(newTestClass, oldTestMethod.Method) + 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-trait 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 + // xUnit demands this constructor for deserialization. + new() = { inherit XunitTestCase() } + + new(sink: IMessageSink, md, mdo, testMethod, testMethodArgs) = { inherit XunitTestCase(sink, md, mdo, testMethod, testMethodArgs) } + + // Initialize is ensured by xUnit to run once before any property access. + override testCase.Initialize () = + base.Initialize() + testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase + +type CustomTheoryTestCase = + inherit XunitTheoryTestCase + new() = { inherit XunitTheoryTestCase() } + + new(sink: IMessageSink, md, mdo, testMethod) = { inherit XunitTheoryTestCase(sink, md, mdo, testMethod) } + + override testCase.Initialize () = + base.Initialize() + testCase.TestMethod <- TestCaseCustomizations.rewriteTestMethod testCase + TestCaseCustomizations.addBatchTrait testCase + +#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(ActivityNames.FscSourceName) + .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() + +// In some situations, VS can invoke CreateExecutor and RunTestCases many times during testhost lifetime. +// For example when executing "run until failure" command in Test Explorer. +// However, we want to ensure that OneTimeSetup is called only once per test run. +module OneTimeSetup = + + let init = + lazy + #if !NETCOREAPP + // We need AssemblyResolver already here, because OpenTelemetry loads some assemblies dynamically. + log "Adding AssemblyResolver" + AssemblyResolver.addResolver () + #endif + log $"Server GC enabled: {System.Runtime.GCSettings.IsServerGC}" + log "Installing TestConsole redirection" + TestConsole.install() + + logConfig initialConfig + + let EnsureInitialized() = + // Ensure that the initialization is done only once per test run. + init.Force() + +/// `XunitTestFramework` providing parallel console support and conditionally enabling optional xUnit customizations. +/// NOTE: Temporarily disabled due to xUnit3 API incompatibilities +/// TODO: Reimplement for xUnit3 if OneTimeSetup, OpenTelemetry, or cleanup functionality is needed +(* +type FSharpXunitFramework(sink: IMessageSink) = + inherit XunitTestFramework(sink) + + do OneTimeSetup.EnsureInitialized() + + override this.CreateExecutor (assemblyName) = + { new XunitTestFrameworkExecutor(assemblyName, this.SourceInformationProvider, this.DiagnosticMessageSink) with + + // Because xUnit v2 lacks assembly fixture, this is a good place to ensure things get called right at the start of the test run. + override x.RunTestCases(testCases, executionMessageSink, executionOptions) = + + let testRunName = $"RunTests_{assemblyName.Name} {Runtime.InteropServices.RuntimeInformation.FrameworkDescription}" + + use _ = new OpenTelemetryExport(testRunName, Environment.GetEnvironmentVariable("FSHARP_OTEL_EXPORT") <> null) + + begin + 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 + + cleanUpTemporaryDirectoryOfThisTestRun () + } +*) + +#if XUNIT_EXTRAS + // Rewrites discovered test cases to support extra parallelization and batch trait injection. + override this.CreateDiscoverer (assemblyInfo) = + { new XunitTestFrameworkDiscoverer(assemblyInfo, this.SourceInformationProvider, this.DiagnosticMessageSink) with + override _.FindTestsForType (testClass, includeSourceInformation, messageBus, options) = + // Intercepts test discovery messages to augment test cases with additional capabilities. + let customizingBus = + { new IMessageBus with + member _.QueueMessage (message: IMessageSinkMessage) = + match message with + | :? ITestCaseDiscoveryMessage as discoveryMessage -> + let customized: ITestCase = + match discoveryMessage.TestCase with + | :? XunitTheoryTestCase -> + new CustomTheoryTestCase( + sink, + options.MethodDisplayOrDefault(), + options.MethodDisplayOptionsOrDefault(), + discoveryMessage.TestCase.TestMethod, + SourceInformation = discoveryMessage.TestCase.SourceInformation + ) + | :? XunitTestCase -> + new CustomTestCase( + sink, + options.MethodDisplayOrDefault(), + options.MethodDisplayOptionsOrDefault(), + discoveryMessage.TestCase.TestMethod, + discoveryMessage.TestCase.TestMethodArguments, + SourceInformation = discoveryMessage.TestCase.SourceInformation + ) + | testCase -> testCase + messageBus.QueueMessage(TestCaseDiscoveryMessage customized) + | _ -> + messageBus.QueueMessage message + member _.Dispose () = messageBus.Dispose() } + base.FindTestsForType(testClass, includeSourceInformation, customizingBus, options) + } + +#endif diff --git a/tests/FSharp.Test.Utilities/XunitSetup.fs b/tests/FSharp.Test.Utilities/XunitSetup.fs index 87ebb5436da..93d2b09121e 100644 --- a/tests/FSharp.Test.Utilities/XunitSetup.fs +++ b/tests/FSharp.Test.Utilities/XunitSetup.fs @@ -1,33 +1,40 @@ namespace FSharp.Test -open System open Xunit -open TestFramework -/// xUnit3 assembly fixture: performs one-time setup for the test assembly. -/// Registered via [)>] below. -/// The constructor is called by xUnit once before any tests in the assembly run. -type FSharpTestAssemblyFixture() = - do +// xUnit3 assembly fixtures: ensure TestConsole is installed once per assembly +// This replaces the OneTimeSetup.EnsureInitialized() call that was done in FSharpXunitFramework +module private XUnitInit = + let private ensureInitialized = lazy ( #if !NETCOREAPP - // We need AssemblyResolver already here, because OpenTelemetry loads some assemblies dynamically. - log "Adding AssemblyResolver" + // On .NET Framework, we need the assembly resolver for finding assemblies + // that might be in different locations (e.g., when FSI loads assemblies) AssemblyResolver.addResolver() #endif - log $"Server GC enabled: {Runtime.GCSettings.IsServerGC}" - logConfig initialConfig + TestConsole.install() + ) + + /// Call this to ensure TestConsole is installed. Safe to call multiple times. + let initialize() = ensureInitialized.Force() /// Exclude from parallelization. Execute test cases in sequence and do not run any other collections at the same time. /// see https://github.com/xunit/xunit/issues/1999#issuecomment-522635397 [] type NotThreadSafeResourceCollection() = class end -/// Mark test cases as not safe to run in parallel with other test cases of the same test collection. -/// In case Xunit 3 enables internal parallelization of test collections. -[] -type RunTestCasesInSequenceAttribute() = inherit Attribute() - module XUnitSetup = - [); CaptureConsole; CaptureTrace>] - do () \ No newline at end of file + // NOTE: Custom TestFramework temporarily disabled due to xUnit3 API incompatibilities + // TODO: Reimplement FSharpXunitFramework for xUnit3 if needed + // [] + + // NOTE: CaptureTrace is disabled because it conflicts with TestConsole.ExecutionCapture + // which is used by FSI tests to capture console output. xUnit3's trace capture intercepts + // console output before it can reach TestConsole's redirectors. + // [] + + /// Call this to ensure TestConsole is installed. Safe to call multiple times. + let initialize() = XUnitInit.initialize() + + // Force initialization when module is loaded + do initialize() diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index ab0a033b43f..5020ff5b01d 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -97,6 +97,13 @@ + + + + PreserveNewest + + + diff --git a/tests/fsharp/testconfig.json b/tests/fsharp/testconfig.json new file mode 100644 index 00000000000..e8a53ff9b23 --- /dev/null +++ b/tests/fsharp/testconfig.json @@ -0,0 +1,6 @@ +{ + "xUnit": { + "parallelizeTestCollections": false, + "maxParallelThreads": 1 + } +} diff --git a/tests/projects/CompilerCompat/CompilerCompatApp/Program.fs b/tests/projects/CompilerCompat/CompilerCompatApp/Program.fs index e7bd46a8ed8..9b045345a25 100644 --- a/tests/projects/CompilerCompat/CompilerCompatApp/Program.fs +++ b/tests/projects/CompilerCompat/CompilerCompatApp/Program.fs @@ -68,8 +68,64 @@ let main _argv = printfn "ERROR: Processed result doesn't match expected" 1 else - printfn "SUCCESS: All compiler compatibility tests passed" - 0 + printfn "SUCCESS: Anonymous record tests passed" + + // ---- RFC FS-1043 breaking change compat tests ---- + + // T4a: inline addOne via concrete wrapper + let addOneResult = Library.addOneConcrete 41 + if addOneResult <> 42 then + printfn "ERROR: addOneConcrete 41 = %d, expected 42" addOneResult + 1 + else + printfn "SUCCESS: addOneConcrete test passed" + + // T4b: inline negate via concrete wrapper + let negateResult = Library.negateConcrete 7 + if negateResult <> -7 then + printfn "ERROR: negateConcrete 7 = %d, expected -7" negateResult + 1 + else + printfn "SUCCESS: negateConcrete test passed" + + // T4c: pass concrete wrapper as function value + let applyResult = Library.applyToInt Library.addOneConcrete 41 + if applyResult <> 42 then + printfn "ERROR: applyToInt addOneConcrete 41 = %d, expected 42" applyResult + 1 + else + printfn "SUCCESS: applyToInt test passed" + + // T5: custom type operator via concrete wrapper + let n1 = { Library.V = 3 } + let n2 = { Library.V = 4 } + let numResult = Library.addNumsConcrete n1 n2 + if numResult.V <> 7 then + printfn "ERROR: addNumsConcrete {V=3} {V=4} = {V=%d}, expected {V=7}" numResult.V + 1 + else + printfn "SUCCESS: custom type operator compat test passed" + + // T6: extension operator on StringRep via concrete wrapper + let repeatResult = Library.repeatRepConcrete { Library.Value = "ab" } 3 + if repeatResult.Value <> "ababab" then + printfn "ERROR: repeatRepConcrete {Value=\"ab\"} 3 = \"%s\", expected \"ababab\"" repeatResult.Value + 1 + else + printfn "SUCCESS: extension string repeat compat test passed" + + // T7: extension operator on generic Wrapper via concrete wrapper + let w1 = { Library.Inner = 42 } + let w2 = { Library.Inner = 99 } + let mergeResult = Library.mergeWrappersConcrete w1 w2 + if mergeResult.Inner <> 42 then + printfn "ERROR: mergeWrappersConcrete {Inner=42} {Inner=99} = {Inner=%d}, expected {Inner=42}" mergeResult.Inner + 1 + else + printfn "SUCCESS: extension generic wrapper compat test passed" + + printfn "SUCCESS: All compiler compatibility tests passed" + 0 with ex -> printfn "ERROR: Exception occurred: %s" ex.Message diff --git a/tests/projects/CompilerCompat/CompilerCompatLib/Library.fs b/tests/projects/CompilerCompat/CompilerCompatLib/Library.fs index 625cb787b58..cdc6a5efce1 100644 --- a/tests/projects/CompilerCompat/CompilerCompatLib/Library.fs +++ b/tests/projects/CompilerCompat/CompilerCompatLib/Library.fs @@ -16,6 +16,28 @@ module Library = let processAnonymousRecord (record: {| X: int; Y: string |}) = sprintf "Processed: X=%d, Y=%s" record.X record.Y + // ---- RFC FS-1043 breaking change compat tests ---- + + /// Inline function with operator + literal (T4a) + let inline addOne x = x + 1 + let addOneConcrete (x: int) : int = addOne x + + /// Inline unary negate (T4b) + let inline negate x = -x + let negateConcrete (x: int) : int = negate x + + /// Takes a function int -> int (T4c) + let applyToInt (f: int -> int) (x: int) = f x + + /// Custom type with intrinsic operator (T5) + type Num = { V: int } + with static member (+) (a: Num, b: Num) = { V = a.V + b.V } + + let inline addNums (a: Num) (b: Num) = a + b + let addNumsConcrete (a: Num) (b: Num) : Num = addNums a b + + + /// Type with Sealed attribute for compatibility testing [] type SealedType() = @@ -41,6 +63,36 @@ module Library = [] let reflectedFunction x = x + 1 + // ---- RFC FS-1043 extension operator compat tests ---- + + /// Type with NO intrinsic operators + type StringRep = { Value: string } + + /// Extension operator on StringRep: repeat via (<*>) + type StringRep with + static member (<*>) (s: StringRep, n: int) = + { Value = System.String.Concat(System.Linq.Enumerable.Repeat(s.Value, n)) } + + /// Inline SRTP function using the extension operator + let inline repeatRep (s: ^T) (n: int) = + (^T : (static member (<*>) : ^T * int -> ^T) (s, n)) + + /// Concrete wrapper (extension resolved at definition time) + let repeatRepConcrete (s: StringRep) (n: int) : StringRep = repeatRep s n + + /// Extension operator on generic Wrapper + type Wrapper<'T> = { Inner: 'T } + + type Wrapper<'T> with + static member (++) (a: Wrapper<'T>, b: Wrapper<'T>) = { Inner = a.Inner } + + /// Inline SRTP function using generic extension operator + let inline mergeWrappers (a: ^T) (b: ^T) = + (^T : (static member (++) : ^T * ^T -> ^T) (a, b)) + + /// Concrete wrapper + let mergeWrappersConcrete (a: Wrapper) (b: Wrapper) : Wrapper = mergeWrappers a b + /// Literal string used as an attribute argument. /// Tests that Expr.Val in AttribExpr.source pickles/unpickles across compiler versions. [] diff --git a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl index 92d2ae4ebfc..c758a86713b 100644 --- a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl index f53b47a4eaa..2dfabf99037 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Tiger], + ([], None, [], + Some (LongIdent (SynLongIdent ([Tiger], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,10)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl index dde24f9afc2..ca69c6c240f 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl @@ -11,7 +11,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Tiger], + ([], None, [], + Some (LongIdent (SynLongIdent ([Tiger], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,10)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl index 3a657b48cb7..4ddbaa30a1e 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Bird], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bird], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,9)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl index 566cba41a61..97c89e14126 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl index cd43cce87f7..18f70db4737 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl index ff220a2a034..c00e7097438 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl index 8698f8ddc7c..7178d68817c 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl @@ -11,7 +11,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Crane], + ([], None, [], + Some (LongIdent (SynLongIdent ([Crane], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,10)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl index 0a48a4272fc..5aa125fd7d2 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl index c8eb3a32a50..259eb13eb23 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl index 431946b6f94..168eca913f5 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl index 72ee28c403d..50c20b95c78 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl index 65b7c6c556f..3e471588201 100644 --- a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl index ca80ebf45a9..4deed6349cd 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl index 4ac684664e3..38541f77791 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl index ce9e69a010f..e4c4f935534 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl @@ -14,7 +14,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,15) }] - Range = (2,0--2,17) }], None, [], [CFoo], + Range = (2,0--2,17) }], None, [], + Some (LongIdent (SynLongIdent ([CFoo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,9)), ObjectModel 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 d8ac768d36b..e996b5af927 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl index 34aa70d3379..6d2191eea5c 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl index 9f3ccbf040b..9af612b5345 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl index b8ef7219487..287100699ed 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl index 028585bc0b5..b96259d7a68 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl index 14ae9d51f17..9d60b2ad605 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl index 74f4d74b17e..a85b8c10cb2 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl index 3d161da52e3..971972fc3ae 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl index d9ba80b80df..e6a59818d36 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl index ebc374d1432..78b57f37728 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl index f9d0ec25562..2fa60d32554 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [D], + ([], None, [], + Some (LongIdent (SynLongIdent ([D], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl index 837e1b368fd..4e82f7ef281 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl index e75b4c25218..896220cd85b 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl index 73e5a522b4b..18f0590e32f 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl index ef71149048c..c68a084b8c1 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl index 5251188440d..bf25e29828d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl index 541b6f582a9..ca51015d681 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl index feb33135568..e812c614c83 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl index 47aa7f74ac2..fea9afcef7f 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl index 111c2ac7565..b0b94b84629 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl index 33675b1a3a1..90fe1dbc0b7 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl @@ -13,7 +13,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,9) }] - Range = (2,0--2,11) }], None, [], [X], + Range = (2,0--2,11) }], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,17--2,18)), Simple diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl index fc29ce7d7e1..7f4d3c9853b 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl @@ -13,7 +13,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,9) }] - Range = (2,0--2,11) }], None, [], [X], + Range = (2,0--2,11) }], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,17--2,18)), Simple diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl index 6e423837385..293eb756779 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl @@ -13,7 +13,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,9) }] - Range = (2,0--2,11) }], None, [], [R], + Range = (2,0--2,11) }], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,17--2,18)), Simple 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 20e86102317..797ef6345e7 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 c78f3040f42..a6d539aa1a2 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 cff1499dca4..b3540e4aa57 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 a208af54581..2723ab38fc4 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 6ad8da57115..0c47f66fcac 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 7490cf06b8e..6937f6658e0 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 cd6d84a1903..1ab6fea31cd 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 499e1c4c6ec..aa968f3afc6 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 c57b6c5faad..85582276600 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 6ae271aaa1a..a279226c6cb 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 4e0c9d821ae..56b2058d9d2 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 920e5a36916..c7048c15714 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 c758fcae4a9..c7fc41f6754 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 70796107bed..ab94a305a40 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 ba04b1a3de7..56eb2fb6fb6 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 dfd6e2fff03..0bf2cc8a278 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 80e694f5424..0a7ce7bf4f8 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 d6522b75532..b984147e1c8 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 ba44d47b0c0..63d3a3258ab 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 6e0b861b01e..53931304e57 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl index 0706eb256c4..df3f2f2c108 100644 --- a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl index e2d791b5860..e713579a438 100644 --- a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl index eb75b56a51d..4a65a338ba8 100644 --- a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl index 2c6ac32e12e..e7467a33a7a 100644 --- a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl index 517082e1e06..64bdd3552ac 100644 --- a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl index 874473c1059..8df010895d7 100644 --- a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl index b2663b51b18..6755702bbff 100644 --- a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl index 878fc8647bd..1704a777767 100644 --- a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl index 80f5a737513..ccd715dae6e 100644 --- a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl index 3c29ce9e5ab..6b0a3c07d1f 100644 --- a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl index 9d652142213..93a22f9a8db 100644 --- a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl index 77a967f379a..cd906f887e0 100644 --- a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl index 4f9de01f3a6..b65f633d824 100644 --- a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl index fa1e21bf3e1..17efda74ff7 100644 --- a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl index e62fa49126b..122c2a82a26 100644 --- a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl index 54f58854119..0803664bb0f 100644 --- a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl index 86fcb6cd48d..11b88a6ad59 100644 --- a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl index 4873d37e961..3e5ae5cf022 100644 --- a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl index 62e1ee5046f..846a2b09f41 100644 --- a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl index 9e5a4d2c4b8..f5f93abd7ab 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl index f09cb92e147..0316ca4e994 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel 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 72f6fee4eb6..dbf7cd83859 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 567a68b336c..405997e4013 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 26a281bd317..d595bc0b9e5 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 e1f3b5fa319..beb1359746a 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 7a2f7aff28c..512b00b5665 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 2f79bcc5830..6c98100f452 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 5d8f26d1d61..b2c27970695 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 ab62149eaf0..144d9796ec5 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 d96ff30cc94..367a94788ec 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 fcf88aa59ce..5c594d54a9d 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 6e2a0109f5c..720bcd9c4ca 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 b7193884014..e9af475786f 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 8d6e7c19f5b..9e81585cccc 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 810cb8303f7..ce102030043 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 11c7411ee8b..8c73ad2ea1d 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl index 06e7e3f9fdc..b9c38f06ac6 100644 --- a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl @@ -7,7 +7,10 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [CompilerStateCache], + ([], None, [], + Some + (LongIdent + (SynLongIdent ([CompilerStateCache], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, Some (Internal (2,5--2,13)), (2,14--2,32)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl index 16618257bdd..63fb5b9acb5 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl index 80da2bd45fd..a241f7d20e9 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T1], + ([], None, [], + Some (LongIdent (SynLongIdent ([T1], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,7)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl index 7b476b67650..7f6bce86edb 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl index e502b24ef0c..e6427cd6b6d 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl index d006bbe9099..3cd89205431 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl index 04d00187693..1d0517359e8 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl index 2c6af3b87ee..ad99eea8ef7 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl index d75196d3f26..95a79c82d27 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl index c99c2599dfd..c5adcca9631 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl index 7d67643e0fa..5a7840fb790 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl index 0f0731b660c..6521824e6e6 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl index af0e0006af0..6b78c398023 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel @@ -20,7 +21,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T2], + ([], None, [], + Some (LongIdent (SynLongIdent ([T2], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,7)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl index 04592eb93d6..2e2a55e9ac1 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl index 2552febe621..a8628d8ecf2 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl index 03171bf375d..97322f407bb 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl index ce5ae85345f..fa9168e966d 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl index cbea58a540b..d3bb7167aad 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel @@ -20,7 +21,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T2], + ([], None, [], + Some (LongIdent (SynLongIdent ([T2], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,7)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl index 76edb4cdbf1..c1c7ad7b8f4 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel @@ -20,7 +21,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T2], + ([], None, [], + Some (LongIdent (SynLongIdent ([T2], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,7)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl index 88576ca7ceb..de1257946da 100644 --- a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl index 00844e3bd36..621ee6127b9 100644 --- a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl index c7da3208795..7934d529120 100644 --- a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl index 8fb32af3ac8..d6706a7684f 100644 --- a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl index 9426e515461..91a1e31741c 100644 --- a/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), ObjectModel 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 7efcd1a8341..c5bb5990cf7 100644 --- a/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 4cbba8169f3..a6aadb06b86 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl index e6ca39bf5f5..a5fa19532b7 100644 --- a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl index af9957edb7b..c7790316a4d 100644 --- a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl index a7baa985888..dad99508ddf 100644 --- a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl index 5b11990bd32..3b2fe30af3f 100644 --- a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl index 9f480a45c60..8b0d1d59d8f 100644 --- a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl index e33344ba3e9..21f0d4c9c85 100644 --- a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl index c919ab5a29d..16429b6916b 100644 --- a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl index 2f1415319fd..e8aa5065b6e 100644 --- a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl @@ -15,7 +15,9 @@ ImplFile SynTyparDecl ([], SynTypar (Measure, None, false), [], { AmpersandRanges = [] })], [], (3,17--3,30))), - [], [INumericNorm], + [], + Some + (LongIdent (SynLongIdent ([INumericNorm], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (3,5--3,17)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl index a9104d2dfb0..1c176e8f856 100644 --- a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl index b30067d371f..9d9b28e6a5b 100644 --- a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl index eb37ddf77d9..317090ffd98 100644 --- a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl index 33eac2d6efd..299bf6fb466 100644 --- a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl index bb146d2a2ba..a193c595abf 100644 --- a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel @@ -45,7 +46,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,6)), Simple diff --git a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl index dcd3bb70c91..cea24c9b6d2 100644 --- a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Seq], + ([], None, [], + Some (LongIdent (SynLongIdent ([Seq], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl index 65401553b8f..72e50a483c2 100644 --- a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 94e0c06897d..2b14c1b775f 100644 --- a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 110af6cd16c..952ebfa13cd 100644 --- a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -11,7 +11,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl index c257b90f316..3d3f8796551 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl index 6be357ee2c4..87952c90a4a 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index c5bf35a6c4e..c9268e63fbb 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl index 5a7647188b2..5b6638fdab2 100644 --- a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl index d339245331b..8c203848395 100644 --- a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl index 68d1466b47a..593bd4824d5 100644 --- a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index 4838003cfc0..65ecd1cea83 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 3009a787588..03e059f863f 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Person], + ([], None, [], + Some (LongIdent (SynLongIdent ([Person], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,11)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index f437240766a..ce44eb64c71 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl index cf045eeca1f..3320f71b017 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl index 97c59244fb9..4e8085e2b1e 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl index 7277f5e58c2..01eb0da2441 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 70bb20dca39..b6da1782f70 100644 --- a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl index bbc45fd79ae..5228b6d4db2 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl index 2f12d930aa0..cefd2508db5 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl index ddf52181d1c..5dbe9a61452 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl @@ -8,7 +8,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl index e697a34ef5b..9b61905a233 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl index 943f383f438..41b4aeeb2b6 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl @@ -9,7 +9,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,6)), Simple diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl index da840787205..546bf4d95c3 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl @@ -18,7 +18,7 @@ ImplFile SynTyparDecl ([], SynTypar (b, None, false), [], { AmpersandRanges = [] })], [], (5,8--5,16))), [], - [Teq], + Some (LongIdent (SynLongIdent ([Teq], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (5,5--5,8)), Simple (None (5,5--5,8), (5,5--5,8)), [], None, (4,0--5,8), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl index 34dfdc36a77..7e2ac4517da 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl @@ -8,7 +8,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,6)), Simple diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl index adb907aea72..36f1072e5ff 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl @@ -27,7 +27,9 @@ ImplFile (10,5--10,33)), (10,0--10,33)); NestedModule (SynComponentInfo - ([], None, [], [SynExprAppLocationsImpl], + ([], None, [], + Some + (LongIdent (SynLongIdent ([SynExprAppLocationsImpl], [], []))), PreXmlDoc ((12,0), FSharp.Compiler.Xml.XmlDocCollector), false, Some (Internal (12,7--12,15)), (12,0--12,39)), false, [Let diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl index e014e4eee8b..a35daf7b626 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Teq], + ([], None, [], + Some (LongIdent (SynLongIdent ([Teq], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,8)), ObjectModel (Class, [], (5,11--5,20)), [], None, (4,0--5,20), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl index 4afb0f52f03..00c33a21f88 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl index 62ec379c8c3..b1660c02f6f 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Foo], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], Some (LongIdent (SynLongIdent ([Bar], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,10)), false, [Let 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 e12ac1da401..b2ff4a76ff1 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [Expr (Const (Unit, (4,4--4,6)), (4,4--4,6))], false, (3,0--4,6), 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 9724fa99d55..df7f53d585a 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) 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 a37acb38fda..7633ce4d395 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) 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 94a68e469af..5f2d93bfd30 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--5,0)), false, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) 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 2b38fecef1e..4a4ad7130b7 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--5,0)), true, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) 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 92a0fd598cf..03eab90c922 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,12)), true, [], false, (3,0--3,12), { ModuleKeyword = Some (3,0--3,6) 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 bf4b8207050..d9dedd7f1e2 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl @@ -6,12 +6,12 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,4--6,0)), false, [], false, (4,4--6,0), { ModuleKeyword = Some (4,4--4,10) 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 f2411c2682b..6772acd4c28 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl @@ -6,12 +6,12 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [NestedModule (SynComponentInfo - ([], None, [], [B], + ([], None, [], Some (LongIdent (SynLongIdent ([B], [], []))), PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,4--4,12)), false, [], false, (4,4--4,12), { ModuleKeyword = Some (4,4--4,10) 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 c4e7b8b3451..804f34a30f6 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl @@ -6,12 +6,12 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [NestedModule (SynComponentInfo - ([], None, [], [B], + ([], None, [], Some (LongIdent (SynLongIdent ([B], [], []))), PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,4--4,12)), false, [], false, (4,4--4,14), { ModuleKeyword = Some (4,4--4,10) 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 9cf96516449..cb8b089124b 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl @@ -6,12 +6,12 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,4--6,4)), false, [], false, (4,4--6,4), { ModuleKeyword = Some (4,4--4,10) 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 135e3df2d10..73b324eadca 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--5,0)), false, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) 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 7d45479cb57..cb15aef287b 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--4,0)), false, [], false, (3,0--4,0), { ModuleKeyword = Some (3,0--3,6) 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 96edfc00dee..18788e7d24d 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) 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 d79064e294f..dbb71b3fdc7 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) 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 f837a3cf675..fd605fa7579 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Ns], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) 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 c7401f2e650..7ef9898f101 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Ns], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) 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 c48299a6150..23f3d82c21a 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([Ns], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [], + ([], None, [], Some (LongIdent (SynLongIdent ([], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--4,0)), false, [], false, (3,0--4,0), { ModuleKeyword = Some (3,0--3,6) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl index 785521f5d0d..2154ae2194a 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,8)), Simple diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl index fbd3308bd1f..935263358ce 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl @@ -13,13 +13,14 @@ SigFile (4,5--4,16)), (4,0--4,16)); ModuleAbbrev (A, [B], (6,0--6,12)); NestedModule (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], Some (LongIdent (SynLongIdent ([Bar], [], []))), PreXmlDoc ((8,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,0--8,10)), false, [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [a], + ([], None, [], + Some (LongIdent (SynLongIdent ([a], [], [None]))), PreXmlDoc ((9,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (9,9--9,10)), Simple 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 33b397cbffe..0ea43531228 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([Foo], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], Some (LongIdent (SynLongIdent ([Bar], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,10)), false, [Val 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 a987306bfc6..1cc264bfb4b 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([Module], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [Val diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl index 46bc6ef7b84..3e68f3f3ddd 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,8)), Simple diff --git a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl index dd1fced8df7..e24b4b322cf 100644 --- a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([A; B], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl index 2cbc6fa5c0a..fbd7d44b5e0 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([X], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Y], + ([], None, [], Some (LongIdent (SynLongIdent ([Y], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [Let diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl index ca093b12f75..4e40da5d4e9 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([X], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Y], + ([], None, [], Some (LongIdent (SynLongIdent ([Y], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [Val @@ -23,7 +23,8 @@ SigFile Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,13--6,14)), Simple diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl index 8538ab3d4cc..6fae62512d3 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl @@ -11,7 +11,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (4,2--4,5) }] - Range = (4,0--4,7) }], None, [], [Nested], + Range = (4,0--4,7) }], None, [], + Some (LongIdent (SynLongIdent ([Nested], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,0--5,13)), false, [Expr (Const (Unit, (6,4--6,6)), (6,4--6,6))], false, (4,0--6,6), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl index eaac7dbed8e..7fe35b89327 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl @@ -12,7 +12,8 @@ SigFile Target = None AppliesToGetterAndSetter = false Range = (4,2--4,5) }] - Range = (4,0--4,7) }], None, [], [Nested], + Range = (4,0--4,7) }], None, [], + Some (LongIdent (SynLongIdent ([Nested], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,0--5,13)), false, [Val diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl index dfecd0d9c4d..be4b4a8a5e3 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([X], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Y], + ([], None, [], Some (LongIdent (SynLongIdent ([Y], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], false, (3,0--4,13), { ModuleKeyword = Some (3,0--3,6) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl index 1e08843a84a..43a940462e5 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([X], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [Y], + ([], None, [], Some (LongIdent (SynLongIdent ([Y], [], []))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,0--3,8)), false, [], (3,0--4,13), { ModuleKeyword = Some (3,0--3,6) diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl index 5b493568519..5e5612278a8 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([RangeOfEqualSignShouldBePresent], false, AnonModule, [NestedModule (SynComponentInfo - ([], None, [], [X], + ([], None, [], Some (LongIdent (SynLongIdent ([X], [], []))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,0--2,8)), false, [Expr (Const (Unit, (3,4--3,6)), (3,4--3,6))], false, (2,0--3,6), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl index 627b1b608b9..b07c77ed59c 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl @@ -6,7 +6,7 @@ SigFile ([Foo], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [X], + ([], None, [], Some (LongIdent (SynLongIdent ([X], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,0--4,8)), false, [Val diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl index fc0b13845c2..674553909af 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl @@ -31,7 +31,7 @@ SigFile (8,5--8,23)), (8,0--8,23)); NestedModule (SynComponentInfo - ([], None, [], [Tuple], + ([], None, [], Some (LongIdent (SynLongIdent ([Tuple], [], []))), PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (11,0--11,12)), false, [Types @@ -52,7 +52,8 @@ SigFile SynTyparDecl ([], SynTypar (T4, None, false), [], { AmpersandRanges = [] })], [], - (13,14--13,31))), [], [Tuple], + (13,14--13,31))), [], + Some (LongIdent (SynLongIdent ([Tuple], [], [None]))), PreXmlDoc ((13,4), FSharp.Compiler.Xml.XmlDocCollector), true, None, (13,9--13,14)), ObjectModel @@ -224,7 +225,8 @@ SigFile EqualsRange = Some (11,13--11,14) }); NestedModule (SynComponentInfo - ([], None, [], [Choice], + ([], None, [], + Some (LongIdent (SynLongIdent ([Choice], [], []))), PreXmlDoc ((24,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (24,0--24,13)), false, [Types @@ -280,7 +282,8 @@ SigFile SynTyparDecl ([], SynTypar (T6, None, false), [], { AmpersandRanges = [] })], [], - (29,15--29,40))), [], [Choice], + (29,15--29,40))), [], + Some (LongIdent (SynLongIdent ([Choice], [], [None]))), PreXmlDoc ((27,4), FSharp.Compiler.Xml.XmlDocCollector), true, None, (29,9--29,15)), Simple @@ -390,7 +393,8 @@ SigFile Target = None AppliesToGetterAndSetter = false Range = (46,2--46,10) }] - Range = (46,0--46,12) }], None, [], [Operators], + Range = (46,0--46,12) }], None, [], + Some (LongIdent (SynLongIdent ([Operators], [], []))), PreXmlDoc ((46,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (47,0--47,16)), false, [Types @@ -402,7 +406,8 @@ SigFile ([SynTyparDecl ([], SynTypar (T, None, false), [], { AmpersandRanges = [] })], [], - (49,16--49,20))), [], [[,]], + (49,16--49,20))), [], + Some (LongIdent (SynLongIdent ([[,]], [], [None]))), PreXmlDoc ((49,4), FSharp.Compiler.Xml.XmlDocCollector), true, None, (49,9--49,16)), Simple (None (49,9--61,26), (49,9--61,26)), diff --git a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl index d544fd6cd7b..4192c0cf4b3 100644 --- a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl @@ -14,7 +14,9 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (1,2--1,15) }] - Range = (1,0--1,17) }], None, [], [AbstractBase], + Range = (1,0--1,17) }], None, [], + Some + (LongIdent (SynLongIdent ([AbstractBase], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,17)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl index 13161fa49f4..b9cb707e07d 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [DU], + ([], None, [], + Some (LongIdent (SynLongIdent ([DU], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,7)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl index 51050a8e198..d45d134b922 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [DU], + ([], None, [], + Some (LongIdent (SynLongIdent ([DU], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,7)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl index 8626a3204af..ee855e9de97 100644 --- a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyStruct], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyStruct], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,13)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl index 2e217784614..f7ee1d62ecc 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl @@ -17,7 +17,8 @@ ImplFile (SynTypar (T, None, false), (1,15--1,27), { ColonRange = (1,17--1,18) NotRange = (1,19--1,22) })], (1,6--1,28))), [], - [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + Some (LongIdent (SynLongIdent ([C], [], [None]))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,6)), ObjectModel (Class, [], (1,31--1,40)), [], None, (1,5--1,40), { LeadingKeyword = Type (1,0--1,4) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl index 4f47caa397c..da11437e35f 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl @@ -19,7 +19,8 @@ ImplFile NotRange = (1,19--1,22) }); WhereTyparIsEquatable (SynTypar (T, None, false), (1,32--1,43))], - (1,6--1,44))), [], [C], + (1,6--1,44))), [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,6)), ObjectModel (Class, [], (1,47--1,56)), [], None, (1,5--1,56), 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 0ea0210a109..2d2056c2a59 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 @@ -20,7 +20,8 @@ ImplFile (SynTypar (T, None, false), (1,15--1,29)); WhereTyparIsEquatable (SynTypar (T, None, false), (1,34--1,45))], - (1,6--1,46))), [], [C], + (1,6--1,46))), [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,6)), ObjectModel (Class, [], (1,49--1,58)), [], None, (1,5--1,58), diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl index 59936ebce22..941b596c6da 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl @@ -15,7 +15,8 @@ ImplFile { AmpersandRanges = [] })], [WhereTyparSupportsNull (SynTypar (T, None, false), (1,15--1,23))], - (1,6--1,24))), [], [C], + (1,6--1,24))), [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,6)), ObjectModel (Class, [], (1,27--1,36)), [], None, (1,5--1,36), diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl index 59b59562625..0e0779af378 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl @@ -19,7 +19,8 @@ ImplFile (SynTypar (T, None, false), (1,31--1,43), { ColonRange = (1,33--1,34) NotRange = (1,35--1,38) })], (1,6--1,44))), [], - [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + Some (LongIdent (SynLongIdent ([C], [], [None]))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,6)), ObjectModel (Class, [], (1,47--1,56)), [], None, (1,5--1,56), { LeadingKeyword = Type (1,0--1,4) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl index 79d2dfce12c..3cfb91b5149 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl @@ -16,7 +16,8 @@ ImplFile SynTyparDecl ([], SynTypar (T2, None, false), [], { AmpersandRanges = [] })], [], (1,13--1,22))), - [], [MyChoice], + [], + Some (LongIdent (SynLongIdent ([MyChoice], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,13)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl index 749078efa17..aa011a630cd 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl @@ -13,7 +13,7 @@ ImplFile ([SynTyparDecl ([], SynTypar (T, None, false), [], { AmpersandRanges = [] })], [], (1,9--1,13))), [], - [List], + Some (LongIdent (SynLongIdent ([List], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,9)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl index 8d6a085bc09..38f3013a884 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl @@ -7,7 +7,9 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyFlatOption], + ([], None, [], + Some + (LongIdent (SynLongIdent ([MyFlatOption], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,17)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl index 502b1ba39e7..30751b58837 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl @@ -13,7 +13,7 @@ ImplFile ([SynTyparDecl ([], SynTypar (T, None, false), [], { AmpersandRanges = [] })], [], (1,11--1,15))), - [], [Option], + [], Some (LongIdent (SynLongIdent ([Option], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,5--1,11)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl index e7de7e51e35..7483af00ab8 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl @@ -16,7 +16,8 @@ ImplFile SynTyparDecl ([], SynTypar (TError, None, false), [], { AmpersandRanges = [] })], [], (1,17--1,29))), - [], [MyResult], + [], + Some (LongIdent (SynLongIdent ([MyResult], [], [None]))), PreXmlDoc ((1,4), FSharp.Compiler.Xml.XmlDocCollector), true, None, (1,9--1,17)), Simple diff --git a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl index 317752b3425..9901a41ab81 100644 --- a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl @@ -7,7 +7,9 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClassBase1], + ([], None, [], + Some + (LongIdent (SynLongIdent ([MyClassBase1], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,17)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl index 20af4b08c2e..c624f136846 100644 --- a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl @@ -7,7 +7,9 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyFlatOption], + ([], None, [], + Some + (LongIdent (SynLongIdent ([MyFlatOption], [], [None]))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,5--1,17)), Simple diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl index faa01ee9c32..d509cffa217 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl index 6a073559389..8533edc0699 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl index 5137e642c9a..eb67f1dad3e 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel (Augmentation (2,7--2,11), [], (2,5--3,28)), diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl index a27b46c979c..85a69ab09b1 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl index 2a904b29554..aa62a5fcfe0 100644 --- a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), Simple @@ -19,7 +20,8 @@ SigFile WithKeyword = None }); SynTypeDefnSig (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,4--3,5)), Simple diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index de5ad0828c3..662fa4bf1fe 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl index b509927045c..c60d78a34ca 100644 --- a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel @@ -15,7 +16,8 @@ SigFile [NestedType (SynTypeDefnSig (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((3,16), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,16--3,17)), ObjectModel (Class, [], (4,20--5,23)), [], diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl index e73e3ca6fee..0f4152e236f 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl @@ -13,7 +13,8 @@ SigFile Target = None AppliesToGetterAndSetter = false Range = (4,2--4,6) }] - Range = (4,0--4,8) }], None, [], [MyType], + Range = (4,0--4,8) }], None, [], + Some (LongIdent (SynLongIdent ([MyType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,11)), ObjectModel (Class, [], (6,4--7,7)), [], (4,0--7,7), diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl index 101ec260450..106df5a91e2 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [FooType], + ([], None, [], + Some (LongIdent (SynLongIdent ([FooType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl index af1c383c20c..269c23c691a 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,8)), Simple @@ -30,7 +31,8 @@ SigFile Target = None AppliesToGetterAndSetter = false Range = (7,6--7,20) }] - Range = (7,4--7,22) }], None, [], [Bang], + Range = (7,4--7,22) }], None, [], + Some (LongIdent (SynLongIdent ([Bang], [], [None]))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,23--7,27)), Simple diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl index a38d43e98c3..a201f76d4b6 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [MyFunction], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyFunction], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,15)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl index cce6edadb6d..ef04bbe3602 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [MyRecord], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyRecord], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,13)), ObjectModel (Class, [], (4,4--5,7)), diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl index bcbb3398842..e03d11b817c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [MyRecord], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyRecord], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,13)), Simple diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl index 6b584fc5717..c7a0197e98b 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl @@ -7,7 +7,9 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [SomeCollection], + ([], None, [], + Some + (LongIdent (SynLongIdent ([SomeCollection], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,19)), Simple (None (3,5--5,37), (3,5--5,37)), diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl index 92a00ceca6b..8dfd8ce65b7 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Meh], + ([], None, [], + Some (LongIdent (SynLongIdent ([Meh], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,8)), ObjectModel (Class, [], (5,8--6,11)), [], (4,5--6,11), diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl index 313b1d493a0..3971346ac76 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Bear], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bear], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,9)), Simple diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl index 6d2eafdbc7c..90d507d5013 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Foobar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foobar], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,11)), ObjectModel (Class, [], (5,4--6,7)), [], (4,5--6,7), diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl index a1b964f3ac1..3a06ba064b3 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl index 3afb8f5e0cf..ff490de4b97 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -8,7 +8,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Shape], + ([], None, [], + Some (LongIdent (SynLongIdent ([Shape], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), Simple diff --git a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl index 0562bc80619..6c7bc951db9 100644 --- a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel @@ -38,7 +39,8 @@ SigFile Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (11,5--11,6)), Simple @@ -51,7 +53,8 @@ SigFile Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Z], + ([], None, [], + Some (LongIdent (SynLongIdent ([Z], [], [None]))), PreXmlDoc ((14,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (14,5--14,6)), Simple (None (14,5--15,32), (14,5--15,32)), diff --git a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl index b51549de53b..39ed0db75be 100644 --- a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl @@ -6,7 +6,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), Simple (None (3,5--4,28), (3,5--4,28)), diff --git a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl index 939f5e095d7..cb48e865440 100644 --- a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel @@ -39,7 +40,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Y], + ([], None, [], + Some (LongIdent (SynLongIdent ([Y], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel @@ -75,7 +77,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Z], + ([], None, [], + Some (LongIdent (SynLongIdent ([Z], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,6)), ObjectModel @@ -157,7 +160,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Unit], + ([], None, [], + Some (LongIdent (SynLongIdent ([Unit], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,9)), ObjectModel diff --git a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl index d7fb308c07b..b26b2d1b458 100644 --- a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl +++ b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([InterpolatedStringOffsideInModule], false, AnonModule, [NestedModule (SynComponentInfo - ([], None, [], [A], + ([], None, [], Some (LongIdent (SynLongIdent ([A], [], []))), PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (1,0--1,8)), false, [Let 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 53050c358a9..3fb283b6443 100644 --- a/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl @@ -42,7 +42,8 @@ ImplFile (3,53--3,55))], [], Some (3,55--3,56), false, (3,49--3,56)), (3,48--3,56))], { AmpersandRanges = [(3,46--3,47)] })], [], - (3,6--3,57))), [], [C], + (3,6--3,57))), [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (3,5--3,6)), ObjectModel 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 aba7c4ea07e..d7d0668ffa6 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [I], + ([], None, [], + Some (LongIdent (SynLongIdent ([I], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl index 1e3e4c88ac6..5c0d1c5b5ef 100644 --- a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl index c65846b5121..594477491cc 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl index 6519bc1260e..550ac2bba88 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl @@ -7,7 +7,8 @@ SigFile [Types ([SynTypeDefnSig (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl index 8161ef11d05..dead9e8e0a6 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl index 69efd4467a5..7fc9db85d81 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl index 3d81221a098..7b83a3f788c 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl index 4b2d945ae86..3fad1100e46 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl index 4c6d6d9d69d..deffd75e900 100644 --- a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,7 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,0--7,3)), Simple (None (7,0--7,3), (7,0--7,3)), [], None, (7,0--7,3), @@ -27,7 +28,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,5)), Simple diff --git a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl index d8ed54e6278..513493b714d 100644 --- a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,5)), Simple (None (5,4--5,5), (5,4--5,5)), [], None, (5,4--5,5), @@ -27,7 +29,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,5)), Simple diff --git a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl index 75c21712b48..4ad899f5b0d 100644 --- a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,5)), Simple (None (5,4--5,7), (5,4--5,7)), [], None, (5,4--5,7), @@ -27,7 +29,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,5)), Simple diff --git a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl index 43cdb517f1f..f0c3d09ad2b 100644 --- a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,7 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,0--6,0)), Simple (None (6,0--6,0), (6,0--6,0)), [], None, (6,0--6,0), diff --git a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl index e830f0923ad..dfd339972b7 100644 --- a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,5)), Simple (None (5,4--5,5), (5,4--5,5)), [], None, (5,4--5,5), diff --git a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl index 88650dda065..ea4ba6191c4 100644 --- a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -18,7 +19,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,5)), Simple (None (5,4--5,7), (5,4--5,7)), [], None, (5,4--5,7), diff --git a/tests/service/data/SyntaxTree/Type/As 01.fs.bsl b/tests/service/data/SyntaxTree/Type/As 01.fs.bsl index 6ee3982d866..a88e7d8e467 100644 --- a/tests/service/data/SyntaxTree/Type/As 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl index d9175ab67c2..9b50c46c719 100644 --- a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl index c6d3679b645..bd84b6cb79d 100644 --- a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Class, [], (3,17--3,26)), [], None, (3,5--3,26), diff --git a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl index 72a2470ba19..28fcd515c91 100644 --- a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Class, [], (3,12--3,21)), [], None, (3,5--3,21), diff --git a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl index a95fbbe8e9c..5e0dd6a73fe 100644 --- a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), diff --git a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl index 9f32f95a557..9b5461b052a 100644 --- a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), diff --git a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl index c984cc41133..a57706d6a1d 100644 --- a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), diff --git a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl index 949d6732cb3..af178a417b2 100644 --- a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), diff --git a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl index 478489a67f7..29a9a670505 100644 --- a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Cascading Nested Invalid Constructs 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Cascading Nested Invalid Constructs 01.fs.bsl index 1526b36c74e..583b499b8af 100644 --- a/tests/service/data/SyntaxTree/Type/Cascading Nested Invalid Constructs 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Cascading Nested Invalid Constructs 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple (None (4,5--4,8), (4,5--4,8)), [], None, (4,5--4,8), @@ -17,7 +18,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,9--5,10)), Simple @@ -29,7 +31,7 @@ ImplFile WithKeyword = None })], (5,4--5,16)); NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,8--6,16)), false, [Expr (Const (Unit, (6,19--6,21)), (6,19--6,21))], false, diff --git a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl index 319b6a1799c..867f91235e9 100644 --- a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Class, [], (3,9--3,18)), [], None, (3,5--3,18), diff --git a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl index b3d84e0003e..6d3cad87cb8 100644 --- a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl index 1b1edb27290..1ca4a7b14ce 100644 --- a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl index ae98b2f4211..bdb588664a4 100644 --- a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl index a47c0c4fc45..ba04a21406d 100644 --- a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Comments With Keywords 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Comments With Keywords 01.fs.bsl index 90710f91ec7..2de6b43c379 100644 --- a/tests/service/data/SyntaxTree/Type/Comments With Keywords 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Comments With Keywords 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyType], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,11)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Deeply Indented Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Deeply Indented Type 01.fs.bsl index a5d38e13ca0..25b3bafbe62 100644 --- a/tests/service/data/SyntaxTree/Type/Deeply Indented Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Deeply Indented Type 01.fs.bsl @@ -6,18 +6,23 @@ ImplFile ([OuterModule], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [InnerModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InnerModule], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,0--4,18)), false, [NestedModule (SynComponentInfo - ([], None, [], [DeeplyNested], + ([], None, [], + Some (LongIdent (SynLongIdent ([DeeplyNested], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,23)), false, [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [IndentedType], + ([], None, [], + Some + (LongIdent + (SynLongIdent ([IndentedType], [], [None]))), PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,13--6,25)), Simple (None (6,13--6,27), (6,13--6,27)), [], None, @@ -27,7 +32,10 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [NestedType], + ([], None, [], + Some + (LongIdent + (SynLongIdent ([NestedType], [], [None]))), PreXmlDoc ((7,12), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,17--7,27)), Simple @@ -39,7 +47,9 @@ ImplFile WithKeyword = None })], (7,12--7,33)); NestedModule (SynComponentInfo - ([], None, [], [NestedModule], + ([], None, [], + Some + (LongIdent (SynLongIdent ([NestedModule], [], []))), PreXmlDoc ((8,12), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,12--8,31)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Double Semicolon Delimiters 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Double Semicolon Delimiters 01.fs.bsl index e2bda14132e..6e5d09b251f 100644 --- a/tests/service/data/SyntaxTree/Type/Double Semicolon Delimiters 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Double Semicolon Delimiters 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple (None (4,5--4,8), (4,5--4,8)), [], None, (4,5--4,8), @@ -17,7 +18,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,9--5,10)), Simple @@ -29,7 +31,7 @@ ImplFile WithKeyword = None })], (5,4--5,16)); NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,12)), false, [Expr (Const (Unit, (6,15--6,17)), (6,15--6,17))], false, diff --git a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl index 1d8dfd6a8ff..58bbcea4d2b 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl index f9ea108dd50..25c44c336d7 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl index 7bce3a3aa62..0d3abc67b26 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl index 710fdf83368..23d641a0dc1 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl index 4d1063812b5..352e9386858 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl index 3382f753b9f..d0e2c7a79c2 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 6d424af5776..c31d60368a2 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 40680d4d737..f3b15745b1f 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 5604912f25c..a3e9ffe3b9a 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 c85ef4a38c1..aa8afca9a59 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [E], + ([], None, [], + Some (LongIdent (SynLongIdent ([E], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Exception Inside Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Exception Inside Type 01.fs.bsl index 887cb099c0c..23dff41cf07 100644 --- a/tests/service/data/SyntaxTree/Type/Exception Inside Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Exception Inside Type 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple (None (4,5--4,6), (4,5--4,6)), [], None, (4,5--4,6), diff --git a/tests/service/data/SyntaxTree/Type/Inline IL With Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Inline IL With Type 01.fs.bsl index 357f581f362..44a85684f64 100644 --- a/tests/service/data/SyntaxTree/Type/Inline IL With Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Inline IL With Type 01.fs.bsl @@ -37,21 +37,19 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], + ([], None, [], Some - (PrefixList - ([SynTyparDecl - ([], SynTypar (T, None, false), [], - { AmpersandRanges = [] })], (4,27--4,31))), [], - [x], + (Paren + (Var (SynTypar (T, None, false), (4,28--4,30)), + (4,27--4,31))), PreXmlDoc ((4,22), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,32--4,33)), - Simple (None (4,32--4,33), (4,32--4,33)), [], None, - (4,32--4,33), { LeadingKeyword = Type (4,22--4,26) + false, None, (4,27--4,31)), + Simple (None (4,27--4,31), (4,27--4,31)), [], None, + (4,27--4,31), { LeadingKeyword = Type (4,22--4,26) EqualsRange = None - WithKeyword = None })], (4,22--4,33))], + WithKeyword = None })], (4,22--4,31))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, - (2,0--4,33), { LeadingKeyword = Module (2,0--2,6) })], (true, true), + (2,0--4,31), { LeadingKeyword = Module (2,0--2,6) })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [LineComment (1,0--1,62)] }, set [])) @@ -60,4 +58,4 @@ ImplFile (4,4)-(4,5) parse error Unmatched '(' (4,22)-(4,26) parse error Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. (3,0)-(3,3) parse error 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. -(4,34)-(4,35) parse error Unexpected symbol ':' in type definition. Expected '=' or other token. +(4,32)-(4,33) parse error Unexpected identifier in type definition. Expected '=' or other token. diff --git a/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl index 0736baeb450..601bb906951 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Interface, [], (4,4--4,17)), [], None, diff --git a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl index 00f511cf97b..1654e0ed705 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Interface, [], (4,4--5,7)), [], None, (3,5--5,7), diff --git a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl index 9bd8891abe6..4c84e10a736 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl index 2f68afd4da1..78387daebef 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl index 07799f674ef..dfc2f5be612 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Keywords In Strings 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Keywords In Strings 01.fs.bsl index de2137341ef..96cb20b4525 100644 --- a/tests/service/data/SyntaxTree/Type/Keywords In Strings 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Keywords In Strings 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClass], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyClass], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Let Inside Class 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Let Inside Class 01.fs.bsl index c7eddf540a5..e3d44124849 100644 --- a/tests/service/data/SyntaxTree/Type/Let Inside Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Let Inside Class 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClass], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyClass], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Module After Do Binding 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module After Do Binding 01.fs.bsl index feda58cda85..83501350e62 100644 --- a/tests/service/data/SyntaxTree/Type/Module After Do Binding 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module After Do Binding 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClass], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyClass], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel @@ -43,7 +44,7 @@ ImplFile WithKeyword = None })], (4,0--5,29)); NestedModule (SynComponentInfo - ([], None, [], [M], + ([], None, [], Some (LongIdent (SynLongIdent ([M], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,12)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module After Inherit 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module After Inherit 01.fs.bsl index 644860bccd4..4859f0c7176 100644 --- a/tests/service/data/SyntaxTree/Type/Module After Inherit 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module After Inherit 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Base], + ([], None, [], + Some (LongIdent (SynLongIdent ([Base], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,9)), ObjectModel @@ -27,7 +28,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Derived], + ([], None, [], + Some (LongIdent (SynLongIdent ([Derived], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,12)), ObjectModel @@ -50,7 +52,8 @@ ImplFile WithKeyword = None })], (6,0--7,18)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((9,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (9,4--9,24)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module After Members 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module After Members 01.fs.bsl index 28b3548fe66..ccd18891bf5 100644 --- a/tests/service/data/SyntaxTree/Type/Module After Members 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module After Members 01.fs.bsl @@ -7,7 +7,10 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [ClassWithMembers], + ([], None, [], + Some + (LongIdent + (SynLongIdent ([ClassWithMembers], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,21)), ObjectModel @@ -81,7 +84,8 @@ ImplFile WithKeyword = None })], (4,0--6,26)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,4--8,24)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module After Static Members 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module After Static Members 01.fs.bsl index 15115ecfedc..83add4de069 100644 --- a/tests/service/data/SyntaxTree/Type/Module After Static Members 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module After Static Members 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyType], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,11)), ObjectModel @@ -44,7 +45,8 @@ ImplFile WithKeyword = None })], (4,0--5,37)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,24)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module And Exception Interleaved With Members 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module And Exception Interleaved With Members 01.fs.bsl index 8f92eb2c87b..f607faa5881 100644 --- a/tests/service/data/SyntaxTree/Type/Module And Exception Interleaved With Members 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module And Exception Interleaved With Members 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Interleaved], + ([], None, [], + Some (LongIdent (SynLongIdent ([Interleaved], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,16)), ObjectModel @@ -41,7 +42,7 @@ ImplFile WithKeyword = None })], (4,0--5,18)); NestedModule (SynComponentInfo - ([], None, [], [M1], + ([], None, [], Some (LongIdent (SynLongIdent ([M1], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,13)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module And Type After Do Binding 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module And Type After Do Binding 01.fs.bsl index 6e7606cc734..be8cb4cee5f 100644 --- a/tests/service/data/SyntaxTree/Type/Module And Type After Do Binding 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module And Type After Do Binding 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [ClassWithDo], + ([], None, [], + Some (LongIdent (SynLongIdent ([ClassWithDo], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,16)), ObjectModel @@ -43,7 +44,9 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [InternalType], + ([], None, [], + Some + (LongIdent (SynLongIdent ([InternalType], [], [None]))), PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,9--8,21)), Simple @@ -55,7 +58,8 @@ ImplFile WithKeyword = None })], (8,4--8,27)); NestedModule (SynComponentInfo - ([], None, [], [InternalModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InternalModule], [], []))), PreXmlDoc ((10,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (10,4--10,25)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module And Type Inside Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module And Type Inside Type 01.fs.bsl index 8a885013e07..0b97767af36 100644 --- a/tests/service/data/SyntaxTree/Type/Module And Type Inside Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module And Type Inside Type 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyType], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,11)), Simple (None (4,5--4,13), (4,5--4,13)), [], None, (4,5--4,13), @@ -16,7 +17,8 @@ ImplFile WithKeyword = None })], (4,0--4,13)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,24)), false, [Let @@ -38,7 +40,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [InvalidType], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidType], [], [None]))), PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,9--8,20)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Module At Module Level 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module At Module Level 01.fs.bsl index 64f3e9a1f48..ed7bb9afaff 100644 --- a/tests/service/data/SyntaxTree/Type/Module At Module Level 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module At Module Level 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [SimpleType], + ([], None, [], + Some (LongIdent (SynLongIdent ([SimpleType], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,15)), Simple @@ -43,7 +44,8 @@ ImplFile WithKeyword = None })], (4,0--6,17)); NestedModule (SynComponentInfo - ([], None, [], [ValidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([ValidModule], [], []))), PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,0--7,18)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module At Type Column 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module At Type Column 01.fs.bsl index c8750dbc0a7..c1728ab6899 100644 --- a/tests/service/data/SyntaxTree/Type/Module At Type Column 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module At Type Column 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -32,7 +33,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,6)), Simple @@ -44,7 +46,7 @@ ImplFile WithKeyword = None })], (6,0--6,10)); NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,0--7,8)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Between Constructors 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Between Constructors 01.fs.bsl index def37df2059..8b9d3cf0d7f 100644 --- a/tests/service/data/SyntaxTree/Type/Module Between Constructors 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Between Constructors 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClass], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyClass], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel @@ -67,7 +68,8 @@ ImplFile WithKeyword = None })], (4,0--5,22)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,24)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Class 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Class 01.fs.bsl index da0eeb70c26..37589b75905 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Class 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), ObjectModel @@ -54,7 +55,7 @@ ImplFile WithKeyword = None })], (4,0--5,21)); NestedModule (SynComponentInfo - ([], None, [], [M2], + ([], None, [], Some (LongIdent (SynLongIdent ([M2], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,13)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Class With Constructor 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Class With Constructor 01.fs.bsl index f61b8d0da80..21813ff5c7a 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Class With Constructor 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Class With Constructor 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyClass], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyClass], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,12)), ObjectModel @@ -38,7 +39,8 @@ ImplFile WithKeyword = None })], (4,0--4,22)); NestedModule (SynComponentInfo - ([], None, [], [InternalModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InternalModule], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,25)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Delegate 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Delegate 01.fs.bsl index 89330c2e3c9..8bde6aa48d5 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Delegate 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Delegate 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyDelegate], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyDelegate], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,15)), ObjectModel @@ -65,7 +66,8 @@ ImplFile WithKeyword = None })], (4,0--4,46)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,24)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Interface 01.fs.bsl index 25a1e2ee23b..1004a386e61 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Interface 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [IFace], + ([], None, [], + Some (LongIdent (SynLongIdent ([IFace], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), ObjectModel @@ -41,7 +42,7 @@ ImplFile WithKeyword = None })], (4,0--5,27)); NestedModule (SynComponentInfo - ([], None, [], [M], + ([], None, [], Some (LongIdent (SynLongIdent ([M], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,12)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Interface End 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Interface End 01.fs.bsl index 8bcf248f981..c667b2c305b 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Interface End 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Interface End 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [IFace], + ([], None, [], + Some (LongIdent (SynLongIdent ([IFace], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Nested Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Nested Type 01.fs.bsl index 69502f842e4..b070b3dc863 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Nested Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Nested Type 01.fs.bsl @@ -6,18 +6,22 @@ ImplFile ([Level1], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [Level2], + ([], None, [], + Some (LongIdent (SynLongIdent ([Level2], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,0--4,13)), false, [NestedModule (SynComponentInfo - ([], None, [], [Level3], + ([], None, [], + Some (LongIdent (SynLongIdent ([Level3], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,17)), false, [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyType], + ([], None, [], + Some + (LongIdent (SynLongIdent ([MyType], [], [None]))), PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,13--6,19)), Simple @@ -34,7 +38,9 @@ ImplFile WithKeyword = None })], (6,8--7,15)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some + (LongIdent (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((8,12), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,12--8,32)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Record 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Record 01.fs.bsl index 49bb21bfb20..52853402530 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Record 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Record 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -25,7 +26,7 @@ ImplFile WithKeyword = None })], (4,0--5,15)); NestedModule (SynComponentInfo - ([], None, [], [M4], + ([], None, [], Some (LongIdent (SynLongIdent ([M4], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,13)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Struct 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Struct 01.fs.bsl index 38b44cf5f9f..deb368bb023 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Struct 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Struct 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MyStruct], + ([], None, [], + Some (LongIdent (SynLongIdent ([MyStruct], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,13)), ObjectModel (Struct, [], (5,4--5,10)), [], None, (4,5--5,10), diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Type With Augmentation 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Type With Augmentation 01.fs.bsl index 8cd1248d8de..d3f319373c7 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Type With Augmentation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Type With Augmentation 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Module Inside Union 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Inside Union 01.fs.bsl index 5b239279ff4..68855ce9ba8 100644 --- a/tests/service/data/SyntaxTree/Type/Module Inside Union 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Inside Union 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -27,7 +28,7 @@ ImplFile WithKeyword = None })], (4,0--6,7)); NestedModule (SynComponentInfo - ([], None, [], [M3], + ([], None, [], Some (LongIdent (SynLongIdent ([M3], [], []))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,13)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Less Indented 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Less Indented 01.fs.bsl index f8a33abb0ef..2a01d444913 100644 --- a/tests/service/data/SyntaxTree/Type/Module Less Indented 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Less Indented 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -43,7 +44,8 @@ ImplFile WithKeyword = None })], (4,0--6,21)); NestedModule (SynComponentInfo - ([], None, [], [ValidModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([ValidModule], [], []))), PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,0--7,18)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Module Same Indentation 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module Same Indentation 01.fs.bsl index 4b5f37845d7..b8ece58006e 100644 --- a/tests/service/data/SyntaxTree/Type/Module Same Indentation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module Same Indentation 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -43,7 +44,7 @@ ImplFile WithKeyword = None })], (4,0--6,21)); NestedModule (SynComponentInfo - ([], None, [], [B], + ([], None, [], Some (LongIdent (SynLongIdent ([B], [], []))), PreXmlDoc ((8,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,0--8,8)), false, [Let @@ -65,7 +66,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (11,5--11,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Module With Semicolon Delimiter 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Module With Semicolon Delimiter 01.fs.bsl index a32fe9a3cc2..6f86a212c41 100644 --- a/tests/service/data/SyntaxTree/Type/Module With Semicolon Delimiter 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Module With Semicolon Delimiter 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [TypeA], + ([], None, [], + Some (LongIdent (SynLongIdent ([TypeA], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), Simple @@ -23,7 +24,9 @@ ImplFile WithKeyword = None })], (4,0--5,7)); NestedModule (SynComponentInfo - ([], None, [], [ModuleAfterDelimiter], + ([], None, [], + Some + (LongIdent (SynLongIdent ([ModuleAfterDelimiter], [], []))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,4--6,31)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/Multiple Invalid Constructs In Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Multiple Invalid Constructs In Type 01.fs.bsl index c2c35d68f89..d3f19073894 100644 --- a/tests/service/data/SyntaxTree/Type/Multiple Invalid Constructs In Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Multiple Invalid Constructs In Type 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [MultiTest], + ([], None, [], + Some (LongIdent (SynLongIdent ([MultiTest], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,14)), Simple @@ -27,7 +28,8 @@ ImplFile WithKeyword = None })], (4,0--6,11)); NestedModule (SynComponentInfo - ([], None, [], [NestedModule], + ([], None, [], + Some (LongIdent (SynLongIdent ([NestedModule], [], []))), PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,4--7,23)), false, [], false, (7,4--7,35), { ModuleKeyword = Some (7,4--7,10) @@ -35,7 +37,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [NestedType], + ([], None, [], + Some (LongIdent (SynLongIdent ([NestedType], [], [None]))), PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,9--8,19)), Simple diff --git a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl index 26f912fd463..a7983ca3b7c 100644 --- a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl index cd9f16db52b..d126853d5f5 100644 --- a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Nested Module Hierarchy 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Nested Module Hierarchy 01.fs.bsl index 5e9f1664abd..de299f033dc 100644 --- a/tests/service/data/SyntaxTree/Type/Nested Module Hierarchy 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Nested Module Hierarchy 01.fs.bsl @@ -6,23 +6,30 @@ ImplFile ([Root], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [Level1], + ([], None, [], + Some (LongIdent (SynLongIdent ([Level1], [], []))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,0--4,13)), false, [NestedModule (SynComponentInfo - ([], None, [], [Level2], + ([], None, [], + Some (LongIdent (SynLongIdent ([Level2], [], []))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,17)), false, [NestedModule (SynComponentInfo - ([], None, [], [Level3], + ([], None, [], + Some (LongIdent (SynLongIdent ([Level3], [], []))), PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,8--6,21)), false, [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [TypeWithInvalidModule], + ([], None, [], + Some + (LongIdent + (SynLongIdent + ([TypeWithInvalidModule], [], [None]))), PreXmlDoc ((7,12), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,17--7,38)), Simple (None (7,17--7,40), (7,17--7,40)), [], None, @@ -32,7 +39,10 @@ ImplFile (7,12--7,40)); NestedModule (SynComponentInfo - ([], None, [], [InvalidModule], + ([], None, [], + Some + (LongIdent + (SynLongIdent ([InvalidModule], [], []))), PreXmlDoc ((8,16), FSharp.Compiler.Xml.XmlDocCollector), false, None, (8,16--8,36)), false, [Let diff --git a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl index b494146b3bb..18514086600 100644 --- a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel @@ -15,7 +16,8 @@ ImplFile [NestedType (SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((3,16), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,16--3,17)), ObjectModel (Class, [], (4,20--5,23)), [], None, diff --git a/tests/service/data/SyntaxTree/Type/One Line With Semicolons 01.fs.bsl b/tests/service/data/SyntaxTree/Type/One Line With Semicolons 01.fs.bsl index f7d8eebe54c..10723f6de06 100644 --- a/tests/service/data/SyntaxTree/Type/One Line With Semicolons 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/One Line With Semicolons 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -20,7 +21,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((4,12), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,17--4,18)), Simple @@ -32,7 +34,7 @@ ImplFile WithKeyword = None })], (4,12--4,22)); NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((4,24), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,24--4,32)), false, [Expr (Const (Unit, (4,35--4,37)), (4,35--4,37))], false, @@ -69,7 +71,7 @@ ImplFile (4,81--4,92)); NestedModule (SynComponentInfo - ([], None, [], [G], + ([], None, [], Some (LongIdent (SynLongIdent ([G], [], []))), PreXmlDoc ((4,94), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,94--4,102)), false, [ModuleAbbrev (H, [E], (4,105--4,117))], false, (4,94--4,117), 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 fe0302ab859..9128da8ebe4 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 72bc51bf468..d21ef2a839e 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 99c099de787..e5c5809c727 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), 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 057d2f4c5b5..13d9311e747 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel 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 9a347eecea8..25bf74a3353 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl index 79bbd17b1a6..42576a586ec 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl @@ -13,7 +13,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,5) }] - Range = (2,0--2,7) }], None, [], [Bar], + Range = (2,0--2,7) }], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), ObjectModel (Class, [], (4,4--5,7)), [], None, (2,0--5,7), diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl index ad592dd5cbb..a0036fe4637 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl @@ -27,7 +27,7 @@ ImplFile SynTyparDecl ([], SynTypar (a, None, false), [], { AmpersandRanges = [] })], [], (3,8--3,22))), [], - [Foo], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), true, None, (3,5--3,8)), Simple @@ -81,7 +81,7 @@ ImplFile SynTyparDecl ([], SynTypar (a, None, false), [], { AmpersandRanges = [] })], [], (6,41--6,55))), - [], [Bar], + [], Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), true, None, (6,38--6,41)), Simple 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 e2c49be6c8e..66574891011 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 3540dbcc68c..b752bd44d9d 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 353570298cd..991d7a3acb1 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 37ad416ff25..d6edd2dd7ca 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 37da69f67aa..12905c51d95 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 7b80fa8e08f..15fe43fbed4 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 64b6dba2775..b485f14ef35 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 c3b99f04619..64d81e31c9f 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 6443e19b43b..22dcc1f9734 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl index 50126fc6544..93d6e8125ea 100644 --- a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [AU], + ([], None, [], + Some (LongIdent (SynLongIdent ([AU], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,7)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl index 986cadf5de9..4d9fa068d1e 100644 --- a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [AU], + ([], None, [], + Some (LongIdent (SynLongIdent ([AU], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,7)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl index e53b6c858d4..c84c6dc709f 100644 --- a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (Record (None, [], (4,4--4,7)), (4,4--4,7)), [], None, diff --git a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl index bc34db45a45..e9e57640658 100644 --- a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl index 65f78f4d5d3..99ea93b89f9 100644 --- a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [R], + ([], None, [], + Some (LongIdent (SynLongIdent ([R], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Same Line Declarations 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Same Line Declarations 01.fs.bsl index 81c58ccf689..4cc67ce3b5f 100644 --- a/tests/service/data/SyntaxTree/Type/Same Line Declarations 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Same Line Declarations 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -20,7 +21,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((4,11), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,16--4,17)), Simple @@ -32,13 +34,14 @@ ImplFile WithKeyword = None })], (4,11--4,21)); NestedModule (SynComponentInfo - ([], None, [], [C], + ([], None, [], Some (LongIdent (SynLongIdent ([C], [], []))), PreXmlDoc ((4,22), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,22--4,30)), false, [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [CC], + ([], None, [], + Some (LongIdent (SynLongIdent ([CC], [], [None]))), PreXmlDoc ((4,33), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,38--4,40)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl index eebe5e89043..1924d357420 100644 --- a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl index 7a1e7f126b6..9bd206577e2 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [S], + ([], None, [], + Some (LongIdent (SynLongIdent ([S], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Struct, [], (3,9--3,19)), [], None, (3,5--3,19), diff --git a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl index 50148b6ee14..5d103746294 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [S], + ([], None, [], + Some (LongIdent (SynLongIdent ([S], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl index 4a03a8854ac..b021fea7a3a 100644 --- a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl index bdf9ec74f42..9a30fbf73fe 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -16,7 +16,8 @@ ImplFile Target = None AppliesToGetterAndSetter = false Range = (2,2--2,13) }] - Range = (2,0--2,15) }], None, [], [A], + Range = (2,0--2,15) }], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl index 200a42bb6be..ad62ac64df8 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Int32], + ([], None, [], + Some (LongIdent (SynLongIdent ([Int32], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,10)), ObjectModel (Augmentation (2,11--2,15), [], (2,5--3,21)), diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl index 4ebef606401..125a6a9a916 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl @@ -8,7 +8,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Bear], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bear], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,9)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl index ac4171bbf00..5aff8580091 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl index 7cb9f5a2af5..234d020db12 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl index 561ab54725d..2452d36b757 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl @@ -9,7 +9,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Shape], + ([], None, [], + Some (LongIdent (SynLongIdent ([Shape], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,10)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl index 98690850046..0292c0a6453 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -10,7 +10,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -22,7 +23,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [C], + ([], None, [], + Some (LongIdent (SynLongIdent ([C], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,5)), Simple diff --git a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl index 18cf4ffe778..2b64c6a7d7c 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs new file mode 100644 index 00000000000..bbe31efe64c --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs @@ -0,0 +1 @@ +type ('T1) diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs.bsl b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs.bsl new file mode 100644 index 00000000000..72a53fed398 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs.bsl @@ -0,0 +1,26 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 01.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 01, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 01], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], + Some + (Paren + (Var (SynTypar (T1, None, false), (1,6--1,9)), + (1,5--1,10))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,5--1,10)), + Simple (None (1,5--1,10), (1,5--1,10)), [], None, (1,5--1,10), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,10))], 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 'TupleTypeExtensionRecovery 01' based on the file name 'TupleTypeExtensionRecovery 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/Type/TupleTypeExtensionRecovery 02.fs b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs new file mode 100644 index 00000000000..1a987f1bf22 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs @@ -0,0 +1 @@ +type ('T1 *) diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs.bsl b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs.bsl new file mode 100644 index 00000000000..27577845e20 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 02.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 02, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 02], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], + Some + (Paren + (Tuple + (false, + [Type + (Var (SynTypar (T1, None, false), (1,6--1,9))); + Star (1,10--1,11); + Type (FromParseError (1,11--1,11))], (1,6--1,11)), + (1,5--1,12))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,5--1,12)), + Simple (None (1,5--1,12), (1,5--1,12)), [], None, (1,5--1,12), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,12))], PreXmlDocEmpty, [], + None, (1,0--2,0), { LeadingKeyword = None })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(1,11)-(1,12) parse error Unexpected symbol ')' in type +(1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'TupleTypeExtensionRecovery 02' based on the file name 'TupleTypeExtensionRecovery 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/Type/TupleTypeExtensionRecovery 03.fs b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs new file mode 100644 index 00000000000..b09d4650ad7 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs @@ -0,0 +1 @@ +type ('T1 * 'T2) diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs.bsl b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs.bsl new file mode 100644 index 00000000000..db8e159d466 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs.bsl @@ -0,0 +1,32 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 03.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 03, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 03], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], + Some + (Paren + (Tuple + (false, + [Type + (Var (SynTypar (T1, None, false), (1,6--1,9))); + Star (1,10--1,11); + Type + (Var (SynTypar (T2, None, false), (1,12--1,15)))], + (1,6--1,15)), (1,5--1,16))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,5--1,16)), + Simple (None (1,5--1,16), (1,5--1,16)), [], None, (1,5--1,16), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,16))], 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 'TupleTypeExtensionRecovery 03' based on the file name 'TupleTypeExtensionRecovery 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/Type/TupleTypeExtensionRecovery 04.fs b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs new file mode 100644 index 00000000000..3415dd5614c --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs @@ -0,0 +1,2 @@ +type ('T1) with + static member X = 1 diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs.bsl b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs.bsl new file mode 100644 index 00000000000..7371336d3da --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs.bsl @@ -0,0 +1,48 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 04.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 04, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 04], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], + Some + (Paren + (Var (SynTypar (T1, None, false), (1,6--1,9)), + (1,5--1,10))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,5--1,10)), + ObjectModel (Augmentation (1,11--1,15), [], (1,5--2,23)), + [Member + (SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((2,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (Some { IsInstance = false + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = Member }, + SynValInfo ([[]], SynArgInfo ([], false, None)), + None), + LongIdent + (SynLongIdent ([X], [], [None]), None, None, Pats [], + None, (2,18--2,19)), None, + Const (Int32 1, (2,22--2,23)), (2,18--2,19), + NoneAtInvisible, + { LeadingKeyword = + StaticMember ((2,4--2,10), (2,11--2,17)) + InlineKeyword = None + EqualsRange = Some (2,20--2,21) }), (2,4--2,23))], + None, (1,5--2,23), { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--2,23))], + PreXmlDocEmpty, [], None, (1,0--3,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 'TupleTypeExtensionRecovery 04' based on the file name 'TupleTypeExtensionRecovery 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/Type/TupleTypeExtensionRecovery 05.fs b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs new file mode 100644 index 00000000000..3e64b70d5a6 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs @@ -0,0 +1,2 @@ +type ('T1 *) with + static member X = 1 diff --git a/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs.bsl b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs.bsl new file mode 100644 index 00000000000..90b654e983e --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs.bsl @@ -0,0 +1,54 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 05.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 05, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 05], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], + Some + (Paren + (Tuple + (false, + [Type + (Var (SynTypar (T1, None, false), (1,6--1,9))); + Star (1,10--1,11); + Type (FromParseError (1,11--1,11))], (1,6--1,11)), + (1,5--1,12))), + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,5--1,12)), + ObjectModel (Augmentation (1,13--1,17), [], (1,5--2,23)), + [Member + (SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((2,4), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (Some { IsInstance = false + IsDispatchSlot = false + IsOverrideOrExplicitImpl = false + IsFinal = false + GetterOrSetterIsCompilerGenerated = false + MemberKind = Member }, + SynValInfo ([[]], SynArgInfo ([], false, None)), + None), + LongIdent + (SynLongIdent ([X], [], [None]), None, None, Pats [], + None, (2,18--2,19)), None, + Const (Int32 1, (2,22--2,23)), (2,18--2,19), + NoneAtInvisible, + { LeadingKeyword = + StaticMember ((2,4--2,10), (2,11--2,17)) + InlineKeyword = None + EqualsRange = Some (2,20--2,21) }), (2,4--2,23))], + None, (1,5--2,23), { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--2,23))], + PreXmlDocEmpty, [], None, (1,0--3,0), { LeadingKeyword = None })], + (true, true), { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(1,11)-(1,12) parse error Unexpected symbol ')' in type +(1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module 'TupleTypeExtensionRecovery 05' based on the file name 'TupleTypeExtensionRecovery 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/Type/Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl index 6d2a653d3c3..96fac2fcc5c 100644 --- a/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl @@ -6,7 +6,7 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--5,0)), Simple (None (3,5--5,0), (3,5--5,0)), [], None, (3,5--5,0), diff --git a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl index 1612c6d364a..7d280833d9b 100644 --- a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), diff --git a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl index d852d9f5b0c..63b74e14d64 100644 --- a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,8), (3,5--3,8)), [], None, (3,5--3,8), diff --git a/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl index 25829050752..b8177b098b1 100644 --- a/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T1], + ([], None, [], + Some (LongIdent (SynLongIdent ([T1], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,7)), Simple (None (3,5--3,9), (3,5--3,9)), [], None, (3,5--3,9), @@ -16,7 +17,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T2], + ([], None, [], + Some (LongIdent (SynLongIdent ([T2], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,7)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl index 3b6a0da3290..572a616df47 100644 --- a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T1], + ([], None, [], + Some (LongIdent (SynLongIdent ([T1], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,7)), Simple (None (3,5--3,9), (3,5--3,9)), [], None, (3,5--3,9), @@ -15,7 +16,8 @@ ImplFile WithKeyword = None }); SynTypeDefn (SynComponentInfo - ([], None, [], [T2], + ([], None, [], + Some (LongIdent (SynLongIdent ([T2], [], [None]))), PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,4--5,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl index 9fbbe27cb68..67f7c81e1d5 100644 --- a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl @@ -6,7 +6,7 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), diff --git a/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl index fc4e61c33cd..db46ec5fa4f 100644 --- a/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl @@ -6,7 +6,7 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl index 787da13b0e8..aa22a466fc3 100644 --- a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl index 0105941f2d9..fc1dd630e5c 100644 --- a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl index 7cbdc0524f8..027e57b0b2a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl @@ -5,13 +5,13 @@ ImplFile ([N], false, DeclaredNamespace, [NestedModule (SynComponentInfo - ([], None, [], [M], + ([], None, [], Some (LongIdent (SynLongIdent ([M], [], []))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,0--6,8)), false, [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [], + ([], None, [], None, PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (7,9--7,10)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl index 18c53db2380..05fc4905a0a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel diff --git a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl index 49cd0e01aff..742764864c3 100644 --- a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), diff --git a/tests/service/data/SyntaxTree/Type/Type Inside Type 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Type Inside Type 01.fs.bsl index 2890c48d450..5364be323b4 100644 --- a/tests/service/data/SyntaxTree/Type/Type Inside Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type Inside Type 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,6)), Simple @@ -23,7 +24,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [NestedType], + ([], None, [], + Some (LongIdent (SynLongIdent ([NestedType], [], [None]))), PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,9--6,19)), Simple 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 da9b04d91b5..e669630b678 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 d649bbb87ad..e6f42e72ab8 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 45a33b76422..da9c73ef9ba 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl index 95b3750a979..6a85cc6cb1b 100644 --- a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl index 01aad19db35..6c3765eb2f3 100644 --- a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl index 9623dd96ac7..dc49791cf0c 100644 --- a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl index a83e76cb5a0..c4946207532 100644 --- a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl index 055cbe1b68b..6f419387dde 100644 --- a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl index 5648e1559f0..9ae41b2cee0 100644 --- a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl index 756c74260c8..82652e9b278 100644 --- a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl index 82fde979587..75eb3b461da 100644 --- a/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -22,7 +23,8 @@ ImplFile WithKeyword = None })], (3,0--4,7)); NestedModule (SynComponentInfo - ([], None, [], [ThisIsFine], + ([], None, [], + Some (LongIdent (SynLongIdent ([ThisIsFine], [], []))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,0--6,17)), false, [Let @@ -47,7 +49,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((9,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (9,5--9,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl index 5b6217dfe21..a2e612ab497 100644 --- a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Augmentation (3,7--3,11), [], (3,5--4,21)), diff --git a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl index f319074e37e..1db84c1de31 100644 --- a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Augmentation (3,7--3,11), [], (3,5--3,11)), [], diff --git a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl index 197d6d3efc9..4d1f6d805f3 100644 --- a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [T], + ([], None, [], + Some (LongIdent (SynLongIdent ([T], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), ObjectModel (Augmentation (3,7--3,11), [], (3,5--3,11)), [], diff --git a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl index 1eda3d63210..8181e58589b 100644 --- a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl index 8dedec200dd..67f47e742fe 100644 --- a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl @@ -6,7 +6,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 2e9707e1462..0a8cade8985 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl @@ -20,7 +20,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (5,5--5,6)), Simple 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 f4722cd1688..84df03a3f3f 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 1d96591c282..cdcf649f035 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 acbcf5624b1..fc6596e1b2b 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -32,7 +33,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,6)), Simple 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 f7225a0927b..3d3fa2c01c9 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 d1d8fe0cce1..c16ac12e9e1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 44085d99dcf..bc28d5fb097 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 86769a68dd1..5d3ea578eb4 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple 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 1f0a8ebdcac..a533ef9ab8a 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -24,7 +25,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [A], + ([], None, [], + Some (LongIdent (SynLongIdent ([A], [], [None]))), PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (6,5--6,6)), Simple 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 458228278e4..08626532d3e 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [U], + ([], None, [], + Some (LongIdent (SynLongIdent ([U], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl index 7b2aafa30de..1a23cc71e26 100644 --- a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl index 732c0e0b8bf..6784bb03077 100644 --- a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Currency], + ([], None, [], + Some (LongIdent (SynLongIdent ([Currency], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,13)), Simple 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 ff412468614..2709037ac47 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Bar], + ([], None, [], + Some (LongIdent (SynLongIdent ([Bar], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,8)), Simple @@ -37,7 +38,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Other], + ([], None, [], + Some (LongIdent (SynLongIdent ([Other], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), Simple 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 e1c73af2833..ad998ab9c99 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -37,7 +38,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Other], + ([], None, [], + Some (LongIdent (SynLongIdent ([Other], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), Simple 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 32f2f4bb2a1..384b82e4878 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 @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [B], + ([], None, [], + Some (LongIdent (SynLongIdent ([B], [], [None]))), PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (3,5--3,6)), Simple @@ -42,7 +43,8 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Other], + ([], None, [], + Some (LongIdent (SynLongIdent ([Other], [], [None]))), PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (4,5--4,10)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl index 7ed7778c9c9..98babe67b94 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl index a2888b02b10..3cd9b89a33a 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl index cd3e454e196..80126d91db0 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [X], + ([], None, [], + Some (LongIdent (SynLongIdent ([X], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,6)), Simple diff --git a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl index 57c3921ba18..5fc8f22a8d1 100644 --- a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl @@ -7,7 +7,8 @@ ImplFile [Types ([SynTypeDefn (SynComponentInfo - ([], None, [], [Foo], + ([], None, [], + Some (LongIdent (SynLongIdent ([Foo], [], [None]))), PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, None, (2,5--2,8)), Simple diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl index 6f5235e69b6..2de25567b81 100644 --- a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl @@ -6,7 +6,7 @@ ImplFile ([M], false, NamedModule, [NestedModule (SynComponentInfo - ([], None, [], [N], + ([], None, [], Some (LongIdent (SynLongIdent ([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));