From 6f664036e0265db06450b4879f6f623319fe627a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 30 May 2019 10:59:22 -0700 Subject: [PATCH 1/7] Cleanup xml in error message tests (#6902) * Cleanup xml * fixup some tests --- .../AssemblyAlgorithmId_001.fs | 2 +- .../AssemblyCompany/AssemblyCompany_001.fs | 2 +- .../AssemblyConfiguration_001.fs | 2 +- .../AssemblyCopyright_001.fs | 2 +- .../AssemblyDescription_001.fs | 2 +- .../AssemblyFileVersion_001.fs | 2 +- .../AssemblyInformationalVersion_001.fs | 2 +- .../AssemblyTitle/AssemblyTitle_001.fs | 2 +- .../AssemblyTrademark_001.fs | 2 +- .../AssemblyVersion/AssemblyVersion_001.fs | 2 +- .../EmittedIL/Misc/ModuleWithExpression01.fs | 2 +- .../fsc/codepage/Functional01.fs | 2 +- .../fsc/codepage/MatchingCodePage01.fsx | 2 +- .../CompilerOptions/fsc/codepage/Zero.fs | 2 +- .../fsc/determinism/PathMap1/pathmap.fs | 2 +- .../fsc/determinism/PathMap2/pathmap.fs | 2 +- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 2 +- .../Source/CompilerOptions/fsc/lib/dummy.fs | 2 +- .../Source/CompilerOptions/fsc/out/dummy.fs | 2 +- .../CompilerOptions/fsc/out/invalidchar.fs | 2 +- .../fsc/responsefile/responsefile01.fs | 2 +- .../fsc/responsefile/responsefile02.fs | 2 +- .../fsc/simpleresolution/simpleres_02.fs | 4 +- .../CompilerOptions/fsc/times/times01.fs | 78 ++++++------- .../Source/CompilerOptions/fsc/warn/nowarn.fs | 2 +- .../fsc/warn/nowarn_with_warnaserror03.fs | 4 +- .../fsi/arguments/PassedArguments01.fsx | 2 +- .../fsi/arguments/PassedArguments02.fsx | 2 +- .../fsi/arguments/PassedArguments03.fs | 2 +- .../fsi/arguments/PassedArguments04.fsx | 4 +- .../CompilerOptions/fsi/arguments/error02.fsx | 2 +- .../CompilerOptions/fsi/nologo/nologo01.fsx | 2 +- .../CompilerOptions/fsi/times/asargument.fsx | 2 +- .../CompilerOptions/fsi/times/times01.fs | 2 +- .../Constants/DecimalLiterals02.fs | 2 +- .../ExclamationMark02.fs | 2 +- .../ExceptionDefinitions/Abbreviation01.fsx | 2 +- .../Abbreviation_SampleCodeFromSpec01.fsx | 2 +- ...xceptionAsDerivedFromSystemException01.fsx | 2 +- .../ExnAsDiscriminatedUnion01.fsx | 2 +- .../GeneratedTypeNameNoClash01.fsx | 2 +- .../ImportCSharpException01.fsx | 2 +- .../ExceptionDefinitions/NamedFields01.fsx | 2 +- .../ExceptionDefinitions/Override01.fsx | 2 +- .../PatternMatch_SampleCodeFromSpec01.fsx | 2 +- .../Basic/Arrays.fsx | 2 +- .../Basic/Exceptions.fsx | 2 +- .../Basic/Generated_Record.fsx | 2 +- .../Basic/Lists.fsx | 2 +- .../Basic/NeverGenerated_Class.fsx | 2 +- .../Basic/NeverGenerated_Delegate.fsx | 2 +- .../Basic/NeverGenerated_Interface.fsx | 2 +- .../Basic/Options.fsx | 2 +- .../Basic/Sample_Records.fsx | 2 +- .../Basic/Sample_Tuples.fsx | 2 +- .../Basic/Structs.fsx | 2 +- .../Basic/Unions.fsx | 2 +- .../ModuleDefinitions/LightSyntax01.fsx | 2 +- .../ModuleAbbreviationWithModule01.fs | 2 +- .../ModuleDefinitions/ModuleSuffix02.fsx | 2 +- .../ModuleWithExpression01.fs | 2 +- .../ModuleWithExpression02.fs | 2 +- .../Production_ExceptionDefinition.fsx | 2 +- .../Production_ImportDeclaration.fsx | 2 +- .../Production_LetBindings_Binding.fsx | 2 +- .../Production_LetBindings_SideEff.fsx | 2 +- .../Production_ModuleAbbreviation.fsx | 2 +- .../Production_ModuleDefinition.fsx | 2 +- .../Production_OCamlCompat.fsx | 2 +- .../Production_TypeDefinitions.fsx | 2 +- .../RecordTypes/DispatchSlot_Equals01.fsx | 2 +- .../RecordTypes/DispatchSlot_GetHashCode.fsx | 2 +- .../RecordTypes/E_TypeInference01b.fs | 2 +- .../RecordTypes/Interface_IComparable.fsx | 2 +- .../RecordTypes/LongIdentifiers01.fsx | 2 +- .../RecordTypes/Member01.fsx | 2 +- .../RecordTypes/MutableFields01.fsx | 2 +- .../MutableFields_SampleFromSpec02.fsx | 2 +- .../RecordTypes/SampleFromSpec01.fsx | 2 +- .../RecordTypes/SampleFromSpec03.fsx | 2 +- .../RecordTypes/Scoping03.fsx | 2 +- .../RecordTypes/Scoping04.fsx | 2 +- .../RecordTypes/UnitType01.fsx | 2 +- .../Constraints_SampleFromSpec01.fsx | 2 +- .../TypeAbbreviations/Identity01.fsx | 2 +- .../ReorderingTypeVariables01.fsx | 2 +- .../TypeNestedInModules01.fsx | 2 +- .../UnionTypes/DispatchSlot_Equals01.fsx | 2 +- .../UnionTypes/DispatchSlot_GetHashCode.fsx | 2 +- .../UnionTypes/Interface01.fsx | 2 +- .../UnionTypes/Interface_IComparable.fsx | 2 +- .../UnionTypes/Member01.fsx | 2 +- .../UnionTypes/NamedFields01.fsx | 2 +- .../UnionTypes/NamedFields02.fsx | 2 +- .../UnionTypes/NamedFields03.fsx | 2 +- .../UnionTypes/Overrides01.fsx | 2 +- .../UnionTypes/Parenthesis01.fsx | 2 +- .../UnionTypes/Parenthesis03.fsx | 2 +- .../UnionTypes/Recursive01.fsx | 2 +- .../UnionTypes/SampleFromSpec01b.fsx | 2 +- .../UnionTypes/SampleFromSpec01d.fsx | 2 +- .../ScopeAndDataConstrAndPattern01.fsx | 2 +- .../UnionTypes/UnionCaseProduction01.fsx | 2 +- .../UnionTypes/UnionCasesProduction01.fsx | 2 +- .../E_accessibilityOnInterface.fs | 12 +- .../basic/LocalLetBinding01.fs | 2 +- .../AttributeUsage/WithBitwiseOr02a.fsx | 2 +- .../AttributeUsage/WithBitwiseOr02b.fsx | 2 +- .../Basic/FreeTypeVariable01.fs | 4 +- .../CustomAttributes/Basic/Function01.fs | 2 +- .../CustomAttributes/Basic/FunctionArg01.fs | 2 +- .../CustomAttributes/Basic/ReturnType01.fs | 2 +- .../CustomAttributes/Basic/ReturnType02.fs | 2 +- .../CustomAttributes/Basic/ReturnType03.fs | 2 +- .../LetBindings/Basic/E_AsPat01.fs | 2 +- .../LetBindings/Basic/Pathological02.fs | 2 +- .../LetBindings/Basic/Pathological04.fs | 2 +- .../TypeFunctions/typeofBasic001.fs | 2 +- .../typeofInCustomAttributes001.fs | 2 +- .../TypeFunctions/typeof_anonymous_01.fs | 2 +- .../NoOverloadIDSpecified.fs | 2 +- .../OverloadingMembers/TooGeneric.fs | 2 +- .../ModuleAbbreviations/SanityCheck.fs | 2 +- .../ModuleAbbreviations/useInsideModuleDef.fs | 2 +- .../useInsideNamespaceDef.fs | 2 +- .../useInsideNamespaceDefExternal.fs | 2 +- .../PatternMatching/LiteralNull01.fs | 2 +- .../AddressOf/addressof001.fsx | 2 +- .../AddressOf/addressof002.fsx | 2 +- .../AddressOf/addressof_local_unit.fsx | 2 +- .../GenericTypeAnnotations01.fs | 2 +- .../FloatingPointRangeExp01.fs | 2 +- .../CodeDisposalInMatch01.fs | 2 +- .../SequenceExpressions/IfThenElse04.fs | 2 +- .../SequenceExpressions/IfThenElse05.fs | 2 +- .../SequenceExpressions/IfThenElse06.fs | 2 +- .../SequenceExpressions/IfThenElse07.fs | 2 +- .../final_yield_bang_keyword_01.fs | 2 +- .../final_yield_dash_gt_01.fs | 2 +- .../final_yield_keyword_01.fs | 2 +- .../RigidTypeAnnotation01.fsx | 2 +- .../RigidTypeAnnotation02.fsx | 2 +- .../RigidTypeAnnotation_null01.fsx | 2 +- .../StaticCoercion_class01.fsx | 2 +- .../StaticCoercion_int_to_obj.fsx | 2 +- .../StaticCoercion_interface01.fsx | 2 +- .../StaticCoercion_interface02.fsx | 2 +- .../StaticCoercion_null_to_obj.fsx | 2 +- .../NoMoreValueRestriction01.fs | 2 +- .../TypeInference/IgnoreUnitParameters.fs | 2 +- .../Comments/E_embeddedString005.fs | 2 +- .../Comments/embeddedString001.fs | 2 +- .../Comments/embeddedString002.fs | 2 +- .../Comments/embeddedString003.fs | 2 +- .../Comments/embeddedString004.fs | 2 +- .../Comments/escapeCharsInComments001.fs | 2 +- .../Comments/escapeCharsInComments002.fs | 2 +- .../LexicalAnalysis/Comments/ocamlstyle001.fs | 2 +- .../Comments/ocamlstyle_nested001.fs | 2 +- .../Comments/ocamlstyle_nested002.fs | 2 +- .../Comments/ocamlstyle_nested003.fs | 2 +- .../Comments/ocamlstyle_nested004.fs | 2 +- .../Comments/ocamlstyle_nested005.fs | 2 +- .../E_ReservedIdentKeywords.fs | 34 +++--- .../backtickmoduleandtypenames.fsx | 2 +- .../NumericLiterals/casingBin.fs | 2 +- .../NumericLiterals/casingHex.fs | 2 +- .../NumericLiterals/casingIEEE-lf-LF01.fs | 2 +- .../NumericLiterals/casingIEEE-lf-LF02.fs | 2 +- .../NumericLiterals/casingOct.fs | 2 +- .../Shift/Generics/RightShift001.fs | 2 +- .../Shift/Generics/RightShift002.fs | 2 +- .../StringsAndCharacters/UnicodeString03.fs | 2 +- .../GreaterThanClosedCurly01.fs | 2 +- .../GreaterThanClosedCurly02.fs | 2 +- .../GreaterThanClosedCurly03.fs | 2 +- .../GreaterThanClosedCurly04.fs | 2 +- .../GreaterThanClosedCurly05.fs | 2 +- .../GreaterThanClosedParenthesis01.fs | 2 +- .../GreaterThanClosedSquare01.fs | 2 +- .../GreaterThanClosedSquare02.fs | 2 +- .../E_GreaterThanColon002.fs | 2 +- .../SymbolicOperators/GreaterThanColon001.fs | 2 +- .../OffsideExceptions/InfixTokenPlusOne.fs | 2 +- .../HashLight/First_Non_Comment_Text01.fs | 2 +- .../HashLight/default_in_fsi01.fs | 2 +- .../HashLight/default_in_fsi02.fs | 2 +- .../HashLight/indent_off_after_comment01.fs | 2 +- .../HashLight/light_off_01.fs | 2 +- .../RangeOperator01.fs | 2 +- .../RangeOperator01.fsx | 2 +- .../InheritFromAbstractClass.fs | 2 +- .../Sealed_Member_Override01.fsx | 2 +- .../LexicalScoping01.fs | 2 +- .../StaticLetDoDeclarations/Offside01.fs | 2 +- .../RecNonMutable01.fs | 2 +- .../ValidSignature_MultiArg01.fs | 2 +- .../ValidSignature_ReturningValues01.fs | 2 +- .../InterfaceTypes/MultipleInst03.fs | 2 +- .../StructTypes/E_StructInheritance01b.fs | 2 +- .../StructTypes/StructWithNoFields01.fs | 2 +- .../basic/NonConflictingIntrinsicMembers.fs | 2 +- .../TypeExtensions/basic/SignitureIssue01.fs | 2 +- .../TypeExtensions/basic/SignitureIssue01.fsi | 2 +- .../basic/SignitureIssue01.test.fs | 2 +- .../optional/E_typeext_opt005.fs | 4 +- .../TypeExtensions/optional/typeext_opt008.fs | 2 +- .../Named/E_ActivePatternHasNoFields.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec01.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec02.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec03.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec04.fs | 2 +- .../Named/E_Error_NonParam01.fs | 2 +- .../Named/E_Error_NonParam02.fs | 2 +- .../Named/E_Error_NonParam03.fs | 2 +- .../Named/E_Error_NonParam04.fs | 2 +- .../PatternMatching/Named/E_Error_Param01.fs | 2 +- .../PatternMatching/Named/E_Error_Param02.fs | 2 +- .../PatternMatching/Named/E_Error_Param03.fs | 2 +- .../PatternMatching/Named/E_Error_Param04.fs | 2 +- .../E_StructConstructor01.fsi | 2 +- .../Diagnostics/RangeOfDimensioned01.fs | 2 +- .../Diagnostics/RangeOfDimensioned02.fs | 4 +- .../Parsing/KnownTypeAsUnit01b.fs | 10 +- .../UnitsOfMeasure/Parsing/find_gtdef.fsx | 2 +- .../TypeAbbreviation_decimal_01.fs | 2 +- .../TypeAbbreviation_float32_01.fs | 2 +- .../TypeChecker/TypeAbbreviation_float_01.fs | 2 +- .../UnitsOfMeasure/WithOOP/Polymorphism02.fs | 2 +- ...E_AreYouMissingAnArgumentToAFunction01b.fs | 2 +- .../General/E_IncompleteConstruct01b.fs | 2 +- .../General/E_SpanExtendsToNextToken01.fs | 2 +- .../E_StructMustHaveAtLeastOneField.fs | 2 +- .../General/E_UnexpectedSymbol01.fs | 2 +- .../Diagnostics/General/Generic_Subtype01.fs | 2 +- .../W_InstantiationOfGenericTypeMissing02.fs | 2 +- .../NONTERM/attrUnionCaseDecl01b.fs | 2 +- .../Diagnostics/NONTERM/braceExpr01b.fs | 2 +- .../Source/Diagnostics/NONTERM/declExpr01b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl01b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl02b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl03.fs | 4 +- .../NONTERM/fileNamespaceImpl01b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator01b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator02b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator03b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator04b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator05b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator06b.fs | 2 +- .../NONTERM/memberDefinitionWithoutType01b.fs | 2 +- .../NONTERM/monadicExprNonEmptyInitial01b.fs | 2 +- .../NONTERM/monadicPatternClauses01b.fs | 2 +- .../Diagnostics/NONTERM/quoteExpr01b.fs | 2 +- .../Diagnostics/NONTERM/tuplewithlazy01b.fs | 2 +- .../Source/Diagnostics/NONTERM/typ01b.fs | 2 +- .../Diagnostics/NONTERM/typeConstraint01b.fs | 2 +- .../NONTERM/typedSeqExprBlock01b.fs | 2 +- .../NONTERM/typedSeqExprBlock02b.fs | 2 +- .../Source/EntryPoint/E_twofiles_002b.fs | 2 +- .../fsharpqa/Source/EntryPoint/behavior001.fs | 2 +- .../Source/EntryPoint/entrypointandFSI.fs | 2 +- .../Source/EntryPoint/entrypointandFSI02.fsx | 2 +- .../entrypointfunctionnotmain001.fs | 2 +- .../Source/EntryPoint/inamodule001.fs | 2 +- .../Source/EntryPoint/noarguments001.fs | 2 +- .../Source/EntryPoint/oneargument001.fs | 2 +- .../Source/EntryPoint/twofiles_001a.fs | 2 +- .../Source/EntryPoint/twofiles_001b.fs | 2 +- .../Source/Import/assign_to_static_field01.fs | 2 +- .../InteractiveSession/Misc/DeclareEvent.fsx | 2 +- .../Misc/DontShowCompilerGenNames01.fsx | 14 +-- .../Misc/E_RangeOperator01.fsx | 4 +- .../InteractiveSession/Misc/EmptyList.fsx | 2 +- .../Misc/NativeIntSuffix01.fs | 2 +- .../InteractiveSession/Misc/References.fsx | 2 +- .../InteractiveSession/Misc/References35.fsx | 2 +- .../InteractiveSession/Misc/References40.fsx | 2 +- .../InteractiveSession/Misc/TimeToggles.fsx | 4 +- .../Misc/UNativeIntSuffix01.fs | 2 +- .../Misc/UnitConstInput_6323b.fsx | 4 +- .../Core/Collections/Seq_Cast_Dispose01.fs | 2 +- .../Core/LanguagePrimitives/anytostring01.fsx | 108 +++++++++--------- .../Libraries/Core/Operators/CastOperator.fs | 2 +- tests/fsharpqa/Source/Misc/DefaultManifest.fs | 2 +- .../Source/Misc/WhetherEmbededManifest.fs | 2 +- .../Source/OCamlCompat/NoParensInLet01.fs | 2 +- .../Source/Printing/BindingsWithValues01.fsx | 42 +++---- .../Source/Printing/CustomExceptions02.fsx | 6 +- .../Source/Printing/DisposeOnSprintfA.fs | 2 +- .../Printing/ParamArrayInSignatures.fsx | 8 +- tests/fsharpqa/Source/Printing/Quotation01.fs | 6 +- .../Printing/SignatureWithOptionalArgs01.fs | 16 +-- .../UnitsOfMeasureIdentifiersRoundTrip01.fsx | 6 +- .../UnitsOfMeasureIdentifiersRoundTrip02.fsx | 6 +- .../UnitsOfMeasuresGenericSignature01.fsx | 2 +- .../UnitsOfMeasuresGenericSignature02.fsx | 2 +- .../Source/Printing/VariantTypes01.fs | 2 +- .../MemberHasMultiplePossibleDispatchSlots.fs | 2 +- .../Warnings/WarnOnlyOnLastExpression.fs | 2 +- .../Source/XmlDoc/Basic/XMLDocOnEnum01.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs | 2 +- .../Source/XmlDoc/OCamlDoc/ocamldoc001.fs | 2 +- tests/fsharpqa/Source/test.lst | 2 +- 307 files changed, 473 insertions(+), 481 deletions(-) diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs index d7f37d152cc..ec764831447 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyAlgorithmId -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs index 918cccc2b68..38550cb9e9d 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCompany -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs index f159e63c11e..66257e21647 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyConfiguration -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs index b19fe0c9783..d5bf3b71587 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCopyright -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs index 2a586e348c5..293ab4ad11a 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyDescription -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs index b507a18bd16..3b27e3a86df 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyFileVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs index 45653540755..d5a58722193 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyInformationalVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs index 4df4d7003be..01339cfcdb3 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTitle -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs index 5942474dfd8..45fd7e6205e 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTrademark -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs index 733384b1098..c855f442c20 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyVersion -// +// #light diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs index 97f178a786f..d9dfb9ac86f 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #NoMono #NoMT #CodeGen #EmittedIL // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs index 1d7f197fe2a..382cf1b56a5 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs @@ -3,7 +3,7 @@ // - The same source file (FunctionalLibrary01.fs) is compile twice, with different --codepage options // - The library file is designed so that it gets compiled to slightly different assemblies // - This file references both assemblies and should compile without problems -// +// #light diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx index eb417415555..d4ca66733d4 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions #load "FunctionalLibrary01.fs";; #q;; -// +// diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs index fb1d506c8e8..55e151c551b 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs @@ -1,7 +1,7 @@ // #NoMT #CompilerOptions // --codepage 0 // It does not mean much to me... -// +// #light let x = "a" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs index a5cdf2d0239..9dd5d2f70b2 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions #Deterministic -// +// // // IMPORTANT: PathMap1/pathmap.fs and PathMap2/pathmap.fs must be identical! module TestPathMap diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs index a5cdf2d0239..9dd5d2f70b2 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions #Deterministic -// +// // // IMPORTANT: PathMap1/pathmap.fs and PathMap2/pathmap.fs must be identical! module TestPathMap diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index e16db4e42e3..e0d7d42cc87 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -72,7 +72,7 @@ //section='NoSection ' ! option=splitting kind=OptionSwitch //section='NoSection ' ! option=versionfile kind=OptionString //section='NoSection ' ! option=times kind=OptionUnit -//section='NoSection ' ! option=showextensionresolution kind=OptionUnit +//section='NoSection ' ! option=showextensionresolution kind=OptionUnit //section='NoSection ' ! option=metadataversion kind=OptionString //section='NoSection ' ! option=d kind=OptionString //section='NoSection ' ! option=O kind=OptionSwitch diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs index 069fcced085..5dcac9cf663 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs index 069fcced085..5dcac9cf663 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs index f44d40f4923..9bad8413f89 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs index f6b04c2c5ef..4359bc00092 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs index 13e56008605..a7ea6871f67 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs index a8e2f22d2c0..5acad376be1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs @@ -1,7 +1,7 @@ // Regression test for FSharp1.0:4849 // Title: Promote "-simpleresolution" to a documented compiler switch -//mscorlib -//FSharp.Core +//mscorlib +//FSharp.Core exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs index 30331de28d9..b01b7a501da 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs @@ -14,46 +14,38 @@ namespace N2 module M3 = exit 0 -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Build Framework TC Imports\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import DLLs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Interface File \] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Initial simplify\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Lowertop optimization\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> ILX\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[ILX -> IL\] -//ilwrite: TIME.+Write Started -//ilwrite: TIME.+Module Generation Preparation -//ilwrite: TIME.+Module Generation Pass 1 -//ilwrite: TIME.+Module Generation Pass 2 -//ilwrite: TIME.+Module Generation Pass 3 -//ilwrite: TIME.+Module Generation Pass 4 -//ilwrite: TIME.+Finalize Module Generation Results -//ilwrite: TIME.+Generated Tables and Code -//ilwrite: TIME.+Layout Header of Tables -//ilwrite: TIME.+Build String/Blob Address Tables -//ilwrite: TIME.+Sort Tables -//ilwrite: TIME.+Write Header of tablebuf -//ilwrite: TIME.+Write Tables to tablebuf -//ilwrite: TIME.+Layout Metadata -//ilwrite: TIME.+Write Metadata Header -//ilwrite: TIME.+Write Metadata Tables -//ilwrite: TIME.+Write Metadata Strings -//ilwrite: TIME.+Write Metadata User Strings -//ilwrite: TIME.+Write Blob Stream -//ilwrite: TIME.+Fixup Metadata -//ilwrite: TIME.+Generated IL and metadata -//ilwrite: TIME.+Layout image -//ilwrite: TIME.+Writing Image -//ilwrite: TIME.+Finalize PDB -//ilwrite: TIME.+Signing Image -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Config File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Stats File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Copy referenced files\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib and FSharp.Core.dll\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import non-system references\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> IL\] +//ilwrite: TIME.+Write Started +//ilwrite: TIME.+Module Generation Preparation +//ilwrite: TIME.+Module Generation Pass 1 +//ilwrite: TIME.+Module Generation Pass 2 +//ilwrite: TIME.+Module Generation Pass 3 +//ilwrite: TIME.+Module Generation Pass 4 +//ilwrite: TIME.+Finalize Module Generation Results +//ilwrite: TIME.+Generated Tables and Code +//ilwrite: TIME.+Layout Header of Tables +//ilwrite: TIME.+Build String/Blob Address Tables +//ilwrite: TIME.+Sort Tables +//ilwrite: TIME.+Write Header of tablebuf +//ilwrite: TIME.+Write Tables to tablebuf +//ilwrite: TIME.+Layout Metadata +//ilwrite: TIME.+Write Metadata Header +//ilwrite: TIME.+Write Metadata Tables +//ilwrite: TIME.+Write Metadata Strings +//ilwrite: TIME.+Write Metadata User Strings +//ilwrite: TIME.+Write Blob Stream +//ilwrite: TIME.+Fixup Metadata +//ilwrite: TIME.+Generated IL and metadata +//ilwrite: TIME.+Layout image +//ilwrite: TIME.+Writing Image +//ilwrite: TIME.+Finalize PDB +//ilwrite: TIME.+Signing Image +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs index 9a2eb16929f..7f7d7accda8 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:3789 // Unfixable warning 45 -// +// #nowarn "0988" type I = abstract M : unit -> unit diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs index 149d67a2537..a829eea182e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs @@ -1,8 +1,8 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:4867 // nowarn has no effect if "Warning level = 4" and "Warnings as errors" -//FS0040 -//FS0021 +//FS0040 +//FS0021 #nowarn "21" #nowarn "40" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx index a34de38edf4..4ec51d38423 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments01\.fsx"\|] +//Args: \[\|"PassedArguments01\.fsx"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx index 5b6819251b6..3c0c0881a1e 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] +//Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs index fcdc1430a1b..491fa875410 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs @@ -1,3 +1,3 @@ -// Args: \[\|"PassedArguments03\.fs"\|] +//Args: \[\|"PassedArguments03\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx index 65477eb854f..17c37a083b1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx index d6d041937b3..5d040a2471c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx @@ -1,2 +1,2 @@ -// error FS0078:.+ +//error FS0078:.+ #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx index f56d132a6dd..6909de053cc 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -//NOTE +//NOTE #q;; diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx index 8231d242071..a06a2fa3adb 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -// +// #light exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs index 66d43ff9466..e30ea7ad563 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -//TIME.+Optimizations +//TIME.+Optimizations exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs index af9d419bf55..ff61e0a1b47 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #BasicGrammarElements #Constants #NoMono // This is a positive test on Dev10, at least until // FSHARP1.0:4523 gets resolved. -// +// let ok = 1.0E-50M // parses ok on Dev10 diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs index 3f358cb2754..d2ce98e00a7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs @@ -3,7 +3,7 @@ // Prefix only operators: !OP, ?OP, ~OP // Try to use !OP as an infix-op is an error // ?OP ~OP -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx index 055894027ff..4aac243eadf 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Abbreviation - using short and long identifiers -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx index 38f8c465856..087a7a40630 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 -// +// #light exception ThatWentBadlyWrong of string * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx index 33ed3c37769..c7e13ce9e77 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception values may be generated by defining and using classes that extends System.Exception // In this test we verify that both defitions can be used interchangably -// +// type E1(s) = class inherit System.Exception(s) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx index 1f4d6c24d21..5184278d076 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] -// +// #light exception E1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx index 9fa3d94c69f..c0b62be04ca 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx @@ -2,7 +2,7 @@ // An exception definition no longer generates a type with name idException // (this used to be the case until Dev10 Beta1, but not anymore) // In this case we check and see what happens when such a type already exist -// +// exception E of string type EException = | EE diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx index e9dd9c03e5a..7a27a7ca85c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Import C# exception in F# -// +// #light #r "CSharpException.dll" diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx index 305c5ef9e1d..806cb29ed94 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Specify and match on named fields -// +// exception AAA of V1 : int * V2 : int * V3 : string exception BBB of bool * bool diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx index 0b09b6befba..1cb548bd737 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx @@ -2,7 +2,7 @@ // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] // This is reqgression test for FSHARP1.0:3725 -// +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx index 2efcb980ff7..ad08703e8c0 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 // It shows how to use exceptions in pattern match -// +// #light exception Error of int * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx index 5c240f9bdc7..0971bca358d 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Arrays -// +// let samples = [ [|1;1+1|] = [|1;2|]; [|hash (1,1+1)|] = [|hash (1,2)|]; diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx index 7492fef2873..df1081f8e07 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on exception // See bug FSHARP1.0:5345 -// +// exception E of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx index e9857b417b6..45b1a9b3007 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Record -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx index 80f3468d47f..5241648be98 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // List -// +// let samples = [ [1;1+1] = [1;2]; // tuples support structural equality [hash (1,1+1)] = [hash (1,2)]; // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx index 43b309619a5..188aa419588 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Classes -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx index 2b2abb21a6f..00dbdb7c4aa 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Delegate -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx index 6997648873e..1305080924c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Interface -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx index 2a23ced7f95..ad0945f5954 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Options // Interesting case: Some vs None -// +// let samples = [ Some(1,1+1) = Some(1,2); // tuples support structural equality Some(hash (1,1+1)) = Some(hash (1,2)); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx index aecacd74ee5..96a9518be1e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// type R = R of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx index 30044004352..e90c48f0632 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// let samples = [ (1,1+1) = (1,2); // tuples support structural equality hash (1,1+1) = hash (1,2); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx index 959e012f670..e5a163f92a8 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Structs -// +// type S<'a> = struct new ( a:'a ) = { f = a } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx index 89a77d2e228..bafeef6d6eb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Unions -// +// type DU = | A | B diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx index a322a5053bb..0d9d10e2caf 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Light syntax: begin/end can be omitted -// +// #light module N1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs index bf3f02a16ea..a4eb1fe2322 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Module abbreviation: // Trying to abbreviate a module is ok -// +// #light // Module abbreviations diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx index 08af03fe86f..9ce7dfd7feb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Decorating a module with the CompilationRepresentation -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs index b1ca8692338..b4e987a1520 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #Modules // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs index 1368f2aabe5..de640d9e72c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // This is unfortunate, but this is the current behavior for this release. // So, the workaround is to use begin... end -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx index af3a544868d..d66062890bc 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M4 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx index 62b675e22ec..0c280103325 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M7 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx index 2420054016f..bdd1915e30a 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M1 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx index 80e2b4dca46..f4e122d45d8 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx index 8e33910fde9..0e0b33c6116 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M6 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx index 5cb177ab565..72b6bb5de9c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M5 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx index e1d533892ed..ad3085500b5 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Modules // Productions // Compile with: --mlcompatibility -a --warnaserror+ -// +// #light module N1 = struct diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx index 2e7d213e138..7eb95ab5c8e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M3 = begin type T = | A = 1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx index e1fc1df313c..76a42060e73 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx index dab0aae3fd4..a2c6072efc5 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx @@ -3,7 +3,7 @@ // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs index bc4b7aa4e02..dff437e6396 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs @@ -2,7 +2,7 @@ // Verify appropriate error with ambiguous record inference // Same as 01, but with generic types // Regression test for FSHARP1.0:2780 -//No assignment given for field 'Y' of type 'N\.M\.Blue<_>' +//No assignment given for field 'Y' of type 'N\.M\.Blue+ namespace N module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx index 1a05f0322ba..d23f40d38f6 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // By default, record types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx index bbfd268769e..f107174b968 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // This test is a bit of a kitchen-sink, but its main // purpose is to validate that we can use fully qualified field names -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx index 9ccfb90db7b..32b251c047c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Record types may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx index 4f148fcd617..049ec44f13c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Verify that record fields may be marked mutable // In this case, only one field is marked as mutable -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx index 734682db99e..d90102244bd 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (second code snippet) -// +// #light type R2 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx index 7fe45138971..41fe778adc3 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 -// +// #light type R1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx index 007989b7a82..22d4a314017 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (3rd code snippet) -// +// #light type R = { dx : int; dy: int } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx index e7a5527184c..ac35685aa01 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope -// +// #light type T1 = { a : decimal } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx index c64eab36cc9..5fd5f32742f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope // Also, in this case we see that there is no collision when the field and type have the same name -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx index 380c7a54380..2735d24b515 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field has type 'unit' (which is kind of special) -// +// #light type T1 = { u : unit;} diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx index c5df98643ea..b6c2be98862 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules // Abbreviation: the constraints on the right-hand-side are sufficient -// +// #light type IA = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx index 5d6d34022f9..9d1f5733876 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // A type that redefine itself -- not very useful, but ok -// +// #light type Z = Z // ok (useless, but ok) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx index 377001a76ba..35a11690587 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx @@ -2,7 +2,7 @@ // Abbreviation: it is ok to reorder type variables // Used to be regression test for FSHARP1.0:3738 // It is now regression test for FSHARP1.0:4786 -// +// module M type Reverse<'a,'b> = 'b -> 'a diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx index a8a08368b18..66456c0d0f9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // The type nested in modules -// +// #light module M1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx index 44eb0b1bacb..9cec35e1c95 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx index 7c256533dcd..e098945c59b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot GetHashCode // We also minimally verify that the hash codes are different for this simple case -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx index d70e164488b..263007b6093 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include implement interfaces -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx index 51eeaf412e9..d2692cf9af9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx index 9ba75b652d7..c3fbee93b7e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // DU may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx index f771144bfca..e4fe32ea353 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Constructing DUs with named fields -// +// type Lunch = | Sandwich of meat : string * pickles : bool * layers : int | Soup of Ounces : float * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx index 0585842d8b0..4d7d6b92703 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Should be able to pattern match using named or positional fields -// +// type MyDU = | Case1 of int * int * int * Named1 : int * Named2 : int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx index 263ea8620e4..70c518c1930 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Potentially ambiguous cases where we need to decide if user is specifying named argument or passing result of equality comparison to boolean/generic field -// +// let checkType (o : obj) ty = if o.GetType() = ty then () diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx index 334e604d724..54bf0f4b11f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include overrides -// +// [] [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx index 71561c2a87e..cf39d596adb 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Paretheses are significant in DU definitions -// +// #light type T = | C of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx index 7c6875ff5f6..f07b38c462b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #TypesAndModules #Unions // Regression test for FSHARP1.0:4787 ("Discriminated union constructors as first class values") -// +// type A = | A1 of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx index 2bc63a34c34..ab64c103be7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx @@ -2,7 +2,7 @@ // DU - with recursive definition // Note: don't try to make much sense of this code. // It's a rather (intentionally) convoluted code. -// +// #light type E = | Sum of E * E diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx index ecdd581962f..163d70cd452 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // Sample from spec - using #light "off" -// +// #light "off" (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx index 6b01a68a9ed..cd241344ffd 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx @@ -4,7 +4,7 @@ // The with/end tokens can be omitted when using the #light syntax option as long as the // type-defn-elements vertically aligns with the first ‘|’ in the union-cases // Regression test for FSHARP1.0:3707 -// +// #light (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx index 30687482605..0917601943b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx @@ -4,7 +4,7 @@ // It also covers the fact that they can be used both as data constructors // and to form patterns. // This is the positive case. -// +// #light [] type ı diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx index f182ae8ce49..af214bf2b49 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx @@ -4,7 +4,7 @@ // | id -- nullary union case // | id of type * ... * type -- n-ary union case // | id : sig-spec -- n-ary union case -// +// #light type T = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx index 5596aefbd1c..e2150095cef 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // union-cases := [ ‘|’ ] union-case ‘|’ ... ‘|’ union-case -// +// #light // With missing | diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs index e8489051c53..ae579c72f80 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs @@ -1,12 +1,12 @@ // #Regression #Conformance #DeclarationElements #Accessibility #light -//\(17,14-18,12\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(18,14-19,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(19,14-20,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(20,14-20,20\): error FS0010: unexpected keyword 'public' in member definition. Expected identifier, '\(', '\(\*\)' or other token -//\(21,5-22,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(22,14-22,22\): error FS0010: unexpected keyword 'internal' in member definition. Expected identifier, '\(', '\(\*\)' or other token +//\(17,14-18,12\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(18,14-19,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(19,14-20,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(20,14-20,20\): error FS0010: unexpected keyword 'public' in member definition. Expected identifier, '\(', '\(\*\)' or other token +//\(21,5-22,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(22,14-22,22\): error FS0010: unexpected keyword 'internal' in member definition. Expected identifier, '\(', '\(\*\)' or other token type public IDoStuffAsWell = abstract SomeStuff : int -> unit diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs index b432eafee8c..f10d65a84b7 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DeclarationElements #Accessibility // Regression test for FSHARP1.0:4679 -// +// module M type internal A() = class end diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx index eedaf6b9ef2..ff5676ea2fd 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02b.fsx, on class) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx index 36ff507f7d7..440f9a46029 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02a.fsx, on struct) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs index a31c1267b4b..291c83011d4 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs @@ -1,8 +1,8 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:1708 // internal compiler error for free type variable in attribute -//internal error -// +//internal error +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs index 05412591a44..fdea8b78ee7 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs index b75aa1b4ab8..89a67dd4075 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on the argument of a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs index 32842a0cebe..427aa2b82fc 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1165 // F# supports custom attributes on return type // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs index 355de813e7a..26bc70a04cd 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (two different attributes) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs index 8f27434b167..0676010d0dc 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (same attribute repeated twice) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs index e774ae5c32b..79385956e60 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DeclarationElements #LetBindings // Verify errors associated with using let bindings + pattern matching -//Type mismatch\. Expecting a +//Type mismatch\. Expecting a+ let one, two = 1, 2, 3 diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs index a546fde44bd..1f3590543dd 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs index db5aca52857..27015737d9a 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs index 93953ffa217..12a318bdac5 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // Basic usage of typeof -// +// #light let x = typeof diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs index 389dfbb8da0..c315468d874 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // can't use typeof in attributes -// +// [)>] type TestTypeOnType() = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs index 181044fdacb..e0b29ab5585 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:2320 // Type passed to typeof<> is _ -// +// #light let _ = typeof<_> diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs index b214cf657ba..c4f77fe17d3 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #MemberDefinitions #Overloading // As of Beta2, we don't need OverloadIDs anymore! -// +// type Foo() = member this.SomeMethod (x:int) = true member this.SomeMethod (y:string) = false diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs index 96e0f5da737..fcd700ebe77 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #MemberDefinitions #Overloading // Regression test for FSHARP1.0:3388 // overloaded operators which are more generic than their enclosing class -// +// #light type Foo<'a,'b>() = #if TOO_GENERIC diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs index 97ead5bc661..d476d1d24d3 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs @@ -1,5 +1,5 @@ // #Conformance #DeclarationElements #Modules -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs index 50a62b56c13..b9c510b3960 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a module -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs index 3371d5ac8f4..24bb542c29f 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a namespace -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs index e090adafeb1..61c682c267c 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #Modules #ReqNOMT // Use module abbreviation inside a namespace // Module is defined in an external assembly -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs index d7741016041..a20dcca4dd3 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ControlFlow // Regression test for FSHARP1.0:2323 (Compiler ICE when matching on literal Null) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx index 1161e8d27a6..1611af55de7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (ref) -// +// #light #r @"addressof001dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx index 52368cae5f9..519f256a377 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (out) -// +// #light #r @"addressof002dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx index c36bea78fdd..ab127168910 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions // Regression test for FSHARP1.0:4183 // Assert failed in code that take the address of a local of type unit -// +// let f () = let dict = System.Collections.Generic.Dictionary() diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs index 262b175df4a..0f1a0653d47 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #ObjectConstructors // Regression test for FSHARP1.0:3857 // Incorrect FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type ''a'. -// +// #light type X = diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs index 6615b0a4121..4fe0d1146c6 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs @@ -3,7 +3,7 @@ // FSB 1005, float comprehensions of form "x0 .. dx .. x1" suffer rounding errors // After changes in BigInt, this is no longer a warning. -//Floating point ranges are experimental and may be deprecated in a future release +//Floating point ranges are experimental and may be deprecated in a future release let floatingPointRange = [0.0 .. 0.01 .. 2.0] let lastNum, sndToLast = floatingPointRange diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs index 07e0c0093aa..18c751f8192 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4365 // Mistake in generation of code for disposal in "match" sequence expressions -// +// let r = ref 0 let f () = [ if (incr r; true) then yield! failwith "" ] let x = (try f () with Failure _ -> [!r]) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs index 7cb9fc6b0a0..2ac4289fdef 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then [for i = 1 to 10 do yield i] // yield is not immediately under the 'then' branch, diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs index eeac39a5931..145442d6f8d 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then 1 else 2) ] (if p = [ 1 ] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs index 7868329a4ff..fcf5e4a2a14 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let y = [ if true then yield! [1;2] else () ] (if y = [1;2] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs index 41214f29903..55a248688fc 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let x = [ if true then yield! [1] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs index 3c9793e9ae5..5ce4014dd77 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->>" in a sequence expression is deprecated // Use "do yield! ..." instead -// +// #light let s = seq { for i in [1 .. 2] do yield! seq { yield i+1 } } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs index 0a149b1d29b..537141f6eae 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs @@ -3,7 +3,7 @@ // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr // Compile with --warnaserror -// +// #light let s1 = seq { for i in [ 1 .. 2 ] -> 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs index e6f8bceff17..bc0876af1de 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr -// +// #light let s1 = seq { yield 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx index d789557d0a0..9f1a449e249 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx index 6db2cbfdc03..53811ad4000 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding (function definition + function invocation) // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx index b45dbc64fda..c42d7ac54a0 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx @@ -7,7 +7,7 @@ // expr : ty // // Misc test on 'null' -// +// #light let a = null : string diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx index ba26509d6ab..83a7153666b 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy -// +// #light type K1() = class diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx index 1af94c3923e..e86d044d685 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - int -// +// #light let a = ( upcast 1 ) : obj let b = ( 1 :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx index fde1b72d2fd..e8189cdb727 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx index 8bb0edd84f1..2e896ef9c30 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface // Interface is defined in the base class -> can still upcast to I -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx index 0355b0147f6..d65de19a9d2 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - null -// +// #light let a = ( upcast null ) : obj let b = ( null :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs index eb5dcc1b987..97af65cbebd 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs @@ -1,6 +1,6 @@ // #Conformance #TypeInference // Verify error if you only specify some, but not all, type args -// +// let f<'a> x (y : 'a) = (x, y) // used to be error "Value restriction...". In Beta2, it is ok (val f : obj -> 'a -> obj * 'a) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs index 41689d49b55..92e7f412d0a 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs @@ -2,7 +2,7 @@ // Regression test for https://github.com/Microsoft/visualfsharp/issues/1749 // Type Inference // Explicit program entry point: [] -// +// let run1 (f: unit -> string) = f() diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs index 944e2270832..61b32dc9f2d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // string embedded in a comment: malformed string // which yield to a compilation error -//End of file in string embedded in comment begun at or before here diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs index fa317a2ee2d..00265542dd4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: invalid escape sequence // \s is not an escaped char, so it's the same as \\s -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs index 2370baad00e..d5250ec549d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate string containing the // block-comment-end token -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs index 09e204dfdde..4931f43463c 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs @@ -1,6 +1,6 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs index 3491c92e104..88dc701d70e 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence // A backslash in in the string -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs index f0a284920ba..622e431eeb2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:945 // comment lexing does not handle \" inside quoted strings -// +// #light (* simple escape chars (escape-char in the grammar) *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs index 742841694ca..4553f23c2b6 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:946 // comment lexing does not handle "" and \ inside @" strings -// +// #light (* @"\" *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs index e3ce9f34794..91f98df0bf4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs index e720d1e00a2..61a6c1ffc15 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y1 = (* This is a comment with (**) nested *) 0 exit (if y1 = 0 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs index 0d639e0121e..669873e81a9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y2 = (* This is a comment with * nested *) 2 exit (if y2 = 2 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs index 11d0d3840b9..caa6e1fcdf3 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y3 = (* This is a comment with (* *) nested *) 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs index e6e7f3bffe8..68ece1a9eb6 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y4 = (* This is a comment with (** **) nested *) 4 exit (if y4 = 4 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs index ab1add1c779..1aaa55e3330 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y5= (* This is a comment with (***) nested *) 5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs index d1a63a0c45d..993798e6e7d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs @@ -31,28 +31,28 @@ let virtual = 10 -//The identifier 'break' is reserved for future use by F# -//The identifier 'checked' is reserved for future use by F# -//The identifier 'component' is reserved for future use by F# +//The identifier 'break' is reserved for future use by F# +//The identifier 'checked' is reserved for future use by F# +//The identifier 'component' is reserved for future use by F# -//The identifier 'constraint' is reserved for future use by F# +//The identifier 'constraint' is reserved for future use by F# -//The identifier 'continue' is reserved for future use by F# -//The identifier 'fori' is reserved for future use by F# +//The identifier 'continue' is reserved for future use by F# +//The identifier 'fori' is reserved for future use by F# -//The identifier 'include' is reserved for future use by F# +//The identifier 'include' is reserved for future use by F# -//The identifier 'mixin' is reserved for future use by F# +//The identifier 'mixin' is reserved for future use by F# -//The identifier 'parallel' is reserved for future use by F# -//The identifier 'params' is reserved for future use by F# -//The identifier 'process' is reserved for future use by F# -//The identifier 'protected' is reserved for future use by F# -//The identifier 'pure' is reserved for future use by F# +//The identifier 'parallel' is reserved for future use by F# +//The identifier 'params' is reserved for future use by F# +//The identifier 'process' is reserved for future use by F# +//The identifier 'protected' is reserved for future use by F# +//The identifier 'pure' is reserved for future use by F# -//The identifier 'sealed' is reserved for future use by F# -//The identifier 'tailcall' is reserved for future use by F# -//The identifier 'trait' is reserved for future use by F# -//The identifier 'virtual' is reserved for future use by F# +//The identifier 'sealed' is reserved for future use by F# +//The identifier 'tailcall' is reserved for future use by F# +//The identifier 'trait' is reserved for future use by F# +//The identifier 'virtual' is reserved for future use by F# diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx index b578bcded92..a546320d987 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx @@ -1,4 +1,4 @@ -// +// open System open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs index 08eecf28298..91ab16df814 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Bin -// +// #light let x1 = 0B1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs index 406ac91d881..e5a7ca5ad86 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Float -// +// #light let x = 0x5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs index 37f601ddeb8..3ab355ec10a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier LF/lf are case sensitive // IEEE32/IEEE64 - lf vs LF -// +// #light let x = 0x5lf diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs index 5ae1d5e5446..25862389482 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs @@ -2,7 +2,7 @@ // Number type specifier are not case sensitive // IEEE32/IEEE64 - lf vs LF // verify that xint can be specified either with '0x' or '0X' -// +// #light let x = 0X5LF diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs index 960047eaf0d..dbd648a4f56 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Oct -// +// #light let x = 0o7 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs index bff2323485f..251673d2e07 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // No spaces between >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs index 4dd9cab1ee3..ec1187fbd79 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // 1 space >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs index aa7d7b4ff6e..878eb85caa4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2193 // Unicodegraph-long not in parity with C# -// +// #light let some_unicode_char = '\u00D6' diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs index d41170617de..12a6671e882 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs index 4370c474a37..5af95e05e46 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs index 62b007acc27..ed3f5860e8a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs index 2ebfa5c841e..0065830c2a9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs index 5476699dca2..6aff7f10196 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs index 638c6f267b8..7f23ee0d1e3 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs index fdd9d2158b7..2c542fd8ea4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs index 00e96083226..76e31e183ca 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs index dc948a4e44d..1333d1c115f 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs index 4936e4123a3..e90463c36ca 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs index fdd58db8d43..b7327e1bc27 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs @@ -3,7 +3,7 @@ // FSB 1624, LexFilter should consifer infix tokens according to their length -// +// let x = 3 let y = x diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs index f60fbcf281a..5533778e40f 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is now the default. See also FSHARP1.0:2319 -//#light +//#light //Main module of program is empty: nothing will happen when it is run diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs index f276b3a87e3..379ba736e68 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter #ReqNOMT // Regression test for FSHARP1.0:1078 // The #light is default in fsi.exe -// +// let SimpleSample() = let x = 10 + 12 - 3 let y = x * 2 + 1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs index 9d33a8618ca..d06c07211db 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs @@ -1,5 +1,5 @@ // #Conformance #LexFilter #ReqNOMT -//#light +//#light module TestModule let SimpleSample() = let x = 10 + 12 - 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs index 7a313d434fa..6ba9a667f22 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The opposit of #light is (for now) #indent "off" -// +// #indent "off" module M let SimpleSample() = diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs index 43a8ed0a290..2c75e5f8ec9 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is (for now) #indent "off" -// +// #light "off" exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs index 35c40129de1..d69200019bb 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// module TestModule diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx index 2abd0fa9735..8f6b8df6b37 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs index a92ede8e7ae..5193bdba68e 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test for FSHARP1.0:3929 // Impossible to subclass certain C# classes -// +// #light type Bottom() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx index c6b60e50871..bee58b466ff 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test DevDiv:370485 ([Portable] Cannot override sealed method) -// +// // This is the repro case for the bug. There should be no error. type T1() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs index cda8b5087a2..0ca40dc39c3 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // Scoping: // identifier introduced by let is local -// +// #light type C() = class static let mutable m = [1;2;3] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs index 22b1a7f557a..bd89ddbb5a1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs @@ -2,7 +2,7 @@ // Offside rule for static let // We should start counting from the 'static' not from 'let' // Regression test for FSHARP1.0:2042 -// +// #light type T() = static let foo baz = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs index debbdcb429d..43fdce499d2 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // rec (non-mutable) -// +// #light type C() = class static let rec f a = if a = 0 then 1 else a*f(a-1) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs index ef33bb87fb7..18e7e81d0ab 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate taking multiple arguments // Declaration is in the form: typ * ... * typ -> typ -// +// // Non-generic type MultiArgDelegate = delegate of int * string * byte -> unit diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs index 8e5dda697e7..629659fad76 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate returning a function value // Declaration is in the form: typ -> (typ -> ... -> typ -> typ) -// +// // Non-generic type DelegateReturningAFunctionValue = delegate of int -> (string -> int) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs index 528b0c9caa6..c420de39e11 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:5540 // See also FSHARP1.0:5597 // It is forbidden to implement an interface at multiple instantiations -// +//Duplicate specification of an interface$ //Duplicate or redundant interface$ //Duplicate or redundant interface$ //No abstract or interface member was found that corresponds to this override$ diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs index 1abe9c7206e..c8771146df5 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Verify error when trying to inherit from a struct type // Regression test for FSHARP1.0:2803 -//FS0191: Cannot inherit from interface type +//FS0191: Cannot inherit from interface type //Cannot inherit a sealed type diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs index ba7ef290a7a..ae191b89c89 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Regression test for FSHARP1.0:3051 -// +// module TestModule [] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs index d831cb584ee..1f668e8eec1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs @@ -3,7 +3,7 @@ // conflicting members. // After recent changes, DoStuff are no longed intrinsic members; they are instead // extension methods... so this code compiles just fine. -// +// #light namespace NS diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs index 35a34ad8112..e0b3b861f16 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi index d21fdb3e9d9..c99ea8c1217 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs index cf998c11080..583335bb35d 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Test diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs index eb1c2a44bba..4f9afc41f42 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Error when trying to use member overloading when some overloads are specified using curried arguments -//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form -//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form +//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form +//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form namespace NS module M = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs index 620ed72e812..65dab9bc7c6 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3593 // "Prefer extension members that have been brought into scope by more recent "open" statements" -// +// namespace NS module M = type Lib with diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs index 09cf78bec16..9d323f7b4e0 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for https://github.com/Microsoft/visualfsharp/issues/5745 -//Active patterns do not have fields. This syntax is invalid\. +//Active patterns do not have fields. This syntax is invalid\. open System.Text.RegularExpressions let (|USZipPlus4Code|_|) s = diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs index ce1f8c52e57..ad44bfc85ba 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let rec (|Foo|Bar|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs index 30cbacafdc6..1e2d83477a8 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let rec (|Foo2|Bar2|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs index 8c56c01eeba..dcae474e228 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let rec (|Foo2b|Bar2b|Baz2b|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs index b8e73717c38..25a7343ffd5 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let rec (|Foo3|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs index c6dcdfd479b..e8f77849d35 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let (|Foo|Bar|) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs index 7fbec1115f1..6d310e4e9f8 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2|Bar2|_|) x = "BAD DOG!" // expect: invalid name for an active pattern diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs index 803ae8e5fb1..3791cfb83eb 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2b|Bar2b|Baz2b|_|) x = "BAD DOG!" // expect: type string doesn't match type 'choice' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs index 4bee3f20660..b164c604c20 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let (|Foo3|_|) x = "BAD DOG!" // expect: type string doesn't match type 'option' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs index a54718deadc..d1fd1f3e712 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let (|Foo|Bar|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs index c71c4592067..36985891c50 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2|Bar2|_|) (a:int) x = "BAD DOG!" // expect: invalid name for an active pattern diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs index fabc98f7ddb..25bf8af83dc 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2b|Bar2b|Baz2b|_|) (a:int) x = "BAD DOG!" // expect: type string doesn't match type 'choice' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs index 5d345aeff8b..02a9fd6ba01 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let (|Foo3|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi index 7c9b851e897..991c81ee5b4 100644 --- a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi +++ b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi @@ -1,6 +1,6 @@ // #Conformance #Signatures #Structs #Regression // Regression for Dev11:137930, structs used to not give errors on unimplemented constructors in the signature file -//Module 'M' requires a value 'new : unit -> Foo<'T>' +//Module 'M' requires a value 'new : unit -> Foo<'T>' module M diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs index 0a42a52c550..028d13cfb5d 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -// +// // Note: you need the 'step' in the range in order to see the warning! [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs index 1f3fb5ae30d..60007529f20 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -//Floating point ranges are experimental -// +//Floating point ranges are experimental +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs index 7395d9854f0..97b11087766 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs @@ -2,11 +2,11 @@ // Regression test for FSHARP1.0:2708 // ICE when using a known type (int, decimal, etc...) as a unit of measure -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx index 72a6f9dc17a..5c54cd0ff6c 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx @@ -3,7 +3,7 @@ // In 1.9.6.2, this code snipped passed to fsi used to throw an ICE // This issue was automagically fixed in Beta1 // The text of the ICE was: FSC(0,0): error FS0192: internal error: find_gtdef: Continuous not found -// +// module Compounding = [] type Continuous diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs index 07cd9c4c656..bcb68704da5 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithDecimal = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs index e0d70933979..3a4b5c44f18 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithFloat32 = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs index 227548f506b..015e097a977 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs index 9eccc471df5..ad94a9d4e1f 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #ObjectOrientedTypes // Regression test for FSHARP1.0:3687 // ICE in Units of Measure + Polymorphism -// +// #light module Test diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs index 388da653fee..7f03cb7eee4 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2804 // Make sure we don't emit ?. (notice that the error message changed a bit since the bug was opened) -//\?\. +//\?\. // let f (x : int list) = int32 (x>>32) diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs index c863b0860a9..e3fb451018e 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:1181 -//syntax error +//syntax error // diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs index 2e64ca51bf4..c12c0836205 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs @@ -13,4 +13,4 @@ namespace N2 // Regression test for FSHARP1.0:4995 // Note that what we are really testing in this case is the span (which was incorrectly (3,1-7-10)) -//Namespaces cannot contain values\. Consider using a module to hold your value declarations\.$ +//Namespaces cannot contain values\. Consider using a module to hold your value declarations\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs index 9064787a01d..577d8c4f352 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs @@ -2,7 +2,7 @@ #light // Somehow related to the fix for FSHARP1.0:3143: as a result, now struct may be empty -// +// type StructType = struct end diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs index 4b9ce7abc5c..67024e490cc 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs @@ -3,7 +3,7 @@ // Regression test for FSHARP1.0:2670 //Unexpected symbol '<-' in pattern //The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. -//lambda +//lambda open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs index 29d42721be9..1c6af333707 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4579 // The following code should not give any error/warning -// +// module M let fromSeq (s: #seq<'schema>) = // <--- used to give a false warning that can't be eliminated s |> Array.ofSeq diff --git a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs index 1ccac8da600..d65c5ad4470 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:3286 -// +// module M type C3<'a>() = class diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs index 3e7a4a52c87..900a961bd2c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:3702 -//NONTERM +//NONTERM //Incomplete structured construct at or before this point in union case\. Expected identifier, '\(', '\(\*\)' or other token\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs index c1853be0bbd..aa88eb453a6 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2369 -//NONTERM +//NONTERM //Unexpected symbol '<' in expression\. Expected '}' or other token\. //: error : Unmatched '{'$ #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs index 43e9b79ad30..849880f6ca3 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs index 27268bf5fcc..a9fb1c5dd80 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2219 -//NONTERM +//NONTERM //Unexpected keyword 'val' in definition [] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs index 349e0f1f235..44cf67e9c04 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2681 -//NONTERM +//NONTERM //Unexpected start of structured construct in definition\. Expected identifier, 'global' or other token\. module '\U00002620' diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs index af5eb1ce3bf..60c5736d092 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2681 // To repro: fsi.exe < foo.fs, otherwise it won't repro! // This test used to emit an error, now (after fix for 2193, it works fine) -//\^\^\^\^\^ -// +//\^\^\^\^\^ +// '\U00002620';; exit 0;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs index 246b03087a8..7005248760c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2324 -//NONTERM +//NONTERM //Unexpected symbol '\[<' in definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs index cd027304f9e..c68c6b60c4f 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ';;' in expression\. Expected '\]' or other token\.$ //Unmatched '\['$ [1;;2] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs index 20571c7106c..a68c24f01b8 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ',' in lambda expression. fun x, y -> x < y diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs index 29c2971575f..d51d30c1366 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs index b35c66c64cc..d350cec694d 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs index 690122a45a9..e7aa4511525 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol '.' in implementation file failwith "foo" : int;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs index b8ec396377b..4046e284f40 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected character '.' in implementation file \;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs index fac2ce699d1..39cfda78348 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected keyword 'member' in implementation file member private this.Size with set newSize = m_size <- newSize;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs index fd0312d50e7..2e135a6fba1 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2104 -//NONTERM +//NONTERM //Unexpected end of input$ #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs index 7f4300249e9..765257c1562 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2106 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs index e40a3437265..4d0087137cd 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2391, FSHARP1.0:1479 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 231d1ec0cca..6e950dfac58 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -//NONTERM +//NONTERM //Unexpected keyword 'lazy' in type definition$ // 5 elements -> ok diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs index 23154a25c9d..400bc6d4ab7 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2467 -//NONTERM +//NONTERM //Unexpected symbol '->' in type #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs index 4a15b697fae..9f5c695916f 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2648 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs index c7b2f1c622f..cc7101d992b 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs index e9c309d66b7..704409444c3 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // diff --git a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs index 47a8c8bbcfa..bafbd8f597c 100644 --- a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs +++ b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // Attribute is last declaration on first file //Hello -//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. +//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. module TestModule [] diff --git a/tests/fsharpqa/Source/EntryPoint/behavior001.fs b/tests/fsharpqa/Source/EntryPoint/behavior001.fs index d8186ff9214..1bbaa34c252 100644 --- a/tests/fsharpqa/Source/EntryPoint/behavior001.fs +++ b/tests/fsharpqa/Source/EntryPoint/behavior001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // Verify that static initializers are invoked before entering the 'main' function -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs index 04b0092e960..a8f28497cd8 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx index b3465af492b..535ab9aa2f4 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// module M = [] diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs index 048debefa95..5d5659a9022 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1793 // Explicit program entry point: [] // Entry point function does not have to be called 'main' -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs index c6e22cef201..71070cb0266 100644 --- a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs +++ b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function is in a module //Hello -// +// #light module M = diff --git a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs index 688afe23d52..08b4ef60cf4 100644 --- a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs +++ b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // 'main' function invoked with no arguments -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs index 47c4ee5a4e7..c50c8334ac8 100644 --- a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs +++ b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with 1 argument //Hello -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs index 98ea1ad7ddd..89db75bb9e2 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module M diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs index eb54d7243e6..41a6d23c11d 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module TestModule diff --git a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs index 34cc7e1daec..345f0bf6605 100644 --- a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs +++ b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Import // Regression test for FSHARP1.0:2097 // Make sure we can assign to a static field imported from a C# assembly -// +// #light // Retrieve initial value diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx index 91b75021aa8..52467c23a68 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx @@ -1,5 +1,5 @@ // #NoMT #FSI -//EventName: Event +//EventName: Event type T() = do diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx index 2e75878deb0..9b2bd981e96 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx @@ -2,13 +2,13 @@ // Regression test for FSHARP1.0:2549 // See also CL:14579 -//type T = -//class -//member M1 : x:int \* y:string -> \('a -> unit\) -//member M2 : \(int \* string\) -> \('a -> unit\) -//exception ExnType of int \* string -//type DiscUnion = \| DataTag of int \* string -//val f : x:int -> y:int -> int +//type T = +//class +//member M1 : x:int \* y:string -> \('a -> unit\) +//member M2 : \(int \* string\) -> \('a -> unit\) +//exception ExnType of int \* string +//type DiscUnion = \| DataTag of int \* string +//val f : x:int -> y:int -> int type T = diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx index 2b6910f9d4d..004ef985471 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx @@ -1,8 +1,8 @@ // #Regression #NoMT #FSI // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// fsbug -// nonTerminalId\.GetTag +//fsbug +//nonTerminalId\.GetTag //Unexpected symbol '\.\.' in interaction\. Expected incomplete structured construct at or before this point, ';', ';;' or other token\.$ aaaa..;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx index 3ab03833487..da1df59524e 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:5599 // -//val it : 'a list$ +//val it : 'a list$ [];; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs index 262e185ff9b..9ee7197ebea 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : nativeint = 2n +//val it : nativeint = 2n nativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx index 2b1bc970fb7..e78bd6d32f9 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI -//System\.Core\.dll +//System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx index 18420dc5914..1e09e7ca7f1 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono -//v3\.5.+System\.Core\.dll +//v3\.5.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx index 029133fbd55..c56ce024ff3 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono -//v4\.0.+System\.Core\.dll +//v4\.0.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx index fa3a42fb800..a764279c7f5 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI #RequiresENU // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// Timing now on -// Timing now off +// Timing now on +// Timing now off #time "on" #time "off" diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs index 57fd75df7b8..2c074746de7 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : unativeint = 2un +//val it : unativeint = 2un unativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx index 94417a53524..9947eb92f90 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx @@ -1,6 +1,6 @@ // #NoMT #FSI -//val it : int = 42 -//val it : unit = \(\) +//val it : int = 42 +//val it : unit = \(\) 42;; ();; #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs b/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs index 9d78863661d..9ad88b379ad 100644 --- a/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs +++ b/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs @@ -6,7 +6,7 @@ // This test should probably go under the SystematicUnitTests suite, but // I could not decide how to make it fit... so I'm leaving it here. // -// +// let mutable dispose_called_in_E = 0 // we expect this to be incremented 3 times let mutable dispose_called_in_C = 0 // we expect this to be incremented once (=this is what the bug was about, i.e. .Dispose() was never invoked) diff --git a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx index d753159960c..ba675c60d73 100644 --- a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx +++ b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx @@ -1,60 +1,60 @@ // #Regression #Libraries #LanguagePrimitives #ReqNOMT // Regression test for FSHARP1.0:5894 -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "127" -//val it : string = "-128" -//val it : string = "0" -//val it : string = "-1" -//val it : string = "1" -//val it : string = "255" -//val it : string = "0" -//val it : string = "0" -//val it : string = "1" -//val it : string = "32767" -//val it : string = "-32768" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "65535" -//val it : string = "0" -//val it : string = "0" -//val it : string = "110" -//val it : string = "2147483647" -//val it : string = "-2147483648" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "4294967295" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "9223372036854775807" -//val it : string = "-9223372036854775808" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "18446744073709551615" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "79228162514264337593543950335" -//val it : string = "-79228162514264337593543950335" -//val it : string = "0" -//val it : string = "12345678" -//val it : string = "-12345678" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "127" +//val it : string = "-128" +//val it : string = "0" +//val it : string = "-1" +//val it : string = "1" +//val it : string = "255" +//val it : string = "0" +//val it : string = "0" +//val it : string = "1" +//val it : string = "32767" +//val it : string = "-32768" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "65535" +//val it : string = "0" +//val it : string = "0" +//val it : string = "110" +//val it : string = "2147483647" +//val it : string = "-2147483648" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "4294967295" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "9223372036854775807" +//val it : string = "-9223372036854775808" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "18446744073709551615" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "79228162514264337593543950335" +//val it : string = "-79228162514264337593543950335" +//val it : string = "0" +//val it : string = "12345678" +//val it : string = "-12345678" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" (string 1.0f);; (string 1.00001f);; diff --git a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs index be46abb5e19..a79a04119b2 100644 --- a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs +++ b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs @@ -1,7 +1,7 @@ // #Regression #Libraries #Operators // Regression test for FSHARP1.0:1247 // Precedence of type annotations :> and :?> over preceeding expression forms, e.g. if-then-else etc. -// +// open System let x = 2 :> Object diff --git a/tests/fsharpqa/Source/Misc/DefaultManifest.fs b/tests/fsharpqa/Source/Misc/DefaultManifest.fs index c0ba0869d9c..39d47d6f1dd 100644 --- a/tests/fsharpqa/Source/Misc/DefaultManifest.fs +++ b/tests/fsharpqa/Source/Misc/DefaultManifest.fs @@ -1,5 +1,5 @@ // The compiler should add an embedded default win32 manifest so that UAC is handled properly -// +// open System open System.Text diff --git a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs index b86d9317002..bbf0c797abf 100644 --- a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs +++ b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs @@ -1,7 +1,7 @@ // #Regression #Misc #NoMono // Regression test for FSHARP1.0:1668 // Compiler should provide a way to embed manifest files -// +// open System.Reflection let thisExe = System.Reflection.Assembly.GetExecutingAssembly() diff --git a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs index 47ede512117..471653dabd8 100644 --- a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs +++ b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs @@ -4,7 +4,7 @@ // FSHARP1.0:1117, Bindings that look like function definitions are interpreted as pattern matches without warning. Add a warning for this case to allow for later language design change here. // FSHARP1.0:2552, name scoping bug -// +// type t = F of int * int diff --git a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx index a1bca475bf5..052100c05f6 100644 --- a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx +++ b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx @@ -3,27 +3,27 @@ // Test for FSharp1.0:2581 - FSI should display bound values, not just evaluated expressions (was: FSI should print the value of the last declared value is there is no last expression) -//type RecT = -// {Name: string;} -//type Bldg = -// \| House -// \| Museum -// \| Office -//val a : int = 1 -//val B : string = "Hello" -//val c' : RecT = {Name = "F#";} -//val _d : Bldg = Office -//val e : seq -//val F'F : int list = \[3; 2; 1] -//val g : Set -//val g' : Set<'a> -//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF -//val h : System\.Drawing\.PointF = {X=.+, Y=.+} -//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) -//val J_ : int \[\] = \[\|1; 2; 3\|] -//val j_' : float \[\] = \[\|1\.0; 1\.0\|] -//val j_'_ : RecT \[\] = \[\|\|] -//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] +//type RecT = +// {Name: string;} +//type Bldg = +// \| House +// \| Museum +// \| Office +//val a : int = 1 +//val B : string = "Hello" +//val c' : RecT = {Name = "F#";} +//val _d : Bldg = Office +//val e : seq +//val F'F : int list = \[3; 2; 1] +//val g : Set +//val g' : Set<'a> +//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF +//val h : System\.Drawing\.PointF = {X=.+, Y=.+} +//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) +//val J_ : int \[\] = \[\|1; 2; 3\|] +//val j_' : float \[\] = \[\|1\.0; 1\.0\|] +//val j_'_ : RecT \[\] = \[\|\|] +//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] type RecT = { Name : string } diff --git a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx index d1332158c18..c3a2d77b8d1 100644 --- a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx +++ b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx @@ -2,9 +2,9 @@ #light // Test for FSharp1.0:4086 - accessiblity not printed for exceptions -// exception internal A of int -// exception private B of string -// exception C of System\.DateTime +//exception internal A of int +//exception private B of string +//exception C of System\.DateTime exception internal A of int exception private B of string diff --git a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs index e20b0c73582..41af243eb38 100644 --- a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs +++ b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:4725 // F# is not disposing an IEnumerator in implementation of sprintf "%A" -//Done +//Done let x = seq { try yield 1; yield 2; finally printfn "Done" } diff --git a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx index 712a9f5ed34..c68d6bbb8e2 100644 --- a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx +++ b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx @@ -2,10 +2,10 @@ // Regression test for https://github.com/Microsoft/visualfsharp/issues/109 // pretty printing signatures with params arguments -//type Heterogeneous = -// class -// static member Echo : \[\] args:obj \[\] -> obj \[\] -// end +//type Heterogeneous = +// class +// static member Echo : \[\] args:obj \[\] -> obj \[\] +// end type Heterogeneous = static member Echo([] args: obj[]) = args diff --git a/tests/fsharpqa/Source/Printing/Quotation01.fs b/tests/fsharpqa/Source/Printing/Quotation01.fs index bf6ce9e2479..c34e1e78fbb 100644 --- a/tests/fsharpqa/Source/Printing/Quotation01.fs +++ b/tests/fsharpqa/Source/Printing/Quotation01.fs @@ -1,7 +1,7 @@ // #NoMT #Printing // Regression test for FSHARP1.0:524 -//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; -// Raw = \.\.\.; -// Type = System\.Int32;} +//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; +// Raw = \.\.\.; +// Type = System\.Int32;} <@ 1 @>;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs index 7473f0a5214..5605d46d4d0 100644 --- a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs +++ b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs @@ -2,14 +2,14 @@ // Regression test for FSHARP1.0:1110 // pretty printing signatures with optional arguments -//type AsyncTimer = -// class -// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer -// member Start : unit -> unit -// member Stop : unit -> unit -// member Delay : int option -// member Delay : int option with set -// end +//type AsyncTimer = +// class +// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer +// member Start : unit -> unit +// member Stop : unit -> unit +// member Delay : int option +// member Delay : int option with set +// end open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx index ca110a61825..d4643be3c79 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal = -2\.0M +//val it : float32 = 2\.0f +//val it : float = 1\.2 #light module M1 = diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx index db0557eb71e..b9b5d7d8385 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal+ +//val it : float32+ +//val it : float+ #light #r "UnitsOfMeasureIdentifiersRoundTrip02.dll" diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx index 1366f40b821..e4a11a88618 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx @@ -3,6 +3,6 @@ // Make sure the generic type variable is echoed back // (notice that the next time we evaluate 'f' this // goes back to 'u) -//val f : x:float<'a> -> float<'a \^ 2> +//val f : x:float+ let f(x:float<'a>) = x*x;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx index d57eda1d03e..b71e606a9f1 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx @@ -4,6 +4,6 @@ // (notice that the next time we evaluate 'f' this // goes back to 'u, 'v) // This is the case where the generic function takes 2 args -//val g : x:float<'a> -> y:float32<'b> -> float<'a> +//val g : x:float+ let g (x:float<'a>) (y:float32<'b>) = x * float y;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/VariantTypes01.fs b/tests/fsharpqa/Source/Printing/VariantTypes01.fs index 10ab2c05366..074e72da981 100644 --- a/tests/fsharpqa/Source/Printing/VariantTypes01.fs +++ b/tests/fsharpqa/Source/Printing/VariantTypes01.fs @@ -2,6 +2,6 @@ // Regression test for FSHARP1.0:1401 // incorrect pretty printing of variant types // The issue here was the missing parens around the nested Some ... -//val it : int option option = Some \(Some 1\) +//val it : int option option = Some \(Some 1\) Some(Some(1));; exit 0;; diff --git a/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs b/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs index d737c4ade34..ae6738208b6 100644 --- a/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs +++ b/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs @@ -1,5 +1,5 @@ // #Warnings -//The member 'Bar +//The member 'Bar //Please restrict it to one of the following: //Bar : double -> int //Bar : int -> int diff --git a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs index 6f2ef4d9c45..7b0b968c23b 100644 --- a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs +++ b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs @@ -1,5 +1,5 @@ // #Warnings -// +//The result of this expression has type 'bool' and is implicitly ignored let mutable x = 0 while x < 1 do diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs index 8761062c0fa..793c9a1d636 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs @@ -1,6 +1,6 @@ // #XMLDoc // Regression test for Dev11:40070 -// +// /// Doc comment for Test. type Test = diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs index 3e1ea349d44..6b916c9d632 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Simple /// is xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs index 16cad97bb17..f41c9f3198d 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Verify that //// is not xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs index fd817a80100..a2930dea500 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs @@ -2,7 +2,7 @@ // This used to be regression test for FSHARP1.0:850 // Now, we simple verify that OCaml style xml-doc are gone (i.e. treated as regular comments) // Verify that //// is not xmldoc (after an ocaml-style xml-comment) -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs index 1b90a21e47e..15767fff559 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc name is correctly generated -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs index 4fa8dbecaca..76977a7eec0 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc names are generated, but no empty members are generated re: issue #148 -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs index 723484f1ba4..f3338bfb757 100644 --- a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs @@ -3,7 +3,7 @@ // Now that the OCaml style XmlDoc is gone, (** ... *) should be just a normal comment. // We want to verify that no xml with a "summary" is generate. // See also FSHARP1.0:1654 -// +// #light diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index 67199ab1137..f3d79d7a03f 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -56,7 +56,7 @@ CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\staticlink CompilerOptions01,NoMT CompilerOptions\fsc\subsystemversion CompilerOptions01,NoMT CompilerOptions\fsc\tailcalls CompilerOptions01,NoMT CompilerOptions\fsc\target -CompilerOptions01,NoMT CompilerOptions\fsc\times +CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\times CompilerOptions01,NoMT CompilerOptions\fsc\warn CompilerOptions01,NoMT CompilerOptions\fsc\warnaserror CompilerOptions01,NoMT CompilerOptions\fsc\warnon From 4a695e798a05c8139c3cba89a7d971055bdd3160 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 30 May 2019 17:42:23 -0700 Subject: [PATCH 2/7] Removed reference counting from IncrementalBuilder; now relies on GC. (#6863) * TcImports doesn't explicitly have to be disposed, relies on GC. Removed reference counting in incremental builder. Builders can only be invalidated by a type provider, not anything else. * Removing any notion of being incremental builder reference counting and being alive * Added ITypeProviderThread * Fixed declaration list item * Changed EnqueueWorkAndWait to just EnqueueWork that's not blocking * Minor cleanup * Forgot to check disposed * Quick update on comment * Update FCS project * Renamed ITypeProviderThread to ICompilationThread * Changes from feedback and added a test --- .../FSharp.Compiler.Service.fsproj | 14 +- src/fsharp/CompileOps.fs | 142 +++++++++++++----- src/fsharp/CompileOps.fsi | 12 ++ .../FSharp.Compiler.Private.fsproj | 12 +- src/fsharp/service/IncrementalBuild.fs | 97 +++--------- src/fsharp/service/IncrementalBuild.fsi | 22 +-- src/fsharp/service/ServiceDeclarationLists.fs | 17 +-- .../service/ServiceDeclarationLists.fsi | 2 +- src/fsharp/service/service.fs | 122 ++++----------- src/fsharp/service/service.fsi | 11 +- tests/service/MultiProjectAnalysisTests.fs | 5 - tests/service/ProjectAnalysisTests.fs | 21 ++- 12 files changed, 219 insertions(+), 258 deletions(-) diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 134a3ca745d..6b2d04cb626 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -1,4 +1,4 @@ - + @@ -543,18 +543,18 @@ Symbols/SymbolPatterns.fs - - Service/IncrementalBuild.fsi - - - Service/IncrementalBuild.fs - Service/Reactor.fsi Service/Reactor.fs + + Service/IncrementalBuild.fsi + + + Service/IncrementalBuild.fs + Service/ServiceConstants.fs diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index d95bf2d0706..491a753b9d9 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -1963,6 +1963,14 @@ type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * Assem type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +/// The thread in which compilation calls will be enqueued and done work on. +/// Note: This is currently only used when disposing of type providers and will be extended to all the other type provider calls when compilations can be done in parallel. +/// Right now all calls in FCS to type providers are single-threaded through use of the reactor thread. +type ICompilationThread = + + /// Enqueue work to be done on a compilation thread. + abstract EnqueueWork: (CompilationThreadToken -> unit) -> unit + type ImportedBinary = { FileName: string RawMetadata: IRawFSharpAssemblyData @@ -2115,6 +2123,7 @@ type TcConfigBuilder = /// show messages about extension type resolution? mutable showExtensionTypeMessages: bool #endif + mutable compilationThread: ICompilationThread /// pause between passes? mutable pause: bool @@ -2274,6 +2283,9 @@ type TcConfigBuilder = #if !NO_EXTENSIONTYPING showExtensionTypeMessages = false #endif + compilationThread = + let ctok = CompilationThreadToken () + { new ICompilationThread with member __.EnqueueWork work = work ctok } pause = false alwaysCallVirt = true noDebugData = false @@ -2746,8 +2758,9 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member x.showLoadedAssemblies = data.showLoadedAssemblies member x.continueAfterParseFailure = data.continueAfterParseFailure #if !NO_EXTENSIONTYPING - member x.showExtensionTypeMessages = data.showExtensionTypeMessages + member x.showExtensionTypeMessages = data.showExtensionTypeMessages #endif + member x.compilationThread = data.compilationThread member x.pause = data.pause member x.alwaysCallVirt = data.alwaysCallVirt member x.noDebugData = data.noDebugData @@ -3741,10 +3754,43 @@ type TcConfigProvider = // TcImports //-------------------------------------------------------------------------- - +#if !NO_EXTENSIONTYPING +// These are hacks in order to allow TcImports to be held as a weak reference inside a type provider. +// The reason is due to older type providers compiled using an older TypeProviderSDK, that SDK used reflection on fields and properties to determine the contract. +// The reflection code has now since been removed, see here: https://github.com/fsprojects/FSharp.TypeProviders.SDK/pull/305. But we still need to work on older type providers. +// One day we can remove these hacks when we deemed most if not all type providers were re-compiled using the newer TypeProviderSDK. +// Yuck. +type TcImportsDllInfoHack = + { + FileName: string + } + +and TcImportsWeakHack (tcImports: WeakReference) = + let mutable dllInfos: TcImportsDllInfoHack list = [] + + member __.SetDllInfos (value: ImportedBinary list) = + dllInfos <- value |> List.map (fun x -> { FileName = x.FileName }) + + member __.Base: TcImportsWeakHack option = + match tcImports.TryGetTarget() with + | true, strong -> + match strong.Base with + | Some (baseTcImports: TcImports) -> + Some baseTcImports.Weak + | _ -> + None + | _ -> + None + + member __.SystemRuntimeContainsType typeName = + match tcImports.TryGetTarget () with + | true, strong -> strong.SystemRuntimeContainsType typeName + | _ -> false +#endif /// Represents a table of imported assemblies with their resolutions. -[] -type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, ilGlobalsOpt) = +/// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. +/// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. +and [] TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, ilGlobalsOpt, compilationThread: ICompilationThread) as this = let mutable resolutions = initialResolutions let mutable importsBase: TcImports option = importsBase @@ -3757,12 +3803,30 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let mutable ilGlobalsOpt = ilGlobalsOpt let mutable tcGlobals = None #if !NO_EXTENSIONTYPING + let mutable disposeTypeProviderActions = [] let mutable generatedTypeRoots = new System.Collections.Generic.Dictionary() + let mutable tcImportsWeak = TcImportsWeakHack (WeakReference<_> this) #endif let CheckDisposed() = if disposed then assert false + let dispose () = + CheckDisposed() + // disposing deliberately only closes this tcImports, not the ones up the chain + disposed <- true + if verbose then + dprintf "disposing of TcImports, %d binaries\n" disposeActions.Length +#if !NO_EXTENSIONTYPING + let actions = disposeTypeProviderActions + disposeTypeProviderActions <- [] + if actions.Length > 0 then + compilationThread.EnqueueWork (fun _ -> for action in actions do action()) +#endif + let actions = disposeActions + disposeActions <- [] + for action in actions do action() + static let ccuHasType (ccu: CcuThunk) (nsname: string list) (tname: string) = let matchNameSpace (entityOpt: Entity option) n = match entityOpt with @@ -3776,8 +3840,8 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu | Some _ -> true | None -> false | None -> false - - member private tcImports.Base = + + member internal tcImports.Base = CheckDisposed() importsBase @@ -3787,7 +3851,13 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu member tcImports.DllTable = CheckDisposed() - dllTable + dllTable + +#if !NO_EXTENSIONTYPING + member tcImports.Weak = + CheckDisposed() + tcImportsWeak +#endif member tcImports.RegisterCcu ccuInfo = CheckDisposed() @@ -3798,9 +3868,12 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu member tcImports.RegisterDll dllInfo = CheckDisposed() dllInfos <- dllInfos ++ dllInfo +#if !NO_EXTENSIONTYPING + tcImportsWeak.SetDllInfos dllInfos +#endif dllTable <- NameMap.add (getNameOfScopeRef dllInfo.ILScopeRef) dllInfo dllTable - member tcImports.GetDllInfos() = + member tcImports.GetDllInfos() : ImportedBinary list = CheckDisposed() match importsBase with | Some importsBase-> importsBase.GetDllInfos() @ dllInfos @@ -3967,9 +4040,15 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu |> Seq.toList #endif - member tcImports.AttachDisposeAction action = + member private tcImports.AttachDisposeAction action = CheckDisposed() disposeActions <- action :: disposeActions + +#if !NO_EXTENSIONTYPING + member private tcImports.AttachDisposeTypeProviderAction action = + CheckDisposed() + disposeTypeProviderActions <- action :: disposeTypeProviderActions +#endif // Note: the returned binary reader is associated with the tcImports, i.e. when the tcImports are closed // then the reader is closed. @@ -4119,7 +4198,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu | _ -> failwith "Unexpected representation in namespace entity referred to by a type provider" - member tcImports.ImportTypeProviderExtensions + member tcImportsStrong.ImportTypeProviderExtensions (ctok, tcConfig: TcConfig, fileNameOfRuntimeAssembly, ilScopeRefOfRuntimeAssembly, @@ -4153,7 +4232,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu { resolutionFolder = tcConfig.implicitIncludeDir outputFile = tcConfig.outputFile showResolutionMessages = tcConfig.showExtensionTypeMessages - referencedAssemblies = Array.distinct [| for r in tcImports.AllAssemblyResolutions() -> r.resolvedPath |] + referencedAssemblies = Array.distinct [| for r in tcImportsStrong.AllAssemblyResolutions() -> r.resolvedPath |] temporaryFolder = FileSystem.GetTempPathShim() } // The type provider should not hold strong references to disposed @@ -4161,9 +4240,10 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // dispatch via a thunk which gets set to a non-resource-capturing // failing function when the object is disposed. let systemRuntimeContainsType = - // NOTE: do not touch this + // NOTE: do not touch this, edit: but we did, we had no choice - TPs cannot hold a strong reference on TcImports "ever". + let tcImports = tcImportsWeak let systemRuntimeContainsTypeRef = ref (fun typeName -> tcImports.SystemRuntimeContainsType typeName) - tcImports.AttachDisposeAction(fun () -> systemRuntimeContainsTypeRef := (fun _ -> raise (System.ObjectDisposedException("The type provider has been disposed")))) + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> systemRuntimeContainsTypeRef := (fun _ -> raise (System.ObjectDisposedException("The type provider has been disposed")))) fun arg -> systemRuntimeContainsTypeRef.Value arg let providers = @@ -4174,7 +4254,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // Note, type providers are disposable objects. The TcImports owns the provider objects - when/if it is disposed, the providers are disposed. // We ignore all exceptions from provider disposal. for provider in providers do - tcImports.AttachDisposeAction(fun () -> + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> try provider.PUntaintNoFailure(fun x -> x).Dispose() with e -> @@ -4203,7 +4283,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let handler = tp.Invalidate.Subscribe(fun _ -> capturedInvalidateCcu.Trigger (capturedMessage)) // When the TcImports is disposed we detach the invalidation callback - tcImports.AttachDisposeAction(fun () -> try handler.Dispose() with _ -> ())), m) + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> try handler.Dispose() with _ -> ())), m) match providers with | [] -> @@ -4222,7 +4302,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // for that namespace. let rec loop (providedNamespace: Tainted) = let path = ExtensionTyping.GetProvidedNamespaceAsPath(m, provider, providedNamespace.PUntaint((fun r -> r.NamespaceName), m)) - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, None) + tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, None) // Inject entities for the types returned by provider.GetTypes(). // @@ -4232,7 +4312,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let tys = providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m) let ptys = [| for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m) |] for st in ptys do - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, Some st) + tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, Some st) for providedNestedNamespace in providedNamespace.PApplyArray((fun provider -> provider.GetNestedNamespaces()), "GetNestedNamespaces", m) do loop providedNestedNamespace @@ -4564,9 +4644,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // Note: This returns a TcImports object. However, framework TcImports are not currently disposed. The only reason // we dispose TcImports is because we need to dispose type providers, and type providers are never included in the framework DLL set. - // - // If this ever changes then callers may need to begin disposing the TcImports (though remember, not before all derived - // non-framework TcImports built related to this framework TcImports are disposed). + // If a framework set ever includes type providers, you will not have to worry about explicitly calling Dispose as the Finalizer will handle it. static member BuildFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, frameworkDLLs, nonFrameworkDLLs) = cancellable { @@ -4574,8 +4652,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, frameworkDLLs, []) let tcAltResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkDLLs, []) - // Note: TcImports are disposable - the caller owns this object and must dispose - let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None) + let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None, tcConfig.compilationThread) // Fetch the primaryAssembly from the referenced assemblies otherwise let primaryAssemblyReference = @@ -4666,24 +4743,21 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu knownUnresolved |> List.map (function UnresolvedAssemblyReference(file, originalReferences) -> file, originalReferences) |> List.iter reportAssemblyNotResolved + + override tcImports.Finalize () = + dispose () - // Note: This returns a TcImports object. TcImports are disposable - the caller owns the returned TcImports object - // and when hosted in Visual Studio or another long-running process must dispose this object. static member BuildNonFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, tcGlobals: TcGlobals, baseTcImports, nonFrameworkReferences, knownUnresolved) = cancellable { let tcConfig = tcConfigP.Get ctok let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkReferences, knownUnresolved) let references = tcResolutions.GetAssemblyResolutions() - let tcImports = new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some tcGlobals.ilg) + let tcImports = new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some tcGlobals.ilg, tcConfig.compilationThread) let! _assemblies = tcImports.RegisterAndImportReferencedAssemblies(ctok, references) tcImports.ReportUnresolvedAssemblyReferences knownUnresolved return tcImports } - // Note: This returns a TcImports object. TcImports are disposable - the caller owns the returned TcImports object - // and if hosted in Visual Studio or another long-running process must dispose this object. However this - // function is currently only used from fsi.exe. If we move to a long-running hosted evaluation service API then - // we should start disposing these objects. static member BuildTcImports(ctok, tcConfigP: TcConfigProvider) = cancellable { let tcConfig = tcConfigP.Get ctok @@ -4696,14 +4770,8 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu interface System.IDisposable with member tcImports.Dispose() = - CheckDisposed() - // disposing deliberately only closes this tcImports, not the ones up the chain - disposed <- true - if verbose then - dprintf "disposing of TcImports, %d binaries\n" disposeActions.Length - let actions = disposeActions - disposeActions <- [] - for action in actions do action() + dispose () + GC.SuppressFinalize tcImports override tcImports.ToString() = "TcImports(...)" diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 3d08610670a..71bb7c6f8b6 100644 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -209,6 +209,14 @@ type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * Assem type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +/// The thread in which compilation calls will be enqueued and done work on. +/// Note: This is currently only used when disposing of type providers and will be extended to all the other type provider calls when compilations can be done in parallel. +/// Right now all calls in FCS to type providers are single-threaded through use of the reactor thread. +type ICompilationThread = + + /// Enqueue work to be done on a compilation thread. + abstract EnqueueWork: (CompilationThreadToken -> unit) -> unit + [] type CompilerTarget = | WinExe @@ -351,6 +359,7 @@ type TcConfigBuilder = #if !NO_EXTENSIONTYPING mutable showExtensionTypeMessages: bool #endif + mutable compilationThread: ICompilationThread mutable pause: bool mutable alwaysCallVirt: bool mutable noDebugData: bool @@ -510,6 +519,7 @@ type TcConfig = #if !NO_EXTENSIONTYPING member showExtensionTypeMessages: bool #endif + member compilationThread: ICompilationThread member pause: bool member alwaysCallVirt: bool member noDebugData: bool @@ -591,6 +601,8 @@ type TcAssemblyResolutions = static member BuildFromPriorResolutions : CompilationThreadToken * TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions /// Represents a table of imported assemblies with their resolutions. +/// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. +/// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. [] type TcImports = interface System.IDisposable diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index ebef5fb040b..3b3d38409f7 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -560,6 +560,12 @@ Symbols/SymbolPatterns.fs + + Service/Reactor.fsi + + + Service/Reactor.fs + @@ -568,12 +574,6 @@ Service/IncrementalBuild.fs - - Service/Reactor.fsi - - - Service/Reactor.fs - Service/ServiceConstants.fs diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 24769360aeb..4099b59c803 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1211,11 +1211,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) = let tcConfigP = TcConfigProvider.Constant tcConfig - let importsInvalidated = new Event() let fileParsed = new Event() let beforeFileChecked = new Event() let fileChecked = new Event() let projectChecked = new Event() +#if !NO_EXTENSIONTYPING + let importsInvalidatedByTypeProvider = new Event() +#endif + let mutable currentTcImportsOpt = None // Check for the existence of loaded sources and prepend them to the sources list if present. let sourceFiles = tcConfig.GetAvailableLoadedSources() @ (sourceFiles |>List.map (fun s -> rangeStartup, s)) @@ -1242,27 +1245,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput for (_, f, _) in sourceFiles do yield f |] - // The IncrementalBuilder needs to hold up to one item that needs to be disposed, which is the tcImports for the incremental - // build. - let mutable cleanupItem = None: TcImports option - let disposeCleanupItem() = - match cleanupItem with - | None -> () - | Some item -> - cleanupItem <- None - dispose item - - let setCleanupItem x = - assert cleanupItem.IsNone - cleanupItem <- Some x - - let mutable disposed = false - let assertNotDisposed() = - if disposed then - System.Diagnostics.Debug.Assert(false, "IncrementalBuild object has already been disposed!") - - let mutable referenceCount = 0 - //---------------------------------------------------- // START OF BUILD TASK FUNCTIONS @@ -1270,14 +1252,12 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Get the timestamp of the given file name. let StampFileNameTask (cache: TimeStampCache) _ctok (_m: range, filename: string, _isLastCompiland) = - assertNotDisposed() cache.GetFileTimeStamp filename /// This is a build task function that gets placed into the build rules as the computation for a VectorMap /// /// Parse the given file and return the given input. let ParseTask ctok (sourceRange: range, filename: string, isLastCompiland) = - assertNotDisposed() DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok let errorLogger = CompilationErrorLogger("ParseTask", tcConfig.errorSeverityOptions) @@ -1300,7 +1280,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Timestamps of referenced assemblies are taken from the file's timestamp. let StampReferencedAssemblyTask (cache: TimeStampCache) ctok (_ref, timeStamper) = - assertNotDisposed() timeStamper cache ctok @@ -1309,7 +1288,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // Link all the assemblies together and produce the input typecheck accumulator let CombineImportedAssembliesTask ctok _ : Cancellable = cancellable { - assertNotDisposed() let errorLogger = CompilationErrorLogger("CombineImportedAssembliesTask", tcConfig.errorSeverityOptions) // Return the disposable object that cleans up use _holder = new CompilationGlobalsScope(errorLogger, BuildPhase.Parameter) @@ -1317,10 +1295,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let! tcImports = cancellable { try - // We dispose any previous tcImports, for the case where a dependency changed which caused this part - // of the partial build to be re-evaluated. - disposeCleanupItem() - let! tcImports = TcImports.BuildNonFrameworkTcImports(ctok, tcConfigP, tcGlobals, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences) #if !NO_EXTENSIONTYPING tcImports.GetCcusExcludingBase() |> Seq.iter (fun ccu -> @@ -1338,19 +1312,13 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // // In the invalidation handler we use a weak reference to allow the IncrementalBuilder to // be collected if, for some reason, a TP instance is not disposed or not GC'd. - let capturedImportsInvalidated = WeakReference<_>(importsInvalidated) + let capturedImportsInvalidated = WeakReference<_>(importsInvalidatedByTypeProvider) ccu.Deref.InvalidateEvent.Add(fun msg -> match capturedImportsInvalidated.TryGetTarget() with | true, tg -> tg.Trigger msg - | _ -> ())) + | _ -> ())) #endif - - - // The tcImports must be cleaned up if this builder ever gets disposed. We also dispose any previous - // tcImports should we be re-creating an entry because a dependency changed which caused this part - // of the partial build to be re-evaluated. - setCleanupItem tcImports - + currentTcImportsOpt <- Some tcImports return tcImports with e -> System.Diagnostics.Debug.Assert(false, sprintf "Could not BuildAllReferencedDllTcImports %A" e) @@ -1390,7 +1358,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Type check all files. let TypeCheckTask ctok (tcAcc: TypeCheckAccumulator) input: Eventually = - assertNotDisposed() match input with | Some input, _sourceRange, filename, parseErrors-> IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBETypechecked filename) @@ -1462,7 +1429,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// Finish up the typechecking to produce outputs for the rest of the compilation process let FinalizeTypeCheckTask ctok (tcStates: TypeCheckAccumulator[]) = cancellable { - assertNotDisposed() DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok let errorLogger = CompilationErrorLogger("CombineImportedAssembliesTask", tcConfig.errorSeverityOptions) @@ -1581,21 +1547,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput partialBuild <- b let MaxTimeStampInDependencies cache (ctok: CompilationThreadToken) (output: INode) = - IncrementalBuild.MaxTimeStampInDependencies cache ctok output.Name partialBuild - - member this.IncrementUsageCount() = - assertNotDisposed() - System.Threading.Interlocked.Increment(&referenceCount) |> ignore - { new System.IDisposable with member __.Dispose() = this.DecrementUsageCount() } - - member __.DecrementUsageCount() = - assertNotDisposed() - let currentValue = System.Threading.Interlocked.Decrement(&referenceCount) - if currentValue = 0 then - disposed <- true - disposeCleanupItem() - - member __.IsAlive = referenceCount > 0 + IncrementalBuild.MaxTimeStampInDependencies cache ctok output.Name partialBuild member __.TcConfig = tcConfig @@ -1607,21 +1559,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member __.ProjectChecked = projectChecked.Publish - member __.ImportedCcusInvalidated = importsInvalidated.Publish - - member __.AllDependenciesDeprecated = allDependencies - #if !NO_EXTENSIONTYPING - member __.ThereAreLiveTypeProviders = - let liveTPs = - match cleanupItem with - | None -> [] - | Some tcImports -> [for ia in tcImports.GetImportedAssemblies() do yield! ia.TypeProviders] - match liveTPs with - | [] -> false - | _ -> true + member __.ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider.Publish #endif + member __.TryGetCurrentTcImports () = currentTcImportsOpt + + member __.AllDependenciesDeprecated = allDependencies + member __.Step (ctok: CompilationThreadToken) = cancellable { let cache = TimeStampCache defaultTimeStamp // One per step @@ -1808,6 +1753,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // Never open PDB files for the language service, even if --standalone is specified tcConfigB.openDebugInformationForLaterStaticLinking <- false + tcConfigB.compilationThread <- + { new ICompilationThread with + member __.EnqueueWork work = + Reactor.Singleton.EnqueueOp ("Unknown", "ICompilationThread.EnqueueWork", "work", fun ctok -> + work ctok + ) + } + tcConfigB, sourceFilesNew match loadClosureOpt with @@ -1887,11 +1840,3 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput return builderOpt, diagnostics } - - static member KeepBuilderAlive (builderOpt: IncrementalBuilder option) = - match builderOpt with - | Some builder -> builder.IncrementUsageCount() - | None -> { new System.IDisposable with member __.Dispose() = () } - - member __.IsBeingKeptAliveApartFromCacheEntry = (referenceCount >= 2) - diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi index 89d143ca985..96d00636887 100755 --- a/src/fsharp/service/IncrementalBuild.fsi +++ b/src/fsharp/service/IncrementalBuild.fsi @@ -80,9 +80,6 @@ type internal PartialCheckResults = [] type internal IncrementalBuilder = - /// Check if the builder is not disposed - member IsAlive : bool - /// The TcConfig passed in to the builder creation. member TcConfig : TcConfig @@ -104,15 +101,17 @@ type internal IncrementalBuilder = /// overall analysis results for the project will be quick. member ProjectChecked : IEvent +#if !NO_EXTENSIONTYPING /// Raised when a type provider invalidates the build. - member ImportedCcusInvalidated : IEvent + member ImportsInvalidatedByTypeProvider : IEvent +#endif + + /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. + member TryGetCurrentTcImports : unit -> TcImports option /// The list of files the build depends on member AllDependenciesDeprecated : string[] -#if !NO_EXTENSIONTYPING - /// Whether there are any 'live' type providers that may need a refresh when a project is Cleaned - member ThereAreLiveTypeProviders : bool -#endif + /// Perform one step in the F# build. Return true if the background work is finished. member Step : CompilationThreadToken -> Cancellable @@ -164,13 +163,6 @@ type internal IncrementalBuilder = static member TryCreateBackgroundBuilderForProjectOptions : CompilationThreadToken * ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * FrameworkImportsCache * scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectReferences: IProjectReference list * projectDirectory:string * useScriptResolutionRules:bool * keepAssemblyContents: bool * keepAllBackgroundResolutions: bool * maxTimeShareMilliseconds: int64 * tryGetMetadataSnapshot: ILBinaryReader.ILReaderTryGetMetadataSnapshot * suggestNamesForErrors: bool -> Cancellable - /// Increment the usage count on the IncrementalBuilder by 1. This initial usage count is 0 so immediately after creation - /// a call to KeepBuilderAlive should be made. The returns an IDisposable which will - /// decrement the usage count and dispose if the usage count goes to zero - static member KeepBuilderAlive : IncrementalBuilder option -> IDisposable - - member IsBeingKeptAliveApartFromCacheEntry : bool - /// Generalized Incremental Builder. This is exposed only for unittesting purposes. module internal IncrementalBuild = type INode = diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index f06fc56ca2e..c4bf83bf087 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -492,19 +492,12 @@ type FSharpDeclarationListItem(name: string, nameInCode: string, fullName: strin member __.StructuredDescriptionTextAsync = let userOpName = "ToolTip" match info with - | Choice1Of2 (items: CompletionItem list, infoReader, m, denv, reactor:IReactorOperations, checkAlive) -> + | Choice1Of2 (items: CompletionItem list, infoReader, m, denv, reactor:IReactorOperations) -> // reactor causes the lambda to execute on the background compiler thread, through the Reactor reactor.EnqueueAndAwaitOpAsync (userOpName, "StructuredDescriptionTextAsync", name, fun ctok -> RequireCompilationThread ctok - // This is where we do some work which may touch TAST data structures owned by the IncrementalBuilder - infoReader, item etc. - // It is written to be robust to a disposal of an IncrementalBuilder, in which case it will just return the empty string. - // It is best to think of this as a "weak reference" to the IncrementalBuilder, i.e. this code is written to be robust to its - // disposal. Yes, you are right to scratch your head here, but this is ok. - cancellable.Return( - if checkAlive() then - FSharpToolTipText(items |> List.map (fun x -> SymbolHelpers.FormatStructuredDescriptionOfItem true infoReader m denv x.ItemWithInst)) - else - FSharpToolTipText [ FSharpStructuredToolTipElement.Single(wordL (tagText (FSComp.SR.descriptionUnavailable())), FSharpXmlDoc.None) ])) + cancellable.Return(FSharpToolTipText(items |> List.map (fun x -> SymbolHelpers.FormatStructuredDescriptionOfItem true infoReader m denv x.ItemWithInst))) + ) | Choice2Of2 result -> async.Return result @@ -559,7 +552,7 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT member __.IsError = isError // Make a 'Declarations' object for a set of selected items - static member Create(infoReader:InfoReader, m, denv, getAccessibility, items: CompletionItem list, reactor, currentNamespaceOrModule: string[] option, isAttributeApplicationContext: bool, checkAlive) = + static member Create(infoReader:InfoReader, m: range, denv, getAccessibility, items: CompletionItem list, reactor, currentNamespaceOrModule: string[] option, isAttributeApplicationContext: bool) = let g = infoReader.g let isForType = items |> List.exists (fun x -> x.Type.IsSome) let items = items |> SymbolHelpers.RemoveExplicitlySuppressedCompletionItems g @@ -697,7 +690,7 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT | ns -> Some (System.String.Join(".", ns))) FSharpDeclarationListItem( - name, nameInCode, fullName, glyph, Choice1Of2 (items, infoReader, m, denv, reactor, checkAlive), getAccessibility item.Item, + name, nameInCode, fullName, glyph, Choice1Of2 (items, infoReader, m, denv, reactor), getAccessibility item.Item, item.Kind, item.IsOwnMember, item.MinorPriority, item.Unresolved.IsNone, namespaceToOpen)) new FSharpDeclarationListInfo(Array.ofList decls, isForType, false) diff --git a/src/fsharp/service/ServiceDeclarationLists.fsi b/src/fsharp/service/ServiceDeclarationLists.fsi index 4dc7905251d..ae8171bfb00 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fsi +++ b/src/fsharp/service/ServiceDeclarationLists.fsi @@ -67,7 +67,7 @@ type public FSharpDeclarationListInfo = member IsError : bool // Implementation details used by other code in the compiler - static member internal Create : infoReader:InfoReader * m:range * denv:DisplayEnv * getAccessibility:(Item -> FSharpAccessibility option) * items:CompletionItem list * reactor:IReactorOperations * currentNamespace:string[] option * isAttributeApplicationContex:bool * checkAlive:(unit -> bool) -> FSharpDeclarationListInfo + static member internal Create : infoReader:InfoReader * m:range * denv:DisplayEnv * getAccessibility:(Item -> FSharpAccessibility option) * items:CompletionItem list * reactor:IReactorOperations * currentNamespace:string[] option * isAttributeApplicationContex:bool -> FSharpDeclarationListInfo static member internal Error : message:string -> FSharpDeclarationListInfo diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 3ca4f8a248f..a63fdccee89 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -161,7 +161,6 @@ type TypeCheckInfo sFallback: NameResolutionEnv, loadClosure : LoadClosure option, reactorOps : IReactorOperations, - checkAlive : (unit -> bool), textSnapshotInfo:obj option, implFileOpt: TypedImplFile option, openDeclarations: OpenDeclaration[]) = @@ -937,7 +936,7 @@ type TypeCheckInfo |> Option.bind (fun x -> x.ParseTree) |> Option.map (fun parsedInput -> UntypedParseImpl.GetFullNameOfSmallestModuleOrNamespaceAtPoint(parsedInput, mkPos line 0)) let isAttributeApplication = ctx = Some CompletionContext.AttributeApplication - FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication,checkAlive)) + FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication)) (fun msg -> Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarations: '%s'" msg) FSharpDeclarationListInfo.Error msg) @@ -1616,8 +1615,6 @@ module internal Parser = // These are the errors and warnings seen by the background compiler for the entire antecedent backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], reactorOps: IReactorOperations, - // Used by 'FSharpDeclarationListInfo' to check the IncrementalBuilder is still alive. - checkAlive : (unit -> bool), textSnapshotInfo : obj option, userOpName: string, suggestNamesForErrors: bool) = @@ -1761,7 +1758,6 @@ module internal Parser = tcEnvAtEnd.NameEnv, loadClosure, reactorOps, - checkAlive, textSnapshotInfo, List.tryHead implFiles, sink.GetOpenDeclarations()) @@ -1935,48 +1931,18 @@ type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssem override info.ToString() = "FSharpCheckProjectResults(" + projectFileName + ")" [] -/// A live object of this type keeps the background corresponding background builder (and type providers) alive (through reference-counting). -// -// There is an important property of all the objects returned by the methods of this type: they do not require -// the corresponding background builder to be alive. That is, they are simply plain-old-data through pre-formatting of all result text. type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo option, dependencyFiles: string[], builderX: IncrementalBuilder option, reactorOpsX:IReactorOperations, keepAssemblyContents: bool) = - // This may be None initially, or may be set to None when the object is disposed or finalized + // This may be None initially. let mutable details = match scopeOptX with None -> None | Some scopeX -> Some (scopeX, builderX, reactorOpsX) - // Increment the usage count on the IncrementalBuilder. We want to keep the IncrementalBuilder and all associated - // resources and type providers alive for the duration of the lifetime of this object. - let decrementer = - match details with - | Some (_,builderOpt,_) -> IncrementalBuilder.KeepBuilderAlive builderOpt - | _ -> { new System.IDisposable with member x.Dispose() = () } - - let mutable disposed = false - - let dispose() = - if not disposed then - disposed <- true - match details with - | Some (_,_,reactor) -> - // Make sure we run disposal in the reactor thread, since it may trigger type provider disposals etc. - details <- None - reactor.EnqueueOp ("GCFinalizer","FSharpCheckFileResults.DecrementUsageCountOnIncrementalBuilder", filename, fun ctok -> - RequireCompilationThread ctok - decrementer.Dispose()) - | _ -> () - // Run an operation that needs to access a builder and be run in the reactor thread let reactorOp userOpName opName dflt f = async { match details with | None -> return dflt - | Some (_, Some builder, _) when not builder.IsAlive -> - System.Diagnostics.Debug.Assert(false,"unexpected dead builder") - return dflt - | Some (scope, builderOpt, reactor) -> - // Increment the usage count to ensure the builder doesn't get released while running operations asynchronously. - use _unwind = IncrementalBuilder.KeepBuilderAlive builderOpt + | Some (scope, _, reactor) -> let! res = reactor.EnqueueAndAwaitOpAsync(userOpName, opName, filename, fun ctok -> f ctok scope |> cancellable.Return) return res } @@ -1987,13 +1953,14 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | None -> dflt() | Some (scope, _builderOpt, _ops) -> f scope - // At the moment we only dispose on finalize - we never explicitly dispose these objects. Explicitly disposing is not - // really worth much since the underlying project builds are likely to still be in the incrementalBuilder cache. - override info.Finalize() = dispose() - member info.Errors = errors member info.HasFullTypeCheckInfo = details.IsSome + + member info.TryGetCurrentTcImports () = + match builderX with + | Some builder -> builder.TryGetCurrentTcImports () + | _ -> None /// Intellisense autocompletions member info.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = @@ -2388,17 +2355,16 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds, tryGetMetadataSnapshot, suggestNamesForErrors) - // We're putting the builder in the cache, so increment its count. - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - match builderOpt with | None -> () | Some builder -> +#if !NO_EXTENSIONTYPING // Register the behaviour that responds to CCUs being invalidated because of type // provider Invalidate events. This invalidates the configuration in the build. - builder.ImportedCcusInvalidated.Add (fun _ -> + builder.ImportsInvalidatedByTypeProvider.Add (fun _ -> self.InvalidateConfiguration(options, None, userOpName)) +#endif // Register the callback called just before a file is typechecked by the background builder (without recording // errors or intellisense information). @@ -2410,7 +2376,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC builder.FileChecked.Add (fun file -> fileChecked.Trigger(file, options.ExtraProjectInfo)) builder.ProjectChecked.Add (fun () -> projectChecked.Trigger (options.ProjectFileName, options.ExtraProjectInfo)) - return (builderOpt, diagnostics, decrement) + return (builderOpt, diagnostics) } // STATIC ROOT: FSharpLanguageServiceTestable.FSharpChecker.backgroundCompiler.incrementalBuildersCache. This root typically holds more @@ -2419,27 +2385,23 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // /// Cache of builds keyed by options. let incrementalBuildersCache = - MruCache + MruCache (keepStrongly=projectCacheSize, keepMax=projectCacheSize, areSame = FSharpProjectOptions.AreSameForChecking, - areSimilar = FSharpProjectOptions.UseSameProject, - requiredToKeep=(fun (builderOpt,_,_) -> match builderOpt with None -> false | Some (b:IncrementalBuilder) -> b.IsBeingKeptAliveApartFromCacheEntry), - onDiscard = (fun (_, _, decrement:IDisposable) -> decrement.Dispose())) + areSimilar = FSharpProjectOptions.UseSameProject) - let getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) = + let getOrCreateBuilder (ctok, options, userOpName) = cancellable { RequireCompilationThread ctok match incrementalBuildersCache.TryGet (ctok, options) with - | Some (builderOpt,creationErrors,_) -> + | Some (builderOpt,creationErrors) -> Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_GettingCache - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - return builderOpt,creationErrors, decrement + return builderOpt,creationErrors | None -> Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_BuildingNewCache - let! (builderOpt,creationErrors,_) as info = CreateOneIncrementalBuilder (ctok, options, userOpName) + let! (builderOpt,creationErrors) as info = CreateOneIncrementalBuilder (ctok, options, userOpName) incrementalBuildersCache.Set (ctok, options, info) - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - return builderOpt, creationErrors, decrement + return builderOpt, creationErrors } let parseCacheLock = Lock() @@ -2530,8 +2492,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundParseResultsForFileInProject ", filename, fun ctok -> cancellable { - let! builderOpt, creationErrors, decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> return FSharpParseFileResults(creationErrors, None, true, [| |]) | Some builder -> @@ -2600,7 +2561,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, fileName, options.ProjectFileName, tcPrior.TcConfig, tcPrior.TcGlobals, tcPrior.TcImports, - tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName, suggestNamesForErrors) + tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, textSnapshotInfo, userOpName, suggestNamesForErrors) let parsingOptions = FSharpParsingOptions.FromTcConfig(tcPrior.TcConfig, Array.ofList builder.SourceFiles, options.UseScriptResolutionRules) let checkAnswer = MakeCheckFileAnswer(fileName, tcFileResult, options, builder, Array.ofList tcPrior.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) bc.RecordTypeCheckFileInProjectResults(fileName, options, parsingOptions, parseResults, fileVersion, tcPrior.TimeStamp, Some checkAnswer, sourceText.GetHashCode()) @@ -2629,11 +2590,10 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let! cachedResults = execWithReactorAsync <| fun ctok -> cancellable { - let! _builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! _builderOpt,_creationErrors = getOrCreateBuilder (ctok, options, userOpName) match incrementalBuildersCache.TryGetAny (ctok, options) with - | Some (Some builder, creationErrors, _) -> + | Some (Some builder, creationErrors) -> match bc.GetCachedCheckFileResult(builder, filename, sourceText, options) with | Some (_, checkResults) -> return Some (builder, creationErrors, Some (FSharpCheckFileAnswer.Succeeded checkResults)) | _ -> return Some (builder, creationErrors, None) @@ -2668,8 +2628,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC try if implicitlyStartBackgroundWork then reactor.CancelBackgroundOp() // cancel the background work, since we will start new work after we're done - let! builderOpt,creationErrors, decrement = execWithReactorAsync (fun ctok -> getOrCreateBuilderAndKeepAlive (ctok, options, userOpName)) - use _unwind = decrement + let! builderOpt,creationErrors = execWithReactorAsync (fun ctok -> getOrCreateBuilder (ctok, options, userOpName)) match builderOpt with | None -> return FSharpCheckFileAnswer.Succeeded (MakeCheckFileResultsEmpty(filename, creationErrors)) | Some builder -> @@ -2699,8 +2658,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC Logger.LogMessage (filename + strGuid + "-Cancelling background work") LogCompilerFunctionId.Service_ParseAndCheckFileInProject reactor.CancelBackgroundOp() // cancel the background work, since we will start new work after we're done - let! builderOpt,creationErrors,decrement = execWithReactorAsync (fun ctok -> getOrCreateBuilderAndKeepAlive (ctok, options, userOpName)) - use _unwind = decrement + let! builderOpt,creationErrors = execWithReactorAsync (fun ctok -> getOrCreateBuilder (ctok, options, userOpName)) match builderOpt with | None -> Logger.LogBlockMessageStop (filename + strGuid + "-Failed_Aborted") LogCompilerFunctionId.Service_ParseAndCheckFileInProject @@ -2738,8 +2696,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.GetBackgroundCheckResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundCheckResultsForFileInProject", filename, fun ctok -> cancellable { - let! builderOpt, creationErrors, decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> let parseResults = FSharpParseFileResults(creationErrors, None, true, [| |]) @@ -2761,7 +2718,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC List.head tcProj.TcResolutionsRev, List.head tcProj.TcSymbolUsesRev, tcProj.TcEnvAtEnd.NameEnv, - loadClosure, reactorOps, (fun () -> builder.IsAlive), None, + loadClosure, reactorOps, None, tcProj.LatestImplementationFile, List.head tcProj.TcOpenDeclarationsRev) let typedResults = MakeCheckFileResults(filename, options, builder, scope, Array.ofList tcProj.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) @@ -2782,8 +2739,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC /// Parse and typecheck the whole project (the implementation, called recursively as project graph is evaluated) member private bc.ParseAndCheckProjectImpl(options, ctok, userOpName) : Cancellable = cancellable { - let! builderOpt,creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt,creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, creationErrors, None) @@ -2803,20 +2759,11 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // NOTE: This creation of the background builder is currently run as uncancellable. Creating background builders is generally // cheap though the timestamp computations look suspicious for transitive project references. - let builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName + ".TryGetLogicalTimeStampForProject") |> Cancellable.runWithoutCancellation - use _unwind = decrement + let builderOpt,_creationErrors = getOrCreateBuilder (ctok, options, userOpName + ".TryGetLogicalTimeStampForProject") |> Cancellable.runWithoutCancellation match builderOpt with | None -> None | Some builder -> Some (builder.GetLogicalTimeStampForProject(cache, ctok)) - /// Keep the projet builder alive over a scope - member bc.KeepProjectAlive(options, userOpName) = - reactor.EnqueueAndAwaitOpAsync(userOpName, "KeepProjectAlive", options.ProjectFileName, fun ctok -> - cancellable { - let! _builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - return decrement - }) - /// Parse and typecheck the whole project. member bc.ParseAndCheckProject(options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "ParseAndCheckProject", options.ProjectFileName, fun ctok -> bc.ParseAndCheckProjectImpl(options, ctok, userOpName)) @@ -2912,10 +2859,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.CheckProjectInBackground (options, userOpName) = reactor.SetBackgroundOp (Some (userOpName, "CheckProjectInBackground", options.ProjectFileName, (fun ctok ct -> // The creation of the background builder can't currently be cancelled - match getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) |> Cancellable.run ct with + match getOrCreateBuilder (ctok, options, userOpName) |> Cancellable.run ct with | ValueOrCancelled.Cancelled _ -> false - | ValueOrCancelled.Value (builderOpt,_,decrement) -> - use _unwind = decrement + | ValueOrCancelled.Value (builderOpt,_) -> match builderOpt with | None -> false | Some builder -> @@ -3205,10 +3151,6 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten ic.CheckMaxMemoryReached() backgroundCompiler.ParseAndCheckProject(options, userOpName) - member ic.KeepProjectAlive(options, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - backgroundCompiler.KeepProjectAlive(options, userOpName) - /// For a given script file, get the ProjectOptions implied by the #load closure member ic.GetProjectOptionsFromScript(filename, source, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?useSdkRefs, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" @@ -3325,7 +3267,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, [ ]) let loadClosure = LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, sourceText, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, tcConfig.useSdkRefs, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) - let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, (fun () -> true), None, userOpName, suggestNamesForErrors) + let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, None, userOpName, suggestNamesForErrors) return match tcFileResult with diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index a17abb46a3d..ea27c142c12 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -98,6 +98,9 @@ type public FSharpCheckFileResults = /// an unrecoverable error in earlier checking/parsing/resolution steps. member HasFullTypeCheckInfo: bool + /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. + member internal TryGetCurrentTcImports: unit -> TcImports option + /// Indicates the set of files which must be watched to accurately track changes that affect these results, /// Clients interested in reacting to updates to these files should watch these files and take actions as described /// in the documentation for compiler service. @@ -504,14 +507,6 @@ type public FSharpChecker = /// An optional string used for tracing compiler operations associated with this request. member ParseAndCheckProject : options: FSharpProjectOptions * ?userOpName: string -> Async - /// - /// Create resources for the project and keep the project alive until the returned object is disposed. - /// - /// - /// The options for the project or script. - /// An optional string used for tracing compiler operations associated with this request. - member KeepProjectAlive : options: FSharpProjectOptions * ?userOpName: string -> Async - /// /// For a given script file, get the FSharpProjectOptions implied by the #load closure. /// All files are read from the FileSystem API, except the file being checked. diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 45608256535..04ba820da0d 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -348,11 +348,6 @@ let ``Test ManyProjectsStressTest cache too small`` () = let checker = ManyProjectsStressTest.makeCheckerForStressTest false - // Because the cache is too small, we need explicit calls to KeepAlive to avoid disposal of project information - let disposals = - [ for p in ManyProjectsStressTest.jointProject :: ManyProjectsStressTest.projects do - yield checker.KeepProjectAlive p.Options |> Async.RunSynchronously ] - let wholeProjectResults = checker.ParseAndCheckProject(ManyProjectsStressTest.jointProject.Options) |> Async.RunSynchronously [ for x in wholeProjectResults.AssemblySignature.Entities -> x.DisplayName ] |> shouldEqual ["JointProject"] diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 9dca0cd56f6..16ef433e691 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -96,7 +96,6 @@ let mmmm2 : M.CAbbrev = new M.CAbbrev() // note, these don't count as uses of C [] let ``Test project1 whole project errors`` () = - let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously wholeProjectResults .Errors.Length |> shouldEqual 2 wholeProjectResults.Errors.[1].Message.Contains("Incomplete pattern matches on this expression") |> shouldEqual true // yes it does @@ -107,6 +106,26 @@ let ``Test project1 whole project errors`` () = wholeProjectResults.Errors.[0].StartColumn |> shouldEqual 43 wholeProjectResults.Errors.[0].EndColumn |> shouldEqual 44 +[] +let ``Test project1 and make sure TcImports gets cleaned up`` () = + + let test () = + let (_, checkFileAnswer) = checker.ParseAndCheckFileInProject(Project1.fileName1, 0, Project1.fileSource1, Project1.options) |> Async.RunSynchronously + match checkFileAnswer with + | FSharpCheckFileAnswer.Aborted -> failwith "should not be aborted" + | FSharpCheckFileAnswer.Succeeded checkFileResults -> + let tcImportsOpt = checkFileResults.TryGetCurrentTcImports () + Assert.True tcImportsOpt.IsSome + let weakTcImports = WeakReference tcImportsOpt.Value + Assert.True weakTcImports.IsAlive + weakTcImports + + let weakTcImports = test () + checker.InvalidateConfiguration (Project1.options) + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + GC.Collect(2, GCCollectionMode.Forced, blocking = true) + Assert.False weakTcImports.IsAlive + [] let ``Test Project1 should have protected FullName and TryFullName return same results`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously From 8e467c11ad69357d6b975524b9c98a8efee7732a Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 00:08:50 -0700 Subject: [PATCH 3/7] Remove call to internal API in Simplify Name Analyzer (#6901) * Remove call to internal API in Simplify Name Analyzer * Remove unused opens --- .../Diagnostics/SimplifyNameDiagnosticAnalyzer.fs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 53556c97e71..97235c0f1e0 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -7,13 +7,11 @@ open System.Collections.Immutable open System.Diagnostics open System.Threading open System.Threading.Tasks -open System.Runtime.CompilerServices open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler open FSharp.Compiler.Range -open FSharp.Compiler.SourceCodeServices open System.Runtime.Caching open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics @@ -94,7 +92,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = match rest with | [] -> return current | headIdent :: restPlid -> - let! res = checkResults.IsRelativeNameResolvable(posAtStartOfName, current, symbolUse.Symbol.Item, userOpName=userOpName) + let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) if res then return current else return! loop restPlid (headIdent :: current) } From be0a37411f19280c6453fb0c78e87cb358e30f13 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 31 May 2019 00:46:34 -0700 Subject: [PATCH 4/7] add framework for LSP support (#6907) --- .gitignore | 1 + FSharp.sln | 30 ++++++++ VisualFSharp.sln | 30 ++++++++ eng/Build.ps1 | 2 + eng/Versions.props | 1 + eng/build.sh | 1 + .../Directory.Build.props | 9 +++ .../FSharp.Compiler.LanguageServer.fsproj | 31 ++++++++ .../LspTypes.fs | 72 +++++++++++++++++++ .../FSharp.Compiler.LanguageServer/Methods.fs | 22 ++++++ .../FSharp.Compiler.LanguageServer/Program.fs | 16 +++++ .../FSharp.Compiler.LanguageServer/Server.fs | 25 +++++++ .../FSharp.Compiler.LanguageServer/State.fs | 12 ++++ .../TextDocument.fs | 33 +++++++++ .../FSharp.Compiler.Private.fsproj | 1 + .../Directory.Build.props | 9 +++ ...p.Compiler.LanguageServer.UnitTests.fsproj | 25 +++++++ .../ProtocolTests.fs | 40 +++++++++++ 18 files changed, 360 insertions(+) create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Program.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Server.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/State.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs diff --git a/.gitignore b/.gitignore index cbf6773ddd1..e6feea6dfc9 100644 --- a/.gitignore +++ b/.gitignore @@ -95,6 +95,7 @@ extras ossreadme*.txt *.csproj.user *.fsproj.user +*.vbproj.user *.sln.DotSettings.user *.log *.jrs diff --git a/FSharp.sln b/FSharp.sln index 8d4feaef719..c34abdba39a 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -38,6 +38,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packages", "Packages", "{38 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\fsharp\FSharp.Compiler.nuget\Microsoft.FSharp.Compiler.csproj", "{81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\fsharp\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{C97819B0-B428-4B96-9CD7-497D2D1C738C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -180,6 +184,30 @@ Global {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|Any CPU.Build.0 = Release|Any CPU {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|x86.ActiveCfg = Release|Any CPU {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|x86.Build.0 = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|x86.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|Any CPU.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|x86.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|x86.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|Any CPU.Build.0 = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|x86.ActiveCfg = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|x86.Build.0 = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|x86.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|Any CPU.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|x86.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|x86.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|Any CPU.Build.0 = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.ActiveCfg = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -196,6 +224,8 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {53C0DAAD-158C-4658-8EC7-D7341530239F} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7} = {3840F2E7-3898-45F7-8CF7-1E6829E56DB8} + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {C97819B0-B428-4B96-9CD7-497D2D1C738C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 41d5424b810..3df52bb4731 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -154,6 +154,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TutorialProject", "vsintegr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.Core.nuget", "src\fsharp\FSharp.Core.nuget\FSharp.Core.nuget.csproj", "{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\fsharp\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{60BAFFA5-6631-4328-B044-2E012AB76DCA}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{AAF2D233-1C38-4090-8FFA-F7C545625E06}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -884,6 +888,30 @@ Global {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|Any CPU.Build.0 = Release|Any CPU {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|x86.ActiveCfg = Release|Any CPU {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|x86.Build.0 = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|x86.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|x86.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|Any CPU.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|x86.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|x86.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|Any CPU.Build.0 = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|x86.ActiveCfg = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|x86.Build.0 = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|x86.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|x86.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|Any CPU.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|x86.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|x86.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|Any CPU.Build.0 = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.ActiveCfg = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -956,6 +984,8 @@ Global {C32806E0-71C2-40E4-AEC4-517F73F6A18A} = {BED74F9E-A0D2-48E2-9EE7-449832100487} {7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1} = {BED74F9E-A0D2-48E2-9EE7-449832100487} {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC} = {647810D0-5307-448F-99A2-E83917010DAE} + {60BAFFA5-6631-4328-B044-2E012AB76DCA} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {AAF2D233-1C38-4090-8FFA-F7C545625E06} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 2c88012b376..a296764692d 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -270,6 +270,7 @@ try { if ($testDesktop) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework @@ -277,6 +278,7 @@ try { if ($testCoreClr) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework diff --git a/eng/Versions.props b/eng/Versions.props index ee246da3bd7..d288bf98a9a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -175,5 +175,6 @@ 2.1.36 1.0.0-beta2-dev3 5.22.2.1 + 2.0.187 \ No newline at end of file diff --git a/eng/build.sh b/eng/build.sh index 23b00ef66a9..8ce74bfa523 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -245,6 +245,7 @@ BuildSolution if [[ "$test_core_clr" == true ]]; then coreclrtestframework=netcoreapp2.1 TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework fi diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props b/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props new file mode 100644 index 00000000000..7cd41381b5d --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props @@ -0,0 +1,9 @@ + + + + true + + + + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj new file mode 100644 index 00000000000..1e0ca2f912a --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj @@ -0,0 +1,31 @@ + + + + + Exe + .exe + net472;netcoreapp2.1 + netcoreapp2.1 + true + Implements the Language Server Protocol (LSP) for F#. + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs new file mode 100644 index 00000000000..7a919bc74de --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +// Interfaces as defined at https://microsoft.github.io/language-server-protocol/specification. The properties on these +// types are camlCased to match the underlying JSON properties to avoid attributes on every field: +// [] + +/// Represents a zero-based line and column of a text document. +type Position = + { line: int + character: int } + +type Range = + { start: Position + ``end``: Position } + +type DocumentUri = string + +type Location = + { uri: DocumentUri + range: Range } + +type DiagnosticRelatedInformation = + { location: Location + message: string } + +type Diagnostic = + { range: Range + severity: int + code: string + source: string // "F#" + message: string + relatedInformation: DiagnosticRelatedInformation[] } + static member Error = 1 + static member Warning = 2 + static member Information = 3 + static member Hint = 4 + +type PublishDiagnosticsParams = + { uri: DocumentUri + diagnostics: Diagnostic[] } + +type InitializeParams = string // TODO: + +// Note, this type has many more optional values that can be expanded as support is added. +type ServerCapabilities = + { hoverProvider: bool } + static member DefaultCapabilities() = + { ServerCapabilities.hoverProvider = true } + +type InitializeResult = + { capabilities: ServerCapabilities } + +type MarkupKind = + | PlainText + | Markdown + +type MarkupContent = + { kind: MarkupKind + value: string } + +type Hover = + { contents: MarkupContent + range: Range option } + +type TextDocumentIdentifier = + { uri: DocumentUri } + +type TextDocumentPositionParams = + { textDocument: TextDocumentIdentifier + position: Position } diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs new file mode 100644 index 00000000000..80e06e9781b --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open StreamJsonRpc + +// https://microsoft.github.io/language-server-protocol/specification +type Methods(state: State) = + + [] + member __.Initialize (args: InitializeParams) = + async { + // note, it's important that this method is `async` because unit tests can then properly verify that the + // JSON RPC handling of async methods is correct + return ServerCapabilities.DefaultCapabilities() + } |> Async.StartAsTask + + [] + member __.Shutdown() = state.DoShutdown() + + [] + member __.TextDocumentHover (args: TextDocumentPositionParams) = TextDocument.Hover(state, args) |> Async.StartAsTask diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs new file mode 100644 index 00000000000..13d0c9709fb --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System + +module Program = + + [] + let main(args: string[]) = + async { + let server = new Server(Console.OpenStandardOutput(), Console.OpenStandardInput()) + server.StartListening() + do! server.WaitForExitAsync() + return 0 + } |> Async.RunSynchronously diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs new file mode 100644 index 00000000000..87f6d1c2ffe --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System +open System.IO +open StreamJsonRpc + +type Server(sendingStream: Stream, receivingStream: Stream) = + + let state = State() + let methods = Methods(state) + let rpc = new JsonRpc(sendingStream, receivingStream, methods) + + member __.StartListening() = + rpc.StartListening() + + member __.WaitForExitAsync() = + async { + do! Async.AwaitEvent (state.Shutdown) + } + + interface IDisposable with + member __.Dispose() = + rpc.Dispose() diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/State.fs b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs new file mode 100644 index 00000000000..53cacbb8c0d --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +type State() = + + let shutdownEvent = new Event<_>() + + [] + member __.Shutdown = shutdownEvent.Publish + + member __.DoShutdown() = shutdownEvent.Trigger() diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs new file mode 100644 index 00000000000..eef57581c5b --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +module TextDocument = + + let Hover(state: State, args: TextDocumentPositionParams) = + async { + return { + Hover.contents = { + MarkupContent.kind = MarkupKind.PlainText + value = "TODO" + } + range = Some({ + Range.start = { + Position.line = 0 + character = 0 + } + ``end`` = { + Position.line = 0 + character = 0 + } + }) + } + } + + let PublishDiagnostics(state: State) = + async { + return { + PublishDiagnosticsParams.uri = "" + diagnostics = [||] + } + } diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 3b3d38409f7..e8831bc9327 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -49,6 +49,7 @@ + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props b/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props new file mode 100644 index 00000000000..7cd41381b5d --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props @@ -0,0 +1,9 @@ + + + + true + + + + + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj new file mode 100644 index 00000000000..a5e8bdf3264 --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj @@ -0,0 +1,25 @@ + + + + + net472;netcoreapp2.1 + netcoreapp2.1 + Library + true + nunit + + + + + + + + + + + + + + + + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs new file mode 100644 index 00000000000..75c6e15cee7 --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer.UnitTests + +open System.Diagnostics +open System.Threading.Tasks +open FSharp.Compiler.LanguageServer +open NUnit.Framework +open StreamJsonRpc + +[] +type ProtocolTests() = + +#if !NETCOREAPP + // The `netcoreapp2.1` version of `FSharp.Compiler.LanguageServer.exe` can't be run without a `publish` step so + // we're artificially restricting this test to the full framework. + [] +#endif + member __.``Server consuming stdin and stdout``() = + async { + // start server as a console app + let serverAssemblyPath = typeof.Assembly.Location + let startInfo = ProcessStartInfo(serverAssemblyPath) + startInfo.UseShellExecute <- false + startInfo.RedirectStandardInput <- true + startInfo.RedirectStandardOutput <- true + let proc = Process.Start(startInfo) + + // create a fake client + let client = new JsonRpc(proc.StandardInput.BaseStream, proc.StandardOutput.BaseStream) + client.StartListening() + + // initialize + let! capabilitites = client.InvokeAsync("initialize", "") |> Async.AwaitTask + Assert.True(capabilitites.hoverProvider) + + // shutdown the server + do! client.NotifyAsync("shutdown") |> Async.AwaitTask + if not (proc.WaitForExit(5000)) then failwith "Expected server process to exit." + } |> Async.StartAsTask :> Task From 53f8ea1bc1944351c2596b707bacfaf900953482 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 00:47:52 -0700 Subject: [PATCH 5/7] Clean projectinfomanager (#6850) * Expose IsScript from CompileOps so IVT is not needed * Undo rename of internal VersionStamp in PatternMatcher --- src/fsharp/service/service.fs | 2 ++ src/fsharp/service/service.fsi | 3 +++ .../LanguageService/FSharpProjectOptionsManager.fs | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index a63fdccee89..a3afd792b86 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -3325,3 +3325,5 @@ module PrettyNaming = let QuoteIdentifierIfNeeded id = Lexhelp.Keywords.QuoteIdentifierIfNeeded id let KeywordNames = Lexhelp.Keywords.keywordNames +module FSharpFileUtilities = + let isScriptFile (fileName: string) = CompileOps.IsScript fileName \ No newline at end of file diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index ea27c142c12..f5e2d373d6e 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -761,3 +761,6 @@ module public PrettyNaming = /// All the keywords in the F# language val KeywordNames : string list +/// A set of helpers for dealing with F# files. +module FSharpFileUtilities = + val isScriptFile : string -> bool \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 3f966c31048..51cb4bbeec8 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -10,7 +10,6 @@ open System.ComponentModel.Composition open System.IO open System.Linq open Microsoft.CodeAnalysis -open FSharp.Compiler.CompileOps open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor @@ -359,7 +358,7 @@ type internal FSharpProjectOptionsManager let parsingOptions = match reactor.TryGetCachedOptionsByProjectId(document.Project.Id) with | Some (_, parsingOptions, _) -> parsingOptions - | _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name } + | _ -> { FSharpParsingOptions.Default with IsInteractive = FSharpFileUtilities.isScriptFile document.Name } CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions member this.TryGetOptionsByProject(project) = From 4702abbf7c452671f2fd52c927aae6a4c6c9db7c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 31 May 2019 11:22:58 -0700 Subject: [PATCH 6/7] remove NuGet dependency from fslex/fsyacc (#6913) --- src/buildtools/fslex/fslex.fsproj | 5 +++++ src/buildtools/fsyacc/fsyacc.fsproj | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/buildtools/fslex/fslex.fsproj b/src/buildtools/fslex/fslex.fsproj index 64d34426053..2766098c25d 100644 --- a/src/buildtools/fslex/fslex.fsproj +++ b/src/buildtools/fslex/fslex.fsproj @@ -4,6 +4,7 @@ Exe netcoreapp2.1 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) + true @@ -19,4 +20,8 @@ + + + + diff --git a/src/buildtools/fsyacc/fsyacc.fsproj b/src/buildtools/fsyacc/fsyacc.fsproj index 693080ec985..dc5a4f67f36 100644 --- a/src/buildtools/fsyacc/fsyacc.fsproj +++ b/src/buildtools/fsyacc/fsyacc.fsproj @@ -4,6 +4,7 @@ Exe netcoreapp2.1 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) + true @@ -19,4 +20,8 @@ + + + + From 9b1287c90c61328c399ff14bb55b243185b286ad Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 18:43:23 -0700 Subject: [PATCH 7/7] Replace FSComp invocations in VS tooling with an FCS API (#6904) --- .../FSharp.Compiler.Private.fsproj | 6 ++++++ src/fsharp/service/ServiceCompilerDiagnostics.fs | 14 ++++++++++++++ src/fsharp/service/ServiceCompilerDiagnostics.fsi | 13 +++++++++++++ .../src/FSharp.Editor/CodeFix/FixIndexerAccess.fs | 6 ++---- .../FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs | 3 ++- .../src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs | 1 - .../CodeFix/RenameParamToMatchSignature.fs | 5 +---- .../FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs | 4 ++-- 8 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 src/fsharp/service/ServiceCompilerDiagnostics.fs create mode 100644 src/fsharp/service/ServiceCompilerDiagnostics.fsi diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index e8831bc9327..1bb82db552e 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -575,6 +575,12 @@ Service/IncrementalBuild.fs + + Service/ServiceCompilerDiagnostics.fsi + + + Service/ServiceCompilerDiagnostics.fs + Service/ServiceConstants.fs diff --git a/src/fsharp/service/ServiceCompilerDiagnostics.fs b/src/fsharp/service/ServiceCompilerDiagnostics.fs new file mode 100644 index 00000000000..008cb327bb0 --- /dev/null +++ b/src/fsharp/service/ServiceCompilerDiagnostics.fs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.SourceCodeServices + +type DiagnosticKind = + | AddIndexerDot + | ReplaceWithSuggestion of suggestion:string + +[] +module CompilerDiagnostics = + let getErrorMessage diagnosticKind = + match diagnosticKind with + | AddIndexerDot -> FSComp.SR.addIndexerDot() + | ReplaceWithSuggestion s -> FSComp.SR.replaceWithSuggestion(s) \ No newline at end of file diff --git a/src/fsharp/service/ServiceCompilerDiagnostics.fsi b/src/fsharp/service/ServiceCompilerDiagnostics.fsi new file mode 100644 index 00000000000..4916b2c2f6b --- /dev/null +++ b/src/fsharp/service/ServiceCompilerDiagnostics.fsi @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.SourceCodeServices + +/// Supported kinds of diagnostics by this service. +type DiagnosticKind = + | AddIndexerDot + | ReplaceWithSuggestion of suggestion:string + +/// Exposes compiler diagnostic error messages. +module CompilerDiagnostics = + /// Given a DiagnosticKind, returns the string representing the error message for that diagnostic. + val getErrorMessage: diagnosticKind: DiagnosticKind -> string \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs index 32f99295777..eb9a49c0fad 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs @@ -2,15 +2,13 @@ namespace Microsoft.VisualStudio.FSharp.Editor -open System open System.Composition open System.Collections.Immutable open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open SymbolHelpers +open FSharp.Compiler.SourceCodeServices [] type internal FSharpFixIndexerAccessCodeFixProvider() = @@ -50,7 +48,7 @@ type internal FSharpFixIndexerAccessCodeFixProvider() = let codefix = CodeFixHelpers.createTextChangeCodeFix( - FSComp.SR.addIndexerDot(), + CompilerDiagnostics.getErrorMessage AddIndexerDot, context, (fun () -> asyncMaybe.Return [| TextChange(span, replacement.TrimEnd() + ".") |])) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs b/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs index a01ed2f37ed..8b46a80b7d9 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs @@ -6,6 +6,7 @@ open System.Composition open System.Threading.Tasks open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions +open FSharp.Compiler.SourceCodeServices [] type internal FSharpProposeUpperCaseLabelCodeFixProvider @@ -24,7 +25,7 @@ type internal FSharpProposeUpperCaseLabelCodeFixProvider asyncMaybe { let textChanger (originalText: string) = originalText.[0].ToString().ToUpper() + originalText.Substring(1) let! solutionChanger, originalText = SymbolHelpers.changeAllSymbolReferences(context.Document, context.Span, textChanger, projectInfoManager, checkerProvider.Checker, userOpName) - let title = FSComp.SR.replaceWithSuggestion (textChanger originalText) + let title = CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion <| textChanger originalText) context.RegisterCodeFix( CodeAction.Create(title, solutionChanger, title), context.Diagnostics |> Seq.filter (fun x -> fixableDiagnosticIds |> List.contains x.Id) |> Seq.toImmutableArray) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs index b1641f99a77..e2ccc7e22c8 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs @@ -6,7 +6,6 @@ open System.Composition open System.Threading open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs index 2255d003cdc..245c1ff1405 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs @@ -2,16 +2,13 @@ namespace Microsoft.VisualStudio.FSharp.Editor -open System open System.Collections.Immutable open System.Composition open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers open FSharp.Compiler.SourceCodeServices.Keywords @@ -57,7 +54,7 @@ type internal FSharpRenameParamToMatchSignature yield TextChange(textSpan, replacement) |] return changes } - let title = FSComp.SR.replaceWithSuggestion suggestion + let title = CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion suggestion) let codefix = CodeFixHelpers.createTextChangeCodeFix(title, context, computeChanges) context.RegisterCodeFix(codefix, diagnostics) | _ -> () diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs index dc84479da38..b3f80dc2327 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs @@ -59,9 +59,9 @@ type internal FSharpReplaceWithSuggestionCodeFixProvider for suggestion in suggestions do let replacement = Keywords.QuoteIdentifierIfNeeded suggestion - let codeFix = + let codeFix = CodeFixHelpers.createTextChangeCodeFix( - FSComp.SR.replaceWithSuggestion suggestion, + CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion suggestion), context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, replacement) |]))