diff --git a/.fantomasignore b/.fantomasignore index c8ecde76fbd..f974955bb88 100644 --- a/.fantomasignore +++ b/.fantomasignore @@ -17,7 +17,6 @@ src/Compiler/**/*.fs src/fsc/**/*.fs src/fscAnyCpu/**/*.fs src/FSharp.Build/**/*.fs -src/FSharp.Compiler.Interactive.Settings/**/*.fs src/FSharp.Compiler.Server.Shared/**/*.fs src/FSharp.DependencyManager.Nuget/**/*.fs src/fsi/**/*.fs diff --git a/src/Compiler/AbstractIL/ilsupp.fs b/src/Compiler/AbstractIL/ilsupp.fs index 345a90057ad..83609883eb7 100644 --- a/src/Compiler/AbstractIL/ilsupp.fs +++ b/src/Compiler/AbstractIL/ilsupp.fs @@ -878,16 +878,13 @@ let pdbInitialize (binaryName: string) (pdbName: string) = { symWriter = writer } -[] -do() - let pdbCloseDocument(documentWriter: PdbDocumentWriter) = Marshal.ReleaseComObject (documentWriter.symDocWriter) |> ignore -[] let pdbClose (writer: PdbWriter) dllFilename pdbFilename = writer.symWriter.Close() + // CorSymWriter objects (ISymUnmanagedWriter) lock the files they're operating // on (both the pdb and the binary). The locks are released only when their ref // count reaches zero, but since we're dealing with RCWs, there's no telling when @@ -897,6 +894,7 @@ let pdbClose (writer: PdbWriter) dllFilename pdbFilename = // interface, which the SymWriter class, unfortunately, does not. // Right now, take the same approach as mdbg, and manually forcing a collection. let rc = Marshal.ReleaseComObject(writer.symWriter) + for i = 0 to (rc - 1) do Marshal.ReleaseComObject(writer.symWriter) |> ignore diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 70e56990e98..1a79a6e94f8 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -2309,7 +2309,6 @@ module internal MagicAssemblyResolution = // It is an explicit user trust decision to load an assembly with #r. Scripts are not run automatically (for example, by double-clicking in explorer). // We considered setting loadFromRemoteSources in fsi.exe.config but this would transitively confer unsafe loading to the code in the referenced // assemblies. Better to let those assemblies decide for themselves which is safer. - [] let private assemblyLoadFrom (path:string) = Assembly.UnsafeLoadFrom(path) let ResolveAssembly (ctok, m, tcConfigB, tcImports: TcImports, fsiDynamicCompiler: FsiDynamicCompiler, fsiConsoleOutput: FsiConsoleOutput, fullAssemName: string) = @@ -3591,7 +3590,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i /// /// A background thread is started by this thread to read from the inReader and/or console reader. - [] member x.Run() = progress <- condition "FSHARP_INTERACTIVE_PROGRESS" diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index 5e2e5a9732d..df1dfdde294 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -6,6 +6,7 @@ open System open System.Threading open FSharp.Compiler open FSharp.Compiler.Text + #nowarn "57" /// Represents encoded information for the end-of-line continuation of lexing diff --git a/src/FSharp.Build/Fsc.fs b/src/FSharp.Build/Fsc.fs index e9c61149c0a..3e5e6a8937d 100644 --- a/src/FSharp.Build/Fsc.fs +++ b/src/FSharp.Build/Fsc.fs @@ -16,7 +16,6 @@ open Internal.Utilities //The goal is to have the most common/important flags available via the Fsc class, and the //rest can be "backdoored" through the .OtherFlags property. -[] type public Fsc () as this = inherit ToolTask () diff --git a/src/FSharp.Build/Fsi.fs b/src/FSharp.Build/Fsi.fs index c5da10a645d..8f83a6d0bdc 100644 --- a/src/FSharp.Build/Fsi.fs +++ b/src/FSharp.Build/Fsi.fs @@ -16,7 +16,6 @@ open Internal.Utilities //The goal is to have the most common/important flags available via the Fsi class, and the //rest can be "backdoored" through the .OtherFlags property. -[] type public Fsi () as this = inherit ToolTask () diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiattrs.fs b/src/FSharp.Compiler.Interactive.Settings/fsiattrs.fs index 8e279c43ddd..d7233554d4f 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiattrs.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiattrs.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. module FSharp.Compiler.Interactive.Attributes -[] -do() +[] +do () diff --git a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs index 3c12d56812d..bf70d1535b3 100644 --- a/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs +++ b/src/FSharp.Compiler.Interactive.Settings/fsiaux.fs @@ -10,69 +10,90 @@ open System.Diagnostics open System.Threading [] -[] -do() +[] +do () type IEventLoop = - abstract Run : unit -> bool - abstract Invoke : (unit -> 'T) -> 'T - abstract ScheduleRestart : unit -> unit - + abstract Run: unit -> bool + abstract Invoke: (unit -> 'T) -> 'T + abstract ScheduleRestart: unit -> unit + // An implementation of IEventLoop suitable for the command-line console [] -type internal SimpleEventLoop() = +type internal SimpleEventLoop() = let runSignal = new AutoResetEvent(false) let exitSignal = new AutoResetEvent(false) let doneSignal = new AutoResetEvent(false) - let mutable queue = ([] : (unit -> obj) list) - let mutable result = (None : obj option) - let setSignal(signal : AutoResetEvent) = while not (signal.Set()) do Thread.Sleep(1); done - let waitSignal signal = WaitHandle.WaitAll([| (signal :> WaitHandle) |]) |> ignore - let waitSignal2 signal1 signal2 = + let mutable queue = ([]: (unit -> obj) list) + let mutable result = (None: obj option) + + let setSignal (signal: AutoResetEvent) = + while not (signal.Set()) do + Thread.Sleep(1) + + let waitSignal signal = + WaitHandle.WaitAll([| (signal :> WaitHandle) |]) |> ignore + + let waitSignal2 signal1 signal2 = WaitHandle.WaitAny([| (signal1 :> WaitHandle); (signal2 :> WaitHandle) |]) + let mutable running = false let mutable restart = false - interface IEventLoop with - member x.Run() = - running <- true - let rec run() = - match waitSignal2 runSignal exitSignal with - | 0 -> - queue |> List.iter (fun f -> result <- try Some(f()) with _ -> None) - setSignal doneSignal - run() - | 1 -> - running <- false - restart - | _ -> run() - run() - member x.Invoke(f : unit -> 'T) : 'T = - queue <- [f >> box] - setSignal runSignal - waitSignal doneSignal - result |> Option.get |> unbox - member x.ScheduleRestart() = - // nb. very minor race condition here on running here, but totally - // unproblematic as ScheduleRestart and Exit are almost never called. - if running then - restart <- true - setSignal exitSignal - interface System.IDisposable with - member x.Dispose() = - runSignal.Dispose() - exitSignal.Dispose() - doneSignal.Dispose() - + interface IEventLoop with + member x.Run() = + running <- true + + let rec run () = + match waitSignal2 runSignal exitSignal with + | 0 -> + queue + |> List.iter (fun f -> + result <- + try + Some(f ()) + with + | _ -> None) + + setSignal doneSignal + run () + | 1 -> + running <- false + restart + | _ -> run () + + run () + + member x.Invoke(f: unit -> 'T) : 'T = + queue <- [ f >> box ] + setSignal runSignal + waitSignal doneSignal + result |> Option.get |> unbox + + member x.ScheduleRestart() = + // nb. very minor race condition here on running here, but totally + // unproblematic as ScheduleRestart and Exit are almost never called. + if running then + restart <- true + setSignal exitSignal + + interface System.IDisposable with + member x.Dispose() = + runSignal.Dispose() + exitSignal.Dispose() + doneSignal.Dispose() [] -type InteractiveSession() = +type InteractiveSession() = let mutable evLoop = (new SimpleEventLoop() :> IEventLoop) let mutable showIDictionary = true let mutable showDeclarationValues = true - let mutable args = System.Environment.GetCommandLineArgs() + let mutable args = System.Environment.GetCommandLineArgs() let mutable fpfmt = "g10" - let mutable fp = (System.Globalization.CultureInfo.InvariantCulture :> System.IFormatProvider) + + let mutable fp = + (System.Globalization.CultureInfo.InvariantCulture :> System.IFormatProvider) + let mutable printWidth = 78 let mutable printDepth = 100 let mutable printLength = 100 @@ -81,59 +102,92 @@ type InteractiveSession() = let mutable showProperties = true let mutable addedPrinters = [] - member self.FloatingPointFormat with get() = fpfmt and set v = fpfmt <- v - member self.FormatProvider with get() = fp and set v = fp <- v - member self.PrintWidth with get() = printWidth and set v = printWidth <- v - member self.PrintDepth with get() = printDepth and set v = printDepth <- v - member self.PrintLength with get() = printLength and set v = printLength <- v - member self.PrintSize with get() = printSize and set v = printSize <- v - member self.ShowDeclarationValues with get() = showDeclarationValues and set v = showDeclarationValues <- v - member self.ShowProperties with get() = showProperties and set v = showProperties <- v - member self.ShowIEnumerable with get() = showIEnumerable and set v = showIEnumerable <- v - member self.ShowIDictionary with get() = showIDictionary and set v = showIDictionary <- v - member self.AddedPrinters with get() = addedPrinters and set v = addedPrinters <- v - - [] - member self.CommandLineArgs - with get() = args - and set v = args <- v - - member self.AddPrinter(printer : 'T -> string) = - addedPrinters <- Choice1Of2 (typeof<'T>, (fun (x:obj) -> printer (unbox x))) :: addedPrinters - - member self.EventLoop - with get () = evLoop - and set (x:IEventLoop) = evLoop.ScheduleRestart(); evLoop <- x - - member self.AddPrintTransformer(printer : 'T -> obj) = - addedPrinters <- Choice2Of2 (typeof<'T>, (fun (x:obj) -> printer (unbox x))) :: addedPrinters - - member internal self.SetEventLoop (run: (unit -> bool), invoke: ((unit -> obj) -> obj), restart: (unit -> unit)) = - evLoop.ScheduleRestart() - evLoop <- { new IEventLoop with - member _.Run() = run() - member _.Invoke(f) = invoke((fun () -> f() |> box)) |> unbox - member _.ScheduleRestart() = restart() } - -[] -do() - - -module Settings = + member _.FloatingPointFormat + with get () = fpfmt + and set v = fpfmt <- v + + member _.FormatProvider + with get () = fp + and set v = fp <- v + + member _.PrintWidth + with get () = printWidth + and set v = printWidth <- v + + member _.PrintDepth + with get () = printDepth + and set v = printDepth <- v + + member _.PrintLength + with get () = printLength + and set v = printLength <- v + + member _.PrintSize + with get () = printSize + and set v = printSize <- v + + member _.ShowDeclarationValues + with get () = showDeclarationValues + and set v = showDeclarationValues <- v + + member _.ShowProperties + with get () = showProperties + and set v = showProperties <- v + + member _.ShowIEnumerable + with get () = showIEnumerable + and set v = showIEnumerable <- v + + member _.ShowIDictionary + with get () = showIDictionary + and set v = showIDictionary <- v + + member _.AddedPrinters + with get () = addedPrinters + and set v = addedPrinters <- v + + member _.CommandLineArgs + with get () = args + and set v = args <- v + + member _.AddPrinter(printer: 'T -> string) = + addedPrinters <- Choice1Of2(typeof<'T>, (fun (x: obj) -> printer (unbox x))) :: addedPrinters + + member _.EventLoop + with get () = evLoop + and set (x: IEventLoop) = + evLoop.ScheduleRestart() + evLoop <- x + + member _.AddPrintTransformer(printer: 'T -> obj) = + addedPrinters <- Choice2Of2(typeof<'T>, (fun (x: obj) -> printer (unbox x))) :: addedPrinters + + member internal self.SetEventLoop(run: (unit -> bool), invoke: ((unit -> obj) -> obj), restart: (unit -> unit)) = + evLoop.ScheduleRestart() + + evLoop <- + { new IEventLoop with + member _.Run() = run () + + member _.Invoke(f) = + invoke ((fun () -> f () |> box)) |> unbox + + member _.ScheduleRestart() = restart () + } + +module Settings = let fsi = new InteractiveSession() - + [] - do() + do () // For legacy compatibility with old naming namespace Microsoft.FSharp.Compiler.Interactive - type IEventLoop = FSharp.Compiler.Interactive.IEventLoop - - type InteractiveSession = FSharp.Compiler.Interactive.InteractiveSession - - module Settings = +type IEventLoop = FSharp.Compiler.Interactive.IEventLoop - let fsi = FSharp.Compiler.Interactive.Settings.fsi +type InteractiveSession = FSharp.Compiler.Interactive.InteractiveSession +module Settings = + let fsi = FSharp.Compiler.Interactive.Settings.fsi diff --git a/src/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs b/src/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs index eca486f48cc..d9bbc5d9612 100644 --- a/src/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs +++ b/src/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs @@ -29,7 +29,6 @@ type internal FSharpInteractiveServer() = abstract Interrupt : unit -> unit default x.Interrupt() = () - [] static member StartServer(channelName:string,server:FSharpInteractiveServer) = let chan = new Ipc.IpcChannel(channelName) LifetimeServices.LeaseTime <- TimeSpan(7,0,0,0); // days,hours,mins,secs diff --git a/src/FSharp.Core/array.fs b/src/FSharp.Core/array.fs index 90f9a7fd7be..328536ddc97 100644 --- a/src/FSharp.Core/array.fs +++ b/src/FSharp.Core/array.fs @@ -75,7 +75,6 @@ namespace Microsoft.FSharp.Collections [] let empty<'T> : 'T [] = [| |] - [] [] let inline blit (source: 'T[]) (sourceIndex: int) (target: 'T[]) (targetIndex: int) (count: int) = Array.Copy(source, sourceIndex, target, targetIndex, count) diff --git a/src/FSharp.Core/local.fs b/src/FSharp.Core/local.fs index f7184b9ae36..a00cbbb43b2 100644 --- a/src/FSharp.Core/local.fs +++ b/src/FSharp.Core/local.fs @@ -87,9 +87,6 @@ module internal List = let inline arrayZeroCreate (n:int) = (# "newarr !0" type ('T) n : 'T array #) - [] - let nonempty x = match x with [] -> false | _ -> true - // optimized mutation-based implementation. This code is only valid in fslib, where mutation of private // tail cons cells is permitted in carefully written library code. let inline setFreshConsTail cons t = cons.( :: ).1 <- t diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 8a4c0b64fb0..7a72f29b1d8 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -561,7 +561,6 @@ module MapTree = [>)>] [] [] -[] [] type Map<[]'Key, []'Value when 'Key : comparison >(comparer: IComparer<'Key>, tree: MapTree<'Key, 'Value>) = diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index baa7fd5cb0b..907d34488ac 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -555,7 +555,6 @@ namespace Microsoft.FSharp.Core [] let InputMustBeNonNegativeString = SR.GetString(SR.inputMustBeNonNegative) - [] // nested module OK module IntrinsicOperators = //------------------------------------------------------------------------- // Lazy and/or. Laziness added by the F# compiler. @@ -584,7 +583,7 @@ namespace Microsoft.FSharp.Core (# "throw" (e :> System.Exception) : nativeptr<'T> #) open IntrinsicOperators - [] // nested module OK + module IntrinsicFunctions = // Unboxing, type casts, type tests @@ -2081,7 +2080,6 @@ namespace Microsoft.FSharp.Core let Float32IEquality = MakeGenericEqualityComparer() let DecimalIEquality = MakeGenericEqualityComparer() - [] type FastGenericEqualityComparerTable<'T>() = static let f : IEqualityComparer<'T> = match typeof<'T> with @@ -2162,7 +2160,6 @@ namespace Microsoft.FSharp.Core /// Use a type-indexed table to ensure we only create a single FastStructuralComparison function /// for each type - [] type FastGenericComparerTable<'T>() = // The CLI implementation of mscorlib optimizes array sorting @@ -2435,7 +2432,6 @@ namespace Microsoft.FSharp.Core let inline ParseSingle (s:string) = Single.Parse(removeUnderscores s,NumberStyles.Float, CultureInfo.InvariantCulture) - [] type GenericZeroDynamicImplTable<'T>() = static let result : 'T = // The dynamic implementation @@ -2459,7 +2455,6 @@ namespace Microsoft.FSharp.Core unboxPrim<'T> (pinfo.GetValue(null,null)) static member Result : 'T = result - [] type GenericOneDynamicImplTable<'T>() = static let result : 'T = // The dynamic implementation @@ -3417,19 +3412,15 @@ namespace Microsoft.FSharp.Core // Note: this is not made public in the signature, because of conflicts with the Converter overload. // The method remains in case someone is calling it via reflection. - [] - static member op_Implicit(converter : Func<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) + static member op_Implicit(converter: Func<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) // Note: this is not made public in the signature, because of conflicts with the Converter overload. // The method remains in case someone is calling it via reflection. - [] - static member op_Implicit(func : ('T -> 'Res) ) = new Func<'T,'Res>(func) + static member op_Implicit(func: ('T -> 'Res) ) = new Func<'T,'Res>(func) - [] - static member op_Implicit(f : Converter<_,_>) : ('T -> 'Res) = (fun t -> f.Invoke(t)) + static member op_Implicit(f: Converter<_,_>) : ('T -> 'Res) = (fun t -> f.Invoke(t)) - [] - static member op_Implicit (func : ('T -> 'Res) ) = new Converter<'T,'Res>(func) + static member op_Implicit (func: ('T -> 'Res) ) = new Converter<'T,'Res>(func) static member FromConverter (converter: Converter<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t)) @@ -3511,7 +3502,6 @@ namespace Microsoft.FSharp.Core [] [] [] - [] [] [] type Option<'T> = @@ -3607,7 +3597,6 @@ namespace Microsoft.FSharp.Collections [] [>)>] [] - [] [] [] type List<'T> = @@ -3845,7 +3834,6 @@ namespace Microsoft.FSharp.Core open Microsoft.FSharp.Core.BasicInlinedOperations open Microsoft.FSharp.Collections - [] module Operators = [] @@ -3909,17 +3897,14 @@ namespace Microsoft.FSharp.Core let inline failwith message = raise (Failure(message)) [] - [] let inline invalidArg (argumentName:string) (message:string) = raise (new ArgumentException(message,argumentName)) [] - [] let inline nullArg (argumentName:string) = raise (new ArgumentNullException(argumentName)) [] - [] let inline invalidOp message = raise (InvalidOperationException(message)) [] @@ -3931,18 +3916,15 @@ namespace Microsoft.FSharp.Core let inline reraise() = unbox(# "rethrow ldnull" : Object #) [] - [] let inline fst (a, _) = a [] - [] let inline snd (_, b) = b [] let inline ignore _ = () [] - [] let ref value = { contents = value } let (:=) cell value = cell.contents <- value @@ -4869,7 +4851,6 @@ namespace Microsoft.FSharp.Core [] let inline hash (obj: 'T) = LanguagePrimitives.GenericHash obj - [] let inline limitedHash (limit:int) (obj: 'T) = LanguagePrimitives.GenericLimitedHash limit obj @@ -5558,46 +5539,32 @@ namespace Microsoft.FSharp.Core loop n - [] let PowByte (x:byte) n = ComputePowerGenericInlined 1uy Checked.( * ) x n - [] let PowSByte (x:sbyte) n = ComputePowerGenericInlined 1y Checked.( * ) x n - [] let PowInt16 (x:int16) n = ComputePowerGenericInlined 1s Checked.( * ) x n - [] let PowUInt16 (x:uint16) n = ComputePowerGenericInlined 1us Checked.( * ) x n - [] let PowInt32 (x:int32) n = ComputePowerGenericInlined 1 Checked.( * ) x n - [] let PowUInt32 (x:uint32) n = ComputePowerGenericInlined 1u Checked.( * ) x n - [] let PowInt64 (x:int64) n = ComputePowerGenericInlined 1L Checked.( * ) x n - [] let PowUInt64 (x:uint64) n = ComputePowerGenericInlined 1UL Checked.( * ) x n - [] let PowIntPtr (x:nativeint) n = ComputePowerGenericInlined 1n Checked.( * ) x n - [] let PowUIntPtr (x:unativeint) n = ComputePowerGenericInlined 1un Checked.( * ) x n - [] let PowSingle (x:float32) n = ComputePowerGenericInlined 1.0f Checked.( * ) x n - [] let PowDouble (x:float) n = ComputePowerGenericInlined 1.0 Checked.( * ) x n - [] let PowDecimal (x:decimal) n = ComputePowerGenericInlined 1.0M Checked.( * ) x n - [] let PowGeneric (one, mul, value: 'T, exponent) = ComputePowerGenericInlined one mul value exponent let inline ComputeSlice bound start finish length = @@ -6188,7 +6155,6 @@ namespace Microsoft.FSharp.Core when ^T : float = Math.Pow((retype x : float), (retype y: float)) when ^T : float32 = Math.Pow(toFloat (retype x), toFloat(retype y)) |> toFloat32 - [] type AbsDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6203,7 +6169,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Abs" static member Result : ('T -> 'T) = result - [] type AcosDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6212,7 +6177,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Acos" static member Result : ('T -> 'T) = result - [] type AsinDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6221,7 +6185,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Asin" static member Result : ('T -> 'T) = result - [] type AtanDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6230,7 +6193,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Atan" static member Result : ('T -> 'T) = result - [] type Atan2DynamicImplTable<'T,'U>() = static let result : ('T -> 'T -> 'U) = let aty = typeof<'T> @@ -6239,7 +6201,6 @@ namespace Microsoft.FSharp.Core else BinaryDynamicImpl "Atan2" static member Result : ('T -> 'T -> 'U) = result - [] type CeilingDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6248,7 +6209,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Ceiling" static member Result : ('T -> 'T) = result - [] type ExpDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6257,7 +6217,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Exp" static member Result : ('T -> 'T) = result - [] type FloorDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6266,7 +6225,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Floor" static member Result : ('T -> 'T) = result - [] type TruncateDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6275,7 +6233,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Truncate" static member Result : ('T -> 'T) = result - [] type RoundDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6284,7 +6241,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Round" static member Result : ('T -> 'T) = result - [] type SignDynamicImplTable<'T>() = static let result : ('T -> int) = let aty = typeof<'T> @@ -6299,7 +6255,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Sign" static member Result : ('T -> int) = result - [] type LogDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6308,7 +6263,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Log" static member Result : ('T -> 'T) = result - [] type Log10DynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6317,7 +6271,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Log10" static member Result : ('T -> 'T) = result - [] type SqrtDynamicImplTable<'T,'U>() = static let result : ('T -> 'U) = let aty = typeof<'T> @@ -6326,7 +6279,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Sqrt" static member Result : ('T -> 'U) = result - [] type CosDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6335,7 +6287,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Cos" static member Result : ('T -> 'T) = result - [] type CoshDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6344,7 +6295,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Cosh" static member Result : ('T -> 'T) = result - [] type SinDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6353,7 +6303,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Sin" static member Result : ('T -> 'T) = result - [] type SinhDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6362,7 +6311,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Sinh" static member Result : ('T -> 'T) = result - [] type TanDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6371,7 +6319,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Tan" static member Result : ('T -> 'T) = result - [] type TanhDynamicImplTable<'T>() = static let result : ('T -> 'T) = let aty = typeof<'T> @@ -6380,7 +6327,6 @@ namespace Microsoft.FSharp.Core else UnaryDynamicImpl "Tanh" static member Result : ('T -> 'T) = result - [] type PowDynamicImplTable<'T,'U>() = static let result : ('T -> 'U -> 'T) = let aty = typeof<'T> @@ -6389,27 +6335,47 @@ namespace Microsoft.FSharp.Core else BinaryDynamicImpl "Pow" static member Result : ('T -> 'U -> 'T) = result - let AbsDynamic x = AbsDynamicImplTable<_>.Result x - let AcosDynamic x = AcosDynamicImplTable<_>.Result x - let AsinDynamic x = AsinDynamicImplTable<_>.Result x - let AtanDynamic x = AtanDynamicImplTable<_>.Result x - let Atan2Dynamic y x = Atan2DynamicImplTable<_,_>.Result y x - let CeilingDynamic x = CeilingDynamicImplTable<_>.Result x - let ExpDynamic x = ExpDynamicImplTable<_>.Result x - let FloorDynamic x = FloorDynamicImplTable<_>.Result x - let TruncateDynamic x = TruncateDynamicImplTable<_>.Result x - let RoundDynamic x = RoundDynamicImplTable<_>.Result x - let SignDynamic x = SignDynamicImplTable<_>.Result x - let LogDynamic x = LogDynamicImplTable<_>.Result x - let Log10Dynamic x = Log10DynamicImplTable<_>.Result x - let SqrtDynamic x = SqrtDynamicImplTable<_,_>.Result x - let CosDynamic x = CosDynamicImplTable<_>.Result x - let CoshDynamic x = CoshDynamicImplTable<_>.Result x - let SinDynamic x = SinDynamicImplTable<_>.Result x - let SinhDynamic x = SinhDynamicImplTable<_>.Result x - let TanDynamic x = TanDynamicImplTable<_>.Result x - let TanhDynamic x = TanhDynamicImplTable<_>.Result x - let PowDynamic x y = PowDynamicImplTable<_,_>.Result x y + let AbsDynamic x = AbsDynamicImplTable<_>.Result x + + let AcosDynamic x = AcosDynamicImplTable<_>.Result x + + let AsinDynamic x = AsinDynamicImplTable<_>.Result x + + let AtanDynamic x = AtanDynamicImplTable<_>.Result x + + let Atan2Dynamic y x = Atan2DynamicImplTable<_,_>.Result y x + + let CeilingDynamic x = CeilingDynamicImplTable<_>.Result x + + let ExpDynamic x = ExpDynamicImplTable<_>.Result x + + let FloorDynamic x = FloorDynamicImplTable<_>.Result x + + let TruncateDynamic x = TruncateDynamicImplTable<_>.Result x + + let RoundDynamic x = RoundDynamicImplTable<_>.Result x + + let SignDynamic x = SignDynamicImplTable<_>.Result x + + let LogDynamic x = LogDynamicImplTable<_>.Result x + + let Log10Dynamic x = Log10DynamicImplTable<_>.Result x + + let SqrtDynamic x = SqrtDynamicImplTable<_,_>.Result x + + let CosDynamic x = CosDynamicImplTable<_>.Result x + + let CoshDynamic x = CoshDynamicImplTable<_>.Result x + + let SinDynamic x = SinDynamicImplTable<_>.Result x + + let SinhDynamic x = SinhDynamicImplTable<_>.Result x + + let TanDynamic x = TanDynamicImplTable<_>.Result x + + let TanhDynamic x = TanhDynamicImplTable<_>.Result x + + let PowDynamic x y = PowDynamicImplTable<_,_>.Result x y open OperatorIntrinsics diff --git a/src/FSharp.Core/quotations.fs b/src/FSharp.Core/quotations.fs index 2dd9abf11b9..3ef11b97bd3 100644 --- a/src/FSharp.Core/quotations.fs +++ b/src/FSharp.Core/quotations.fs @@ -78,7 +78,6 @@ open Helpers [] [] -[] type Var(name: string, typ: Type, ?isMutable: bool) = inherit obj() diff --git a/src/FSharp.Core/seq.fs b/src/FSharp.Core/seq.fs index 6e82b071ba7..27699c40abb 100644 --- a/src/FSharp.Core/seq.fs +++ b/src/FSharp.Core/seq.fs @@ -1073,7 +1073,6 @@ module Seq = let cached = cache source2 source1 |> collect (fun x -> cached |> map (fun y -> x, y)) - [] [] let readonly (source:seq<_>) = checkNonNull "source" source diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index 9978a574c97..e59d3052168 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -558,7 +558,6 @@ module internal SetTree = [] [>)>] [] -[] type Set<[]'T when 'T: comparison >(comparer:IComparer<'T>, tree: SetTree<'T>) = [] @@ -663,14 +662,12 @@ type Set<[]'T when 'T: comparison >(comparer:IComparer<'T member s.ForAll f = SetTree.forall f s.Tree - [] static member (-) (set1: Set<'T>, set2: Set<'T>) = if SetTree.isEmpty set1.Tree then set1 (* 0 - B = 0 *) else if SetTree.isEmpty set2.Tree then set1 (* A - 0 = A *) else Set(set1.Comparer, SetTree.diff set1.Comparer set1.Tree set2.Tree) - [] static member (+) (set1: Set<'T>, set2: Set<'T>) = #if TRACE_SETS_AND_MAPS SetTree.report() diff --git a/vsintegration/src/FSharp.LanguageService/Colorize.fs b/vsintegration/src/FSharp.LanguageService/Colorize.fs index 7edbdfaf245..7badc11b7d6 100644 --- a/vsintegration/src/FSharp.LanguageService/Colorize.fs +++ b/vsintegration/src/FSharp.LanguageService/Colorize.fs @@ -265,7 +265,6 @@ type internal FSharpColorizer_DEPRECATED | None -> () } tokens() |> Array.ofSeq - [] // exceeds EndIndex member private c.GetColorInfo(line,lineText,length,lastColorState) = let refState = ref (ColorStateLookup_DEPRECATED.LexStateOfColorState lastColorState) scanner.SetLineText lineText