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 1fa3a995d50..c568da7ade6 100644 --- a/src/Compiler/AbstractIL/ilsign.fs +++ b/src/Compiler/AbstractIL/ilsign.fs @@ -349,11 +349,10 @@ 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.IsFullySigned = diff --git a/src/Compiler/AbstractIL/ilsign.fsi b/src/Compiler/AbstractIL/ilsign.fsi index c67980166ab..9dcdbf8ecda 100644 --- a/src/Compiler/AbstractIL/ilsign.fsi +++ b/src/Compiler/AbstractIL/ilsign.fsi @@ -16,9 +16,9 @@ open System.IO [] 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 IsFullySigned: bool member PublicKey: byte[] 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/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 698c6e92023..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 = @@ -1482,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] @@ -1500,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 @@ -1562,7 +1534,7 @@ type internal FsiDynamicCompiler( | MultipleInMemoryAssemblies emEnv -> - let execs = EmitInMemoryAssembly (tcConfig, emEnv, ilxMainModule, m) + let execs = EmitInMemoryAssembly (tcConfig, emEnv, ilxMainModule) MultipleInMemoryAssemblies emEnv, execs @@ -1731,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 @@ -1850,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 @@ -1865,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 @@ -2221,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) @@ -2468,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") @@ -3405,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/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.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/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/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