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..8f77b5a445e 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -1,8 +1,30 @@ ### 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. * 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..31eafde4d23 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) @@ -2737,7 +2737,7 @@ 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, _, _, longPath, xml, _, vis, im, _)) = compInfo let id = ComputeModuleName longPath let modAttrs = TcAttributes cenv envInitial AttributeTargets.ModuleDecl attribs let moduleKind = ComputeModuleOrNamespaceKind g true typeNames modAttrs id.idText @@ -2766,7 +2766,7 @@ 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, _, id, xmlDoc, preferPostfix, synVis, _, _)) = synTyconInfo let checkedTypars = TcTyparDecls cenv env synTypars id |> List.iter (CheckNamespaceModuleOrTypeName g) @@ -2847,7 +2847,7 @@ module EstablishTypeDefinitionCores = /// synTyconRepr: Syntactic AST for the RHS of the type definition let private TcTyconDefnCore_Phase1B_EstablishBasicKind (cenv: cenv) inSig envinner (MutRecDefnsPhase1DataForTycon(synTyconInfo, synTyconRepr, _, _, _, _)) (tycon: Tycon) = let g = cenv.g - let (SynComponentInfo(Attributes synAttrs, TyparDecls typars, _, _, _, _, _, _)) = synTyconInfo + let (SynComponentInfo(Attributes synAttrs, TyparDecls typars, _, _, _, _, _, _, _)) = synTyconInfo let m = tycon.Range let id = tycon.Id @@ -4026,7 +4026,7 @@ module EstablishTypeDefinitionCores = match origInfo, tyconOpt with | (typeDefCore, _, _), Some (tycon: Tycon) -> let (MutRecDefnsPhase1DataForTycon(synTyconInfo, _, _, _, _, _)) = typeDefCore - let (SynComponentInfo(_, TyparsAndConstraints (_, cs1), cs2, _, _, _, _, _)) = synTyconInfo + let (SynComponentInfo(_, TyparsAndConstraints (_, cs1), cs2, _, _, _, _, _, _)) = synTyconInfo let synTyconConstraints = cs1 @ cs2 let envForTycon = AddDeclaredTypars CheckForDuplicateTypars (tycon.Typars m) envForDecls let thisTyconRef = mkLocalTyconRef tycon @@ -4282,7 +4282,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 +4291,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 +4605,7 @@ 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, longPath, _, _, _, _, _)) = synTyconInfo 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,8 +4615,8 @@ module TcDeclarations = if not (isNil members) && tcref.IsTypeAbbrev then errorR(Error(FSComp.SR.tcTypeAbbreviationsCannotHaveAugmentations(), tyDeclRange)) - - let (SynComponentInfo (attributes, _, _, _, _, _, _, _)) = synTyconInfo + + let (SynComponentInfo (attributes, _, _, _, _, _, _, _, _)) = synTyconInfo if not (List.isEmpty attributes) && (declKind = ExtrinsicExtensionBinding || declKind = IntrinsicExtensionBinding) then let attributeRange = (List.head attributes).Range error(Error(FSComp.SR.tcAugmentationsCannotHaveAttributes(), attributeRange)) @@ -4791,7 +4791,7 @@ 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, longPath, _, _, _, m, _)) = synTyconInfo let cs = cs1 @ cs2 let declKind, tcref, declaredTyconTypars = ComputeTyconDeclKind cenv envForDecls tyconOpt isAtOriginalTyconDefn true m typars cs longPath @@ -4981,7 +4981,7 @@ 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 modDecl = [SynModuleSigDecl.NestedModule(SynComponentInfo(attribs, None, [], [modName], xml, false, vis, m, None), false, defs, m, SynModuleSigDeclNestedModuleTrivia.Zero)] nsp, modDecl else longId, defs @@ -5073,7 +5073,7 @@ 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 compInfo = SynComponentInfo(synAttrs, None, [], [id], xmlDoc, false, vis, id.idRange, None) let decls = [ MutRecShape.Tycon(SynTypeDefnSig.SynTypeDefnSig(compInfo, SynTypeDefnSigRepr.Exception exnRepr, members, m, { LeadingKeyword = SynTypeDefnLeadingKeyword.Synthetic; WithKeyword = withKeyword; EqualsRange = None })) ] decls, (false, false) @@ -5230,7 +5230,7 @@ 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 compInfo = SynComponentInfo(synAttrs, None, [], [id], xmlDoc, false, vis, id.idRange, None) let decls = [ MutRecShape.Tycon(SynTypeDefn(compInfo, SynTypeDefnRepr.Exception repr, members, None, m, SynTypeDefnTrivia.Zero)) ] decls, (false, false, attrs) @@ -5289,7 +5289,29 @@ 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) + let typeDefs = + typeDefs |> List.choose (fun typeDef -> + match typeDef with + | SynTypeDefn(typeInfo = SynComponentInfo(longId = []; synType = Some(SynType.Tuple(isStruct, path, tupleRange))) as compInfo) -> + // 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 newCompInfo = SynComponentInfo(attrs, typars, constraints, longId, xmlDoc, fixity, vis, tupleRange, None) + let (SynTypeDefn(_, repr, members, implicitCtor, range, trivia)) = typeDef + Some(SynTypeDefn(newCompInfo, repr, members, implicitCtor, range, trivia)) + | SynTypeDefn(typeInfo = SynComponentInfo(longId = [])) -> None + | _ -> Some typeDef) 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 @@ -5349,7 +5371,7 @@ 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 (SynComponentInfo(Attributes attribs, _, _, longPath, xml, _, vis, im, _)) = compInfo let id = ComputeModuleName longPath let modAttrs = TcAttributes cenv env AttributeTargets.ModuleDecl attribs @@ -5358,7 +5380,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 +5466,7 @@ 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 modDecl = [SynModuleDecl.NestedModule(SynComponentInfo(attribs, None, [], [modName], xml, false, vis, m, None), false, defs, true, m, SynModuleDeclNestedModuleTrivia.Zero)] nsp, modDecl else longId, defs @@ -5793,7 +5815,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 +5903,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 +5948,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 +5960,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 e93c217da66..cae80738361 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) @@ -4182,11 +4183,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 @@ -4287,7 +4288,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)) @@ -4305,7 +4306,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. @@ -5820,7 +5821,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 @@ -7149,7 +7150,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) @@ -7218,7 +7219,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 @@ -8247,7 +8253,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 @@ -8912,7 +8918,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)) | _ -> @@ -9149,7 +9155,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 -> @@ -9285,7 +9290,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) @@ -10168,18 +10173,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 @@ -10405,7 +10408,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. @@ -10480,7 +10483,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 @@ -10610,7 +10613,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 @@ -10620,7 +10623,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 @@ -10629,7 +10632,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 @@ -10925,7 +10928,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 @@ -10983,7 +10986,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 @@ -11769,15 +11772,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) @@ -12057,7 +12080,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) @@ -12123,7 +12146,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)) @@ -12221,7 +12244,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 @@ -12246,7 +12269,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 @@ -12332,7 +12355,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 @@ -12797,8 +12820,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 9e3014896c8..3098748932e 100644 --- a/src/Compiler/Checking/Expressions/CheckExpressions.fsi +++ b/src/Compiler/Checking/Expressions/CheckExpressions.fsi @@ -483,6 +483,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..ffae487d805 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, indexed by logical name. + eOpenedTypeOperators: NameMultiMap + /// 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 = Map.empty 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 @@ -874,6 +930,9 @@ let AddTyconByAccessNames bulkAddMode (tcrefs: TyconRef[]) (tab: LayeredMultiMap /// Add a record field to the corresponding sub-table of the name resolution environment let AddRecdField (rfref: RecdFieldRef) tab = NameMultiMap.add rfref.FieldName rfref tab +/// Index a MethInfo by its logical name into a NameMultiMap sub-table of the environment. +let AddMethInfoByLogicalName (minfo: MethInfo) tab = NameMultiMap.add minfo.LogicalName minfo tab + /// Add a set of union cases to the corresponding sub-table of the environment let AddUnionCases1 (tab: Map<_, _>) (ucrefs: UnionCaseRef list) = (tab, ucrefs) ||> List.fold (fun acc ucref -> @@ -1215,9 +1274,12 @@ let rec AddStaticContentOfTypeToNameEnv (g:TcGlobals) (amap: Import.ImportMap) a let nenv = { nenv with eUnqualifiedItems = nenv.eUnqualifiedItems.AddMany items } + let allMethInfos = + IntrinsicMethInfosOfType infoReader None ad AllowMultiIntfInstantiations.Yes PreferOverrides m ty + let methodGroupItems = // Methods - IntrinsicMethInfosOfType infoReader None ad AllowMultiIntfInstantiations.Yes PreferOverrides m ty + allMethInfos |> ChooseMethInfosForNameEnv g m ty // Combine methods and extension method groups of the same type |> List.map (fun pair -> @@ -1234,7 +1296,28 @@ 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 = + allMethInfos + |> 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 + let eOpenedTypeOperators = + // Preserve source-declaration order of `operatorMethods` within each bucket + // (matches the prior list-prepend semantics). `List.foldBack` lands the first + // declared method at the head of the bucket; do not switch to `List.fold` or + // `NameMultiMap.initBy` without reversing first. See `docs/name-resolution-operators.md`. + List.foldBack AddMethInfoByLogicalName operatorMethods nenv.eOpenedTypeOperators + { nenv with eOpenedTypeOperators = 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 +1698,72 @@ 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. Bucket order is source-declaration order + // within each `open type` and most-recently-opened-first across `open type`s; see + // `AddStaticContentOfTypeToNameEnv` and `docs/name-resolution-operators.md`. + let openTypeResults = + match traitInfo.SupportTypes with + | [] -> [] + | firstSupportTy :: _ -> + nenv.eOpenedTypeOperators + |> NameMultiMap.find nm + |> List.map (fun minfo -> (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 +3372,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 +3750,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 +3914,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..d520e7c24dc 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: NameMultiMap + /// 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..275495fe58e 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 @@ -2396,26 +2398,20 @@ let CheckEntityDefn cenv env (tycon: Entity) = | true, h -> h | _ -> [] + // Index MethInfos by LogicalName; used for fresh-build groupings below. + let methInfosByLogicalName (xs: MethInfo list) : NameMultiMap = + NameMultiMap.initBy (fun m -> m.LogicalName) xs + // precompute methods grouped by MethInfo.LogicalName - let hashOfImmediateMeths = - let h = Dictionary() - for minfo in immediateMeths do - match h.TryGetValue minfo.LogicalName with - | true, methods -> - h[minfo.LogicalName] <- minfo :: methods - | false, _ -> - h[minfo.LogicalName] <- [minfo] - h + let immediateMethsByLogicalName = methInfosByLogicalName immediateMeths let getOtherMethods (minfo : MethInfo) = - [ - //we have added all methods to the dictionary on the previous step - let methods = hashOfImmediateMeths[minfo.LogicalName] - for m in methods do - // use referential identity to filter out 'minfo' method - if not(Object.ReferenceEquals(m, minfo)) then - yield m - ] + [ for m in NameMultiMap.find minfo.LogicalName immediateMethsByLogicalName do + // use referential identity to filter out 'minfo' method + if not (Object.ReferenceEquals(m, minfo)) then + yield m ] + // Scan-so-far: each duplicate pair reported once, when the second member is seen. + // Symmetrizing (via NameMultiMap) would double-emit — see immediateMethsByLogicalName above. let hashOfImmediateProps = Dictionary() for minfo in immediateMeths do let nm = minfo.LogicalName @@ -2496,7 +2492,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = | None -> m | Some vref -> vref.DefinitionRange - if hashOfImmediateMeths.ContainsKey nm then + if immediateMethsByLogicalName.ContainsKey nm then errorR(Error(FSComp.SR.chkPropertySameNameMethod(nm, NicePrint.minimalStringOfType cenv.denv ty), m)) let others = getHash hashOfImmediateProps nm @@ -2544,18 +2540,14 @@ let CheckEntityDefn cenv env (tycon: Entity) = hashOfImmediateProps[nm] <- pinfo :: others if not (isInterfaceTy g ty) then - let hashOfAllVirtualMethsInParent = Dictionary() - for minfo in allVirtualMethsInParent do - let nm = minfo.LogicalName - let others = getHash hashOfAllVirtualMethsInParent nm - hashOfAllVirtualMethsInParent[nm] <- minfo :: others + let parentVirtualMethsByLogicalName = methInfosByLogicalName allVirtualMethsInParent for minfo in immediateMeths do if not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance then let nm = minfo.LogicalName let m = (match minfo.ArbitraryValRef with None -> m | Some vref -> vref.DefinitionRange) - let parentMethsOfSameName = getHash hashOfAllVirtualMethsInParent nm + let parentMethsOfSameName = NameMultiMap.find nm parentVirtualMethsByLogicalName let checkForDup erasureFlag (minfo2: MethInfo) = minfo2.IsDispatchSlot && MethInfosEquivByNameAndSig erasureFlag true g cenv.amap m minfo minfo2 - match parentMethsOfSameName |> List.tryFind (checkForDup EraseAll) with + match parentMethsOfSameName |> List.tryFindBack (checkForDup EraseAll) with | None -> () | Some minfo -> let mtext = NicePrint.stringOfMethInfo cenv.infoReader m cenv.denv minfo @@ -2568,7 +2560,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = if minfo.IsDispatchSlot then let nm = minfo.LogicalName let m = (match minfo.ArbitraryValRef with None -> m | Some vref -> vref.DefinitionRange) - let parentMethsOfSameName = getHash hashOfAllVirtualMethsInParent nm + let parentMethsOfSameName = NameMultiMap.find nm parentVirtualMethsByLogicalName let checkForDup erasureFlag minfo2 = MethInfosEquivByNameAndSig erasureFlag true g cenv.amap m minfo minfo2 if parentMethsOfSameName |> List.exists (checkForDup EraseAll) then 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/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 a4007147b9a..bcf940832e0 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1809,6 +1809,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" 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/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index ed1a4da5bf5..c7779b59384 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -947,7 +947,7 @@ module ParsedInput = | _ -> None and walkComponentInfo isModule compInfo = - let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, _, _, _, _, r)) = + let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, _, _, _, _, r, _)) = compInfo let constraints = cs1 @ cs2 @@ -2286,7 +2286,7 @@ module ParsedInput = | _ -> () and walkComponentInfo isTypeExtensionOrAlias compInfo = - let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, longIdent, _, _, _, _)) = + let (SynComponentInfo(Attributes attrs, TyparsAndConstraints(typars, cs1), cs2, longIdent, _, _, _, _, _)) = compInfo let constraints = cs1 @ cs2 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..d6ce095956a 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fs +++ b/src/Compiler/SyntaxTree/SyntaxTree.fs @@ -1390,7 +1390,8 @@ type SynComponentInfo = xmlDoc: PreXmlDoc * preferPostfix: bool * accessibility: SynAccess option * - range: range + range: range * + synType: SynType option member this.Range = match this with diff --git a/src/Compiler/SyntaxTree/SyntaxTree.fsi b/src/Compiler/SyntaxTree/SyntaxTree.fsi index 2206d199c39..91b43cc75ed 100644 --- a/src/Compiler/SyntaxTree/SyntaxTree.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTree.fsi @@ -1519,7 +1519,8 @@ type SynComponentInfo = xmlDoc: PreXmlDoc * preferPostfix: bool * accessibility: SynAccess option * - range: range + range: range * + synType: SynType option /// Gets the syntax range of this construct member Range: range 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 92649150c9d..a469d7a738a 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 9208d5034d8..b55e885f535 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,7 @@ 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 info = SynComponentInfo($1 @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3, None) 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 +709,7 @@ 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 info = SynComponentInfo($1 @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3, None) 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 +718,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, b, _xmlDoc, d, d2, d3, synTy), typeRepr, members, range, trivia)) = $4 leadingKeyword _xmlDoc.MarkAsInvalid() let attrs = $1 @ cas let xmlDoc = grabXmlDoc(parseState, $1, 1) @@ -725,7 +726,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, b, xmlDoc, d, d2, d3, synTy), 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 +799,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, lid, _xmlDoc, fixity, vis, mLongId, synTy)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then typeDefnSig else let range = unionRangeWithXmlDoc _xmlDoc range @@ -807,7 +808,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, lid, xmlDoc, fixity, vis, mLongId, synTy) SynTypeDefnSig(componentInfo, typeRepr, members, range, trivia) tyconSpfn :: $3 } @@ -1328,11 +1329,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, b, _xmlDoc, d, d2, d3, synTy), 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, b, xmlDoc, d, d2, d3, synTy), e, f, g, mDefn, trivia) let types = tc :: $5 [ SynModuleDecl.Types(types, (rhs parseState 3, types) ||> unionRangeWithListBy (fun t -> t.Range)) ] } @@ -1364,7 +1365,7 @@ 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 info = SynComponentInfo(attribs @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3, None) let mEquals = rhs parseState 4 let trivia: SynModuleDeclNestedModuleTrivia = { ModuleKeyword = Some mModule; EqualsRange = Some mEquals } let m = @@ -1379,7 +1380,7 @@ 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 info = SynComponentInfo(attribs @ attribs2, None, [], path, xmlDoc, false, vis, rhs parseState 3, None) let trivia: SynModuleDeclNestedModuleTrivia = { ModuleKeyword = Some mModule; EqualsRange = None } [ SynModuleDecl.NestedModule(info, isRec, [], false, mWhole, trivia) ] } @@ -1602,10 +1603,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, lid, 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 -> match lid with [] -> rhs parseState 2 | _ -> rangeOfLid lid + SynComponentInfo ($1, typars, $3, lid, xmlDoc, fixity, vis, m, synTy) } /* Part of a set of type definitions */ tyconDefnList: @@ -1614,7 +1615,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, lid, _xmlDoc, fixity, vis, mLongId, synTy)) = componentInfo if xmlDoc.IsEmpty then if _xmlDoc.IsEmpty then typeDefn else let range = unionRangeWithXmlDoc _xmlDoc range @@ -1623,7 +1624,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, lid, xmlDoc, fixity, vis, mLongId, synTy) SynTypeDefn(componentInfo, typeRepr, members, implicitConstructor, range, trivia) tyconDefn :: $3 } | @@ -1647,7 +1648,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 (SynComponentInfo(_, _, _, lid, _, _, _, _, _)) = $1 let mEquals = rhs parseState 7 // Gets the XML doc comments prior to the implicit constructor let xmlDoc = grabXmlDoc (parseState, $2, 2) @@ -2540,16 +2541,37 @@ interfaceMember: tyconNameAndTyparDecls: | opt_access path - { None, $2.LongIdent, false, $1 } + { None, $2.LongIdent, false, $1, None } | opt_access prefixTyparDecls path - { Some $2, $3.LongIdent, false, $1 } + { Some $2, $3.LongIdent, false, $1, None } | opt_access path postfixTyparDecls - { Some $3, $2.LongIdent, true, $1 } + { Some $3, $2.LongIdent, true, $1, None } + + /* Tuple type extension: type ('T1 * 'T2) with ..., type struct ('T1 * 'T2) with ..., etc. */ + | opt_access opt_struct LPAREN appTypeCanBeNullable STAR tupleOrQuotTypeElements rparen + { let mStar = rhs parseState 5 + let path = SynTupleTypeSegment.Type $4 :: SynTupleTypeSegment.Star mStar :: $6 + let synTy = + match $2 with + | Some mStruct -> SynType.Tuple(true, path, unionRanges mStruct (rhs parseState 7)) + | None -> mkSynTypeTuple path + None, [], false, $1, Some synTy } + + /* 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 path = [SynTupleTypeSegment.Type $3; SynTupleTypeSegment.Star mStar] + let synTy = mkSynTypeTuple path + None, [], false, $1, Some synTy } | opt_access recover - { None, [], false, $1 } + { None, [], false, $1, None } prefixTyparDecls: | typar @@ -6991,6 +7013,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 6896c33a6a4..400891385ef 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 diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 3966a59a853..2250c0e5729 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 diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 08828606dd6..56161f7e5bb 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 diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 5a28ec15953..ce9862970c2 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 diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 5dead052c6a..095102a802f 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 diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index f491fb0c4c5..df856cefa40 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 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index f8185fb2a22..72dd0eff8e1 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 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 7e81e135eeb..185e326d929 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 diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 22a5db4504c..daffb8d01b4 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 diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 8f5220ba47e..6b3602f5490 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 diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 17509827124..bd164755696 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 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index bf26625f8ec..8c134e2e39d 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 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 2a63e5ad753..6d46e90308a 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 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..cfde91bece7 --- /dev/null +++ b/testcheck.fsx @@ -0,0 +1,21 @@ +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/Members/CheckEntityDefnEdgeCases.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Members/CheckEntityDefnEdgeCases.fs new file mode 100644 index 00000000000..5e77b410b38 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Members/CheckEntityDefnEdgeCases.fs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Conformance.Members + +open Xunit +open FSharp.Test.Compiler + +// Regression coverage for duplicate-member diagnostics emitted by CheckEntityDefn +// in src/Compiler/Checking/PostInferenceChecks.fs (lines ~2483-2566). +module CheckEntityDefnEdgeCases = + + // (a) Duplicate abstract method inherited from a base type, where the two + // signatures differ only in an erased unit-of-measure type argument. + // Exercises chkDuplicateMethodInheritedType(WithSuffix) (FS0442). + [] + let ``Duplicate abstract method differing only in erased measure (FS0442)`` () = + FSharp """ +module Test +[] type m + +[] +type A() = + abstract DoStuff : int -> int + +[] +type B() = + inherit A() + abstract DoStuff : int -> int + """ + |> typecheck + |> shouldFail + |> withErrorCode 442 + + // (b) Property and method on the same type share a name. + // Exercises chkPropertySameNameMethod (FS0434). + [] + let ``Property and method with same name (FS0434)`` () = + FSharp """ +module Test +type T() = + member val P = 0 with get + member _.P() = 1 + """ + |> typecheck + |> shouldFail + |> withErrorCode 434 + + // (c) A new member in a derived class has the same name/signature as an + // inherited abstract member but is not declared as override. + // Exercises tcNewMemberHidesAbstractMember(WithSuffix) (FS0864 warning). + [] + let ``New member hides inherited abstract member (FS0864 warning)`` () = + FSharp """ +module Test +type Base() = + abstract M : int -> int + default _.M x = x + +type Derived() = + inherit Base() + member _.M(x: int) = x + 1 + """ + |> withOptions [ "--warnaserror+" ] + |> typecheck + |> shouldFail + |> withErrorCode 864 + + // (d) Indexer and non-indexer property share a name on the same type. + // Exercises chkPropertySameNameIndexer (FS0436). + [] + let ``Indexer vs non-indexer property with same name (FS0436)`` () = + FSharp """ +module Test +type T() = + let mutable x = 0 + member _.P with get () = x and set v = x <- v + member _.P with get (i: int) = i + """ + |> typecheck + |> shouldFail + |> withErrorCode 436 + + // (e) Getter/setter for the same (non-indexer) property have different types. + // Exercises chkGetterAndSetterHaveSamePropertyType (FS3172). + [] + let ``Getter and setter with different property types (FS3172)`` () = + FSharp """ +module Test +type T() = + let mutable x = 0 + member _.P + with get () : int = x + and set (v: string) = ignore v + """ + |> typecheck + |> shouldFail + |> withErrorCode 3172 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..4c2a979d372 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/ExtensionConstraintsTests.fs @@ -0,0 +1,469 @@ +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 ``open type with homograph operators yields all overloads for SRTP`` () = + compileAndRunPreview "OpenTypeOperatorHomographOrder.fs" + + [] + let ``open type homograph operators across multiple holder types accumulate`` () = + compileAndRunPreview "OpenTypeOperatorHomographMultipleHolders.fs" + + [] + let ``open type nested in a module scopes extension operator correctly`` () = + compileAndRunPreview "OpenTypeOperatorNestedModule.fs" + + [] + let ``local let binding shadows open type extension operator`` () = + compileAndRunPreview "OpenTypeOperatorShadowing.fs" + + [] + let ``open type SRTP dispatch selects overload per argument type across holders`` () = + compileAndRunPreview "OpenTypeOperatorSRTPDispatch.fs" + + [] + let ``open type homograph overloads on single holder differ by parameter type`` () = + compileAndRunPreview "OpenTypeOperatorOverloadByParam.fs" + + [] + let ``open type operator with CompiledName attribute resolves by F# symbol`` () = + compileAndRunPreview "OpenTypeOperatorCompiledName.fs" + + [] + let ``open type extension operator crosses assembly boundary`` () = + let library = + FSharp """ +module OpLib + +[] +type Ops = + static member inline (+!) (a: int, b: int) = a + b + 7 + static member inline (+!) (a: string, b: string) = a + b + "_X" + """ + |> withName "OpLib" + |> asLibrary + |> withLangVersionPreview + + FSharp """ +module Consumer +open OpLib +open type Ops + +let r1 : int = 10 +! 20 +if r1 <> 37 then failwith (sprintf "Expected 37, got %d" r1) + +let r2 : string = "a" +! "b" +if r2 <> "ab_X" then failwith (sprintf "Expected 'ab_X', got '%s'" r2) + +let inline combine (a: ^T) (b: ^T) = a +! b +let r3 : int = combine 1 2 +if r3 <> 10 then failwith (sprintf "Expected 10, got %d" r3) + """ + |> asExe + |> withLangVersionPreview + |> withReferences [library] + |> compileAndRun + |> shouldSucceed + + [] + 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/OpenTypeOperatorCompiledName.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorCompiledName.fs new file mode 100644 index 00000000000..ae48e0a62e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorCompiledName.fs @@ -0,0 +1,21 @@ +// Regression: a holder-type operator whose CLR emission is renamed via +// [] must still be resolvable through 'open type' at +// the F# source level. The LogicalName (op_PlusPlus etc.) is what feeds +// into eOpenedTypeOperators keying and IsLogicalOpName filtering, so +// CompiledName must not interfere with either. + +module OpenTypeOperatorCompiledName + +[] +type Ops = + [] + static member inline (++) (a: int, b: int) = a + b + 100 + +open type Ops + +let r1 : int = 1 ++ 2 +if r1 <> 103 then failwith $"Expected 103, got {r1}" + +let inline bump (a: ^T) (b: ^T) = a ++ b +let r2 : int = bump 5 6 +if r2 <> 111 then failwith $"Expected 111, got {r2}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographMultipleHolders.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographMultipleHolders.fs new file mode 100644 index 00000000000..01e5275f5cf --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographMultipleHolders.fs @@ -0,0 +1,28 @@ +// Regression: homograph operators declared across TWO separate holder types +// each opened via 'open type'. Exercises cross-call bucket accumulation of +// eOpenedTypeOperators (NameMultiMap) — each 'open type' is a +// separate AddStaticContentOfTypeToNameEnv call; both must contribute to the +// same bucket keyed by LogicalName. + +module OpenTypeOperatorHomographMultipleHolders + +[] +type OpsA = + static member inline (+!) (a: int, b: int) = a + b + 10 + +[] +type OpsB = + static member inline (+!) (a: float, b: float) = a + b + 100.0 + static member inline (+!) (a: string, b: string) = a + b + "_B" + +open type OpsA +open type OpsB + +let r1 : int = 1 +! 2 +if r1 <> 13 then failwith $"Expected 13, got {r1}" + +let r2 : float = 1.5 +! 2.5 +if r2 <> 104.0 then failwith $"Expected 104.0, got {r2}" + +let r3 : string = "hi" +! "world" +if r3 <> "hiworld_B" then failwith $"Expected 'hiworld_B', got '{r3}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographOrder.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographOrder.fs new file mode 100644 index 00000000000..560d82d20ea --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorHomographOrder.fs @@ -0,0 +1,24 @@ +// Regression: multiple homograph operators declared on a single 'open type' holder +// must all be discoverable via SRTP. Exercises the >=2 entries-per-bucket path of +// eOpenedTypeOperators (NameMultiMap), where within-call source order +// is preserved by List.foldBack at insertion. + +module OpenTypeOperatorHomographOrder + +[] +type Ops = + // Three homograph (++!) overloads on int * int / float * float / string * string + static member inline (++!) (a: int, b: int) = a + b + 1 + static member inline (++!) (a: float, b: float) = a + b + 1.0 + static member inline (++!) (a: string, b: string) = a + b + "!" + +open type Ops + +let r1 : int = 1 ++! 2 +if r1 <> 4 then failwith $"Expected 4, got {r1}" + +let r2 : float = 1.5 ++! 2.5 +if r2 <> 5.0 then failwith $"Expected 5.0, got {r2}" + +let r3 : string = "hi" ++! "world" +if r3 <> "hiworld!" then failwith $"Expected 'hiworld!', got '{r3}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorNestedModule.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorNestedModule.fs new file mode 100644 index 00000000000..1ed343aa506 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorNestedModule.fs @@ -0,0 +1,16 @@ +// Regression: 'open type' inside a nested module correctly scopes the +// extension operator only to that module, and a sibling scope sees neither +// the operator nor the holder. + +module OpenTypeOperatorNestedModule + +[] +type Ops = + static member inline (+.?) (a: int, b: int) = a * b + 1 + +module Inner = + open type Ops + let useIt () : int = 3 +.? 4 + +let inner = Inner.useIt() +if inner <> 13 then failwith $"Expected 13, got {inner}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorOverloadByParam.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorOverloadByParam.fs new file mode 100644 index 00000000000..b07509e649d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorOverloadByParam.fs @@ -0,0 +1,20 @@ +// Regression: a single 'open type' holder declares two homograph overloads +// that differ only in one parameter type (int*int vs int*float). Overload +// resolution at the call site must pick the correct overload based on the +// *second* argument's type. Exercises multi-entry bucket + downstream +// ResolveOverloading disambiguation. + +module OpenTypeOperatorOverloadByParam + +[] +type Ops = + static member inline (+?) (a: int, b: int) = a + b + 1 + static member inline (+?) (a: int, b: float) = float a + b + 0.5 + +open type Ops + +let r1 : int = 10 +? 20 +if r1 <> 31 then failwith $"Expected 31, got {r1}" + +let r2 : float = 10 +? 2.0 +if r2 <> 12.5 then failwith $"Expected 12.5, got {r2}" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorSRTPDispatch.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorSRTPDispatch.fs new file mode 100644 index 00000000000..7b895380089 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorSRTPDispatch.fs @@ -0,0 +1,33 @@ +// Regression: an inline SRTP-using function dispatches to different 'open type' +// extension operator overloads based on argument type, where each overload is +// declared on a *separate* holder type. Exercises SelectExtensionMethInfosForTrait +// pulling candidates from the eOpenedTypeOperators bucket of multiple holders, +// with overload resolution selecting the applicable one per call site. + +module OpenTypeOperatorSRTPDispatch + +[] +type IntOps = + static member inline (+!) (a: int, b: int) = a + b + 1 + +[] +type StringOps = + static member inline (+!) (a: string, b: string) = a + b + "!" + +open type IntOps +open type StringOps + +let inline combine (a: ^T) (b: ^T) = a +! b + +let r1 : int = combine 10 20 +if r1 <> 31 then failwith $"Expected 31, got {r1}" + +let r2 : string = combine "hi" "world" +if r2 <> "hiworld!" then failwith $"Expected 'hiworld!', got '{r2}'" + +// Direct call sites as well +let r3 : int = 1 +! 2 +if r3 <> 4 then failwith $"Expected 4, got {r3}" + +let r4 : string = "a" +! "b" +if r4 <> "ab!" then failwith $"Expected 'ab!', got '{r4}'" diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorShadowing.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorShadowing.fs new file mode 100644 index 00000000000..cf8c0eaaa04 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/TypeConstraints/ExtensionConstraints/testFiles/OpenTypeOperatorShadowing.fs @@ -0,0 +1,21 @@ +// Regression: a local 'let' binding of an operator shadows an 'open type'-provided +// extension operator at the point of definition. Exercises correct precedence +// between the eOpenedTypeOperators bucket and the standard unqualified-value lookup. + +module OpenTypeOperatorShadowing + +[] +type Ops = + static member inline (+%) (a: int, b: int) = a + b + 1 + +open type Ops + +// Before shadowing: the extension wins. +let before : int = 10 +% 20 +if before <> 31 then failwith $"Expected 31 before shadow, got {before}" + +// Local shadow. +let inline (+%) (a: int) (b: int) : int = a - b + +let after : int = 10 +% 20 +if after <> -10 then failwith $"Expected -10 after shadow, got {after}" 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 a345c31d728..d5db8b76938 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -55,6 +55,7 @@ + @@ -141,6 +142,7 @@ + @@ -171,6 +173,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..e3517718295 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.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, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Syntax.SynType]) 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() @@ -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..afe093cf659 100644 --- a/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs +++ b/tests/FSharp.Compiler.Service.Tests/InteractiveCheckerTests.fs @@ -19,7 +19,7 @@ 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, longIdent, _, _, _, range, _synType)) = componentInfo // TODO : attrs, typarDecls and typarConstraints [identAndRange (longIdentToString longIdent) range] let extractFromTypeDefn (typeDefn: SynTypeDefn) = 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.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..e49bfaae7d2 100644 --- a/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/ColonBeforeReturnTypeIsPartOfTriviaInProperties.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [GetSetMember diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl index f53b47a4eaa..665090c5690 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMember.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Tiger], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,10)), + false, None, (2,5--2,10), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl index dde24f9afc2..4996b2b4011 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInConstructorSynMemberDefnMemberOptAsSpec.fs.bsl @@ -13,7 +13,7 @@ ImplFile (SynComponentInfo ([], None, [], [Tiger], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,10)), + false, None, (2,5--2,10), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl index 3a657b48cb7..35b52856f6b 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInFullSynMemberDefnMemberProperty.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bird], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,9)), + false, None, (2,5--2,9), None), ObjectModel (Unspecified, [GetSetMember diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl index 566cba41a61..23216ec1ee9 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSecondaryConstructor.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl index cd43cce87f7..dafd6a56689 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnLetBindings.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl index ff220a2a034..0fabeb7d8ff 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInSynMemberDefnMember.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl index 8698f8ddc7c..eb7e3dacf5b 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfAttributeShouldBeIncludedInWriteOnlySynMemberDefnMemberProperty.fs.bsl @@ -13,7 +13,7 @@ ImplFile (SynComponentInfo ([], None, [], [Crane], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,10)), + false, None, (2,5--2,10), None), ObjectModel (Unspecified, [GetSetMember diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl index 0a48a4272fc..9e3c5d89cbd 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBinding.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl index c8eb3a32a50..5cc68c71e2e 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithParameters.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl index 431946b6f94..0d57fcd75f0 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInMemberBindingWithReturnType.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl index 72ee28c403d..4049facd933 100644 --- a/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Binding/RangeOfEqualSignShouldBePresentInProperty.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl index 65b7c6c556f..a62ce5688e3 100644 --- a/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/MultipleSynEnumCasesHaveBarRange.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl index ca80ebf45a9..cdbdca55b3b 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseHasBarRange.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl index 4ac684664e3..20388e58664 100644 --- a/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/EnumCase/SingleSynEnumCaseWithoutBar.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl index ce9e69a010f..6b1b9b34e77 100644 --- a/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/SynExprObjWithSetter.fs.bsl @@ -16,7 +16,7 @@ ImplFile Range = (2,2--2,15) }] Range = (2,0--2,17) }], None, [], [CFoo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,9)), + false, None, (3,5--3,9), None), ObjectModel (Unspecified, [ImplicitCtor 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..44cacae7e06 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl index 34aa70d3379..ff8850ddb94 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl index 9f3ccbf040b..57538fe0f56 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/AbstractMemberKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl index b8ef7219487..201b17a5e42 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultKeyword.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl index 028585bc0b5..5063d46302d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DefaultValKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [AutoProperty diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl index 14ae9d51f17..48bd655cc1f 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl index 74f4d74b17e..5761b9aa5e9 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/DoStaticKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl index 3d161da52e3..ef81df214ab 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl index d9ba80b80df..29886237d7d 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/MemberValKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AutoProperty diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl index ebc374d1432..1b14fd44acc 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/NewKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl index f9d0ec25562..04989344b91 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [D], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl index 837e1b368fd..7393e18613b 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/OverrideValKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AutoProperty diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl index e75b4c25218..30861fa9830 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl index 73e5a522b4b..0aaee5d7deb 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticAbstractMemberKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl index ef71149048c..2c8574c708a 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl index 5251188440d..4934917b3e7 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticLetRecKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl index 541b6f582a9..022a0a9f1f2 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl index feb33135568..2dd0e05a2e6 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticMemberValKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AutoProperty diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl index 47aa7f74ac2..2c5a5744065 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/StaticValKeyword.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl index 111c2ac7565..e8b4c68af55 100644 --- a/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/LeadingKeyword/ValKeyword.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl index 33675b1a3a1..bc5cabef884 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithLeadingSlash.fs.bsl @@ -15,7 +15,7 @@ ImplFile Range = (2,2--2,9) }] Range = (2,0--2,11) }], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,17--2,18)), + false, None, (2,17--2,18), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl index fc29ce7d7e1..f94ca2c5a06 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithNoSlashes.fs.bsl @@ -15,7 +15,7 @@ ImplFile Range = (2,2--2,9) }] Range = (2,0--2,11) }], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,17--2,18)), + false, None, (2,17--2,18), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl index 6e423837385..9287d1149da 100644 --- a/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl +++ b/tests/service/data/SyntaxTree/Measure/SynTypeTupleInMeasureTypeWithStartAndSlash.fs.bsl @@ -15,7 +15,7 @@ ImplFile Range = (2,2--2,9) }] Range = (2,0--2,11) }], None, [], [R], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,17--2,18)), + false, None, (2,17--2,18), None), Simple (TypeAbbrev (Ok, 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..6103adc0d50 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 01.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot 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..1cba5b6dc9d 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 02.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot 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..544a4fecc3d 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 03.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot 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..15fe20d82df 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 04.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot 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..8aa56061de2 100644 --- a/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Abstract - Property 05.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot 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..057490e931c 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..f4527174910 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..fbe6fbb410f 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..8380c33e587 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..17c68fef71f 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..9b94b8a94ae 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..8b26f542ce8 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor 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..d01bb417a8e 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty @@ -46,4 +46,21 @@ ImplFile (6,0)-(6,1) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(6,0)-(6,1) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. +(6,0)-(6,1) parse error Incomplete structured construct at or before this point. (no 'in' context found: [[NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSet; NONTERM_classMemberSpfnGetSet]; + [NONTERM_autoPropsDefnDecl]; [NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]]). Expected identifier, '(', '(*)' or other token. 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..788d0e9b111 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 09.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty @@ -69,4 +69,21 @@ ImplFile (5,4)-(5,10) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:23). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(5,4)-(5,10) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. +(5,4)-(5,10) parse error Incomplete structured construct at or before this point. (no 'in' context found: [[NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSet; NONTERM_classMemberSpfnGetSet]; + [NONTERM_autoPropsDefnDecl]; [NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]]). Expected identifier, '(', '(*)' or other token. 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..3c8907e662a 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 10.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty @@ -45,4 +45,21 @@ ImplFile (5,0)-(5,0) parse error Unexpected syntax or possible incorrect indentation: this token is offside of context started at position (4:22). Try indenting this further. To continue using non-conforming indentation, pass the '--strict-indentation-' flag to the compiler, or set the language version to F# 7. -(5,0)-(5,0) parse error Incomplete structured construct at or before this point. Expected identifier, '(', '(*)' or other token. +(5,0)-(5,0) parse error Incomplete structured construct at or before this point. (no 'in' context found: [[NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSetElements; NONTERM_classMemberSpfnGetSetElements; + NONTERM_classMemberSpfnGetSetElements]; + [NONTERM_classMemberSpfnGetSet; NONTERM_classMemberSpfnGetSet]; + [NONTERM_autoPropsDefnDecl]; [NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]; + [NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl; + NONTERM_autoPropsDefnDecl; NONTERM_autoPropsDefnDecl]]). Expected identifier, '(', '(*)' or other token. 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..318119d2b1f 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 11.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..1680fbaebe4 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 12.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..0b09cd26e96 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 13.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AutoProperty 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..09bfaeb4091 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 14.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor 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..431c2c6f70d 100644 --- a/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Auto property 15.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl index 0706eb256c4..7ee583c311f 100644 --- a/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl index e2d791b5860..061104c253e 100644 --- a/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl index eb75b56a51d..f32fd6aaf6f 100644 --- a/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl index 2c6ac32e12e..4e58dfa7de6 100644 --- a/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Do 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl index 517082e1e06..7459e70a46c 100644 --- a/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl index 874473c1059..bcf105ef6f1 100644 --- a/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl index b2663b51b18..029c616f848 100644 --- a/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl index 878fc8647bd..0e6e76701a0 100644 --- a/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl index 80f5a737513..510741948cc 100644 --- a/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl index 3c29ce9e5ab..1a497e65f30 100644 --- a/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl index 9d652142213..d59b8bf0ca3 100644 --- a/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl index 77a967f379a..edd87849a7d 100644 --- a/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Struct, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl index 4f9de01f3a6..26fb0d81693 100644 --- a/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 09.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl index fa1e21bf3e1..eefb2454d5c 100644 --- a/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 10.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl index e62fa49126b..592cd278adb 100644 --- a/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 11.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl index 54f58854119..ff7df862ccd 100644 --- a/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 12.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl index 86fcb6cd48d..e09135a8653 100644 --- a/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 13.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl index 4873d37e961..7cdffcefe86 100644 --- a/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 14.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl index 62e1ee5046f..6995f92ad90 100644 --- a/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Field 15.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ValField diff --git a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl index 9e5a4d2c4b8..de13922cc51 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMember 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl index f09cb92e147..2ded02ae6b6 100644 --- a/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/GetSetMemberWithInlineKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [GetSetMember 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..50105c8ed50 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..c6d6a214c78 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..c2c5d55ba0a 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..bb4b59550d3 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..4fc9ee77988 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..120126cdcd5 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..905520f8cfe 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..eed1dea158c 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..327e5cd4374 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..29be67668ac 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..29d2ea2742d 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..4e0e24b8f05 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..d00460d93d5 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..2350b5ae5fd 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..66d6f2c0b9c 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl index 06e7e3f9fdc..1a1bf221801 100644 --- a/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ImplicitCtorWithAsKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [CompilerStateCache], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, Some (Internal (2,5--2,13)), (2,14--2,32)), + false, Some (Internal (2,5--2,13)), (2,14--2,32), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl index 16618257bdd..c26180468d1 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit diff --git a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl index 80da2bd45fd..bd723e01dc3 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T1], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,7)), + false, None, (3,5--3,7), None), ObjectModel (Unspecified, [ImplicitInherit diff --git a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl index 7b476b67650..92927b4fb20 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit diff --git a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl index e502b24ef0c..80a049273a6 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit diff --git a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl index d006bbe9099..f8eceb745d5 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit diff --git a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl index 04d00187693..9a9c0a10078 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 06.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit (FromParseError (4,11--4,11), (4,4--4,11))], diff --git a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl index 2c6af3b87ee..182533b0a9d 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 07.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit (FromParseError (4,11--4,11), (4,4--4,11)); diff --git a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl index d75196d3f26..76d6d1a130d 100644 --- a/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Inherit 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Inherit diff --git a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl index c99c2599dfd..0e2edfa2597 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl index 7d67643e0fa..b8afbdd3b90 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl index 0f0731b660c..b6321ef5dfe 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl index af0e0006af0..015de9e0aee 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [T2], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,7)), + false, None, (6,5--6,7), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl index 04592eb93d6..ed7659316eb 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl index 2552febe621..969065707a3 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl index 03171bf375d..c6be5645c88 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl index ce5ae85345f..d079c4cab5e 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl index cbea58a540b..c0eae931f3a 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 09.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [T2], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,7)), + false, None, (6,5--6,7), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl index 76edb4cdbf1..4129f17b3ad 100644 --- a/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Interface 10.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [T2], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,7)), + false, None, (6,5--6,7), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl index 88576ca7ceb..d8249480e85 100644 --- a/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl index 00844e3bd36..fbb9dd6bde9 100644 --- a/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl index c7da3208795..a58495f8a4c 100644 --- a/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl index 8fb32af3ac8..a284af00d8c 100644 --- a/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [LetBindings diff --git a/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl index 9426e515461..97370e69fe3 100644 --- a/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Let 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), ObjectModel (Unspecified, [ImplicitCtor 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..07f383c30f4 100644 --- a/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member - Attributes 01.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member 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..6b1c577a0eb 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl index e6ca39bf5f5..bda6043cd3d 100644 --- a/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl index af9957edb7b..7c4636e6043 100644 --- a/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl index a7baa985888..a634811295e 100644 --- a/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl index 5b11990bd32..2ffb46ca8ef 100644 --- a/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl index 9f480a45c60..d5d490c6299 100644 --- a/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl index e33344ba3e9..d5b0c17b58b 100644 --- a/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl index c919ab5a29d..1fef5f852ce 100644 --- a/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl index 2f1415319fd..0e1d66f445c 100644 --- a/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 08.fs.bsl @@ -17,7 +17,7 @@ ImplFile { AmpersandRanges = [] })], [], (3,17--3,30))), [], [INumericNorm], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (3,5--3,17)), + true, None, (3,5--3,17), None), ObjectModel (Unspecified, [Interface diff --git a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl index a9104d2dfb0..21dd18529db 100644 --- a/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 09.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl index b30067d371f..591f046224a 100644 --- a/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 10.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl index eb37ddf77d9..76a8de9d37f 100644 --- a/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 11.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl index 33eac2d6efd..4bee79ded44 100644 --- a/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 12.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl index bb146d2a2ba..ae9df790811 100644 --- a/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Member 13.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member @@ -47,7 +47,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,6)), + false, None, (6,5--6,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl index dcd3bb70c91..9d5e6923b31 100644 --- a/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberMispelledToMeme.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Seq], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,8)), + false, None, (1,5--1,8), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl index 65401553b8f..71f6ebf9a3e 100644 --- a/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/MemberWithInlineKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 94e0c06897d..29c2b095358 100644 --- a/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Read-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 110af6cd16c..56fe1303776 100644 --- a/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/ReadwritePropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -13,7 +13,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl index c257b90f316..e9eee03f60a 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithGet.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl index 6be357ee2c4..af9f0bf2c3a 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSet.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl index c5bf35a6c4e..230ccc7785d 100644 --- a/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl +++ b/tests/service/data/SyntaxTree/Member/SignatureMemberWithSetget.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl index 5a7647188b2..d7e32f9d413 100644 --- a/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl index d339245331b..120d8661843 100644 --- a/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl index 68d1466b47a..d1dbf196ecd 100644 --- a/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Static 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl index 4838003cfc0..d5058827462 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAbstractSlotContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl index 3009a787588..175835e85a4 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheEqualsSign.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Person], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,11)), + false, None, (3,5--3,11), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl index f437240766a..f8359f6867d 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithAutoPropertyContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl index cf045eeca1f..8938e162eb1 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithGetHasXmlComment.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [GetSetMember diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl index 97c59244fb9..93182526802 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithMemberWithSetget.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl index 7277f5e58c2..3f8234aa224 100644 --- a/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/SynTypeDefnWithStaticMemberWithGetset.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [GetSetMember diff --git a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl index 70bb20dca39..5e2d9d27186 100644 --- a/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Member/Write-onlyPropertyInSynMemberDefnMemberContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl index bbc45fd79ae..3ea7bfbceaa 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAbstractSlotHasCorrectKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl index 2f12d930aa0..ab699980065 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnAutoPropertyHasCorrectKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [AutoProperty diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl index ddf52181d1c..3ed24665fcf 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberDefnMemberSynValDataHasCorrectKeyword.fs.bsl @@ -10,7 +10,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl index e697a34ef5b..b7839493ad2 100644 --- a/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl +++ b/tests/service/data/SyntaxTree/MemberFlag/SynMemberSigMemberHasCorrectKeywords.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl index 943f383f438..e384db8af7f 100644 --- a/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleMember/Open 05.fs.bsl @@ -11,7 +11,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,6)), + false, None, (5,5--5,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl index da840787205..88bfb7dde07 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/DeclaredNamespaceRangeShouldStartAtNamespaceKeyword.fs.bsl @@ -20,7 +20,7 @@ ImplFile { AmpersandRanges = [] })], [], (5,8--5,16))), [], [Teq], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (5,5--5,8)), + true, None, (5,5--5,8), None), Simple (None (5,5--5,8), (5,5--5,8)), [], None, (4,0--5,8), { LeadingKeyword = Type (5,0--5,4) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl index 34dfdc36a77..530db00c197 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/GlobalNamespaceShouldStartAtNamespaceKeyword.fs.bsl @@ -10,7 +10,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,6)), + false, None, (6,5--6,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl index adb907aea72..d86c2ae0aea 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/ModuleShouldContainModuleKeyword.fs.bsl @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [SynExprAppLocationsImpl], PreXmlDoc ((12,0), FSharp.Compiler.Xml.XmlDocCollector), false, - Some (Internal (12,7--12,15)), (12,0--12,39)), false, + Some (Internal (12,7--12,15)), (12,0--12,39), None), false, [Let (false, [SynBinding diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl index e014e4eee8b..8a06bde4422 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/MultipleDeclaredNamespacesShouldHaveARangeThatStartsAtTheNamespaceKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Teq], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,8)), + false, None, (5,5--5,8), None), ObjectModel (Class, [], (5,11--5,20)), [], None, (4,0--5,20), { LeadingKeyword = Type (5,0--5,4) EqualsRange = Some (5,9--5,10) diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl index 4afb0f52f03..fbdda21aab8 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Namespace 07.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl index 62ec379c8c3..917d8c4f92e 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/NamespaceShouldContainNamespaceKeyword.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,10)), false, + None, (3,0--3,10), None), false, [Let (false, [SynBinding 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..9a55bdf1e02 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [Expr (Const (Unit, (4,4--4,6)), (4,4--4,6))], false, (3,0--4,6), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) }); 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..8760f2a8289 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,10), + None, (3,0--3,8), None), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) }); Expr (Const (Unit, (5,0--5,2)), (5,0--5,2))], 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..63252b232ae 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,8), + None, (3,0--3,8), None), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Expr (Const (Unit, (5,0--5,2)), (5,0--5,2))], 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..1bb7e1a605c 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--5,0)), false, [], false, (3,0--5,0), + None, (3,0--5,0), None), false, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Expr (Const (Unit, (5,0--5,2)), (5,0--5,2))], 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..e0685bf7cbe 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--5,0)), true, [], false, (3,0--5,0), + None, (3,0--5,0), None), true, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Expr (Const (Unit, (5,0--5,2)), (5,0--5,2))], 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..7d67e34087d 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,12)), true, [], false, (3,0--3,12), + None, (3,0--3,12), None), true, [], false, (3,0--3,12), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Expr (Const (Unit, (5,0--5,2)), (5,0--5,2))], 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..73170d78131 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 07.fs.bsl @@ -8,14 +8,14 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [NestedModule (SynComponentInfo ([], None, [], [], 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) - EqualsRange = None })], false, (3,0--6,0), + false, None, (4,4--6,0), None), false, [], false, + (4,4--6,0), { ModuleKeyword = Some (4,4--4,10) + EqualsRange = None })], false, (3,0--6,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) }); Expr (Const (Int32 2, (6,0--6,1)), (6,0--6,1))], 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..70973e7a3d5 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 08.fs.bsl @@ -8,14 +8,14 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [NestedModule (SynComponentInfo ([], None, [], [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) - EqualsRange = None }); + false, None, (4,4--4,12), None), false, [], false, + (4,4--4,12), { ModuleKeyword = Some (4,4--4,10) + EqualsRange = None }); Expr (Const (Int32 2, (6,4--6,5)), (6,4--6,5))], false, (3,0--6,5), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,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..b8a016419ca 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 09.fs.bsl @@ -8,14 +8,14 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [NestedModule (SynComponentInfo ([], None, [], [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) - EqualsRange = Some (4,13--4,14) }); + false, None, (4,4--4,12), None), false, [], false, + (4,4--4,14), { ModuleKeyword = Some (4,4--4,10) + EqualsRange = Some (4,13--4,14) }); Expr (Const (Int32 2, (6,4--6,5)), (6,4--6,5))], false, (3,0--6,5), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,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..f29ba07aeb7 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 10.fs.bsl @@ -8,14 +8,14 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [NestedModule (SynComponentInfo ([], None, [], [], 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) - EqualsRange = None }); + false, None, (4,4--6,4), None), false, [], false, + (4,4--6,4), { ModuleKeyword = Some (4,4--4,10) + EqualsRange = None }); Expr (Const (Int32 2, (6,4--6,5)), (6,4--6,5))], false, (3,0--6,5), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,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..2befd4166be 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 11.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--5,0)), false, [], false, (3,0--5,0), + None, (3,0--5,0), None), false, [], false, (3,0--5,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Expr (Ident A, (5,0--5,1))], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, 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..419295ecacb 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 12.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--4,0)), false, [], false, (3,0--4,0), + None, (3,0--4,0), None), false, [], false, (3,0--4,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None })], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, 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..b369b43c06e 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 13.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,8), + None, (3,0--3,8), None), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None })], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, 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..aff439a8f0b 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 14.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,10), + None, (3,0--3,8), None), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) })], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, 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..464de22dc8c 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 15.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,10), + None, (3,0--3,8), None), false, [], false, (3,0--3,10), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--3,10), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), 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..082ccdb6a22 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 16.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--3,8), + None, (3,0--3,8), None), false, [], false, (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None })], PreXmlDocEmpty, [], None, (1,0--3,8), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), 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..d2c16038e34 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespace/Nested module 17.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--4,0)), false, [], false, (3,0--4,0), + None, (3,0--4,0), None), false, [], false, (3,0--4,0), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None })], PreXmlDocEmpty, [], None, (1,0--4,0), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl index 785521f5d0d..7be3dee2194 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/GlobalNamespaceShouldStartAtNamespaceKeyword.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,8)), + false, None, (6,5--6,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl index fbd3308bd1f..c31d3daf28e 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/ModuleAbbreviation.fsi.bsl @@ -15,13 +15,13 @@ SigFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((8,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (8,0--8,10)), false, + None, (8,0--8,10), None), false, [Types ([SynTypeDefnSig (SynComponentInfo ([], None, [], [a], PreXmlDoc ((9,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (9,9--9,10)), + false, None, (9,9--9,10), None), Simple (Union (None, 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..518f663f897 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Namespace - Keyword 01.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,10)), false, + None, (3,0--3,10), None), false, [Val (SynValSig ([], SynIdent (a, None), SynValTyparDecls (None, true), 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..a4a912074c5 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/Nested module 01.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [Val (SynValSig ([], SynIdent (a, None), SynValTyparDecls (None, true), diff --git a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl index 46bc6ef7b84..49357fd4a31 100644 --- a/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/ModuleOrNamespaceSig/RangeMemberReturnsRangeOfSynModuleOrNamespaceSig.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,8)), + false, None, (4,5--4,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl index dd1fced8df7..bd32e6aa7ee 100644 --- a/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/IncompleteNestedModuleSigShouldBePresent.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], (3,0--3,8), + None, (3,0--3,8), None), false, [], (3,0--3,8), { ModuleKeyword = Some (3,0--3,6) EqualsRange = None }); Val diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl index 2cbc6fa5c0a..ede6d58aa99 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [Let (false, [SynBinding diff --git a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl index ca093b12f75..47b9e62c506 100644 --- a/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/NestedModuleWithBeginEndAndDecls.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, + None, (3,0--3,8), None), false, [Val (SynValSig ([], SynIdent (a, None), SynValTyparDecls (None, true), @@ -25,7 +25,7 @@ SigFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,13--6,14)), + false, None, (6,13--6,14), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([string], [], [None])), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl index 8538ab3d4cc..b4a593a242f 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleDeclNestedModule.fs.bsl @@ -13,7 +13,7 @@ ImplFile Range = (4,2--4,5) }] Range = (4,0--4,7) }], None, [], [Nested], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (5,0--5,13)), false, + None, (5,0--5,13), None), false, [Expr (Const (Unit, (6,4--6,6)), (6,4--6,6))], false, (4,0--6,6), { ModuleKeyword = Some (5,0--5,6) EqualsRange = Some (5,14--5,15) })], diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl index eaac7dbed8e..f392453b374 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfAttributeShouldBeIncludedInSynModuleSigDeclNestedModule.fsi.bsl @@ -14,7 +14,7 @@ SigFile Range = (4,2--4,5) }] Range = (4,0--4,7) }], None, [], [Nested], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (5,0--5,13)), false, + None, (5,0--5,13), None), false, [Val (SynValSig ([], SynIdent (x, None), SynValTyparDecls (None, true), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl index dfecd0d9c4d..78272753998 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], false, (3,0--4,13), + None, (3,0--3,8), None), false, [], false, (3,0--4,13), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--4,13), { LeadingKeyword = Namespace (1,0--1,9) })], (true, true), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl index 1e08843a84a..b878b4a5906 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfBeginEnd.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (3,0--3,8)), false, [], (3,0--4,13), + None, (3,0--3,8), None), false, [], (3,0--4,13), { ModuleKeyword = Some (3,0--3,6) EqualsRange = Some (3,9--3,10) })], PreXmlDocEmpty, [], None, (1,0--4,13), { LeadingKeyword = Namespace (1,0--1,9) })], diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl index 5b493568519..aab76af801b 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresent.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (2,0--2,8)), false, + None, (2,0--2,8), None), false, [Expr (Const (Unit, (3,4--3,6)), (3,4--3,6))], false, (2,0--3,6), { ModuleKeyword = Some (2,0--2,6) EqualsRange = Some (2,9--2,10) })], PreXmlDocEmpty, [], None, diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl index 627b1b608b9..73e26ab9be0 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfEqualSignShouldBePresentSignatureFile.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,0--4,8)), false, + None, (4,0--4,8), None), false, [Val (SynValSig ([], SynIdent (bar, None), SynValTyparDecls (None, true), diff --git a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl index fc0b13845c2..42aa75261f1 100644 --- a/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl +++ b/tests/service/data/SyntaxTree/NestedModule/RangeOfNestedModuleInSignatureFileShouldEndAtTheLastSynModuleSigDecl.fsi.bsl @@ -33,7 +33,7 @@ SigFile (SynComponentInfo ([], None, [], [Tuple], PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (11,0--11,12)), false, + None, (11,0--11,12), None), false, [Types ([SynTypeDefnSig (SynComponentInfo @@ -54,7 +54,7 @@ SigFile { AmpersandRanges = [] })], [], (13,14--13,31))), [], [Tuple], PreXmlDoc ((13,4), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (13,9--13,14)), + true, None, (13,9--13,14), None), ObjectModel (Unspecified, [Interface @@ -226,7 +226,7 @@ SigFile (SynComponentInfo ([], None, [], [Choice], PreXmlDoc ((24,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (24,0--24,13)), false, + None, (24,0--24,13), None), false, [Types ([SynTypeDefnSig (SynComponentInfo @@ -282,7 +282,7 @@ SigFile { AmpersandRanges = [] })], [], (29,15--29,40))), [], [Choice], PreXmlDoc ((27,4), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (29,9--29,15)), + true, None, (29,9--29,15), None), Simple (Union (None, @@ -392,7 +392,7 @@ SigFile Range = (46,2--46,10) }] Range = (46,0--46,12) }], None, [], [Operators], PreXmlDoc ((46,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (47,0--47,16)), false, + None, (47,0--47,16), None), false, [Types ([SynTypeDefnSig (SynComponentInfo @@ -404,7 +404,7 @@ SigFile { AmpersandRanges = [] })], [], (49,16--49,20))), [], [[,]], PreXmlDoc ((49,4), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (49,9--49,16)), + true, None, (49,9--49,16), None), Simple (None (49,9--61,26), (49,9--61,26)), [Member (SynValSig diff --git a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl index d544fd6cd7b..43a57c5736b 100644 --- a/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/AbstractClassProperty.fs.bsl @@ -16,7 +16,7 @@ ImplFile Range = (1,2--1,15) }] Range = (1,0--1,17) }], None, [], [AbstractBase], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,17)), + false, None, (2,5--2,17), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl index 13161fa49f4..af01c0cde60 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseStringOrNull.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [DU], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,7)), + false, None, (1,5--1,7), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl index 51050a8e198..0325c1872dd 100644 --- a/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/DuCaseTuplePrecedence.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [DU], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,7)), + false, None, (1,5--1,7), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl index 8626a3204af..2a0f08fbd25 100644 --- a/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/ExplicitField.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyStruct], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,13)), + false, None, (1,5--1,13), None), ObjectModel (Struct, [ValField diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl index 2e217784614..6d1589dc38f 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNull.fs.bsl @@ -18,7 +18,7 @@ ImplFile { ColonRange = (1,17--1,18) NotRange = (1,19--1,22) })], (1,6--1,28))), [], [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,6)), + true, None, (1,5--1,6), None), ObjectModel (Class, [], (1,31--1,40)), [], None, (1,5--1,40), { LeadingKeyword = Type (1,0--1,4) EqualsRange = Some (1,29--1,30) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl index 4f47caa397c..c61b66065fa 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNotNullAndOtherConstraint.fs.bsl @@ -21,7 +21,7 @@ ImplFile (SynTypar (T, None, false), (1,32--1,43))], (1,6--1,44))), [], [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,6)), + true, None, (1,5--1,6), None), ObjectModel (Class, [], (1,47--1,56)), [], None, (1,5--1,56), { LeadingKeyword = Type (1,0--1,4) EqualsRange = Some (1,45--1,46) 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..2f8fa40ad36 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 @@ -22,7 +22,7 @@ ImplFile (SynTypar (T, None, false), (1,34--1,45))], (1,6--1,46))), [], [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,6)), + true, None, (1,5--1,6), None), ObjectModel (Class, [], (1,49--1,58)), [], None, (1,5--1,58), { LeadingKeyword = Type (1,0--1,4) EqualsRange = Some (1,47--1,48) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl index 59936ebce22..f2023984190 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeNull.fs.bsl @@ -17,7 +17,7 @@ ImplFile (SynTypar (T, None, false), (1,15--1,23))], (1,6--1,24))), [], [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,6)), + true, None, (1,5--1,6), None), ObjectModel (Class, [], (1,27--1,36)), [], None, (1,5--1,36), { LeadingKeyword = Type (1,0--1,4) EqualsRange = Some (1,25--1,26) diff --git a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl index 59b59562625..66a82eccb16 100644 --- a/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/GenericTypeOtherConstraintAndThenNotNull.fs.bsl @@ -20,7 +20,7 @@ ImplFile { ColonRange = (1,33--1,34) NotRange = (1,35--1,38) })], (1,6--1,44))), [], [C], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,6)), + true, None, (1,5--1,6), None), ObjectModel (Class, [], (1,47--1,56)), [], None, (1,5--1,56), { LeadingKeyword = Type (1,0--1,4) EqualsRange = Some (1,45--1,46) diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl index 79d2dfce12c..a85f3627359 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionChoiceType.fs.bsl @@ -18,7 +18,7 @@ ImplFile { AmpersandRanges = [] })], [], (1,13--1,22))), [], [MyChoice], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,13)), + true, None, (1,5--1,13), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl index 749078efa17..780a6c75e12 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionListType.fs.bsl @@ -15,7 +15,7 @@ ImplFile { AmpersandRanges = [] })], [], (1,9--1,13))), [], [List], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,9)), + true, None, (1,5--1,9), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl index 8d6a085bc09..71d8b1505b3 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOneLinerOptionType.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyFlatOption], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,17)), + false, None, (1,5--1,17), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl index 502b1ba39e7..f6fa537c0b4 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionOptionType.fs.bsl @@ -15,7 +15,7 @@ ImplFile { AmpersandRanges = [] })], [], (1,11--1,15))), [], [Option], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,5--1,11)), + true, None, (1,5--1,11), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl index e7de7e51e35..895e7d729bb 100644 --- a/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/RegressionResultType.fs.bsl @@ -18,7 +18,7 @@ ImplFile { AmpersandRanges = [] })], [], (1,17--1,29))), [], [MyResult], PreXmlDoc ((1,4), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (1,9--1,17)), + true, None, (1,9--1,17), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl index 317752b3425..0098dfd6763 100644 --- a/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/SignatureInAbstractMember.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClassBase1], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,17)), + false, None, (1,5--1,17), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl index 20af4b08c2e..689039e2cc7 100644 --- a/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl +++ b/tests/service/data/SyntaxTree/Nullness/TypeAbbreviationAddingWithNull.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyFlatOption], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (1,5--1,17)), + false, None, (1,5--1,17), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl index faa01ee9c32..1ddf1ce3da5 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ActivePatternIdentifierInPrivateMember.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl index 6a073559389..06aa993c095 100644 --- a/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/ObjectModelWithTwoMembers.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl index 5137e642c9a..b41a23d9480 100644 --- a/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl +++ b/tests/service/data/SyntaxTree/OperatorName/OperatorInMemberDefinition.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Augmentation (2,7--2,11), [], (2,5--3,28)), [Member (SynBinding diff --git a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl index a27b46c979c..1911af56d1d 100644 --- a/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/EqualsTokenIsPresentInSynValSigMember.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl index 2a904b29554..af986eba4ec 100644 --- a/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/LeadingKeywordInRecursiveTypes.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([obj], [], [None])), @@ -21,7 +21,7 @@ SigFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((3,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,4--3,5)), + false, None, (3,4--3,5), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl index de5ad0828c3..a8ca892965a 100644 --- a/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/MemberSigOfSynMemberSigMemberShouldContainsTheRangeOfTheWithKeyword.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,8)), + false, None, (4,5--4,8), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl index b509927045c..194eeba523c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/NestedTypeHasStaticTypeAsLeadingKeyword.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [NestedType @@ -17,7 +17,7 @@ SigFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((3,16), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,16--3,17)), + false, None, (3,16--3,17), None), ObjectModel (Class, [], (4,20--5,23)), [], (3,16--5,23), { LeadingKeyword = diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl index e73e3ca6fee..bff505c214c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynTypeDefnSig.fsi.bsl @@ -15,7 +15,7 @@ SigFile Range = (4,2--4,6) }] Range = (4,0--4,8) }], None, [], [MyType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,11)), + false, None, (5,5--5,11), None), ObjectModel (Class, [], (6,4--7,7)), [], (4,0--7,7), { LeadingKeyword = Type (5,0--5,4) EqualsRange = Some (5,12--5,13) diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl index 101ec260450..499517639a2 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributeShouldBeIncludedInSynValSpfnAndMember.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [FooType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl index af1c383c20c..c1f201fe345 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,8)), + false, None, (4,5--4,8), None), Simple (Union (None, @@ -32,7 +32,7 @@ SigFile Range = (7,6--7,20) }] Range = (7,4--7,22) }], None, [], [Bang], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,23--7,27)), + false, None, (7,23--7,27), None), Simple (Record (Some (Internal (8,4--8,12)), diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl index a38d43e98c3..bbd026be794 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigDelegateOfShouldStartFromName.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [MyFunction], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,15)), + false, None, (3,5--3,15), None), ObjectModel (Delegate (Fun diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl index cce6edadb6d..20c020bf17c 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigObjectModelShouldEndAtLastMember.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [MyRecord], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,13)), + false, None, (3,5--3,13), None), ObjectModel (Class, [], (4,4--5,7)), [Member (SynValSig diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl index bcbb3398842..bdb6f6ae1ff 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigRecordShouldEndAtLastMember.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [MyRecord], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,13)), + false, None, (3,5--3,13), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl index 6b584fc5717..abe3ebf4b72 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfSynTypeDefnSigSimpleShouldEndAtLastVal.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [SomeCollection], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,19)), + false, None, (3,5--3,19), None), Simple (None (3,5--5,37), (3,5--5,37)), [ValField (SynField diff --git a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl index 92a00ceca6b..845d6c6a529 100644 --- a/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/RangeOfTypeShouldEndAtEndKeyword.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [Meh], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,8)), + false, None, (4,5--4,8), None), ObjectModel (Class, [], (5,8--6,11)), [], (4,5--6,11), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,9--4,10) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl index 313b1d493a0..7e418bbd7ce 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithEnumContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [Bear], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,9)), + false, None, (4,5--4,9), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl index 6d2eafdbc7c..6b68fb74523 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelClassContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [Foobar], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,11)), + false, None, (4,5--4,11), None), ObjectModel (Class, [], (5,4--6,7)), [], (4,5--6,7), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,12--4,13) diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl index a1b964f3ac1..1ff9c1392df 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Delegate (Fun diff --git a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl index 3afb8f5e0cf..7b2f8d7ba8e 100644 --- a/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/SynTypeDefnSigWithUnionContainsTheRangeOfTheEqualsSign.fsi.bsl @@ -10,7 +10,7 @@ SigFile (SynComponentInfo ([], None, [], [Shape], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl index 0562bc80619..e84126aa40a 100644 --- a/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/TriviaIsPresentInSynTypeDefnSig.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [Member @@ -40,7 +40,7 @@ SigFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (11,5--11,6)), + false, None, (11,5--11,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -53,7 +53,7 @@ SigFile (SynComponentInfo ([], None, [], [Z], PreXmlDoc ((14,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (14,5--14,6)), + false, None, (14,5--14,6), None), Simple (None (14,5--15,32), (14,5--15,32)), [Member (SynValSig diff --git a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl index b51549de53b..8c8998c7fc2 100644 --- a/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl +++ b/tests/service/data/SyntaxTree/SignatureType/With 01.fsi.bsl @@ -8,7 +8,7 @@ SigFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), Simple (None (3,5--4,28), (3,5--4,28)), [Member (SynValSig diff --git a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl index 939f5e095d7..0a7691dec9e 100644 --- a/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl +++ b/tests/service/data/SyntaxTree/SimplePats/SimplePats 02.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor @@ -41,7 +41,7 @@ ImplFile (SynComponentInfo ([], None, [], [Y], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Class, [ImplicitCtor @@ -77,7 +77,7 @@ ImplFile (SynComponentInfo ([], None, [], [Z], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,6)), + false, None, (5,5--5,6), None), ObjectModel (Class, [ImplicitCtor @@ -159,7 +159,7 @@ ImplFile (SynComponentInfo ([], None, [], [Unit], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,9)), + false, None, (6,5--6,9), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl index d7fb308c07b..4d626381bc4 100644 --- a/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl +++ b/tests/service/data/SyntaxTree/String/InterpolatedStringOffsideInModule.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (1,0--1,8)), false, + None, (1,0--1,8), None), false, [Let (false, [SynBinding 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..7a47bcfb72e 100644 --- a/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl +++ b/tests/service/data/SyntaxTree/SynTyparDecl/Constraint intersection 01.fs.bsl @@ -44,7 +44,7 @@ ImplFile { AmpersandRanges = [(3,46--3,47)] })], [], (3,6--3,57))), [], [C], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (3,5--3,6)), + true, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member 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..ba32f35f5d7 100644 --- a/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/Constraint intersection 03.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [I], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl index 1e3e4c88ac6..c9d754b062f 100644 --- a/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl +++ b/tests/service/data/SyntaxTree/SynType/SingleSynTypeInsideSynExprTraitCall.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl index c65846b5121..f679e5cf0f9 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterAttributes.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl index 6519bc1260e..84ad382b495 100644 --- a/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl +++ b/tests/service/data/SyntaxTree/SynType/SynTypeTupleDoesIncludeLeadingParameterName.fsi.bsl @@ -9,7 +9,7 @@ SigFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl index 8161ef11d05..47fbda35858 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl index 69efd4467a5..e3ff3054ae0 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl index 3d81221a098..8290b809611 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl index 4b2d945ae86..dcfc634ede6 100644 --- a/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Abbreviation 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, diff --git a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl index 4c6d6d9d69d..7854078db66 100644 --- a/tests/service/data/SyntaxTree/Type/And 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,0--7,3)), + false, None, (7,0--7,3), None), Simple (None (7,0--7,3), (7,0--7,3)), [], None, (7,0--7,3), { LeadingKeyword = And (5,0--5,3) EqualsRange = None @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,4--7,5)), + false, None, (7,4--7,5), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl index d8ed54e6278..bc4e46c5ab5 100644 --- a/tests/service/data/SyntaxTree/Type/And 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,5)), + false, None, (5,4--5,5), None), Simple (None (5,4--5,5), (5,4--5,5)), [], None, (5,4--5,5), { LeadingKeyword = And (5,0--5,3) EqualsRange = None @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,4--7,5)), + false, None, (7,4--7,5), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl index 75c21712b48..542f21caf69 100644 --- a/tests/service/data/SyntaxTree/Type/And 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,5)), + false, None, (5,4--5,5), None), Simple (None (5,4--5,7), (5,4--5,7)), [], None, (5,4--5,7), { LeadingKeyword = And (5,0--5,3) EqualsRange = Some (5,6--5,7) @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,4--7,5)), + false, None, (7,4--7,5), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl index 43cdb517f1f..bb488e57088 100644 --- a/tests/service/data/SyntaxTree/Type/And 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,0--6,0)), + false, None, (6,0--6,0), None), Simple (None (6,0--6,0), (6,0--6,0)), [], None, (6,0--6,0), { LeadingKeyword = And (5,0--5,3) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl index e830f0923ad..0b579602aa6 100644 --- a/tests/service/data/SyntaxTree/Type/And 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,5)), + false, None, (5,4--5,5), None), Simple (None (5,4--5,5), (5,4--5,5)), [], None, (5,4--5,5), { LeadingKeyword = And (5,0--5,3) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl index 88650dda065..42e7cc379ff 100644 --- a/tests/service/data/SyntaxTree/Type/And 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/And 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -20,7 +20,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,5)), + false, None, (5,4--5,5), None), Simple (None (5,4--5,7), (5,4--5,7)), [], None, (5,4--5,7), { LeadingKeyword = And (5,0--5,3) EqualsRange = Some (5,6--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..26077f03d86 100644 --- a/tests/service/data/SyntaxTree/Type/As 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl index d9175ab67c2..f29c4dac5f6 100644 --- a/tests/service/data/SyntaxTree/Type/As 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl index c6d3679b645..82829811d7a 100644 --- a/tests/service/data/SyntaxTree/Type/As 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [], (3,17--3,26)), [], None, (3,5--3,26), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,15--3,16) diff --git a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl index 72a2470ba19..a8d691155a6 100644 --- a/tests/service/data/SyntaxTree/Type/As 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [], (3,12--3,21)), [], None, (3,5--3,21), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,10--3,11) diff --git a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl index a95fbbe8e9c..81035cd5e82 100644 --- a/tests/service/data/SyntaxTree/Type/As 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), Some this, diff --git a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl index 9f32f95a557..173bbc559cd 100644 --- a/tests/service/data/SyntaxTree/Type/As 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), None, diff --git a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl index c984cc41133..c6fc6771545 100644 --- a/tests/service/data/SyntaxTree/Type/As 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), Some this, diff --git a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl index 949d6732cb3..44ae0644443 100644 --- a/tests/service/data/SyntaxTree/Type/As 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/As 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), None, diff --git a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl index 478489a67f7..aa20de4ed7e 100644 --- a/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/AttributesInOptionalNamedMemberParameter.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [AbstractSlot 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..3d9d74d0c96 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (None (4,5--4,8), (4,5--4,8)), [], None, (4,5--4,8), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,7--4,8) @@ -19,7 +19,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,9--5,10)), + false, None, (5,9--5,10), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -31,7 +31,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,8--6,16)), false, + None, (6,8--6,16), None), false, [Expr (Const (Unit, (6,19--6,21)), (6,19--6,21))], false, (6,8--6,21), { ModuleKeyword = Some (6,8--6,14) EqualsRange = Some (6,17--6,18) }); diff --git a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl index 319b6a1799c..faed9f5cfe1 100644 --- a/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [], (3,9--3,18)), [], None, (3,5--3,18), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl index b3d84e0003e..7b0fec9b7ac 100644 --- a/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [Member diff --git a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl index 1b1edb27290..5f63e544cb1 100644 --- a/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl index ae98b2f4211..4a1ac615217 100644 --- a/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl index a47c0c4fc45..244d9981c5a 100644 --- a/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Class 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..d940a269acf 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,11)), + false, None, (4,5--4,11), None), ObjectModel (Unspecified, [Member 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..fe73ebe3d19 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 @@ -8,18 +8,18 @@ ImplFile (SynComponentInfo ([], None, [], [InnerModule], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,0--4,18)), false, + None, (4,0--4,18), None), false, [NestedModule (SynComponentInfo ([], None, [], [DeeplyNested], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,23)), false, + false, None, (5,4--5,23), None), false, [Types ([SynTypeDefn (SynComponentInfo ([], None, [], [IndentedType], PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,13--6,25)), + false, None, (6,13--6,25), None), Simple (None (6,13--6,27), (6,13--6,27)), [], None, (6,13--6,27), { LeadingKeyword = Type (6,8--6,12) EqualsRange = Some (6,26--6,27) @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [NestedType], PreXmlDoc ((7,12), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,17--7,27)), + false, None, (7,17--7,27), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -41,7 +41,7 @@ ImplFile (SynComponentInfo ([], None, [], [NestedModule], PreXmlDoc ((8,12), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,12--8,31)), false, + false, None, (8,12--8,31), None), false, [Let (false, [SynBinding 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..a5c28dfa723 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (None (4,5--4,8), (4,5--4,8)), [], None, (4,5--4,8), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,7--4,8) @@ -19,7 +19,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,9--5,10)), + false, None, (5,9--5,10), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -31,7 +31,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,12)), false, + None, (6,4--6,12), None), false, [Expr (Const (Unit, (6,15--6,17)), (6,15--6,17))], false, (6,4--6,17), { ModuleKeyword = Some (6,4--6,10) EqualsRange = Some (6,13--6,14) }); diff --git a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl index 1d8dfd6a8ff..f41565b2c46 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl index f9ea108dd50..564d0523baa 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl index 7bce3a3aa62..7a9c546bab3 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl index 710fdf83368..7a44cc31db2 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl index 4d1063812b5..2706af3f733 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl index 3382f753b9f..20ec371c334 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase 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..44738b49b81 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 07 - Eof.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase 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..8549720dda2 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 08 - Eof.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase 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..e513fc1b6b0 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 09 - Eof.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase 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..67aced9df22 100644 --- a/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Enum 10 - Eof.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [E], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Enum ([SynEnumCase 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..4ec5fee8415 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (None (4,5--4,6), (4,5--4,6)), [], None, (4,5--4,6), { LeadingKeyword = Type (4,0--4,4) EqualsRange = None 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..3faa8e33485 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,16 @@ ImplFile Types ([SynTypeDefn (SynComponentInfo - ([], - Some - (PrefixList - ([SynTyparDecl - ([], SynTypar (T, None, false), [], - { AmpersandRanges = [] })], (4,27--4,31))), [], - [x], + ([], None, [], [], 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,28--4,30), + Some (Var (SynTypar (T, None, false), (4,28--4,30)))), + Simple (None (4,28--4,30), (4,28--4,30)), [], None, + (4,28--4,30), { LeadingKeyword = Type (4,22--4,26) EqualsRange = None - WithKeyword = None })], (4,22--4,33))], + WithKeyword = None })], (4,22--4,30))], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, - (2,0--4,33), { LeadingKeyword = Module (2,0--2,6) })], (true, true), + (2,0--4,30), { LeadingKeyword = Module (2,0--2,6) })], (true, true), { ConditionalDirectives = [] WarnDirectives = [] CodeComments = [LineComment (1,0--1,62)] }, set [])) @@ -60,4 +55,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..12294f620c5 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Interface, [], (4,4--4,17)), [], None, (3,5--4,17), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl index 00f511cf97b..0f120990323 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Interface, [], (4,4--5,7)), [], None, (3,5--5,7), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl index 9bd8891abe6..29c1704a30f 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Interface, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl index 2f68afd4da1..83ba91935b2 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Interface, [AbstractSlot diff --git a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl index 07799f674ef..86414cfd3df 100644 --- a/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Interface 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Interface 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..cfb9e0d0d63 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClass], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [LetBindings 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..2a371b8baca 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 @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClass], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [ImplicitCtor 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..e2692b94833 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClass], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [ImplicitCtor @@ -45,7 +45,7 @@ ImplFile (SynComponentInfo ([], None, [], [M], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,12)), false, + None, (6,4--6,12), None), false, [Let (false, [SynBinding 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..e7cf677785b 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Base], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,9)), + false, None, (4,5--4,9), None), ObjectModel (Class, [ImplicitCtor @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [Derived], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,12)), + false, None, (6,5--6,12), None), ObjectModel (Unspecified, [ImplicitCtor @@ -52,7 +52,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((9,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (9,4--9,24)), false, + None, (9,4--9,24), None), false, [Let (false, [SynBinding 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..5cdf2d20808 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [ClassWithMembers], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,21)), + false, None, (4,5--4,21), None), ObjectModel (Unspecified, [ImplicitCtor @@ -83,7 +83,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (8,4--8,24)), false, + None, (8,4--8,24), None), false, [Let (false, [SynBinding 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..946069b49f1 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,11)), + false, None, (4,5--4,11), None), ObjectModel (Unspecified, [Member @@ -46,7 +46,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,4--7,24)), false, + None, (7,4--7,24), None), false, [Let (false, [SynBinding 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..abc7f679503 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Interleaved], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,16)), + false, None, (4,5--4,16), None), ObjectModel (Unspecified, [Member @@ -43,7 +43,7 @@ ImplFile (SynComponentInfo ([], None, [], [M1], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,13)), false, + None, (6,4--6,13), None), false, [Let (false, [SynBinding 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..8b718d72c75 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [ClassWithDo], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,16)), + false, None, (4,5--4,16), None), ObjectModel (Unspecified, [ImplicitCtor @@ -45,7 +45,7 @@ ImplFile (SynComponentInfo ([], None, [], [InternalType], PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,9--8,21)), + false, None, (8,9--8,21), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), @@ -57,7 +57,7 @@ ImplFile (SynComponentInfo ([], None, [], [InternalModule], PreXmlDoc ((10,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (10,4--10,25)), false, + None, (10,4--10,25), None), false, [Let (false, [SynBinding 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..76513ee8ce1 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,11)), + false, None, (4,5--4,11), None), Simple (None (4,5--4,13), (4,5--4,13)), [], None, (4,5--4,13), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,12--4,13) @@ -18,7 +18,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (5,4--5,24)), false, + None, (5,4--5,24), None), false, [Let (false, [SynBinding @@ -40,7 +40,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidType], PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,9--8,20)), + false, None, (8,9--8,20), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([string], [], [None])), 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..80edc613a28 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [SimpleType], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,15)), + false, None, (4,5--4,15), None), Simple (Union (None, @@ -45,7 +45,7 @@ ImplFile (SynComponentInfo ([], None, [], [ValidModule], PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,0--7,18)), false, + None, (7,0--7,18), None), false, [Let (false, [SynBinding 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..6997a1c5587 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, @@ -34,7 +34,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,6)), + false, None, (6,5--6,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([B], [], [None])), @@ -46,7 +46,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,0--7,8)), false, + None, (7,0--7,8), None), false, [Let (false, [SynBinding 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..f7f3f06af40 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClass], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [ImplicitCtor @@ -69,7 +69,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,4--7,24)), false, + None, (7,4--7,24), None), false, [Let (false, [SynBinding 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..13a6c44dabb 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), ObjectModel (Unspecified, [ImplicitCtor @@ -56,7 +56,7 @@ ImplFile (SynComponentInfo ([], None, [], [M2], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,13)), false, + None, (6,4--6,13), None), false, [Let (false, [SynBinding 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..042f0740560 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyClass], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,12)), + false, None, (4,5--4,12), None), ObjectModel (Unspecified, [ImplicitCtor @@ -40,7 +40,7 @@ ImplFile (SynComponentInfo ([], None, [], [InternalModule], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (5,4--5,25)), false, + None, (5,4--5,25), None), false, [Let (false, [SynBinding 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..3d09cd537dd 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyDelegate], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,15)), + false, None, (4,5--4,15), None), ObjectModel (Delegate (Fun @@ -67,7 +67,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (5,4--5,24)), false, + None, (5,4--5,24), None), false, [Let (false, [SynBinding 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..470dd87ac23 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [IFace], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), ObjectModel (Unspecified, [AbstractSlot @@ -43,7 +43,7 @@ ImplFile (SynComponentInfo ([], None, [], [M], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,12)), false, + None, (6,4--6,12), None), false, [Let (false, [SynBinding 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..c0b3e1734cd 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [IFace], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), ObjectModel (Interface, [AbstractSlot 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..fd640c12916 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 @@ -8,18 +8,18 @@ ImplFile (SynComponentInfo ([], None, [], [Level2], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,0--4,13)), false, + None, (4,0--4,13), None), false, [NestedModule (SynComponentInfo ([], None, [], [Level3], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,17)), false, + false, None, (5,4--5,17), None), false, [Types ([SynTypeDefn (SynComponentInfo ([], None, [], [MyType], PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,13--6,19)), + false, None, (6,13--6,19), None), Simple (Union (None, @@ -36,7 +36,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((8,12), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,12--8,32)), false, + false, None, (8,12--8,32), None), false, [Let (false, [SynBinding 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..41760fb22f1 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Record (None, @@ -27,7 +27,7 @@ ImplFile (SynComponentInfo ([], None, [], [M4], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,13)), false, + None, (6,4--6,13), None), false, [Let (false, [SynBinding 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..b88a2a3140c 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MyStruct], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,13)), + false, None, (4,5--4,13), None), ObjectModel (Struct, [], (5,4--5,10)), [], None, (4,5--5,10), { LeadingKeyword = Type (4,0--4,4) EqualsRange = Some (4,14--4,15) 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..e62f2e36adc 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, 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..b8666ac8bd4 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [M3], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,4--7,13)), false, + None, (7,4--7,13), None), false, [Let (false, [SynBinding 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..c2b2bc1948e 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, @@ -45,7 +45,7 @@ ImplFile (SynComponentInfo ([], None, [], [ValidModule], PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,0--7,18)), false, + None, (7,0--7,18), None), false, [Let (false, [SynBinding 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..b1051abfa52 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, @@ -45,7 +45,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((8,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (8,0--8,8)), false, + None, (8,0--8,8), None), false, [Let (false, [SynBinding @@ -67,7 +67,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((11,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (11,5--11,6)), + false, None, (11,5--11,6), None), Simple (Record (None, 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..dd6bb2757fa 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [TypeA], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), Simple (Union (None, @@ -25,7 +25,7 @@ ImplFile (SynComponentInfo ([], None, [], [ModuleAfterDelimiter], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,4--6,31)), false, + None, (6,4--6,31), None), false, [Let (false, [SynBinding 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..21af0d4ec65 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [MultiTest], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,14)), + false, None, (4,5--4,14), None), Simple (Union (None, @@ -29,7 +29,7 @@ ImplFile (SynComponentInfo ([], None, [], [NestedModule], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (7,4--7,23)), false, [], false, (7,4--7,35), + None, (7,4--7,23), None), false, [], false, (7,4--7,35), { ModuleKeyword = Some (7,4--7,10) EqualsRange = Some (7,24--7,25) }); Types @@ -37,7 +37,7 @@ ImplFile (SynComponentInfo ([], None, [], [NestedType], PreXmlDoc ((8,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,9--8,19)), + false, None, (8,9--8,19), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl index 26f912fd463..4ebf1a6a1ba 100644 --- a/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/MultipleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl index cd9f16db52b..35fe8537b9a 100644 --- a/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NamedParametersInDelegateType.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Delegate (Fun 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..215e882861d 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 @@ -8,23 +8,23 @@ ImplFile (SynComponentInfo ([], None, [], [Level1], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,0--4,13)), false, + None, (4,0--4,13), None), false, [NestedModule (SynComponentInfo ([], None, [], [Level2], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,17)), false, + false, None, (5,4--5,17), None), false, [NestedModule (SynComponentInfo ([], None, [], [Level3], PreXmlDoc ((6,8), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,8--6,21)), false, + false, None, (6,8--6,21), None), false, [Types ([SynTypeDefn (SynComponentInfo ([], None, [], [TypeWithInvalidModule], PreXmlDoc ((7,12), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,17--7,38)), + false, None, (7,17--7,38), None), Simple (None (7,17--7,40), (7,17--7,40)), [], None, (7,17--7,40), { LeadingKeyword = Type (7,12--7,16) EqualsRange = Some (7,39--7,40) @@ -34,7 +34,7 @@ ImplFile (SynComponentInfo ([], None, [], [InvalidModule], PreXmlDoc ((8,16), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (8,16--8,36)), false, + false, None, (8,16--8,36), None), false, [Let (false, [SynBinding diff --git a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl index b494146b3bb..557f5bf3ea0 100644 --- a/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/NestedTypeHasStaticTypeAsLeadingKeyword.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Unspecified, [NestedType @@ -17,7 +17,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((3,16), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,16--3,17)), + false, None, (3,16--3,17), None), ObjectModel (Class, [], (4,20--5,23)), [], None, (3,16--5,23), { LeadingKeyword = 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..b129f46e053 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([A], [], [None])), @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((4,12), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,17--4,18)), + false, None, (4,17--4,18), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([A], [], [None])), @@ -34,7 +34,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((4,24), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,24--4,32)), false, + None, (4,24--4,32), None), false, [Expr (Const (Unit, (4,35--4,37)), (4,35--4,37))], false, (4,24--4,37), { ModuleKeyword = Some (4,24--4,30) EqualsRange = Some (4,33--4,34) }); @@ -71,7 +71,7 @@ ImplFile (SynComponentInfo ([], None, [], [G], PreXmlDoc ((4,94), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,94--4,102)), false, + None, (4,94--4,102), None), false, [ModuleAbbrev (H, [E], (4,105--4,117))], false, (4,94--4,117), { ModuleKeyword = Some (4,94--4,100) EqualsRange = Some (4,103--4,104) })], 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..aeb309c7580 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Class, [ImplicitCtor 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..5a3f70a8459 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor 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..cda98a065c1 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), None, 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..68df9d33bc8 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor 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..b3410259ffa 100644 --- a/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Primary ctor 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [ImplicitCtor (None, [], Const (Unit, (3,6--3,8)), None, diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl index 79bbd17b1a6..1a16864008d 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributeShouldBeIncludedInSynTypeDefn.fs.bsl @@ -15,7 +15,7 @@ ImplFile Range = (2,2--2,5) }] Range = (2,0--2,7) }], None, [], [Bar], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), ObjectModel (Class, [], (4,4--5,7)), [], None, (2,0--5,7), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,9--3,10) diff --git a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl index ad592dd5cbb..d7bd49fcdf8 100644 --- a/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/RangeOfAttributesShouldBeIncludedInRecursiveTypes.fs.bsl @@ -29,7 +29,7 @@ ImplFile { AmpersandRanges = [] })], [], (3,8--3,22))), [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (3,5--3,8)), + true, None, (3,5--3,8), None), Simple (Union (None, @@ -83,7 +83,7 @@ ImplFile { AmpersandRanges = [] })], [], (6,41--6,55))), [], [Bar], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - true, None, (6,38--6,41)), + true, None, (6,38--6,41), None), Simple (Record (Some (Internal (7,4--7,12)), 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..d5f7e00ef5d 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..dc0e5345014 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..ae41e323e18 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..be5247a0bf1 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Access 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..df989828a91 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..6997c836e21 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..02897237a0d 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..645951fde01 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..7aee62a4c2e 100644 --- a/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record - Mutable 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl index 50126fc6544..94476f2913f 100644 --- a/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [AU], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,7)), + false, None, (3,5--3,7), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl index 986cadf5de9..8ddabc4ea13 100644 --- a/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [AU], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,7)), + false, None, (3,5--3,7), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl index e53b6c858d4..a45388e2fd4 100644 --- a/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, [], (4,4--4,7)), (4,4--4,7)), [], None, (3,5--4,7), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl index bc34db45a45..b894212403e 100644 --- a/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl index 65f78f4d5d3..58980c8e8eb 100644 --- a/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Record 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [R], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Record (None, 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..cad5bd2255c 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([A], [], [None])), @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((4,11), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,16--4,17)), + false, None, (4,16--4,17), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([A], [], [None])), @@ -34,13 +34,13 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((4,22), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (4,22--4,30)), false, + None, (4,22--4,30), None), false, [Types ([SynTypeDefn (SynComponentInfo ([], None, [], [CC], PreXmlDoc ((4,33), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,38--4,40)), + false, None, (4,38--4,40), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl index eebe5e89043..31e387fe9b3 100644 --- a/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SingleSynEnumCaseContainsRangeOfConstant.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl index 7a1e7f126b6..d43ad11f819 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [S], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Struct, [], (3,9--3,19)), [], None, (3,5--3,19), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--3,8) diff --git a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl index 50148b6ee14..14ef51c22df 100644 --- a/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Struct 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [S], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Struct, [ValField diff --git a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl index 4a03a8854ac..b513a1ad377 100644 --- a/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynMemberDefnInterfaceContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl index bdf9ec74f42..d728eb2017e 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAttributeContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -18,7 +18,7 @@ ImplFile Range = (2,2--2,13) }] Range = (2,0--2,15) }], None, [], [A], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([B], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl index 200a42bb6be..2738696710e 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithAugmentationContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Int32], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,10)), + false, None, (2,5--2,10), None), ObjectModel (Augmentation (2,11--2,15), [], (2,5--3,21)), [Member (SynBinding diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl index 4ebef606401..eb3de235915 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithEnumContainsTheRangeOfTheEqualsSign.fs.bsl @@ -10,7 +10,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bear], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,9)), + false, None, (2,5--2,9), None), Simple (Enum ([SynEnumCase diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl index ac4171bbf00..db115cc41b0 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithObjectModelDelegateContainsTheRangeOfTheEqualsSign.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), ObjectModel (Delegate (Fun diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl index 7cb9f5a2af5..69daf8cac2b 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithRecordContainsTheRangeOfTheWithKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Record (None, diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl index 561ab54725d..90a654f6c8e 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithUnionContainsTheRangeOfTheEqualsSign.fs.bsl @@ -11,7 +11,7 @@ ImplFile (SynComponentInfo ([], None, [], [Shape], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,10)), + false, None, (2,5--2,10), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl index 98690850046..c1dca0f7748 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeDefnWithXmlDocContainsTheRangeOfTheTypeKeyword.fs.bsl @@ -12,7 +12,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([B], [], [None])), @@ -24,7 +24,7 @@ ImplFile (SynComponentInfo ([], None, [], [C], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,5)), + false, None, (5,4--5,5), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([D], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl index 18cf4ffe778..d854e54b8ab 100644 --- a/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/SynTypeFunHasRangeOfArrow.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), Simple (TypeAbbrev (Ok, 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..26c4a13283e --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 01.fs.bsl @@ -0,0 +1,23 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 01.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 01, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 01], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,6--1,9), + Some (Var (SynTypar (T1, None, false), (1,6--1,9)))), + Simple (None (1,6--1,9), (1,6--1,9)), [], None, (1,6--1,9), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,9))], 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..d0fe4d1fae3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 02.fs.bsl @@ -0,0 +1,27 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 02.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 02, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 02], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,6--1,11), + Some + (Tuple + (false, + [Type (Var (SynTypar (T1, None, false), (1,6--1,9))); + Star (1,10--1,11)], (1,6--1,11)))), + Simple (None (1,6--1,11), (1,6--1,11)), [], None, (1,6--1,11), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,11))], PreXmlDocEmpty, [], + None, (1,0--2,0), { LeadingKeyword = None })], (true, true), + { ConditionalDirectives = [] + WarnDirectives = [] + CodeComments = [] }, set [])) + +(1,0)-(2,0) parse warning The declarations in this file will be placed in an implicit module '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..84891c1d8ea --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 03.fs.bsl @@ -0,0 +1,30 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 03.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 03, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 03], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,6--1,15), + Some + (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)))), + Simple (None (1,6--1,15), (1,6--1,15)), [], None, (1,6--1,15), + { LeadingKeyword = Type (1,0--1,4) + EqualsRange = None + WithKeyword = None })], (1,0--1,15))], 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..1143bdb4a56 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 04.fs.bsl @@ -0,0 +1,45 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 04.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 04, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 04], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,6--1,9), + Some (Var (SynTypar (T1, None, false), (1,6--1,9)))), + 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..8dfbe90ecb4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Type/TupleTypeExtensionRecovery 05.fs.bsl @@ -0,0 +1,49 @@ +ImplFile + (ParsedImplFileInput + ("/root/Type/TupleTypeExtensionRecovery 05.fs", false, + QualifiedNameOfFile TupleTypeExtensionRecovery 05, [], + [SynModuleOrNamespace + ([TupleTypeExtensionRecovery 05], false, AnonModule, + [Types + ([SynTypeDefn + (SynComponentInfo + ([], None, [], [], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), + false, None, (1,6--1,11), + Some + (Tuple + (false, + [Type (Var (SynTypar (T1, None, false), (1,6--1,9))); + Star (1,10--1,11)], (1,6--1,11)))), + 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,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..37a9a3a6129 100644 --- a/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--5,0)), + false, None, (3,5--5,0), None), Simple (None (3,5--5,0), (3,5--5,0)), [], None, (3,5--5,0), { LeadingKeyword = Type (3,0--3,4) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl index 1612c6d364a..9105a95ae36 100644 --- a/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), { LeadingKeyword = Type (3,0--3,4) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl index d852d9f5b0c..376d4851a47 100644 --- a/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,8), (3,5--3,8)), [], None, (3,5--3,8), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,7--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..c267c65ce21 100644 --- a/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T1], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,7)), + false, None, (3,5--3,7), None), Simple (None (3,5--3,9), (3,5--3,9)), [], None, (3,5--3,9), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,8--3,9) @@ -18,7 +18,7 @@ ImplFile (SynComponentInfo ([], None, [], [T2], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,7)), + false, None, (5,5--5,7), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl index 3b6a0da3290..7580ce79b10 100644 --- a/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T1], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,7)), + false, None, (3,5--3,7), None), Simple (None (3,5--3,9), (3,5--3,9)), [], None, (3,5--3,9), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (3,8--3,9) @@ -17,7 +17,7 @@ ImplFile (SynComponentInfo ([], None, [], [T2], PreXmlDoc ((5,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,4--5,6)), + false, None, (5,4--5,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl index 9fbbe27cb68..ca68494c48d 100644 --- a/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), { LeadingKeyword = Type (3,0--3,4) EqualsRange = Some (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..08c0c74301a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [Member diff --git a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl index 787da13b0e8..a744bffdf5d 100644 --- a/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl index 0105941f2d9..3e20ae4f84a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 09.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl index 7cbdc0524f8..0ce7ff1b95a 100644 --- a/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 10.fs.bsl @@ -7,13 +7,13 @@ ImplFile (SynComponentInfo ([], None, [], [M], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,0--6,8)), false, + None, (6,0--6,8), None), false, [Types ([SynTypeDefn (SynComponentInfo ([], None, [], [], PreXmlDoc ((7,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (7,9--7,10)), + false, None, (7,9--7,10), None), ObjectModel (Class, [Member diff --git a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl index 18c53db2380..be1614ac8b2 100644 --- a/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 11.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Unspecified, [ImplicitCtor diff --git a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl index 49cd0e01aff..a2fbe766be1 100644 --- a/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Type 12.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (None (3,5--3,6), (3,5--3,6)), [], None, (3,5--3,6), { LeadingKeyword = Type (3,0--3,4) EqualsRange = None 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..cd571af74a4 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 @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,6)), + false, None, (4,5--4,6), None), Simple (Union (None, @@ -25,7 +25,7 @@ ImplFile (SynComponentInfo ([], None, [], [NestedType], PreXmlDoc ((6,4), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,9--6,19)), + false, None, (6,9--6,19), None), Simple (Union (None, 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..f4729769d05 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..59589cb41a2 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..04ebebbd6a6 100644 --- a/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl index 95b3750a979..820bb51932c 100644 --- a/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl index 01aad19db35..e3d957f7e56 100644 --- a/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl index 9623dd96ac7..b15d17b9eb8 100644 --- a/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl index a83e76cb5a0..95a1566a80d 100644 --- a/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl index 055cbe1b68b..9630f1b1073 100644 --- a/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl index 5648e1559f0..38f9de6d851 100644 --- a/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 06.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl index 756c74260c8..2e9d73444cd 100644 --- a/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 07.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl b/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl index 82fde979587..1fe3f0b8410 100644 --- a/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/Union 08.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, @@ -24,7 +24,7 @@ ImplFile (SynComponentInfo ([], None, [], [ThisIsFine], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (6,0--6,17)), false, + None, (6,0--6,17), None), false, [Let (false, [SynBinding @@ -49,7 +49,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((9,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (9,5--9,6)), + false, None, (9,5--9,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl index 5b6217dfe21..122431d8cff 100644 --- a/tests/service/data/SyntaxTree/Type/With 01.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 01.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Augmentation (3,7--3,11), [], (3,5--4,21)), [Member (SynBinding diff --git a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl index f319074e37e..f5151fcefe9 100644 --- a/tests/service/data/SyntaxTree/Type/With 02.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 02.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Augmentation (3,7--3,11), [], (3,5--3,11)), [], None, (3,5--3,11), { LeadingKeyword = Type (3,0--3,4) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl index 197d6d3efc9..4735ba624b4 100644 --- a/tests/service/data/SyntaxTree/Type/With 03.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 03.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [T], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), ObjectModel (Augmentation (3,7--3,11), [], (3,5--3,11)), [], None, (3,5--3,11), { LeadingKeyword = Type (3,0--3,4) EqualsRange = None diff --git a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl index 1eda3d63210..a773534d5f4 100644 --- a/tests/service/data/SyntaxTree/Type/With 04.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 04.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl index 8dedec200dd..e7e4ed94c67 100644 --- a/tests/service/data/SyntaxTree/Type/With 05.fs.bsl +++ b/tests/service/data/SyntaxTree/Type/With 05.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..2452740520b 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing keyword of.fs.bsl @@ -22,7 +22,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (5,5--5,6)), + false, None, (5,5--5,6), None), Simple (Union (None, 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..1708bd40da2 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 01.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..5efa9d8c758 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 02.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..15db2780743 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 03.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, @@ -34,7 +34,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,6)), + false, None, (6,5--6,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), 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..fa1daba1305 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 04.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..0807c63e7df 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 05.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..7b264811484 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 06.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..5b87dcace32 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 07.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, 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..2ff99a2a47a 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 08.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, @@ -26,7 +26,7 @@ ImplFile (SynComponentInfo ([], None, [], [A], PreXmlDoc ((6,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (6,5--6,6)), + false, None, (6,5--6,6), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), 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..7ef2861fb08 100644 --- a/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/Missing name 09.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [U], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl index 7b2aafa30de..5c36fc3adf7 100644 --- a/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/MultipleSynUnionCasesHaveBarRange.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl index 732c0e0b8bf..a052d5eced0 100644 --- a/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/PrivateKeywordHasRange.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Currency], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,13)), + false, None, (2,5--2,13), None), Simple (Union (Some (Private (7,4--7,11)), 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..26da1ba4249 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Bar], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,8)), + false, None, (3,5--3,8), None), Simple (Union (None, @@ -39,7 +39,7 @@ ImplFile (SynComponentInfo ([], None, [], [Other], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), 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..4282a3c818d 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, @@ -39,7 +39,7 @@ ImplFile (SynComponentInfo ([], None, [], [Other], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), 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..aaf4a6a9917 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 @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [B], PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (3,5--3,6)), + false, None, (3,5--3,6), None), Simple (Union (None, @@ -44,7 +44,7 @@ ImplFile (SynComponentInfo ([], None, [], [Other], PreXmlDoc ((4,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (4,5--4,10)), + false, None, (4,5--4,10), None), Simple (TypeAbbrev (Ok, LongIdent (SynLongIdent ([int], [], [None])), diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl index 7ed7778c9c9..f1fa3b7ba07 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseHasBarRange.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl index a2888b02b10..f244dadacd3 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SingleSynUnionCaseWithoutBar.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl index cd3e454e196..91b2f34ae71 100644 --- a/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/SynUnionCaseKindFullType.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [X], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,6)), + false, None, (2,5--2,6), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl index 57c3921ba18..eba12f16b9a 100644 --- a/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl +++ b/tests/service/data/SyntaxTree/UnionCase/UnionCaseFieldsCanHaveComments.fs.bsl @@ -9,7 +9,7 @@ ImplFile (SynComponentInfo ([], None, [], [Foo], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), - false, None, (2,5--2,8)), + false, None, (2,5--2,8), None), Simple (Union (None, diff --git a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl index 6f5235e69b6..30ace065105 100644 --- a/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl +++ b/tests/service/data/SyntaxTree/WarnScope/WarnScopeInSubmodule.fs.bsl @@ -8,7 +8,7 @@ ImplFile (SynComponentInfo ([], None, [], [N], PreXmlDoc ((2,0), FSharp.Compiler.Xml.XmlDocCollector), false, - None, (2,0--2,8)), false, + None, (2,0--2,8), None), false, [Expr (Const (Unit, (4,4--4,6)), (4,4--4,6)); Expr (Const (Unit, (6,4--6,6)), (6,4--6,6))], false, (2,0--6,6), { ModuleKeyword = Some (2,0--2,6)