diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 0c8d9cef75c..21e531409e8 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -27,6 +27,7 @@ $(OtherFlags) --nowarn:3384 $(OtherFlags) --times --nowarn:75 $(OtherFlags) --test:ParallelCheckingWithSignatureFilesOn + $(OtherFlags) $(AdditionalFscCmdFlags) diff --git a/a b/a new file mode 100644 index 00000000000..6ff3473cd9a Binary files /dev/null and b/a differ diff --git a/src/Compiler/AbstractIL/ilsign.fs b/src/Compiler/AbstractIL/ilsign.fs index 0239f4759c0..c568da7ade6 100644 --- a/src/Compiler/AbstractIL/ilsign.fs +++ b/src/Compiler/AbstractIL/ilsign.fs @@ -297,12 +297,6 @@ let signStream stream keyBlob = let signature = createSignature hash keyBlob KeyType.KeyPair patchSignature stream peReader signature -let signFile fileName keyBlob = - use fs = - FileSystem.OpenFileForWriteShim(fileName, FileMode.Open, FileAccess.ReadWrite) - - signStream fs keyBlob - let signatureSize (pk: byte[]) = if pk.Length < 25 then raise (CryptographicException(getResourceString (FSComp.SR.ilSignInvalidPKBlob ()))) @@ -339,18 +333,9 @@ let signerOpenKeyPairFile filePath = let signerGetPublicKeyForKeyPair (kp: keyPair) : pubkey = getPublicKeyForKeyPair kp -let signerGetPublicKeyForKeyContainer (_kcName: keyContainerName) : pubkey = - raise (NotImplementedException("signerGetPublicKeyForKeyContainer is not yet implemented")) - -let signerCloseKeyContainer (_kc: keyContainerName) : unit = - raise (NotImplementedException("signerCloseKeyContainer is not yet implemented")) - let signerSignatureSize (pk: pubkey) : int = signatureSize pk -let signerSignFileWithKeyPair (fileName: string) (kp: keyPair) : unit = signFile fileName kp - -let signerSignFileWithKeyContainer (_fileName: string) (_kcName: keyContainerName) : unit = - raise (NotImplementedException("signerSignFileWithKeyContainer is not yet implemented")) +let signerSignStreamWithKeyPair stream keyBlob = signStream stream keyBlob let failWithContainerSigningUnsupportedOnThisPlatform () = failwith (FSComp.SR.containerSigningUnsupportedOnThisPlatform () |> snd) @@ -364,20 +349,12 @@ type ILStrongNameSigner = | KeyPair of keyPair | KeyContainer of keyContainerName - static member OpenPublicKeyOptions s p = - PublicKeyOptionsSigner((signerOpenPublicKeyFile s), p) + static member OpenPublicKeyOptions kp p = PublicKeyOptionsSigner(kp, p) - static member OpenPublicKey pubkey = PublicKeySigner pubkey - static member OpenKeyPairFile s = KeyPair(signerOpenKeyPairFile s) + static member OpenPublicKey bytes = PublicKeySigner bytes + static member OpenKeyPairFile bytes = KeyPair(bytes) static member OpenKeyContainer s = KeyContainer s - member s.Close() = - match s with - | PublicKeySigner _ - | PublicKeyOptionsSigner _ - | KeyPair _ -> () - | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () - member s.IsFullySigned = match s with | PublicKeySigner _ -> false @@ -412,9 +389,9 @@ type ILStrongNameSigner = | KeyPair kp -> pkSignatureSize (signerGetPublicKeyForKeyPair kp) | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () - member s.SignFile file = + member s.SignStream stream = match s with | PublicKeySigner _ -> () | PublicKeyOptionsSigner _ -> () - | KeyPair kp -> signerSignFileWithKeyPair file kp + | KeyPair kp -> signerSignStreamWithKeyPair stream kp | KeyContainer _ -> failWithContainerSigningUnsupportedOnThisPlatform () diff --git a/src/Compiler/AbstractIL/ilsign.fsi b/src/Compiler/AbstractIL/ilsign.fsi index 23a82daffca..9dcdbf8ecda 100644 --- a/src/Compiler/AbstractIL/ilsign.fsi +++ b/src/Compiler/AbstractIL/ilsign.fsi @@ -7,18 +7,20 @@ module internal FSharp.Compiler.AbstractIL.StrongNameSign +open System +open System.IO + //--------------------------------------------------------------------- // Strong name signing //--------------------------------------------------------------------- [] type ILStrongNameSigner = member PublicKey: byte[] - static member OpenPublicKeyOptions: string -> bool -> ILStrongNameSigner + static member OpenPublicKeyOptions: byte array -> bool -> ILStrongNameSigner static member OpenPublicKey: byte[] -> ILStrongNameSigner - static member OpenKeyPairFile: string -> ILStrongNameSigner + static member OpenKeyPairFile: byte[] -> ILStrongNameSigner static member OpenKeyContainer: string -> ILStrongNameSigner - member Close: unit -> unit member IsFullySigned: bool member PublicKey: byte[] member SignatureSize: int - member SignFile: string -> unit + member SignStream: Stream -> unit diff --git a/src/Compiler/AbstractIL/ilwrite.fs b/src/Compiler/AbstractIL/ilwrite.fs index fb024b63f06..33894493f4b 100644 --- a/src/Compiler/AbstractIL/ilwrite.fs +++ b/src/Compiler/AbstractIL/ilwrite.fs @@ -502,9 +502,7 @@ type cenv = emitTailcalls: bool - deterministic: bool - - showTimes: bool + deterministic: bool desiredMetadataVersion: ILVersionInfo @@ -3023,14 +3021,14 @@ let GenModule (cenv : cenv) (modul: ILModuleDef) = let midx = AddUnsharedRow cenv TableNames.Module (GetModuleAsRow cenv modul) List.iter (GenResourcePass3 cenv) (modul.Resources.AsList()) let tdefs = destTypeDefsWithGlobalFunctionsFirst cenv.ilg modul.TypeDefs - reportTime cenv.showTimes "Module Generation Preparation" + reportTime "Module Generation Preparation" GenTypeDefsPass1 [] cenv tdefs - reportTime cenv.showTimes "Module Generation Pass 1" + reportTime "Module Generation Pass 1" GenTypeDefsPass2 0 [] cenv tdefs - reportTime cenv.showTimes "Module Generation Pass 2" + reportTime "Module Generation Pass 2" (match modul.Manifest with None -> () | Some m -> GenManifestPass3 cenv m) GenTypeDefsPass3 [] cenv tdefs - reportTime cenv.showTimes "Module Generation Pass 3" + reportTime "Module Generation Pass 3" GenCustomAttrsPass3Or4 cenv (hca_Module, midx) modul.CustomAttrs // GenericParam is the only sorted table indexed by Columns in other tables (GenericParamConstraint\CustomAttributes). // Hence we need to sort it before we emit any entries in GenericParamConstraint\CustomAttributes that are attached to generic params. @@ -3038,7 +3036,7 @@ let GenModule (cenv : cenv) (modul: ILModuleDef) = // the key --> index map since it is no longer valid cenv.GetTable(TableNames.GenericParam).SetRowsOfSharedTable (SortTableRows TableNames.GenericParam (cenv.GetTable(TableNames.GenericParam).GenericRowsOfTable)) GenTypeDefsPass4 [] cenv tdefs - reportTime cenv.showTimes "Module Generation Pass 4" + reportTime "Module Generation Pass 4" /// Arbitrary value [] @@ -3056,8 +3054,7 @@ let generateIL ( generatePdb, ilg: ILGlobals, emitTailcalls, - deterministic, - showTimes, + deterministic, referenceAssemblyOnly, referenceAssemblyAttribOpt: ILAttribute option, allGivenSources, @@ -3098,8 +3095,7 @@ let generateIL ( MetadataTable.Unshared (MetadataTable.New ("row table "+string i, EqualityComparer.Default))) use cenv = { emitTailcalls=emitTailcalls - deterministic = deterministic - showTimes=showTimes + deterministic = deterministic ilg = ilg desiredMetadataVersion=desiredMetadataVersion requiredDataFixups= requiredDataFixups @@ -3183,7 +3179,7 @@ let generateIL ( EventTokenMap = (fun t edef -> let tidx = idxForNextedTypeDef t getUncodedToken TableNames.Event (cenv.eventDefs.GetTableEntry (EventKey (tidx, edef.Name)))) } - reportTime cenv.showTimes "Finalize Module Generation Results" + reportTime "Finalize Module Generation Results" // New return the results let data = cenv.data.AsMemory().ToArray() let resources = cenv.resources.AsMemory().ToArray() @@ -3217,8 +3213,7 @@ let writeILMetadataAndCode ( desiredMetadataVersion, ilg, emitTailcalls, - deterministic, - showTimes, + deterministic, referenceAssemblyOnly, referenceAssemblyAttribOpt, allGivenSources, @@ -3240,8 +3235,7 @@ let writeILMetadataAndCode ( generatePdb, ilg, emitTailcalls, - deterministic, - showTimes, + deterministic, referenceAssemblyOnly, referenceAssemblyAttribOpt, allGivenSources, @@ -3249,7 +3243,7 @@ let writeILMetadataAndCode ( cilStartAddress, normalizeAssemblyRefs) - reportTime showTimes "Generated Tables and Code" + reportTime "Generated Tables and Code" let tableSize (tab: TableName) = tables[tab.Index].Count // Now place the code @@ -3321,7 +3315,7 @@ let writeILMetadataAndCode ( (if tableSize TableNames.GenericParamConstraint > 0 then 0x00001000 else 0x00000000) ||| 0x00000200 - reportTime showTimes "Layout Header of Tables" + reportTime "Layout Header of Tables" let guidAddress n = (if n = 0 then 0 else (n - 1) * 0x10 + 0x01) @@ -3365,7 +3359,7 @@ let writeILMetadataAndCode ( if n >= blobAddressTable.Length then failwith "blob index out of range" blobAddressTable[n] - reportTime showTimes "Build String/Blob Address Tables" + reportTime "Build String/Blob Address Tables" let sortedTables = Array.init 64 (fun i -> @@ -3374,7 +3368,7 @@ let writeILMetadataAndCode ( let rows = tab.GenericRowsOfTable if TableRequiresSorting tabName then SortTableRows tabName rows else rows) - reportTime showTimes "Sort Tables" + reportTime "Sort Tables" let codedTables = @@ -3489,7 +3483,7 @@ let writeILMetadataAndCode ( tablesBuf.EmitInt32 rows.Length - reportTime showTimes "Write Header of tablebuf" + reportTime "Write Header of tablebuf" // The tables themselves for rows in sortedTables do @@ -3524,7 +3518,7 @@ let writeILMetadataAndCode ( tablesBuf.AsMemory().ToArray() - reportTime showTimes "Write Tables to tablebuf" + reportTime "Write Tables to tablebuf" let tablesStreamUnpaddedSize = codedTables.Length // QUERY: extra 4 empty bytes in array.exe - why? Include some extra padding after @@ -3541,7 +3535,7 @@ let writeILMetadataAndCode ( let blobsChunk, _next = chunk blobsStreamPaddedSize next let blobsStreamPadding = blobsChunk.size - blobsStreamUnpaddedSize - reportTime showTimes "Layout Metadata" + reportTime "Layout Metadata" let metadata, guidStart = use mdbuf = ByteBuffer.Create(MetadataCapacity, useArrayPool = true) @@ -3576,12 +3570,12 @@ let writeILMetadataAndCode ( mdbuf.EmitInt32 blobsChunk.size mdbuf.EmitIntsAsBytes [| 0x23; 0x42; 0x6c; 0x6f; 0x62; 0x00; 0x00; 0x00; (* #Blob000 *)|] - reportTime showTimes "Write Metadata Header" + reportTime "Write Metadata Header" // Now the coded tables themselves mdbuf.EmitBytes codedTables for i = 1 to tablesStreamPadding do mdbuf.EmitIntAsByte 0x00 - reportTime showTimes "Write Metadata Tables" + reportTime "Write Metadata Tables" // The string stream mdbuf.EmitByte 0x00uy @@ -3589,7 +3583,7 @@ let writeILMetadataAndCode ( mdbuf.EmitBytes s for i = 1 to stringsStreamPadding do mdbuf.EmitIntAsByte 0x00 - reportTime showTimes "Write Metadata Strings" + reportTime "Write Metadata Strings" // The user string stream mdbuf.EmitByte 0x00uy for s in userStrings do @@ -3599,7 +3593,7 @@ let writeILMetadataAndCode ( for i = 1 to userStringsStreamPadding do mdbuf.EmitIntAsByte 0x00 - reportTime showTimes "Write Metadata User Strings" + reportTime "Write Metadata User Strings" // The GUID stream let guidStart = mdbuf.Position Array.iter mdbuf.EmitBytes guids @@ -3611,7 +3605,7 @@ let writeILMetadataAndCode ( mdbuf.EmitBytes s for i = 1 to blobsStreamPadding do mdbuf.EmitIntAsByte 0x00 - reportTime showTimes "Write Blob Stream" + reportTime "Write Blob Stream" // Done - close the buffer and return the result. mdbuf.AsMemory().ToArray(), guidStart @@ -3627,7 +3621,7 @@ let writeILMetadataAndCode ( let token = getUncodedToken TableNames.UserStrings (userStringAddress userStringIndex) if (Bytes.get code (locInCode-1) <> i_ldstr) then failwith "strings-in-code fixup: not at ldstr instruction!" applyFixup32 code locInCode token - reportTime showTimes "Fixup Metadata" + reportTime "Fixup Metadata" entryPointToken, code, codePadding, metadata, data, resources, requiredDataFixups.Value, pdbData, mappings, guidStart @@ -3690,8 +3684,7 @@ let writeDirectory os dict = let writeBytes (os: BinaryWriter) (chunk: byte[]) = os.Write(chunk, 0, chunk.Length) let writePdb ( - dumpDebugInfo, - showTimes, + dumpDebugInfo, embeddedPDB, pdbfile, outfile, @@ -3714,9 +3707,22 @@ let writePdb ( // Used to capture the pdb file bytes in the case we're generating in-memory let mutable pdbBytes = None + let signImage () = + // Sign the binary. No further changes to binary allowed past this point! + match signer with + | None -> () + | Some s -> + use fs = reopenOutput() + try + s.SignStream fs + with exn -> + failwith ($"Warning: A call to SignFile failed ({exn.Message})") + reportTime "Signing Image" + // Now we've done the bulk of the binary, do the PDB file and fixup the binary. match pdbfile with - | None -> () + | None -> signImage () + | Some pdbfile -> let idd = match pdbInfoOpt with @@ -3741,7 +3747,7 @@ let writePdb ( stream.WriteTo fs getInfoForPortablePdb contentId pdbfile pathMap debugDataChunk debugDeterministicPdbChunk debugChecksumPdbChunk algorithmName checkSum embeddedPDB deterministic | None -> [| |] - reportTime showTimes "Generate PDB Info" + reportTime "Generate PDB Info" // Now we have the debug data we can go back and fill in the debug directory in the image use fs2 = reopenOutput() @@ -3766,28 +3772,15 @@ let writePdb ( os2.BaseStream.Seek (int64 (textV2P i.iddChunk.addr), SeekOrigin.Begin) |> ignore if i.iddChunk.size < i.iddData.Length then failwith "Debug data area is not big enough. Debug info may not be usable" writeBytes os2 i.iddData + reportTime "Finalize PDB" + signImage () os2.Dispose() with exn -> failwith ("Error while writing debug directory entry: " + exn.Message) (try os2.Dispose(); FileSystem.FileDeleteShim outfile with _ -> ()) reraise() - - reportTime showTimes "Finalize PDB" - - // Sign the binary. No further changes to binary allowed past this point! - match signer with - | None -> () - | Some s -> - try - s.SignFile outfile - s.Close() - with exn -> - failwith ("Warning: A call to SignFile failed ("+exn.Message+")") - (try s.Close() with _ -> ()) - (try FileSystem.FileDeleteShim outfile with _ -> ()) - () - - reportTime showTimes "Signing Image" + + reportTime "Finish" pdbBytes type options = @@ -3803,8 +3796,7 @@ type options = checksumAlgorithm: HashAlgorithm signer: ILStrongNameSigner option emitTailcalls: bool - deterministic: bool - showTimes: bool + deterministic: bool dumpDebugInfo: bool referenceAssemblyOnly: bool referenceAssemblyAttribOpt: ILAttribute option @@ -3815,7 +3807,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe // Store the public key from the signer into the manifest. This means it will be written // to the binary and also acts as an indicator to leave space for delay sign - reportTime options.showTimes "Write Started" + reportTime "Write Started" let isDll = modul.IsDLL let ilg = options.ilg @@ -3929,8 +3921,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe desiredMetadataVersion, ilg, options.emitTailcalls, - options.deterministic, - options.showTimes, + options.deterministic, options.referenceAssemblyOnly, options.referenceAssemblyAttribOpt, options.allGivenSources, @@ -3939,7 +3930,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe normalizeAssemblyRefs ) - reportTime options.showTimes "Generated IL and metadata" + reportTime "Generated IL and metadata" let _codeChunk, next = chunk code.Length next let _codePaddingChunk, next = chunk codePadding.Length next @@ -3972,7 +3963,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe match options.pdbfile, options.portablePDB with | Some _, true -> let pdbInfo = - generatePortablePdb options.embedAllSource options.embedSourceList options.sourceLink options.checksumAlgorithm options.showTimes pdbData options.pathMap + generatePortablePdb options.embedAllSource options.embedSourceList options.sourceLink options.checksumAlgorithm pdbData options.pathMap if options.embeddedPDB then let (uncompressedLength, contentId, stream, algorithmName, checkSum) = pdbInfo @@ -4098,7 +4089,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe let imageEndSectionPhysLoc = nextPhys let imageEndAddr = next - reportTime options.showTimes "Layout image" + reportTime "Layout image" let write p (os: BinaryWriter) chunkName chunk = match p with @@ -4505,7 +4496,7 @@ let writeBinaryAux (stream: Stream, options: options, modul, normalizeAssemblyRe pdbData, pdbInfoOpt, debugDirectoryChunk, debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, debugDeterministicPdbChunk, textV2P, mappings - reportTime options.showTimes "Writing Image" + reportTime "Writing Image" pdbData, pdbInfoOpt, debugDirectoryChunk, debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, debugDeterministicPdbChunk, textV2P, mappings let writeBinaryFiles (options: options, modul, normalizeAssemblyRefs) = @@ -4531,10 +4522,9 @@ let writeBinaryFiles (options: options, modul, normalizeAssemblyRefs) = reraise() let reopenOutput () = - FileSystem.OpenFileForWriteShim(options.outfile, FileMode.Open, FileAccess.Write, FileShare.Read) + FileSystem.OpenFileForWriteShim(options.outfile, FileMode.Open, FileAccess.ReadWrite, FileShare.Read) - writePdb (options.dumpDebugInfo, - options.showTimes, + writePdb (options.dumpDebugInfo, options.embeddedPDB, options.pdbfile, options.outfile, @@ -4561,11 +4551,12 @@ let writeBinaryInMemory (options: options, modul, normalizeAssemblyRefs) = let pdbData, pdbInfoOpt, debugDirectoryChunk, debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, debugDeterministicPdbChunk, textV2P, _mappings = writeBinaryAux(stream, options, modul, normalizeAssemblyRefs) - let reopenOutput () = stream + let reopenOutput () = + stream.Seek(0, SeekOrigin.Begin) |> ignore + stream let pdbBytes = - writePdb (options.dumpDebugInfo, - options.showTimes, + writePdb (options.dumpDebugInfo, options.embeddedPDB, options.pdbfile, options.outfile, diff --git a/src/Compiler/AbstractIL/ilwrite.fsi b/src/Compiler/AbstractIL/ilwrite.fsi index 780a6a95f09..a5240473fb1 100644 --- a/src/Compiler/AbstractIL/ilwrite.fsi +++ b/src/Compiler/AbstractIL/ilwrite.fsi @@ -22,7 +22,6 @@ type options = signer: ILStrongNameSigner option emitTailcalls: bool deterministic: bool - showTimes: bool dumpDebugInfo: bool referenceAssemblyOnly: bool referenceAssemblyAttribOpt: ILAttribute option diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 715987a2ad1..9b969bae098 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -316,10 +316,10 @@ let pdbGetDebugInfo let getDebugFileName outfile = (FileSystemUtils.chopExtension outfile) + ".pdb" -let sortMethods showTimes info = - reportTime showTimes (sprintf "PDB: Defined %d documents" info.Documents.Length) +let sortMethods info = + reportTime (sprintf "PDB: Defined %d documents" info.Documents.Length) Array.sortInPlaceBy (fun x -> x.MethToken) info.Methods - reportTime showTimes (sprintf "PDB: Sorted %d methods" info.Methods.Length) + reportTime (sprintf "PDB: Sorted %d methods" info.Methods.Length) () let getRowCounts tableRowCounts = @@ -345,7 +345,6 @@ type PortablePdbGenerator embedSourceList: string list, sourceLink: string, checksumAlgorithm, - showTimes, info: PdbData, pathMap: PathMap ) = @@ -784,7 +783,7 @@ type PortablePdbGenerator | Some scope -> writeMethodScopes minfo.MethToken scope member _.Emit() = - sortMethods showTimes info + sortMethods info metadata.SetCapacity(TableIndex.MethodDebugInformation, info.Methods.Length) defineModuleImportScope () @@ -823,7 +822,7 @@ type PortablePdbGenerator let contentId = serializer.Serialize blobBuilder let portablePdbStream = new MemoryStream() blobBuilder.WriteContentTo portablePdbStream - reportTime showTimes "PDB: Created" + reportTime "PDB: Created" (portablePdbStream.Length, contentId, portablePdbStream, algorithmName, contentHash) let generatePortablePdb @@ -831,12 +830,11 @@ let generatePortablePdb (embedSourceList: string list) (sourceLink: string) checksumAlgorithm - showTimes (info: PdbData) (pathMap: PathMap) = let generator = - PortablePdbGenerator(embedAllSource, embedSourceList, sourceLink, checksumAlgorithm, showTimes, info, pathMap) + PortablePdbGenerator(embedAllSource, embedSourceList, sourceLink, checksumAlgorithm, info, pathMap) generator.Emit() diff --git a/src/Compiler/AbstractIL/ilwritepdb.fsi b/src/Compiler/AbstractIL/ilwritepdb.fsi index 79c1db52ac0..5987cc165e3 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fsi +++ b/src/Compiler/AbstractIL/ilwritepdb.fsi @@ -107,7 +107,6 @@ val generatePortablePdb: embedSourceList: string list -> sourceLink: string -> checksumAlgorithm: HashAlgorithm -> - showTimes: bool -> info: PdbData -> pathMap: PathMap -> int64 * BlobContentId * MemoryStream * string * byte[] diff --git a/src/Compiler/Checking/AugmentWithHashCompare.fs b/src/Compiler/Checking/AugmentWithHashCompare.fs index dd81dc0a575..ad2645e1940 100644 --- a/src/Compiler/Checking/AugmentWithHashCompare.fs +++ b/src/Compiler/Checking/AugmentWithHashCompare.fs @@ -996,7 +996,16 @@ let MakeBindingsForEqualityWithComparerAugmentation (g: TcGlobals) (tycon: Tycon // build the hash rhs let withcGetHashCodeExpr = let compv, compe = mkCompGenLocal m "comp" g.IEqualityComparer_ty - let thisv, hashe = hashf g tcref tycon compe + + // Special case List type to avoid StackOverflow exception , call custom hash code instead + let thisv,hashe = + if tyconRefEq g tcref g.list_tcr_canon && tycon.HasMember g "CustomHashCode" [g.IEqualityComparer_ty] then + let customCodeVal = (tycon.TryGetMember g "CustomHashCode" [g.IEqualityComparer_ty]).Value + let tinst, ty = mkMinimalTy g tcref + let thisv, thise = mkThisVar g m ty + thisv,mkApps g ((exprForValRef m customCodeVal, customCodeVal.Type), (if isNil tinst then [] else [tinst]), [thise; compe], m) + else + hashf g tcref tycon compe mkLambdas g m tps [thisv; compv] (hashe, g.int_ty) // build the equals rhs diff --git a/src/Compiler/Checking/CheckComputationExpressions.fs b/src/Compiler/Checking/CheckComputationExpressions.fs index db8d307381f..a1c89f61dc7 100644 --- a/src/Compiler/Checking/CheckComputationExpressions.fs +++ b/src/Compiler/Checking/CheckComputationExpressions.fs @@ -1672,6 +1672,9 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol let bindCall = mkSynCall bindName bindRange (bindArgs @ [consumeExpr]) translatedCtxt (bindCall |> addBindDebugPoint)) + /// This function is for desugaring into .Bind{N}Return calls if possible + /// The outer option indicates if .BindReturn is possible. When it returns None, .BindReturn cannot be used + /// The inner option indicates if a custom operation is involved inside and convertSimpleReturnToExpr varSpace innerComp = match innerComp with | SynExpr.YieldOrReturn ((false, _), returnExpr, m) -> @@ -1697,7 +1700,8 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol | Some (thenExpr, None) -> let elseExprOptOpt = match elseCompOpt with - | None -> Some None + // When we are missing an 'else' part alltogether in case of 'if cond then return exp', we fallback from BindReturn into regular Bind+Return + | None -> None | Some elseComp -> match convertSimpleReturnToExpr varSpace elseComp with | None -> None // failure diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs index 7ea1c4b3429..a501f74edc0 100644 --- a/src/Compiler/Checking/CheckDeclarations.fs +++ b/src/Compiler/Checking/CheckDeclarations.fs @@ -1655,6 +1655,19 @@ module MutRecBindingChecking = defnsEs, envMutRec +let private ReportErrorOnStaticClass (synMembers: SynMemberDefn list) = + for mem in synMembers do + match mem with + | SynMemberDefn.ImplicitCtor(ctorArgs = SynSimplePats.SimplePats(pats = pats)) when (not pats.IsEmpty) -> + for pat in pats do + errorR(Error(FSComp.SR.chkConstructorWithArgumentsOnStaticClasses(), pat.Range)) + + | SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Constructor -> + errorR(Error(FSComp.SR.chkAdditionalConstructorOnStaticClasses(), m)) + | SynMemberDefn.Member(SynBinding(valData = SynValData(memberFlags = Some memberFlags)), m) when memberFlags.MemberKind = SynMemberKind.Member && memberFlags.IsInstance -> + errorR(Error(FSComp.SR.chkInstanceMemberOnStaticClasses(), m)); + | _ -> () + /// Check and generalize the interface implementations, members, 'let' definitions in a mutually recursive group of definitions. let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (envMutRec: TcEnv) (mutRecDefns: MutRecDefnsPhase2Data) isMutRec = let g = cenv.g @@ -1755,7 +1768,13 @@ let TcMutRecDefns_Phase2 (cenv: cenv) envInitial mBinds scopem mutRecNSInfo (env let binds: MutRecDefnsPhase2Info = (envMutRec, mutRecDefns) ||> MutRecShapes.mapTyconsWithEnv (fun envForDecls tyconData -> - let (MutRecDefnsPhase2DataForTycon(tyconOpt, _, declKind, tcref, _, _, declaredTyconTypars, _, _, _, fixupFinalAttrs)) = tyconData + let (MutRecDefnsPhase2DataForTycon(tyconOpt, _x, declKind, tcref, _, _, declaredTyconTypars, synMembers, _, _, fixupFinalAttrs)) = tyconData + + // If a tye uses both [] and [] attributes it means it is a static class. + let isStaticClass = HasFSharpAttribute cenv.g cenv.g.attrib_SealedAttribute tcref.Attribs && HasFSharpAttribute cenv.g cenv.g.attrib_AbstractClassAttribute tcref.Attribs + if isStaticClass && cenv.g.langVersion.SupportsFeature(LanguageFeature.ErrorReportingOnStaticClasses) then + ReportErrorOnStaticClass synMembers + let envForDecls = // This allows to implement protected interface methods if it's a DIM. // Does not need to be hidden behind a lang version as it needs to be possible to @@ -4030,6 +4049,7 @@ module TcDeclarations = let rec private SplitTyconDefn (SynTypeDefn(typeInfo=synTyconInfo;typeRepr=trepr; members=extraMembers)) = let extraMembers = desugarGetSetMembers extraMembers let implements1 = List.choose (function SynMemberDefn.Interface (interfaceType=ty) -> Some(ty, ty.Range) | _ -> None) extraMembers + match trepr with | SynTypeDefnRepr.ObjectModel(kind, cspec, m) -> let cspec = desugarGetSetMembers cspec @@ -4047,7 +4067,7 @@ module TcDeclarations = let members = let membersIncludingAutoProps = cspec |> List.filter (fun memb -> - match memb with + match memb with | SynMemberDefn.Interface _ | SynMemberDefn.Member _ | SynMemberDefn.GetSetMember _ @@ -4837,7 +4857,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let moduleEntity = Construct.NewModuleOrNamespace (Some env.eCompPath) vis id xmlDoc modAttrs (MaybeLazy.Strict moduleTy) // Now typecheck. - let! moduleContents, topAttrsNew, envAtEnd = TcModuleOrNamespaceElements cenv (Parent (mkLocalModuleRef moduleEntity)) endm envForModule xml None [] moduleDefs + let! moduleContents, topAttrsNew, envAtEnd = TcModuleOrNamespaceElements cenv (Parent (mkLocalModuleRef moduleEntity)) endm envForModule xml None [] moduleDefs // Get the inferred type of the decls and record it in the modul. moduleEntity.entity_modul_type <- MaybeLazy.Strict moduleTyAcc.Value @@ -4924,8 +4944,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let! moduleContents, topAttrs, envAtEnd = TcModuleOrNamespaceElements cenv parent endm envNS xml mutRecNSInfo [] defs - MutRecBindingChecking.TcMutRecDefns_UpdateNSContents nsInfo - + MutRecBindingChecking.TcMutRecDefns_UpdateNSContents nsInfo let env, openDecls = if isNil enclosingNamespacePath then envAtEnd, [] @@ -5316,8 +5335,8 @@ let CheckOneImplFile use _ = Activity.start "CheckDeclarations.CheckOneImplFile" [| - "fileName", fileName - "qualifiedNameOfFile", qualNameOfFile.Text + Activity.Tags.fileName, fileName + Activity.Tags.qualifiedNameOfFile, qualNameOfFile.Text |] let cenv = cenv.Create (g, isScript, amap, thisCcu, false, Option.isSome rootSigOpt, @@ -5450,8 +5469,8 @@ let CheckOneSigFile (g, amap, thisCcu, checkForErrors, conditionalDefines, tcSin use _ = Activity.start "CheckDeclarations.CheckOneSigFile" [| - "fileName", sigFile.FileName - "qualifiedNameOfFile", sigFile.QualifiedName.Text + Activity.Tags.fileName, sigFile.FileName + Activity.Tags.qualifiedNameOfFile, sigFile.QualifiedName.Text |] let cenv = cenv.Create diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs index d4ff82dd1da..ef4930408a0 100644 --- a/src/Compiler/Checking/CheckExpressions.fs +++ b/src/Compiler/Checking/CheckExpressions.fs @@ -1015,15 +1015,16 @@ let MakeMemberDataAndMangledNameForMemberVal(g, tcref, isExtrinsic, attrs, implS if not isCompGen && IsLogicalInfixOpName id.idText then let m = id.idRange - let name = ConvertValLogicalNameToDisplayNameCore id.idText + let logicalName = id.idText + let displayName = ConvertValLogicalNameToDisplayNameCore logicalName // Check symbolic members. Expect valSynData implied arity to be [[2]]. match SynInfo.AritiesOfArgs valSynData with - | [] | [0] -> warning(Error(FSComp.SR.memberOperatorDefinitionWithNoArguments name, m)) + | [] | [0] -> warning(Error(FSComp.SR.memberOperatorDefinitionWithNoArguments displayName, m)) | n :: otherArgs -> - let opTakesThreeArgs = IsLogicalTernaryOperator name - if n<>2 && not opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonPairArgument(name, n), m)) - if n<>3 && opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonTripleArgument(name, n), m)) - if not (isNil otherArgs) then warning(Error(FSComp.SR.memberOperatorDefinitionWithCurriedArguments name, m)) + let opTakesThreeArgs = IsLogicalTernaryOperator logicalName + if n<>2 && not opTakesThreeArgs then warning(Error(FSComp.SR.memberOperatorDefinitionWithNonPairArgument(displayName, n), m)) + 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 warning(Error(FSComp.SR.tcMemberOperatorDefinitionInExtrinsic(), id.idRange)) @@ -1209,6 +1210,12 @@ let CheckRequiredProperties (g:TcGlobals) (env: TcEnv) (cenv: TcFileState) (minf let details = NicePrint.multiLineStringOfPropInfos g cenv.amap mMethExpr env.DisplayEnv missingProps errorR(Error(FSComp.SR.tcMissingRequiredMembers details, mMethExpr)) +let private HasMethodImplNoInliningAttribute g attrs = + match TryFindFSharpAttribute g g.attrib_MethodImplAttribute attrs with + // NO_INLINING = 8 + | Some (Attrib(_, _, [ AttribInt32Arg flags ], _, _, _, _)) -> (flags &&& 0x8) <> 0x0 + | _ -> false + let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRecInfo, vscheme, attrs, xmlDoc, konst, isGeneratedEventVal) = let g = cenv.g @@ -1257,16 +1264,10 @@ let MakeAndPublishVal (cenv: cenv) env (altActualParent, inSig, declKind, valRec errorR(Error(FSComp.SR.tcDllImportStubsCannotBeInlined(), m)) ValInline.Never else - let implflags = - match TryFindFSharpAttribute g g.attrib_MethodImplAttribute attrs with - | Some (Attrib(_, _, [ AttribInt32Arg flags ], _, _, _, _)) -> flags - | _ -> 0x0 - // MethodImplOptions.NoInlining = 0x8 - let NO_INLINING = 0x8 - if (implflags &&& NO_INLINING) <> 0x0 then - ValInline.Never - else - inlineFlag + if HasMethodImplNoInliningAttribute g attrs + then ValInline.Never + else inlineFlag + // CompiledName not allowed on virtual/abstract/override members let compiledNameAttrib = TryFindFSharpStringAttribute g g.attrib_CompiledNameAttribute attrs @@ -2204,26 +2205,32 @@ module GeneralizationHelpers = // ComputeInlineFlag //------------------------------------------------------------------------- -let ComputeInlineFlag (memFlagsOption: SynMemberFlags option) isInline isMutable hasNoCompilerInliningAttribute m = - let inlineFlag = - let isCtorOrAbstractSlot = - match memFlagsOption with - | None -> false - | Some x -> (x.MemberKind = SynMemberKind.Constructor) || x.IsDispatchSlot || x.IsOverrideOrExplicitImpl +let ComputeInlineFlag (memFlagsOption: SynMemberFlags option) isInline isMutable g attrs m = + let hasNoCompilerInliningAttribute() = HasFSharpAttribute g g.attrib_NoCompilerInliningAttribute attrs + let isCtorOrAbstractSlot() = + match memFlagsOption with + | None -> false + | Some x -> (x.MemberKind = SynMemberKind.Constructor) || x.IsDispatchSlot || x.IsOverrideOrExplicitImpl + let inlineFlag, reportIncorrectInlineKeywordUsage = // Mutable values may never be inlined // Constructors may never be inlined // Calls to virtual/abstract slots may never be inlined - // Values marked with NoCompilerInliningAttribute may never be inlined - if isMutable || isCtorOrAbstractSlot || hasNoCompilerInliningAttribute then - ValInline.Never + // Values marked with NoCompilerInliningAttribute or [] may never be inlined + if isMutable || isCtorOrAbstractSlot() || hasNoCompilerInliningAttribute() then + ValInline.Never, errorR + elif HasMethodImplNoInliningAttribute g attrs then + ValInline.Never, + if g.langVersion.SupportsFeature LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction + then warning + else ignore elif isInline then - ValInline.Always + ValInline.Always, ignore else - ValInline.Optional + ValInline.Optional, ignore if isInline && (inlineFlag <> ValInline.Always) then - errorR(Error(FSComp.SR.tcThisValueMayNotBeInlined(), m)) + reportIncorrectInlineKeywordUsage (Error(FSComp.SR.tcThisValueMayNotBeInlined(), m)) inlineFlag @@ -4378,7 +4385,7 @@ and CheckIWSAM (cenv: cenv) (env: TcEnv) checkConstraints iwsam m tcref = if iwsam = WarnOnIWSAM.Yes && isInterfaceTy g ty && checkConstraints = CheckCxs then let tcref = tcrefOfAppTy g ty let meths = AllMethInfosOfTypeInScope ResultCollectionSettings.AllResults cenv.infoReader env.NameEnv None ad IgnoreOverrides m ty - if meths |> List.exists (fun meth -> not meth.IsInstance && meth.IsDispatchSlot) then + if meths |> List.exists (fun meth -> not meth.IsInstance && meth.IsDispatchSlot && not meth.IsExtensionMember) then warning(Error(FSComp.SR.tcUsingInterfaceWithStaticAbstractMethodAsType(tcref.DisplayNameWithStaticParametersAndUnderscoreTypars), m)) and TcLongIdentType kindOpt (cenv: cenv) newOk checkConstraints occ iwsam env tpenv synLongId = @@ -4550,16 +4557,6 @@ and TcTypeMeasurePower kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv let ms, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv ty m TType_measure (Measure.RationalPower (ms, TcSynRationalConst exponent)), tpenv -and TcTypeMeasureDivide kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv typ1 typ2 m = - match kindOpt with - | Some TyparKind.Type -> - errorR(Error(FSComp.SR.tcUnexpectedSymbolInTypeExpression("/"), m)) - NewErrorType (), tpenv - | _ -> - let ms1, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv typ1 m - let ms2, tpenv = TcMeasure cenv newOk checkConstraints occ env tpenv typ2 m - TType_measure (Measure.Prod(ms1, Measure.Inv ms2)), tpenv - and TcTypeMeasureApp kindOpt (cenv: cenv) newOk checkConstraints occ env tpenv arg1 args postfix m = match arg1 with | StripParenTypes (SynType.Var(_, m1) | SynType.MeasurePower(_, _, m1)) -> @@ -10287,10 +10284,8 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt SynValData(valMf, SynValInfo(args, SynArgInfo({Attributes=rotRetSynAttrs; Range=mHead} :: attrs, opt, retId)), valId) retAttribs, valAttribs, valSynData - let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute valAttribs - let hasNoCompilerInliningAttribute = HasFSharpAttribute g g.attrib_NoCompilerInliningAttribute valAttribs - - let inlineFlag = ComputeInlineFlag memberFlagsOpt isInline isMutable hasNoCompilerInliningAttribute mBinding + let isVolatile = HasFSharpAttribute g g.attrib_VolatileFieldAttribute valAttribs + let inlineFlag = ComputeInlineFlag memberFlagsOpt isInline isMutable g valAttribs mBinding let argAttribs = spatsL |> List.map (SynInfo.InferSynArgInfoFromSimplePats >> List.map (SynInfo.AttribsOfArgData >> TcAttrs AttributeTargets.Parameter false)) @@ -11423,10 +11418,9 @@ and AnalyzeAndMakeAndPublishRecursiveValue let bindingAttribs = TcAttributes cenv env attrTgt bindingSynAttribs // Allocate the type inference variable for the inferred type - let ty = NewInferenceType g - let hasNoCompilerInliningAttribute = HasFSharpAttribute g g.attrib_NoCompilerInliningAttribute bindingAttribs + let ty = NewInferenceType g - let inlineFlag = ComputeInlineFlag memberFlagsOpt isInline isMutable hasNoCompilerInliningAttribute mBinding + let inlineFlag = ComputeInlineFlag memberFlagsOpt isInline isMutable g bindingAttribs mBinding if isMutable then errorR(Error(FSComp.SR.tcOnlyRecordFieldsAndSimpleLetCanBeMutable(), mBinding)) @@ -12042,7 +12036,6 @@ let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind let attrs = TcAttributes cenv env attrTgt synAttrs let newOk = if canInferTypars then NewTyparsOK else NoNewTypars - let hasNoCompilerInliningAttribute = HasFSharpAttribute g g.attrib_NoCompilerInliningAttribute attrs let valinfos, tpenv = TcValSpec cenv env declKind newOk containerInfo memFlagsOpt None tpenv synValSig attrs let denv = env.DisplayEnv @@ -12051,7 +12044,7 @@ let TcAndPublishValSpec (cenv: cenv, env, containerInfo: ContainerInfo, declKind let (ValSpecResult (altActualParent, memberInfoOpt, id, enclosingDeclaredTypars, declaredTypars, ty, prelimValReprInfo, declKind)) = valSpecResult - let inlineFlag = ComputeInlineFlag (memberInfoOpt |> Option.map (fun (PrelimMemberInfo(memberInfo, _, _)) -> memberInfo.MemberFlags)) isInline mutableFlag hasNoCompilerInliningAttribute m + let inlineFlag = ComputeInlineFlag (memberInfoOpt |> Option.map (fun (PrelimMemberInfo(memberInfo, _, _)) -> memberInfo.MemberFlags)) isInline mutableFlag g attrs m let freeInType = freeInTypeLeftToRight g false ty diff --git a/src/Compiler/Checking/CheckFormatStrings.fs b/src/Compiler/Checking/CheckFormatStrings.fs index 8652e305761..8d287145dcb 100644 --- a/src/Compiler/Checking/CheckFormatStrings.fs +++ b/src/Compiler/Checking/CheckFormatStrings.fs @@ -48,6 +48,13 @@ let newInfo () = addZeros = false precision = false} +let escapeDotnetFormatString str = + str + // We need to double '{' and '}', because even if they were escaped in the + // original string, extra curly braces were stripped away by the F# lexer. + |> Seq.collect (fun x -> if x = '{' || x = '}' then [x;x] else [x]) + |> System.String.Concat + let parseFormatStringInternal (m: range) (fragRanges: range list) @@ -55,7 +62,7 @@ let parseFormatStringInternal isInterpolated isFormattableString (context: FormatStringCheckContext option) - fmt + (fmt: string) printerArgTy printerResidueTy = @@ -86,6 +93,8 @@ let parseFormatStringInternal // there are no accurate intra-string ranges available for exact error message locations within the string. // The 'm' range passed as an input is however accurate and covers the whole string. // + let escapeFormatStringEnabled = g.langVersion.SupportsFeature Features.LanguageFeature.EscapeDotnetFormattableStrings + let fmt, fragments = //printfn "--------------------" @@ -175,7 +184,7 @@ let parseFormatStringInternal | _ -> // Don't muck with the fmt when there is no source code context to go get the original // source code (i.e. when compiling or background checking) - fmt, [ (0, 1, m) ] + (if escapeFormatStringEnabled then escapeDotnetFormatString fmt else fmt), [ (0, 1, m) ] let len = fmt.Length diff --git a/src/Compiler/Driver/CompilerConfig.fs b/src/Compiler/Driver/CompilerConfig.fs index 91a2e9fde3d..e945c9564a4 100644 --- a/src/Compiler/Driver/CompilerConfig.fs +++ b/src/Compiler/Driver/CompilerConfig.fs @@ -300,7 +300,7 @@ type ImportedAssembly = IsProviderGenerated: bool mutable TypeProviders: Tainted list #endif - FSharpOptimizationData: Microsoft.FSharp.Control.Lazy> + FSharpOptimizationData: Microsoft.FSharp.Control.Lazy } type AvailableImportedAssembly = @@ -517,6 +517,7 @@ type TcConfigBuilder = /// show times between passes? mutable showTimes: bool + mutable writeTimesToFile: string option mutable showLoadedAssemblies: bool mutable continueAfterParseFailure: bool @@ -740,6 +741,7 @@ type TcConfigBuilder = productNameForBannerText = FSharpProductName showBanner = true showTimes = false + writeTimesToFile = None showLoadedAssemblies = false continueAfterParseFailure = false #if !NO_TYPEPROVIDERS @@ -1296,6 +1298,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member _.productNameForBannerText = data.productNameForBannerText member _.showBanner = data.showBanner member _.showTimes = data.showTimes + member _.writeTimesToFile = data.writeTimesToFile member _.showLoadedAssemblies = data.showLoadedAssemblies member _.continueAfterParseFailure = data.continueAfterParseFailure #if !NO_TYPEPROVIDERS diff --git a/src/Compiler/Driver/CompilerConfig.fsi b/src/Compiler/Driver/CompilerConfig.fsi index 70abf7beb63..95e26b637ef 100644 --- a/src/Compiler/Driver/CompilerConfig.fsi +++ b/src/Compiler/Driver/CompilerConfig.fsi @@ -426,6 +426,8 @@ type TcConfigBuilder = mutable showTimes: bool + mutable writeTimesToFile: string option + mutable showLoadedAssemblies: bool mutable continueAfterParseFailure: bool @@ -748,6 +750,8 @@ type TcConfig = member showTimes: bool + member writeTimesToFile: string option + member showLoadedAssemblies: bool member continueAfterParseFailure: bool diff --git a/src/Compiler/Driver/CompilerImports.fs b/src/Compiler/Driver/CompilerImports.fs index 22162611f0c..69cb69d4106 100644 --- a/src/Compiler/Driver/CompilerImports.fs +++ b/src/Compiler/Driver/CompilerImports.fs @@ -338,7 +338,7 @@ type ImportedAssembly = IsProviderGenerated: bool mutable TypeProviders: Tainted list #endif - FSharpOptimizationData: Microsoft.FSharp.Control.Lazy> + FSharpOptimizationData: Microsoft.FSharp.Control.Lazy } type AvailableImportedAssembly = diff --git a/src/Compiler/Driver/CompilerImports.fsi b/src/Compiler/Driver/CompilerImports.fsi index 30bb4333f77..f9fa17487ae 100644 --- a/src/Compiler/Driver/CompilerImports.fsi +++ b/src/Compiler/Driver/CompilerImports.fsi @@ -116,7 +116,7 @@ type ImportedAssembly = IsProviderGenerated: bool mutable TypeProviders: Tainted list #endif - FSharpOptimizationData: Lazy> } + FSharpOptimizationData: Lazy } /// Tables of assembly resolutions [] diff --git a/src/Compiler/Driver/CompilerOptions.fs b/src/Compiler/Driver/CompilerOptions.fs index 0881e8c9179..a4e0aab19e8 100644 --- a/src/Compiler/Driver/CompilerOptions.fs +++ b/src/Compiler/Driver/CompilerOptions.fs @@ -69,7 +69,7 @@ and CompilerOption = name: string * argumentDescriptionString: string * actionSpec: OptionSpec * - deprecationError: Option * + deprecationError: exn option * helpText: string option and CompilerOptionBlock = @@ -1741,6 +1741,15 @@ let internalFlags (tcConfigB: TcConfigBuilder) = None ) + // "Write timing profiles for compilation to a file" + CompilerOption( + "times", + tagFile, + OptionString(fun s -> tcConfigB.writeTimesToFile <- Some s), + Some(InternalCommandLineOption("times", rangeCmdArgs)), + None + ) + #if !NO_TYPEPROVIDERS // "Display information about extension type resolution") CompilerOption( @@ -2295,6 +2304,23 @@ let GetCoreFsiCompilerOptions (tcConfigB: TcConfigBuilder) = ) ] +let CheckAndReportSourceFileDuplicates (sourceFiles: ResizeArray) = + let visited = Dictionary.newWithSize (sourceFiles.Count * 2) + let count = sourceFiles.Count + + [ + for i = 0 to (count - 1) do + let source = sourceFiles[i] + + match visited.TryGetValue source with + | true, duplicatePosition -> + + warning (Error(FSComp.SR.buildDuplicateFile (source, i + 1, count, duplicatePosition + 1, count), range0)) + | false, _ -> + visited.Add(source, i) + yield source + ] + let ApplyCommandLineArgs (tcConfigB: TcConfigBuilder, sourceFiles: string list, argv) = try let sourceFilesAcc = ResizeArray sourceFiles @@ -2304,7 +2330,7 @@ let ApplyCommandLineArgs (tcConfigB: TcConfigBuilder, sourceFiles: string list, sourceFilesAcc.Add name ParseCompilerOptions(collect, GetCoreServiceCompilerOptions tcConfigB, argv) - ResizeArray.toList sourceFilesAcc + sourceFilesAcc |> CheckAndReportSourceFileDuplicates with e -> errorRecovery e range0 sourceFiles @@ -2336,81 +2362,47 @@ let PrintWholeAssemblyImplementation (tcConfig: TcConfig) outfile header expr = // ReportTime //---------------------------------------------------------------------------- -let mutable tPrev: (DateTime * DateTime * float * int[]) option = None -let mutable nPrev: (string * IDisposable) option = None - -let ReportTime (tcConfig: TcConfig) descr = - match nPrev with - | None -> () - | Some (prevDescr, prevActivity) -> - use _ = prevActivity // Finish the previous diagnostics activity by .Dispose() at the end of this block - - if tcConfig.pause then - dprintf "[done '%s', entering '%s'] press to continue... " prevDescr descr - Console.ReadLine() |> ignore - // Intentionally putting this right after the pause so a debugger can be attached. - match tcConfig.simulateException with - | Some ("fsc-oom") -> raise (OutOfMemoryException()) - | Some ("fsc-an") -> raise (ArgumentNullException("simulated")) - | Some ("fsc-invop") -> raise (InvalidOperationException()) - | Some ("fsc-av") -> raise (AccessViolationException()) - | Some ("fsc-aor") -> raise (ArgumentOutOfRangeException()) - | Some ("fsc-dv0") -> raise (DivideByZeroException()) - | Some ("fsc-nfn") -> raise (NotFiniteNumberException()) - | Some ("fsc-oe") -> raise (OverflowException()) - | Some ("fsc-atmm") -> raise (ArrayTypeMismatchException()) - | Some ("fsc-bif") -> raise (BadImageFormatException()) - | Some ("fsc-knf") -> raise (System.Collections.Generic.KeyNotFoundException()) - | Some ("fsc-ior") -> raise (IndexOutOfRangeException()) - | Some ("fsc-ic") -> raise (InvalidCastException()) - | Some ("fsc-ip") -> raise (InvalidProgramException()) - | Some ("fsc-ma") -> raise (MemberAccessException()) - | Some ("fsc-ni") -> raise (NotImplementedException()) - | Some ("fsc-nr") -> raise (NullReferenceException()) - | Some ("fsc-oc") -> raise (OperationCanceledException()) - | Some ("fsc-fail") -> failwith "simulated" - | _ -> () - - if (tcConfig.showTimes || verbose) then - // Note that timing calls are relatively expensive on the startup path so we don't - // make this call unless showTimes has been turned on. - let p = Process.GetCurrentProcess() - let utNow = p.UserProcessorTime.TotalSeconds - let tNow = DateTime.Now - let maxGen = GC.MaxGeneration - let gcNow = [| for i in 0..maxGen -> GC.CollectionCount i |] - let wsNow = p.WorkingSet64 / 1000000L - - let tStart = - match tPrev, nPrev with - | Some (tStart, tPrev, utPrev, gcPrev), Some (prevDescr, _) -> - let spanGC = [| for i in 0..maxGen -> GC.CollectionCount i - gcPrev[i] |] - let t = tNow - tStart - let tDelta = tNow - tPrev - let utDelta = utNow - utPrev - - printf - "Real: %4.1f Realdelta: %4.1f Cpu: %4.1f Cpudelta: %4.1f Mem: %3d" - t.TotalSeconds - tDelta.TotalSeconds - utNow - utDelta - wsNow - - printfn - " G0: %3d G1: %2d G2: %2d [%s]" - spanGC[Operators.min 0 maxGen] - spanGC[Operators.min 1 maxGen] - spanGC[Operators.min 2 maxGen] - prevDescr - - tStart - - | _ -> DateTime.Now - - tPrev <- Some(tStart, tNow, utNow, gcNow) - - nPrev <- Some(descr, Activity.startNoTags descr) +let private SimulateException simulateConfig = + match simulateConfig with + | Some ("fsc-oom") -> raise (OutOfMemoryException()) + | Some ("fsc-an") -> raise (ArgumentNullException("simulated")) + | Some ("fsc-invop") -> raise (InvalidOperationException()) + | Some ("fsc-av") -> raise (AccessViolationException()) + | Some ("fsc-aor") -> raise (ArgumentOutOfRangeException()) + | Some ("fsc-dv0") -> raise (DivideByZeroException()) + | Some ("fsc-nfn") -> raise (NotFiniteNumberException()) + | Some ("fsc-oe") -> raise (OverflowException()) + | Some ("fsc-atmm") -> raise (ArrayTypeMismatchException()) + | Some ("fsc-bif") -> raise (BadImageFormatException()) + | Some ("fsc-knf") -> raise (System.Collections.Generic.KeyNotFoundException()) + | Some ("fsc-ior") -> raise (IndexOutOfRangeException()) + | Some ("fsc-ic") -> raise (InvalidCastException()) + | Some ("fsc-ip") -> raise (InvalidProgramException()) + | Some ("fsc-ma") -> raise (MemberAccessException()) + | Some ("fsc-ni") -> raise (NotImplementedException()) + | Some ("fsc-nr") -> raise (NullReferenceException()) + | Some ("fsc-oc") -> raise (OperationCanceledException()) + | Some ("fsc-fail") -> failwith "simulated" + | _ -> () + +let ReportTime = + let mutable nPrev = None + + fun (tcConfig: TcConfig) descr -> + nPrev + |> Option.iter (fun (prevDescr, prevAct) -> + use _ = prevAct + + if tcConfig.pause then + dprintf "[done '%s', entering '%s'] press to continue... " prevDescr descr + Console.ReadLine() |> ignore + // Intentionally putting this right after the pause so a debugger can be attached. + SimulateException tcConfig.simulateException) + + if descr <> "Exiting" then + nPrev <- Some(descr, Activity.Profiling.startAndMeasureEnvironmentStats descr) + else + nPrev <- None let ignoreFailureOnMono1_1_16 f = try diff --git a/src/Compiler/Driver/CompilerOptions.fsi b/src/Compiler/Driver/CompilerOptions.fsi index 0915d999032..bb2034b93d5 100644 --- a/src/Compiler/Driver/CompilerOptions.fsi +++ b/src/Compiler/Driver/CompilerOptions.fsi @@ -36,7 +36,7 @@ and CompilerOption = name: string * argumentDescriptionString: string * actionSpec: OptionSpec * - deprecationError: Option * + deprecationError: exn option * helpText: string option and CompilerOptionBlock = @@ -66,6 +66,8 @@ val GetCoreFsiCompilerOptions: TcConfigBuilder -> CompilerOptionBlock list val GetCoreServiceCompilerOptions: TcConfigBuilder -> CompilerOptionBlock list +val CheckAndReportSourceFileDuplicates: ResizeArray -> string list + /// Apply args to TcConfigBuilder and return new list of source files val ApplyCommandLineArgs: tcConfigB: TcConfigBuilder * sourceFiles: string list * argv: string list -> string list @@ -89,7 +91,7 @@ val DoWithColor: ConsoleColor -> (unit -> 'T) -> 'T val DoWithDiagnosticColor: FSharpDiagnosticSeverity -> (unit -> 'T) -> 'T -val ReportTime: TcConfig -> string -> unit +val ReportTime: (TcConfig -> string -> unit) val GetAbbrevFlagSet: TcConfigBuilder -> bool -> Set diff --git a/src/Compiler/Driver/CreateILModule.fs b/src/Compiler/Driver/CreateILModule.fs index 7aad1268a74..60c588263e4 100644 --- a/src/Compiler/Driver/CreateILModule.fs +++ b/src/Compiler/Driver/CreateILModule.fs @@ -65,7 +65,11 @@ module AttributeHelpers = //---------------------------------------------------------------------------- /// Represents the configuration settings used to perform strong-name signing -type StrongNameSigningInfo = StrongNameSigningInfo of delaysign: bool * publicsign: bool * signer: string option * container: string option +type StrongNameSigningInfo = + | StrongNameSigningInfo of delaysign: bool * publicsign: bool * signer: byte array option * container: string option + +let GetStrongNameSigningInfo (delaysign, publicsign, signer, container) = + StrongNameSigningInfo(delaysign, publicsign, signer, container) /// Validate the attributes and configuration settings used to perform strong-name signing let ValidateKeySigningAttributes (tcConfig: TcConfig, tcGlobals, topAttrs) = @@ -91,14 +95,24 @@ let ValidateKeySigningAttributes (tcConfig: TcConfig, tcGlobals, topAttrs) = // if signer is set via an attribute, validate that it wasn't set via an option let signer = - match signerAttrib with - | Some signer -> - if tcConfig.signer.IsSome && tcConfig.signer <> Some signer then - warning (Error(FSComp.SR.fscKeyFileWarning (), rangeCmdArgs)) - tcConfig.signer - else - Some signer - | None -> tcConfig.signer + let signerFile = + match signerAttrib with + | Some signer -> + if tcConfig.signer.IsSome && tcConfig.signer <> Some signer then + warning (Error(FSComp.SR.fscKeyFileWarning (), rangeCmdArgs)) + tcConfig.signer + else + Some signer + | None -> tcConfig.signer + + match signerFile with + | Some signerPath -> + try + Some(FileSystem.OpenFileForReadShim(signerPath).ReadAllBytes()) + with _ -> + // Note :: don't use errorR here since we really want to fail and not produce a binary + error (Error(FSComp.SR.fscKeyFileCouldNotBeOpened signerPath, rangeCmdArgs)) + | None -> None // if container is set via an attribute, validate that it wasn't set via an option, and that they keyfile wasn't set // if keyfile was set, use that instead (silently) @@ -127,15 +141,11 @@ let GetStrongNameSigner signingInfo = | None -> match signer with | None -> None - | Some s -> - try - if publicsign || delaysign then - Some(ILStrongNameSigner.OpenPublicKeyOptions s publicsign) - else - Some(ILStrongNameSigner.OpenKeyPairFile s) - with _ -> - // Note :: don't use errorR here since we really want to fail and not produce a binary - error (Error(FSComp.SR.fscKeyFileCouldNotBeOpened s, rangeCmdArgs)) + | Some bytes -> + if publicsign || delaysign then + Some(ILStrongNameSigner.OpenPublicKeyOptions bytes publicsign) + else + Some(ILStrongNameSigner.OpenKeyPairFile bytes) //---------------------------------------------------------------------------- // Building the contents of the finalized IL module diff --git a/src/Compiler/Driver/CreateILModule.fsi b/src/Compiler/Driver/CreateILModule.fsi index eba0ab0251e..8290b90086d 100644 --- a/src/Compiler/Driver/CreateILModule.fsi +++ b/src/Compiler/Driver/CreateILModule.fsi @@ -15,6 +15,10 @@ open FSharp.Compiler.TypedTree /// Represents the configuration settings used to perform strong-name signing type StrongNameSigningInfo +/// Get the SigningInfo for specific values(delaysign, tcConfig.publicsign, signer, container) +val GetStrongNameSigningInfo: + delaysign: bool * publicsign: bool * signer: byte array option * container: string option -> StrongNameSigningInfo + /// Validate the attributes and configuration settings used to perform strong-name signing val ValidateKeySigningAttributes: tcConfig: TcConfig * tcGlobals: TcGlobals * TopAttribs -> StrongNameSigningInfo diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index ac36b76477c..b384a93bf9e 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -1205,7 +1205,7 @@ let CheckOneInputAux cancellable { try use _ = - Activity.start "ParseAndCheckInputs.CheckOneInput" [| "fileName", inp.FileName |] + Activity.start "ParseAndCheckInputs.CheckOneInput" [| Activity.Tags.fileName, inp.FileName |] CheckSimulateException tcConfig diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index e8ec56fa5a5..d59676d082e 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -536,6 +536,7 @@ let main1 // Rather than start processing, just collect names, then process them. try let files = ProcessCommandLineFlags(tcConfigB, lcidFromCodePage, argv) + let files = CheckAndReportSourceFileDuplicates(ResizeArray.ofList files) AdjustForScriptCompile(tcConfigB, files, lexResourceManager, dependencyProvider) with e -> errorRecovery e rangeStartup @@ -576,6 +577,20 @@ let main1 delayForFlagsLogger.CommitDelayedDiagnostics(diagnosticsLoggerProvider, tcConfigB, exiter) exiter.Exit 1 + if tcConfig.showTimes then + Activity.Profiling.addConsoleListener () |> disposables.Register + + tcConfig.writeTimesToFile + |> Option.iter (fun f -> + Activity.CsvExport.addCsvFileListener f |> disposables.Register + + Activity.start + "FSC compilation" + [ + Activity.Tags.project, tcConfig.outputFile |> Option.defaultValue String.Empty + ] + |> disposables.Register) + let diagnosticsLogger = diagnosticsLoggerProvider.CreateLogger(tcConfigB, exiter) // Install the global error logger and never remove it. This logger does have all command-line flags considered. @@ -588,7 +603,7 @@ let main1 AbortOnError(diagnosticsLogger, exiter) // Resolve assemblies - ReportTime tcConfig "Import mscorlib and FSharp.Core.dll" + ReportTime tcConfig "Import mscorlib+FSharp.Core" let foundationalTcConfigP = TcConfigProvider.Constant tcConfig let sysRes, otherRes, knownUnresolved = @@ -762,7 +777,7 @@ let main2 if tcConfig.printSignature || tcConfig.printAllSignatureFiles then InterfaceFileWriter.WriteInterfaceFile(tcGlobals, tcConfig, InfoReader(tcGlobals, tcImports.GetImportMap()), typedImplFiles) - ReportTime tcConfig "Write XML document signatures" + ReportTime tcConfig "Write XML doc signatures" if tcConfig.xmlDocOutputFile.IsSome then XmlDocWriter.ComputeXmlDocSigs(tcGlobals, generatedCcu) @@ -1087,7 +1102,6 @@ let main6 pdbfile = None emitTailcalls = tcConfig.emitTailcalls deterministic = tcConfig.deterministic - showTimes = tcConfig.showTimes portablePDB = false embeddedPDB = false embedAllSource = tcConfig.embedAllSource @@ -1118,7 +1132,6 @@ let main6 pdbfile = pdbfile emitTailcalls = tcConfig.emitTailcalls deterministic = tcConfig.deterministic - showTimes = tcConfig.showTimes portablePDB = tcConfig.portablePDB embeddedPDB = tcConfig.embeddedPDB embedAllSource = tcConfig.embedAllSource diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index e495541bab5..03ab28bfc97 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1558,7 +1558,9 @@ featureLowercaseDUWhenRequireQualifiedAccess,"Allow lowercase DU when RequireQua featureMatchNotAllowedForUnionCaseWithNoData,"Pattern match discard is not allowed for union case that takes no data." featureCSharpExtensionAttributeNotRequired,"Allow implicit Extension attribute on declaring types, modules" featureErrorForNonVirtualMembersOverrides,"Raises errors for non-virtual members overrides" +featureWarningWhenInliningMethodImplNoInlineMarkedFunction,"Raises warnings when 'let inline ... =' is used together with [] attribute. Function is not getting inlined." featureArithmeticInLiterals,"Allow arithmetic and logical operations in literals" +featureErrorReportingOnStaticClasses,"Error reporting on static classes" 3353,fsiInvalidDirective,"Invalid directive '#%s %s'" 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." @@ -1662,3 +1664,8 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form" 3548,matchNotAllowedForUnionCaseWithNoData,"Pattern discard is not allowed for union case that takes no data." 3549,tcSynTypeOrInvalidInDeclaration,"SynType.Or is not permitted in this declaration" 3550,chkDuplicatedMethodParameter,"Duplicate parameter. The parameter '%s' has been used more that once in this method." +featureEscapeBracesInFormattableString,"Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString" +3551,buildDuplicateFile,"The source file '%s' (at position %d/%d) already appeared in the compilation list (at position %d/%d). Please verify that it is included only once in the project file." +3552,chkConstructorWithArgumentsOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed." +3553,chkAdditionalConstructorOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed." +3554,chkInstanceMemberOnStaticClasses,"If a type uses both [] and [] attributes, it means it is static. Instance members are not allowed." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 6b543bc9b64..e7654bea422 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -57,8 +57,11 @@ type LanguageFeature = | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired | ErrorForNonVirtualMembersOverrides + | WarningWhenInliningMethodImplNoInlineMarkedFunction + | EscapeDotnetFormattableStrings | ArithmeticInLiterals - + | ErrorReportingOnStaticClasses + /// LanguageVersion management type LanguageVersion(versionText) = @@ -131,7 +134,10 @@ type LanguageVersion(versionText) = LanguageFeature.MatchNotAllowedForUnionCaseWithNoData, previewVersion LanguageFeature.CSharpExtensionAttributeNotRequired, previewVersion LanguageFeature.ErrorForNonVirtualMembersOverrides, previewVersion + LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction, previewVersion + LanguageFeature.EscapeDotnetFormattableStrings, previewVersion LanguageFeature.ArithmeticInLiterals, previewVersion + LanguageFeature.ErrorReportingOnStaticClasses, previewVersion ] @@ -240,9 +246,12 @@ type LanguageVersion(versionText) = | LanguageFeature.InterfacesWithAbstractStaticMembers -> FSComp.SR.featureInterfacesWithAbstractStaticMembers () | LanguageFeature.SelfTypeConstraints -> FSComp.SR.featureSelfTypeConstraints () | LanguageFeature.MatchNotAllowedForUnionCaseWithNoData -> FSComp.SR.featureMatchNotAllowedForUnionCaseWithNoData () - | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () - | LanguageFeature.ErrorForNonVirtualMembersOverrides -> FSComp.SR.featureErrorForNonVirtualMembersOverrides () + | LanguageFeature.CSharpExtensionAttributeNotRequired -> FSComp.SR.featureCSharpExtensionAttributeNotRequired () + | LanguageFeature.ErrorForNonVirtualMembersOverrides -> FSComp.SR.featureErrorForNonVirtualMembersOverrides () + | LanguageFeature.WarningWhenInliningMethodImplNoInlineMarkedFunction -> FSComp.SR.featureWarningWhenInliningMethodImplNoInlineMarkedFunction () + | LanguageFeature.EscapeDotnetFormattableStrings -> FSComp.SR.featureEscapeBracesInFormattableString () | LanguageFeature.ArithmeticInLiterals -> FSComp.SR.featureArithmeticInLiterals () + | LanguageFeature.ErrorReportingOnStaticClasses -> FSComp.SR.featureErrorReportingOnStaticClasses () /// 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 616093ecb30..d070a8b4e36 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -47,7 +47,10 @@ type LanguageFeature = | MatchNotAllowedForUnionCaseWithNoData | CSharpExtensionAttributeNotRequired | ErrorForNonVirtualMembersOverrides + | WarningWhenInliningMethodImplNoInlineMarkedFunction + | EscapeDotnetFormattableStrings | ArithmeticInLiterals + | ErrorReportingOnStaticClasses /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Interactive/FSIstrings.txt b/src/Compiler/Interactive/FSIstrings.txt index 2d41ffcc406..c357f835be5 100644 --- a/src/Compiler/Interactive/FSIstrings.txt +++ b/src/Compiler/Interactive/FSIstrings.txt @@ -56,6 +56,4 @@ shadowCopyReferences,"Prevents references from being locked by the F# Interactiv fsiOperationCouldNotBeCompleted,"Operation could not be completed due to earlier error" fsiOperationFailed,"Operation failed. The error text has been printed in the error stream. To return the corresponding FSharpDiagnostic use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing" fsiMultiAssemblyEmitOption,"Emit multiple assemblies (on by default)" -fsiMultiAssemblyEmitOptionOffByDefault,"Emit multiple assemblies (off by default for .NET Framework)" -2303,fsiInternalAccess,"Accessing the internal type, method or field '%s' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option." 2304,fsiEntryPointWontBeInvoked,"Functions with [] are not invoked in FSI. '%s' was not invoked. Execute '%s ' in order to invoke '%s' with the appropriate string array of command line arguments." diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 0485d4e06e5..69917433357 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -41,6 +41,7 @@ open FSharp.Compiler.CompilerConfig open FSharp.Compiler.CompilerDiagnostics open FSharp.Compiler.CompilerImports open FSharp.Compiler.CompilerGlobalState +open FSharp.Compiler.CreateILModule open FSharp.Compiler.DependencyManager open FSharp.Compiler.Diagnostics open FSharp.Compiler.EditorServices @@ -938,31 +939,22 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, ] /// These options follow the FsiCoreCompilerOptions in the help blocks - let fsiUsageSuffix tcConfigB = - [PublicOptions(FSComp.SR.optsHelpBannerInputFiles(), - [CompilerOption("--","", OptionRest recordExplicitArg, None, - Some (FSIstrings.SR.fsiRemaining())); - ]); - PublicOptions(FSComp.SR.optsHelpBannerMisc(), - [ CompilerOption("help", tagNone, - OptionConsoleOnly (displayHelpFsi tcConfigB), None, Some (FSIstrings.SR.fsiHelp())) - ]); - PrivateOptions( - [ CompilerOption("?", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); + let fsiUsageSuffix tcConfigB = [ + PublicOptions(FSComp.SR.optsHelpBannerInputFiles(), [CompilerOption("--","", OptionRest recordExplicitArg, None, Some (FSIstrings.SR.fsiRemaining())); ]); + PublicOptions(FSComp.SR.optsHelpBannerMisc(), [ CompilerOption("help", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, Some (FSIstrings.SR.fsiHelp())) ]); + PrivateOptions([ + CompilerOption("?", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); CompilerOption("help", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); CompilerOption("full-help", tagNone, OptionConsoleOnly (displayHelpFsi tcConfigB), None, None); // "Short form of --help"); ]); - PublicOptions(FSComp.SR.optsHelpBannerAdvanced(), - [CompilerOption("exec", "", OptionUnit (fun () -> interact <- false), None, Some (FSIstrings.SR.fsiExec())) - CompilerOption("gui", tagNone, OptionSwitch(fun flag -> gui <- (flag = OptionSwitch.On)),None,Some (FSIstrings.SR.fsiGui())) - CompilerOption("quiet", "", OptionUnit (fun () -> tcConfigB.noFeedback <- true), None,Some (FSIstrings.SR.fsiQuiet())); - CompilerOption("readline", tagNone, OptionSwitch(fun flag -> enableConsoleKeyProcessing <- (flag = OptionSwitch.On)), None, Some(FSIstrings.SR.fsiReadline())) - CompilerOption("quotations-debug", tagNone, OptionSwitch(fun switch -> tcConfigB.emitDebugInfoInQuotations <- switch = OptionSwitch.On),None, Some(FSIstrings.SR.fsiEmitDebugInfoInQuotations())) - CompilerOption("shadowcopyreferences", tagNone, OptionSwitch(fun flag -> tcConfigB.shadowCopyReferences <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.shadowCopyReferences())) - if FSharpEnvironment.isRunningOnCoreClr then - CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOption())) - else - CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOptionOffByDefault())) + PublicOptions(FSComp.SR.optsHelpBannerAdvanced(), [ + CompilerOption("exec", "", OptionUnit (fun () -> interact <- false), None, Some (FSIstrings.SR.fsiExec())) + CompilerOption("gui", tagNone, OptionSwitch(fun flag -> gui <- (flag = OptionSwitch.On)),None,Some (FSIstrings.SR.fsiGui())) + CompilerOption("quiet", "", OptionUnit (fun () -> tcConfigB.noFeedback <- true), None,Some (FSIstrings.SR.fsiQuiet())); + CompilerOption("readline", tagNone, OptionSwitch(fun flag -> enableConsoleKeyProcessing <- (flag = OptionSwitch.On)), None, Some(FSIstrings.SR.fsiReadline())) + CompilerOption("quotations-debug", tagNone, OptionSwitch(fun switch -> tcConfigB.emitDebugInfoInQuotations <- switch = OptionSwitch.On),None, Some(FSIstrings.SR.fsiEmitDebugInfoInQuotations())) + CompilerOption("shadowcopyreferences", tagNone, OptionSwitch(fun flag -> tcConfigB.shadowCopyReferences <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.shadowCopyReferences())) + CompilerOption("multiemit", tagNone, OptionSwitch(fun flag -> tcConfigB.fsiMultiAssemblyEmit <- flag = OptionSwitch.On), None, Some(FSIstrings.SR.fsiMultiAssemblyEmitOption())) ]); ] @@ -1360,14 +1352,12 @@ type internal FsiDynamicCompiler( let dynamicCcuName = "FSI-ASSEMBLY" - let maxInternalsVisibleTo = 30 // In multi-assembly emit, how many future interactions can access internals with a warning - let valueBoundEvent = Control.Event<_>() let mutable fragmentId = 0 - static let mutable dynamicAssemblyId = 0 - + static let maxVersion = int Int16.MaxValue + let mutable prevIt : ValRef option = None let dynamicAssemblies = ResizeArray() @@ -1390,8 +1380,6 @@ type internal FsiDynamicCompiler( let rangeStdin0 = rangeN stdinMockFileName 0 - //let _writer = moduleBuilder.GetSymWriter() - let infoReader = InfoReader(tcGlobals,tcImports.GetImportMap()) let reportedAssemblies = Dictionary() @@ -1406,43 +1394,28 @@ type internal FsiDynamicCompiler( Some { man with CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs codegenResults.ilAssemAttrs) }) } /// Generate one assembly using multi-assembly emit - let EmitInMemoryAssembly (tcConfig: TcConfig, emEnv: ILMultiInMemoryAssemblyEmitEnv, ilxMainModule: ILModuleDef, m) = - - // The name of the assembly is "FSI-ASSEMBLY1" etc - dynamicAssemblyId <- dynamicAssemblyId + 1 - - let multiAssemblyName = ilxMainModule.ManifestOfAssembly.Name + string dynamicAssemblyId + let EmitInMemoryAssembly (tcConfig: TcConfig, emEnv: ILMultiInMemoryAssemblyEmitEnv, ilxMainModule: ILModuleDef) = + let multiAssemblyName = ilxMainModule.ManifestOfAssembly.Name // Adjust the assembly name of this fragment, and add InternalsVisibleTo attributes to - // allow internals access by multiple future assemblies + // allow internals access by all future assemblies with the same name (and only differing in version) let manifest = let manifest = ilxMainModule.Manifest.Value - let attrs = - [ for i in 1..maxInternalsVisibleTo do - let fwdAssemblyName = ilxMainModule.ManifestOfAssembly.Name + string (dynamicAssemblyId + i) - tcGlobals.MakeInternalsVisibleToAttribute(fwdAssemblyName) - yield! manifest.CustomAttrs.AsList() ] + let attrs = [ + tcGlobals.MakeInternalsVisibleToAttribute(ilxMainModule.ManifestOfAssembly.Name) + yield! manifest.CustomAttrs.AsList() + ] { manifest with - Name = multiAssemblyName + Name = multiAssemblyName + // Because the coreclr loader will not load a higher assembly make versions go downwards + Version = Some (parseILVersion $"0.0.0.{maxVersion - dynamicAssemblyId}") CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs attrs) } - let ilxMainModule = { ilxMainModule with Manifest = Some manifest } + // The name of the assembly is "FSI-ASSEMBLY" for all submissions. This number is used for the Version + dynamicAssemblyId <- (dynamicAssemblyId + 1) % maxVersion - // Check access of internals across fragments and give warning - let refs = computeILRefs ilGlobals ilxMainModule - - for tref in refs.TypeReferences do - if emEnv.IsLocalInternalType(tref) then - warning(Error((FSIstrings.SR.fsiInternalAccess(tref.FullName)), m)) - - for mref in refs.MethodReferences do - if emEnv.IsLocalInternalMethod(mref) then - warning(Error((FSIstrings.SR.fsiInternalAccess(mref.Name)), m)) - - for fref in refs.FieldReferences do - if emEnv.IsLocalInternalField(fref) then - warning(Error((FSIstrings.SR.fsiInternalAccess(fref.Name)), m)) + let ilxMainModule = { ilxMainModule with Manifest = Some manifest } // Rewrite references to local types to their respective dynamic assemblies let ilxMainModule = @@ -1457,8 +1430,7 @@ type internal FsiDynamicCompiler( // but needs to be set for some logic of ilwrite to function. pdbfile = (if tcConfig.debuginfo then Some (multiAssemblyName + ".pdb") else None) emitTailcalls = tcConfig.emitTailcalls - deterministic = tcConfig.deterministic - showTimes = tcConfig.showTimes + deterministic = tcConfig.deterministic // we always use portable for F# Interactive debug emit portablePDB = true // we don't use embedded for F# Interactive debug emit @@ -1483,7 +1455,6 @@ type internal FsiDynamicCompiler( match pdbBytes with | None -> Assembly.Load(assemblyBytes) | Some pdbBytes -> Assembly.Load(assemblyBytes, pdbBytes) - dynamicAssemblies.Add(asm) let loadedTypes = [ for t in asm.GetTypes() -> t] @@ -1501,18 +1472,18 @@ type internal FsiDynamicCompiler( yield! loop (enc@[tdef]) ntdef ] [ for tdef in ilxMainModule.TypeDefs do yield! loop [] tdef ] - // Make the 'exec' functions for the entry point initializations - let execs = + let execs = [ for edef in entries do if edef.ArgCount = 0 then - yield - (fun () -> + yield (fun () -> let typ = asm.GetType(edef.DeclaringTypeRef.BasicQualifiedName) try ignore (typ.InvokeMember (edef.Name, BindingFlags.InvokeMethod ||| BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.Static, null, null, [| |], Globalization.CultureInfo.InvariantCulture)) None - with :? TargetInvocationException as e -> - Some e.InnerException) ] + with + | :? TargetInvocationException as e -> + Some e.InnerException) + ] emEnv.AddModuleDef asm ilScopeRef ilxMainModule @@ -1563,7 +1534,7 @@ type internal FsiDynamicCompiler( | MultipleInMemoryAssemblies emEnv -> - let execs = EmitInMemoryAssembly (tcConfig, emEnv, ilxMainModule, m) + let execs = EmitInMemoryAssembly (tcConfig, emEnv, ilxMainModule) MultipleInMemoryAssemblies emEnv, execs @@ -1732,11 +1703,10 @@ type internal FsiDynamicCompiler( let nextFragmentId() = fragmentId <- fragmentId + 1 - fragmentId + $"%04d{fragmentId}" - let mkFragmentPath m i = - // NOTE: this text shows in exn traces and type names. Make it clear and fixed width - [mkSynId m (FsiDynamicModulePrefix + sprintf "%04d" i)] + let mkFragmentPath m fragmentId = + [mkSynId m (FsiDynamicModulePrefix + fragmentId())] let processContents istate declaredImpls = let tcState = istate.tcState @@ -1851,12 +1821,17 @@ type internal FsiDynamicCompiler( member _.DynamicAssemblies = dynamicAssemblies.ToArray() - member _.FindDynamicAssembly(simpleAssemName) = - dynamicAssemblies |> ResizeArray.tryFind (fun asm -> asm.GetName().Name = simpleAssemName) + member _.FindDynamicAssembly (name, useFullName: bool) = + let getName (assemblyName: AssemblyName) = + if useFullName then + assemblyName.FullName + else + assemblyName.Name + + dynamicAssemblies |> ResizeArray.tryFind (fun asm -> getName (asm.GetName()) = name) member _.EvalParsedSourceFiles (ctok, diagnosticsLogger, istate, inputs, m) = - let i = nextFragmentId() - let prefix = mkFragmentPath m i + let prefix = mkFragmentPath m nextFragmentId // Ensure the path includes the qualifying name let inputs = inputs |> List.map (PrependPathToInput prefix) let isIncrementalFragment = false @@ -1866,9 +1841,8 @@ type internal FsiDynamicCompiler( /// Evaluate the given definitions and produce a new interactive state. member _.EvalParsedDefinitions (ctok, diagnosticsLogger: DiagnosticsLogger, istate, showTypes, isInteractiveItExpr, defs: SynModuleDecl list) = let fileName = stdinMockFileName - let i = nextFragmentId() let m = match defs with [] -> rangeStdin0 | _ -> List.reduce unionRanges [for d in defs -> d.Range] - let prefix = mkFragmentPath m i + let prefix = mkFragmentPath m nextFragmentId let prefixPath = pathOfLid prefix let impl = SynModuleOrNamespace(prefix,false, SynModuleOrNamespaceKind.NamedModule,defs,PreXmlDoc.Empty,[],None,m, { LeadingKeyword = SynModuleOrNamespaceLeadingKeyword.None }) let isLastCompiland = true @@ -2222,9 +2196,8 @@ type internal FsiDynamicCompiler( let ty = List.head tys let amap = istate.tcImports.GetImportMap() - let i = nextFragmentId() let m = rangeStdin0 - let prefix = mkFragmentPath m i + let prefix = mkFragmentPath m nextFragmentId let prefixPath = pathOfLid prefix let qualifiedName = ComputeQualifiedNameOfFileFromUniquePath (m,prefixPath) @@ -2469,9 +2442,15 @@ type internal MagicAssemblyResolution () = if simpleAssemName.EndsWith(".XmlSerializers", StringComparison.OrdinalIgnoreCase) || simpleAssemName = "UIAutomationWinforms" then null else - match fsiDynamicCompiler.FindDynamicAssembly(simpleAssemName) with + // Check dynamic assemblies by exact version + match fsiDynamicCompiler.FindDynamicAssembly(fullAssemName, true) with + | Some asm -> asm + | None -> + // Check dynamic assemblies by simple name + match fsiDynamicCompiler.FindDynamicAssembly(simpleAssemName, false) with | Some asm -> asm | None -> + // Otherwise continue let assemblyReferenceTextDll = (simpleAssemName + ".dll") @@ -3406,10 +3385,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i do if isRunningOnCoreClr then SetTargetProfile tcConfigB "netcore" // always assume System.Runtime codegen #endif - // Preset: --multiemit- on .NET Framework and Mono - do if not isRunningOnCoreClr then - tcConfigB.fsiMultiAssemblyEmit <- false - // Preset: --optimize+ -g --tailcalls+ (see 4505) do SetOptimizeSwitch tcConfigB OptionSwitch.On do SetDebugSwitch tcConfigB (Some "pdbonly") OptionSwitch.On diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf index 667a5ed5a7b..97dcca71c4c 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.cs.xlf @@ -7,11 +7,6 @@ Funkce s [<EntryPoint>] nejsou vyvolány v FSI. {0} nebylo vyvoláno. Pokud chcete vyvolat {2} s příslušným polem řetězců argumentů příkazového řádku, spusťte příkaz{1} <args>. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - Přístup k internímu typu, metodě nebo poli {0} z předchozího vyhodnocení ve F# Interactive je zastaralý a může způsobit následné chyby přístupu. Pokud chcete povolit starší generaci jednoho dynamického sestavení, které má přístup k interním sestavením, použijte možnost --multiemit-. - - Include package source uri when searching for packages Při vyhledávání balíčků zahrnout identifikátor zdroje balíčku @@ -22,11 +17,6 @@ Vymazat obrazovku - - Emit multiple assemblies (off by default for .NET Framework) - Vygenerovat více sestavení (pro .NET Framework je to ve výchozím nastavení vypnuto) - - Operation could not be completed due to earlier error Operaci nešlo dokončit z důvodu dřívější chyby. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf index f6553e896d1..a3d73b0e675 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.de.xlf @@ -7,11 +7,6 @@ Funktionen mit [<EntryPoint>] werden in FSI nicht aufgerufen. '{0}' wurde nicht aufgerufen. Führen Sie '{1} <args>' aus, um '{2}' mit dem entsprechenden String-Array von Befehlszeilenargumenten aufzurufen. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - Der Zugriff auf den internen Typ, die Methode oder das Feld “{0}” aus einer vorherigen Auswertung in F# Interactive ist veraltet und kann zu nachfolgenden Zugriffsfehlern führen. Verwenden Sie die Option “--multiemit-”, um die Legacygenerierung einer einzelnen dynamischen Assembly zu aktivieren, die auf Interne zugreifen kann. - - Include package source uri when searching for packages URI der Paketquelle bei Suche nach Paketen einschließen @@ -22,11 +17,6 @@ Bildschirm löschen - - Emit multiple assemblies (off by default for .NET Framework) - Ausgeben mehrerer Assemblys (standardmäßig deaktiviert für .NET Framework) - - Operation could not be completed due to earlier error Der Vorgang konnte aufgrund eines vorherigen Fehlers nicht abgeschlossen werden. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf index 913c5217e13..190ff245baa 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.es.xlf @@ -7,11 +7,6 @@ Las funciones con [<EntryPoint>] no se invocan en FSI. “{0}” no se invocó. Ejecute “{1} <args>” para invocar “{2}” con la matriz adecuada de cadenas de argumentos de línea de comandos. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - El acceso al tipo, método o campo interno “{0}” de una evaluación anterior en F# interactivo está en desuso y puede provocar errores de acceso posteriores. Para habilitar la generación heredada de un único ensamblado dinámico que pueda acceder a elementos internos, use la opción “--multiemit-”. - - Include package source uri when searching for packages Incluir el URI de origen del paquete al buscar paquetes @@ -22,11 +17,6 @@ Borrar pantalla - - Emit multiple assemblies (off by default for .NET Framework) - Emitir varios ensamblados (desactivado de forma predeterminada para .NET Framework) - - Operation could not be completed due to earlier error La operación no se pudo completar debido a un error anterior diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf index e83c98d04a5..38d7a20d8e9 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.fr.xlf @@ -7,11 +7,6 @@ Les fonctions avec [<EntryPoint>] ne sont pas appelées dans FSI. '{0}' n’a pas été appelée. Exécutez '{1} <args>' pour appeler '{2}' avec le tableau de chaînes approprié d’arguments de ligne de commande. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - L’accès au type interne, à la méthode ou au champ «{0}» d’une évaluation précédente dans F# Interactive est déconseillé et peut entraîner des erreurs d’accès ultérieures. Pour activer la génération héritée d’un assemblée dynamique unique qui peut accéder aux éléments internes, utilisez l’option « --multiemit- ». - - Include package source uri when searching for packages Inclure l'URI de source de package au moment de la recherche des packages @@ -22,11 +17,6 @@ Effacer l'écran - - Emit multiple assemblies (off by default for .NET Framework) - Émettre plusieurs assemblées (désactivé par défaut pour .NET Framework) - - Operation could not be completed due to earlier error Impossible d'exécuter l'opération en raison d'une erreur antérieure diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf index f59a4e13f44..9c916837e52 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.it.xlf @@ -7,11 +7,6 @@ Le funzioni con [<EntryPoint>] non vengono richiamate in FSI. '{0}' non è stato richiamato. Eseguire '{1} <args>' per richiamare '{2}' con la matrice di stringhe appropriata degli argomenti della riga di comando. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - L'accesso al tipo, al metodo o al campo interno '{0}' da una valutazione precedente in F# Interactive è deprecato e potrebbe causare errori di accesso successivi. Per abilitare la generazione legacy di un singolo assembly dinamico che può accedere agli elementi interni, usare l'opzione '--multiemit-'. - - Include package source uri when searching for packages Includi l'URI di origine pacchetti durante la ricerca di pacchetti @@ -22,11 +17,6 @@ Cancella schermata - - Emit multiple assemblies (off by default for .NET Framework) - Creare più assembly (disattivato per impostazione predefinita per .NET Framework) - - Operation could not be completed due to earlier error Non è stato possibile completare l'operazione a causa di un errore precedente diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf index 4bd3f98f44f..eab626f267e 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ja.xlf @@ -7,11 +7,6 @@ [<EntryPoint>] を含む関数は FSI では呼び出されません。'{0}' は呼び出されませんでした。コマンド ライン引数の適切な文字列配列を使用して '{2}' を呼び出すには、'{1} <args>' を実行してください。 - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - F# インタラクティブの以前の評価から内部型、メソッド、またはフィールド `{0}` にアクセスすることは非推奨であり、その後のアクセス エラーが発生する可能性があります。内部にアクセスできる単一の動的アセンブリのレガシ生成を有効にするには、`--multiemit-` オプションを使用します。 - - Include package source uri when searching for packages パッケージの検索時にパッケージ ソースの URI を含める @@ -22,11 +17,6 @@ 画面をクリアする - - Emit multiple assemblies (off by default for .NET Framework) - 複数のアセンブリを出力する (.NET Frameworkの場合は既定でオフ) - - Operation could not be completed due to earlier error 以前のエラーが原因で操作を完了できませんでした diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf index 5a6c0bb8f4f..be891b98188 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ko.xlf @@ -7,11 +7,6 @@ [<EntryPoint>]가 있는 함수는 FSI에서 호출되지 않습니다. '{0}'이(가) 호출되지 않았습니다. 명령줄 인수의 적절한 문자열 배열로 '{2}'을(를) 호출하려면 '{1}<args>'를 실행하세요. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - F# 대화형의 이전 평가에서 내부 형식, 메서드 또는 필드 '{0}'에 액세스하는 것은 더 이상 사용되지 않으며 후속 액세스 오류가 발생할 수 있습니다. 내부에 액세스할 수 있는 단일 동적 어셈블리의 레거시 생성을 사용하도록 설정하려면 '--multiemit-' 옵션을 사용합니다. - - Include package source uri when searching for packages 패키지를 검색할 때 패키지 원본 URI 포함 @@ -22,11 +17,6 @@ 화면 지우기 - - Emit multiple assemblies (off by default for .NET Framework) - 여러 어셈블리 내보내기(기본적으로 .NET Framework 해제) - - Operation could not be completed due to earlier error 이전 오류로 인해 작업을 완료할 수 없습니다. diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf index b6cd0fa6659..58adec37da4 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pl.xlf @@ -7,11 +7,6 @@ Funkcje z elementem [<EntryPoint>] nie są wywoływane w interfejsie FSI. „{0}” nie został wywołany. Wykonaj polecenie „{1} <args>”, aby wywołać „{2}” z odpowiednią tablicą ciągów argumentów wiersza polecenia. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - Uzyskiwanie dostępu do typu wewnętrznego, metody lub pola „{0}“ z poprzedniej oceny w programie F# Interactive jest przestarzałe i może powodować kolejne błędy dostępu. Aby włączyć starszą generację pojedynczego zestawu dynamicznego, który może uzyskiwać dostęp wewnętrzny, użyj opcji „--multiemit-“. - - Include package source uri when searching for packages Uwzględnij identyfikator URI źródła pakietów podczas wyszukiwania pakietów @@ -22,11 +17,6 @@ Wyczyść ekran - - Emit multiple assemblies (off by default for .NET Framework) - Emituj wiele zestawów (domyślnie wyłączone dla programu .NET Framework) - - Operation could not be completed due to earlier error Nie udało się ukończyć operacji z powodu wcześniejszego błędu diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf index 3ae204efd46..b080a196f7c 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.pt-BR.xlf @@ -7,11 +7,6 @@ As funções com [<EntryPoint>] não são invocadas no FSI. '{0}' não foi invocado. Execute '{1} <args>' para invocar '{2}' com a matriz de cadeia de caracteres apropriada dos argumentos da linha de comando. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - O acesso ao tipo, método ou campo interno '{0}' de uma avaliação anterior em F# Interativo é preterido e pode causar erros de acesso subsequentes. Para habilitar a geração herdada de uma única assembly dinâmica que possa acessar os elementos internos, use a opção '--multiemit-'. - - Include package source uri when searching for packages Incluir o URI de origem do pacote ao pesquisar pacotes @@ -22,11 +17,6 @@ Limpar tela - - Emit multiple assemblies (off by default for .NET Framework) - Emitir várias montagens (desligadas por padrão para .NET Framework) - - Operation could not be completed due to earlier error Não foi possível concluir a operação devido a um erro anterior diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf index 34c69c3e70a..e46822530d8 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.ru.xlf @@ -7,11 +7,6 @@ Функции с [<EntryPoint>] не вызываются в FSI. "{0}" не вызван. Выполните "{1} <args>", чтобы вызвать "{2}" с соответствующим строковым массивом аргументов командной строки. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - Доступ ко внутреннему типу, методу или полю \"{0}\" из предыдущей оценки в F# Interactive является нерекомендуемым и может привести к последующим ошибкам доступа. Чтобы включить устаревшее создание одной динамической сборки, которая может получать доступ ко внутренним данным, используйте параметр \"--multiemit-\". - - Include package source uri when searching for packages Включать исходный URI пакета при поиске пакетов @@ -22,11 +17,6 @@ Очистить экран - - Emit multiple assemblies (off by default for .NET Framework) - Выпуск нескольких сборок (отключено по умолчанию для .NET Framework) - - Operation could not be completed due to earlier error Операция не может быть завершена из-за предыдущей ошибки diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf index e064e5d942c..3222a474ef5 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.tr.xlf @@ -7,11 +7,6 @@ [<EntryPoint>] ile işlevler, FSI'de çağrılmaz. '{0}' başlatılmadı. '{1} <args>' komutunu çalıştırarak uygun komut satırı bağımsız değişken dizisiyle '{2}' komutunu başlatın. - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - F# Etkileşimli’de önceki bir değerlendirmeden '{0}' iç türüne, yöntemine veya alanına erişim kullanım dışıdır ve sonraki erişim hatalarına neden olabilir. İç öğelere erişen tek bir dinamik bütünleştirilmiş kodun eski neslini etkinleştirmek için '--multiemit-' seçeneğini kullanın. - - Include package source uri when searching for packages Paketler aranırken paket kaynağı URI'si ekleyin @@ -22,11 +17,6 @@ Ekranı temizle - - Emit multiple assemblies (off by default for .NET Framework) - Birden çok bütünleştirilmiş kod göster (.NET Framework için varsayılan olarak kapalı) - - Operation could not be completed due to earlier error Önceki hata nedeniyle işlem tamamlanamadı diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf index e9262eef59c..de485cc5361 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hans.xlf @@ -7,11 +7,6 @@ FSI 中未调用具有 [<EntryPoint>] 的函数。未调用“{0}”。执行“{1} <args>”,以便使用命令行参数的相应字符串数组调用“{2}”。 - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - 已弃用从 F# 交互窗口的上一个评估中访问内部类型、方法或字段“{0}”,并可能导致后续访问错误。如果要启用可以访问内部的单个动态程序集的旧的生成,请使用 “--multiemit-” 选项。 - - Include package source uri when searching for packages 搜索包时包含包源 uri @@ -22,11 +17,6 @@ 清除屏幕 - - Emit multiple assemblies (off by default for .NET Framework) - 发出多个程序集(默认情况下为 .NET Framework 关闭) - - Operation could not be completed due to earlier error 由于早期错误,无法完成操作 diff --git a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf index 3223a668d89..9348019132b 100644 --- a/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf +++ b/src/Compiler/Interactive/xlf/FSIstrings.txt.zh-Hant.xlf @@ -7,11 +7,6 @@ FSI 中未叫用具有 [<EntryPoint>] 的函數。未叫用'{0}'。執行 '{1} <args>',以使用適當的命令列引數字串陣列叫用 '{2}'。 - - Accessing the internal type, method or field '{0}' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - 從之前 F# 互動中的評估存取內部類型、方法或欄位 '{0}' 已過時,可能造成後續存取錯誤。若要啟用可存取內部之單一動態組件的舊版世代,請使用 '--multiemit-' 選項。 - - Include package source uri when searching for packages 搜尋套件時包含套件來源 URI @@ -22,11 +17,6 @@ 清空螢幕 - - Emit multiple assemblies (off by default for .NET Framework) - 發出多組件 (.NET Framework 預設為關閉) - - Operation could not be completed due to earlier error 因為先前發生錯誤,所以無法完成作業 diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 25c94ca5c5c..25d1cbeba0b 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -834,7 +834,7 @@ type internal TypeCheckInfo if p >= 0 then Some p else None /// Build a CompetionItem - let CompletionItem (ty: ValueOption) (assemblySymbol: ValueOption) (item: ItemWithInst) = + let CompletionItem (ty: TyconRef voption) (assemblySymbol: AssemblySymbol voption) (item: ItemWithInst) = let kind = match item.Item with | Item.FakeInterfaceCtor _ @@ -2347,7 +2347,9 @@ module internal ParseAndCheckFile = let parseFile (sourceText: ISourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "parseFile", fileName) - use act = Activity.start "ParseAndCheckFile.parseFile" [| "fileName", fileName |] + + use act = + Activity.start "ParseAndCheckFile.parseFile" [| Activity.Tags.fileName, fileName |] let errHandler = DiagnosticsHandler(true, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) @@ -2504,7 +2506,12 @@ module internal ParseAndCheckFile = cancellable { use _ = - Activity.start "ParseAndCheckFile.CheckOneFile" [| "fileName", mainInputFileName; "length", sourceText.Length.ToString() |] + Activity.start + "ParseAndCheckFile.CheckOneFile" + [| + Activity.Tags.fileName, mainInputFileName + Activity.Tags.length, sourceText.Length.ToString() + |] let parsedMainInput = parseResults.ParseTree diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 578eb5558f0..a77ba8ff9ff 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -127,7 +127,7 @@ module IncrementalBuildSyntaxTree = use act = Activity.start "IncrementalBuildSyntaxTree.parse" [| - "fileName", source.FilePath + Activity.Tags.fileName, source.FilePath "buildPhase", BuildPhase.Parse.ToString() "canSkip", canSkip.ToString() |] @@ -475,7 +475,7 @@ type BoundModel private (tcConfig: TcConfig, let! res = defaultTypeCheck () return res | Some syntaxTree -> - use _ = Activity.start "BoundModel.TypeCheck" [|"fileName", syntaxTree.FileName|] + use _ = Activity.start "BoundModel.TypeCheck" [|Activity.Tags.fileName, syntaxTree.FileName|] let sigNameOpt = if partialCheck then this.BackingSignature @@ -538,7 +538,7 @@ type BoundModel private (tcConfig: TcConfig, // Build symbol keys let itemKeyStore, semanticClassification = if enableBackgroundItemKeyStoreAndSemanticClassification then - use _ = Activity.start "IncrementalBuild.CreateItemKeyStoreAndSemanticClassification" [|"fileName", fileName|] + use _ = Activity.start "IncrementalBuild.CreateItemKeyStoreAndSemanticClassification" [|Activity.Tags.fileName, fileName|] let sResolutions = sink.GetResolutions() let builder = ItemKeyStoreBuilder() let preventDuplicates = HashSet({ new IEqualityComparer with @@ -1043,7 +1043,7 @@ module IncrementalBuilderStateHelpers = let rec createFinalizeBoundModelGraphNode (initialState: IncrementalBuilderInitialState) (boundModels: ImmutableArray>.Builder) = GraphNode(node { - use _ = Activity.start "GetCheckResultsAndImplementationsForProject" [|"projectOutFile", initialState.outfile|] + use _ = Activity.start "GetCheckResultsAndImplementationsForProject" [|Activity.Tags.project, initialState.outfile|] // Compute last bound model then get all the evaluated models. let! _ = boundModels[boundModels.Count - 1].GetOrComputeValue() let boundModels = diff --git a/src/Compiler/Service/ServiceParseTreeWalk.fs b/src/Compiler/Service/ServiceParseTreeWalk.fs index 2a335d274e9..8415ec401fd 100644 --- a/src/Compiler/Service/ServiceParseTreeWalk.fs +++ b/src/Compiler/Service/ServiceParseTreeWalk.fs @@ -594,7 +594,7 @@ module SyntaxTraversal = | SynExpr.TypeApp (synExpr, _, _synTypeList, _commas, _, _, _range) -> traverseSynExpr synExpr - | SynExpr.LetOrUse (_, isRecursive, synBindingList, synExpr, range, _) -> + | SynExpr.LetOrUse (isRecursive, _, synBindingList, synExpr, range, _) -> match visitor.VisitLetOrUse(path, isRecursive, traverseSynBinding path, synBindingList, range) with | None -> [ diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 07c1f518725..9af88d75880 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -287,7 +287,7 @@ type BackgroundCompiler let CreateOneIncrementalBuilder (options: FSharpProjectOptions, userOpName) = node { use _ = - Activity.start "BackgroundCompiler.CreateOneIncrementalBuilder" [| "project", options.ProjectFileName |] + Activity.start "BackgroundCompiler.CreateOneIncrementalBuilder" [| Activity.Tags.project, options.ProjectFileName |] Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "CreateOneIncrementalBuilder", options.ProjectFileName) let projectReferences = getProjectReferences options userOpName @@ -479,7 +479,13 @@ type BackgroundCompiler member _.ParseFile(fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, userOpName: string) = async { use _ = - Activity.start "BackgroundCompiler.ParseFile" [| "fileName", fileName; "userOpName", userOpName; "cache", cache.ToString() |] + Activity.start + "BackgroundCompiler.ParseFile" + [| + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName + Activity.Tags.cache, cache.ToString() + |] if cache then let hash = sourceText.GetHashCode() |> int64 @@ -506,7 +512,9 @@ type BackgroundCompiler member _.GetBackgroundParseResultsForFileInProject(fileName, options, userOpName) = node { use _ = - Activity.start "BackgroundCompiler.GetBackgroundParseResultsForFileInProject" [| "fileName", fileName; "userOpName", userOpName |] + Activity.start + "BackgroundCompiler.GetBackgroundParseResultsForFileInProject" + [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, userOpName |] let! builderOpt, creationDiags = getOrCreateBuilder (options, userOpName) @@ -535,7 +543,9 @@ type BackgroundCompiler member _.GetCachedCheckFileResult(builder: IncrementalBuilder, fileName, sourceText: ISourceText, options) = node { - use _ = Activity.start "BackgroundCompiler.GetCachedCheckFileResult" [| "fileName", fileName |] + use _ = + Activity.start "BackgroundCompiler.GetCachedCheckFileResult" [| Activity.Tags.fileName, fileName |] + let hash = sourceText.GetHashCode() |> int64 let key = (fileName, hash, options) let cachedResultsOpt = parseCacheLock.AcquireLock(fun ltok -> checkFileInProjectCache.TryGet(ltok, key)) @@ -642,9 +652,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.CheckFileInProjectAllowingStaleCachedResults" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName |] let! cachedResults = @@ -684,9 +694,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.CheckFileInProject" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName |] let! builderOpt, creationDiags = getOrCreateBuilder (options, userOpName) @@ -712,9 +722,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.ParseAndCheckFileInProject" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName |] let! builderOpt, creationDiags = getOrCreateBuilder (options, userOpName) @@ -758,9 +768,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.ParseAndCheckFileInProject" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName |] let! builderOpt, creationDiags = getOrCreateBuilder (options, userOpName) @@ -850,9 +860,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.FindReferencesInFile" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName "symbol", symbol.FullName |] @@ -878,9 +888,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.GetSemanticClassificationForFile" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, userOpName |] let! builderOpt, _ = getOrCreateBuilder (options, userOpName) @@ -902,9 +912,9 @@ type BackgroundCompiler Activity.start "BackgroundCompiler.GetSemanticClassificationForFile" [| - "project", options.ProjectFileName - "fileName", fileName - "userOpName", _userOpName + Activity.Tags.project, options.ProjectFileName + Activity.Tags.fileName, fileName + Activity.Tags.userOpName, _userOpName |] match sourceText with @@ -980,7 +990,12 @@ type BackgroundCompiler member _.GetAssemblyData(options, userOpName) = node { use _ = - Activity.start "BackgroundCompiler.GetAssemblyData" [| "project", options.ProjectFileName; "userOpName", userOpName |] + Activity.start + "BackgroundCompiler.GetAssemblyData" + [| + Activity.Tags.project, options.ProjectFileName + Activity.Tags.userOpName, userOpName + |] let! builderOpt, _ = getOrCreateBuilder (options, userOpName) @@ -1003,7 +1018,12 @@ type BackgroundCompiler /// Parse and typecheck the whole project. member bc.ParseAndCheckProject(options, userOpName) = use _ = - Activity.start "BackgroundCompiler.ParseAndCheckProject" [| "project", options.ProjectFileName; "userOpName", userOpName |] + Activity.start + "BackgroundCompiler.ParseAndCheckProject" + [| + Activity.Tags.project, options.ProjectFileName + Activity.Tags.userOpName, userOpName + |] bc.ParseAndCheckProjectImpl(options, userOpName) @@ -1022,7 +1042,9 @@ type BackgroundCompiler _userOpName ) = use _ = - Activity.start "BackgroundCompiler.GetProjectOptionsFromScript" [| "fileName", fileName; "userOpName", _userOpName |] + Activity.start + "BackgroundCompiler.GetProjectOptionsFromScript" + [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, _userOpName |] cancellable { use diagnostics = new DiagnosticsScope() @@ -1109,7 +1131,12 @@ type BackgroundCompiler member bc.InvalidateConfiguration(options: FSharpProjectOptions, userOpName) = use _ = - Activity.start "BackgroundCompiler.InvalidateConfiguration" [| "project", options.ProjectFileName; "userOpName", userOpName |] + Activity.start + "BackgroundCompiler.InvalidateConfiguration" + [| + Activity.Tags.project, options.ProjectFileName + Activity.Tags.userOpName, userOpName + |] if incrementalBuildersCache.ContainsSimilarKey(AnyCallerThread, options) then parseCacheLock.AcquireLock(fun ltok -> @@ -1120,7 +1147,7 @@ type BackgroundCompiler () member bc.ClearCache(options: seq, _userOpName) = - use _ = Activity.start "BackgroundCompiler.ClearCache" [| "userOpName", _userOpName |] + use _ = Activity.start "BackgroundCompiler.ClearCache" [| Activity.Tags.userOpName, _userOpName |] lock gate (fun () -> options @@ -1128,7 +1155,12 @@ type BackgroundCompiler member _.NotifyProjectCleaned(options: FSharpProjectOptions, userOpName) = use _ = - Activity.start "BackgroundCompiler.NotifyProjectCleaned" [| "project", options.ProjectFileName; "userOpName", userOpName |] + Activity.start + "BackgroundCompiler.NotifyProjectCleaned" + [| + Activity.Tags.project, options.ProjectFileName + Activity.Tags.userOpName, userOpName + |] async { let! ct = Async.CancellationToken @@ -1296,7 +1328,10 @@ type FSharpChecker member _.MatchBraces(fileName, sourceText: ISourceText, options: FSharpParsingOptions, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" - use _ = Activity.start "FSharpChecker.MatchBraces" [| "fileName", fileName; "userOpName", userOpName |] + + use _ = + Activity.start "FSharpChecker.MatchBraces" [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, userOpName |] + let hash = sourceText.GetHashCode() |> int64 async { @@ -1348,7 +1383,7 @@ type FSharpChecker member _.Compile(argv: string[], ?userOpName: string) = let _userOpName = defaultArg userOpName "Unknown" - use _ = Activity.start "FSharpChecker.Compile" [| "userOpName", _userOpName |] + use _ = Activity.start "FSharpChecker.Compile" [| Activity.Tags.userOpName, _userOpName |] async { let ctok = CompilationThreadToken() diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fs b/src/Compiler/SyntaxTree/ParseHelpers.fs index fee75795e33..e181801324d 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fs +++ b/src/Compiler/SyntaxTree/ParseHelpers.fs @@ -420,9 +420,9 @@ let (|GetIdent|SetIdent|OtherIdent|) (ident: Ident option) = let mkSynMemberDefnGetSet (parseState: IParseState) - (opt_inline: bool) + (opt_inline: range option) (mWith: range) - (classDefnMemberGetSetElements: (bool * SynAttributeList list * (SynPat * range) * (range option * SynReturnInfo) option * range option * SynExpr * range) list) + (classDefnMemberGetSetElements: (range option * SynAttributeList list * (SynPat * range) * (range option * SynReturnInfo) option * range option * SynExpr * range) list) (mAnd: range option) (mWhole: range) (propertyNameBindingPat: SynPat) @@ -441,7 +441,7 @@ let mkSynMemberDefnGetSet let tryMkSynMemberDefnMember ( - optInline, + mOptInline: range option, optAttrs: SynAttributeList list, (bindingPat, mBindLhs), optReturnType, @@ -449,7 +449,7 @@ let mkSynMemberDefnGetSet expr, mExpr ) : (SynMemberDefn * Ident option) option = - let optInline = opt_inline || optInline + let optInline = Option.isSome opt_inline || Option.isSome mOptInline // optional attributes are only applied to getters and setters // the "top level" attrs will be applied to both let optAttrs = @@ -469,6 +469,7 @@ let mkSynMemberDefnGetSet let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword + InlineKeyword = mOptInline EqualsRange = mEquals } @@ -729,6 +730,7 @@ let mkSynMemberDefnGetSet if getOrSet.idText = "get" then let trivia = { + InlineKeyword = opt_inline WithKeyword = mWith GetKeyword = Some getOrSet.idRange AndKeyword = None @@ -739,6 +741,7 @@ let mkSynMemberDefnGetSet else let trivia = { + InlineKeyword = opt_inline WithKeyword = mWith GetKeyword = None AndKeyword = None @@ -759,6 +762,7 @@ let mkSynMemberDefnGetSet let trivia = { + InlineKeyword = opt_inline WithKeyword = mWith GetKeyword = Some mGet AndKeyword = mAnd @@ -772,6 +776,7 @@ let mkSynMemberDefnGetSet match getOrSet with | GetIdent mGet -> { + InlineKeyword = opt_inline WithKeyword = mWith GetKeyword = Some mGet AndKeyword = mAnd @@ -779,6 +784,7 @@ let mkSynMemberDefnGetSet } | SetIdent mSet -> { + InlineKeyword = opt_inline WithKeyword = mWith GetKeyword = None AndKeyword = mAnd @@ -786,6 +792,7 @@ let mkSynMemberDefnGetSet } | OtherIdent -> { + InlineKeyword = opt_inline WithKeyword = mWith AndKeyword = mAnd GetKeyword = None @@ -899,6 +906,7 @@ let mkSynDoBinding (vis: SynAccess option, mDo, expr, m) = DebugPointAtBinding.NoneAtDo, { LeadingKeyword = SynLeadingKeyword.Do mDo + InlineKeyword = None EqualsRange = None } ) diff --git a/src/Compiler/SyntaxTree/ParseHelpers.fsi b/src/Compiler/SyntaxTree/ParseHelpers.fsi index 353d8c973c6..46ae73f1ab0 100644 --- a/src/Compiler/SyntaxTree/ParseHelpers.fsi +++ b/src/Compiler/SyntaxTree/ParseHelpers.fsi @@ -164,9 +164,9 @@ val raiseParseErrorAt: range -> (int * string) -> 'a val mkSynMemberDefnGetSet: parseState: IParseState -> - opt_inline: bool -> + opt_inline: range option -> mWith: range -> - classDefnMemberGetSetElements: (bool * SynAttributeList list * (SynPat * range) * (range option * SynReturnInfo) option * range option * SynExpr * range) list -> + classDefnMemberGetSetElements: (range option * SynAttributeList list * (SynPat * range) * (range option * SynReturnInfo) option * range option * SynExpr * range) list -> mAnd: range option -> mWhole: range -> propertyNameBindingPat: SynPat -> diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fs b/src/Compiler/SyntaxTree/SyntaxTrivia.fs index 160569564a3..dea3bfbc31a 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fs +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fs @@ -224,12 +224,14 @@ type SynLeadingKeyword = type SynBindingTrivia = { LeadingKeyword: SynLeadingKeyword + InlineKeyword: range option EqualsRange: range option } static member Zero: SynBindingTrivia = { LeadingKeyword = SynLeadingKeyword.Synthetic + InlineKeyword = None EqualsRange = None } @@ -288,6 +290,7 @@ type SynModuleOrNamespaceSigTrivia = type SynValSigTrivia = { LeadingKeyword: SynLeadingKeyword + InlineKeyword: range option WithKeyword: range option EqualsRange: range option } @@ -295,6 +298,7 @@ type SynValSigTrivia = static member Zero: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.Synthetic + InlineKeyword = None WithKeyword = None EqualsRange = None } @@ -305,6 +309,7 @@ type SynTypeFunTrivia = { ArrowRange: range } [] type SynMemberGetSetTrivia = { + InlineKeyword: range option WithKeyword: range GetKeyword: range option AndKeyword: range option diff --git a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi index 555af5520ed..c76e3e99534 100644 --- a/src/Compiler/SyntaxTree/SyntaxTrivia.fsi +++ b/src/Compiler/SyntaxTree/SyntaxTrivia.fsi @@ -287,6 +287,9 @@ type SynBindingTrivia = /// Used leading keyword of SynBinding LeadingKeyword: SynLeadingKeyword + /// The syntax range of the `inline` keyword + InlineKeyword: range option + /// The syntax range of the `=` token. EqualsRange: range option } @@ -362,6 +365,9 @@ type SynValSigTrivia = /// but in case of `SynMemberDefn.AutoProperty` or `SynMemberDefn.AbstractSlot` it could be something else. LeadingKeyword: SynLeadingKeyword + /// The syntax range of the `inline` keyword + InlineKeyword: range option + /// The syntax range of the `with` keyword WithKeyword: range option @@ -383,6 +389,9 @@ type SynTypeFunTrivia = [] type SynMemberGetSetTrivia = { + /// The syntax range of the `inline` keyword + InlineKeyword: range option + /// The syntax range of the `with` keyword WithKeyword: range diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 1ff908d445a..20171928a41 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -1604,13 +1604,13 @@ type TyconRefMultiMap<'T>(contents: TyconRefMap<'T list>) = //-------------------------------------------------------------------------- /// Try to create a EntityRef suitable for accessing the given Entity from another assembly -let tryRescopeEntity viewedCcu (entity: Entity) : ValueOption = +let tryRescopeEntity viewedCcu (entity: Entity) : EntityRef voption = match entity.PublicPath with | Some pubpath -> ValueSome (ERefNonLocal (rescopePubPath viewedCcu pubpath)) | None -> ValueNone /// Try to create a ValRef suitable for accessing the given Val from another assembly -let tryRescopeVal viewedCcu (entityRemap: Remap) (vspec: Val) : ValueOption = +let tryRescopeVal viewedCcu (entityRemap: Remap) (vspec: Val) : ValRef voption = match vspec.PublicPath with | Some (ValPubPath(p, fullLinkageKey)) -> // The type information in the val linkage doesn't need to keep any information to trait solutions. @@ -9573,11 +9573,11 @@ type Entity with List.lengthsEqAndForall2 (typeEquiv g) (List.map fst argInfos) argTys && membInfo.MemberFlags.IsOverrideOrExplicitImpl | _ -> false) - - member tycon.HasMember g nm argTys = + + member tycon.TryGetMember g nm argTys = tycon.TypeContents.tcaug_adhoc |> NameMultiMap.find nm - |> List.exists (fun vref -> + |> List.tryFind (fun vref -> match vref.MemberInfo with | None -> false | _ -> @@ -9586,7 +9586,8 @@ type Entity with match argInfos with | [argInfos] -> List.lengthsEqAndForall2 (typeEquiv g) (List.map fst argInfos) argTys | _ -> false) - + + member tycon.HasMember g nm argTys = (tycon.TryGetMember g nm argTys).IsSome type EntityRef with member tcref.HasInterface g ty = tcref.Deref.HasInterface g ty diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index ae58019683a..60bc899d662 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -665,7 +665,7 @@ val isTyparTy: TcGlobals -> TType -> bool val isAnyParTy: TcGlobals -> TType -> bool -val tryAnyParTy: TcGlobals -> TType -> ValueOption +val tryAnyParTy: TcGlobals -> TType -> Typar voption val tryAnyParTyOption: TcGlobals -> TType -> Typar option @@ -679,26 +679,26 @@ val isProvenUnionCaseTy: TType -> bool val isAppTy: TcGlobals -> TType -> bool -val tryAppTy: TcGlobals -> TType -> ValueOption +val tryAppTy: TcGlobals -> TType -> (TyconRef * TypeInst) voption val destAppTy: TcGlobals -> TType -> TyconRef * TypeInst val tcrefOfAppTy: TcGlobals -> TType -> TyconRef -val tryTcrefOfAppTy: TcGlobals -> TType -> ValueOption +val tryTcrefOfAppTy: TcGlobals -> TType -> TyconRef voption -val tryDestTyparTy: TcGlobals -> TType -> ValueOption +val tryDestTyparTy: TcGlobals -> TType -> Typar voption -val tryDestFunTy: TcGlobals -> TType -> ValueOption +val tryDestFunTy: TcGlobals -> TType -> (TType * TType) voption -val tryDestAnonRecdTy: TcGlobals -> TType -> ValueOption +val tryDestAnonRecdTy: TcGlobals -> TType -> (AnonRecdTypeInfo * TType list) voption val argsOfAppTy: TcGlobals -> TType -> TypeInst val mkInstForAppTy: TcGlobals -> TType -> TyparInstantiation /// Try to get a TyconRef for a type without erasing type abbreviations -val tryNiceEntityRefOfTy: TType -> ValueOption +val tryNiceEntityRefOfTy: TType -> TyconRef voption val tryNiceEntityRefOfTyOption: TType -> TyconRef option @@ -1089,7 +1089,7 @@ val tagEntityRefName: xref: EntityRef -> name: string -> TaggedText /// Return the full text for an item as we want it displayed to the user as a fully qualified entity val fullDisplayTextOfModRef: ModuleOrNamespaceRef -> string -val fullDisplayTextOfParentOfModRef: ModuleOrNamespaceRef -> ValueOption +val fullDisplayTextOfParentOfModRef: ModuleOrNamespaceRef -> string voption val fullDisplayTextOfValRef: ValRef -> string @@ -1303,10 +1303,10 @@ val wrapModuleOrNamespaceTypeInNamespace: val wrapModuleOrNamespaceType: Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespace /// Given a namespace, module or type definition, try to produce a reference to that entity. -val tryRescopeEntity: CcuThunk -> Entity -> ValueOption +val tryRescopeEntity: CcuThunk -> Entity -> EntityRef voption /// Given a value definition, try to produce a reference to that value. Fails for local values. -val tryRescopeVal: CcuThunk -> Remap -> Val -> ValueOption +val tryRescopeVal: CcuThunk -> Remap -> Val -> ValRef voption /// Make the substitution (remapping) table for viewing a module or namespace 'from the outside' /// @@ -1526,7 +1526,7 @@ val isOptionTy: TcGlobals -> TType -> bool val destOptionTy: TcGlobals -> TType -> TType /// Try to take apart an option type -val tryDestOptionTy: TcGlobals -> TType -> ValueOption +val tryDestOptionTy: TcGlobals -> TType -> TType voption /// Try to take apart an option type val destValueOptionTy: TcGlobals -> TType -> TType @@ -1535,7 +1535,7 @@ val destValueOptionTy: TcGlobals -> TType -> TType val isNullableTy: TcGlobals -> TType -> bool /// Try to take apart a System.Nullable type -val tryDestNullableTy: TcGlobals -> TType -> ValueOption +val tryDestNullableTy: TcGlobals -> TType -> TType voption /// Take apart a System.Nullable type val destNullableTy: TcGlobals -> TType -> TType @@ -2449,6 +2449,8 @@ type Entity with member HasMember: TcGlobals -> string -> TType list -> bool + member internal TryGetMember: TcGlobals -> string -> TType list -> ValRef option + type EntityRef with member HasInterface: TcGlobals -> TType -> bool diff --git a/src/Compiler/Utilities/Activity.fs b/src/Compiler/Utilities/Activity.fs index 2ae87433ce5..a5f8000cfa0 100644 --- a/src/Compiler/Utilities/Activity.fs +++ b/src/Compiler/Utilities/Activity.fs @@ -4,11 +4,62 @@ namespace FSharp.Compiler.Diagnostics open System open System.Diagnostics +open System.IO +open System.Text [] -module Activity = +module internal Activity = + + module Tags = + let fileName = "fileName" + let project = "project" + let qualifiedNameOfFile = "qualifiedNameOfFile" + let userOpName = "userOpName" + let length = "length" + let cache = "cache" + let cpuDelta = "cpuDelta(s)" + let realDelta = "realDelta(s)" + let gc0 = "gc0" + let gc1 = "gc1" + let gc2 = "gc2" + let outputDllFile = "outputDllFile" + + let AllKnownTags = + [| + fileName + project + qualifiedNameOfFile + userOpName + length + cache + cpuDelta + realDelta + gc0 + gc1 + gc2 + outputDllFile + |] let private activitySourceName = "fsc" + let private profiledSourceName = "fsc_with_env_stats" + + type System.Diagnostics.Activity with + + member this.RootId = + let rec rootID (act: Activity) = + if isNull act.ParentId then act.Id else rootID act.Parent + + rootID this + + member this.Depth = + let rec depth (act: Activity) acc = + if isNull act.ParentId then + acc + else + depth act.Parent (acc + 1) + + depth this 0 + let private activitySource = new ActivitySource(activitySourceName) let start (name: string) (tags: (string * string) seq) : IDisposable = @@ -23,3 +74,168 @@ module Activity = activity let startNoTags (name: string) : IDisposable = activitySource.StartActivity(name) + + module Profiling = + + module Tags = + let workingSetMB = "workingSet(MB)" + let gc0 = "gc0" + let gc1 = "gc1" + let gc2 = "gc2" + let handles = "handles" + let threads = "threads" + + let profilingTags = [| workingSetMB; gc0; gc1; gc2; handles; threads |] + + let private profiledSource = new ActivitySource(profiledSourceName) + + let startAndMeasureEnvironmentStats (name: string) : IDisposable = profiledSource.StartActivity(name) + + type private GCStats = int[] + + let private collectGCStats () : GCStats = + [| for i in 0 .. GC.MaxGeneration -> GC.CollectionCount i |] + + let private addStatsMeasurementListener () = + let gcStatsInnerTag = "#gc_stats_internal" + + let l = + new ActivityListener( + ShouldListenTo = (fun a -> a.Name = profiledSourceName), + Sample = (fun _ -> ActivitySamplingResult.AllData), + ActivityStarted = (fun a -> a.AddTag(gcStatsInnerTag, collectGCStats ()) |> ignore), + ActivityStopped = + (fun a -> + let statsBefore = a.GetTagItem(gcStatsInnerTag) :?> GCStats + let statsAfter = collectGCStats () + let p = Process.GetCurrentProcess() + a.AddTag(Tags.workingSetMB, p.WorkingSet64 / 1_000_000L) |> ignore + a.AddTag(Tags.handles, p.HandleCount) |> ignore + a.AddTag(Tags.threads, p.Threads.Count) |> ignore + + for i = 0 to statsAfter.Length - 1 do + a.AddTag($"gc{i}", statsAfter[i] - statsBefore[i]) |> ignore) + + ) + + ActivitySource.AddActivityListener(l) + l + + let addConsoleListener () = + let statsMeasurementListener = addStatsMeasurementListener () + + let reportingStart = DateTime.UtcNow + let nameColumnWidth = 36 + + let header = + "|" + + "Phase name".PadRight(nameColumnWidth) + + "|Elapsed |Duration| WS(MB)| GC0 | GC1 | GC2 |Handles|Threads|" + + let consoleWriterListener = + new ActivityListener( + ShouldListenTo = (fun a -> a.Name = profiledSourceName), + Sample = (fun _ -> ActivitySamplingResult.AllData), + ActivityStopped = + (fun a -> + Console.Write('|') + let indentedName = new String('>', a.Depth) + a.DisplayName + Console.Write(indentedName.PadRight(nameColumnWidth)) + + let elapsed = (a.StartTimeUtc + a.Duration - reportingStart).TotalSeconds + Console.Write("|{0,8:N4}|{1,8:N4}|", elapsed, a.Duration.TotalSeconds) + + for t in Tags.profilingTags do + Console.Write("{0,7}|", a.GetTagItem(t)) + + Console.WriteLine()) + ) + + Console.WriteLine(new String('-', header.Length)) + Console.WriteLine(header) + Console.WriteLine(header |> String.map (fun c -> if c = '|' then c else '-')) + + ActivitySource.AddActivityListener(consoleWriterListener) + + { new IDisposable with + member this.Dispose() = + statsMeasurementListener.Dispose() + consoleWriterListener.Dispose() + Console.WriteLine(new String('-', header.Length)) + } + + module CsvExport = + + let private escapeStringForCsv (o: obj) = + if isNull o then + "" + else + let mutable txtVal = o.ToString() + let hasComma = txtVal.IndexOf(',') > -1 + let hasQuote = txtVal.IndexOf('"') > -1 + + if hasQuote then + txtVal <- txtVal.Replace("\"", "\\\"") + + if hasQuote || hasComma then + "\"" + txtVal + "\"" + else + txtVal + + let private createCsvRow (a: Activity) = + let sb = new StringBuilder(128) + + let appendWithLeadingComma (s: string) = + sb.Append(',') |> ignore + sb.Append(s) |> ignore + + // "Name,StartTime,EndTime,Duration,Id,ParentId" + sb.Append(a.DisplayName) |> ignore + appendWithLeadingComma (a.StartTimeUtc.ToString("HH-mm-ss.ffff")) + appendWithLeadingComma ((a.StartTimeUtc + a.Duration).ToString("HH-mm-ss.ffff")) + appendWithLeadingComma (a.Duration.TotalSeconds.ToString("000.0000", System.Globalization.CultureInfo.InvariantCulture)) + appendWithLeadingComma (a.Id) + appendWithLeadingComma (a.ParentId) + appendWithLeadingComma (a.RootId) + + Tags.AllKnownTags + |> Array.iter (fun t -> a.GetTagItem(t) |> escapeStringForCsv |> appendWithLeadingComma) + + sb.ToString() + + let addCsvFileListener pathToFile = + if pathToFile |> File.Exists |> not then + File.WriteAllLines( + pathToFile, + [ + "Name,StartTime,EndTime,Duration(s),Id,ParentId,RootId," + + String.concat "," Tags.AllKnownTags + ] + ) + + let sw = new StreamWriter(path = pathToFile, append = true) + + let msgQueue = + MailboxProcessor.Start + (fun inbox -> + async { + while true do + let! msg = inbox.Receive() + do! sw.WriteLineAsync(msg) |> Async.AwaitTask + }) + + let l = + new ActivityListener( + ShouldListenTo = (fun a -> a.Name = activitySourceName || a.Name = profiledSourceName), + Sample = (fun _ -> ActivitySamplingResult.AllData), + ActivityStopped = (fun a -> msgQueue.Post(createCsvRow a)) + ) + + ActivitySource.AddActivityListener(l) + + { new IDisposable with + member this.Dispose() = + l.Dispose() // Unregister from listening new activities first + (msgQueue :> IDisposable).Dispose() // Wait for the msg queue to be written out + sw.Dispose() // Only then flush the messages and close the file + } diff --git a/src/Compiler/Utilities/Activity.fsi b/src/Compiler/Utilities/Activity.fsi index edf0d890c19..746422455bf 100644 --- a/src/Compiler/Utilities/Activity.fsi +++ b/src/Compiler/Utilities/Activity.fsi @@ -9,6 +9,21 @@ open System [] module internal Activity = + module Tags = + val fileName: string + val qualifiedNameOfFile: string + val project: string + val userOpName: string + val length: string + val cache: string + val startNoTags: name: string -> IDisposable val start: name: string -> tags: (string * string) seq -> IDisposable + + module Profiling = + val startAndMeasureEnvironmentStats: name: string -> IDisposable + val addConsoleListener: unit -> IDisposable + + module CsvExport = + val addCsvFileListener: pathToFile: string -> IDisposable diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index d0bb8f7843b..11ed90c37fa 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -85,27 +85,17 @@ module internal PervasiveAutoOpens = | Some x -> x let reportTime = - let mutable tFirst = None - let mutable tPrev = None - - fun showTimes descr -> - if showTimes then - let t = Process.GetCurrentProcess().UserProcessorTime.TotalSeconds - - let prev = - match tPrev with - | None -> 0.0 - | Some t -> t - - let first = - match tFirst with - | None -> - (tFirst <- Some t - t) - | Some t -> t - - printf " ilwrite: Cpu %4.1f (total) %4.1f (delta) - %s\n" (t - first) (t - prev) descr - tPrev <- Some t + let mutable tPrev: IDisposable = null + + fun descr -> + if isNotNull tPrev then + tPrev.Dispose() + + tPrev <- + if descr <> "Finish" then + FSharp.Compiler.Diagnostics.Activity.Profiling.startAndMeasureEnvironmentStats descr + else + null let foldOn p f z x = f z (p x) diff --git a/src/Compiler/Utilities/illib.fsi b/src/Compiler/Utilities/illib.fsi index 40f8c8f8162..5696a14da98 100644 --- a/src/Compiler/Utilities/illib.fsi +++ b/src/Compiler/Utilities/illib.fsi @@ -48,7 +48,7 @@ module internal PervasiveAutoOpens = /// We set the limit to be 80k to account for larger pointer sizes for when F# is running 64-bit. val LOH_SIZE_THRESHOLD_BYTES: int - val reportTime: (bool -> string -> unit) + val reportTime: (string -> unit) /// Get an initialization hole val getHole: r: 'a option ref -> 'a diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index a18fb02fbb1..dbbf70dcab0 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -695,7 +695,7 @@ moduleSpfn: valSpfn: | opt_attributes opt_access VAL opt_attributes opt_inline opt_mutable opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints optLiteralValueSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) - let attr1, attr2, isInline, isMutable, vis2, id, doc, explicitValTyparDecls, (ty, arity), (mEquals, konst: SynExpr option) = ($1), ($4), ($5), ($6), ($7), ($8), grabXmlDoc(parseState, $1, 1), ($9), ($11), ($12) + let attr1, attr2, isInline, isMutable, vis2, id, doc, explicitValTyparDecls, (ty, arity), (mEquals, konst: SynExpr option) = ($1), ($4), (Option.isSome $5), ($6), ($7), ($8), grabXmlDoc(parseState, $1, 1), ($9), ($11), ($12) if not (isNil attr2) then errorR(Deprecated(FSComp.SR.parsAttributesMustComeBeforeVal(), rhs parseState 4)) let m = rhs2 parseState 1 11 @@ -705,7 +705,7 @@ valSpfn: | None -> m | Some e -> unionRanges m e.Range let mVal = rhs parseState 3 - let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.Val mVal; WithKeyword = None; EqualsRange = mEquals } + let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.Val mVal; InlineKeyword = $5; WithKeyword = None; EqualsRange = mEquals } let valSpfn = SynValSig((attr1@attr2), id, explicitValTyparDecls, ty, arity, isInline, isMutable, doc, vis2, konst, m, trivia) SynModuleSigDecl.Val(valSpfn, m) } @@ -913,7 +913,7 @@ classSpfnMembersAtLeastOne: classMemberSpfn: | opt_attributes opt_access memberSpecFlags opt_inline opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet optLiteralValueSpfn { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2)) - let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = $4, grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 + let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = (Option.isSome $4), grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11 let mWith, (getSet, getSetRangeOpt) = $10 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet let mWhole = @@ -930,7 +930,7 @@ classMemberSpfn: let flags, leadingKeyword = $3 let flags = flags (getSetAdjuster arity) - let trivia = { LeadingKeyword = leadingKeyword; WithKeyword = mWith; EqualsRange = mEquals } + let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = mEquals } let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, trivia) let trivia: SynMemberSigMemberTrivia = { GetSetKeywords = getSetRangeOpt } SynMemberSig.Member(valSpfn, flags, mWhole, trivia) } @@ -970,7 +970,7 @@ classMemberSpfn: let mNew = rhs parseState 3 let m = unionRanges (rhs parseState 1) ty.Range |> unionRangeWithXmlDoc doc let isInline = false - let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; WithKeyword = None; EqualsRange = None } + let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; InlineKeyword = None; WithKeyword = None; EqualsRange = None } let valSpfn = SynValSig ($1, (SynIdent(mkSynId (rhs parseState 3) "new", None)), noInferredTypars, ty, valSynInfo, isInline, false, doc, vis, None, m, trivia) SynMemberSig.Member(valSpfn, CtorMemberFlags, m, SynMemberSigMemberTrivia.Zero) } @@ -1740,8 +1740,8 @@ memberCore: let memFlagsBuilder, leadingKeyword = flagsBuilderAndLeadingKeyword let memberFlags = memFlagsBuilder SynMemberKind.Member let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) - let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals } - let binding = mkSynBinding (xmlDoc, bindingPat) (vis, $1, false, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, optReturnType, $5, mRhs, [], attrs, Some memberFlags, trivia) + let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals } + let binding = mkSynBinding (xmlDoc, bindingPat) (vis, (Option.isSome $1), false, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, optReturnType, $5, mRhs, [], attrs, Some memberFlags, trivia) let memberRange = unionRanges rangeStart mRhs |> unionRangeWithXmlDoc xmlDoc [ SynMemberDefn.Member (binding, memberRange) ]) } @@ -1819,7 +1819,7 @@ classDefnMember: | opt_attributes opt_access abstractMemberFlags opt_inline nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet opt_ODECLEND { let ty, arity = $8 - let isInline, doc, id, explicitValTyparDecls = $4, grabXmlDoc(parseState, $1, 1), $5, $6 + let isInline, doc, id, explicitValTyparDecls = (Option.isSome $4), grabXmlDoc(parseState, $1, 1), $5, $6 let mWith, (getSet, getSetRangeOpt) = $9 let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet let mWhole = @@ -1830,7 +1830,7 @@ classDefnMember: |> unionRangeWithXmlDoc doc if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole)) let mkFlags, leadingKeyword = $3 - let trivia = { LeadingKeyword = leadingKeyword; WithKeyword = mWith; EqualsRange = None } + let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = None } let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, trivia) let trivia: SynMemberDefnAbstractSlotTrivia = { GetSetKeywords = getSetRangeOpt } [ SynMemberDefn.AbstractSlot(valSpfn, mkFlags (getSetAdjuster arity), mWhole, trivia) ] } @@ -1870,7 +1870,7 @@ classDefnMember: let declPat = SynPat.LongIdent (SynLongIdent([mkSynId (rhs parseState 3) "new"], [], [None]), None, Some noInferredTypars, SynArgPats.Pats [$4], vis, rhs parseState 3) // Check that 'SynPatForConstructorDecl' matches this correctly assert (match declPat with SynPatForConstructorDecl _ -> true | _ -> false) - let synBindingTrivia: SynBindingTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; EqualsRange = Some mEquals } + let synBindingTrivia: SynBindingTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; InlineKeyword = None; EqualsRange = Some mEquals } [ SynMemberDefn.Member(SynBinding (None, SynBindingKind.Normal, false, false, $1, xmlDoc, valSynData, declPat, None, expr, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, synBindingTrivia), m) ] } | opt_attributes opt_access STATIC typeKeyword tyconDefn @@ -2669,7 +2669,7 @@ cPrototype: let bindingPat = SynPat.LongIdent (SynLongIdent([nm], [], [None]), None, Some noInferredTypars, SynArgPats.Pats [SynPat.Tuple(false, args, argsm)], vis, nmm) let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) let xmlDoc = grabXmlDoc(parseState, attrs, 1) - let trivia = { LeadingKeyword = SynLeadingKeyword.Extern mExtern; EqualsRange = None } + let trivia = { LeadingKeyword = SynLeadingKeyword.Extern mExtern; InlineKeyword = None; EqualsRange = None } let binding = mkSynBinding (xmlDoc, bindingPat) @@ -2792,8 +2792,8 @@ localBinding: let mWhole = (unionRanges leadingKeyword.Range mRhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) let spBind = if IsDebugPointBinding bindingPat expr then DebugPointAtBinding.Yes mWhole else DebugPointAtBinding.NoneAtLet let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range) - let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals } - mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mWholeBindLhs, spBind, optReturnType, expr, mRhs, opts, attrs, None, trivia)) + let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals } + mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mWholeBindLhs, spBind, optReturnType, expr, mRhs, opts, attrs, None, trivia)) localBindingRange, localBindingBuilder } | opt_inline opt_mutable bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS error @@ -2807,8 +2807,8 @@ localBinding: let zeroWidthAtEnd = mEquals.EndRange let rhsExpr = arbExpr("localBinding1", zeroWidthAtEnd) let spBind = if IsDebugPointBinding bindingPat rhsExpr then DebugPointAtBinding.Yes mWhole else DebugPointAtBinding.NoneAtLet - let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals } - mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia)) + let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals } + mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia)) mWhole, localBindingBuilder } | opt_inline opt_mutable bindingPattern opt_topReturnTypeWithTypeConstraints recover @@ -2820,9 +2820,9 @@ localBinding: let localBindingBuilder = (fun xmlDoc attrs vis (leadingKeyword: SynLeadingKeyword) -> let spBind = DebugPointAtBinding.Yes (unionRanges leadingKeyword.Range mRhs) - let trivia = { LeadingKeyword = leadingKeyword; EqualsRange = None } + let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = None } let rhsExpr = arbExpr("localBinding2", mRhs) - mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia)) + mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia)) mWhole, localBindingBuilder } /* A single expression with an optional type annotation, and an optional static optimization block */ @@ -5816,8 +5816,8 @@ opt_bar: | /* EMPTY */ { } opt_inline: - | INLINE { true } - | /* EMPTY */ { false } + | INLINE { Some (rhs parseState 1) } + | /* EMPTY */ { None } opt_mutable: | MUTABLE { true } diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index fffdc316fa4..6edc8b7cd46 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Všechny prvky pole musí být implicitně převoditelné na typ prvního elementu, což je řazená kolekce členů o délce {0} typu\n {1} \nTento element je řazená kolekce členů o délce {2} typu\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ Soubor {0} má nerozpoznanou příponu. Zdrojové soubory musí mít příponu .fs, .fsi, .fsx nebo .fsscript. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Duplicitní parametr Parametr {0} byl v této metodě použit vícekrát. @@ -57,6 +72,11 @@ Použití incr z knihovny F# je zastaralé. Více informací: https://aka.ms/fsharp-refcell-ops. Změňte prosím například incr cell na cell.Value <- cell.Value + 1. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Atribut AssemblyKeyNameAttribute je zastaralý. Použijte místo něj AssemblyKeyFileAttribute. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Všechny větve výrazu if musí vracet hodnoty implicitně převoditelné na typ první větve, což je řazená kolekce členů o délce {0} typu\n {1} \nTato větev vrací řazenou kolekci členů o délce {2} typu\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Povolit aritmetické a logické operace v literálech @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Povolit implicitní atribut Extension pro deklarující typy, moduly @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Vyvolá chyby pro přepsání jiných než virtuálních členů @@ -192,6 +212,16 @@ chyba při zastaralém přístupu konstruktoru s atributem RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Uvede složené závorky před voláním formattableStringFactory.Create, pokud je interpolovaný řetězcový literál zadán jako FormattableString. + + more types support units of measure více typů podporuje měrné jednotky @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + Zahození shody vzoru není povolené pro případ sjednocení, který nepřijímá žádná data. @@ -332,6 +362,11 @@ reprezentace struktury aktivních vzorů + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop zástupný znak ve smyčce for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Všechny větve výrazu shody vzoru musí vracet hodnoty implicitně převoditelné na typ první větve, což je řazená kolekce členů o délce {0} typu\n {1} \nTato větev vrací řazenou kolekci členů o délce {2} typu\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Výraz if musí vrátit řazenou kolekci členů o délce {0} typu\n {1} \nto splňovat požadavky na typ kontextu. Aktuálně vrací řazenou kolekci členů o délce {2} typu\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Všechny prvky seznamu musí být implicitně převoditelné na typ prvního prvku, což je řazená kolekce členů o délce {0} typu\n {1} \nTento element je řazená kolekce členů o délce {2} typu\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + Pro případ sjednocení, který nepřijímá žádná data, se zahození vzoru nepovoluje. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Neplatné použití generování referenčního sestavení, nepoužívejte --standalone ani --staticlink s --refonly nebo --refout. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Za tímto bodem byl očekáván vzor @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Očekává se vzorek. @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or není v této deklaraci povoleno @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Tento případ sjednocení očekává argumenty {0} ve formě řazené kolekce členů, ale byl zadán {1}. Argumenty chybějícího pole mohou být následující:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Pokud je typ sjednocení s více písmeny struktura, musí mít všechny případy sjednocení jedinečné názvy. Příklad: 'type A = B of b: int | C z c: int diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 06cd9ff43cf..0e49da8710e 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Alle Elemente eines Arrays müssen implizit in den Typ des ersten Elements konvertiert werden. Hierbei handelt es sich um ein Tupel der Länge {0} vom Typ\n {1} \nDieses Element ist ein Tupel der Länge {2} vom Typ\n {3}. \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ Die Dateierweiterung von „{0}“ wurde nicht erkannt. Quelldateien müssen die Erweiterung .fs, .fsi, .fsx oder .fsscript haben + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Doppelter Parameter. Der Parameter „{0}“ wurde in dieser Methode mehrmals verwendet. @@ -57,6 +72,11 @@ Die Verwendung von "incr" aus der F#-Bibliothek ist veraltet. Siehe https://aka.ms/fsharp-refcell-ops. Ändern Sie z. B. "incr cell" in "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" gilt als veraltet. Verwenden Sie stattdessen "AssemblyKeyFileAttribute". @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Alle Verzweigungen eines „If-Ausdrucks“ müssen Werte zurückgeben, die implizit in den Typ der ersten Verzweigung konvertierbar sind. In diesem Fall handelt es sich dabei um ein Tupel der Länge {0} des Typs.\n {1} \nDiese Verzweigung gibt ein Tupel der Länge {2} des Typs\n {3} \nzurück. @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Arithmetische und logische Vorgänge in Literalen zulassen @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Implizites Erweiterungsattribut für deklarierende Typen und Module zulassen @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Löst Fehler für Außerkraftsetzungen nicht virtueller Member aus. @@ -192,6 +212,16 @@ Beim veralteten Zugriff auf das Konstrukt mit dem RequireQualifiedAccess-Attribut wird ein Fehler ausgegeben. + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Escapezeichen mit geschweiften Klammern, bevor FormattableStringFactory.Create aufgerufen wird, wenn ein interpoliertes Zeichenfolgenliteral als FormattableString eingegeben wird. + + more types support units of measure Maßeinheitenunterstützung durch weitere Typen @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + Das Verwerfen von Musterübereinstimmungen ist für einen Union-Fall, der keine Daten akzeptiert, nicht zulässig. @@ -332,6 +362,11 @@ Strukturdarstellung für aktive Muster + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop Platzhalter in for-Schleife @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Alle Verzweigungen eines Musterübereinstimmungsausdrucks müssen Werte zurückgeben, die implizit in den Typ der ersten Verzweigung konvertierbar sind. In diesem Fall handelt es sich dabei um ein Tupel der Länge {0} des Typs.\n {1} \nDiese Verzweigung gibt ein Tupel der Länge {2} des Typs\n {3} \nzurück. @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Der „if“-Ausdruck muss ein Tupel mit der Länge {0} vom Typ\n {1} \nzurückgeben, um die Kontexttypanforderungen zu erfüllen. Derzeit wird ein Tupel mit der Länge {2} vom Typ\n {3} \nzurückgegeben. @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Alle Elemente einer Liste müssen implizit in den Typ des ersten Elements konvertiert werden. Hierbei handelt es sich um ein Tupel der Länge {0} vom Typ\n {1} \nDieses Element ist ein Tupel der Länge {2} vom Typ\n {3}. \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + Das Verwerfen von Mustern ist für Union-Fall, der keine Daten akzeptiert, nicht zulässig. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Ungültige Verwendung der Ausgabe einer Referenzassembly. Verwenden Sie nicht „--standalone“ oder „--staticlink“ mit „--refonly“ oder „--refout“. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Nach diesem Punkt wurde ein Muster erwartet. @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Muster wird erwartet @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or ist in dieser Deklaration nicht zulässig. @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Dieser Union-Fall erwartet {0} Argumente in Tupelform, es wurden jedoch {1} angegeben. Zu den fehlenden Feldargumenten gehören möglicherweise folgende: {2}. @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Wenn ein Mehrfach-Union-Typ eine Struktur ist, müssen alle Union-Fälle eindeutige Namen aufweisen. Beispiel: „type A = B von b: int | C von c: int“. diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 99a18053ef2..10b58cd8a70 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Todos los elementos de una matriz deben convertirse implícitamente en el tipo del primer elemento, que aquí es una tupla de longitud {0} de tipo\n {1} \nEste elemento es una tupla de longitud {2} de tipo\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ No se reconoce la extensión de archivo de '{0}'. Los archivos de código fuente deben tener las extensiones .fs, .fsi, .fsx o .fsscript + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Parámetro duplicado. El parámetro '{0}' se ha usado más una vez en este método. @@ -57,6 +72,11 @@ El uso de "incr" de la biblioteca de F# está en desuso. Vea https://aka.ms/fsharp-refcell-ops. Por ejemplo, cambie "incr cell" a "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. El elemento "AssemblyKeyNameAttribute" está en desuso. Use "AssemblyKeyFileAttribute" en su lugar. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Todas las ramas de una expresión 'if' deben devolver valores implícitamente convertibles al tipo de la primera rama, que aquí es una tupla de longitud {0} de tipo\n {1} \nEsta rama devuelve una tupla de longitud {2} de tipo\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Permitir operaciones aritméticas y lógicas en literales @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Permitir atributo Extension implícito en tipos declarativo, módulos @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Genera errores para invalidaciones de miembros no virtuales @@ -192,6 +212,16 @@ error en el acceso en desuso de la construcción con el atributo RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Crea un escape de llaves antes de llamar a FormattableStringFactory.Create cuando el literal de cadena interpolado se escribe como FormattableString. + + more types support units of measure más tipos admiten las unidades de medida @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + No se permite el descarte de coincidencia de patrón para un caso de unión que no tome datos. @@ -332,6 +362,11 @@ representación de struct para modelos activos + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop carácter comodín en bucle for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Todas las ramas de una expresión de coincidencia de patrón deben devolver valores implícitamente convertibles al tipo de la primera rama, que aquí es una tupla de longitud {0} de tipo\n {1} \nEsta rama devuelve una tupla de longitud {2} de tipo\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + La expresión "if" debe devolver una tupla de longitud {0} de tipo\n {1} \npara satisfacer los requisitos de tipo de contexto. Actualmente devuelve una tupla de longitud {2} de tipo\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Todos los elementos de una lista deben convertirse implícitamente en el tipo del primer elemento, que aquí es una tupla de longitud {0} de tipo\n {1} \nEste elemento es una tupla de longitud {2} de tipo\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + No se permite el descarte de patrón para un caso de unión que no tome datos. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Uso no válido de emisión de un ensamblado de referencia, no use '--standalone or --staticlink' con '--refonly or --refout'. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Se esperaba un patrón después de este punto @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Se espera un patrón @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or no se permite en esta declaración @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Este caso de unión espera {0} argumentos en forma de combinación, pero se han proporcionado {1}. Los argumentos de campo que faltan pueden ser cualquiera de:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Si un tipo de unión multicase es un struct, todos los casos de unión deben tener nombres únicos. Por ejemplo: 'type A = B of b: int | C of c: int'. diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 5dcf19b7252..f59cfd66661 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Tous les éléments d’un tableau doivent être implicitement convertibles en type du premier élément, qui est ici un tuple de longueur {0} de type\n {1} \nCet élément est un tuple de longueur {2} de type\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ L'extension de fichier de '{0}' n'est pas reconnue. Les fichiers sources doivent avoir l'extension .fs, .fsi, .fsx, ou .fsscript. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Paramètre dupliqué. Le paramètre « {0} » a été utilisé une fois de plus dans cette méthode. @@ -57,6 +72,11 @@ L’utilisation de « incr » à partir de la bibliothèque F# est déconseillée. Voir https://aka.ms/fsharp-refcell-ops. Par exemple, veuillez remplacer « incr cell » par « cell.Value <- cell.Value + 1 ». + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' a été déprécié. Utilisez 'AssemblyKeyFileAttribute' à la place. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Toutes les branches d’une expression « if » doivent retourner des valeurs implicitement convertibles au type de la première branche, qui est ici un tuple de longueur {0} de type\n {1} \nCette branche renvoie un tuple de longueur {2} de type\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Autoriser les opérations arithmétiques et logiques dans les littéraux @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Autoriser l’attribut implicite Extension lors de la déclaration des types, modules @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Déclenche des erreurs pour les remplacements de membres non virtuels @@ -192,6 +212,16 @@ donner une erreur sur l’accès déconseillé de la construction avec l’attribut RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Échappe les accolades avant d’appeler FormattableStringFactory.Create lorsque le littéral de chaîne interpolé est tapé en tant que FormattableString. + + more types support units of measure d'autres types prennent en charge les unités de mesure @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + L’abandon des correspondances de modèle n’est pas autorisé pour un cas d’union qui n’accepte aucune donnée. @@ -332,6 +362,11 @@ représentation de structure pour les modèles actifs + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop caractère générique dans une boucle for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Toutes les branches d’une expression de correspondance de motifs doivent retourner des valeurs implicitement convertibles au type de la première branche, qui est ici un tuple de longueur {0} de type\n {1} \nCette branche renvoie un tuple de longueur {2} de type\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + L’expression « if » doit retourner un tuple de longueur {0} de type\n {1} \npour répondre aux exigences de type de contexte. Il retourne actuellement un tuple de longueur {2} de type\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Tous les éléments d’une liste doivent être implicitement convertibles en type du premier élément, qui est ici un tuple de longueur {0} de type\n {1} \nCet élément est un tuple de longueur {2} de type\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + L’abandon de modèle n’est pas autorisé pour un cas d’union qui n’accepte aucune donnée. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Utilisation non valide de l’émission d’un assembly de référence, n’utilisez pas '--standalone ou --staticlink' avec '--refonly ou --refout'. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Modèle attendu après ce point @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Modèle attendu @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or n’est pas autorisé dans cette déclaration @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Ce cas d’union attend des arguments {0} sous forme tuple, mais a reçu {1}. Les arguments de champ manquants peuvent être l’un des suivants : {2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Si un type d’union multi-cas est un struct, alors tous les cas d’union doivent avoir des noms uniques. Par exemple : 'type A = B de b : int | C de c : int'. diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index f04279ca2d2..5a1908c4e75 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Tutti gli elementi di una matrice devono essere convertibili in modo implicito nel tipo del primo elemento, che qui è una tupla di lunghezza {0} di tipo\n {1} \nQuesto elemento è una tupla di lunghezza {2} di tipo\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ Estensione di file di '{0}' non riconosciuta. I file di origine devono avere estensione .fs, .fsi, .fsx or .fsscript + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Parametro duplicato. Il parametro '{0}' è stato utilizzato più volte in questo metodo. @@ -57,6 +72,11 @@ L'uso di 'incr' dalla libreria F # è deprecato. Vedere https://aka.ms/fsharp-refcell-ops. Ad esempio, modificare 'incr cell' in 'cell.Value <- cell.Value + 1'. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. L'attributo 'AssemblyKeyNameAttribute' è deprecato. In alternativa, usare 'AssemblyKeyFileAttribute'. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Tutti i rami di un'espressione 'if' devono restituire valori convertibili in modo implicito nel tipo del primo ramo, che è una tupla di lunghezza {0} di tipo\n {1} \nQuesto ramo restituisce una tupla di lunghezza {2} di tipo\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Consentire operazioni aritmetiche e logiche in valori letterali @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Consentire l'attributo estensione implicito per i tipi dichiarabili, i moduli @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Genera errori per gli override dei membri non virtuali @@ -192,6 +212,16 @@ errore durante l'accesso deprecato del costrutto con l'attributo RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Trasferisce le parentesi graffe prima di chiamare FormattableStringFactory.Create quando il valore letterale stringa interpolato viene digitato come FormattableString + + more types support units of measure più tipi supportano le unità di misura @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + L'eliminazione della corrispondenza dei criteri non è consentita per case di unione che non accetta dati. @@ -332,6 +362,11 @@ rappresentazione struct per criteri attivi + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop carattere jolly nel ciclo for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Tutti i rami di un'espressione di corrispondenza criterio devono restituire valori convertibili in modo implicito nel tipo del primo ramo, che è una tupla di lunghezza {0} di tipo\n {1} \nQuesto ramo restituisce una tupla di lunghezza {2} di tipo\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + L'espressione 'if' deve restituire una tupla di lunghezza {0} di tipo\n {1} \nper soddisfare i requisiti del tipo di contesto. Restituisce attualmente una tupla di lunghezza {2} di tipo\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Tutti gli elementi di un elenco devono essere convertibili in modo implicito nel tipo del primo elemento, che qui è una tupla di lunghezza {0} di tipo\n {1} \nQuesto elemento è una tupla di lunghezza {2} di tipo\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + L'eliminazione del criterio non è consentita per case di unione che non accetta dati. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Utilizzo non valido della creazione di un assembly di riferimento. Non usare insieme '--standalone o --staticlink' con '--refonly o --refout'.. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Previsto un criterio dopo questa posizione @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Criterio previsto @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or non è consentito in questa dichiarazione @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Questo case di unione prevede argomenti {0} in forma tupla, ma è stato specificato {1}. Gli argomenti di campo mancanti possono essere uno dei seguenti: {2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Se un tipo di unione multicase è uno struct, tutti i case di unione devono avere nomi univoci. Ad esempio: 'tipo A = B di b: int | C di c: int'. diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index af8b37d90da..f9e8af34870 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 配列のすべての要素は、最初の要素の型に暗黙的に変換できる必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの要素は、型の長さ {2} のタプルです\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ '{0}' のファイル拡張子は認識されません。ソース ファイルの拡張子は .fs、.fsi、.fsx、または .fsscript にする必要があります。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + パラメーターが重複しています。パラメーター '{0}' は、このメソッドで 1 回以上使用されています。 @@ -57,6 +72,11 @@ F# ライブラリからの 'incr' の使用は非推奨です。https://aka.ms/fsharp-refcell-ops を参照してください。たとえば、'incr cell' を 'cell.Value <- cell.Value +1' に変更してください。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' は非推奨になりました。代わりに 'AssemblyKeyFileAttribute' を使用してください。 @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 'if' 式のすべての分岐は、最初の分岐の型に暗黙的に変換できる値を返す必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの分岐は、型の長さ {2} のタプルを返します\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + リテラルで算術演算と論理演算を許可する @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + 型、モジュールの宣言で暗黙的な拡張属性を許可する @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + 仮想メンバー以外のオーバーライドに対してエラーを発生させます @@ -192,6 +212,16 @@ RequireQualifiedAccess 属性を持つコンストラクトの非推奨アクセスでエラーが発生しました + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + 挿入文字列リテラルが FormattableString として型指定されている場合は、FormattableStringFactory.Create を呼び出す前に波かっこをエスケープします + + more types support units of measure 単位をサポートするその他の型 @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + データを受け取らない共用体ケースでは、パターン一致の破棄は許可されません。 @@ -332,6 +362,11 @@ アクティブなパターンの構造体表現 + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop for ループのワイルド カード @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + パターン一致のすべての分岐は、最初の分岐の型に暗黙的に変換できる値を返す必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの分岐は、型の長さ {2} のタプルを返します\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + 'if' 式は、コンテキスト型の要件を満たすために、\n {1} \n 型の長さの {0} のタプルを返す必要があります。現在、型の {2} 長さのタプルを返します\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + リストのすべての要素は、最初の要素の型に暗黙的に変換できる必要があります。これは、型の長さ {0} のタプルです\n {1} \nこの要素は、型の長さ {2} のタプルです\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + データを受け取らない共用体ケースでは、パターンの破棄は許可されません。 @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + 参照アセンブリの出力の使用が無効です。'--standalone または --staticlink' を '--relabelly または --refout' と共に使用しないでください。 @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + このポイントの後にパターンが必要です @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + 必要なパターン @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or はこの宣言では許可されていません @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + この共用体の場合は、タプル フォームに {0} 個の引数が必要ですが、{1} 個しか渡されませんでした。不足しているフィールド引数は次のいずれかです:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + マルチケース共用体の型が構造体の場合は、すべての共用体ケースに一意の名前を付ける必要があります。例: 'type A = B of b: int | c の C: int'。 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 6e5c423907f..a150456cb49 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 배열의 모든 요소는 첫 번째 요소의 형식으로 암시적으로 변환할 수 있어야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 요소는 형식이 \n {3}이고 길이가 {2}인 튜플입니다. \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ '{0}'의 파일 확장명을 인식할 수 없습니다. 원본 파일의 확장명은 .fs, .fsi, .fsx 또는 .fsscript여야 합니다. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + 매개 변수가 중복되었습니다. 이 메소드에서 매개 변수 '{0}'이(가) 두 번 이상 사용되었습니다. @@ -57,6 +72,11 @@ F# 라이브러리의 'incr' 사용은 더 이상 사용되지 않습니다. https://aka.ms/fsharp-refcell-ops를 참조하세요. 예를 들어 'incr cell'을 'cell.Value <- cell.Value + 1'로 변경하세요. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute'는 사용되지 않습니다. 대신 'AssemblyKeyFileAttribute'를 사용하세요. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 'if' 식의 모든 분기는 첫 번째 분기의 유형으로 암시적으로 변환 가능한 값을 반환해야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 분기는 형식이 \n {3}이고 길이가 {2}인 튜플을 반환합니다. \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + 리터럴에서 산술 및 논리 연산 허용 @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + 유형, 모듈 선언에 암시적 확장 속성 허용 @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + 비가상 멤버 재정의에 대한 오류 발생 @@ -192,6 +212,16 @@ RequireQualifiedAccess 특성을 사용하여 사용되지 않는 구문 액세스에 대한 오류 제공 + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + 보간된 문자열 리터럴이 FormattableString으로 형식화된 경우 FormattableStringFactory.Create를 호출하기 전에 중괄호를 이스케이프합니다. + + more types support units of measure 더 많은 형식이 측정 단위를 지원함 @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + 데이터를 사용하지 않는 공용 구조체 사례에는 패턴 일치 삭제가 허용되지 않습니다. @@ -332,6 +362,11 @@ 활성 패턴에 대한 구조체 표현 + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop for 루프의 와일드카드 @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 패턴 일치 식의 모든 분기는 첫 번째 분기의 유형으로 암시적으로 변환 가능한 값을 반환해야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 분기는 형식이 \n {3}이고 길이가 {2}인 튜플을 반환합니다. \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + 'if' 식은 컨텍스트 유형 요구 사항을 충족하기 위해 형식이\n {1} \n이고 길이가 {0}인 튜플을 반환해야 합니다. 해당 식은 현재 형식이 {3}이고 길이가\n {2}인 튜플을 반환합니다. \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 목록의 모든 요소는 첫 번째 요소의 형식으로 암시적으로 변환할 수 있어야 합니다. 여기서는 형식이 \n {1}이고 길이가 {0}인 튜플입니다. \n이 요소는 형식이 \n {3}이고 길이가 {2}인 튜플입니다. \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + 데이터를 사용하지 않는 공용 구조체 사례에는 패턴 삭제가 허용되지 않습니다. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + 참조 어셈블리 내보내기를 잘못 사용했습니다. '--refonly 또는 --refout'과 함께 '--standalone 또는 --staticlink'를 사용하지 마세요. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + 이 지점 뒤에 패턴이 필요합니다. @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + 예상되는 패턴 @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or는 이 선언에서 허용되지 않습니다. @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + 이 공용 구조체 사례에는 튜플 형식의 {0} 인수가 필요하지만 {1}이(가) 제공되었습니다. 누락된 필드 인수는 다음 중 하나일 수 있습니다.{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + 다중 사례 공용 구조체 형식이 구조체인 경우 모든 공용 구조체 사례의 이름이 고유해야 합니다. 예: 'type A = B of b: int | C 중 C: 정수'. diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 7be1dba85ba..986518d0ee9 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Wszystkie elementy tablicy muszą być niejawnie konwertowalne na typ pierwszego elementu, który w tym miejscu jest krotką o długości {0} typu\n {1} \nTen element jest krotką o długości {2} typu\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ Rozszerzenie pliku "{0}" nie zostało rozpoznane. Pliki źródłowe muszą mieć rozszerzenie .fs, .fsi, .fsx lub .fsscript + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Zduplikowany parametr. Parametr „{0}” został użyty więcej niż raz w tej metodzie. @@ -57,6 +72,11 @@ Użycie elementu „incr” z biblioteki języka F# jest przestarzałe. Sprawdź stronę https://aka.ms/fsharp-refcell-ops. Na przykład zmień wyrażenie „incr cell” na „cell.Value <- cell.Value + 1”. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Element „AssemblyKeyNameAttribute” jest przestarzały. Zamiast niego użyj elementu „AssemblyKeyFileAttribute”. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Wszystkie gałęzie wyrażenia „if” muszą zwracać wartości niejawnie konwertowalne na typ pierwszej gałęzi, która tutaj jest krotką o długości {0} typu\n {1} \nTa gałąź zwraca krotkę o długości {2} typu\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Zezwalaj na operacje arytmetyczne i logiczne w literałach @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Zezwalaj na niejawny atrybut Rozszerzenie dla deklarujących typów, modułów @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Zgłasza błędy w przypadku przesłonięć elementów innych niż wirtualne @@ -192,6 +212,16 @@ wskazywanie błędu w przypadku przestarzałego dostępu do konstrukcji z atrybutem RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Uniknie nawiasów klamrowych przed wywołaniem metody FormattableStringFactory.Create, gdy interpolowany literał ciągu jest wpisywany jako FormattableString + + more types support units of measure więcej typów obsługuje jednostki miary @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + Odrzucenie dopasowania wzorca jest niedozwolone w przypadku unii, która nie pobiera żadnych danych. @@ -332,6 +362,11 @@ reprezentacja struktury aktywnych wzorców + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop symbol wieloznaczny w pętli for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Wszystkie gałęzie wyrażenia dopasowania wzorca muszą zwracać wartości niejawnie konwertowalne na typ pierwszej gałęzi, oto krotka o długości {0} typu\n {1} \nTa Gałąź zwraca krotki o długości {2} typu\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Wyrażenie „if” musi zwrócić krotkę o długości {0} typu\n {1} \naby spełnić wymagania dotyczące typu kontekstu. Obecnie zwraca krotkę o długości {2} typu\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Wszystkie elementy tablicy muszą być niejawnie konwertowalne na typ pierwszego elementu, który w tym miejscu jest krotką o długości {0} typu\n {1} \nTen element jest krotką o długości {2} typu\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + Odrzucanie wzorca jest niedozwolone w przypadku unii, która nie przyjmuje żadnych danych. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Nieprawidłowe użycie emitowania zestawu odwołania. Nie używaj elementu „--standalone ani --staticlink” z elementem „--refonly lub --refout”. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Oczekiwano wzorca po tym punkcie @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Oczekiwano wzorca @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + Element SynType.Or nie jest dozwolony w tej deklaracji @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Ten przypadek unii oczekuje {0} argumentów w formie krotki, ale otrzymano {1}. Brakujące argumenty pola mogą być dowolne z:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Jeśli typ unii wielokaskładnikowej jest strukturą, wszystkie przypadki unii muszą mieć unikatowe nazwy. Na przykład: „typ A = B z b: int | C z c: int”. diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 4150442274d..e4221b5ed1c 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Todos os elementos de uma matriz devem ser implicitamente conversíveis ao tipo do primeiro elemento, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEste elemento é uma tupla de comprimento {2} do tipo\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ A extensão do arquivo de '{0}' não foi reconhecida. Os arquivos de origem devem ter a extensão .fs, .fsi, .fsx or .fsscript + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Parâmetro duplicado. O parâmetro '{0}' foi usado mais de uma vez neste método. @@ -57,6 +72,11 @@ O uso de 'incr' da biblioteca F# foi preterido. Consulte https://aka.ms/fsharp-refcell-ops. Por exemplo, altere a célula 'incr cell' para 'cell.Value <- cell.Value + 1'. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. O 'AssemblyKeyNameAttribute' foi preterido. Use o 'AssemblyKeyFileAttribute'. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Todas as ramificações de uma expressão 'if' devem retornar valores implicitamente conversíveis ao tipo da primeira ramificação, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEsta ramificação retorna uma tupla de comprimento {2} do tipo\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Permitir operações aritméticas e lógicas em literais @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Permitir atributo de Extensão implícito em tipos declarativos, módulos @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Gera erros para substituições de membros não virtuais @@ -192,6 +212,16 @@ fornecer erro no acesso preterido do constructo com o atributo RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Sai das chaves antes de chamar FormattableStringFactory.Create quando o literal de cadeia de caracteres é digitado como FormattableString + + more types support units of measure mais tipos dão suporte para unidades de medida @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + O descarte de correspondência de padrão não é permitido para casos união que não aceitam dados. @@ -332,6 +362,11 @@ representação estrutural para padrões ativos + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop curinga para loop @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Todas as ramificações de uma expressão de correspondência de padrão devem retornar valores implicitamente conversíveis ao tipo da primeira ramificação, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEsta ramificação retorna uma tupla de comprimento {2} do tipo\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Se a expressão 'if' precisa retornar uma tupla de comprimento {0} do tipo\n {1} \npara atender aos requisitos de tipo de contexto. Atualmente, ele retorna uma tupla de comprimento {2} do tipo\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Todos os elementos de uma lista devem ser implicitamente conversíveis ao tipo do primeiro elemento, que aqui é uma tupla de comprimento {0} do tipo\n {1} \nEste elemento é uma tupla de comprimento {2} do tipo\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + O descarte de padrão não é permitido para casos união que não aceitam dados. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Uso inválido da emissão de um assembly de referência, não use '--standalone ou --staticlink' com '--refonly ou --refout'. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Um padrão é esperado após este ponto @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Padrão esperado @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or não é permitido nesta declaração @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Este caso união espera {0} argumentos em formato de tupla, mas recebeu {1}. Os argumentos de campo ausente pode ser:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Se um tipo de união multicase for um struct, todos os casos união deverão ter nomes exclusivos. Por exemplo: tipo A = B de b: int | C de c: int'. diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index aca4bbcae80..1ae14bbb5c1 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Все элементы массива должны поддерживать неявное преобразование в тип первого элемента, который здесь является кортежем длиной {0} типа\n {1} \nЭтот элемент является кортежем длиной {2} типа\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ Расширение файла "{0}" не распознано. Исходные файлы должны иметь расширения FS, FSI, FSX или FSSCRIPT + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Повторяющийся параметр. Параметр "{0}" использовался в этом методе несколько раз. @@ -57,6 +72,11 @@ Использование "incr" из библиотеки F# является нерекомендуемым. См. https://aka.ms/fsharp-refcell-ops. Например, замените "incr cell" на "cell.Value <- cell.Value + 1". + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. Атрибут "AssemblyKeyNameAttribute" является устаревшим. Используйте вместо него атрибут "AssemblyKeyFileAttribute". @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Все ветви выражения "if" должны возвращать значения, поддерживающие неявное преобразование в тип первой ветви, которым здесь является кортеж длиной {0} типа\n {1} \nЭта ветвь возвращает кортеж длиной {2} типа\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Разрешить арифметические и логические операции в литералах @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Разрешить атрибут неявного расширения для объявляющих типов, модулей @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Вызывает ошибки при переопределениях невиртуальных элементов @@ -192,6 +212,16 @@ выдать ошибку при устаревшем доступе к конструкции с атрибутом RequireQualifiedAccess + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + Экранирует фигурные скобки перед вызовом FormattableStringFactory.Create, когда интерполированный строковый литерал введен как FormattableString + + more types support units of measure другие типы поддерживают единицы измерения @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + Отмена сопоставления с шаблоном не разрешена для случая объединения, не принимающего данные. @@ -332,6 +362,11 @@ представление структуры для активных шаблонов + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop подстановочный знак в цикле for @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Все ветви выражения сопоставления с шаблоном должны возвращать значения, поддерживающие неявное преобразование в тип первой ветви, которым здесь является кортеж длиной {0} типа\n {1} \nЭта ветвь возвращает кортеж длиной {2} типа\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Выражение "if" должно возвращать кортеж длиной {0} типа\n {1} \nдля соответствия требованиям к типу контекста. В настоящее время возвращается кортеж длиной {2} типа\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Все элементы списка должны поддерживать неявное преобразование в тип первого элемента, который здесь является кортежем длиной {0} типа\n {1} \nЭтот элемент является кортежем длиной {2} типа\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + Отмена шаблона не разрешена для случая объединения, не принимающего данные. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Недопустимое использование при создании базовой сборки. Не используйте "--standalone or --staticlink" с "--refonly or --refout". @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + После этой точки ожидался шаблон @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Ожидается шаблон @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + SynType.Or не допускается в этом объявлении @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Этот вариант объединения ожидает аргументы {0} в форме кортежа, но было предоставлено: {1}. Отсутствующие аргументы поля могут быть любыми из следующих: {2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Если тип объединения с несколькими регистрами является структурой, все случаи объединения должны иметь уникальные имена. Например: "type A = B of b: int | C of c: int". diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 0e330d1012a..bf35b586795 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Bir dizinin tüm öğeleri örtük olarak ilk öğenin türüne dönüştürülebilir olmalıdır. Burada ilk öğe {0} uzunluğunda türü\n {1} \nolan bir demet. Bu öğe ise {2} uzunluğunda türü\n {3} \nolan bir demet. + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ '{0}' kaynak dosyasının dosya uzantısı tanınmadı. Kaynak dosyaların uzantısı .fs, .fsi, .fsx veya .fsscript olmalıdır. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + Yinelenen parametre. '{0}' parametresi bu metotta bir kereden fazla kullanıldı. @@ -57,6 +72,11 @@ F# kitaplığından gelen 'incr' kullanımı kullanım dışı. https://aka.ms/fsharp-refcell-ops’a bakın. Örneğin, lütfen 'incr cell' ifadesini 'cell.Value <- cell.Value + 1' olarak değiştirin. + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' kullanım dışı bırakıldı. Bunun yerine 'AssemblyKeyFileAttribute' kullanın. @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Bir 'if' ifadesinin tüm dalları, örtük olarak ilk dalın türüne dönüştürülebilir değerler döndürmelidir. Burada ilk dal {0} uzunluğunda türü\n {1} olan bir demet \nBu dal {2} uzunluğunda türü\n {3} \nolan bir demet döndürüyor @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + Sabit değerlerle aritmetik ve mantıksal işlemlere izin ver @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + Türler, modüller bildirirken örtük Extension özniteliğine izin ver @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + Sanal olmayan üyelerde geçersiz kılmalar için hatalar oluştur @@ -192,6 +212,16 @@ RequireQualifiedAccess özniteliğine sahip yapının kullanım dışı erişiminde hata + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + İçe eklenmiş dize sabit değerinin türü FormattableString olduğunda FormattableStringFactory.Create çağrılmadan önce küme ayraçlarını atlar + + more types support units of measure tür daha ölçü birimlerini destekler @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + Veri almayan birleşim durumu için desen eşleştirme atma kullanılamaz. @@ -332,6 +362,11 @@ etkin desenler için yapı gösterimi + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop for döngüsünde joker karakter @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + Bir desen eşleştirme ifadesinin tüm dalları, örtük olarak ilk dalın türüne dönüştürülebilir değerler döndürmelidir. Burada ilk dal {0} uzunluğunda türü\n {1} olan bir demet \nBu dal {2} uzunluğunda türü\n {3} \nolan bir demet döndürüyor @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + Bağlam türü gereksinimlerini karşılaması için 'if' ifadesinin {0} uzunluğunda türü\n {1} \nolan bir demet döndürmesi gerekiyor. Şu anda {2} uzunluğunda türü\n {3} \nolan bir demet döndürüyor @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + Bir listenin tüm öğeleri örtük olarak ilk öğenin türüne dönüştürülebilir olmalıdır. Burada ilk öğe {0} uzunluğunda türü\n {1} \nolan bir demet. Bu öğe ise {2} uzunluğunda türü\n {3} \nolan bir demet. Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + Veri almayan birleşim durumu için desen atma kullanılamaz. @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + Başvuru bütünleştirilmiş kodu oluşturmanın geçersiz kullanımı; '--standalone’ veya ‘--staticlink' seçeneğini '--refonly’ veya ‘--refout' ile birlikte kullanmayın. @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + Bu noktadan sonra bir desen bekleniyordu @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + Desen bekleniyor @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + Bu bildirimde SynType.Or'a izin verilmiyor @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + Bu birleşim durumu demet halinde {0} bağımsız değişken bekliyordu ancak {1} verildi. Eksik alan bağımsız değişkenleri şunlardan biri olabilir:{2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + Çok durumlu bir birleşim türü bir yapıysa, tüm birleşim durumlarının adları benzersiz olmalıdır. Örneğin: 'type A = B of b: int | C of c: int'. diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index c7c7e46a083..84880217177 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 数组的所有元素必须可隐式转换为第一个元素的类型,这是一个长度为 {0} 的类型的元组\n {1} \n此元素是长度为 {2} 类型的元组\n {3} \n + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ 无法识别“{0}”的文件扩展名。源文件必须具有扩展名 .fs、.fsi、.fsx 或 .fsscript + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + 参数重复。此方法中多次使用了参数“{0}”。 @@ -57,6 +72,11 @@ 已弃用 F# 库中的“incr”。请参阅 https://aka.ms/fsharp-refcell-ops。 例如,请将“incr cell”更改为“cell.Value <- cell.Value + 1”。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. "AssemblyKeyNameAttribute" 已被弃用。请改为使用 "AssemblyKeyFileAttribute"。 @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + “if” 表达式的所有分支必须返回可隐式转换为第一个分支类型的值,这是一个长度为 {0} 的类型的元组\n {1} \n此分支会返回长度为 {2} 的类型的元组\n {3} \n @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + 允许在文本中进行算术和逻辑运算 @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + 允许对声明类型、模块使用隐式扩展属性 @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + 引发非虚拟成员替代的错误 @@ -192,6 +212,16 @@ 对具有 RequireQualifiedAccess 属性的构造进行弃用的访问时出错 + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + 当内插字符串文本键入为 FormattableString 时,在调用 FormattableStringFactory.Create 之前转义大括号 + + more types support units of measure 更多类型支持度量单位 @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + 不允许将模式匹配丢弃用于不采用数据的联合事例。 @@ -332,6 +362,11 @@ 活动模式的结构表示形式 + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop for 循环中的通配符 @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 模式匹配表达式的所有分支必须返回可隐式转换为第一个分支类型的值,这是一个长度为 {0} 的类型的元组\n {1} \n此分支会返回长度为 {2} 的类型的元组\n {3} \n @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + “if” 表达式需要返回长度为 {0} 的类型的元组\n {1} \n以满足上下文类型要求。它当前返回了长度为 {2} 的类型的元组\n {3} \n @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 列表的所有元素必须可隐式转换为第一个元素的类型,这是一个长度为 {0} 的类型的元组\n {1} \n此元素是长度为 {2} 类型的元组\n {3} \n Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + 不允许将模式丢弃用于不采用数据的联合事例。 @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + 发出引用程序集的使用无效,请勿将 '--standalone 或 --staticlink' 与 '--refonly 或 --refout' 一起使用。 @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + 此点之后应有一个模式 @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + 预期模式 @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + 此声明中不允许使用 SynType.Or @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + 此联合事例需要元组形式的 {0} 个参数,但提供了 {1} 个。缺少的字段参数可以是 {2} 的任何参数 @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + 如果多事例联合类型是结构,则所有联合事例都必须具有唯一的名称。例如: “type A = B of b: int | C of c: int”。 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 6dd03f28c9d..dd29ebfd8c3 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -4,7 +4,12 @@ All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of an array must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 陣列的所有元素必須以隱含方式轉換成第一個元素的類型,這是類型為\n {1} \n的元組長度 {0}此元素是類型為\n {3} \n的元組長度{2} + + + + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. + The source file '{0}' (at position {1}/{2}) already appeared in the compilation list (at position {3}/{4}). Please verify that it is included only once in the project file. @@ -17,9 +22,19 @@ 無法辨識 '{0}' 的副檔名。來源檔案的副檔名必須是 .fs、.fsi、.fsx 或 .fsscript。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Additional constructor is not allowed. + + + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Constructor with arguments is not allowed. + + Duplicate parameter. The parameter '{0}' has been used more that once in this method. - Duplicate parameter. The parameter '{0}' has been used more that once in this method. + 重複的參數。參數 '{0}' 在此方法中使用多次。 @@ -57,6 +72,11 @@ 透過 F# 程式庫使用 'incr' 的方式已淘汰。請參閱 https://aka.ms/fsharp-refcell-ops。舉例來說,請將 'incr cell' 變更為 'cell.Value <- cell.Value + 1'。 + + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + If a type uses both [<Sealed>] and [<AbstractClass>] attributes, it means it is static. Instance members are not allowed. + + The 'AssemblyKeyNameAttribute' has been deprecated. Use 'AssemblyKeyFileAttribute' instead. 'AssemblyKeyNameAttribute' 已淘汰。請改用 'AssemblyKeyFileAttribute'。 @@ -114,7 +134,7 @@ All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 'if' 運算式的所有分支都傳回可隱含轉換為第一個分支的類型的值,這是類型為\n {1} \n的元組長度 {0}此分支傳回的是類型為\n {3} \n的元組長度 {2} @@ -144,7 +164,7 @@ Allow arithmetic and logical operations in literals - Allow arithmetic and logical operations in literals + 允許常值中的算術和邏輯運算 @@ -159,7 +179,7 @@ Allow implicit Extension attribute on declaring types, modules - Allow implicit Extension attribute on declaring types, modules + 允許宣告類型、模組上的隱含擴充屬性 @@ -184,7 +204,7 @@ Raises errors for non-virtual members overrides - Raises errors for non-virtual members overrides + 引發非虛擬成員覆寫的錯誤 @@ -192,6 +212,16 @@ 對具有 RequireQualifiedAccess 屬性的建構的已取代存取發出錯誤 + + Error reporting on static classes + Error reporting on static classes + + + + Escapes curly braces before calling FormattableStringFactory.Create when interpolated string literal is typed as FormattableString + 當差補字串常值輸入為 FormattableString 時,在呼叫 FormattableStringFactory.Create 之前先逸出大括弧 + + more types support units of measure 更多支援測量單位的類型 @@ -244,7 +274,7 @@ Pattern match discard is not allowed for union case that takes no data. - Pattern match discard is not allowed for union case that takes no data. + 不接受資料的聯集案例不允許模式比對捨棄。 @@ -332,6 +362,11 @@ 現用模式的結構表示法 + + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + Raises warnings when 'let inline ... =' is used together with [<MethodImpl(MethodImplOptions.NoInlining)>] attribute. Function is not getting inlined. + + wild card in for loop for 迴圈中的萬用字元 @@ -344,7 +379,7 @@ All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n - All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is a tuple of length {0} of type\n {1} \nThis branch returns a tuple of length {2} of type\n {3} \n + 模式比對運算式的所有分支都傳回可隱含轉換為第一個分支的類型的值,這是類型為\n {1} \n的元組長度 {0}此分支傳回的是類型為\n {3} \n的元組長度 {2} @@ -389,7 +424,7 @@ The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n - The 'if' expression needs to return a tuple of length {0} of type\n {1} \nto satisfy context type requirements. It currently returns a tuple of length {2} of type\n {3} \n + 'if' 運算式必須傳回類型為\n {1} \n的元組長度{0},才能滿足內容類型需求。目前傳回的是類型為\n {3} \n的元組長度 {2} @@ -454,12 +489,12 @@ All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n - All elements of a list must be implicitly convertible to the type of the first element, which here is a tuple of length {0} of type\n {1} \nThis element is a tuple of length {2} of type\n {3} \n + 清單的所有元素必須以隱含方式轉換成第一個元素的類型,這是類型為\n {1} \n的元組長度 {0}此元素是類型為\n {3} \n的元組長度 {2} Pattern discard is not allowed for union case that takes no data. - Pattern discard is not allowed for union case that takes no data. + 不接受資料的聯集案例不允許模式捨棄。 @@ -544,7 +579,7 @@ Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. - Invalid use of emitting a reference assembly, do not use '--standalone or --staticlink' with '--refonly or --refout'. + 發出參考組件的使用無效,請勿同時使用 '--standalone 或 '--refonly' 和 '--refout'。 @@ -654,7 +689,7 @@ Expected a pattern after this point - Expected a pattern after this point + 在這個點之後必須有模式 @@ -664,7 +699,7 @@ Expecting pattern - Expecting pattern + 必須是模式 @@ -1024,7 +1059,7 @@ SynType.Or is not permitted in this declaration - SynType.Or is not permitted in this declaration + 此宣告中不允許 SynType.Or @@ -3854,7 +3889,7 @@ This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} - This union case expects {0} arguments in tupled form, but was given {1}. The missing field arguments may be any of:{2} + 此聯集案例需要元組格式的 {0} 引數,但提供的是 {1}。遺漏的欄位引數可能是下列任一: {2} @@ -7534,7 +7569,7 @@ If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. - If a multicase union type is a struct, then all union cases must have unique names. For example: 'type A = B of b: int | C of c: int'. + 如果多案例聯集類型是結構,則所有聯集案例都必須有唯一的名稱。例如: 'type A = B of b: int | C of c: int'。 diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 51030b9a0f1..7ebb3c64f7c 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Neshoda typů Očekává se řazená kolekce členů o délce {0} typu\n {1} \nale odevzdala se řazená kolekce členů o délce {2} typu\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Implementace rozhraní by obvykle měly být zadány pro počáteční deklaraci typu. Implementace rozhraní v rozšířeních mohou vést k přístupu ke statickým vazbám před jejich inicializací, ale pouze v případě, že je implementace rozhraní vyvolána během inicializace statických dat a následně umožní přístup ke statickým datům. Toto upozornění můžete odebrat pomocí #nowarn „69“, pokud jste ověřili, že tomu tak není. diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index 0de47ca6214..69473239ef4 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Typenkonflikt. Es wurde ein Tupel der Länge {0} des Typs\n {1} \nerwartet, aber ein Tupel der Länge {2} des Typs\n {3}{4}\n angegeben. @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Die Implementierung von Schnittstellen sollte normalerweise in der ersten Deklaration eines Typs angegeben werden. Schnittstellenimplementierungen in Augmentationen können dazu führen, dass vor der Initialisierung auf statische Bindungen zugegriffen wird. Die gilt allerdings nur, wenn die Schnittstellenimplementierung während der Initialisierung der statischen Daten aufgerufen wird, und wiederum auf die statischen Daten zugreift. Sie können diese Warnung mit #nowarn "69" entfernen, wenn Sie überprüft haben, dass dies nicht der Fall ist. diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 14d81b194e1..2b06bc30aa3 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Error de coincidencia de tipos. Se espera una tupla de longitud {0} de tipo\n {1} \nperero se ha proporcionado una tupla de longitud {2} de tipo\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Normalmente, las implementaciones de interfaz deben proporcionarse en la declaración inicial de un tipo. Las implementaciones de interfaz en aumentos pueden dar lugar al acceso a enlaces estáticos antes de inicializarse, aunque solo si la implementación de interfaz se invoca durante la inicialización de los datos estáticos y, a su vez, obtiene acceso a los datos estáticos. Puede quitar esta advertencia con #nowarn "69" si ha comprobado que este no es el caso. diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 11ad1e48779..cce4c1059b0 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Incompatibilité de type. Tuple de longueur attendu {0} de type\n {1} \nmais tuple de longueur {2} de type\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Les implémentations d’interfaces doivent normalement être fournies lors de la déclaration initiale d’un type. Les implémentations d’interface dans les augmentations peuvent entraîner l’accès à des liaisons statiques avant leur initialisation, mais seulement si l’implémentation de l’interface est invoquée pendant l’initialisation des données statiques, et accède à son tour aux données statiques. Vous pouvez supprimer cet avertissement en utilisant #nowarn « 69 » si vous avez vérifié que ce n’est pas le cas. diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 1dc5fd10514..f2f77ac5fee 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Tipo non corrispondente. È prevista una tupla di lunghezza {0} di tipo\n {1} \n, ma è stata specificata una tupla di lunghezza {2} di tipo\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + In genere, le implementazioni di interfaccia devono essere specificate nella dichiarazione iniziale di un tipo. Le implementazioni di interfaccia negli aumenti possono portare all'accesso ai binding statici prima dell'inizializzazione, anche se l'implementazione dell'interfaccia viene richiamata durante l'inizializzazione dei dati statici e a sua volta accede ai dati statici. È possibile rimuovere questo avviso utilizzando #nowarn "69" se è stato verificato che il caso specifico non lo richiede. diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index f4fb766e2f3..23d92dd03d1 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + 型が一致しません。型の長さ {0} のタプルが必要です\n {1} \nただし、型の長さ {2} のタプルが指定された場合\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + インターフェイスの実装には、通常、最初に型を指定する必要があります。拡張のインターフェイス実装は、初期化前に静的バインディングにアクセスする可能性があります。ただし、静的データの初期化中にインターフェイスの実装が呼び出され、静的データにアクセスする場合のみです。この警告は、#nowarn "69" を使用して削除できます。この点をすでにチェックしている場合は該当しません。 diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index 7836a3d685f..c16c466ebc4 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + 유형 불일치. 형식이 \n {1}이고 길이가 {0}인 튜플이 필요합니다. \n그러나 형식이 \n {3}이고 길이가 {2}인 튜플이 제공되었습니다.{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + 인터페이스 구현은 일반적으로 유형의 초기 선언에 제공되어야 합니다. 확대의 인터페이스 구현은 초기화되기 전에 정적 바인딩에 액세스할 수 있지만 정적 데이터의 초기화 중에 인터페이스 구현이 호출되어 정적 데이터에 액세스하는 경우에만 가능합니다. 사실이 아님을 확인한 경우 #nowarn "69"를 사용하여 이 경고를 제거할 수 있습니다. diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index 45aeb6f00d7..385be4e2a2a 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Niezgodność. Oczekiwano krotki o długości {0} typu\n {1} \nale otrzymano krotkę o długości {2} typu\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Implementacje interfejsu powinny być zwykle podane w początkowej deklaracji typu. Implementacje interfejsu w rozszerzeniach mogą prowadzić do uzyskania dostępu do powiązań statycznych przed ich zainicjowaniem, chociaż tylko wtedy, gdy implementacja interfejsu jest wywoływana podczas inicjowania danych statycznych i z kolei uzyskuje dostęp do danych statycznych. To ostrzeżenie można usunąć przy użyciu #nowarn "69" jeśli zaznaczono, że tak nie jest. diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index 326d8bd9a91..8fa1e1ee33d 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Tipo incompatível. Esperando uma tupla de comprimento {0} do tipo\n {1} \nmas recebeu uma tupla de comprimento {2} do tipo\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + As implementações de interface normalmente devem ser fornecidas na declaração inicial de um tipo. As implementações de interface em aumentos podem levar ao acesso a associações estáticas antes de serem inicializadas, embora somente se a implementação de interface for chamada durante a inicialização dos dados estáticos e, por sua vez, o acesso aos dados estáticos. Você pode remover este aviso usando #nowarn "69" se tiver verificado que não é o caso. diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 4394b1396a4..27b87f0c6b0 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Несоответствие типов. Ожидается кортеж длиной {0} типа\n {1}, \nно предоставлен кортеж длиной {2} типа\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Реализации интерфейса обычно следует указывать при первоначальном объявлении типа. Реализации интерфейса в приращениях могут привести к доступу к статическим привязкам до их инициализации, но только в том случае, если реализация интерфейса вызвана во время инициализации статических данных. Это, в свою очередь, приведет к доступу к статическим данным. Это предупреждение можно удалить с помощью #nowarn "69", если вы убедились, что это не так. diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 54b9570f63e..fe1b018c46e 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + Tür uyuşmazlığı. {0} uzunluğunda türü\n {1} \nolan bir demet bekleniyordu ancak {2} uzunluğunda türü\n {3}{4}\nolan bir demet verildi @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + Arabirim uygulamaları normalde bir türün ilk bildiriminde verilmelidir. Genişletmelerdeki arabirim uygulamaları, başlatılmadan önce statik bağlamalara erişilmesine neden olabilirse de bu yalnızca arabirim uygulaması statik verilerin başlatılması sırasında çağrılmışsa ve buna bağlı olarak statik verilere erişiyorsa olur. Bunun söz konusu olmadığından eminseniz #nowarn "69" seçeneğini kullanarak bu uyarıyı kaldırabilirsiniz. diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index adab29a69b1..89cac4d4d7a 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + 类型不匹配。应为长度为 {0} 的类型的元组\n {1} \n但提供了长度为 {2} 的类型的元组\n {3}{4}\n @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + 通常应在类型的初始声明中提供接口实现。扩充中的接口实现可能会导致在初始化静态绑定之前访问静态绑定,尽管只有在静态数据初始化期间调用了接口实现,并进而访问静态数据时才会发生这种情况。如果已经核实并非如此,则可以使用 #nowarn "69" 移除此警告。 diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index a4e6a9ce8a5..18f0ea682d6 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -4,7 +4,7 @@ Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n - Type mismatch. Expecting a tuple of length {0} of type\n {1} \nbut given a tuple of length {2} of type\n {3} {4}\n + 類型不符。必須是類型為\n {1} \n 的元組長度 {0},但提供的是類型為\n {3}{4}\n 的元組長度 {2} @@ -1564,7 +1564,7 @@ Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. - Interface implementations should normally be given on the initial declaration of a type. Interface implementations in augmentations may lead to accessing static bindings before they are initialized, though only if the interface implementation is invoked during initialization of the static data, and in turn access the static data. You may remove this warning using #nowarn "69" if you have checked this is not the case. + 通常應該在類型的初始宣告上指定介面實作。擴增中的介面實作可能會在初始化之前存取靜態繫結,但只有在初始化靜態資料時叫用介面實作,並依序存取靜態資料。如果您未檢查過這種情況,可以使用 #nowarn 「69」 移除此警告。 diff --git a/src/FSharp.Core/ILLink.LinkAttributes.xml b/src/FSharp.Core/ILLink.LinkAttributes.xml index 3e70f972b8a..e4493298d41 100644 --- a/src/FSharp.Core/ILLink.LinkAttributes.xml +++ b/src/FSharp.Core/ILLink.LinkAttributes.xml @@ -83,6 +83,9 @@ + + + @@ -164,4 +167,4 @@ - \ No newline at end of file + diff --git a/src/FSharp.Core/fslib-extra-pervasives.fs b/src/FSharp.Core/fslib-extra-pervasives.fs index 01fd7018b11..c04d02721f4 100644 --- a/src/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/FSharp.Core/fslib-extra-pervasives.fs @@ -51,10 +51,7 @@ module ExtraTopLevelOperators = makeSafeKey: 'Key -> 'SafeKey, getKey: 'SafeKey -> 'Key ) = -#if NETSTANDARD - static let emptyEnumerator = - (Array.empty> :> seq<_>).GetEnumerator() -#endif + member _.Count = t.Count // Give a read-only view of the dictionary @@ -169,47 +166,8 @@ module ExtraTopLevelOperators = member _.GetEnumerator() = // We use an array comprehension here instead of seq {} as otherwise we get incorrect // IEnumerator.Reset() and IEnumerator.Current semantics. - // Coreclr has a bug with SZGenericEnumerators --- implement a correct enumerator. On desktop use the desktop implementation because it's ngened. -#if !NETSTANDARD let kvps = [| for (KeyValue (k, v)) in t -> KeyValuePair(getKey k, v) |] :> seq<_> kvps.GetEnumerator() -#else - let endIndex = t.Count - - if endIndex = 0 then - emptyEnumerator - else - let kvps = [| for (KeyValue (k, v)) in t -> KeyValuePair(getKey k, v) |] - let mutable index = -1 - - let current () = - if index < 0 then - raise <| InvalidOperationException(SR.GetString(SR.enumerationNotStarted)) - - if index >= endIndex then - raise <| InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished)) - - kvps.[index] - - { new IEnumerator<_> with - member _.Current = current () - interface System.Collections.IEnumerator with - member _.Current = box (current ()) - - member _.MoveNext() = - if index < endIndex then - index <- index + 1 - index < endIndex - else - false - - member _.Reset() = - index <- -1 - interface System.IDisposable with - member _.Dispose() = - () - } -#endif interface System.Collections.IEnumerable with member _.GetEnumerator() = diff --git a/src/FSharp.Core/map.fs b/src/FSharp.Core/map.fs index 9fad005450e..2535dff7522 100644 --- a/src/FSharp.Core/map.fs +++ b/src/FSharp.Core/map.fs @@ -882,6 +882,41 @@ type Map<[] 'Key, [ as that -> + use e1 = (this :> seq<_>).GetEnumerator() + use e2 = (that :> seq<_>).GetEnumerator() + + let rec loop () = + let m1 = e1.MoveNext() + let m2 = e2.MoveNext() + + (m1 = m2) + && (not m1 + || (let e1c = e1.Current + let e2c = e2.Current + + (comparer.Equals(e1c.Key, e2c.Key) + && comparer.Equals(e1c.Value, e2c.Value) + && loop ()))) + + loop () + | _ -> false + + member this.GetHashCode(comparer) = + let combineHash x y = + (x <<< 1) + y + 631 + + let mutable res = 0 + + for (KeyValue (x, y)) in this do + res <- combineHash res (comparer.GetHashCode x) + res <- combineHash res (comparer.GetHashCode y) + + res + interface IEnumerable> with member _.GetEnumerator() = MapTree.mkIEnumerator tree diff --git a/src/FSharp.Core/map.fsi b/src/FSharp.Core/map.fsi index b560950ffbd..abf960909a2 100644 --- a/src/FSharp.Core/map.fsi +++ b/src/FSharp.Core/map.fsi @@ -210,6 +210,7 @@ type Map<[] 'Key, [> interface IEnumerable> interface System.IComparable + interface System.Collections.IStructuralEquatable interface System.Collections.IEnumerable interface IReadOnlyCollection> interface IReadOnlyDictionary<'Key, 'Value> diff --git a/src/FSharp.Core/observable.fsi b/src/FSharp.Core/observable.fsi index bc371965090..b415b7c3086 100644 --- a/src/FSharp.Core/observable.fsi +++ b/src/FSharp.Core/observable.fsi @@ -135,7 +135,6 @@ module Observable = /// let observableNumbers = Observable.ToObservable numbers /// /// let isEvenNumber = fun number -> number % 2 = 0 - /// let initialState = 2 /// /// let leftPartition, rightPartition = /// Observable.partition isEvenNumber observableNumbers diff --git a/src/FSharp.Core/prim-types.fs b/src/FSharp.Core/prim-types.fs index 604abae7688..675f6d5221c 100644 --- a/src/FSharp.Core/prim-types.fs +++ b/src/FSharp.Core/prim-types.fs @@ -3912,6 +3912,16 @@ namespace Microsoft.FSharp.Collections type List<'T> = | ([]) : 'T list | ( :: ) : Head: 'T * Tail: 'T list -> 'T list + member private this.CustomHashCode(c:IEqualityComparer) = + let rec loop l acc position = + match l with + | [] -> acc + | h::t -> + let hashOfH = GenericHashWithComparer c h + let acc = LanguagePrimitives.HashCompare.HashCombine position acc hashOfH + loop t acc (position+1) + + loop this 0 0 interface IEnumerable<'T> interface IEnumerable interface IReadOnlyCollection<'T> diff --git a/src/FSharp.Core/result.fsi b/src/FSharp.Core/result.fsi index 2641fd1eff3..837f8b4d06c 100644 --- a/src/FSharp.Core/result.fsi +++ b/src/FSharp.Core/result.fsi @@ -281,7 +281,7 @@ module Result = /// /// [] - val toList: result: Result<'T, 'Error> -> List<'T> + val toList: result: Result<'T, 'Error> -> 'T list /// Convert the result to an Option value. /// @@ -296,7 +296,7 @@ module Result = /// /// [] - val toOption: result: Result<'T, 'Error> -> Option<'T> + val toOption: result: Result<'T, 'Error> -> 'T option /// Convert the result to an Option value. /// @@ -311,4 +311,4 @@ module Result = /// /// [] - val toValueOption: result: Result<'T, 'Error> -> ValueOption<'T> + val toValueOption: result: Result<'T, 'Error> -> 'T voption diff --git a/src/FSharp.Core/set.fs b/src/FSharp.Core/set.fs index f04cc12433e..4a1b9b42f57 100644 --- a/src/FSharp.Core/set.fs +++ b/src/FSharp.Core/set.fs @@ -872,7 +872,7 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' member x.ToArray() = SetTree.toArray x.Tree - member this.ComputeHashCode() = + member private this.ComputeHashCode() = let combineHash x y = (x <<< 1) + y + 631 @@ -904,6 +904,32 @@ type Set<[] 'T when 'T: comparison>(comparer: IComparer<' member this.CompareTo(that: obj) = SetTree.compare this.Comparer this.Tree ((that :?> Set<'T>).Tree) + interface IStructuralEquatable with + member this.Equals(that, comparer) = + match that with + | :? Set<'T> as that -> + use e1 = (this :> seq<_>).GetEnumerator() + use e2 = (that :> seq<_>).GetEnumerator() + + let rec loop () = + let m1 = e1.MoveNext() + let m2 = e2.MoveNext() + (m1 = m2) && (not m1 || ((comparer.Equals(e1.Current, e2.Current)) && loop ())) + + loop () + | _ -> false + + member this.GetHashCode(comparer) = + let combineHash x y = + (x <<< 1) + y + 631 + + let mutable res = 0 + + for x in this do + res <- combineHash res (comparer.GetHashCode(x)) + + res + interface ICollection<'T> with member s.Add x = ignore x diff --git a/src/FSharp.Core/set.fsi b/src/FSharp.Core/set.fsi index b1c51c87afb..f1c2fd291c2 100644 --- a/src/FSharp.Core/set.fsi +++ b/src/FSharp.Core/set.fsi @@ -229,6 +229,7 @@ type Set<[] 'T when 'T: comparison> = interface IEnumerable<'T> interface System.Collections.IEnumerable interface System.IComparable + interface System.Collections.IStructuralEquatable interface IReadOnlyCollection<'T> override Equals: obj -> bool diff --git a/src/FSharp.Core/tasks.fs b/src/FSharp.Core/tasks.fs index a52cae27310..13eb2a43a59 100644 --- a/src/FSharp.Core/tasks.fs +++ b/src/FSharp.Core/tasks.fs @@ -459,7 +459,7 @@ module MediumPriority = computation: Async<'TResult1>, continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ) : TaskCode<'TOverall, 'TResult2> = - this.Bind(Async.StartAsTask computation, continuation) + this.Bind(Async.StartImmediateAsTask computation, continuation) member inline this.ReturnFrom(computation: Async<'T>) : TaskCode<'T, 'T> = - this.ReturnFrom(Async.StartAsTask computation) + this.ReturnFrom(Async.StartImmediateAsTask computation) diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf index fe16dc84f65..1efc72d39cc 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.cs.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Nalezené klíčem registru AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Nalezené klíčem registru AssemblyFolders Global Assembly Cache - Global Assembly Cache + Globální mezipaměť sestavení .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf index 0980cec838a..4f0a70cd829 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.de.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Von AssemblyFoldersEx-Registrierungsschlüssel gefunden Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Von AssemblyFolders-Registrierungsschlüssel gefunden Global Assembly Cache - Global Assembly Cache + Globaler Assemblycache .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf index ae938d2cacd..975fc66a829 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.es.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Encontrado por la clave del Registro AssemblyFoldersEx. Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Encontrado por la clave del Registro AssemblyFolders. Global Assembly Cache - Global Assembly Cache + Caché global de ensamblados .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf index 7fe41477230..a34c9a39ee7 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.fr.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Trouvée par la clé de Registre AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Trouvée par la clé de Registre AssemblyFolders Global Assembly Cache - Global Assembly Cache + Global Assembly Cache .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf index d20390cc87e..22d36262342 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.it.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Trovata mediante chiave del Registro di sistema AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Trovata mediante la chiave del Registro di sistema AssemblyFolders Global Assembly Cache - Global Assembly Cache + Global Assembly Cache .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf index 2f2fbca84a3..a47832b3e62 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ja.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + AssemblyFoldersEx レジストリ キーによって検出されました Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + AssemblyFolders レジストリ キーによって検出されました Global Assembly Cache - Global Assembly Cache + グローバル アセンブリ キャッシュ .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf index a57ff6c0dc3..48bdb97ec18 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ko.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + AssemblyFoldersEx 레지스트리 키로 찾았습니다. Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + AssemblyFolders 레지스트리 키로 찾았습니다. Global Assembly Cache - Global Assembly Cache + 전역 어셈블리 캐시 .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf index 49133a8479c..8b27ac86275 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pl.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Znalezione przez klucz rejestru AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Znalezione przez klucz rejestru AssemblyFolders Global Assembly Cache - Global Assembly Cache + Globalna pamięć podręczna zestawów .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf index fbfa95dbf16..8247129a519 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.pt-BR.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Localizada pela chave de registro AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Localizada pela chave de registro AssemblyFolders Global Assembly Cache - Global Assembly Cache + Cache de Assembly Global .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf index c01f76a7296..4b4d86b480c 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.ru.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + Найдено по разделу реестра AssemblyFoldersEx Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + Найдено по разделу реестра AssemblyFolders Global Assembly Cache - Global Assembly Cache + Глобальный кэш сборок .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf index 3131d7674af..f018b6eb8a3 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.tr.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + AssemblyFoldersEx kayıt defteri anahtarı ile bulunur Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + AssemblyFolders kayıt defteri anahtarı ile bulunur Global Assembly Cache - Global Assembly Cache + Genel Bütünleştirilmiş Kod Önbelleği .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf index 7791accdff9..933560fc589 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hans.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + 已由 AssemblyFoldersEx 注册表项找到 Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + 已由 AssemblyFolders 注册表项找到 Global Assembly Cache - Global Assembly Cache + 全局程序集缓存 .NET Framework - .NET Framework + .NET Framework diff --git a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf index 52a305821cf..f01e41cc97e 100644 --- a/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf +++ b/src/LegacyMSBuildResolver/xlf/LegacyResolver.txt.zh-Hant.xlf @@ -4,22 +4,22 @@ Found by AssemblyFoldersEx registry key - Found by AssemblyFoldersEx registry key + 依 AssemblyFoldersEx 登錄機碼找到 Found by AssemblyFolders registry key - Found by AssemblyFolders registry key + 依 AssemblyFolders 登錄機碼找到 Global Assembly Cache - Global Assembly Cache + 全域組件快取 .NET Framework - .NET Framework + .NET Framework diff --git a/src/fsi/console.fs b/src/fsi/console.fs index b64849394d3..4e68d2aea0b 100644 --- a/src/fsi/console.fs +++ b/src/fsi/console.fs @@ -104,6 +104,103 @@ module internal Utils = | ' ', false -> nextWordFromIdx line (idx + 1, false) | _, _ -> nextWordFromIdx line (idx + 1, true) + /// An array stores ranges of full-width chars. + /// + /// The ranges are sorted by increasing order in the array, and each range are stored in the 2nth and 2n+1th + /// position in the array (n is the ordinal number of the range) + /// + /// Array [| a; b; c; d |] represents range [a, b] or [c, d], means chars in these ranges are full-width. + /// + /// Definition: https://www.unicode.org/reports/tr11/ + /// + /// Data source: https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt + let private fullWidthCharRanges = + Array.concat + [| + [| '\u1100'; '\u115f' |] + [| '\u231a'; '\u231b' |] + [| '\u2329'; '\u232a' |] + [| '\u23e9'; '\u23ec' |] + [| '\u23f0'; '\u23f0' |] + [| '\u23f3'; '\u23f3' |] + [| '\u25fd'; '\u25fe' |] + [| '\u2614'; '\u2615' |] + [| '\u2648'; '\u2653' |] + [| '\u267f'; '\u267f' |] + [| '\u2693'; '\u2693' |] + [| '\u26a1'; '\u26a1' |] + [| '\u26aa'; '\u26ab' |] + [| '\u26bd'; '\u26be' |] + [| '\u26c4'; '\u26c5' |] + [| '\u26ce'; '\u26ce' |] + [| '\u26d4'; '\u26d4' |] + [| '\u26ea'; '\u26ea' |] + [| '\u26f2'; '\u26f3' |] + [| '\u26f5'; '\u26f5' |] + [| '\u26fa'; '\u26fa' |] + [| '\u26fd'; '\u26fd' |] + [| '\u2705'; '\u2705' |] + [| '\u270a'; '\u270b' |] + [| '\u2728'; '\u2728' |] + [| '\u274c'; '\u274c' |] + [| '\u274e'; '\u274e' |] + [| '\u2753'; '\u2755' |] + [| '\u2757'; '\u2757' |] + [| '\u2795'; '\u2797' |] + [| '\u27b0'; '\u27b0' |] + [| '\u27bf'; '\u27bf' |] + [| '\u2b1b'; '\u2b1c' |] + [| '\u2b50'; '\u2b50' |] + [| '\u2b55'; '\u2b55' |] + [| '\u2e80'; '\u303e' |] + [| '\u3041'; '\u3096' |] + [| '\u3099'; '\u30ff' |] + [| '\u3105'; '\u312f' |] + [| '\u3131'; '\u318e' |] + [| '\u3190'; '\u3247' |] + [| '\u3250'; '\u4dbf' |] + [| '\u4e00'; '\ua4c6' |] + [| '\ua960'; '\ua97c' |] + [| '\uac00'; '\ud7a3' |] + [| '\uf900'; '\ufaff' |] + [| '\ufe10'; '\ufe1f' |] + [| '\ufe30'; '\ufe6b' |] + [| '\uff01'; '\uff60' |] + [| '\uffe0'; '\uffe6' |] + |] + + let isFullWidth (char) = + // for array [| a; b; c; d |], + // if a value is in (a, b) or (c, d), the result of Array.BinarySearch will be a negative even number + // if a value is a, b, c, d, the result will be a positive number + let n = Array.BinarySearch(fullWidthCharRanges, char) + n >= 0 || n % 2 = 0 + + /// Limits BufferWidth to make sure that full-width characters will not be print to wrong position. + /// + /// The return value is Console.BufferWidth - 2. + /// + /// When printing full-width characters to the screen (such as 一二三四五六七八九零), + /// + /// if BufferWidth = Console.BufferWidth, the output will be + /// + /// #> 一二三四五六七八九零一二三四五六七八九 # (零 is missing) + /// + /// #一二三四五六七八九零 # + /// + /// if BufferWidth = Console.BufferWidth - 1, the output will be + /// + /// #> 一二三四五六七八九零一二三四五六七八九零# (零 is printed, but will not correctly cauculate cursor position) + /// + /// #一二三四五六七八九零 # (cursor may appear in the middle of the character) + /// + /// if BufferWidth = Console.BufferWidth - 2, the output will be + /// + /// #> 一二三四五六七八九零一二三四五六七八九 # + /// + /// #零一二三四五六七八九零 # (work correctly) + let bufferWidth () = Console.BufferWidth - 2 + [] type internal Cursor = static member ResetTo(top, left) = @@ -111,14 +208,12 @@ type internal Cursor = Console.CursorTop <- min top (Console.BufferHeight - 1) Console.CursorLeft <- left) - static member Move(inset, delta) = - let position = - Console.CursorTop * (Console.BufferWidth - inset) - + (Console.CursorLeft - inset) - + delta + static member Move(delta) = + let width = Utils.bufferWidth () + let position = Console.CursorTop * width + Console.CursorLeft + delta - let top = position / (Console.BufferWidth - inset) - let left = inset + position % (Console.BufferWidth - inset) + let top = position / width + let left = position % width Cursor.ResetTo(top, left) type internal Anchor = @@ -137,8 +232,11 @@ type internal Anchor = member p.PlaceAt(inset, index) = //printf "p.top = %d, p.left = %d, inset = %d, index = %d\n" p.top p.left inset index - let left = inset + (((p.left - inset) + index) % (Console.BufferWidth - inset)) - let top = p.top + ((p.left - inset) + index) / (Console.BufferWidth - inset) + let width = Utils.bufferWidth () + let index = inset + index + + let left = index % width + let top = p.top + index / width Cursor.ResetTo(top, left) type internal ReadLineConsole() = @@ -209,7 +307,9 @@ type internal ReadLineConsole() = | _ -> "^?" member x.GetCharacterSize(c) = - if Char.IsControl(c) then x.MapCharacter(c).Length else 1 + if Char.IsControl(c) then x.MapCharacter(c).Length + elif Utils.isFullWidth c then 2 + else 1 static member TabSize = 4 @@ -242,19 +342,21 @@ type internal ReadLineConsole() = /// Cache of optionsCache let mutable optionsCache = Options() + let moveCursorToNextLine c = + let charSize = x.GetCharacterSize(c) + + if Console.CursorLeft + charSize > Utils.bufferWidth () then + if Console.CursorTop + 1 = Console.BufferHeight then + Console.BufferHeight <- Console.BufferHeight + 1 + + Cursor.Move(0) + let writeBlank () = + moveCursorToNextLine (' ') Console.Write(' ') - checkLeftEdge false let writeChar (c) = - if - Console.CursorTop = Console.BufferHeight - 1 - && Console.CursorLeft = Console.BufferWidth - 1 - then - //printf "bottom right!\n" - anchor <- { anchor with top = (anchor).top - 1 } - - checkLeftEdge true + moveCursorToNextLine (c) if Char.IsControl(c) then let s = x.MapCharacter c @@ -262,9 +364,7 @@ type internal ReadLineConsole() = rendered <- rendered + s.Length else Console.Write(c) - rendered <- rendered + 1 - - checkLeftEdge true + rendered <- rendered + x.GetCharacterSize(c) /// The console input buffer. let input = new StringBuilder() @@ -273,25 +373,16 @@ type internal ReadLineConsole() = let mutable current = 0 let render () = - //printf "render\n" let curr = current anchor.PlaceAt(x.Inset, 0) - let output = new StringBuilder() - let mutable position = -1 - - for i = 0 to input.Length - 1 do - if (i = curr) then - position <- output.Length - - let c = input.Chars(i) - if (Char.IsControl c) then - output.Append(x.MapCharacter c) |> ignore + let rec getLineWidth state i = + if i = curr || i = input.Length then + state else - output.Append(c) |> ignore + getLineWidth (state + x.GetCharacterSize(input.Chars i)) (i + 1) - if (curr = input.Length) then - position <- output.Length + let position = getLineWidth 0 0 // render the current text, computing a new value for "rendered" let old_rendered = rendered @@ -326,13 +417,13 @@ type internal ReadLineConsole() = if current > 0 && (current - 1 < input.Length) then current <- current - 1 let c = input.Chars(current) - Cursor.Move(x.Inset, -x.GetCharacterSize c) + Cursor.Move(-x.GetCharacterSize c) let moveRight () = if current < input.Length then let c = input.Chars(current) current <- current + 1 - Cursor.Move(x.Inset, x.GetCharacterSize c) + Cursor.Move(x.GetCharacterSize c) let moveWordLeft () = if current > 0 && (current - 1 < input.Length) then diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/sourceFiles.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/sourceFiles.fs new file mode 100644 index 00000000000..9f467df00cd --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/sourceFiles.fs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +module FSharp.Compiler.ComponentTests.CompilerOptions.FscSourceFilesArguments + +open Xunit +open FSharp.Test +open FSharp.Test.Compiler + + +[] +let ``Reports duplicate sources via warning``() = + let file = SourceCodeFileKind.Fs({FileName="test.fs"; SourceText=Some """printfn "Hello" """ }) + + fsFromString file + |> FS + |> asExe + |> withAdditionalSourceFile file + |> compile + |> withWarningCodes [3551] + |> withErrorCodes [] \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs index dcdd57b4000..604071cc694 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/times/times.fs @@ -5,6 +5,8 @@ namespace FSharp.Compiler.ComponentTests.CompilerOptions.fsc open Xunit open FSharp.Test open FSharp.Test.Compiler +open System +open System.IO module times = @@ -47,3 +49,46 @@ module times = |> withDiagnosticMessageMatches "Unrecognized option: '--times\+'" |> ignore + [] + let ``times - to console`` compilation = + let oldConsole = Console.Out + let sw = new StringWriter() + Console.SetOut(sw) + use _ = {new IDisposable with + member this.Dispose() = Console.SetOut(oldConsole) } + + compilation + |> asFsx + |> withOptions ["--times"] + |> ignoreWarnings + |> compile + |> shouldSucceed + |> ignore + + let consoleContents = sw.ToString() + Assert.Contains("Parse inputs",consoleContents) + Assert.Contains("Typecheck",consoleContents) + Assert.Contains("GC0",consoleContents) + Assert.Contains("Duration",consoleContents) + + + [] + let ``times - to csv file`` compilation = + let tempPath = Path.Combine(Path.GetTempPath(),Guid.NewGuid().ToString() + ".csv") + use _ = {new IDisposable with + member this.Dispose() = File.Delete(tempPath) } + + compilation + |> asFsx + |> withOptions ["--times:"+tempPath] + |> ignoreWarnings + |> compile + |> shouldSucceed + |> ignore + + let csvContents = File.ReadAllLines(tempPath) + + Assert.Contains("Name,StartTime,EndTime,Duration(s),Id,ParentId,RootId",csvContents[0]) + Assert.Contains(csvContents, fun row -> row.Contains("Typecheck")) + Assert.Contains(csvContents, fun row -> row.Contains("Parse inputs")) + diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs index a328c5f3df2..44f84521e36 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/TypesAndTypeConstraints/IWSAMsAndSRTPs/IWSAMsAndSRTPsTests.fs @@ -320,6 +320,28 @@ module ``Equivalence of properties and getters`` = IL_000e: ret }"""] +module ``Type checking behavior`` = + + #if !NETCOREAPP + [] + #else + [] + [] + [] + #endif + let ``Extension method on interface without SAM does not produce a warning`` version = + Fsx """ + type INormalInterface = + abstract member IntMember: int + + module INormalInterfaceExtensions = + type INormalInterface with + static member ExtMethod (a: INormalInterface) = + () + """ + |> withLangVersion version + |> compile + |> shouldSucceed module Negative = @@ -375,7 +397,6 @@ module Negative = |> withDiagnosticMessage "The trait 'A' invoked by this call has multiple support types. This invocation syntax is not permitted for such traits. See https://aka.ms/fsharp-srtp for guidance." |> ignore - module InvocationBehavior = [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.NoInlining_InlineKeyword.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.NoInlining_InlineKeyword.fs new file mode 100644 index 00000000000..b40e3a3f8e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.NoInlining_InlineKeyword.fs @@ -0,0 +1,3 @@ +module M +[] +let inline getUnit (f : unit -> unit) = f() \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs index 51f758b7f47..183be7e87b9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/MethodImplAttribute/MethodImplAttribute.fs @@ -33,6 +33,20 @@ module MethodImplAttribute = let ``NoInlining_fs`` compilation = compilation |> verifyCompilation + + [] + let ``NoInlining_fs with inline keyword => should warn in preview version`` compilation = + compilation + |> withLangVersionPreview + |> typecheck + |> withSingleDiagnostic (Warning 3151, Line 2, Col 1, Line 3, Col 38, "This member, function or value declaration may not be declared 'inline'") + + [] + let ``NoInlining_fs with inline keyword => should not warn in F# 7 or older`` compilation = + compilation + |> withLangVersion70 + |> typecheck + |> withDiagnostics [] // SOURCE=MethodImplAttribute.AggressiveInlining.fs SCFLAGS="-a -g --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplAttribute.AggressiveInlining.dll" # MethodImplAttribute.AggressiveInlining.fs [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/UnionTypeWithSignature02.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/UnionTypeWithSignature02.fs index f0d289ff540..92daf21dfd1 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/UnionTypeWithSignature02.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Structure/UnionTypeWithSignature02.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:4040 // "Signature files do not prevent compiler-generated public constructors from leaking out of discriminated unions" // Note that the corresponsing .fsi file is NOT missing the "| C of int" part of the DU -namespace N +module N type T = | C of int diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index 7627368cc57..3a00acd4d02 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -173,9 +173,11 @@ + + @@ -198,6 +200,7 @@ + diff --git a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs index 1afd0d56220..562df051904 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs +++ b/tests/FSharp.Compiler.ComponentTests/FSharpChecker/CommonWorkflows.fs @@ -89,3 +89,13 @@ let ``Changes in a referenced project`` () = saveFile "Library" checkFile "Last" expectSignatureChanged } + +[] +let ``Language service works if the same file is listed twice`` () = + let file = sourceFile "First" [] + let project = SyntheticProject.Create(file) + project.Workflow { + checkFile "First" expectOk + addFileAbove "First" file + checkFile "First" (expectSingleWarningAndNoErrors "Please verify that it is included only once in the project file.") + } \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs index 52a4ccabe4c..fa1c8c49b42 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/ComputationExpressionTests.fs @@ -92,4 +92,47 @@ let x = lb {1; 2; if true then 3;} |> compile |> shouldFail |> withSingleDiagnostic (Error 708, Line 10, Col 19, Line 10, Col 31, "This control construct may only be used if the computation expression builder defines a 'Zero' method") - |> ignore \ No newline at end of file + |> ignore + + [] + [] + [] + [] + [] + [] + let ``A CE with BindReturn and Zero can omit else in an if-then return`` (langVersion, bindReturnName) = + let code = $""" +type Builder () = + member inline __.Return (x: 'T) = Seq.singleton x + member inline __.Bind (p: seq<'T>, rest: 'T->seq<'U>) = Seq.collect rest p + member inline __.Zero () = Seq.empty + member inline __.%s{bindReturnName} (x : seq<'T>, f: 'T -> 'U) = Seq.map f x + +let seqbuilder= new Builder () + +let _pythags = seqbuilder {{ + let! z = seq [5;10] + if (z > 6) then return (z,z) }} """ + code + |> FSharp + |> withLangVersion langVersion + |> typecheck + |> shouldSucceed + + [] + let ``A CE with BindReturn and Zero can work without Return if flow control is not used`` () = + let code = $""" +type Builder () = + member inline __.Bind (p: seq<'T>, rest: 'T->seq<'U>) = Seq.collect rest p + //member inline __.Zero () = Seq.empty + member inline __.BindReturn (x : seq<'T>, f: 'T -> 'U) = Seq.map f x + +let seqbuilder= new Builder () + +let _pythags = seqbuilder {{ + let! z = seq [5;10] + return (z,z) }} """ + code + |> FSharp + |> typecheck + |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/DynamicAssignmentOperatorTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/DynamicAssignmentOperatorTests.fs new file mode 100644 index 00000000000..69525f0ef38 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/DynamicAssignmentOperatorTests.fs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.ComponentTests.Language + +open System +open Xunit +open FSharp.Test.Compiler + +module DynamicAssignmentOperatorTests = + + [] + [] + [] + let ``Implementing dynamic assignment operator does not produce a warning`` version = + Fsx """ + type T = T with + static member inline (?<-) (f, x, y) = f x y + """ + |> withLangVersion version + |> compile + |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs index db431a6386c..c51836e105a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs +++ b/tests/FSharp.Compiler.ComponentTests/Language/InterpolatedStringsTests.fs @@ -32,8 +32,19 @@ let c: System.IFormattable = $"string" |> compile |> shouldSucceed + [] + let ``Interpolated string literal typed as FormattableString handles double braces correctly`` () = + Fsx """ +let a = $"{{hello}} world" : System.FormattableString +printf $"{a.Format}" + """ + |> withLangVersionPreview + |> compileExeAndRun + |> shouldSucceed + |> withStdOutContains "{{hello}} world" + [] let ``Percent sign characters in interpolated strings`` () = Assert.Equal("%", $"%%") Assert.Equal("42%", $"{42}%%") - Assert.Equal("% 42", $"%%%3d{42}") \ No newline at end of file + Assert.Equal("% 42", $"%%%3d{42}") diff --git a/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs new file mode 100644 index 00000000000..b6a2f32e2f1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/Language/StaticClassTests.fs @@ -0,0 +1,255 @@ +namespace FSharp.Compiler.ComponentTests.Language + +open Xunit +open FSharp.Test.Compiler + +module StaticClassTests = + + [] + let ``Sealed and AbstractClass on a type in lang version70`` () = + Fsx """ +[] +type T = class end + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type in lang preview`` () = + Fsx """ +[] +type T = class end + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with constructor in lang preview`` () = + Fsx """ +[] +type T() = class end + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with constructor in lang version70`` () = + Fsx """ +[] +type T() = class end + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with constructor with arguments in lang preview`` () = + Fsx """ +[] +type T(x: int) = class end + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3552, Line 3, Col 8, Line 3, Col 14, "If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed.") + ] + + [] + let ``Sealed and AbstractClass on a type with constructor with arguments in lang version70`` () = + Fsx """ +[] +type T(x: int) = class end + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``When Sealed and AbstractClass on a type with additional constructors in lang preview`` () = + Fsx """ +[] +type T = + new () = {} + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3553, Line 4, Col 5, Line 4, Col 16, "If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed.") + ] + + [] + let ``When Sealed and AbstractClass on a type with additional constructors in lang version70`` () = + Fsx """ +[] +type T = + new () = {} + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``When Sealed and AbstractClass on a type with a primary(parameters) and additional constructor in lang preview`` () = + Fsx """ +[] +type T(x: int) = + new () = T(42) + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3552, Line 3, Col 8, Line 3, Col 14, "If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed.") + (Error 3553, Line 4, Col 5, Line 4, Col 19, "If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed.") + ] + + [] + let ``When Sealed and AbstractClass on a type with explicit fields and constructor in lang version70`` () = + Fsx """ +[] +type B = + val F : int + val mutable G : int + new () = { F = 3; G = 3 } + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + [] + let ``When Sealed and AbstractClass on a generic type with constructor in lang version70`` () = + Fsx """ +[] +type ListDebugView<'T>(l: 'T list) = class end + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``When Sealed and AbstractClass on a generic type with constructor in lang preview`` () = + Fsx """ +[] +type ListDebugView<'T>(l: 'T list) = class end + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3552, Line 3, Col 24, Line 3, Col 34, "If a type uses both [] and [] attributes, it means it is static. Constructor with arguments is not allowed.") + ] + + [] + let ``When Sealed and AbstractClass on a type with explicit fields and constructor in lang preview`` () = + Fsx """ +[] +type B = + val F : int + val mutable G : int + new () = { F = 3; G = 3 } + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3553, Line 6, Col 5, Line 6, Col 30, "If a type uses both [] and [] attributes, it means it is static. Additional constructor is not allowed.") + ] + + [] + [] + [] + let ``Mutually recursive type definition that using custom attributes``(langVersion) = + let code = """ + module Test + + open System.Diagnostics + + [] + [>)>] + [] + [] + type MyCustomList<'T> = + | Empty + | NonEmpty of Head: 'T * Tail: MyCustomList<'T> + + and MyImbaAlias<'T> = MyCustomList<'T> + + //------------------------------------------------------------------------- + // List (debug view) + //------------------------------------------------------------------------- + + and + MyCustomListDebugView<'T>(l: MyCustomList<'T>) = + let asList = + let rec toList ml = + match ml with + | Empty -> [] + | NonEmpty (head,tail) -> head :: (toList tail) + toList l + + [] + member x.Items = asList |> List.toArray + + [] + member x._FullList = asList |> List.toArray + + """ + Fs code + |> withLangVersion langVersion + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with instance members in lang version70`` () = + Fsx """ +[] +type T() = + member this.M() = () + static member X = 1 + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with instance members in lang preview`` () = + Fsx """ +[] +type T() = + member this.M() = () + static member X = 1 + """ + |> withLangVersionPreview + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3554, Line 4, Col 5, Line 4, Col 25, "If a type uses both [] and [] attributes, it means it is static. Instance members are not allowed.") + ] + + [] + let ``Sealed and AbstractClass on a type with static members in lang version70`` () = + Fsx """ +[] +type T() = + static member M() = () + static member X = T.M() + """ + |> withLangVersion70 + |> compile + |> shouldSucceed + + [] + let ``Sealed and AbstractClass on a type with static members in lang preview`` () = + Fsx """ +[] +type T() = + static member M() = () + static member X = T.M() + """ + |> withLangVersionPreview + |> compile + |> shouldSucceed \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs b/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs index faf21a9c7a9..cfc86ff3618 100644 --- a/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs +++ b/tests/FSharp.Compiler.ComponentTests/Scripting/Interactive.fs @@ -3,6 +3,7 @@ namespace FSharp.Compiler.ComponentTests.Scripting open Xunit +open System open FSharp.Test.Compiler module ``Interactive tests`` = @@ -35,3 +36,17 @@ module ``External FSI tests`` = Fsx "1+a" |> runFsi |> shouldFail + + + [] + let ``Internals visible over a large number of submissions``() = + let submission = + let lines = [| + yield """let internal original_submission = "From the first submission";;""" + Environment.NewLine + for _ in 1 .. 200 do yield """if original_submission <> "From the first submission" then failwith $"Failed to read an internal at line: {__LINE__}";;""" + Environment.NewLine + |] + lines |> Array.fold(fun acc line -> acc + line) "" + Fsx submission + |> runFsi + |> shouldSucceed + diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 279296ec02c..4259be3890a 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -131,6 +131,9 @@ SyntaxTree\LeadingKeywordTests.fs + + SyntaxTree\ValTests.fs + FileSystemTests.fs diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected index 65f6aa81b24..10aabc3dcc4 100644 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.CompilerService.SurfaceArea.netstandard.expected @@ -2162,8 +2162,8 @@ FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsFromDispatchSlotImplemen FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsFromOpenStatement FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsFromPattern FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsFromType -FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsPrivateToFile FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsFromUse +FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean IsPrivateToFile FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromAttribute() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromComputationExpression() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromDefinition() @@ -2171,8 +2171,8 @@ FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromDispatchSlotImpl FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromOpenStatement() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromPattern() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromType() -FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsPrivateToFile() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsFromUse() +FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: Boolean get_IsPrivateToFile() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: FSharp.Compiler.Symbols.FSharpDisplayContext get_DisplayContext() FSharp.Compiler.CodeAnalysis.FSharpSymbolUse: FSharp.Compiler.Symbols.FSharpSymbol Symbol @@ -5170,10 +5170,10 @@ FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpGenericParamet FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpGenericParameter get_GenericParameter() FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpParameter Prettify(FSharp.Compiler.Symbols.FSharpParameter) FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType AbbreviatedType +FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType ErasedType FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType Instantiate(Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[FSharp.Compiler.Symbols.FSharpGenericParameter,FSharp.Compiler.Symbols.FSharpType]]) FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType Prettify(FSharp.Compiler.Symbols.FSharpType) FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType StripAbbreviations() -FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType ErasedType FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType get_AbbreviatedType() FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Symbols.FSharpType get_ErasedType() FSharp.Compiler.Symbols.FSharpType: FSharp.Compiler.Text.TaggedText[] FormatLayout(FSharp.Compiler.Symbols.FSharpDisplayContext) @@ -9518,9 +9518,11 @@ FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: FSharp.Compiler.SyntaxTrivia.SynB FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword LeadingKeyword FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword get_LeadingKeyword() FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange +FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] InlineKeyword FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() +FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_InlineKeyword() FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) +FSharp.Compiler.SyntaxTrivia.SynBindingTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.SyntaxTrivia.SynEnumCaseTrivia FSharp.Compiler.SyntaxTrivia.SynEnumCaseTrivia: FSharp.Compiler.Text.Range EqualsRange FSharp.Compiler.SyntaxTrivia.SynEnumCaseTrivia: FSharp.Compiler.Text.Range get_EqualsRange() @@ -9859,12 +9861,14 @@ FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: FSharp.Compiler.Text.Range W FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: FSharp.Compiler.Text.Range get_WithKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] AndKeyword FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] GetKeyword +FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] InlineKeyword FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] SetKeyword FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_AndKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_GetKeyword() +FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_InlineKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_SetKeyword() FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Void .ctor(FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) +FSharp.Compiler.SyntaxTrivia.SynMemberGetSetTrivia: Void .ctor(Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia Zero FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia: FSharp.Compiler.SyntaxTrivia.SynMemberSigMemberTrivia get_Zero() @@ -10010,11 +10014,13 @@ FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: FSharp.Compiler.SyntaxTrivia.SynLe FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: FSharp.Compiler.SyntaxTrivia.SynValSigTrivia Zero FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: FSharp.Compiler.SyntaxTrivia.SynValSigTrivia get_Zero() FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] EqualsRange +FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] InlineKeyword FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] WithKeyword FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_EqualsRange() +FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_InlineKeyword() FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] get_WithKeyword() FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: System.String ToString() -FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) +FSharp.Compiler.SyntaxTrivia.SynValSigTrivia: Void .ctor(FSharp.Compiler.SyntaxTrivia.SynLeadingKeyword, Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range], Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range]) FSharp.Compiler.Text.ISourceText FSharp.Compiler.Text.ISourceText: Boolean ContentEquals(FSharp.Compiler.Text.ISourceText) FSharp.Compiler.Text.ISourceText: Boolean SubTextEquals(System.String, Int32) diff --git a/tests/FSharp.Compiler.UnitTests/FsiTests.fs b/tests/FSharp.Compiler.UnitTests/FsiTests.fs index 36b36a1c49f..0aed7bbb74a 100644 --- a/tests/FSharp.Compiler.UnitTests/FsiTests.fs +++ b/tests/FSharp.Compiler.UnitTests/FsiTests.fs @@ -14,7 +14,7 @@ type Sentinel () = module MyModule = let test(x: int) = () -[] +[] module FsiTests = let createFsiSession (useOneDynamicAssembly: bool) = @@ -646,35 +646,48 @@ module FsiTests = #if NETCOREAPP [] - let ``Evaluating simple reference and code succeeds under permutations``() = - - for useSdkRefsFlag in ["/usesdkrefs"; "/usesdkrefs-"] do - for multiemitFlag in ["/multiemit"; "/multiemit-"] do - let config = FsiEvaluationSession.GetDefaultConfiguration() - let argv = [| - typeof.Assembly.Location - "--noninteractive" - "--targetprofile:netcore" - "--langversion:preview" - multiemitFlag - useSdkRefsFlag - |] - let fsi = FsiEvaluationSession.Create(config, argv, TextReader.Null, TextWriter.Null, TextWriter.Null) - let assemblyPath = typeof.Assembly.Location.Replace("\\", "/") - let code = $@" - #r ""{assemblyPath}"" - FSharp.Compiler.UnitTests.MyModule.test(3)" - let ch, errors = fsi.EvalInteractionNonThrowing(code, CancellationToken.None) - errors - |> Array.iter (fun e -> printfn "error: %A" e) - match ch with - | Choice1Of2 v -> - let v = - match v with - | Some v -> sprintf "%A" v.ReflectionValue - | None -> "(none)" - printfn "value: %A" v - | Choice2Of2 e -> - printfn "exception: %A" e - raise e + let ``Evaluating simple reference and code succeeds with multiemit on``() = + + use fsiSession = createFsiSession false + let assemblyPath = typeof.Assembly.Location.Replace("\\", "/") + let res, errors = fsiSession.EvalInteractionNonThrowing($""" + #r "{assemblyPath}" + FSharp.Compiler.UnitTests.MyModule.test(3)""") + + errors + |> Array.iter (fun e -> printfn "error: %A" e) + + match res with + | Choice1Of2 v -> + let v = + match v with + | Some v -> sprintf "%A" v.ReflectionValue + | None -> "(none)" + printfn "value: %A" v + | Choice2Of2 e -> + printfn "exception: %A" e + raise e + + [] + let ``Evaluating simple reference and code succeeds with multiemit off``() = + + use fsiSession = createFsiSession true + let assemblyPath = typeof.Assembly.Location.Replace("\\", "/") + let res, errors = fsiSession.EvalInteractionNonThrowing($""" + #r "{assemblyPath}" + FSharp.Compiler.UnitTests.MyModule.test(3)""") + + errors + |> Array.iter (fun e -> printfn "error: %A" e) + + match res with + | Choice1Of2 v -> + let v = + match v with + | Some v -> sprintf "%A" v.ReflectionValue + | None -> "(none)" + printfn "value: %A" v + | Choice2Of2 e -> + printfn "exception: %A" e + raise e #endif diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs index fd78d5298f5..653f9b3a40b 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs @@ -120,6 +120,29 @@ type ListType() = Assert.AreEqual("[1; 2; 3]", [1; 2; 3].ToString()) Assert.AreEqual("[]", [].ToString()) Assert.AreEqual("[]", ([] : decimal list list).ToString()) + + [] + member this.HashCodeNotThrowingStackOverflow() = + let l = 1 :: 2 :: [0.. 35_000] + let hash = l.GetHashCode() + + let l2 = [1;2] @ [0.. 35_000] + let hash2 = l.GetHashCode() + + Assert.AreEqual(hash,hash2) + + [] + member this.HashCodeDoesNotThrowOnListOfNullStrings() = + let l = ["1";"2";null;null] + Assert.AreEqual(l.GetHashCode(),l.GetHashCode()) + + [] + member this.HashCodeIsDifferentForListsWithSamePrefix() = + let sharedPrefix = [0..500] + let l1 = sharedPrefix @ [1] + let l2 = sharedPrefix @ [2] + + Assert.AreNotEqual(l1.GetHashCode(),l2.GetHashCode()) [] member this.ObjectEquals() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs index 4af1df56d39..4ed91efb2fa 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Tasks.fs @@ -1160,6 +1160,22 @@ type Basics() = let result = t.Result require (result = 8) "something weird happened" + [] + member _.testAsyncsMixedWithTasks_ShouldNotSwitchContext() = + let t = task { + let a = Thread.CurrentThread.ManagedThreadId + let! b = async { + return Thread.CurrentThread.ManagedThreadId + } + let c = Thread.CurrentThread.ManagedThreadId + return $"Before: {a}, in async: {b}, after async: {c}" + } + let d = Thread.CurrentThread.ManagedThreadId + let actual = $"{t.Result}, after task: {d}" + + require (actual = $"Before: {d}, in async: {d}, after async: {d}, after task: {d}") actual + + [] // no need to call this, we just want to check that it compiles w/o warnings member _.testDefaultInferenceForReturnFrom() = @@ -1390,5 +1406,4 @@ module Issue12184f = // The overload resolution for Bind commits to 'Task' via SRTP pattern since the type annotation is available let! result = t return result - } - + } \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ExtraTopLevelOperatorsTests.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ExtraTopLevelOperatorsTests.fs index 147edbe1916..9c4379fd459 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ExtraTopLevelOperatorsTests.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/ExtraTopLevelOperatorsTests.fs @@ -8,7 +8,7 @@ open System.Collections.Generic type DictTests () = [] - member this.IEnumerable() = + member this.IEnumerableOnDict() = // Legit IE let ie = (dict [|(1,1);(2,4);(3,9)|]) :> IEnumerable let enum = ie.GetEnumerator() @@ -38,7 +38,7 @@ type DictTests () = CheckThrowsInvalidOperationExn(fun () -> enum.Current |> ignore) [] - member this.IEnumerable_T() = + member this.IEnumerable_T_OnDict() = // Legit IE let ie = (dict [|(1,1);(2,4);(3,9)|]) :> IEnumerable> let enum = ie.GetEnumerator() diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index ee2b662bfe5..0c5e7435ae7 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -202,6 +202,45 @@ type LanguagePrimitivesModule() = let resultNul = LanguagePrimitives.GenericEquality "ABC" null Assert.False(resultNul) + + [] + member _.GenericEqualityForNans() = + Assert.DoesNotContain(true, + [| LanguagePrimitives.GenericEquality nan nan + LanguagePrimitives.GenericEquality [nan] [nan] + LanguagePrimitives.GenericEquality [|nan|] [|nan|] + LanguagePrimitives.GenericEquality (Set.ofList [nan]) (Set.ofList [nan]) + LanguagePrimitives.GenericEquality (Map.ofList [1,nan]) (Map.ofList [1,nan]) + LanguagePrimitives.GenericEquality (Map.ofList [nan,1]) (Map.ofList [nan,1]) + LanguagePrimitives.GenericEquality (Map.ofList [nan,nan]) (Map.ofList [nan,nan]) + + LanguagePrimitives.GenericEquality nanf nanf + LanguagePrimitives.GenericEquality [nanf] [nanf] + LanguagePrimitives.GenericEquality [|nanf|] [|nanf|] + LanguagePrimitives.GenericEquality (Set.ofList [nanf]) (Set.ofList [nanf]) + LanguagePrimitives.GenericEquality (Map.ofList [1,nanf]) (Map.ofList [1,nanf]) + LanguagePrimitives.GenericEquality (Map.ofList [nanf,1]) (Map.ofList [nanf,1]) + LanguagePrimitives.GenericEquality (Map.ofList [nanf,nanf]) (Map.ofList [nanf,nanf])|]) + + [] + member _.GenericEqualityER() = + Assert.DoesNotContain(false, + [| LanguagePrimitives.GenericEqualityER nan nan + LanguagePrimitives.GenericEqualityER [nan] [nan] + LanguagePrimitives.GenericEqualityER [|nan|] [|nan|] + LanguagePrimitives.GenericEqualityER (Set.ofList [nan]) (Set.ofList [nan]) + LanguagePrimitives.GenericEqualityER (Map.ofList [1,nan]) (Map.ofList [1,nan]) + LanguagePrimitives.GenericEqualityER (Map.ofList [nan,1]) (Map.ofList [nan,1]) + LanguagePrimitives.GenericEqualityER (Map.ofList [nan,nan]) (Map.ofList [nan,nan]) + + LanguagePrimitives.GenericEqualityER nanf nanf + LanguagePrimitives.GenericEqualityER [nanf] [nanf] + LanguagePrimitives.GenericEqualityER [|nanf|] [|nanf|] + LanguagePrimitives.GenericEqualityER (Set.ofList [nanf]) (Set.ofList [nanf]) + LanguagePrimitives.GenericEqualityER (Map.ofList [1,nanf]) (Map.ofList [1,nanf]) + LanguagePrimitives.GenericEqualityER (Map.ofList [nanf,1]) (Map.ofList [nanf,1]) + LanguagePrimitives.GenericEqualityER (Map.ofList [nanf,nanf]) (Map.ofList [nanf,nanf])|]) + [] member this.GenericGreaterOrEqual() = diff --git a/tests/FSharp.Test.Utilities/Compiler.fs b/tests/FSharp.Test.Utilities/Compiler.fs index 97808b58591..8ea26ea602b 100644 --- a/tests/FSharp.Test.Utilities/Compiler.fs +++ b/tests/FSharp.Test.Utilities/Compiler.fs @@ -193,7 +193,7 @@ module rec Compiler = // Load the source file from the path let loadSourceFromFile path = getSource(TestType.Path path) - let private fsFromString (source: SourceCodeFileKind): FSharpCompilationSource = + let fsFromString (source: SourceCodeFileKind): FSharpCompilationSource = { Source = source AdditionalSources = [] @@ -321,6 +321,7 @@ module rec Compiler = let asFs (cUnit: CompilationUnit) : CompilationUnit = match cUnit with + | FS { Source = SourceCodeFileKind.Fsi _} -> cUnit | FS src -> FS {src with Source=SourceCodeFileKind.Fs({FileName=src.Source.GetSourceFileName; SourceText=src.Source.GetSourceText})} | _ -> failwith "Only F# compilation can be of type Fs." @@ -391,8 +392,14 @@ module rec Compiler = let withLangVersion70 (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:7.0" ] "withLangVersion70 is only supported on F#" cUnit + let withLangVersion80 (cUnit: CompilationUnit) : CompilationUnit = + withOptionsHelper [ "--langversion:8.0" ] "withLangVersion80 is only supported on F#" cUnit + let withLangVersionPreview (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ "--langversion:preview" ] "withLangVersionPreview is only supported on F#" cUnit + + let withLangVersion (version: string) (cUnit: CompilationUnit) : CompilationUnit = + withOptionsHelper [ $"--langversion:{version}" ] "withLangVersion is only supported on F#" cUnit let withAssemblyVersion (version:string) (cUnit: CompilationUnit) : CompilationUnit = withOptionsHelper [ $"--version:{version}" ] "withAssemblyVersion is only supported on F#" cUnit diff --git a/tests/FSharp.Test.Utilities/ProjectGeneration.fs b/tests/FSharp.Test.Utilities/ProjectGeneration.fs index 19de5910387..3d9c4f9f528 100644 --- a/tests/FSharp.Test.Utilities/ProjectGeneration.fs +++ b/tests/FSharp.Test.Utilities/ProjectGeneration.fs @@ -222,15 +222,6 @@ module Internal = let content = renderSourceFile p f writeFileIfChanged fileName content - let validateFileIdsAreUnique (project: SyntheticProject) = - let ids = [ for _, f in project.GetAllFiles() -> f.Id ] - let duplicates = ids |> List.groupBy id |> List.filter (fun (_, g) -> g.Length > 1) - - if duplicates.Length > 0 then - failwith - $"""Source file IDs have to be unique across the project and all referenced projects. Found duplicates: {String.Join(", ", duplicates |> List.map fst)}""" - - open Internal @@ -311,6 +302,21 @@ module ProjectOperations = if checkResult.Diagnostics.Length > 0 then failwith $"Expected no errors, but there were some: \n%A{checkResult.Diagnostics}" + let expectSingleWarningAndNoErrors (warningSubString:string) parseAndCheckResults _ = + let checkResult = getTypeCheckResult parseAndCheckResults + let errors = checkResult.Diagnostics|> Array.filter (fun d -> d.Severity = FSharpDiagnosticSeverity.Error) + if errors.Length > 0 then + failwith $"Expected no errors, but there were some: \n%A{errors}" + + let warnings = checkResult.Diagnostics|> Array.filter (fun d -> d.Severity = FSharpDiagnosticSeverity.Warning) + match warnings |> Array.tryExactlyOne with + | None -> failwith $"Expected 1 warning, but got {warnings.Length} instead: \n%A{warnings}" + | Some w -> + if w.Message.Contains warningSubString then + () + else + failwith $"Expected 1 warning with substring '{warningSubString}' but got %A{w}" + let expectErrors parseAndCheckResults _ = let checkResult = getTypeCheckResult parseAndCheckResults @@ -378,7 +384,6 @@ type WorkflowContext = let SaveAndCheckProject project checker = async { - validateFileIdsAreUnique project do! saveProject project true checker diff --git a/tests/fsharp/core/attributes/test.fsx b/tests/fsharp/core/attributes/test.fsx index f8f60ee019c..392cd6299fd 100644 --- a/tests/fsharp/core/attributes/test.fsx +++ b/tests/fsharp/core/attributes/test.fsx @@ -1136,7 +1136,7 @@ module Bug5762 = let moduleType = typeof.DeclaringType let mFindFirstFile = moduleType.GetMethod("FindFirstFile") let dataParam = mFindFirstFile.GetParameters().[1] - let marshalAsAttrs = dataParam.GetCustomAttributes(typeof, false) + let marshalAsAttrs = dataParam.GetCustomAttributes(typeof, false) |> Array.distinct check "gjhfdey547" (match marshalAsAttrs with | [| (:? MarshalAsAttribute as ma) |] when ma.Value = UnmanagedType.LPStruct -> true @@ -1145,7 +1145,7 @@ module Bug5762 = let findDataType = typeof check "dguyestgfuysdc" - (match findDataType.GetField("cFileName").GetCustomAttributes(typeof, false) with + (match findDataType.GetField("cFileName").GetCustomAttributes(typeof, false) |> Array.distinct with | [| (:? MarshalAsAttribute as ma) |] when ma.Value = UnmanagedType.ByValTStr && ma.SizeConst = 260 -> true diff --git a/tests/fsharp/core/printing/output.multiemit.stderr.bsl b/tests/fsharp/core/printing/output.multiemit.stderr.bsl index 68785a152df..6926dcc9f34 100644 --- a/tests/fsharp/core/printing/output.multiemit.stderr.bsl +++ b/tests/fsharp/core/printing/output.multiemit.stderr.bsl @@ -346,21 +346,3 @@ stdin(838,6): error FS1210: Active pattern '|A|B|' has a result type containing stdin(844,6): error FS1209: Active pattern '|A|B|' is not a function - - let internal f() = 1;; f();; // should give a warning in multi-assembly interactive emit - -----------------------^^^ - -stdin(1089,24): warning FS2303: Accessing the internal type, method or field 'f' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - - - CPublic().MInternal();; // should give a warning in multi-assembly interactive emit - ^^^^^^^^^^^^^^^^^^^^^ - -stdin(1099,1): warning FS2303: Accessing the internal type, method or field 'MInternal' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - - - CPublic2().MPublic();; // should give a warning in multi-assembly interactive emit - ^^^^^^^^^^^^^^^^^^^^ - -stdin(1105,1): warning FS2303: Accessing the internal type, method or field 'MPublic' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option. - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst index e45bfc18344..f66e0766f85 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst @@ -1 +1 @@ -ReqENU SOURCE=gccerrors01.fs COMPILE_ONLY=1 SCFLAGS="--gccerrors --nologo gccerrors01.fs >gccerrors01.txt" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx gccerrors01.txt gccerrors01.bsl" +ReqENU SOURCE=gccerrors01.fs COMPILE_ONLY=1 SCFLAGS="--gccerrors --nologo >gccerrors01.txt" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx gccerrors01.txt gccerrors01.bsl" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl index 623a47f3f1a..230f80b709e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/help40.437.1033.bsl @@ -107,5 +107,5 @@ Usage: fsharpi [script.fsx []] --quotations-debug[+|-] Emit debug information in quotations --shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process ---multiemit[+|-] Emit multiple assemblies (off by - default for .NET Framework) \ No newline at end of file +--multiemit[+|-] Emit multiple assemblies (on by + default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl index c52df3651b3..b0d97ddcd12 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40-nologo.437.1033.bsl @@ -107,5 +107,5 @@ Usage: fsiAnyCpu [script.fsx []] --quotations-debug[+|-] Emit debug information in quotations --shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process ---multiemit[+|-] Emit multiple assemblies (off by - default for .NET Framework) \ No newline at end of file +--multiemit[+|-] Emit multiple assemblies (on by + default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl index 0da770a2436..e95a139b5fb 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/help40.437.1033.bsl @@ -109,5 +109,5 @@ Usage: fsiAnyCpu [script.fsx []] --quotations-debug[+|-] Emit debug information in quotations --shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process ---multiemit[+|-] Emit multiple assemblies (off by - default for .NET Framework) \ No newline at end of file +--multiemit[+|-] Emit multiple assemblies (on by + default) \ No newline at end of file diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_InheritClassWithoutDefCtor.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/E_InheritClassWithoutDefCtor.fs deleted file mode 100644 index 8fb0dc6abd8..00000000000 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_InheritClassWithoutDefCtor.fs +++ /dev/null @@ -1,19 +0,0 @@ -// #Regression #NoMT #FSI -// Regression test for FSharp1.0:1626 - Classes without constructors can't be emitted by Reflection.Emit. This causes late error in compilation -// Parent does not have a default constructor\. The default constructor must be explicitly defined - -type B = class - - new(a:int) = {} - -end - -type C = class - inherit B -end - -#if INTERACTIVE -;; -exit 1;; -#endif - diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst b/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst index c3cf858c21b..ef48ada5cfa 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/env.lst @@ -74,8 +74,6 @@ NOMONO SOURCE=References40.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # SOURCE=DefinesCompiled.fs # DefinesCompiled SOURCE=E_ErrorRanges01.fs COMPILE_ONLY=1 FSIMODE=PIPE # E_ErrorRanges01.fs - SOURCE=E_InheritClassWithoutDefCtor.fs COMPILE_ONLY=1 FSIMODE=PIPE # E_InheritClassWithoutDefCtor.fs - SOURCE=DoWithNotUnit.fs COMPILE_ONLY=1 FSIMODE=PIPE # DoWithNotUnit.fs SOURCE=LoadingFsx.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--test:ErrorRanges" # LoadingFsx.fsx SOURCE=LoadingFsx.fsscript COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--test:ErrorRanges" # LoadingFsx.fsscript diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index e72cbd11612..2c9482e2461 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -10,7 +10,7 @@ CompilerOptions01,NoMT CompilerOptions\fsc\crossoptimize CompilerOptions01,NoMT,Determinism CompilerOptions\fsc\determinism CompilerOptions01,NoMT CompilerOptions\fsc\dumpAllCommandLineOptions CompilerOptions01,NoMT CompilerOptions\fsc\flaterrors -CompilerOptions02,NoMT CompilerOptions\fsc\gccerrors +CompilerOptions02,NoMT,gcc CompilerOptions\fsc\gccerrors CompilerOptions01,NoMT,help CompilerOptions\fsc\help CompilerOptions01,NoMT CompilerOptions\fsc\highentropyva CompilerOptions01,NoMT CompilerOptions\fsc\langversion diff --git a/tests/fsharpqa/run.fsharpqa.test.fsx b/tests/fsharpqa/run.fsharpqa.test.fsx index 89006028a3d..0d87d742401 100644 --- a/tests/fsharpqa/run.fsharpqa.test.fsx +++ b/tests/fsharpqa/run.fsharpqa.test.fsx @@ -60,4 +60,4 @@ let runPerl arguments = let testResultDir = Path.Combine(rootFolder, "tests", "TestResults") let perlScript = Path.Combine(rootFolder, "tests", "fsharpqa", "testenv", "bin", "runall.pl") -runPerl [|perlScript; "-resultsroot";testResultDir ;"-ttags:Determinism"|] \ No newline at end of file +runPerl [|perlScript; "-resultsroot";testResultDir ;"-ttags:gcc"|] \ No newline at end of file diff --git a/tests/projects/SelfContained_Trimming_Test/check.ps1 b/tests/projects/SelfContained_Trimming_Test/check.ps1 index fbc122b4158..388ed50ae7e 100644 --- a/tests/projects/SelfContained_Trimming_Test/check.ps1 +++ b/tests/projects/SelfContained_Trimming_Test/check.ps1 @@ -14,7 +14,7 @@ if (-not ($output -eq $expected)) } # Checking that FSharp.Core binary is of expected size (needs adjustments if test is updated). -$expected_len = 245248 # In bytes +$expected_len = 246272 # In bytes $file = Get-Item .\bin\Release\net7.0\win-x64\publish\FSharp.Core.dll $file_len = $file.Length if (-not ($file_len -eq $expected_len)) diff --git a/tests/service/SyntaxTreeTests/BindingTests.fs b/tests/service/SyntaxTreeTests/BindingTests.fs index e2afdfd7f93..ef6efe22230 100644 --- a/tests/service/SyntaxTreeTests/BindingTests.fs +++ b/tests/service/SyntaxTreeTests/BindingTests.fs @@ -439,3 +439,44 @@ type X = assertRange (3,28) (3,29) mColon1 assertRange (3,52) (3,53) mColon2 | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Inline keyword in binding`` () = + let parseResults = + getParseResults """ +let inline x y z = + let inline a b c = () + () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(trivia = { InlineKeyword = Some mInline1 } + expr = SynExpr.LetOrUse(bindings = [ + SynBinding(trivia = { InlineKeyword = Some mInline2 }) + ])) + ]) + ]) ])) -> + assertRange (2,4) (2,10) mInline1 + assertRange (3,8) (3,14) mInline2 + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" + +[] +let ``Conditional directive around inline keyword`` () = + let parseResults = + getParseResults """ +let +#if !FOO + inline +#endif + map f ar = Async.map (Result.map f) ar +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Let(bindings = [ + SynBinding(trivia = { InlineKeyword = Some mInline }) ]) + ]) ])) -> + assertRange (4,4) (4,10) mInline + | _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" diff --git a/tests/service/SyntaxTreeTests/MemberTests.fs b/tests/service/SyntaxTreeTests/MemberTests.fs index 3533a4e69b4..2cd0eaafa4e 100644 --- a/tests/service/SyntaxTreeTests/MemberTests.fs +++ b/tests/service/SyntaxTreeTests/MemberTests.fs @@ -315,3 +315,50 @@ type X = assertRange (7, 20) (7, 24) mWith assertRange (8, 32) (8, 35) mGet | _ -> Assert.Fail "Could not get valid AST" + +[] +let ``Member with inline keyword`` () = + let parseResults = + getParseResults + """ +type X = + member inline x.Y () = () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.Member(memberDefn = SynBinding(trivia = { InlineKeyword = Some mInline })) + ])) ] + ) + ]) ])) -> + assertRange (3, 11) (3, 17) mInline + | ast -> Assert.Fail $"Could not get valid AST, got {ast}" + +[] +let ``Get/Set member with inline keyword`` () = + let parseResults = + getParseResults + """ +type X = + member inline x.Y + with inline get () = 4 + and inline set y = () +""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (contents = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.Types( + typeDefns = [ SynTypeDefn(typeRepr = SynTypeDefnRepr.ObjectModel(members = [ + SynMemberDefn.GetSetMember(Some (SynBinding(trivia = { InlineKeyword = Some mInlineGet })), + Some (SynBinding(trivia = { InlineKeyword = Some mInlineSet })), + _, + { InlineKeyword = Some mInlineGetSetMember }) + ])) ] + ) + ]) ])) -> + assertRange (3, 11) (3, 17) mInlineGetSetMember + assertRange (4, 13) (4, 19) mInlineGet + assertRange (5, 12) (5, 18) mInlineSet + | ast -> Assert.Fail $"Could not get valid AST, got {ast}" diff --git a/tests/service/SyntaxTreeTests/ValTests.fs b/tests/service/SyntaxTreeTests/ValTests.fs new file mode 100644 index 00000000000..c14415bad6e --- /dev/null +++ b/tests/service/SyntaxTreeTests/ValTests.fs @@ -0,0 +1,20 @@ +module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ValTests + +open FSharp.Compiler.Service.Tests.Common +open FSharp.Compiler.Syntax +open FSharp.Compiler.SyntaxTrivia +open NUnit.Framework + +[] +let ``Inline keyword`` () = + let parseResults = + getParseResultsOfSignatureFile + """namespace X + +val inline meh: int -> int""" + + match parseResults with + | ParsedInput.SigFile (ParsedSigFileInput (contents = [ + SynModuleOrNamespaceSig(decls = [SynModuleSigDecl.Val(valSig = SynValSig(trivia = { InlineKeyword = Some mInline }))]) ])) -> + assertRange (3, 4) (3,10) mInline + | ast -> Assert.Fail $"Could not get valid AST, got {ast}" diff --git a/tests/service/TreeVisitorTests.fs b/tests/service/TreeVisitorTests.fs index 9bcfa47796a..58bda80d487 100644 --- a/tests/service/TreeVisitorTests.fs +++ b/tests/service/TreeVisitorTests.fs @@ -58,4 +58,20 @@ let ``Visit enum definition test`` () = match SyntaxTraversal.Traverse(pos0, parseTree, visitor) with | Some [ SynEnumCase (_, SynIdent(id1,_), _, _, _, _, _); SynEnumCase (_, SynIdent(id2,_), _, _, _, _, _) ] when id1.idText = "A" && id2.idText = "B" -> () - | _ -> failwith "Did not visit enum definition" \ No newline at end of file + | _ -> failwith "Did not visit enum definition" + +[] +let ``Visit recursive let binding`` () = + let visitor = + { new SyntaxVisitorBase<_>() with + member x.VisitExpr(_, _, defaultTraverse, expr) = defaultTraverse expr + member x.VisitLetOrUse(_, isRecursive, _, bindings, _) = + if not isRecursive then failwith $"{nameof isRecursive} should be true" + Some bindings } + + let source = "let rec fib n = if n < 2 then n else fib (n - 1) + fib (n - 2) in fib 10" + let parseTree = parseSourceCode("C:\\test.fs", source) + + match SyntaxTraversal.Traverse(pos0, parseTree, visitor) with + | Some [ SynBinding(valData = SynValData(valInfo = SynValInfo(curriedArgInfos = [ [ SynArgInfo(ident = Some id) ] ]))) ] when id.idText = "n" -> () + | _ -> failwith "Did not visit recursive let binding" \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Hints/HintService.fs b/vsintegration/src/FSharp.Editor/Hints/HintService.fs index 6b23fe78506..f196e3caac5 100644 --- a/vsintegration/src/FSharp.Editor/Hints/HintService.fs +++ b/vsintegration/src/FSharp.Editor/Hints/HintService.fs @@ -9,29 +9,45 @@ open FSharp.Compiler.Symbols open Hints module HintService = - let private getHintsForSymbol parseResults hintKinds (symbolUse: FSharpSymbolUse) = - match symbolUse.Symbol with - | :? FSharpMemberOrFunctionOrValue as symbol - when hintKinds |> Set.contains HintKind.TypeHint - && InlineTypeHints.isValidForHint parseResults symbol symbolUse -> - - InlineTypeHints.getHints symbol symbolUse - - | :? FSharpMemberOrFunctionOrValue as symbol - when hintKinds |> Set.contains HintKind.ParameterNameHint - && InlineParameterNameHints.isMemberOrFunctionOrValueValidForHint symbol symbolUse -> - InlineParameterNameHints.getHintsForMemberOrFunctionOrValue parseResults symbol symbolUse + type private NativeHintResolver = FSharpSymbolUse seq -> NativeHint seq + + let inline private getTypeHints parseResults symbol: NativeHintResolver = + Seq.filter (InlineTypeHints.isValidForHint parseResults symbol) + >> Seq.collect (InlineTypeHints.getHints symbol) - | :? FSharpUnionCase as symbol - when hintKinds |> Set.contains HintKind.ParameterNameHint - && InlineParameterNameHints.isUnionCaseValidForHint symbol symbolUse -> + let inline private getHintsForMemberOrFunctionOrValue parseResults symbol: NativeHintResolver = + Seq.filter (InlineParameterNameHints.isMemberOrFunctionOrValueValidForHint symbol) + >> Seq.collect (InlineParameterNameHints.getHintsForMemberOrFunctionOrValue parseResults symbol) - InlineParameterNameHints.getHintsForUnionCase parseResults symbol symbolUse + let inline private getHintsForUnionCase parseResults symbol: NativeHintResolver = + Seq.filter (InlineParameterNameHints.isUnionCaseValidForHint symbol) + >> Seq.collect (InlineParameterNameHints.getHintsForUnionCase parseResults symbol) - // we'll be adding other stuff gradually here - | _ -> - [] + let private getHintResolvers parseResults hintKinds (symbol: FSharpSymbol): NativeHintResolver seq = + let rec resolve hintKinds resolvers = + match hintKinds with + | [] -> resolvers |> Seq.choose id + | hintKind :: hintKinds -> + match hintKind with + | HintKind.TypeHint -> + match symbol with + | :? FSharpMemberOrFunctionOrValue as symbol -> getTypeHints parseResults symbol |> Some + | _ -> None + | HintKind.ParameterNameHint -> + match symbol with + | :? FSharpMemberOrFunctionOrValue as symbol -> getHintsForMemberOrFunctionOrValue parseResults symbol |> Some + | :? FSharpUnionCase as symbol -> getHintsForUnionCase parseResults symbol |> Some + | _ -> None + // we'll be adding other stuff gradually here + :: resolvers |> resolve hintKinds + + in resolve hintKinds [] + + let private getHintsForSymbol parseResults hintKinds (symbol: FSharpSymbol, symbolUses: FSharpSymbolUse seq) = + symbol + |> getHintResolvers parseResults hintKinds + |> Seq.collect (fun resolve -> resolve symbolUses) let getHintsForDocument (document: Document) hintKinds userOpName cancellationToken = async { @@ -44,6 +60,7 @@ module HintService = return checkResults.GetAllUsesOfAllSymbolsInFile cancellationToken + |> Seq.groupBy (fun symbolUse -> symbolUse.Symbol) + |> Seq.collect (getHintsForSymbol parseResults (hintKinds |> Set.toList)) |> Seq.toList - |> List.collect (getHintsForSymbol parseResults hintKinds) } diff --git a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs index 4d55fe98986..db8298d826f 100644 --- a/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs +++ b/vsintegration/src/FSharp.Editor/Hints/InlineParameterNameHints.fs @@ -4,6 +4,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor.Hints open Microsoft.VisualStudio.FSharp.Editor open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.EditorServices open FSharp.Compiler.Symbols open FSharp.Compiler.Text open Hints @@ -30,7 +31,7 @@ module InlineParameterNameHints = let private doesFieldNameExist (field: FSharpField) = not field.IsNameGenerated - let private getTupleRanges + let private getArgumentLocations (symbolUse: FSharpSymbolUse) (parseResults: FSharpParseFileResults) = @@ -39,10 +40,13 @@ module InlineParameterNameHints = (symbolUse.Range.End.Column + 1) parseResults.FindParameterLocations position - |> Option.map (fun locations -> locations.ArgumentLocations) - |> Option.map (Seq.map (fun location -> location.ArgumentRange)) - |> Option.defaultValue [] - |> Seq.toList + |> Option.map (fun locations -> locations.ArgumentLocations |> Seq.filter (fun location -> Position.posGeq location.ArgumentRange.Start position)) + |> Option.filter (not << Seq.isEmpty) + |> Option.defaultValue Seq.empty + + let private getTupleRanges = + Seq.map (fun location -> location.ArgumentRange) + >> Seq.toList let private getCurryRanges (symbolUse: FSharpSymbolUse) @@ -51,15 +55,26 @@ module InlineParameterNameHints = parseResults.GetAllArgumentsForFunctionApplicationAtPosition symbolUse.Range.Start |> Option.defaultValue [] - let isMemberOrFunctionOrValueValidForHint (symbol: FSharpMemberOrFunctionOrValue) (symbolUse: FSharpSymbolUse) = + let private isNamedArgument range = + Seq.filter (fun location -> location.IsNamedArgument) + >> Seq.map (fun location -> location.ArgumentRange) + >> Seq.contains range + + let isMemberOrFunctionOrValueValidForHint + (symbol: FSharpMemberOrFunctionOrValue) + (symbolUse: FSharpSymbolUse) = + if symbolUse.IsFromUse then let isNotBuiltInOperator = symbol.DeclaringEntity |> Option.exists (fun entity -> entity.CompiledName <> "Operators") + let isNotCustomOperation = + not <| symbol.HasAttribute() + (symbol.IsFunction && isNotBuiltInOperator) // arguably, hints for those would be rather useless || symbol.IsConstructor - || symbol.IsMethod + || (symbol.IsMethod && isNotCustomOperation) else false @@ -73,10 +88,14 @@ module InlineParameterNameHints = (symbolUse: FSharpSymbolUse) = let parameters = symbol.CurriedParameterGroups |> Seq.concat + let argumentLocations = parseResults |> getArgumentLocations symbolUse - let tupleRanges = parseResults |> getTupleRanges symbolUse + let tupleRanges = argumentLocations |> getTupleRanges let curryRanges = parseResults |> getCurryRanges symbolUse - let ranges = if tupleRanges |> (not << Seq.isEmpty) then tupleRanges else curryRanges + + let ranges = + if tupleRanges |> (not << Seq.isEmpty) then tupleRanges else curryRanges + |> Seq.filter (fun range -> argumentLocations |> (not << isNamedArgument range)) parameters |> Seq.zip ranges // Seq.zip is important as List.zip requires equal lengths diff --git a/vsintegration/src/FSharp.Editor/Hints/InlineTypeHints.fs b/vsintegration/src/FSharp.Editor/Hints/InlineTypeHints.fs index 402eddbaef0..ab40a8931be 100644 --- a/vsintegration/src/FSharp.Editor/Hints/InlineTypeHints.fs +++ b/vsintegration/src/FSharp.Editor/Hints/InlineTypeHints.fs @@ -6,6 +6,7 @@ open Microsoft.VisualStudio.FSharp.Editor open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Symbols open FSharp.Compiler.Text +open FSharp.Compiler.Text.Position open Hints module InlineTypeHints = @@ -44,8 +45,20 @@ module InlineTypeHints = (symbol: FSharpMemberOrFunctionOrValue) (symbolUse: FSharpSymbolUse) = + let isOptionalParameter = + symbolUse.IsFromDefinition + && symbol.FullType.IsAbbreviation + && symbol.FullType.TypeDefinition.DisplayName = "option" + + let adjustedRangeStart = + if isOptionalParameter then + // we need the position to start at the '?' symbol + mkPos symbolUse.Range.StartLine (symbolUse.Range.StartColumn - 1) + else + symbolUse.Range.Start + let isNotAnnotatedManually = - not (parseFileResults.IsTypeAnnotationGivenAtPosition symbolUse.Range.Start) + not (parseFileResults.IsTypeAnnotationGivenAtPosition adjustedRangeStart) let isNotAfterDot = symbolUse.IsFromDefinition diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index b4e83916d52..34840f555df 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Vodítka struktury bloků; +Zobrazit pokyny ke struktuře pro kód F#; +Tvorba osnov; +Zobrazit sbalitelné a sbalitelné uzly pro kód F#; +Vložené tipy; +Zobrazit pomocné parametry vloženého typu (experimentální); +Zobrazit nápovědy k názvům vložených parametrů (experimentální); Pivo @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Zjednodušení názvů (odebrání nepotřebných kvalifikátorů); +Vždy umístit otevřené příkazy na nejvyšší úrovni; +Odebrat nepoužívané otevřené příkazy; +Analyzovat a navrhovat opravy pro nepoužívané hodnoty; +Navrhnout názvy pro nerozpoznané identifikátory; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Převést C# „using“ na F# „open“ @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Znovu naformátovat odsazení při vložení (experimentální) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Seznamy pro doplňování; +Zobrazit seznam pro doplňování po odstranění znaku; +Zobrazit seznam pro doplňování po zadání znaku; +Zobrazit symboly v neotevřených názvových prostorech; +Zadejte chování kláves; +Nikdy nepřidávat nový řádek při stisknutí klávesy Enter; +Přidat nový řádek pouze po zadání za konec plně zadaného slova; +Vždy přidat nový řádek při stisknutí klávesy Enter; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Možnosti výkonu projektu F# a ukládání do mezipaměti; +Povolit odkazy mezi projekty v paměti; +Možnosti výkonu IntelliSense; +Povolit zastaralá data pro funkce IntelliSense; +Doba, než se použijí zastaralé výsledky (v milisekundách); +Paralelizace (vyžaduje restartování); +Povolit paralelní kontrolu typů pomocí souborů podpisu; +Povolit paralelní referenční rozlišení; +Povolit odkazy rychlého hledání a přejmenování (experimentální) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Navigační odkazy; +Zobrazit navigační odkazy jako; +Plné podtržení; +Podtržení tečkami; +Přerušované podtržení; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 0ff95ba6dcb..ebf011be011 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Führungslinien für Blockstruktur; +Strukturrichtlinien für F#-Code anzeigen; +Gliederung; +Gliederungs- und reduzierbare Knoten für F#-Code anzeigen; +Inlinehinweise; +Hinweise zu Inlinetypen anzeigen (experimentell); +Hinweise zu Inlineparameternamen anzeigen (experimentell); Bier @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Namen vereinfachen (unnötige Qualifizierer entfernen); +Open-Anweisungen immer auf oberster Ebene platzieren; +Nicht verwendete Open-Anweisungen entfernen; +Analysieren und Vorschlagen von Korrekturen für nicht verwendete Werte; +Namen für nicht aufgelöste Bezeichner vorschlagen; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + C# „using“ in F# „open“ konvertieren @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Einzug beim Einfügen erneut formatieren (experimentell) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Vervollständigungslisten; +Vervollständigungsliste anzeigen, nachdem ein Zeichen gelöscht wurde; +Vervollständigungsliste anzeigen, nachdem ein Zeichen eingegeben wurde; +Symbole in ungeöffneten Namespaces anzeigen; +Schlüsselverhalten eingeben; +Nach Eingabe keine neue Zeile hinzufügen; +Nur nach dem Ende des vollständig eingegebenen Worts eine neue Zeile hinzufügen. +Nach Eingabe immer eine neue Zeile hinzufügen; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F#-Projekt- und Cacheleistungsoptionen; +Projektübergreifende Verweise im Arbeitsspeicher aktivieren; +IntelliSense-Leistungsoptionen; +Veraltete Daten für IntelliSense-Features aktivieren; +Zeit bis zur Verwendung veralteter Ergebnisse (in Millisekunden); +Parallelisierung (Neustart erforderlich); +Parallele Typüberprüfung mit Signaturdateien aktivieren; +Parallele Verweisauflösung aktivieren; +Schnellsuche und Umbenennen von Verweisen aktivieren (experimentell) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Navigationslinks; +Navigationslinks anzeigen als; +Durchgehende Unterstreichung; +Gepunktete Unterstreichung; +Gestrichelte Unterstreichung; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index d65cd4006b0..149d82474ee 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Guías de estructura de bloques; +Mostrar instrucciones de estructura para el código de F#; +Esquematización; +Mostrar nodos esquematización y contraíbles para el código de F#; +Sugerencias insertadas; +Mostrar sugerencias de tipo insertadas (experimental); +Mostrar sugerencias de nombre de parámetro insertado (experimental); Cerveza @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Simplificar nombres (quitar calificadores innecesarios); +Colocar siempre las instrucciones abiertas en el nivel superior; +Quitar instrucciones abiertas sin usar; +Analizar y sugerir correcciones para valores no usados; +Sugerir nombres para identificadores sin resolver; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Convertir C# 'using' en F# 'open' @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Volver a aplicar formato a la sangría al pegar (experimental) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Listas de finalización; +Mostrar lista de finalización después de eliminar un carácter; +Mostrar lista de finalización después de escribir un carácter; +Mostrar símbolos en espacios de nombres sin abrir; +Escribir el comportamiento de la tecla; +No agregar nunca una nueva línea al pulsar Intro; +Agregar solo una nueva línea al pulsar Intro después del final de la palabra totalmente escrita; +Agregar siempre una nueva línea al pulsar Intro; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Opciones de rendimiento de almacenamiento en caché y proyecto de F#; +Habilitar referencias entre proyectos en memoria; +Opciones de rendimiento de IntelliSense; +Habilitar datos obsoletos para características de IntelliSense; +Tiempo hasta que se usan resultados obsoletos (en milisegundos); +Paralelización (requiere reiniciar); +Habilitar la comprobación de tipos paralelos con archivos de firma; +Habilitar resolución de referencias paralelas; +Habilitar referencias de búsqueda rápida y cambio de nombre (experimental) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Vínculos de navegación; +Mostrar vínculos de navegación como; +Subrayado sólido; +Subrayado de punto; +Subrayado de guion; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 2ba65d2f530..40a09ed5667 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Repères de structure de bloc ; +Afficher les instructions de structure pour le code F# ; +Décrivant; +Afficher les nœuds plan et réductibles pour le code F# ; +Indicateurs inline ; +Afficher les indicateurs de type inline (expérimental); +Afficher les indicateurs de nom de paramètre inline (expérimental); Bière @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Simplifier les noms (supprimer les qualificateurs inutiles) ; +Toujours placer les instructions ouvertes au niveau supérieur ; +Supprimer les instructions open inutilisées ; +Analyser et suggérer des correctifs pour les valeurs inutilisées ; +Suggérer des noms pour les identificateurs non résolus ; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Convertir 'using' C# en F# 'open' @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Formater de nouveau la mise en retrait lors du collage (expérimental) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Listes de saisie semi-automatique ; + Afficher la liste de saisie semi-automatique après la suppression d’un caractère ; + Afficher la liste de saisie semi-automatique après la saisie d’un caractère ; + Afficher les symboles dans les espaces de noms non ouverts ; + Entrer le comportement de la clé ; + Ne jamais ajouter de nouvelle ligne lors de l’entrée ; + Ajouter uniquement une nouvelle ligne à l’entrée après la fin du mot entièrement typé ; + Toujours ajouter une nouvelle ligne lors de l’entrée ; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Options de performances du projet F# et de la mise en cache ; +Activer les références entre projets en mémoire ; +Options de performances IntelliSense ; +Activer les données périmées pour les fonctionnalités IntelliSense ; +Durée d’utilisation des résultats périmés (en millisecondes) ; +Parallélisation (redémarrage nécessaire); +Activer la vérification de type parallèle avec les fichiers de signature ; +Activer la résolution de référence parallèle ; +Activer les références de recherche rapide et renommer (expérimental) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Liens de navigation ; +Afficher les liens de navigation en tant que ; +Soulignement uni ; +Soulignement pointé ; +Soulignement en tirets ; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index d3a30c88bb6..389e4eac16c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Guide struttura a blocchi; +Mostra le linee guida per la struttura per il codice F#; +Delinea; +Mostra nodi struttura e comprimibili per il codice F#; +Suggerimenti incorporati; +Visualizza suggerimenti di tipo inline (sperimentale); +Visualizza suggerimenti per i nomi di parametro inline (sperimentale); Birra @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Semplifica i nomi (rimuovere qualificatori non necessari); +Posiziona sempre le istruzioni open al primo livello; +Rimuovi le istruzioni open non usate; +Analizza e suggerisci le correzioni per i valori inutilizzati; +Suggerisci i nomi per gli identificatori non risolti; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Convertire 'using' di C# in F# 'open' @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Riformattar il rientro dopo operazione incolla (sperimentale) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Elenchi di completamento; +Mostra elenco di completamento dopo l'eliminazione di un carattere; +Mostra elenco di completamento dopo la digitazione di un carattere; +Mostra simboli negli spazi dei nomi non aperti; +Immetti comportamento chiave; +Non aggiungere mai una nuova riga su Invio; +Aggiungi nuova riga su Invio solo dopo aver digitato la parola completa; +Aggiungi sempre nuova riga su Invio; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Opzioni prestazioni progetto F# e memorizzazione nella cache; +Abilita riferimenti tra progetti in memoria; +Opzioni prestazioni IntelliSense; +Abilita dati non aggiornati per le funzionalità di IntelliSense; +Tempo prima dell'utilizzo dei risultati non aggiornati (in millisecondi); +Parallelizzazione (richiede il riavvio); +Abilita il controllo dei tipi paralleli con i file di firma; +Abilita risoluzione riferimenti paralleli; +Abilita la ricerca rapida dei riferimenti e la ridenominazione (sperimentale) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Collegamenti di spostamento; +Mostra collegamenti di spostamento come; +Sottolineatura a tinta unita; +Sottolineatura punto; +Trattino sottolineato; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index af120283f96..7f656e46792 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + ブロック構造ガイド; +F# コードの構造ガイドラインを表示します。 +アウトライン; +F# コードのアウトラインと折りたたみ可能なノードを表示します。 +インライン ヒント; +インライン型のヒントを表示する (試験段階); +インライン パラメーター名のヒントを表示する (試験段階);ビール @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + 名前を簡略化します (不要な修飾子を削除する); +常に open ステートメントを最上位レベルに配置します。 +未使用の open ステートメントを削除します。 +未使用の値の修正を分析して提案します。 +未解決の識別子の名前を提案します; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + C# 'using' を F# 'open' に変換する @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + 貼り付け時にインデントを再フォーマットする (試験段階) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + 入力候補リスト; +文字が削除された後に完了リストを表示します。 +文字が入力された後に入力候補一覧を表示します。 +開かれていない名前空間にシンボルを表示します。 +キーの動作を入力します。 +Enter キーで改行を追加しないでください。 +完全に入力された単語の末尾の後に Enter キーで改行を追加します。 +常に Enter キーを押して新しい行を追加します。 @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F# プロジェクトとキャッシュのパフォーマンス オプション; +メモリ内のプロジェクト間参照を有効にする。 +IntelliSense パフォーマンス オプション; +IntelliSense 機能の古いデータを有効にする。 +古い結果が使用されるまでの時間 (ミリ秒); +並列化 (再起動が必要); +署名ファイルを使用して並列型チェックを有効にする。 +並列参照解決を有効にする; +高速検索参照の有効化と名前の変更 (試験段階) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + ナビゲーション リンク; +ナビゲーション リンクを次のように表示します。 +塗りつぶしの下線; +ドットの下線; +ダッシュ下線; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 88a046021ec..1e2ef1553ac 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + 블록 구조 안내선, +F# 코드에 대한 구조 지침 표시, +개요, +F# 코드에 대한 개요 및 축소 가능한 노드 표시, +인라인 힌트, +인라인 형식 힌트 표시(실험적), +인라인 매개 변수 이름 힌트 표시(실험적); 맥주 @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + 이름 간소화(불필요한 한정자 제거), +항상 최상위 수준에 open 문 배치, +사용되지 않는 열린 문을 제거, +사용되지 않는 값에 대한 수정 사항 분석 및 제안, +확인되지 않은 식별자의 이름 제안, Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + C# 'using'을 F# 'open'으로 변환 @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + 붙여넣을 때 들여쓰기 서식 다시 지정(실험적) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + 완료 목록, +문자가 삭제된 후 완성 목록 표시, +문자를 입력한 후 완성 목록 표시, +열지 않은 네임스페이스에 기호 표시, +키 동작 입력, +<Enter> 키를 누를 때 새 줄을 추가하지 않음, +완전히 입력된 단어의 끝 뒤에 Enter 키를 누를 때만 새 줄 추가, +Enter 키를 누를 때 항상 새 줄 추가, @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F# 프로젝트 및 캐싱 성능 옵션, +메모리 내 프로젝트 간 참조 사용, +IntelliSense 성능 옵션; +IntelliSense 기능에 부실 데이터 사용 +부실 결과가 사용될 때까지의 시간(밀리초) +병렬 처리(다시 시작해야 함) +서명 파일을 사용한 병렬 형식 검사 사용 +병렬 참조 확인 사용 +빠른 찾기 참조 및 이름 바꾸기 사용(실험적) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + 탐색 링크, +탐색 링크를 다음으로 표시, +단색 밑줄, +점 밑줄, +대시 밑줄, diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index f0bbd8ede7c..afa8fa36578 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Prowadnice struktury bloku; +Pokaż wytyczne dotyczące struktury dla kodu języka F#; +Tworzenie konspektu; +Pokaż konspekt i zwijane węzły dla kodu języka F#; +Wskazówki wbudowane; +Wyświetl wskazówki typu wbudowanego (eksperymentalne); +Wyświetl wskazówki dotyczące nazw parametrów wbudowanych (eksperymentalne); Piwo @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Uprość nazwy (usuń niepotrzebne kwalifikatory); +Zawsze umieszczaj otwarte instrukcje na najwyższym poziomie; +Usuń nieużywane otwarte instrukcje; +Analizuj i sugeruj poprawki dla nieużywanych wartości; +Sugeruj nazwy dla nierozpoznanych identyfikatorów; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Konwertuj „using” języka C# na „open” języka F# @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Ponowne formatowanie wcięcia przy wklejeniu (eksperymentalne) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Listy uzupełniania; +Pokaż listę uzupełniania po usunięciu znaku; +Pokaż listę uzupełniania po wpisaniu znaku; +Pokaż symbole w nieotwartych przestrzeniach nazw; +Wprowadź zachowanie klucza; +Nigdy nie dodawaj nowego wiersza przy wprowadzaniu; +Dodaj nowy wiersz w enterie tylko po zakończeniu w pełni wpisanego wyrazu; +Zawsze dodawaj nowy wiersz przy wprowadzaniu; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Opcje wydajności projektów i buforowania języka F#; +Włącz odwołania między projektami w pamięci; +Opcje wydajności funkcji IntelliSense; +Włącz nieaktualne dane dla funkcji IntelliSense; +Czas do użycia nieodświeżonych wyników (w milisekundach); +Równoległość (wymaga ponownego uruchomienia); +Włącz równoległe sprawdzanie typów za pomocą plików podpisu; +Włącz równoległe rozpoznawanie odwołań; +Włącz szybkie znajdowanie odwołań i zmianę nazwy (eksperymentalne) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Linki nawigacyjne; +Pokaż linki nawigacyjne jako; +Pełne podkreślenie; +Podkreślenie kropką; +Podkreślenie kreską; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index ebaf694f5c8..a4f4b36fd67 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Guias de Estrutura de Bloco; +Mostrar diretrizes de estrutura para o código F#; +Estrutura de tópicos; +Mostrar estrutura de tópicos e nós recolhíveis para o código F#; +Dicas embutidas; +Exibir dicas do tipo embutido (experimental); +Exibir dicas de nome de parâmetro embutidas (experimental);Cerveja @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Simplificar nomes (remover qualificadores desnecessários); +Sempre colocar instruções abertas no nível superior; +Remover instruções abertas não utilizadas; +Analisar e sugerir correções para valores não utilizados; +Sugerir nomes para identificadores não resolvidos; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Converter 'using' de C# em 'open' de F# @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Reformatar o recuo na pasta (Experimental) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Listas de Conclusão; +Mostrar a lista de conclusão após a exclusão de um caractere; +Mostrar a lista de conclusão depois que um caractere for digitado; +Mostrar símbolos em namespaces não abertos; +Inserir o comportamento da tecla; +Nunca adicionar uma nova linha ao pressionar Enter; +Somente adicionar uma nova linha ao pressionar Enter após digitar toda a palavra; +Sempre adicionar uma nova linha ao pressionar Enter; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Opções de Desempenho de Projeto e Cache do F#; +Habilitar referências entre projetos na memória; +Opções de Desempenho do IntelliSense; +Habilitar dados obsoletos para recursos do IntelliSense; +Tempo até que os resultados obsoletos sejam usados (em milissegundos); +Paralelização (requer reinicialização); +Habilitar a verificação de tipo paralelo com arquivos de assinatura; +Habilitar a resolução de referência paralela; +Habilitar localizar referências rapidamente e renomear (experimental) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Links de navegação; +Mostrar links de navegação como; +Sublinhado sólido; +Sublinhado pontilhado; +Sublinhado tracejado; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index b6b10d8a608..74e64e6afea 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Направляющие для структуры блоков; +Показать рекомендации по структуре для кода F#; +Структурирование; +Показать структурирование и свертываемые узлы для кода F#; +Встроенные подсказки; +Отображать подсказки для встроенных типов (экспериментальная версия); +Отображать подсказки для имен встроенных параметров (экспериментальная версия);Пиво @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Упростить имена (удалить ненужные квалификаторы); +Всегда располагать открытые операторы на верхнем уровне; +Удалить неиспользуемые открытые операторы; +Анализировать и предлагать исправления для неиспользуемых значений; +Предлагать имена для неразрешенных идентификаторов; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + Преобразовать "using" C# в "open" F# @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Повторно форматировать отступы при вставке (экспериментальная функция) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Списки завершения; +Показывать список завершения после удаления символа; +Показывать список завершения после ввода символа; +Показывать символы в неоткрытых пространствах имен; +Поведение при нажатии клавиши ВВОД; +Никогда не добавлять новую строку при нажатии клавиши ВВОД; +Добавлять новую строку при нажатии клавиши ВВОД только в конце полностью введенного слова; +Всегда добавлять новую строку при нажатии клавиши ВВОД; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + Проект F# и параметры производительности кэширования; +Включить перекрестные ссылки между проектами в памяти; +Параметры производительности IntelliSense; +Включение устаревших данных для функций IntelliSense; +Время использования устаревших результатов (в миллисекундах); +Параллелизация (требуется перезапуск); +Включить параллельную проверку типа с файлами подписей; +Включить параллельное разрешение ссылок; +Включить быстрый поиск ссылок и переименование (экспериментальная версия) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Ссылки навигации; +Показывать ссылки навигации как; +Сплошное подчеркивание; +Подчеркивание точками; +Подчеркивание штрихами; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 690789d5167..524e2404af2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + Blok Yapısı Kılavuzları; +F# kodu için yapı yönergelerini göster; +Anahat oluşturma; +F# kodu için ana hattı ve daraltılabilir düğümleri göster; +Satır içi ipuçları; +Satır içi tür ipuçlarını görüntüle (deneysel); +Satır içi parametre adı ipuçlarını görüntüle (deneysel);Bira @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + Adları basitleştir (gereksiz niteleyicileri kaldır); +Açık deyimleri her zaman en üst düzeye yerleştir; +Kullanılmayan açık deyimleri kaldır; +Kullanılmayan değerleri analiz et ve bunlara düzeltmeler öner; +Çözümlenmemiş tanımlayıcılar için ad öner; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + C# 'using' sözcüğünü F# 'open' sözcüğüne dönüştür @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + Yapıştırırken girintiyi yeniden biçimlendir (Deneysel) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + Tamamlama Listeleri; +Bir karakter silindikten sonra tamamlama listesini göster; +Bir karakter yazıldıktan sonra tamamlama listesini göster; +Açılmamış ad alanlarında simgeleri göster; +Enter tuşu davranışı; +Enter tuşunda hiçbir zaman yeni satır ekleme; +Yalnızca tam olarak yazılan sözcükten sonra basılan Enter tuşunda için yeni satır ekle; +Enter tuşunda her zaman yeni satır ekle; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F# Proje ve Önbelleğe Alma Performans Seçenekleri; +Bellek içi çapraz proje başvurularını etkinleştir; +IntelliSense Performans Seçenekleri; +IntelliSense özellikleri için durum verilerini etkinleştir; +Eski sonuçlar kullanılana kadar geçen süre (milisaniye olarak); +Paralelleştirme (yeniden başlatma gerektirir); +İmza dosyalarıyla paralel tür denetlemeyi etkinleştir; +Paralel başvuru çözümlemeyi etkinleştir; +Başvuruları hızlı bulma ve yeniden adlandırmayı etkinleştir (deneysel) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + Gezinti bağlantıları; +Gezinti bağlantılarını gösterme biçimi; +Altı düz çizili; +Altı noktalı çizili; +Çizgi altı çizili; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index f455ffc5126..b65d9f5979f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + 块结构参考线; +显示 F# 代码的结构准则; +大纲; +显示 F# 代码大纲和可折叠的节点; +内联提示; +显示内联类型提示(实验性); +显示内联参数名称提示(实验性);啤酒 @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + 简化名称(移除不必要的限定符); +始终将 open 语句置于顶层; +移除未使用的 open 语句; +分析未使用的值并提出修复建议; +建议适用于未解析标识符的名称; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + 将 C# “using” 转换为 F# “open” @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + 粘贴时重新设置缩进格式(实验) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + 完成列表; +删除字符后显示完成列表; +键入字符后显示完成列表; +在未打开的命名空间中显示符号; +Enter 键行为; +从不在 Enter 上添加新行; +仅在完全键入的单词结尾后在 Enter 上添加新行; +始终在 Enter 上添加新行; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F# 项目和缓存性能选项; +启用内存中跨项目引用; +IntelliSense 性能选项; +为 IntelliSense 功能启用过时数据; +使用过时结果之前的时间(以毫秒为单位); +并行化(需要重启); +使用签名文件启用并行类型检查; +启用并行引用解析; +启用快速查找引用和重命名(实验性) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + 导航链接; +将导航链接显示为; +实心下划线; +点下划线; +划线下划线; diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 2cc59a1fa87..67ff049db0e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -35,13 +35,13 @@ Show outlining and collapsible nodes for F# code; Inline hints; Display inline type hints (experimental); Display inline parameter name hints (experimental);Beer - Block Structure Guides; -Show structure guidelines for F# code; -Outlining; -Show outlining and collapsible nodes for F# code; -Inline hints; -Display inline type hints (experimental); -Display inline parameter name hints (experimental);Beer + 區塊結構輔助線; +顯示 F# 程式碼的結構方針; +概述; +顯示 F# 程式碼的大綱與可折疊的節點; +內嵌提示; +顯示內嵌類型提示 (實驗性); +顯示內嵌參數名稱提示 (實驗性);啤酒 @@ -50,16 +50,16 @@ Always place open statements at the top level; Remove unused open statements; Analyze and suggest fixes for unused values; Suggest names for unresolved identifiers; - Simplify names (remove unnecessary qualifiers); -Always place open statements at the top level; -Remove unused open statements; -Analyze and suggest fixes for unused values; -Suggest names for unresolved identifiers; + 簡化名稱 (移除不必要的辨識符號); +一律將開啟語句放置在最上層; +移除未使用的開啟語句; +分析並建議未使用值的修正; +建議未解析識別碼的名稱; Convert C# 'using' to F# 'open' - Convert C# 'using' to F# 'open' + 將 C# 'using' 轉換為 F# 'open' @@ -104,7 +104,7 @@ Suggest names for unresolved identifiers; Re-format indentation on paste (Experimental) - Re-format indentation on paste (Experimental) + 在貼上時重新格式化縮排 (實驗性) @@ -126,14 +126,14 @@ Enter key behavior; Never add new line on enter; Only add new line on enter after end of fully typed word; Always add new line on enter; - Completion Lists; -Show completion list after a character is deleted; -Show completion list after a character is typed; -Show symbols in unopened namespaces; -Enter key behavior; -Never add new line on enter; -Only add new line on enter after end of fully typed word; -Always add new line on enter; + 完成清單; +刪除字元後顯示完成清單; +輸入字元後顯示完成清單; +在未開啟的命名空間中顯示符號; +輸入金鑰行為; +在按 ENTER 時永不新增新行; +只在完整輸入文字的結尾之後才在按 ENTER 時新增新行; +按 ENTER 時一律新增新行; @@ -156,15 +156,15 @@ Parallelization (requires restart); Enable parallel type checking with signature files; Enable parallel reference resolution; Enable fast find references & rename (experimental) - F# Project and Caching Performance Options; -Enable in-memory cross project references; -IntelliSense Performance Options; -Enable stale data for IntelliSense features; -Time until stale results are used (in milliseconds); -Parallelization (requires restart); -Enable parallel type checking with signature files; -Enable parallel reference resolution; -Enable fast find references & rename (experimental) + F# 專案和快取效能選項; +啟用記憶體內部跨專案參考; +IntelliSense 效能選項; +啟用 IntelliSense 功能的過時資料; +使用過時結果之前的時間 (毫秒); +平行化 (需要重新開機); +啟用簽章檔案的平行類型檢查; +啟用平行參考解析; +啟用快速尋找參考和重新命名 (實驗性) @@ -178,11 +178,11 @@ Show navigation links as; Solid underline; Dot underline; Dash underline; - Navigation links; -Show navigation links as; -Solid underline; -Dot underline; -Dash underline; + 導覽連結; +導覽連結顯示為; +實線底線; +點底線; +虛線底線; diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 6be46211969..1bee0e3597c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Povolit odkazy rychlého hledání a přejmenování (experimentální) Find References Performance Options - Find References Performance Options + Najít možnosti výkonu odkazů Inline Hints - Inline Hints + Vložené nápovědy @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Povolit paralelní kontrolu typů pomocí souborů podpisu Enable parallel reference resolution - Enable parallel reference resolution + Povolit paralelní referenční rozlišení @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Paralelizace (vyžaduje restartování) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Zobrazit nápovědy k názvům vložených parametrů (experimentální) Display inline type hints (experimental) - Display inline type hints (experimental) + Zobrazení tipů pro vložený typ (experimentální) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 3011cc25b9c..08ef439e77e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Schnellsuche und Umbenennen von Verweisen aktivieren (experimentell) Find References Performance Options - Find References Performance Options + Leistungsoptionen für Verweise suchen Inline Hints - Inline Hints + Inlinehinweise @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Parallele Typüberprüfung mit Signaturdateien aktivieren Enable parallel reference resolution - Enable parallel reference resolution + Parallele Verweisauflösung aktivieren @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Parallelisierung (Neustart erforderlich) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Hinweise zu Inlineparameternamen anzeigen (experimentell) Display inline type hints (experimental) - Display inline type hints (experimental) + Hinweise für Inlinetypen anzeigen (experimentell) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 35568eda7a0..d2f291a7068 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Habilitar referencias de búsqueda rápida y cambio de nombre (experimental) Find References Performance Options - Find References Performance Options + Buscar opciones de rendimiento de referencias Inline Hints - Inline Hints + Sugerencias insertadas @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Habilitar la comprobación de tipos paralelos con archivos de firma Enable parallel reference resolution - Enable parallel reference resolution + Habilitar resolución de referencias paralelas @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Paralelización (requiere reiniciar) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Mostrar sugerencias de nombre de parámetro insertado (experimental) Display inline type hints (experimental) - Display inline type hints (experimental) + Mostrar sugerencias de tipo insertadas (experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 68f57243011..8ea5c20d659 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Activer les références de recherche rapide et renommer (expérimental) Find References Performance Options - Find References Performance Options + Options de performances de recherche de références Inline Hints - Inline Hints + Indicateurs inline @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Activer la vérification de type parallèle avec les fichiers de signature Enable parallel reference resolution - Enable parallel reference resolution + Activer la résolution de référence parallèle @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Parallélisation (Nécessite un redémarrage) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Afficher les indicateurs de nom de paramètre en ligne (expérimental) Display inline type hints (experimental) - Display inline type hints (experimental) + Afficher les indicateurs de type inline (expérimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 523841ce7e2..da3b4d77c6c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Abilitare la ricerca rapida dei riferimenti e la ridenominazione (sperimentale) Find References Performance Options - Find References Performance Options + Trovare opzioni prestazioni riferimenti Inline Hints - Inline Hints + Suggerimenti inline @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Abilitare il controllo dei tipi paralleli con i file di firma Enable parallel reference resolution - Enable parallel reference resolution + Abilitare risoluzione riferimenti paralleli @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Parallelizzazione (richiede il riavvio) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Visualizza suggerimenti per i nomi di parametro inline (sperimentale) Display inline type hints (experimental) - Display inline type hints (experimental) + Visualizzare suggerimenti di tipo inline (sperimentale) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 4f02151e44e..5a1a3671dde 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + 高速検索参照の有効化と名前の変更 (試験段階) Find References Performance Options - Find References Performance Options + 参照の検索のパフォーマンス オプション Inline Hints - Inline Hints + インラインのヒント @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + 署名ファイルを使用して並列型チェックを有効にする Enable parallel reference resolution - Enable parallel reference resolution + 並列参照解決を有効にする @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + 並列化 (再起動が必要) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + インライン パラメーター名のヒントを表示する (試験段階) Display inline type hints (experimental) - Display inline type hints (experimental) + インライン型のヒントを表示する (試験段階) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 0ea54bedbba..9a369afe62c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + 빠른 찾기 참조 및 이름 바꾸기 사용(실험적) Find References Performance Options - Find References Performance Options + 참조 성능 옵션 찾기 Inline Hints - Inline Hints + 인라인 힌트 @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + 서명 파일로 병렬 유형 검사 사용 Enable parallel reference resolution - Enable parallel reference resolution + 병렬 참조 해상도 사용 @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + 병렬화(다시 시작 필요) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + 인라인 매개 변수 이름 힌트 표시(실험적) Display inline type hints (experimental) - Display inline type hints (experimental) + 인라인 유형 힌트 표시(실험적) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index c11bdce4a7b..a38fb3184b2 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Włącz szybkie znajdowanie odwołań i zmień nazwę (eksperymentalne) Find References Performance Options - Find References Performance Options + Opcje wydajności znajdowania odwołań Inline Hints - Inline Hints + Wskazówki w tekście @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Włącz równoległe sprawdzanie typów za pomocą plików podpisu Enable parallel reference resolution - Enable parallel reference resolution + Włącz równoległe rozpoznawanie odwołań @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Równoległość (wymaga ponownego uruchomienia) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Wyświetlaj wbudowane wskazówki dotyczące nazw parametrów (eksperymentalne) Display inline type hints (experimental) - Display inline type hints (experimental) + Wyświetl wskazówki typu wbudowanego (eksperymentalne) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 50b7e6f8000..47c2ffbd415 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Habilitar localizar referências rapidamente e renomear (experimental) Find References Performance Options - Find References Performance Options + Opções de Localizar Referências de Desempenho Inline Hints - Inline Hints + Dicas Embutidas @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Habilitar a verificação de tipo paralelo com arquivos de assinatura Enable parallel reference resolution - Enable parallel reference resolution + Habilitar a resolução de referência paralela @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Paralelização (requer reinicialização) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Exibir dicas de nome de parâmetro embutidas (experimental) Display inline type hints (experimental) - Display inline type hints (experimental) + Exibir as dicas de tipo embutido (experimental) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 4dcb753f0c9..d7b25b83c37 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Включить быстрый поиск ссылок и переименование (экспериментальная версия) Find References Performance Options - Find References Performance Options + Параметры производительности поиска ссылок Inline Hints - Inline Hints + Встроенные подсказки @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + Включить параллельную проверку типа с файлами подписей Enable parallel reference resolution - Enable parallel reference resolution + Включить параллельное разрешение ссылок @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Параллелизация (требуется перезапуск) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Отображать подсказки для имен встроенных параметров (экспериментальная версия) Display inline type hints (experimental) - Display inline type hints (experimental) + Отображать подсказки для встроенных типов (экспериментальная версия) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 4f4286abe68..cb43cd3f76a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + Başvuruları hızlı bulma ve yeniden adlandırmayı etkinleştir (deneysel) Find References Performance Options - Find References Performance Options + Başvuruları Bul Performans Seçenekleri Inline Hints - Inline Hints + Satır İçi İpuçları @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + İmza dosyalarıyla paralel tür denetlemeyi etkinleştir Enable parallel reference resolution - Enable parallel reference resolution + Paralel başvuru çözümlemeyi etkinleştir @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + Paralelleştirme (yeniden başlatma gerektirir) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + Satır içi parametre adı ipuçlarını göster (deneysel) Display inline type hints (experimental) - Display inline type hints (experimental) + Satır içi tür ipuçlarını göster (deneysel) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 379907d0d29..90110088382 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + 启用快速查找引用和重命名(实验性) Find References Performance Options - Find References Performance Options + 查找引用性能选项 Inline Hints - Inline Hints + 内联提示 @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + 使用签名文件启用并行类型检查 Enable parallel reference resolution - Enable parallel reference resolution + 启用并行引用解析 @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + 并行化(需要重启) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + 显示内联参数名称提示(实验性) Display inline type hints (experimental) - Display inline type hints (experimental) + 显示内联类型提示(实验性) diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 155b2946c2b..37f9430761a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -9,17 +9,17 @@ Enable fast find references & rename (experimental) - Enable fast find references & rename (experimental) + 啟用快速尋找參考和重新命名 (實驗性) Find References Performance Options - Find References Performance Options + 尋找參考效能選項 Inline Hints - Inline Hints + 內嵌提示 @@ -39,12 +39,12 @@ Enable parallel type checking with signature files - Enable parallel type checking with signature files + 啟用簽章檔案的平行類型檢查 Enable parallel reference resolution - Enable parallel reference resolution + 啟用平行參考解析 @@ -69,17 +69,17 @@ Parallelization (requires restart) - Parallelization (requires restart) + 平行處理 (需要重新開機) Display inline parameter name hints (experimental) - Display inline parameter name hints (experimental) + 顯示內嵌參數名稱提示 (實驗性) Display inline type hints (experimental) - Display inline type hints (experimental) + 顯示內嵌類型提示 (實驗性) diff --git a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs index 5a49830098a..60b7fa0f0e4 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineParameterNameHintTests.fs @@ -406,3 +406,89 @@ let x = "test".Split("").[0].Split(""); let actual = getParameterNameHints document Assert.AreEqual(expected, actual) + + [] + let ``Hints are not shown for optional parameters with specified names`` () = + let code = + """ +type MyType() = + + member _.MyMethod(?beep: int, ?bap: int, ?boop: int) = () + + member this.Foo = this.MyMethod(3, boop = 4) +""" + + let document = getFsDocument code + + let expected = + [ + { + Content = "beep = " + Location = (5, 37) + } + ] + + let actual = getParameterNameHints document + + Assert.AreEqual(expected, actual) + + [] + let ``Hints are not shown when all optional parameters are named`` () = + let code = + """ +type MyType() = + + member _.MyMethod(?beep: int, ?bap : int, ?boop : int) = () + + member this.Foo = this.MyMethod(bap = 3, beep = 4) +""" + + let document = getFsDocument code + + let actual = getParameterNameHints document + + Assert.IsEmpty(actual) + + [] + let ``Hints are shown correctly for inner bindings`` () = + let code = + """ +let test sequences = + sequences + |> Seq.map (fun sequence -> sequence |> Seq.map (fun sequence' -> sequence' |> Seq.map (fun item -> item))) +""" + + let document = getFsDocument code + + let expected = + [ + { + Content = "mapping = " + Location = (3, 16) + } + { + Content = "mapping = " + Location = (3, 53) + } + { + Content = "mapping = " + Location = (3, 92) + } + ] + + let actual = getParameterNameHints document + + Assert.AreEqual(expected, actual) + + [] + let ``Hints are not shown when CustomOperation attribute is detected`` () = + let code = + """ +let q = query { for x in { 1 .. 10 } do select x } +""" + + let document = getFsDocument code + + let actual = getParameterNameHints document + + Assert.IsEmpty actual \ No newline at end of file diff --git a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineTypeHintTests.fs b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineTypeHintTests.fs index 0faf11e554c..6df54bce6a7 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineTypeHintTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Hints/InlineTypeHintTests.fs @@ -247,3 +247,21 @@ type Number<'T when IAddition<'T>>(value: 'T) = let actual = getTypeHints document CollectionAssert.AreEquivalent(expected, actual) + + + [] + let ``Hints are not shown when type is specified`` () = + let code = + """ +type MyType() = + + member _.MyMethod(?beep: int, ?bap: int, ?boop: int) = () + + member this.Foo = this.MyMethod(bap = 3, boop = 4) +""" + + let document = getFsDocument code + + let result = getTypeHints document + + Assert.IsEmpty(result) \ No newline at end of file diff --git a/vsintegration/tests/FSharp.Editor.Tests/Hints/OptionParserTests.fs b/vsintegration/tests/FSharp.Editor.Tests/Hints/OptionParserTests.fs index 778911047c8..00a82c99aa4 100644 --- a/vsintegration/tests/FSharp.Editor.Tests/Hints/OptionParserTests.fs +++ b/vsintegration/tests/FSharp.Editor.Tests/Hints/OptionParserTests.fs @@ -22,7 +22,7 @@ module OptionParserTests = let actual = OptionParser.getHintKinds options - Assert.AreEqual(expected, actual) + CollectionAssert.AreEquivalent(expected, actual) [] let ``Type hints on, parameter name hints off`` () = @@ -36,7 +36,7 @@ module OptionParserTests = let actual = OptionParser.getHintKinds options - Assert.AreEqual(expected, actual) + CollectionAssert.AreEquivalent(expected, actual) [] let ``Type hints off, parameter name hints on`` () = @@ -50,7 +50,7 @@ module OptionParserTests = let actual = OptionParser.getHintKinds options - Assert.AreEqual(expected, actual) + CollectionAssert.AreEquivalent(expected, actual) [] let ``Type hints on, parameter name hints on`` () = @@ -64,4 +64,4 @@ module OptionParserTests = let actual = OptionParser.getHintKinds options - Assert.AreEqual(expected, actual) + CollectionAssert.AreEquivalent(expected, actual)