From 0e9239aff247c94457bf25bd3bf9870d36d6f5ca Mon Sep 17 00:00:00 2001 From: CyrusNajmabadi Date: Mon, 31 Jul 2017 22:10:42 -0700 Subject: [PATCH 1/3] Rename Foo to Goo --- .../Portable/Binder/Binder_Attributes.cs | 8 +- .../CSharp/Portable/Binder/Binder_Crefs.cs | 8 +- .../Portable/Binder/Binder_Expressions.cs | 6 +- .../Portable/Binder/Binder_Invocation.cs | 4 +- .../Portable/Binder/Binder_Statements.cs | 6 +- .../CSharp/Portable/Binder/Binder_Symbols.cs | 4 +- .../CSharp/Portable/Binder/Imports.cs | 8 +- .../CSharp/Portable/Binder/LookupResult.cs | 4 +- .../Portable/Binder/LookupResultKind.cs | 4 +- .../Portable/Binder/Semantics/AccessCheck.cs | 4 +- .../OverloadResolution/MethodTypeInference.cs | 18 +- .../OverloadResolution/OverloadResolution.cs | 16 +- .../CSharp/Portable/CodeGen/EmitAddress.cs | 4 +- .../CSharp/Portable/CodeGen/Optimizer.cs | 10 +- .../Portable/Compilation/CSharpCompilation.cs | 6 +- .../Compilation/MemberSemanticModel.cs | 4 +- .../Compiler/MethodBodySynthesizer.Lowered.cs | 8 +- .../FlowAnalysis/PreciseAbstractFlowPass.cs | 4 +- .../LocalRewriter/LocalRewriter_Call.cs | 4 +- ...ocalRewriter_CompoundAssignmentOperator.cs | 8 +- .../CSharp/Portable/Parser/DirectiveParser.cs | 16 +- .../Parser/DocumentationCommentParser.cs | 4 +- .../CSharp/Portable/Parser/LanguageParser.cs | 42 +- .../Portable/Symbols/ErrorTypeSymbol.cs | 4 +- .../Symbols/ExtendedErrorTypeSymbol.cs | 8 +- .../Symbols/MissingMetadataTypeSymbol.cs | 4 +- .../Portable/Symbols/NamedTypeSymbol.cs | 8 +- .../OverriddenOrHiddenMembersHelpers.cs | 6 +- .../Portable/Symbols/Source/ModifierUtils.cs | 6 +- .../Symbols/SubstitutedMethodSymbol.cs | 8 +- .../Symbols/SubstitutedNamedTypeSymbol.cs | 6 +- .../Portable/Symbols/SymbolDistinguisher.cs | 4 +- .../Portable/Syntax/SyntaxEquivalence.cs | 4 +- .../Test/CommandLine/CommandLineTests.cs | 262 ++-- .../Test/Emit/Attributes/AttributeTests.cs | 252 ++-- .../AttributeTests_CallerInfoAttributes.cs | 82 +- .../Attributes/AttributeTests_Conditional.cs | 40 +- .../Emit/Attributes/AttributeTests_Dynamic.cs | 6 +- .../Attributes/AttributeTests_Locations.cs | 20 +- .../Attributes/AttributeTests_Security.cs | 38 +- .../Attributes/AttributeTests_Synthesized.cs | 18 +- .../AttributeTests_WellKnownAttributes.cs | 418 +++--- .../InternalsVisibleToAndStrongNameTests.cs | 76 +- .../CSharp/Test/Emit/BreakingChanges.cs | 86 +- .../Test/Emit/CodeGen/CodeGenAsyncEHTests.cs | 6 +- .../Emit/CodeGen/CodeGenAsyncLocalsTests.cs | 10 +- .../Emit/CodeGen/CodeGenAsyncSpillTests.cs | 48 +- .../Test/Emit/CodeGen/CodeGenAsyncTests.cs | 86 +- .../Test/Emit/CodeGen/CodeGenCheckedTests.cs | 8 +- .../Emit/CodeGen/CodeGenClosureLambdaTests.cs | 96 +- .../CodeGenConditionalOperatorTests.cs | 80 +- .../Emit/CodeGen/CodeGenConversionTests.cs | 20 +- .../Emit/CodeGen/CodeGenDeconstructTests.cs | 14 +- .../Test/Emit/CodeGen/CodeGenDynamicTests.cs | 118 +- .../Emit/CodeGen/CodeGenExprLambdaTests.cs | 30 +- .../Test/Emit/CodeGen/CodeGenForEachTests.cs | 8 +- .../CodeGenImplicitImplementationTests.cs | 68 +- .../CodeGenImplicitlyTypeArraysTests.cs | 6 +- .../CodeGen/CodeGenInterfaceImplementation.cs | 10 +- .../Test/Emit/CodeGen/CodeGenIterators.cs | 10 +- .../Emit/CodeGen/CodeGenLocalFunctionTests.cs | 126 +- .../Test/Emit/CodeGen/CodeGenLockTests.cs | 12 +- .../Test/Emit/CodeGen/CodeGenMscorlib.cs | 8 +- .../Test/Emit/CodeGen/CodeGenOperators.cs | 86 +- .../Test/Emit/CodeGen/CodeGenRefOutTests.cs | 6 +- .../Emit/CodeGen/CodeGenRefReturnTests.cs | 28 +- .../Test/Emit/CodeGen/CodeGenScriptTests.cs | 6 +- .../CodeGenShortCircuitOperatorTests.cs | 98 +- .../Emit/CodeGen/CodeGenStructsAndEnum.cs | 26 +- .../CSharp/Test/Emit/CodeGen/CodeGenTests.cs | 522 +++---- .../Test/Emit/CodeGen/CodeGenTupleTest.cs | 66 +- .../CodeGen/CodeGenUsingStatementTests.cs | 18 +- .../CodeGen/CompoundAssignmentForDelegate.cs | 256 ++-- .../CSharp/Test/Emit/CodeGen/ForLoopsTests.cs | 24 +- .../CSharp/Test/Emit/CodeGen/ForeachTest.cs | 4 +- .../CSharp/Test/Emit/CodeGen/GotoTest.cs | 10 +- .../CSharp/Test/Emit/CodeGen/IndexerTests.cs | 70 +- .../ObjectAndCollectionInitializerTests.cs | 32 +- .../CSharp/Test/Emit/CodeGen/SwitchTests.cs | 78 +- .../CSharp/Test/Emit/CodeGen/UnsafeTests.cs | 24 +- .../Test/Emit/Emit/CompilationEmitTests.cs | 28 +- .../DynamicInstrumentationTests.cs | 12 +- .../EditAndContinue/EditAndContinueTests.cs | 10 +- .../CSharp/Test/Emit/Emit/EmitErrorTests.cs | 22 +- .../Test/Emit/Emit/EmitMetadataTests.cs | 8 +- .../CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs | 72 +- .../CSharp/Test/Emit/Emit/ResourceTests.cs | 48 +- .../CSharp/Test/Emit/PDB/PDBConstantTests.cs | 12 +- .../Test/Emit/PDB/PDBDynamicLocalsTests.cs | 38 +- .../CSharp/Test/Emit/PDB/PDBIteratorTests.cs | 26 +- .../CSharp/Test/Emit/PDB/PDBLambdaTests.cs | 10 +- .../Test/Emit/PDB/PDBSourceLinkTests.cs | 10 +- .../CSharp/Test/Emit/PDB/PDBUsingTests.cs | 6 +- .../CSharp/Test/Emit/PDB/PDBWinMdExpTests.cs | 4 +- .../CSharp/Test/Emit/PDB/PortablePdbTests.cs | 24 +- .../Diagnostics/DiagnosticAnalyzerTests.cs | 6 +- .../Diagnostics/GetDiagnosticsTests.cs | 4 +- .../Diagnostics/OperationAnalyzerTests.cs | 66 +- .../FlowAnalysis/FlowDiagnosticTests.cs | 90 +- .../IterationJumpYieldStatementTests.cs | 38 +- .../Semantic/FlowAnalysis/LocalFunctions.cs | 58 +- .../FlowAnalysis/RegionAnalysisTests.cs | 30 +- .../Test/Semantic/FlowAnalysis/StructTests.cs | 10 +- .../TryLockUsingStatementTests.cs | 6 +- .../Semantic/Semantics/AccessCheckTests.cs | 4 +- .../Semantic/Semantics/AccessibilityTests.cs | 12 +- .../Test/Semantic/Semantics/ArglistTests.cs | 10 +- .../Semantics/AwaitExpressionTests.cs | 8 +- .../Semantic/Semantics/BindingAsyncTests.cs | 248 ++-- .../Semantic/Semantics/BindingAwaitTests.cs | 40 +- .../Semantic/Semantics/ColorColorTests.cs | 52 +- .../Semantics/ConditionalOperatorTests.cs | 10 +- .../Test/Semantic/Semantics/ConstantTests.cs | 12 +- .../Test/Semantic/Semantics/DynamicTests.cs | 174 +-- .../Semantics/ExpressionBodiedMemberTests.cs | 32 +- .../Semantics/FieldInitializerBindingTests.cs | 14 +- .../Test/Semantic/Semantics/ForEachTests.cs | 84 +- .../Semantic/Semantics/HideByNameTests.cs | 18 +- .../Semantics/ImplicitlyTypedLocalsTests.cs | 12 +- .../Semantics/InheritanceBindingTests.cs | 234 +-- .../InteractiveSemanticModelTests.cs | 22 +- .../Test/Semantic/Semantics/LambdaTests.cs | 48 +- .../Semantic/Semantics/LocalFunctionTests.cs | 16 +- .../Test/Semantic/Semantics/LockTests.cs | 6 +- .../Test/Semantic/Semantics/LookupTests.cs | 30 +- .../Semantics/MethodBodyModelTests.cs | 44 +- .../Semantics/MethodTypeInferenceTests.cs | 40 +- .../Semantic/Semantics/NameCollisionTests.cs | 14 +- .../Semantic/Semantics/NameLengthTests.cs | 14 +- .../Test/Semantic/Semantics/NameOfTests.cs | 18 +- .../Semantics/NamedAndOptionalTests.cs | 72 +- .../Test/Semantic/Semantics/NullableTests.cs | 8 +- .../ObjectAndCollectionInitializerTests.cs | 60 +- .../Test/Semantic/Semantics/OperatorTests.cs | 104 +- .../Test/Semantic/Semantics/OutVarTests.cs | 12 +- .../Semantics/OverloadResolutionTests.cs | 332 ++--- .../Semantics/PatternMatchingTests.cs | 36 +- .../Semantic/Semantics/PatternSwitchTests.cs | 30 +- .../Test/Semantic/Semantics/QueryTests.cs | 6 +- .../Semantics/RefLocalsAndReturnsTests.cs | 110 +- .../Semantics/ScriptSemanticsTests.cs | 64 +- .../Semantics/SemanticAnalyzerTests.cs | 4 +- .../Semantic/Semantics/SemanticErrorTests.cs | 492 +++--- .../Test/Semantic/Semantics/StructsTests.cs | 12 +- .../SuppressAccessibilityChecksTests.cs | 4 +- .../Test/Semantic/Semantics/SwitchTests.cs | 98 +- .../SynthesizedStaticConstructorTests.cs | 18 +- .../Test/Semantic/Semantics/UnsafeTests.cs | 140 +- .../Semantic/Semantics/UseSiteErrorTests.cs | 34 +- .../Semantics/UserDefinedConversionTests.cs | 16 +- .../Test/Semantic/Semantics/VarianceTests.cs | 14 +- .../CSharp/Test/Symbol/BadSymbolReference.cs | 6 +- .../CSharpCompilationOptionsTests.cs | 54 +- .../Symbol/Compilation/CompilationAPITests.cs | 44 +- .../Compilation/GetSemanticInfoTests.cs | 48 +- .../GetUnusedImportDirectivesTests.cs | 12 +- .../Compilation/ReferenceManagerTests.cs | 52 +- .../Compilation/SemanticModelAPITests.cs | 36 +- .../SemanticModelGetDeclaredSymbolAPITests.cs | 112 +- .../SemanticModelGetSemanticInfoTests.cs | 296 ++-- .../Symbol/DocumentationComments/CrefTests.cs | 20 +- .../PartialTypeDocumentationCommentTests.cs | 36 +- .../SymbolDisplay/SymbolDisplayTests.cs | 36 +- .../AccessorOverriddenOrHiddenMembersTests.cs | 4 +- .../Symbols/AssemblyAndNamespaceTests.cs | 30 +- .../Test/Symbol/Symbols/ConversionTests.cs | 20 +- .../Test/Symbol/Symbols/DestructorTests.cs | 14 +- .../Symbol/Symbols/ExtensionMethodTests.cs | 186 +-- .../Symbol/Symbols/GenericConstraintTests.cs | 48 +- .../Test/Symbol/Symbols/ImplicitClassTests.cs | 14 +- .../Test/Symbol/Symbols/IndexerTests.cs | 10 +- .../Symbols/InterfaceImplementationTests.cs | 22 +- ...InterfaceOverriddenOrHiddenMembersTests.cs | 14 +- .../Symbol/Symbols/LookupSymbolsInfoTests.cs | 30 +- .../PE/LoadingGenericTypeParameters.cs | 8 +- .../Symbols/Metadata/PE/LoadingMethods.cs | 4 +- .../Symbols/Metadata/PE/TypeForwarders.cs | 24 +- .../Test/Symbol/Symbols/MockSymbolTests.cs | 8 +- .../Symbols/OverriddenOrHiddenMembersTests.cs | 78 +- .../Symbol/Symbols/Source/BaseClassTests.cs | 24 +- .../Symbols/Source/CustomModifierCopyTests.cs | 6 +- .../Source/DeclaringSyntaxNodeTests.cs | 12 +- .../Symbol/Symbols/Source/DelegateTests.cs | 4 +- .../Test/Symbol/Symbols/Source/EnumTests.cs | 6 +- .../Test/Symbol/Symbols/Source/EventTests.cs | 24 +- .../Source/ExpressionBodiedMethodTests.cs | 52 +- .../Source/ExpressionBodiedPropertyTests.cs | 20 +- .../Symbol/Symbols/Source/ExternAliasTests.cs | 78 +- .../Test/Symbol/Symbols/Source/MethodTests.cs | 28 +- .../Symbol/Symbols/Source/PropertyTests.cs | 254 ++-- .../Test/Symbol/Symbols/SymbolErrorTests.cs | 412 ++--- .../CSharp/Test/Symbol/Symbols/TypeTests.cs | 128 +- .../Test/Syntax/Diagnostics/DiagnosticTest.cs | 16 +- .../Test/Syntax/Diagnostics/LocationsTests.cs | 58 +- .../IncrementalParsingTests.cs | 86 +- .../LexicalAndXml/DisabledRegionTests.cs | 12 +- .../Syntax/LexicalAndXml/LexicalErrorTests.cs | 4 +- .../Syntax/LexicalAndXml/PreprocessorTests.cs | 32 +- .../LexicalAndXml/XmlDocCommentTests.cs | 274 ++-- .../Test/Syntax/Parsing/AsyncParsingTests.cs | 4 +- .../Test/Syntax/Parsing/AwaitParsingTests.cs | 48 +- .../Syntax/Parsing/DeclarationParsingTests.cs | 6 +- .../Syntax/Parsing/DeconstructionTests.cs | 116 +- .../Syntax/Parsing/ExpressionParsingTests.cs | 8 +- .../Parsing/LambdaParameterParsingTests.cs | 12 +- .../Parsing/LocalFunctionParsingTests.cs | 62 +- .../Test/Syntax/Parsing/NameParsingTests.cs | 74 +- .../Syntax/Parsing/ParserErrorMessageTests.cs | 324 ++-- .../Parsing/ParsingErrorRecoveryTests.cs | 18 +- .../Test/Syntax/Parsing/RoundTrippingTests.cs | 26 +- .../Test/Syntax/Parsing/ScriptParsingTests.cs | 118 +- .../Test/Syntax/Parsing/ValueTupleTests.cs | 8 +- .../CSharp/Test/Syntax/Resources.Designer.cs | 6 +- .../CSharp/Test/Syntax/Resources.resx | 10 +- .../Syntax/Syntax/StructuredTriviaTests.cs | 32 +- .../Test/Syntax/Syntax/SyntaxDiffingTests.cs | 4 +- .../Syntax/Syntax/SyntaxEquivalenceTests.cs | 58 +- .../Test/Syntax/Syntax/SyntaxFactoryTests.cs | 6 +- .../Test/Syntax/Syntax/SyntaxNodeTests.cs | 210 +-- .../Syntax/Syntax/SyntaxNormalizerTests.cs | 44 +- .../CSharp/Test/Syntax/Syntax/SyntaxTests.cs | 50 +- .../Test/WinRT/AnonymousTypesSymbolTests.cs | 26 +- .../Test/WinRT/Metadata/WinMdEventTests.cs | 22 +- src/Compilers/CSharp/Test/WinRT/PdbTests.cs | 6 +- .../AnalyzerFileReferenceTests.cs | 10 +- .../CodeAnalysisTest/CachingLookupTests.cs | 4 +- .../CommonCommandLineParserTests.cs | 12 +- .../CommonTypedConstantTests.cs | 4 +- ...uppressMessageTargetSymbolResolverTests.cs | 106 +- .../FileLinePositionSpanTests.cs | 36 +- .../FileSystem/PathUtilitiesTests.cs | 64 +- .../FileSystem/RelativePathResolverTests.cs | 8 +- .../CodeAnalysisTest/FileUtilitiesTests.cs | 64 +- .../AssemblyIdentityComparerTests.cs | 254 ++-- .../AssemblyIdentityDisplayNameTests.cs | 202 +-- .../AssemblyIdentityTests.cs | 124 +- .../AssemblyPortabilityPolicyTests.cs | 24 +- .../FusionAssemblyIdentityTests.cs | 78 +- .../MetadataReferencePropertiesTests.cs | 8 +- .../MetadataReferenceTests.cs | 22 +- .../MetadataReferences/ModuleMetadataTests.cs | 4 +- .../Core/CodeAnalysisTest/StringTableTests.cs | 12 +- .../StrongNameProviderTests.cs | 4 +- .../CodeAnalysisTest/Text/LargeTextTests.cs | 50 +- .../Text/StringTextDecodingTests.cs | 6 +- .../CodeAnalysisTest/Text/StringTextTest.cs | 30 +- .../Text/StringTextTests_Default.cs | 26 +- .../Text/StringText_LineTest.cs | 14 +- .../Core/CodeAnalysisTest/Win32Res.cs | 6 +- .../XmlDocumentationCommentTextReaderTests.cs | 6 +- .../Core/MSBuildTask/CanonicalError.cs | 8 +- .../CommandLineBuilderExtension.cs | 4 +- src/Compilers/Core/MSBuildTask/Csc.cs | 8 +- src/Compilers/Core/MSBuildTask/Vbc.cs | 8 +- .../Core/MSBuildTaskTests/IntegrationTests.cs | 36 +- .../Collections/IdentifierCollection.cs | 4 +- .../CommandLine/CommonCommandLineParser.cs | 10 +- .../Core/Portable/FileSystem/PathUtilities.cs | 18 +- .../InternalUtilities/FileNameUtilities.cs | 10 +- .../InternalUtilities/StringExtensions.cs | 6 +- .../MetadataReader/MetadataHelpers.cs | 4 +- .../SymbolDisplayCompilerInternalOptions.cs | 4 +- .../SymbolDisplayGenericsOptions.cs | 6 +- .../SymbolDisplayMemberOptions.cs | 4 +- .../Core/Portable/Symbols/IErrorTypeSymbol.cs | 4 +- .../VBCSCompilerTests/CompilerServerTests.cs | 4 +- .../InterfaceAndClass/CSClasses01.cs | 12 +- .../InterfaceAndClass/CSInterfaces01.cs | 14 +- .../Interop/Interop.Mock01.Impl.cs | 20 +- .../MetadataTests/Interop/Interop.Mock01.cs | 14 +- .../Core/MetadataTests/NetModule01/AppCS.cs | 26 +- .../NetModule01/ModuleVB01.vb.txt | 4 +- .../Resources/Core/PerfTests/CSPerfTest.cs | 222 +-- .../Resources/Core/PerfTests/VBPerfTest.vb | 220 +-- .../CustomModifiers/ModoptTestOrignal.cs | 6 +- .../Core/SymbolsTests/Cyclic/Cyclic2.vb | 4 +- .../DifferByCase/CsharpCaseSen.cs | 8 +- .../Core/SymbolsTests/InheritIComparable.cs | 4 +- .../Interface/MDInterfaceMapping.cs | 12 +- .../Metadata/AttributeInterop01.cs | 14 +- .../Metadata/AttributeTestLib01.cs | 12 +- .../Core/SymbolsTests/Methods/CSMethods.cs | 4 +- .../SymbolsTests/MultiModule/MultiModule.vb | 4 +- .../Core/SymbolsTests/MultiModule/mod2.vb | 4 +- .../Core/SymbolsTests/MultiModule/mod3.vb | 4 +- .../SymbolsTests/MultiTargeting/Source1.vb | 4 +- .../SymbolsTests/MultiTargeting/Source3.vb | 12 +- .../Core/SymbolsTests/NoPia/GeneralPia.vb | 60 +- .../Core/SymbolsTests/NoPia/Library2.vb | 4 +- .../Resources/Core/SymbolsTests/NoPia/Pia5.vb | 4 +- .../Core/SymbolsTests/V1/MTTestLib2_V1.vb | 4 +- .../Core/SymbolsTests/V2/MTTestLib3_V2.vb | 8 +- .../Core/SymbolsTests/V3/MTTestLib4_V3.vb | 12 +- .../WithEvents/SimpleWithEvents.vb | 10 +- .../LocalVariableDeclaratorsCollector.vb | 4 +- .../Portable/Binding/Binder_Conversions.vb | 10 +- .../Portable/Binding/Binder_Expressions.vb | 6 +- .../Portable/Binding/Binder_Initializers.vb | 6 +- .../Portable/Binding/Binder_Invocation.vb | 18 +- .../Portable/Binding/Binder_Statements.vb | 6 +- .../Portable/Binding/ImportAliasesBinder.vb | 4 +- .../Portable/Binding/LookupOptions.vb | 16 +- .../Portable/Binding/LookupResult.vb | 4 +- .../Portable/Binding/MemberSemanticModel.vb | 4 +- .../Portable/CodeGen/EmitAddress.vb | 8 +- .../Optimizer/StackScheduler.Analyzer.vb | 4 +- .../Portable/Compilation/SemanticModel.vb | 4 +- .../Declarations/DeclarationTreeBuilder.vb | 6 +- .../MergedNamespaceDeclaration.vb | 6 +- ...ter.AsyncMethodToClassRewriter.Spilling.vb | 6 +- .../LocalRewriter_AssignmentOperator.vb | 6 +- .../LocalRewriter_BinaryOperators.vb | 6 +- .../LocalRewriter/LocalRewriter_Call.vb | 6 +- .../LocalRewriter_LateBindingHelpers.vb | 8 +- .../LocalRewriter_LateInvocation.vb | 4 +- .../Portable/Parser/ParseExpression.vb | 4 +- .../VisualBasic/Portable/Parser/ParseScan.vb | 6 +- .../Portable/Parser/ParseStatement.vb | 4 +- .../VisualBasic/Portable/Parser/Parser.vb | 4 +- .../Portable/Semantics/AccessCheck.vb | 14 +- .../Portable/Semantics/OverloadResolution.vb | 6 +- .../TypeInference/TypeArgumentInference.vb | 8 +- .../TypeInference/TypeInferenceCollection.vb | 6 +- .../Symbols/MethodSignatureComparer.vb | 6 +- .../Symbols/Source/ImplementsHelper.vb | 16 +- .../Symbols/Source/QuickAttributeChecker.vb | 4 +- .../Source/SourceMemberContainerTypeSymbol.vb | 18 +- .../Symbols/Source/SourceNamespaceSymbol.vb | 10 +- .../Portable/Symbols/SymbolExtensions.vb | 4 +- .../Portable/Syntax/SyntaxNormalizer.vb | 20 +- .../CommandLine/CommandLineArgumentsTests.vb | 42 +- .../Test/CommandLine/CommandLineTests.vb | 242 +-- .../Emit/Attributes/AssemblyAttributes.vb | 30 +- .../Test/Emit/Attributes/AttributeTests.vb | 92 +- .../Attributes/AttributeTests_Conditional.vb | 6 +- .../AttributeTests_ObsoleteAttribute.vb | 146 +- .../Attributes/AttributeTests_Synthesized.vb | 12 +- .../AttributeTests_WellKnownAttributes.vb | 156 +- .../InternalsVisibleToAndStrongNameTests.vb | 106 +- .../VisualBasic/Test/Emit/BreakingChanges.vb | 92 +- .../CodeGen/AnonymousTypesCodeGenTests.vb | 12 +- .../Test/Emit/CodeGen/CodeGenAsyncTests.vb | 94 +- .../Emit/CodeGen/CodeGenClosureLambdaTests.vb | 148 +- .../Emit/CodeGen/CodeGenCtorInitializers.vb | 38 +- .../Emit/CodeGen/CodeGenDelegateCreation.vb | 114 +- .../Test/Emit/CodeGen/CodeGenEvents.vb | 88 +- .../Emit/CodeGen/CodeGenFieldInitTests.vb | 4 +- .../Test/Emit/CodeGen/CodeGenForLoops.vb | 34 +- .../Test/Emit/CodeGen/CodeGenForeach.vb | 20 +- .../Test/Emit/CodeGen/CodeGenIfOperator.vb | 12 +- .../CodeGen/CodeGenInterfaceImplementation.vb | 10 +- .../Test/Emit/CodeGen/CodeGenIterators.vb | 326 ++-- .../Test/Emit/CodeGen/CodeGenLateBound.vb | 158 +- .../CodeGen/CodeGenMultiDimensionalArray.vb | 32 +- .../Test/Emit/CodeGen/CodeGenNullable.vb | 32 +- .../CodeGen/CodeGenOverridingAndHiding.vb | 56 +- .../Test/Emit/CodeGen/CodeGenScriptTests.vb | 22 +- .../Test/Emit/CodeGen/CodeGenSelectCase.vb | 144 +- .../Test/Emit/CodeGen/CodeGenStaticLocals.vb | 44 +- .../Test/Emit/CodeGen/CodeGenStopOrEnd.vb | 30 +- .../Test/Emit/CodeGen/CodeGenSyncLock.vb | 44 +- .../Test/Emit/CodeGen/CodeGenTests.vb | 300 ++-- .../Test/Emit/CodeGen/CodeGenTryCatchThrow.vb | 8 +- .../Test/Emit/CodeGen/CodeGenTuples.vb | 84 +- .../Test/Emit/CodeGen/CodeGenVBCore.vb | 30 +- .../Test/Emit/CodeGen/CodeGenWithBlock.vb | 40 +- .../Test/Emit/CodeGen/CodeGenWithEvents.vb | 100 +- .../Test/Emit/Emit/CompilationEmitTests.vb | 112 +- .../DynamicInstrumentationTests.vb | 36 +- .../EditAndContinue/EditAndContinueTests.vb | 32 +- .../Test/Emit/Emit/EmitErrorTests.vb | 40 +- .../Test/Emit/Emit/EmitMetadata.vb | 4 +- .../Test/Emit/Emit/FieldInitializerTests.vb | 50 +- .../Test/Emit/Emit/ResourceTests.vb | 52 +- .../VisualBasic/Test/Emit/ErrorHandling.vb | 58 +- .../Emit/ExpressionTrees/CodeGenExprLambda.vb | 190 +-- .../ExpTreeTestResources.Designer.vb | 4 +- .../Results/ExprTree_LegacyTests08_Result.txt | 14 +- .../Results/ExprTree_LegacyTests10_Result.txt | 8 +- .../Test/Emit/PDB/ChecksumTests.vb | 12 +- .../Test/Emit/PDB/PDBIteratorTests.vb | 18 +- .../Test/Emit/PDB/PDBLambdaTests.vb | 6 +- .../Test/Emit/PDB/PDBNamespaceScopes.vb | 4 +- .../VisualBasic/Test/Emit/PDB/PDBTests.vb | 26 +- .../Test/Emit/PDB/PDBUsingTests.vb | 10 +- .../Test/Emit/PDB/PortablePdbTests.vb | 24 +- .../Semantics/StaticLocalsSemanticTests.vb | 86 +- .../VisualBasic/Test/Emit/XmlLiteralTests.vb | 12 +- .../Binding/Binder_Expressions_Tests.vb | 200 +-- .../Binding/Binder_Statements_Tests.vb | 142 +- .../BindingCollectionInitializerTests.vb | 18 +- .../Binding/BindingDelegateCreationTests.vb | 320 ++-- .../Binding/BindingObjectInitializerTests.vb | 154 +- .../Semantic/Binding/BindingScopeTests.vb | 6 +- .../Test/Semantic/Binding/ForEachTests.vb | 112 +- .../Test/Semantic/Binding/GenericsTests.vb | 8 +- .../Test/Semantic/Binding/GotoTests.vb | 8 +- .../Semantic/Binding/ImplicitVariableTests.vb | 32 +- .../Test/Semantic/Binding/LookupTests.vb | 60 +- .../Binding/MethodBodyBindingTests.vb | 14 +- .../Test/Semantic/Binding/SyncLockTests.vb | 10 +- .../Test/Semantic/Binding/UsingTests.vb | 94 +- .../Compilation/CompilationAPITests.vb | 38 +- .../Semantic/Compilation/MyTemplateTests.vb | 12 +- .../Compilation/ReferenceManagerTests.vb | 20 +- .../Compilation/SemanticModelAPITests.vb | 302 ++-- .../SemanticModelGetDeclaredSymbolAPITests.vb | 166 +-- .../SemanticModelLookupSymbolsAPITests.vb | 4 +- .../VisualBasicCompilationOptionsTests.vb | 82 +- .../Test/Semantic/DeclaringSyntaxNodeTests.vb | 12 +- .../Diagnostics/DiagnosticAnalyzerTests.vb | 6 +- .../Diagnostics/GetDiagnosticsTests.vb | 4 +- .../Diagnostics/OperationAnalyzerTests.vb | 64 +- .../ExtensionMethods/SemanticModelTests.vb | 18 +- .../FlowAnalysis/FlowDiagnosticTests.vb | 36 +- .../IterationJumpYieldStatementTests.vb | 32 +- .../FlowAnalysis/RegionAnalysisTests.vb | 192 +-- .../RegionAnalysisTestsWithStaticLocals.vb | 128 +- .../TryLockUsingStatementTests.vb | 50 +- .../Semantic/IOperation/IOperationTests.vb | 6 +- .../Test/Semantic/Semantics/AccessCheck.vb | 74 +- .../Semantic/Semantics/AnonymousTypesTests.vb | 20 +- .../Semantic/Semantics/ArrayLiteralTests.vb | 126 +- .../Test/Semantic/Semantics/AsyncAwait.vb | 10 +- .../Semantics/Async_Overload_Change_3.vb.txt | 26 +- .../Semantic/Semantics/CompoundAssignment.vb | 134 +- .../Test/Semantic/Semantics/Conversions.vb | 6 +- .../Semantics/FieldInitializerBindingTests.vb | 64 +- .../Test/Semantic/Semantics/ForLoopTest.vb | 4 +- .../Test/Semantic/Semantics/ForeachTest.vb | 28 +- .../Semantics/GetExtendedSemanticInfoTests.vb | 246 +-- .../Semantics/GetSemanticInfoTests.vb | 212 +-- .../GetUnusedImportDirectivesTests.vb | 10 +- .../Test/Semantic/Semantics/GotoTests.vb | 6 +- .../Test/Semantic/Semantics/IFOperatorTest.vb | 18 +- .../Test/Semantic/Semantics/IteratorTests.vb | 42 +- .../Semantics/LambdaSemanticInfoTests.vb | 16 +- .../Test/Semantic/Semantics/LambdaTests.vb | 14 +- .../Lambda_AnonymousDelegateInference.vb | 6 +- .../Semantic/Semantics/Lambda_Relaxation.vb | 6 +- .../Semantics/LongTypeNameNative.vb.txt | 4 +- .../Semantics/MeMyBaseMyClassTests.vb | 20 +- .../Test/Semantic/Semantics/MethodCalls.vb | 180 +-- .../Semantics/MultiDimensionalTest.vb | 10 +- .../Semantic/Semantics/MyBaseMyClassTests.vb | 38 +- .../Semantic/Semantics/NameLengthTests.vb | 14 +- .../Semantic/Semantics/NewOnInterfaceTests.vb | 244 +-- .../NoncompliantOverloadingInMetadata.vb | 572 +++---- .../Semantics/OptionalArgumentTests.vb | 88 +- .../Semantic/Semantics/OverloadResolution.vb | 296 ++-- .../Semantic/Semantics/PartialMethodsTest.vb | 10 +- .../Semantic/Semantics/QueryExpressions.vb | 12 +- .../Semantic/Semantics/SelectCaseTests.vb | 48 +- .../Test/Semantic/Semantics/SyncLockTests.vb | 10 +- .../Semantics/TypeArgumentInference.vb | 56 +- .../Test/Semantic/Semantics/TypeOfTests.vb | 4 +- .../UnstructuredExceptionHandling.vb | 200 +-- .../Semantic/Semantics/UseSiteErrorTests.vb | 8 +- .../Semantics/UserDefinedBinaryOperators.vb | 16 +- .../Semantic/Semantics/UsingStatementTest.vb | 12 +- .../Semantics/VariableTypeInference.vb | 34 +- .../Semantic/Semantics/VarianceConversions.vb | 136 +- .../Semantic/Semantics/WithBlockErrorTests.vb | 6 +- .../Symbol/StaticLocalDeclarationTests.vb | 38 +- .../SymbolDisplay/SymbolDisplayTests.vb | 106 +- .../AnonymousTypesSemanticsTests.vb | 20 +- .../SymbolsTests/AssemblyAndNamespaceTests.vb | 62 +- .../ExtensionMethods/AddressOf.vb | 8 +- .../ExtensionMethods/ExtensionMethodTests.vb | 18 +- .../ExtensionMethods/LookupAndInvocation.vb | 28 +- .../Symbol/SymbolsTests/ImplicitClassTests.vb | 6 +- .../SymbolsTests/InaccessibleOverriding.vb | 26 +- .../Metadata/MetadataMemberTests.vb | 6 +- .../PE/LoadingGenericTypeParameters.vb | 8 +- .../Metadata/PE/LoadingMethods.vb | 14 +- .../Metadata/PE/TypeForwarders.vb | 8 +- .../SymbolsTests/Metadata/WinMdEventTest.vb | 14 +- .../MetadataFileReferenceCompilationTests.vb | 10 +- .../Symbol/SymbolsTests/MockSymbolTests.vb | 8 +- .../Symbol/SymbolsTests/Retargeting/NoPia.vb | 8 +- .../Retargeting/RetargetingTests.vb | 10 +- .../SymbolsTests/Source/BaseClassTests.vb | 50 +- .../SymbolsTests/Source/BindingsTests.vb | 80 +- .../SymbolsTests/Source/ComClassTests.vb | 68 +- .../SymbolsTests/Source/DelegateTests.vb | 6 +- .../Symbol/SymbolsTests/Source/EnumTests.vb | 16 +- .../Symbol/SymbolsTests/Source/EventTests.vb | 112 +- .../Source/MeMyBaseMyClassTests.vb | 124 +- .../Symbol/SymbolsTests/Source/MethodTests.vb | 78 +- .../Source/NamespaceGlobalTests.vb | 8 +- .../SymbolsTests/Source/OverridesTests.vb | 172 +-- .../SymbolsTests/Source/PropertyTests.vb | 434 +++--- .../SymbolsTests/Source/SourceSymbolTests.vb | 10 +- .../Source/SymbolBindingErrorTests.vb | 14 +- .../SymbolsTests/Source/TypeBindingTests.vb | 84 +- .../Source/TypeSubstitutionTests.vb | 16 +- .../Symbol/SymbolsTests/Source/TypeTests.vb | 42 +- .../SymbolsTests/Source/VarianceTests.vb | 8 +- .../Symbol/SymbolsTests/SymbolErrorTests.vb | 1322 ++++++++--------- .../Symbol/SymbolsTests/TypedConstantTests.vb | 4 +- .../IncrementalParser/IPEndBlockStatements.vb | 56 +- .../IncrementalParser/IncrementalParser.vb | 72 +- .../VisualBasic/Test/Syntax/LocationTests.vb | 24 +- .../Test/Syntax/Parser/DeclarationTests.vb | 16 +- .../Syntax/Parser/ParseDeclarationTests.vb | 20 +- .../Test/Syntax/Parser/ParseDirectives.vb | 8 +- .../Test/Syntax/Parser/ParseErrorTests.vb | 140 +- .../Test/Syntax/Parser/ParseExpression.vb | 44 +- .../Test/Syntax/Parser/ParseMethods.vb | 74 +- .../Test/Syntax/Parser/ParseStatements.vb | 206 +-- .../Test/Syntax/Parser/ParseVarDecl.vb | 6 +- .../Test/Syntax/Parser/ParseXml.vb | 48 +- .../Syntax/Parser/ParserRegressionTests.vb | 14 +- .../Parser/VisualBasicParseOptionsTests.vb | 10 +- .../Test/Syntax/Parser/XmlDocComments.vb | 18 +- .../Test/Syntax/Resource.Designer.vb | 18 +- .../Test/Syntax/Resources/VBAllInOne.vb | 70 +- .../Test/Syntax/Scanner/ScannerTests.vb | 14 +- .../Test/Syntax/Syntax/ManualTests.vb | 8 +- .../Test/Syntax/Syntax/SerializationTests.vb | 42 +- .../Syntax/StatementSyntaxWalkerTests.vb | 6 +- .../Syntax/Syntax/SyntaxEquivalenceTests.vb | 78 +- .../Test/Syntax/Syntax/SyntaxFactsTest.vb | 10 +- .../Syntax/Syntax/SyntaxNormalizerTests.vb | 96 +- .../Syntax/Syntax/SyntaxTokenFactoryTests.vb | 8 +- .../Test/Syntax/Syntax/VBAllInOne.txt | Bin 60202 -> 30133 bytes .../Test/Syntax/TestSyntaxNodes.vb | 136 +- .../CSharpIndentationService.Indenter.cs | 4 +- .../AddParameter/AddParameterTests.cs | 50 +- .../CSharpTest/AddUsing/AddUsingTests.cs | 274 ++-- .../AddUsingTests_ExtensionMethods.cs | 38 +- .../AutomaticBraceCompletionTests.cs | 22 +- ...omaticLessAndGreaterThanCompletionTests.cs | 4 +- .../AutomaticLineEnderTests.cs | 18 +- .../BraceHighlightingTests.cs | 44 +- .../BraceMatching/CSharpBraceMatcherTests.cs | 82 +- .../CallHierarchy/CallHierarchyTests.cs | 112 +- .../ChangeSignature/ChangeSignatureTests.cs | 22 +- ...hangeSignature_CheckAllSignatureChanges.cs | 36 +- .../ChangeSignature_Delegates.cs | 106 +- ...ReorderParametersTests.InvocationErrors.cs | 6 +- ...orderParametersTests.InvocationLocation.cs | 48 +- .../ChangeSignature/ReorderParametersTests.cs | 66 +- .../Classification/SemanticClassifierTests.cs | 20 +- .../SyntacticClassifierTests.cs | 352 ++--- .../SyntacticClassifierTests_Preprocessor.cs | 158 +- .../Classification/TotalClassifierTests.cs | 30 +- .../TotalClassifierTests_Dynamic.cs | 6 +- .../EncapsulateField/EncapsulateFieldTests.cs | 122 +- .../ExtractMethod/ExtractMethodTests.cs | 34 +- .../InlineTemporary/InlineTemporaryTests.cs | 174 +-- .../IntroduceVariableTests.cs | 174 +-- .../CodeActions/InvertIf/InvertIfTests.cs | 12 +- .../LambdaSimplifier/LambdaSimplifierTests.cs | 78 +- .../ReplaceMethodWithPropertyTests.cs | 416 +++--- .../ReplacePropertyWithMethodsTests.cs | 38 +- .../AbstractCSharpCompletionProviderTests.cs | 8 +- ...teNamedParameterCompletionProviderTests.cs | 20 +- .../CrefCompletionProviderTests.cs | 44 +- .../DeclarationNameCompletionProviderTests.cs | 30 +- ...nProviderTests_NameDeclarationInfoTests.cs | 20 +- ...ompletionListTagCompletionProviderTests.cs | 42 +- ...tInterfaceMemberCompletionProviderTests.cs | 60 +- ...citInterfaceTypeCompletionProviderTests.cs | 16 +- .../ExternAliasCompletionProviderTests.cs | 14 +- .../KeywordCompletionProviderTests.cs | 10 +- .../NamedParameterCompletionProviderTests.cs | 68 +- .../ObjectCreationCompletionProviderTests.cs | 14 +- ...bjectInitializerCompletionProviderTests.cs | 96 +- .../OverrideCompletionProviderTests.cs | 544 +++---- .../PartialMethodCompletionProviderTests.cs | 112 +- .../PartialTypeCompletionProviderTests.cs | 8 +- .../SnippetCompletionProviderTests.cs | 6 +- .../SpeculativeTCompletionProviderTests.cs | 12 +- .../SuggestionModeCompletionProviderTests.cs | 44 +- .../SymbolCompletionProviderTests.cs | 724 ++++----- .../TupleNameCompletionProviderTests.cs | 4 +- ...mentationCommentCompletionProviderTests.cs | 212 +-- .../FixAllProvider/BatchFixerTests.cs | 6 +- .../GenerateMethod/GenerateMethodTests.cs | 718 ++++----- .../GenerateType/GenerateTypeTests.cs | 256 ++-- .../GenerateType/GenerateTypeTests_Dialog.cs | 448 +++--- ...nvokeDelegateWithConditionalAccessTests.cs | 76 +- ...eWithConditionalAccessTests_FixAllTests.cs | 26 +- .../MakeMethodSynchronousTests.cs | 106 +- .../RemoveUnnecessaryCastTests.cs | 328 ++-- .../SimplifyTypeNamesTests.cs | 152 +- .../Diagnostics/SpellCheck/SpellCheckTests.cs | 54 +- .../UseAutoProperty/UseAutoPropertyTests.cs | 10 +- .../UseExplicitTypeTests.cs | 4 +- .../AddDocCommentNodesCodeFixProviderTests.cs | 6 +- .../DocumentationCommentTests.cs | 82 +- .../XmlTagCompletionTests.cs | 58 +- .../ActiveStatementTests.Methods.cs | 8 +- .../EditAndContinue/ActiveStatementTests.cs | 426 +++--- .../ActiveStatementTrackingServiceTests.cs | 28 +- .../EditAndContinue/BreakpointSpansTests.cs | 624 ++++---- .../CSharpEditAndContinueAnalyzerTests.cs | 10 +- .../EditAndContinue/LineEditTests.cs | 80 +- .../EditAndContinue/StatementEditingTests.cs | 248 ++-- .../EditAndContinue/TopLevelEditingTests.cs | 94 +- .../EncapsulateFieldCommandHandlerTests.cs | 14 +- .../EventHookupCommandHandlerTests.cs | 24 +- .../ContextQuery/NamespaceContextTests.cs | 10 +- .../ContextQuery/PossibleTupleContextTests.cs | 4 +- .../ContextQuery/TypeContextTests.cs | 10 +- .../ExtractInterface/ExtractInterfaceTests.cs | 118 +- .../ExtractMethodTests.LanguageInteraction.cs | 50 +- .../ExtractMethod/ExtractMethodTests.cs | 108 +- .../ExtractMethod/SelectionValidatorTests.cs | 22 +- .../Formatting/FormattingEngineTests.cs | 18 +- .../Formatting/FormattingEngineTests_Venus.cs | 22 +- .../SmartIndenterEnterOnTokenTests.cs | 4 +- .../Indentation/SmartIndenterTests.cs | 58 +- .../SmartTokenFormatterFormatRangeTests.cs | 18 +- .../SmartTokenFormatterFormatTokenTests.cs | 14 +- .../FullyQualify/FullyQualifyTests.cs | 102 +- .../GenerateConstructorTests.cs | 50 +- ...ateEqualsAndGetHashCodeFromMembersTests.cs | 4 +- .../GenerateVariable/GenerateVariableTests.cs | 782 +++++----- .../ImplementAbstractClassTests.cs | 156 +- .../ImplementInterfaceTests.cs | 586 ++++---- .../AddParameterCheckTests.cs | 4 +- .../CSharpInlineDeclarationTests.cs | 36 +- .../InteractiveBraceHighlightingTests.cs | 6 +- .../InteractiveIntroduceVariableTests.cs | 18 +- .../CommandArgumentsParsingTest.cs | 6 +- .../NavigateTo/InteractiveNavigateToTests.cs | 118 +- ...ConditionalPreprocessorHighlighterTests.cs | 34 +- .../IfStatementHighlighterTests.cs | 54 +- .../LineSeparators/LineSeparatorTests.cs | 4 +- .../MoveDeclarationNearReferenceTests.cs | 54 +- .../CSharpTest/NavigateTo/NavigateToTests.cs | 176 +-- .../OrganizeTypeDeclarationTests.cs | 36 +- .../PerfTests/Sources/LargeMethod.cs | 22 +- .../PerfTests/Sources/LargeMethodCS.txt | 14 +- .../CSharpTest/PerfTests/Sources/Scrolling.cs | 1074 ++++++------- .../PerfTests/Sources/TypeFileCS.txt | 134 +- .../QuickInfo/SemanticQuickInfoSourceTests.cs | 296 ++-- .../RemoveUnnecessaryImportsTests.cs | 94 +- .../RemoveUnusedLocalFunctionTests.cs | 4 +- ...ReorderParametersTests.InvocationErrors.cs | 6 +- ...orderParametersTests.InvocationLocation.cs | 42 +- .../ReorderParametersTests.cs | 66 +- .../AttributeSignatureHelpProviderTests.cs | 80 +- ...orInitializerSignatureHelpProviderTests.cs | 64 +- ...essExpressionSignatureHelpProviderTests.cs | 88 +- ...tiallyWrittenSignatureHelpProviderTests.cs | 74 +- .../GenericNameSignatureHelpProviderTests.cs | 124 +- ...ionExpressionSignatureHelpProviderTests.cs | 496 +++---- ...ionExpressionSignatureHelpProviderTests.cs | 86 +- ...eConstructionSignatureHelpProviderTests.cs | 8 +- .../Structure/BlockSyntaxStructureTests.cs | 6 +- .../CompilationUnitStructureTests.cs | 36 +- .../ConstructorDeclarationStructureTests.cs | 6 +- ...ersionOperatorDeclarationStructureTests.cs | 6 +- .../DelegateDeclarationStructureTests.cs | 6 +- .../DestructorDeclarationStructureTests.cs | 6 +- .../Structure/DisabledTextStructureTests.cs | 12 +- .../EnumDeclarationStructureTests.cs | 10 +- .../EventDeclarationStructureTests.cs | 6 +- .../EventFieldDeclarationStructureTests.cs | 6 +- .../FieldDeclarationStructureTests.cs | 6 +- .../IndexerDeclarationStructureTests.cs | 10 +- ...ersionOperatorDeclarationStructureTests.cs | 8 +- .../DelegateDeclarationStructureTests.cs | 8 +- .../DestructorDeclarationStructureTests.cs | 14 +- .../EnumMemberDeclarationStructureTests.cs | 8 +- .../EventDeclarationStructureTests.cs | 24 +- .../EventFieldDeclarationStructureTests.cs | 24 +- .../FieldDeclarationStructureTests.cs | 24 +- .../IndexerDeclarationStructureTests.cs | 16 +- .../MethodDeclarationStructureTests.cs | 16 +- .../OperatorDeclarationStructureTests.cs | 18 +- .../PropertyDeclarationStructureTests.cs | 16 +- .../MethodDeclarationStructureTests.cs | 18 +- .../NamespaceDeclarationStructureTests.cs | 14 +- .../OperatorDeclarationStructureTests.cs | 6 +- .../PropertyDeclarationStructureTests.cs | 18 +- .../RegionDirectiveStructureTests.cs | 8 +- .../TypeDeclarationStructureTests.cs | 26 +- .../SymbolId/SymbolKeyCompilationsTests.cs | 44 +- .../SymbolKeyMetadataVsSourceTests.cs | 30 +- .../TypeInferrer/TypeInferrerTests.cs | 196 +-- .../UseCollectionInitializerTests.cs | 26 +- .../UseDefaultLiteralTests.cs | 58 +- .../UseExplicitTupleNameTests.cs | 10 +- ...ExpressionBodyForAccessorsAnalyzerTests.cs | 56 +- ...seExpressionBodyForMethodsAnalyzerTests.cs | 58 +- ...xpressionBodyForPropertiesAnalyzerTests.cs | 60 +- ...ressionBodyForAccessorsRefactoringTests.cs | 30 +- ...pressionBodyForIndexersRefactoringTests.cs | 4 +- ...xpressionBodyForMethodsRefactoringTests.cs | 16 +- ...essionBodyForPropertiesRefactoringTests.cs | 34 +- .../UseNullPropagationTests.cs | 4 +- .../UseObjectInitializerTests.cs | 34 +- ...CheckWithoutNameDiagnosticAnalyzerTests.cs | 10 +- .../UseThrowExpressionTests.cs | 4 +- .../CSharpTest/Workspaces/WorkspaceTests.cs | 20 +- .../AbstractKeywordRecommenderTests.cs | 30 +- .../AddKeywordRecommenderTests.cs | 20 +- .../AliasKeywordRecommenderTests.cs | 10 +- .../AsKeywordRecommenderTests.cs | 8 +- .../AscendingKeywordRecommenderTests.cs | 4 +- .../AssemblyKeywordRecommenderTests.cs | 22 +- .../AsyncKeywordRecommenderTests.cs | 30 +- .../AwaitKeywordRecommenderTests.cs | 20 +- .../BaseKeywordRecommenderTests.cs | 6 +- .../BoolKeywordRecommenderTests.cs | 38 +- .../BreakKeywordRecommenderTests.cs | 4 +- .../ByKeywordRecommenderTests.cs | 4 +- .../ByteKeywordRecommenderTests.cs | 38 +- .../CaseKeywordRecommenderTests.cs | 14 +- .../CatchKeywordRecommenderTests.cs | 4 +- .../CharKeywordRecommenderTests.cs | 38 +- .../CheckedKeywordRecommenderTests.cs | 4 +- .../ChecksumKeywordRecommenderTests.cs | 4 +- .../ClassKeywordRecommenderTests.cs | 28 +- .../ConstKeywordRecommenderTests.cs | 34 +- .../ContinueKeywordRecommenderTests.cs | 4 +- .../DecimalKeywordRecommenderTests.cs | 38 +- .../DefaultKeywordRecommenderTests.cs | 10 +- .../DefineKeywordRecommenderTests.cs | 4 +- .../DelegateKeywordRecommenderTests.cs | 24 +- .../DescendingKeywordRecommenderTests.cs | 4 +- .../DisableKeywordRecommenderTests.cs | 4 +- .../DoKeywordRecommenderTests.cs | 4 +- .../DoubleKeywordRecommenderTests.cs | 38 +- .../DynamicKeywordRecommenderTests.cs | 34 +- .../ElifKeywordRecommenderTests.cs | 4 +- .../ElseKeywordRecommenderTests.cs | 6 +- .../EndIfKeywordRecommenderTests.cs | 6 +- .../EndRegionKeywordRecommenderTests.cs | 4 +- .../EnumKeywordRecommenderTests.cs | 22 +- .../EqualsKeywordRecommenderTests.cs | 4 +- .../ErrorKeywordRecommenderTests.cs | 4 +- .../EventKeywordRecommenderTests.cs | 44 +- .../ExplicitKeywordRecommenderTests.cs | 24 +- .../ExternKeywordRecommenderTests.cs | 14 +- .../FalseKeywordRecommenderTests.cs | 4 +- .../FieldKeywordRecommenderTests.cs | 20 +- .../FinallyKeywordRecommenderTests.cs | 4 +- .../FixedKeywordRecommenderTests.cs | 4 +- .../FloatKeywordRecommenderTests.cs | 38 +- .../ForEachKeywordRecommenderTests.cs | 4 +- .../ForKeywordRecommenderTests.cs | 4 +- .../FromKeywordRecommenderTests.cs | 4 +- .../GetKeywordRecommenderTests.cs | 34 +- .../GlobalKeywordRecommenderTests.cs | 6 +- .../GotoKeywordRecommenderTests.cs | 4 +- .../GroupKeywordRecommenderTests.cs | 4 +- .../HiddenKeywordRecommenderTests.cs | 4 +- .../IfKeywordRecommenderTests.cs | 6 +- .../ImplicitKeywordRecommenderTests.cs | 24 +- .../InKeywordRecommenderTests.cs | 26 +- .../IntKeywordRecommenderTests.cs | 40 +- .../InterfaceKeywordRecommenderTests.cs | 22 +- .../InternalKeywordRecommenderTests.cs | 30 +- .../IntoKeywordRecommenderTests.cs | 4 +- .../IsKeywordRecommenderTests.cs | 10 +- .../JoinKeywordRecommenderTests.cs | 4 +- .../LetKeywordRecommenderTests.cs | 4 +- .../LineKeywordRecommenderTests.cs | 4 +- .../LockKeywordRecommenderTests.cs | 4 +- .../LongKeywordRecommenderTests.cs | 38 +- .../MethodKeywordRecommenderTests.cs | 24 +- .../ModuleKeywordRecommenderTests.cs | 22 +- .../NamespaceKeywordRecommenderTests.cs | 32 +- .../NewKeywordRecommenderTests.cs | 56 +- .../NullKeywordRecommenderTests.cs | 8 +- .../ObjectKeywordRecommenderTests.cs | 38 +- .../OnKeywordRecommenderTests.cs | 4 +- .../OperatorKeywordRecommenderTests.cs | 18 +- .../OrderByKeywordRecommenderTests.cs | 4 +- .../OutKeywordRecommenderTests.cs | 64 +- .../OverrideKeywordRecommenderTests.cs | 30 +- .../ParamKeywordRecommenderTests.cs | 24 +- .../ParamsKeywordRecommenderTests.cs | 58 +- .../PartialKeywordRecommenderTests.cs | 26 +- .../PragmaKeywordRecommenderTests.cs | 4 +- .../PrivateKeywordRecommenderTests.cs | 34 +- .../PropertyKeywordRecommenderTests.cs | 24 +- .../ProtectedKeywordRecommenderTests.cs | 28 +- .../PublicKeywordRecommenderTests.cs | 24 +- .../ReadOnlyKeywordRecommenderTests.cs | 30 +- .../RefKeywordRecommenderTests.cs | 76 +- .../ReferenceKeywordRecommenderTests.cs | 4 +- .../RegionKeywordRecommenderTests.cs | 4 +- .../RemoveKeywordRecommenderTests.cs | 20 +- .../RestoreKeywordRecommenderTests.cs | 4 +- .../ReturnKeywordRecommenderTests.cs | 26 +- .../SByteKeywordRecommenderTests.cs | 38 +- .../SealedKeywordRecommenderTests.cs | 30 +- .../SelectKeywordRecommenderTests.cs | 4 +- .../SetKeywordRecommenderTests.cs | 34 +- .../ShortKeywordRecommenderTests.cs | 38 +- .../SizeOfKeywordRecommenderTests.cs | 4 +- .../StackAllocKeywordRecommenderTests.cs | 10 +- .../StaticKeywordRecommenderTests.cs | 24 +- .../StringKeywordRecommenderTests.cs | 38 +- .../StructKeywordRecommenderTests.cs | 22 +- .../SwitchKeywordRecommenderTests.cs | 4 +- .../ThisKeywordRecommenderTests.cs | 62 +- .../ThrowKeywordRecommenderTests.cs | 6 +- .../TrueKeywordRecommenderTests.cs | 4 +- .../TryKeywordRecommenderTests.cs | 4 +- .../TypeKeywordRecommenderTests.cs | 20 +- .../TypeOfKeywordRecommenderTests.cs | 4 +- .../TypeVarKeywordRecommenderTests.cs | 20 +- .../UIntKeywordRecommenderTests.cs | 38 +- .../ULongKeywordRecommenderTests.cs | 38 +- .../UShortKeywordRecommenderTests.cs | 38 +- .../UncheckedKeywordRecommenderTests.cs | 4 +- .../UndefKeywordRecommenderTests.cs | 4 +- .../UnsafeKeywordRecommenderTests.cs | 22 +- .../UsingKeywordRecommenderTests.cs | 22 +- .../VarKeywordRecommenderTests.cs | 6 +- .../VirtualKeywordRecommenderTests.cs | 28 +- .../VoidKeywordRecommenderTests.cs | 50 +- .../VolatileKeywordRecommenderTests.cs | 30 +- .../WarningKeywordRecommenderTests.cs | 4 +- .../WhereKeywordRecommenderTests.cs | 16 +- .../WhileKeywordRecommenderTests.cs | 4 +- .../YieldKeywordRecommenderTests.cs | 4 +- ...torInlineRenameService.SymbolRenameInfo.cs | 8 +- .../AbstractSemanticQuickInfoProvider.cs | 6 +- .../Controller.Session_ComputeModel.cs | 6 +- .../Controller.Session_UpdateModel.cs | 4 +- .../SignatureHelp/Controller_TypeChar.cs | 4 +- .../CodeActionSmartTagProducerTests.cs | 4 +- .../CodeGenerationTests.CSharp.cs | 10 +- .../CodeGenerationTests.VisualBasic.cs | 6 +- ...ntUncommentSelectionCommandHandlerTests.cs | 18 +- .../TextSnapshotImplementationTest.cs | 12 +- .../ISemanticSnapshotExtensionTests.cs | 4 +- .../Test/Extensions/ITextExtensionsTests.cs | 26 +- .../Extensions/ITextLineExtensionsTests.cs | 18 +- .../ITextSnapshotExtensionsTests.cs | 32 +- .../ITextSnapshotLineExtensionsTests.cs | 26 +- .../DocCommentFormatterTests.cs | 6 +- .../MetadataAsSource/MetadataAsSourceTests.cs | 42 +- .../RenameTrackingTaggerProviderTests.cs | 12 +- .../Test/Structure/BlockSpanTests.cs | 12 +- .../Structure/BlockStructureServiceTests.cs | 8 +- .../Test/Tagging/TagSpanIntervalTreeTests.cs | 14 +- .../Test/Utilities/PatternMatcherTests.cs | 28 +- .../SymbolEquivalenceComparerTests.cs | 218 +-- .../Test2/CallHierarchy/CallHierarchyTests.vb | 46 +- .../Test2/CodeFixes/CodeFixServiceTests.vb | 6 +- .../AddImport/AddImportCrossLanguageTests.vb | 10 +- .../AddMissingReferenceTests.vb | 10 +- .../Diagnostics/DiagnosticProviderTests.vb | 26 +- .../Diagnostics/DiagnosticServiceTests.vb | 50 +- .../GenerateEventCrossLanguageTests.vb | 16 +- .../GenerateConstructorCrossLanguageTests.vb | 4 +- .../GenerateMethodCrossLanguageTests.vb | 74 +- .../GenerateVariableCrossLanguageTests.vb | 4 +- .../ImplementInterfaceCrossLanguageTests.vb | 22 +- .../ExtensionMethodExpansionRewriteTests.vb | 134 +- .../Expansion/ModuleNameExpansionTests.vb | 42 +- .../FindReferencesTests.AliasSymbols.vb | 28 +- .../FindReferencesTests.ConstructorSymbols.vb | 34 +- ...rencesTests.DynamicDelegatesAndIndexers.vb | 8 +- .../FindReferencesTests.DynamicIdentifiers.vb | 14 +- .../FindReferencesTests.EventSymbols.vb | 6 +- ...cesTests.ExplicitInterfaceMethodSymbols.vb | 10 +- .../FindReferencesTests.FieldSymbols.vb | 42 +- .../FindReferencesTests.IndexerSymbols.vb | 10 +- .../FindReferencesTests.LabelSymbols.vb | 18 +- .../FindReferencesTests.Literals.vb | 36 +- .../FindReferencesTests.LocalSymbols.vb | 12 +- ...ncesTests.MethodTypeParameterTypeSymbol.vb | 26 +- .../FindReferencesTests.NamedTypeSymbols.vb | 74 +- .../FindReferencesTests.NamespaceSymbols.vb | 16 +- .../FindReferencesTests.OperatorSymbols.vb | 18 +- ...ndReferencesTests.OrdinaryMethodSymbols.vb | 354 ++--- .../FindReferencesTests.ParameterSymbol.vb | 38 +- .../FindReferencesTests.PropertySymbols.vb | 22 +- ...FindReferencesTests.RangeVariableSymbol.vb | 10 +- ...ReferencesTests.TypeParameterTypeSymbol.vb | 32 +- .../FindReferencesTests.WinmdSymbols.vb | 8 +- .../FindReferencesTests.XmlDocSymbols.vb | 116 +- .../GoToDefinition/GoToDefinitionTests.vb | 38 +- .../CSharpCompletionCommandHandlerTests.vb | 172 +-- ...mpletionCommandHandlerTests_Projections.vb | 8 +- .../CSharpIntelliSenseCommandHandlerTests.vb | 20 +- .../CSharpSignatureHelpCommandHandlerTests.vb | 46 +- ...isualBasicCompletionCommandHandlerTests.vb | 166 +-- ...mpletionCommandHandlerTests_Projections.vb | 6 +- .../CSharpKeywordHighlightingTests.vb | 6 +- .../VisualBasicKeywordHighlightingTests.vb | 6 +- .../NavigationBar/CSharpNavigationBarTests.vb | 30 +- .../VisualBasicNavigationBarTests.vb | 34 +- src/EditorFeatures/Test2/Peek/PeekTests.vb | 4 +- .../CSharpReferenceHighlightingTests.vb | 18 +- .../VisualBasicReferenceHighlightingTests.vb | 40 +- .../Test2/Rename/CSharp/AliasTests.vb | 104 +- .../Rename/CSharp/DeclarationConflictTests.vb | 42 +- .../Test2/Rename/CSharp/EscapingTests.vb | 20 +- .../CSharp/ImplicitReferenceConflictTests.vb | 4 +- .../Test2/Rename/CSharp/InteractiveTests.vb | 4 +- .../Test2/Rename/CSharp/InterfaceTests.vb | 18 +- .../Test2/Rename/CSharp/LocalConflictTests.vb | 32 +- .../Test2/Rename/DashboardTests.vb | 62 +- .../Test2/Rename/InlineRenameTests.vb | 258 ++-- .../Test2/Rename/RenameCommandHandlerTests.vb | 72 +- .../RenameEngineTests.VisualBasicConflicts.vb | 342 ++--- .../Test2/Rename/RenameEngineTests.vb | 418 +++--- .../Rename/RenameNonRenameableSymbols.vb | 10 +- .../Test2/Rename/RenameTagProducerTests.vb | 170 +-- .../Test2/Rename/VisualBasic/AliasTests.vb | 62 +- .../CallSiteConflictResolutionTests.vb | 14 +- .../VisualBasic/DeclarationConflictTests.vb | 78 +- .../Test2/Rename/VisualBasic/EscapingTests.vb | 50 +- .../Rename/VisualBasic/QualificationTests.vb | 4 +- .../Simplification/CastSimplificationTests.vb | 522 +++---- .../Simplification/EscapingSimplifierTest.vb | 64 +- .../ExtensionMethodSimplificationTests.vb | 34 +- .../ModuleNameSimplificationTests.vb | 26 +- .../ParenthesisSimplificationTests.vb | 14 +- .../TypeInferenceSimplifierTests.vb | 46 +- .../Simplification/TypeNameSimplifierTest.vb | 100 +- .../SymbolDescriptionServiceTests.vb | 66 +- .../AbstractCommandHandlerTestState.cs | 6 +- .../SignatureHelp/SignatureHelpTestItem.cs | 4 +- .../TestUtilities/Workspaces/TestWorkspace.cs | 12 +- ...dConstructStatementVisitor_LambdaHeader.vb | 4 +- .../AddParameter/AddParameterTests.vb | 26 +- .../BraceMatching/BraceHighlightingTests.vb | 8 +- .../VisualBasicBraceMatcherTests.vb | 86 +- .../CaseCorrectionServiceTests.vb | 192 +-- .../ChangeSignature/ChangeSignatureTests.vb | 12 +- .../ReorderParameters.InvocationLocations.vb | 44 +- .../ReorderParameters.MultiFile.vb | 18 +- .../ReorderParametersTests.Cascading.vb | 102 +- .../ChangeSignature/ReorderParametersTests.vb | 34 +- .../Classification/SemanticClassifierTests.vb | 6 +- .../SyntacticClassifierTests.vb | 344 ++--- .../EncapsulateField/EncapsulateFieldTests.vb | 64 +- .../ExtractMethod/ExtractMethodTests.vb | 6 +- .../InlineTemporary/InlineTemporaryTests.vb | 176 +-- .../IntroduceVariableTests.vb | 260 ++-- .../CodeActions/InvertIf/InvertIfTests.vb | 34 +- .../ReplaceMethodWithPropertyTests.vb | 234 +-- .../ReplacePropertyWithMethodsTests.vb | 28 +- ...tractVisualBasicCompletionProviderTests.vb | 16 +- ...ompletionListTagCompletionProviderTests.vb | 10 +- .../CrefCompletionProviderTests.vb | 48 +- .../EnumCompletionProviderTests.vb | 18 +- .../HandlesClauseCompletionProviderTests.vb | 18 +- ...ImplementsClauseCompletionProviderTests.vb | 110 +- .../KeywordCompletionProviderTests.vb | 12 +- .../NamedParameterCompletionProviderTests.vb | 42 +- ...bjectInitializerCompletionProviderTests.vb | 72 +- .../OverrideCompletionProviderTests.vb | 422 +++--- .../PartialTypeCompletionProviderTests.vb | 8 +- .../SuggestionModeCompletionProviderTests.vb | 10 +- .../SymbolCompletionProviderTests.vb | 500 +++---- .../CompletionProviders/TypeContextTests.vb | 4 +- .../XmlDocCommentCompletionProviderTests.vb | 70 +- .../Diagnostics/AddImport/AddImportTests.vb | 204 +-- .../ExitContinueCodeActionTests.vb | 106 +- .../FullyQualify/FullyQualifyTests.vb | 80 +- .../GenerateEndConstructTests.vb | 36 +- .../GenerateEnumMemberTests.vb | 68 +- .../GenerateEvent/GenerateEventTests.vb | 14 +- .../GenerateMethod/GenerateMethodTests.vb | 628 ++++---- .../GenerateType/GenerateTypeTests.vb | 164 +- .../GenerateType/GenerateTypeTests_Dialog.vb | 460 +++--- .../GenerateVariable/GenerateVariableTests.vb | 264 ++-- .../InsertMissingCastTests.vb | 22 +- .../MakeMethodSynchronousTests.vb | 94 +- .../MoveToTopOfFile/MoveToTopOfFileTests.vb | 4 +- .../RemoveUnnecessaryCastTests.vb | 198 +-- .../SimplifyTypeNamesTests.vb | 204 +-- .../Diagnostics/Spellcheck/SpellcheckTests.vb | 68 +- .../UseAutoProperty/UseAutoPropertyTests.vb | 16 +- ...emoveDocCommentNodeCodeFixProviderTests.vb | 6 +- .../DocumentationCommentTests.vb | 54 +- .../XmlTagCompletionTests.vb | 30 +- .../EditAndContinue/ActiveStatementTests.vb | 430 +++--- .../ActiveStatementTrackingServiceTests.vb | 28 +- .../EditAndContinue/BreakpointSpansTests.vb | 192 +-- .../EditAndContinue/LineEditTests.vb | 192 +-- .../EditAndContinue/RudeEditStatementTests.vb | 256 ++-- .../EditAndContinue/RudeEditTopLevelTests.vb | 182 +-- ...VisualBasicEditAndContinueAnalyzerTests.vb | 12 +- .../EncapsulateFieldCommandHandlerTests.vb | 32 +- .../CustomEventTests.vb | 28 +- .../EndConstructGeneration/DoLoopTests.vb | 10 +- .../EndConstructGeneration/ForLoopTests.vb | 18 +- .../EndConstructGeneration/IfBlockTests.vb | 52 +- .../MethodBlockTests.vb | 14 +- .../MiscellaneousTests.vb | 6 +- .../MultiLineLambdaTests.vb | 30 +- .../NamespaceBlockTests.vb | 10 +- .../PreprocessorRegionsTests.vb | 16 +- .../PropertyBlockTests.vb | 62 +- .../SelectBlockTests.vb | 18 +- .../SyncLockBlockTests.vb | 8 +- .../EndConstructGeneration/TryBlockTests.vb | 10 +- .../EndConstructGeneration/TypeBlockTests.vb | 14 +- .../EndConstructGeneration/UsingBlockTests.vb | 8 +- .../EndConstructGeneration/WhileLoopTests.vb | 8 +- .../EndConstructGeneration/WithBlockTests.vb | 8 +- .../EndConstructGeneration/XmlLiteralTests.vb | 8 +- .../StatementSyntaxExtensionTests.vb | 4 +- .../ExtractInterface/ExtractInterfaceTests.vb | 156 +- .../ExtractMethodTests.ControlFlowAnalysis.vb | 14 +- .../ExtractMethodTests.DataFlowAnalysis.vb | 84 +- .../ExtractMethodTests.LanguageInteraction.vb | 54 +- ...ExtractMethodTests.MethodNameGeneration.vb | 6 +- .../ExtractMethodTests.SelectionValidator.vb | 36 +- .../Formatting/FormattingEngineTests_Venus.vb | 6 +- .../Indentation/SmartIndenterTests.vb | 80 +- .../Formatting/XmlLiterals.Designer.vb | 14 +- .../Formatting/XmlLiterals.resx | 14 +- .../GenerateConstructorTests.vb | 56 +- .../GenerateDefaultConstructorsTests.vb | 4 +- ...plementAbstractClassCommandHandlerTests.vb | 52 +- .../ImplementAbstractClassTests.vb | 34 +- .../ImplementInterfaceCommandHandlerTests.vb | 132 +- .../ImplementInterfaceTests.vb | 386 ++--- .../AccessorDeclarationHighlighterTests.vb | 34 +- ...ConditionalPreprocessorHighlighterTests.vb | 58 +- .../EventBlockHighlighterTests.vb | 8 +- .../EventDeclarationHighlighterTests.vb | 6 +- .../MethodDeclarationHighlighterTests.vb | 14 +- .../PropertyBlockHighlighterTests.vb | 8 +- .../PropertyDeclarationHighlighterTests.vb | 6 +- .../TryBlockHighlighterTests.vb | 18 +- .../XmlElementHighlighterTests.vb | 8 +- .../LineCommit/CommitOnEnterTests.vb | 4 +- .../CommitOnMiscellaneousCommandsTests.vb | 10 +- .../LineCommit/CommitWithViewTests.vb | 30 +- .../LineSeparators/LineSeparatorTests.vb | 4 +- .../MoveDeclarationNearReferenceTests.vb | 20 +- .../NavigateTo/NavigateToTests.vb | 180 +-- .../OrganizeTypeDeclarationTests.vb | 12 +- .../PerfTests/Sources/IndividualDS.vb | 4 +- .../PerfTests/Sources/LargeMethod.vb | 22 +- .../PerfTests/Sources/LargeMethodVB.txt | 14 +- .../PerfTests/Sources/Scrolling.vb | 1208 +++++++-------- .../PerfTests/Sources/TypeFileVB.txt | 128 +- .../PopulateSwitch/PopulateSwitchTests.vb | 54 +- .../PopulateSwitchTests_FixAllTests.vb | 38 +- .../QuickInfo/SemanticQuickInfoSourceTests.vb | 160 +- .../AliasKeywordRecommenderTests.vb | 14 +- .../Declarations/AsKeywordRecommenderTests.vb | 86 +- .../AttributeScopesKeywordRecommenderTests.vb | 12 +- .../ClassKeywordRecommenderTests.vb | 4 +- ...varianceModifierKeywordRecommenderTests.vb | 32 +- .../DelegateKeywordRecommenderTests.vb | 4 +- .../EndBlockKeywordRecommenderTests.vb | 64 +- .../EnumKeywordRecommenderTests.vb | 4 +- .../FunctionKeywordRecommenderTests.vb | 8 +- ...nericConstraintsKeywordRecommenderTests.vb | 20 +- .../GetSetKeywordRecommenderTests.vb | 38 +- .../HandlesKeywordRecommenderTests.vb | 22 +- .../ImplementsKeywordRecommenderTests.vb | 84 +- .../ImportsKeywordRecommenderTests.vb | 4 +- .../Declarations/InKeywordRecommenderTests.vb | 6 +- .../InheritsKeywordRecommenderTests.vb | 18 +- .../InterfaceKeywordRecommenderTests.vb | 4 +- .../LibKeywordRecommenderTests.vb | 12 +- .../Declarations/OfKeywordRecommenderTests.vb | 52 +- ...rameterModifiersKeywordRecommenderTests.vb | 38 +- .../StructureKeywordRecommenderTests.vb | 4 +- .../SubKeywordRecommenderTests.vb | 6 +- .../AddressOfKeywordRecommenderTests.vb | 30 +- .../AwaitKeywordRecommenderTests.vb | 18 +- .../BinaryOperatorKeywordRecommenderTests.vb | 34 +- .../CastOperatorsKeywordRecommenderTests.vb | 14 +- .../FromKeywordRecommenderTests.vb | 16 +- .../GetTypeKeywordRecommenderTests.vb | 14 +- .../GetXmlNamespaceKeywordRecommenderTests.vb | 14 +- .../GlobalKeywordRecommenderTests.vb | 14 +- .../Expressions/IfKeywordRecommenderTests.vb | 14 +- .../Expressions/KeyKeywordRecommenderTests.vb | 10 +- .../LambdaKeywordRecommenderTests.vb | 10 +- .../Expressions/MeKeywordRecommenderTests.vb | 16 +- .../MyBaseKeywordRecommenderTests.vb | 18 +- .../MyClassKeywordRecommenderTests.vb | 24 +- .../NameOfKeywordRecommenderTests.vb | 10 +- .../Expressions/NewKeywordRecommenderTests.vb | 20 +- .../Expressions/NotKeywordRecommenderTests.vb | 14 +- .../NothingKeywordRecommenderTests.vb | 14 +- .../TrueFalseKeywordRecommenderTests.vb | 14 +- .../TypeOfKeywordRecommenderTests.vb | 14 +- .../WithKeywordRecommenderTests.vb | 22 +- .../OptionKeywordRecommenderTests.vb | 6 +- .../ConstDirectiveKeywordRecommenderTests.vb | 4 +- ...dRegionDirectiveKeywordRecommenderTests.vb | 8 +- .../IfDirectiveKeywordRecommenderTests.vb | 4 +- .../RegionDirectiveKeywordRecommenderTests.vb | 6 +- .../AggregateKeywordRecommenderTests.vb | 14 +- .../Queries/FromKeywordRecommenderTests.vb | 14 +- .../Statements/CaseKeywordRecommenderTests.vb | 16 +- .../Statements/ElseKeywordRecommenderTests.vb | 18 +- .../Statements/ExitKeywordRecommenderTests.vb | 14 +- .../Statements/ForKeywordRecommenderTests.vb | 4 +- .../ReturnKeywordRecommenderTests.vb | 6 +- .../BuiltInTypesKeywordRecommenderTests.vb | 16 +- .../RemoveUnnecessaryImportsTests.vb | 100 +- ...RemoveHandlerSignatureHelpProviderTests.vb | 14 +- .../AttributeSignatureHelpProviderTests.vb | 10 +- ...astExpressionSignatureHelpProviderTests.vb | 10 +- ...nalExpressionSignatureHelpProviderTests.vb | 6 +- ...onAggregationSignatureHelpProviderTests.vb | 10 +- .../GenericNameSignatureHelpProviderTests.vb | 150 +- ...ypeExpressionSignatureHelpProviderTests.vb | 4 +- ...aceExpressionSignatureHelpProviderTests.vb | 4 +- ...ionExpressionSignatureHelpProviderTests.vb | 380 ++--- ...MidAssignmentSignatureHelpProviderTests.vb | 8 +- ...ionExpressionSignatureHelpProviderTests.vb | 44 +- ...astExpressionSignatureHelpProviderTests.vb | 4 +- .../Squiggles/ErrorSquiggleProducerTests.vb | 10 +- ...ectionInitializerStructureProviderTests.vb | 6 +- .../DelegateDeclarationStructureTests.vb | 4 +- .../EnumDeclarationStructureTests.vb | 8 +- .../ConstructorDeclarationStructureTests.vb | 8 +- .../DelegateDeclarationStructureTests.vb | 8 +- .../EnumDeclarationStructureTests.vb | 16 +- .../EnumMemberDeclarationStructureTests.vb | 8 +- .../EventDeclarationStructureTests.vb | 16 +- .../FieldDeclarationStructureTests.vb | 6 +- .../MethodDeclarationStructureTests.vb | 8 +- .../OperatorDeclarationStructureTests.vb | 8 +- .../PropertyDeclarationStructureTests.vb | 16 +- .../TypeDeclarationStructureTests.vb | 8 +- .../MethodDeclarationStructureTests.vb | 48 +- ...eationInitializerStructureProviderTests.vb | 4 +- .../RegionDirectiveStructureTests.vb | 8 +- .../Structure/SelectBlockStructureTests.vb | 6 +- .../Structure/UsingBlockStructureTests.vb | 6 +- .../Structure/WithBlockStructureTests.vb | 6 +- .../Structure/XmlExpressionStructureTests.vb | 38 +- .../SymbolId/SymbolKeyCompilationsTests.vb | 56 +- .../SymbolKeyMetadataVsSourceTests.vb | 34 +- .../TypeInferrer/TypeInferrerTests.vb | 142 +- .../UseCollectionInitializerTests.vb | 10 +- .../UseExplicitTupleNameTests.vb | 10 +- .../UseObjectInitializerTests.vb | 6 +- src/EditorFeatures/VisualBasicTest/Utils.vb | 4 +- .../ValidateFormatStringTests.vb | 6 +- .../Test/ExpressionCompiler/DynamicTests.cs | 28 +- .../CSharpChangeSignatureService.cs | 4 +- .../GenerateMethodCodeFixProvider.cs | 12 +- .../GenerateTypeCodeFixProvider.cs | 4 +- ...LambdaSimplifierCodeRefactoringProvider.cs | 6 +- ...tributeNamedParameterCompletionProvider.cs | 4 +- ...nNameCompletionProvider.DeclarationInfo.cs | 6 +- .../ObjectInitializerCompletionProvider.cs | 10 +- .../SpeculativeTCompletionProvider.cs | 4 +- .../BaseKeywordRecommender.cs | 4 +- .../ConstKeywordRecommender.cs | 4 +- .../ElseKeywordRecommender.cs | 10 +- .../NamespaceKeywordRecommender.cs | 20 +- .../NewKeywordRecommender.cs | 4 +- .../RefKeywordRecommender.cs | 4 +- .../ThisKeywordRecommender.cs | 4 +- .../UsingKeywordRecommender.cs | 24 +- .../WhereKeywordRecommender.cs | 22 +- .../WhileKeywordRecommender.cs | 4 +- .../CSharpSuggestionModeCompletionProvider.cs | 6 +- .../CSharpGenerateVariableService.cs | 8 +- .../GenerateType/CSharpGenerateTypeService.cs | 14 +- .../CSharpGenerateVariableCodeFixProvider.cs | 6 +- ...rpImplementAbstractClassCodeFixProvider.cs | 4 +- ...harpInlineDeclarationDiagnosticAnalyzer.cs | 4 +- .../CSharpIntroduceVariableService.cs | 4 +- .../CSharpReplaceMethodWithPropertyService.cs | 4 +- ...ntAccessExpressionSignatureHelpProvider.cs | 6 +- .../Providers/BlockSyntaxStructureProvider.cs | 4 +- ...stractMemberInsertingCompletionProvider.cs | 14 +- ...ToInterpolatedStringRefactoringProvider.cs | 4 +- ...AbstractGenerateEnumMemberService.State.cs | 4 +- .../AbstractGenerateMethodService.State.cs | 16 +- ...zedMemberService.AbstractInvocationInfo.cs | 8 +- ...arameterizedMemberService.SignatureInfo.cs | 8 +- ...enerateParameterizedMemberService.State.cs | 8 +- ...tractGenerateVariableService.CodeAction.cs | 8 +- .../AbstractGenerateVariableService.State.cs | 14 +- .../AbstractGenerateTypeService.State.cs | 26 +- .../AbstractGenerateTypeService.cs | 6 +- ...actImplementInterfaceService.CodeAction.cs | 24 +- ...stractReplacePropertyWithMethodsService.cs | 4 +- ...stractUseNullPropagationCodeFixProvider.cs | 4 +- .../GenerateEventCodeFixProvider.vb | 4 +- ...erateParameterizedMemberCodeFixProvider.vb | 8 +- .../GenerateTypeCodeFixProvider.vb | 6 +- .../Declarations/AsKeywordRecommender.vb | 20 +- .../Declarations/OfKeywordRecommender.vb | 10 +- .../BinaryOperatorKeywordRecommender.vb | 4 +- .../Expressions/FromKeywordRecommender.vb | 4 +- .../Expressions/WithKeywordRecommender.vb | 4 +- .../VisualBasicEditAndContinueAnalyzer.vb | 6 +- .../VisualBasicGenerateTypeService.vb | 26 +- ...ualBasicGenerateVariableCodeFixProvider.vb | 6 +- ...icImplementAbstractClassCodeFixProvider.vb | 4 +- ...lBasicImplementInterfaceCodeFixProvider.vb | 4 +- .../VisualBasicReplacePropertyWithMethods.vb | 8 +- .../SignatureHelp/SignatureHelpUtilities.vb | 4 +- .../HostTest/InteractiveHostTests.cs | 28 +- .../Test/ConvertToConditionalTests.cs | 10 +- .../Test/CodeRefactoringTests.cs | 4 +- .../Test/ConvertToAutoPropertyTests.vb | 18 +- .../Test/CodeRefactoringTests.vb | 4 +- .../InteractiveSessionTests.cs | 8 +- .../ObjectFormatterTests.cs | 8 +- .../CSharpTest/InteractiveSessionTests.cs | 90 +- .../CSharpTest/ObjectFormatterTests.cs | 46 +- .../CommonObjectFormatter.Visitor.cs | 4 +- .../MetadataShadowCopyProviderTests.cs | 14 +- .../ObjectFormatterTests.Fixtures.cs | 10 +- .../ObjectFormatterTests.vb | 6 +- .../VisualBasicTest/CommandLineRunnerTests.vb | 12 +- .../SuppressMessageAttributeTests.cs | 30 +- .../Portable/TestResource.Designer.cs | 44 +- src/Test/Utilities/Portable/TestResource.resx | 168 +-- .../GitMergeBot/Mono.Options/Options.cs | 4 +- ...SharpProximityExpressionsService.Worker.cs | 4 +- ...ressionsService_ExpressionTermCollector.cs | 4 +- .../Formatting/IndentationViewModel.cs | 12 +- .../Options/Formatting/NewLinesViewModel.cs | 24 +- .../Options/Formatting/SpacingViewModel.cs | 28 +- .../Options/Formatting/WrappingViewModel.cs | 6 +- .../Interop/ICSharpProjectRoot.cs | 4 +- .../Test/CodeModel/FileCodeClassTests.cs | 16 +- .../FileCodeClassWithMissingBraceTests.cs | 8 +- .../Test/CodeModel/FileCodeFunctionTests.cs | 6 +- .../Test/CodeModel/FileCodeImportTests.cs | 6 +- .../Test/CodeModel/FileCodeNamespaceTests.cs | 14 +- .../FileCodeVariableManipulationTests.cs | 8 +- .../Test/Debugging/DataTipInfoGetterTests.cs | 52 +- .../Test/Debugging/LocationInfoGetterTests.cs | 4 +- .../Test/Debugging/NameResolverTests.cs | 342 ++--- .../ProximityExpressionsGetterTestFile.cs | 4 +- .../ProximityExpressionsGetterTests.Lines.cs | 6 +- .../ProximityExpressionsGetterTests.cs | 10 +- ...ProximityExpressionsGetterTests_Caching.cs | 10 +- .../CSharp/Test/F1Help/F1HelpTests.cs | 24 +- .../InteractiveCommandHandlerTests.cs | 4 +- .../LegacyProject/SourceFileHandlingTests.cs | 6 +- .../Progression/GraphBuilder.cs | 4 +- .../Progression/GraphNodeIdCreation.cs | 10 +- .../MiscellaneousFilesWorkspace.cs | 4 +- .../Impl/CodeModel/CodeModelProjectCache.cs | 8 +- .../CodeModel/CSharp/CodeAttributeTests.vb | 60 +- .../Test/CodeModel/CSharp/CodeClassTests.vb | 138 +- .../CodeModel/CSharp/CodeDelegateTests.vb | 10 +- .../Test/CodeModel/CSharp/CodeEnumTests.vb | 30 +- .../Test/CodeModel/CSharp/CodeEventTests.vb | 38 +- .../CodeModel/CSharp/CodeFunctionTests.vb | 178 +-- .../Test/CodeModel/CSharp/CodeImportTests.vb | 18 +- .../CodeModel/CSharp/CodeInterfaceTests.vb | 8 +- .../CodeModel/CSharp/CodeNamespaceTests.vb | 38 +- .../CodeModel/CSharp/CodeParameterTests.vb | 78 +- .../Test/CodeModel/CSharp/CodeStructTests.vb | 8 +- .../CodeModel/CSharp/CodeVariableTests.vb | 124 +- .../CodeModel/CSharp/EventCollectorTests.vb | 48 +- .../CSharp/ExternalCodeFunctionTests.vb | 10 +- .../CSharp/ExternalCodeParameterTests.vb | 14 +- .../CodeModel/CSharp/FileCodeModelTests.vb | 24 +- .../CodeModel/CSharp/RootCodeModelTests.vb | 8 +- .../MethodXML/MethodXMLTests_CSEvents.vb | 26 +- .../MethodXML/MethodXMLTests_CSInvocations.vb | 24 +- .../MethodXMLTests_CSLocalDeclarations.vb | 18 +- .../MethodXML/MethodXMLTests_CSQuotes.vb | 14 +- .../MethodXML/MethodXMLTests_VBAssignments.vb | 8 +- .../MethodXML/MethodXMLTests_VBInvocations.vb | 18 +- .../MethodXMLTests_VBLocalDeclarations.vb | 26 +- .../VisualBasic/CodeAttributeTests.vb | 60 +- .../CodeModel/VisualBasic/CodeClassTests.vb | 154 +- .../VisualBasic/CodeDelegateTests.vb | 10 +- .../CodeModel/VisualBasic/CodeEnumTests.vb | 16 +- .../CodeModel/VisualBasic/CodeEventTests.vb | 52 +- .../VisualBasic/CodeFunctionTests.vb | 198 +-- .../CodeModel/VisualBasic/CodeImportTests.vb | 10 +- .../VisualBasic/CodeInterfaceTests.vb | 22 +- .../VisualBasic/CodeNamespaceTests.vb | 52 +- .../VisualBasic/CodeParameterTests.vb | 72 +- .../VisualBasic/CodePropertyTests.vb | 24 +- .../CodeModel/VisualBasic/CodeStructTests.vb | 14 +- .../VisualBasic/CodeVariableTests.vb | 116 +- .../VisualBasic/EventCollectorTests.vb | 102 +- .../VisualBasic/ExternalCodeFunctionTests.vb | 10 +- .../VisualBasic/ExternalCodeParameterTests.vb | 4 +- .../VisualBasic/FileCodeModelTests.vb | 20 +- .../VisualBasic/RootCodeModelTests.vb | 10 +- .../VisualBasicCompletionSnippetNoteTests.vb | 4 +- .../CSharpDebuggerIntellisenseTests.vb | 28 +- .../VisualBasicDebuggerIntellisenseTests.vb | 14 +- .../Test/Debugging/DataTipInfoGetterTests.vb | 30 +- .../Test/Debugging/LocationInfoGetterTests.vb | 14 +- .../Core/Test/Debugging/NameResolverTests.vb | 342 ++--- .../ProximityExpressionsGetterTests.vb | 8 +- ...alBasicBreakpointResolutionServiceTests.vb | 10 +- .../EditAndContinueTestHelper.vb | 4 +- .../ExtractInterfaceViewModelTests.vb | 72 +- .../GenerateTypeViewModelTests.vb | 84 +- src/VisualStudio/Core/Test/Help/HelpTests.vb | 122 +- .../ObjectBrowser/CSharp/ObjectBrowerTests.vb | 26 +- .../VisualBasic/ObjectBrowerTests.vb | 38 +- .../Core/Test/Preview/PreviewChangesTests.vb | 10 +- .../Progression/CSharpSymbolLabelTests.vb | 10 +- .../Test/Progression/CallsGraphQueryTests.vb | 8 +- .../Progression/GraphNodeCreationTests.vb | 50 +- .../ImplementedByGraphQueryTests.vb | 14 +- .../Progression/ImplementsGraphQueryTests.vb | 8 +- .../Progression/InheritedByGraphQueryTests.vb | 30 +- .../Progression/IsCalledByGraphQueryTests.vb | 4 +- .../OverriddenByGraphQueryTests.vb | 10 +- .../Progression/OverridesGraphQueryTests.vb | 12 +- .../Test/Progression/SearchGraphQueryTests.vb | 18 +- .../VisualStudioAnalyzerTests.vb | 4 +- .../CSharpSnippetCommandHandlerTests.vb | 34 +- .../VisualBasicSnippetCommandHandlerTests.vb | 38 +- .../SolutionExplorer/AnalyzerItemTests.vb | 14 +- .../AnalyzersFolderItemTests.vb | 6 +- .../AnalyzersFolderProviderTests.vb | 6 +- .../CSharpContainedLanguageSupportTests.vb | 10 +- ...ontainedDocumentTests_AdjustIndentation.vb | 10 +- .../ContainedDocumentTests_UpdateText.vb | 22 +- ...isualBasicContainedLanguageSupportTests.vb | 10 +- .../CSharp/CSharpAddMissingReference.cs | 16 +- .../CSharp/CSharpAutomaticBraceCompletion.cs | 48 +- .../CSharp/CSharpClassification.cs | 8 +- .../CSharp/CSharpFormatting.cs | 6 +- .../CSharp/CSharpGoToImplementation.cs | 8 +- .../CSharp/CSharpIntelliSense.cs | 16 +- .../CSharp/CSharpInteractiveDirectives.cs | 12 +- .../CSharp/CSharpNavigationBar.cs | 18 +- .../CSharp/CSharpOutlining.cs | 6 +- .../CSharp/CSharpQuickInfo.cs | 4 +- .../IntegrationTests/CSharp/CSharpRename.cs | 6 +- .../CSharp/CSharpReplIdeFeatures.cs | 34 +- .../CSharp/CSharpReplIntellisense.cs | 4 +- .../CSharp/CSharpSendToInteractive.cs | 6 +- .../IntegrationTests/CSharp/CSharpWinForms.cs | 6 +- .../VisualBasic/BasicAddMissingReference.cs | 20 +- .../BasicAutomaticBraceCompletion.cs | 54 +- .../VisualBasic/BasicClassification.cs | 6 +- .../VisualBasic/BasicCodeActions.cs | 14 +- .../VisualBasic/BasicEditAndContinue.cs | 18 +- .../VisualBasic/BasicEndConstruct.cs | 6 +- .../VisualBasic/BasicErrorListCommon.cs | 8 +- .../VisualBasic/BasicGoToImplementation.cs | 8 +- .../VisualBasic/BasicLineCommit.cs | 8 +- .../VisualBasic/BasicNavigationBar.cs | 10 +- .../VisualBasic/BasicQuickInfo.cs | 6 +- .../VisualBasic/BasicReferenceHighlighting.cs | 10 +- .../VisualBasic/BasicSignatureHelp.cs | 8 +- .../VisualBasic/BasicWinForms.cs | 6 +- .../Debugging/VisualBasicBreakpointService.vb | 4 +- .../VisualBasicDebuggerIntelliSenseContext.vb | 4 +- .../Worker_DocumentationComments.cs | 4 +- .../CastExpressionSyntaxExtensions.cs | 8 +- .../ContextQuery/SyntaxTokenExtensions.cs | 66 +- .../ContextQuery/SyntaxTreeExtensions.cs | 94 +- .../Extensions/ExpressionSyntaxExtensions.cs | 8 +- .../Extensions/SyntaxNodeExtensions.cs | 16 +- .../Extensions/SyntaxTreeExtensions.cs | 4 +- .../CSharpDeclaredSymbolInfoFactoryService.cs | 6 +- ...CSharpTypeInferenceService.TypeInferrer.cs | 72 +- .../Reducers/CSharpCastReducer.Rewriter.cs | 8 +- .../Portable/Utilities/NameSyntaxComparer.cs | 6 +- .../CodeGeneration/SyntaxGeneratorTests.cs | 6 +- .../CSharpTest/Formatting/FormattingTests.cs | 230 +-- .../Formatting/FormattingTriviaTests.cs | 20 +- .../MSBuild/ProjectFile/ProjectFile.cs | 4 +- .../CodeGeneration/CodeGenerationOptions.cs | 6 +- .../Finders/AbstractReferenceFinder.cs | 6 +- .../Finders/OrdinaryMethodReferenceFinder.cs | 4 +- .../Portable/FindSymbols/ReferenceLocation.cs | 6 +- .../FindSymbols/SymbolFinder_Hierarchy.cs | 10 +- .../AbstractRecommendationService.cs | 4 +- .../ConflictEngine/RenamedSpansTracker.cs | 12 +- .../RenameLocation.ReferenceProcessing.cs | 4 +- .../Extensions/IMethodSymbolExtensions.cs | 8 +- .../Shared/Extensions/ISymbolExtensions.cs | 4 +- .../Extensions/ITypeSymbolExtensions.cs | 14 +- .../Extensions/SemanticModelExtensions.cs | 4 +- .../Utilities/SymbolEquivalenceComparer.cs | 4 +- .../DoNotAddImportsAnnotation.cs | 4 +- .../SymbolKey/SymbolKey.MethodSymbolKey.cs | 8 +- .../SymbolKey/SymbolKey.SymbolKeyWriter.cs | 10 +- .../Core/Portable/Utilities/BKTree.Builder.cs | 4 +- .../CodeCleanup/AddMissingTokensTests.cs | 514 +++---- .../NormalizeModifiersOrOperatorsTests.cs | 34 +- ...clarationsTests.TestSolutionsAndProject.cs | 6 +- .../CoreTest/FindReferencesTests.cs | 10 +- .../CoreTest/ReferencedSymbolTests.cs | 14 +- src/Workspaces/CoreTest/SerializationTests.cs | 4 +- .../SolutionTests/ProjectInfoTests.cs | 16 +- .../CoreTest/SolutionTests/SolutionTests.cs | 146 +- src/Workspaces/CoreTest/SymbolKeyTests.cs | 4 +- src/Workspaces/CoreTest/SyntaxPathTests.cs | 22 +- .../DocumentationCommentIdTests.cs | 4 +- .../UtilityTest/DocumentationCommentTests.cs | 18 +- .../WorkspaceTests/AdhocWorkspaceTests.cs | 18 +- .../WorkspaceTests/CommandLineProjectTests.cs | 38 +- .../WorkspaceTests/GeneralWorkspaceTests.cs | 4 +- .../TestFiles/OtherStuff_Foo.cs | 4 +- .../Classification/Worker.XmlClassifier.vb | 4 +- .../Extensions/ExpressionSyntaxExtensions.vb | 8 +- ...ParenthesizedExpressionSyntaxExtensions.vb | 36 +- .../Extensions/StatementSyntaxExtensions.vb | 6 +- .../Extensions/SyntaxNodeExtensions.vb | 16 +- ...lBasicTypeInferenceService.TypeInferrer.vb | 30 +- .../Reducers/VisualBasicEscapingReducer.vb | 4 +- .../Portable/Utilities/NameSyntaxComparer.vb | 6 +- .../CodeGeneration/SyntaxGeneratorTests.vb | 6 +- .../Formatting/FormattingTests.vb | 352 ++--- .../Formatting/XmlLiterals.Designer.vb | 14 +- .../Formatting/XmlLiterals.resx | 14 +- 1416 files changed, 34804 insertions(+), 34804 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs index 452a3ff705893..f2632ac109364 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -22,7 +22,7 @@ internal partial class Binder // For example, if were binding attributes on delegate type symbol for below code snippet: // [A1] // [return: A2] - // public delegate void Foo(); + // public delegate void Goo(); // attributesToBind will only contain first attribute syntax. internal static void BindAttributeTypes(ImmutableArray binders, ImmutableArray attributesToBind, Symbol ownerSymbol, NamedTypeSymbol[] boundAttributeTypes, DiagnosticBag diagnostics) { @@ -521,9 +521,9 @@ protected virtual MethodSymbol BindAttributeConstructor( /// if named constructor arguments are used. /// /// For example: - /// void Foo(int x, int y, int z, int w = 3); + /// void Goo(int x, int y, int z, int w = 3); /// - /// Foo(0, z: 2, y: 1); + /// Goo(0, z: 2, y: 1); /// /// Arguments returned: 0, 1, 2, 3 /// diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Crefs.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Crefs.cs index 258a7b503a75f..c6899d13e08dd 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Crefs.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Crefs.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -358,11 +358,11 @@ private ImmutableArray ComputeSortedCrefMembers(NamespaceOrTypeSymbol co // to not introduce a regression and breaking change we return NULL in this case. // e.g. // - // /// - // class Foo { } + // /// + // class Goo { } // // This cref used not to bind to anything, because before it was looking for a type and - // since there was no arity, it didn't find Foo. Now however, it finds Foo.ctor, + // since there was no arity, it didn't find Goo. Now however, it finds Goo.ctor, // which is arguably correct, but would be a breaking change (albeit with minimal impact) // so we catch this case and chuck out the symbol found. diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs index 75465b1b43517..75de41c24c2e2 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Collections; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -5198,8 +5198,8 @@ private BoundExpression BindMemberAccessWithBoundLeft( { // There are some sources of a `dynamic` typed value that can be known before runtime // to be invalid. For example, accessing a set-only property whose type is dynamic: - // dynamic Foo { set; } - // If Foo itself is a dynamic thing (e.g. in `x.Foo.Bar`, `x` is dynamic, and we're + // dynamic Goo { set; } + // If Goo itself is a dynamic thing (e.g. in `x.Goo.Bar`, `x` is dynamic, and we're // currently checking Bar), then CheckValue will do nothing. boundLeft = CheckValue(boundLeft, BindValueKind.RValue, diagnostics); return BindDynamicMemberAccess(node, boundLeft, right, invoked, indexed, diagnostics); diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs index bcca00ac96a6e..9061dfb9cd3fd 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -579,7 +579,7 @@ private BoundExpression BindMethodGroupInvocation( { if (HasApplicableConditionalMethod(resolution.OverloadResolutionResult)) { - // warning CS1974: The dynamically dispatched call to method 'Foo' may fail at runtime + // warning CS1974: The dynamically dispatched call to method 'Goo' may fail at runtime // because one or more applicable overloads are conditional methods Error(diagnostics, ErrorCode.WRN_DynamicDispatchToConditionalMethod, syntax, methodGroup.Name); } diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs index 3fa46c8bc37fb..0ca2969dad69b 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Statements.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -2527,8 +2527,8 @@ internal void GenerateAnonymousFunctionConversionError(DiagnosticBag diagnostics // It is possible that the conversion from lambda to delegate is just fine, and // that we ended up here because the target type, though itself is not an error // type, contains a type argument which is an error type. For example, converting - // (Foo foo)=>{} to Action is a perfectly legal conversion even if Foo is undefined! - // In that case we have already reported an error that Foo is undefined, so just bail out. + // (Goo goo)=>{} to Action is a perfectly legal conversion even if Goo is undefined! + // In that case we have already reported an error that Goo is undefined, so just bail out. if (reason == LambdaConversionResult.Success) { diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs index 0369beb373040..c61ca1c445864 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Symbols.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -599,7 +599,7 @@ protected Symbol BindNonGenericSimpleNamespaceOrTypeOrAliasSymbol( { var identifierValueText = node.Identifier.ValueText; - // If we are here in an error-recovery scenario, say, "foo(123);" then + // If we are here in an error-recovery scenario, say, "goo(123);" then // we might have an 'empty' simple name. In that case do not report an // 'unable to find ""' error; we've already reported an error in the parser so // just bail out with an error symbol. diff --git a/src/Compilers/CSharp/Portable/Binder/Imports.cs b/src/Compilers/CSharp/Portable/Binder/Imports.cs index fbddb14a9548a..5737f70fbf41f 100644 --- a/src/Compilers/CSharp/Portable/Binder/Imports.cs +++ b/src/Compilers/CSharp/Portable/Binder/Imports.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -98,9 +98,9 @@ public static Imports FromSyntax( // define all of the extern aliases first. They may used by the target of a using - // using Bar=Foo::Bar; - // using Foo::Baz; - // extern alias Foo; + // using Bar=Goo::Bar; + // using Goo::Baz; + // extern alias Goo; var diagnostics = new DiagnosticBag(); diff --git a/src/Compilers/CSharp/Portable/Binder/LookupResult.cs b/src/Compilers/CSharp/Portable/Binder/LookupResult.cs index 361ef9858b9d7..dd36f0ded62a6 100644 --- a/src/Compilers/CSharp/Portable/Binder/LookupResult.cs +++ b/src/Compilers/CSharp/Portable/Binder/LookupResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -35,7 +35,7 @@ namespace Microsoft.CodeAnalysis.CSharp /// /// var result = LookupResult.GetInstance(); /// - /// scope.Lookup(result, "foo"); + /// scope.Lookup(result, "goo"); /// ... use result ... /// /// result.Clear(); diff --git a/src/Compilers/CSharp/Portable/Binder/LookupResultKind.cs b/src/Compilers/CSharp/Portable/Binder/LookupResultKind.cs index 111dc9c7a7241..342a6892f8a04 100644 --- a/src/Compilers/CSharp/Portable/Binder/LookupResultKind.cs +++ b/src/Compilers/CSharp/Portable/Binder/LookupResultKind.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -41,7 +41,7 @@ internal enum LookupResultKind : byte WrongArity, NotCreatable, // E.g., new of an interface or static class Inaccessible, - NotReferencable, // E.g., get_Foo binding to an accessor. + NotReferencable, // E.g., get_Goo binding to an accessor. NotAValue, NotAVariable, // used for several slightly different places, e.g. LHS of =, out/ref parameters, etc. NotInvocable, diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/AccessCheck.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/AccessCheck.cs index 0caaa511c1c8b..1e0540b4dd9d1 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/AccessCheck.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/AccessCheck.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Diagnostics; @@ -480,7 +480,7 @@ private static bool InheritsFromIgnoringConstruction( } // NOTE(cyrusn): The base type of an 'original' type may not be 'original'. i.e. - // "class Foo : IBar". We must map it back to the 'original' when as we walk up + // "class Goo : IBar". We must map it back to the 'original' when as we walk up // the base type hierarchy. var next = current.GetNextBaseTypeNoUseSiteDiagnostics(basesBeingResolved, compilation, ref visited); if ((object)next == null) diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs index d13b65158e3c4..4a954ef241a4a 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -148,7 +148,7 @@ public static MethodTypeInferenceResult Infer( // void M(T t, U u); // } // ... - // static void Foo(V v, I iv) + // static void Goo(V v, I iv) // { // iv.M(v, ""); // } @@ -546,7 +546,7 @@ private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression // that has no name text. This is because of the following scenario: // // void M(T t) { } - // void Foo() + // void Goo() // { // UnknownType t; // M(t); @@ -2713,17 +2713,17 @@ private static NamedTypeSymbol GetInterfaceInferenceBound(ImmutableArray + // x.Goo( y=> // - // and the question is, "is Foo a valid extension method of x?" If Foo is - // generic, then Foo will be something like: + // and the question is, "is Goo a valid extension method of x?" If Goo is + // generic, then Goo will be something like: // - // static Blah Foo(this Bar bar, Func f){ ... } + // static Blah Goo(this Bar bar, Func f){ ... } // // What we would like to know is: given _only_ the expression x, can we infer // what T is in Bar ? If we can, then for error recovery and reporting - // we can provisionally consider Foo to be an extension method of x. If we - // cannot deduce this just from x then we should consider Foo to not be an + // we can provisionally consider Goo to be an extension method of x. If we + // cannot deduce this just from x then we should consider Goo to not be an // extension method of x, at least until we have more information. // // Clearly it is pointless to run multiple phases diff --git a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs index dda38e3b6c1d0..d1413a364db53 100644 --- a/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs +++ b/src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/OverloadResolution.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -571,8 +571,8 @@ private void AddMemberToCandidateSet( // If the normal form is invalid and the expanded form is valid then obviously we prefer // the expanded form. However, there may be error-reporting situations where we // prefer to report the error on the expanded form rather than the normal form. - // For example, if you have something like Foo(params T[]) and a call - // Foo(1, "") then the error for the normal form is "too many arguments" + // For example, if you have something like Goo(params T[]) and a call + // Goo(1, "") then the error for the normal form is "too many arguments" // and the error for the expanded form is "failed to infer T". Clearly the // expanded form error is better. private static bool PreferExpandedFormOverNormalForm(MemberAnalysisResult normalResult, MemberAnalysisResult expandedResult) @@ -904,21 +904,21 @@ private static void RemoveAllInterfaceMembers(ArrayBuilder(U u) where U : C, IFoo { u.ToString(); } // ??? + // void M(U u) where U : C, IGoo { u.ToString(); } // ??? // ... // M(new D()); // // What should overload resolution do on the call to u.ToString()? // - // We will have IFoo.ToString and C.ToString (which is an override of object.ToString) + // We will have IGoo.ToString and C.ToString (which is an override of object.ToString) // in the candidate set. Does the rule apply to eliminate all interface methods? NO. The // rule only applies if the candidate set contains a method which originally came from a // class type other than object. The method C.ToString is the "slot" for diff --git a/src/Compilers/CSharp/Portable/CodeGen/EmitAddress.cs b/src/Compilers/CSharp/Portable/CodeGen/EmitAddress.cs index 5cb919f64b05f..cf5b988e86cad 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/EmitAddress.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/EmitAddress.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -221,7 +221,7 @@ private LocalDefinition EmitSequenceAddress(BoundSequence sequence, AddressKind // when a sequence is happened to be a byref receiver // we may need to extend the life time of the target until we are done accessing it - // {.v ; v = Foo(); v}.Bar() // v should be released only after Bar() is done. + // {.v ; v = Goo(); v}.Bar() // v should be released only after Bar() is done. LocalSymbol doNotRelease = null; if (tempOpt == null) { diff --git a/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs b/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs index dd8c54d47e34a..5293f3bbe1a11 100644 --- a/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs +++ b/src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -28,7 +28,7 @@ internal class Optimizer /// 1) Do not elide any user defined locals, even if never read from. /// Example: /// { - /// var dummy = Foo(); // should not become just "Foo" + /// var dummy = Goo(); // should not become just "Goo" /// } /// /// User might want to examine dummy in the debugger. @@ -36,8 +36,8 @@ internal class Optimizer /// 2) Do not carry values on the stack between statements /// Example: /// { - /// var temp = Foo(); - /// temp.ToString(); // should not become Foo().ToString(); + /// var temp = Goo(); + /// temp.ToString(); // should not become Goo().ToString(); /// } /// /// User might want to examine temp in the debugger. @@ -368,7 +368,7 @@ private bool Includes(int val) // it will affect inference of stack behavior // it will also affect when locals can be scheduled to the stack // Example: - // Foo(x, ref x) <-- x cannot be a stack local as it is used in different contexts. + // Goo(x, ref x) <-- x cannot be a stack local as it is used in different contexts. internal enum ExprContext { None, diff --git a/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs b/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs index 9bf0068d22399..ac99d10b9904c 100644 --- a/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs +++ b/src/Compilers/CSharp/Portable/Compilation/CSharpCompilation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Concurrent; @@ -1002,8 +1002,8 @@ private void GetAllUnaliasedModules(ArrayBuilder modules) /// Return a list of assembly symbols than can be accessed without using an alias. /// For example: /// 1) /r:A.dll /r:B.dll -> A, B - /// 2) /r:Foo=A.dll /r:B.dll -> B - /// 3) /r:Foo=A.dll /r:A.dll -> A + /// 2) /r:Goo=A.dll /r:B.dll -> B + /// 3) /r:Goo=A.dll /r:A.dll -> A /// internal void GetUnaliasedReferencedAssemblies(ArrayBuilder assemblies) { diff --git a/src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs b/src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs index f5da50993a98e..179eaa062f13e 100644 --- a/src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs +++ b/src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1874,7 +1874,7 @@ protected CSharpSyntaxNode GetBindableParentNode(CSharpSyntaxNode node) /// and returns it instead of rebinding it. /// /// For example, we might have: - /// while (x > foo()) + /// while (x > goo()) /// { /// y = y * x; /// z = z + y; diff --git a/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.Lowered.cs b/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.Lowered.cs index 733c3f3f9428f..6acbb2abadc41 100644 --- a/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.Lowered.cs +++ b/src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.Lowered.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Diagnostics; @@ -137,12 +137,12 @@ internal override bool SynthesizesLoweredBoundBody /// /// Given a SynthesizedExplicitImplementationMethod (effectively a tuple (interface method, implementing method, implementing type)), - /// construct a BoundBlock body. Consider the tuple (Interface.Foo, Base.Foo, Derived). The generated method will look like: + /// construct a BoundBlock body. Consider the tuple (Interface.Goo, Base.Goo, Derived). The generated method will look like: /// - /// R Interface.Foo<T1, T2, ...>(A1 a1, A2 a2, ...) + /// R Interface.Goo<T1, T2, ...>(A1 a1, A2 a2, ...) /// { /// //don't return the output if the return type is void - /// return this.Foo<T1, T2, ...>(a1, a2, ...); + /// return this.Goo<T1, T2, ...>(a1, a2, ...); /// } /// internal override void GenerateMethodBody(TypeCompilationState compilationState, DiagnosticBag diagnostics) diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs index adeaf9b8085cf..60d831b332cae 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/PreciseAbstractFlowPass.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -2156,7 +2156,7 @@ public override BoundNode VisitMethodGroup(BoundMethodGroup node) { if (node.ReceiverOpt != null) { - // An explicit or implicit receiver, for example in an expression such as (x.Foo is Action, or Foo is Action), is considered to be read. + // An explicit or implicit receiver, for example in an expression such as (x.Goo is Action, or Goo is Action), is considered to be read. VisitRvalue(node.ReceiverOpt); } diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs index 9a9d324ef5606..9a53962bd193c 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Diagnostics; @@ -439,7 +439,7 @@ private ImmutableArray MakeArguments( // // By contrast: // - // Foo(z: this.p, y: this.Q(), x: (object)10) + // Goo(z: this.p, y: this.Q(), x: (object)10) // // The boxing of 10 can be reordered, but the fetch of this.p has to happen before the // call to this.Q() because the call could change the value of this.p. diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs index 316f4ab4bd20f..f8e84fa6adaa0 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Diagnostics; @@ -94,7 +94,7 @@ private BoundExpression VisitCompoundAssignmentOperator(BoundCompoundAssignmentO if (isPossibleEventHandlerOperation) { - // IsEvent("Foo", dyn) ? InvokeMember("{add|remove}_Foo", dyn, RHS) : rewrittenAssignment + // IsEvent("Goo", dyn) ? InvokeMember("{add|remove}_Goo", dyn, RHS) : rewrittenAssignment var memberAccess = (BoundDynamicMemberAccess)transformedLHS; var isEventCondition = _dynamicFactory.MakeDynamicIsEventTest(memberAccess.Name, memberAccess.Receiver); @@ -648,9 +648,9 @@ private BoundExpression SpillArrayElementAccess( /// are not captured. /// /// Example: - /// l += foo(ref l); + /// l += goo(ref l); /// - /// even though l is a local, we must access it via a temp since "foo(ref l)" may change it + /// even though l is a local, we must access it via a temp since "goo(ref l)" may change it /// on between accesses. /// internal static bool CanChangeValueBetweenReads( diff --git a/src/Compilers/CSharp/Portable/Parser/DirectiveParser.cs b/src/Compilers/CSharp/Portable/Parser/DirectiveParser.cs index 30f140822c483..734b6df141d6d 100644 --- a/src/Compilers/CSharp/Portable/Parser/DirectiveParser.cs +++ b/src/Compilers/CSharp/Portable/Parser/DirectiveParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Diagnostics; @@ -258,13 +258,13 @@ private DirectiveTriviaSyntax ParseDefineOrUndefDirective(SyntaxToken hash, Synt /// Resulting span: [first non-whitespace char, EOD) /// /// Examples (pipes indicate span): - /// #error |foo| - /// #error |foo| - /// #error |foo | - /// #error |foo baz| - /// #error |//foo| - /// #error |/*foo*/| - /// #error |/*foo| + /// #error |goo| + /// #error |goo| + /// #error |goo | + /// #error |goo baz| + /// #error |//goo| + /// #error |/*goo*/| + /// #error |/*goo| /// /// The '#' token. /// The 'error' or 'warning' token. diff --git a/src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs b/src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs index b91fd6409ac22..f1b483d65e05b 100644 --- a/src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs +++ b/src/Compilers/CSharp/Portable/Parser/DocumentationCommentParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -68,7 +68,7 @@ public DocumentationCommentTriviaSyntax ParseDocumentationComment(out bool isTer // It's possible that we finish parsing the xml, and we are still left in the middle // of an Xml comment. For example, // - // /// + // /// // ^ // In this case, we stop at the caret. We need to ensure that we consume the remainder // of the doc comment here, since otherwise we will return the lexer to the state diff --git a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs index 958b801b818f3..46a7434540a10 100644 --- a/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs +++ b/src/Compilers/CSharp/Portable/Parser/LanguageParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -751,9 +751,9 @@ private bool IsNamespaceMemberStartOrStop() private bool ScanExternAliasDirective() { // The check also includes the ending semicolon so that we can disambiguate among: - // extern alias foo; - // extern alias foo(); - // extern alias foo { get; } + // extern alias goo; + // extern alias goo(); + // extern alias goo { get; } return this.CurrentToken.Kind == SyntaxKind.ExternKeyword && this.PeekToken(1).Kind == SyntaxKind.IdentifierToken && this.PeekToken(1).ContextualKind == SyntaxKind.AliasKeyword @@ -818,7 +818,7 @@ private UsingDirectiveSyntax ParseUsingDirective() //new directive. e.g. // // using - // namespace Foo { + // namespace Goo { // //... // } // @@ -1276,7 +1276,7 @@ private bool ShouldAsyncBeTreatedAsModifier(bool parsingStatementNotDeclaration) { // We've seen "async TypeName". Now we have to determine if we should we treat // 'async' as a modifier. Or is the user actually writing something like - // "public async Foo" where 'async' is actually the return type. + // "public async Goo" where 'async' is actually the return type. if (IsPossibleMemberName()) { @@ -2449,13 +2449,13 @@ private bool IsFieldDeclaration(bool isEvent) var kind = this.PeekToken(1).Kind; switch (kind) { - case SyntaxKind.DotToken: // Foo. explicit - case SyntaxKind.ColonColonToken: // Foo:: explicit - case SyntaxKind.LessThanToken: // Foo< explicit or generic method - case SyntaxKind.OpenBraceToken: // Foo { property - case SyntaxKind.EqualsGreaterThanToken: // Foo => property + case SyntaxKind.DotToken: // Goo. explicit + case SyntaxKind.ColonColonToken: // Goo:: explicit + case SyntaxKind.LessThanToken: // Goo< explicit or generic method + case SyntaxKind.OpenBraceToken: // Goo { property + case SyntaxKind.EqualsGreaterThanToken: // Goo => property return false; - case SyntaxKind.OpenParenToken: // Foo( method + case SyntaxKind.OpenParenToken: // Goo( method return isEvent; default: return true; @@ -2659,7 +2659,7 @@ private bool IsEndOfTypeParameterList() { if (this.CurrentToken.Kind == SyntaxKind.OpenParenToken) { - // void Foo[][] etc.), or pointer types + // (int, string, etc.), or array types (Goo[], A[][] etc.), or pointer types // of things that must be types (int*, void**, etc.). isDefinitelyTypeArgumentList = DetermineIfDefinitelyTypeArgumentList(isDefinitelyTypeArgumentList); result = ScanTypeFlags.GenericTypeOrMethod; @@ -5708,8 +5708,8 @@ private NameSyntax ParseQualifiedNameRight( } // If the left hand side is not an identifier name then the user has done - // something like Foo.Bar::Blah. We've already made an error node for the - // ::, so just pretend that they typed Foo.Bar.Blah and continue on. + // something like Goo.Bar::Blah. We've already made an error node for the + // ::, so just pretend that they typed Goo.Bar.Blah and continue on. var identifierLeft = left as IdentifierNameSyntax; if (identifierLeft == null) @@ -9971,10 +9971,10 @@ private bool ScanCast() } // If we have any of the following, we know it must be a cast: - // 1) (Foo*)bar; - // 2) (Foo?)bar; + // 1) (Goo*)bar; + // 2) (Goo?)bar; // 3) "(int)bar" or "(int[])bar" - // 4) (G::Foo)bar + // 4) (G::Goo)bar if (type == ScanTypeFlags.PointerOrMultiplication || type == ScanTypeFlags.NullableType || type == ScanTypeFlags.MustBeType || diff --git a/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs index b32b91d07d295..b37399ac74433 100644 --- a/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/ErrorTypeSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Roslyn.Utilities; @@ -12,7 +12,7 @@ namespace Microsoft.CodeAnalysis.CSharp.Symbols { /// /// An ErrorSymbol is used when the compiler cannot determine a symbol object to return because - /// of an error. For example, if a field is declared "Foo x;", and the type "Foo" cannot be + /// of an error. For example, if a field is declared "Goo x;", and the type "Goo" cannot be /// found, an ErrorSymbol is returned when asking the field "x" what it's type is. /// internal abstract partial class ErrorTypeSymbol : NamedTypeSymbol, IErrorTypeSymbol diff --git a/src/Compilers/CSharp/Portable/Symbols/ExtendedErrorTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/ExtendedErrorTypeSymbol.cs index d1cc49a042ef2..aacce9a366c3a 100644 --- a/src/Compilers/CSharp/Portable/Symbols/ExtendedErrorTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/ExtendedErrorTypeSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -200,9 +200,9 @@ internal override ImmutableArray GetDeclaredInterfaces(ConsList /// type slot. /// /// Sometimes we will return the original definition of the intended symbol. For example, if we see - /// ]]> and we have an IFoo with a different arity or accessibility - /// (e.g. ]]> was constructed from an error symbol based on ]]>), - /// then we'll return ]]>, rather than trying to construct a corresponding closed + /// ]]> and we have an IGoo with a different arity or accessibility + /// (e.g. ]]> was constructed from an error symbol based on ]]>), + /// then we'll return ]]>, rather than trying to construct a corresponding closed /// type (which may not be difficult/possible in the case of nested types or mismatched arities). /// /// NOTE: Any non-null type symbol returned is guaranteed not to be an error type. diff --git a/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs index 0d2eb1cac430a..4778813c8cbac 100644 --- a/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/MissingMetadataTypeSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; using System.Threading; @@ -71,7 +71,7 @@ internal override DiagnosticInfo ErrorInfo if (containingAssembly.IsMissing) { - // error CS0012: The type 'Blah' is defined in an assembly that is not referenced. You must add a reference to assembly 'Foo'. + // error CS0012: The type 'Blah' is defined in an assembly that is not referenced. You must add a reference to assembly 'Goo'. return new CSDiagnosticInfo(ErrorCode.ERR_NoTypeDef, this, containingAssembly.Identity); } else diff --git a/src/Compilers/CSharp/Portable/Symbols/NamedTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/NamedTypeSymbol.cs index bee7216bad11e..db7526c764cfd 100644 --- a/src/Compilers/CSharp/Portable/Symbols/NamedTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/NamedTypeSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1126,10 +1126,10 @@ internal override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticIn // problems with constraints. We recurse into type *arguments* in the overload // in ConstructedNamedTypeSymbol. // - // When we are binding a name with a nested type, Foo.Bar, then we ask for - // use-site errors to be reported on both Foo and Foo.Bar. Therefore we should + // When we are binding a name with a nested type, Goo.Bar, then we ask for + // use-site errors to be reported on both Goo and Goo.Bar. Therefore we should // not recurse into the containing type here; doing so will result in errors - // being reported twice if Foo is bad. + // being reported twice if Goo is bad. var @base = this.BaseTypeNoUseSiteDiagnostics; if ((object)@base != null && @base.GetUnificationUseSiteDiagnosticRecursive(ref result, owner, ref checkedTypes)) diff --git a/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs b/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs index 84424a1809c0b..63504d3f64f45 100644 --- a/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs +++ b/src/Compilers/CSharp/Portable/Symbols/OverriddenOrHiddenMembersHelpers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Collections.Immutable; @@ -750,8 +750,8 @@ private static void FindOtherOverriddenMethodsInContainingType(Symbol representa // NOTE: We're actually being more precise than Dev10 - we consider the fact that the runtime will also distinguish // on the basis of return type. For example, consider the following signatures: - // int Foo(ref int x) - // long Foo(out int x) + // int Goo(ref int x) + // long Goo(out int x) // Dev10 will warn that these methods are runtime ambiguous, even though they aren't really (because they are // distinguished by their return types). if (MemberSignatureComparer.RuntimeSignatureComparer.Equals(otherMember, representativeMember)) diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs b/src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs index 47f58523e06c5..8cf2ad71e7cc2 100644 --- a/src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs +++ b/src/Compilers/CSharp/Portable/Symbols/Source/ModifierUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Diagnostics; using Roslyn.Utilities; @@ -275,7 +275,7 @@ internal static Accessibility EffectiveAccessibility(DeclarationModifiers modifi default: // This happens when you have a mix of accessibilities. // - // i.e.: public private void Foo() + // i.e.: public private void Goo() return Accessibility.Public; } } @@ -296,7 +296,7 @@ internal static bool IsValidAccessibility(DeclarationModifiers modifiers) default: // This happens when you have a mix of accessibilities. // - // i.e.: public private void Foo() + // i.e.: public private void Goo() return false; } } diff --git a/src/Compilers/CSharp/Portable/Symbols/SubstitutedMethodSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/SubstitutedMethodSymbol.cs index 6c3b29447322d..1514b33df908f 100644 --- a/src/Compilers/CSharp/Portable/Symbols/SubstitutedMethodSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/SubstitutedMethodSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -382,9 +382,9 @@ private int ComputeHashCode() // may still be considered equal, we do not want to give different hashcode to such types. // // Example: - // Having original method A.Foo() we create two _unconstructed_ methods - // A.Foo - // A.Foo + // Having original method A.Goo() we create two _unconstructed_ methods + // A.Goo + // A.Goo // Note that V' and V" are type parameters substituted via alpha-renaming of original V // These are different objects, but represent the same "type parameter at index 1" // diff --git a/src/Compilers/CSharp/Portable/Symbols/SubstitutedNamedTypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/SubstitutedNamedTypeSymbol.cs index 52d6085552edd..5687c1490fe34 100644 --- a/src/Compilers/CSharp/Portable/Symbols/SubstitutedNamedTypeSymbol.cs +++ b/src/Compilers/CSharp/Portable/Symbols/SubstitutedNamedTypeSymbol.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -29,8 +29,8 @@ internal abstract class SubstitutedNamedTypeSymbol : WrappedNamedTypeSymbol // The container of a substituted named type symbol is typically a named type or a namespace. // However, in some error-recovery scenarios it might be some other container. For example, - // consider "int Foo = 123; Foo x = null;" What is the type of x? We construct an error - // type symbol of arity one associated with local variable symbol Foo; when we construct + // consider "int Goo = 123; Goo x = null;" What is the type of x? We construct an error + // type symbol of arity one associated with local variable symbol Goo; when we construct // that error type symbol with , the resulting substituted named type symbol has // the same containing symbol as the local: it is contained in the method. private readonly Symbol _newContainer; diff --git a/src/Compilers/CSharp/Portable/Symbols/SymbolDistinguisher.cs b/src/Compilers/CSharp/Portable/Symbols/SymbolDistinguisher.cs index bfb99f7869edd..de05f342c9955 100644 --- a/src/Compilers/CSharp/Portable/Symbols/SymbolDistinguisher.cs +++ b/src/Compilers/CSharp/Portable/Symbols/SymbolDistinguisher.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Roslyn.Utilities; @@ -9,7 +9,7 @@ namespace Microsoft.CodeAnalysis.CSharp { /// /// Some error messages are particularly confusing if multiple placeholders are substituted - /// with the same string. For example, "cannot convert from 'Foo' to 'Foo'". Usually, this + /// with the same string. For example, "cannot convert from 'Goo' to 'Goo'". Usually, this /// occurs because there are two types in different contexts with the same qualified name. /// The solution is to provide additional qualification on each symbol - either a source /// location, an assembly path, or an assembly identity. diff --git a/src/Compilers/CSharp/Portable/Syntax/SyntaxEquivalence.cs b/src/Compilers/CSharp/Portable/Syntax/SyntaxEquivalence.cs index 2d3bea0bf3959..203209ae97620 100644 --- a/src/Compilers/CSharp/Portable/Syntax/SyntaxEquivalence.cs +++ b/src/Compilers/CSharp/Portable/Syntax/SyntaxEquivalence.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Diagnostics; @@ -135,7 +135,7 @@ private static bool AreEquivalentRecursive(GreenNode before, GreenNode after, Fu // NOTE(cyrusn): Do we want to avoid going down into attribute expressions? I don't // think we can avoid it as there are likely places in the compiler that use these - // expressions. For example, if the user changes [InternalsVisibleTo("foo")] to + // expressions. For example, if the user changes [InternalsVisibleTo("goo")] to // [InternalsVisibleTo("bar")] then that must count as a top level change as it // affects symbol visibility. Perhaps we could enumerate the places in the compiler // that use the values inside source attributes and we can check if we're in an diff --git a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs index 8c686fdc2fbcb..605fc192ca4bf 100644 --- a/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs +++ b/src/Compilers/CSharp/Test/CommandLine/CommandLineTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -175,7 +175,7 @@ public void ResponseFiles_RelativePaths() var dirX = baseDir.CreateDirectory("x"); var dirAB = baseDir.CreateDirectory("a b"); var dirSubDir = baseDir.CreateDirectory("subdir"); - var dirFoo = parentDir.CreateDirectory("foo"); + var dirGoo = parentDir.CreateDirectory("goo"); var dirBar = parentDir.CreateDirectory("bar"); string basePath = baseDir.Path; @@ -188,7 +188,7 @@ public void ResponseFiles_RelativePaths() /r:..\v4.0.30319\System.dll /r:.\System.Data.dll a.cs @""..\c.rsp"" @\d.rsp -/libpaths:..\foo;../bar;""a b"" +/libpaths:..\goo;../bar;""a b"" " }, { Path.Combine(dirSubDir.Path, @"b.rsp"), @" @@ -216,7 +216,7 @@ a.cs @""..\c.rsp"" @\d.rsp AssertEx.Equal(new[] { "first.cs", "second.cs", "b.cs", "a.cs", "c.cs", "d.cs", "last.cs" }.Select(prependBasePath), resolvedSourceFiles); AssertEx.Equal(new[] { typeof(object).Assembly.Location, @"..\v4.0.30319\System.dll", @".\System.Data.dll" }, references); - AssertEx.Equal(new[] { RuntimeEnvironment.GetRuntimeDirectory() }.Concat(new[] { @"x", @"..\foo", @"../bar", @"a b" }.Select(prependBasePath)), args.ReferencePaths.ToArray()); + AssertEx.Equal(new[] { RuntimeEnvironment.GetRuntimeDirectory() }.Concat(new[] { @"x", @"..\goo", @"../bar", @"a b" }.Select(prependBasePath)), args.ReferencePaths.ToArray()); Assert.Equal(basePath, args.BaseDirectory); } @@ -398,7 +398,7 @@ public void Win32ResourceArguments() args = new string[] { - @"/Win32Res:foo.win32data:bar.win32data2" + @"/Win32Res:goo.win32data:bar.win32data2" }; parsedArgs = DefaultParse(args, _baseDirectory); @@ -409,7 +409,7 @@ public void Win32ResourceArguments() args = new string[] { - @"/Win32icon:foo.win32data:bar.win32data2" + @"/Win32icon:goo.win32data:bar.win32data2" }; parsedArgs = DefaultParse(args, _baseDirectory); @@ -420,7 +420,7 @@ public void Win32ResourceArguments() args = new string[] { - @"/Win32manifest:foo.win32data:bar.win32data2" + @"/Win32manifest:goo.win32data:bar.win32data2" }; parsedArgs = DefaultParse(args, _baseDirectory); @@ -433,11 +433,11 @@ public void Win32ResourceArguments() [Fact] public void Win32ResConflicts() { - var parsedArgs = DefaultParse(new[] { "/win32res:foo", "/win32icon:foob", "a.cs" }, _baseDirectory); + var parsedArgs = DefaultParse(new[] { "/win32res:goo", "/win32icon:goob", "a.cs" }, _baseDirectory); Assert.Equal(1, parsedArgs.Errors.Length); Assert.Equal((int)ErrorCode.ERR_CantHaveWin32ResAndIcon, parsedArgs.Errors.First().Code); - parsedArgs = DefaultParse(new[] { "/win32res:foo", "/win32manifest:foob", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { "/win32res:goo", "/win32manifest:goob", "a.cs" }, _baseDirectory); Assert.Equal(1, parsedArgs.Errors.Length); Assert.Equal((int)ErrorCode.ERR_CantHaveWin32ResAndManifest, parsedArgs.Errors.First().Code); @@ -456,7 +456,7 @@ public void Win32ResConflicts() Assert.Equal((int)ErrorCode.ERR_NoFileSpec, parsedArgs.Errors.First().Code); Assert.Equal(1, parsedArgs.Errors.First().Arguments.Count); - parsedArgs = DefaultParse(new[] { "/win32Manifest:foo", "/noWin32Manifest", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { "/win32Manifest:goo", "/noWin32Manifest", "a.cs" }, _baseDirectory); Assert.Equal(0, parsedArgs.Errors.Length); Assert.True(parsedArgs.NoWin32Manifest); Assert.Equal(null, parsedArgs.Win32Manifest); @@ -531,74 +531,74 @@ public void ParseResources() { var diags = new List(); - ResourceDescription desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar", _baseDirectory, diags, embedded: false); + ResourceDescription desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"someFile.foo.bar", desc.FileName); - Assert.Equal("someFile.foo.bar", desc.ResourceName); + Assert.Equal(@"someFile.goo.bar", desc.FileName); + Assert.Equal("someFile.goo.bar", desc.ResourceName); - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,someName", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,someName", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"someFile.foo.bar", desc.FileName); + Assert.Equal(@"someFile.goo.bar", desc.FileName); Assert.Equal("someName", desc.ResourceName); - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\s""ome Fil""e.foo.bar,someName", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\s""ome Fil""e.goo.bar,someName", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"some File.foo.bar", desc.FileName); + Assert.Equal(@"some File.goo.bar", desc.FileName); Assert.Equal("someName", desc.ResourceName); - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,""some Name"",public", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,""some Name"",public", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"someFile.foo.bar", desc.FileName); + Assert.Equal(@"someFile.goo.bar", desc.FileName); Assert.Equal("some Name", desc.ResourceName); Assert.True(desc.IsPublic); // Use file name in place of missing resource name. - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,,private", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,,private", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"someFile.foo.bar", desc.FileName); - Assert.Equal("someFile.foo.bar", desc.ResourceName); + Assert.Equal(@"someFile.goo.bar", desc.FileName); + Assert.Equal("someFile.goo.bar", desc.ResourceName); Assert.False(desc.IsPublic); // Quoted accessibility is fine. - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,,""private""", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,,""private""", _baseDirectory, diags, embedded: false); Assert.Equal(0, diags.Count); - Assert.Equal(@"someFile.foo.bar", desc.FileName); - Assert.Equal("someFile.foo.bar", desc.ResourceName); + Assert.Equal(@"someFile.goo.bar", desc.FileName); + Assert.Equal("someFile.goo.bar", desc.ResourceName); Assert.False(desc.IsPublic); // Leading commas are not ignored... - desc = CSharpCommandLineParser.ParseResourceDescription("", @",,\somepath\someFile.foo.bar,,private", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @",,\somepath\someFile.goo.bar,,private", _baseDirectory, diags, embedded: false); diags.Verify( - // error CS1906: Invalid option '\somepath\someFile.foo.bar'; Resource visibility must be either 'public' or 'private' - Diagnostic(ErrorCode.ERR_BadResourceVis).WithArguments(@"\somepath\someFile.foo.bar")); + // error CS1906: Invalid option '\somepath\someFile.goo.bar'; Resource visibility must be either 'public' or 'private' + Diagnostic(ErrorCode.ERR_BadResourceVis).WithArguments(@"\somepath\someFile.goo.bar")); diags.Clear(); Assert.Null(desc); // ...even if there's whitespace between them. - desc = CSharpCommandLineParser.ParseResourceDescription("", @", ,\somepath\someFile.foo.bar,,private", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @", ,\somepath\someFile.goo.bar,,private", _baseDirectory, diags, embedded: false); diags.Verify( - // error CS1906: Invalid option '\somepath\someFile.foo.bar'; Resource visibility must be either 'public' or 'private' - Diagnostic(ErrorCode.ERR_BadResourceVis).WithArguments(@"\somepath\someFile.foo.bar")); + // error CS1906: Invalid option '\somepath\someFile.goo.bar'; Resource visibility must be either 'public' or 'private' + Diagnostic(ErrorCode.ERR_BadResourceVis).WithArguments(@"\somepath\someFile.goo.bar")); diags.Clear(); Assert.Null(desc); // Trailing commas are ignored... - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,,private", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,,private", _baseDirectory, diags, embedded: false); diags.Verify(); diags.Clear(); - Assert.Equal("someFile.foo.bar", desc.FileName); - Assert.Equal("someFile.foo.bar", desc.ResourceName); + Assert.Equal("someFile.goo.bar", desc.FileName); + Assert.Equal("someFile.goo.bar", desc.ResourceName); Assert.False(desc.IsPublic); // ...even if there's whitespace between them. - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,,private, ,", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,,private, ,", _baseDirectory, diags, embedded: false); diags.Verify(); diags.Clear(); - Assert.Equal("someFile.foo.bar", desc.FileName); - Assert.Equal("someFile.foo.bar", desc.ResourceName); + Assert.Equal("someFile.goo.bar", desc.FileName); + Assert.Equal("someFile.goo.bar", desc.ResourceName); Assert.False(desc.IsPublic); - desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.foo.bar,someName,publi", _baseDirectory, diags, embedded: false); + desc = CSharpCommandLineParser.ParseResourceDescription("", @"\somepath\someFile.goo.bar,someName,publi", _baseDirectory, diags, embedded: false); diags.Verify(Diagnostic(ErrorCode.ERR_BadResourceVis).WithArguments("publi")); Assert.Null(desc); diags.Clear(); @@ -1172,10 +1172,10 @@ public void ArgumentParsing() Assert.False(parsedArgs.DisplayHelp); Assert.True(parsedArgs.SourceFiles.Any()); - parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new[] { "/define:foo", "c.csx" }, _baseDirectory, s_defaultSdkDirectory); + parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new[] { "/define:goo", "c.csx" }, _baseDirectory, s_defaultSdkDirectory); parsedArgs.Errors.Verify( - // error CS2007: Unrecognized option: '/define:foo' - Diagnostic(ErrorCode.ERR_BadSwitch).WithArguments("/define:foo")); + // error CS2007: Unrecognized option: '/define:goo' + Diagnostic(ErrorCode.ERR_BadSwitch).WithArguments("/define:goo")); Assert.False(parsedArgs.DisplayHelp); Assert.True(parsedArgs.SourceFiles.Any()); @@ -1452,21 +1452,21 @@ public void Define() Assert.Equal(0, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); Assert.False(parsedArgs.Errors.Any()); - parsedArgs = DefaultParse(new[] { "/d:FOO", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { "/d:GOO", "a.cs" }, _baseDirectory); Assert.Equal(1, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); - Assert.Contains("FOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); + Assert.Contains("GOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); Assert.False(parsedArgs.Errors.Any()); - parsedArgs = DefaultParse(new[] { "/d:FOO;BAR,ZIP", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { "/d:GOO;BAR,ZIP", "a.cs" }, _baseDirectory); Assert.Equal(3, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); - Assert.Contains("FOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); + Assert.Contains("GOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); Assert.Contains("BAR", parsedArgs.ParseOptions.PreprocessorSymbolNames); Assert.Contains("ZIP", parsedArgs.ParseOptions.PreprocessorSymbolNames); Assert.False(parsedArgs.Errors.Any()); - parsedArgs = DefaultParse(new[] { "/d:FOO;4X", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { "/d:GOO;4X", "a.cs" }, _baseDirectory); Assert.Equal(1, parsedArgs.ParseOptions.PreprocessorSymbolNames.Count()); - Assert.Contains("FOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); + Assert.Contains("GOO", parsedArgs.ParseOptions.PreprocessorSymbolNames); Assert.Equal(1, parsedArgs.Errors.Length); Assert.Equal((int)ErrorCode.WRN_DefineIdentifierRequired, parsedArgs.Errors.First().Code); Assert.Equal("4X", parsedArgs.Errors.First().Arguments[0]); @@ -2093,51 +2093,51 @@ public void Deterministic() [Fact] public void ParseReferences() { - var parsedArgs = DefaultParse(new string[] { "/r:foo.dll", "a.cs" }, _baseDirectory); + var parsedArgs = DefaultParse(new string[] { "/r:goo.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(2, parsedArgs.MetadataReferences.Length); - parsedArgs = DefaultParse(new string[] { "/r:foo.dll;", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { "/r:goo.dll;", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(2, parsedArgs.MetadataReferences.Length); Assert.Equal(typeof(object).Assembly.Location, parsedArgs.MetadataReferences[0].Reference); Assert.Equal(MetadataReferenceProperties.Assembly, parsedArgs.MetadataReferences[0].Properties); - Assert.Equal("foo.dll", parsedArgs.MetadataReferences[1].Reference); + Assert.Equal("goo.dll", parsedArgs.MetadataReferences[1].Reference); Assert.Equal(MetadataReferenceProperties.Assembly, parsedArgs.MetadataReferences[1].Properties); - parsedArgs = DefaultParse(new string[] { @"/l:foo.dll", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { @"/l:goo.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(2, parsedArgs.MetadataReferences.Length); Assert.Equal(typeof(object).Assembly.Location, parsedArgs.MetadataReferences[0].Reference); Assert.Equal(MetadataReferenceProperties.Assembly, parsedArgs.MetadataReferences[0].Properties); - Assert.Equal("foo.dll", parsedArgs.MetadataReferences[1].Reference); + Assert.Equal("goo.dll", parsedArgs.MetadataReferences[1].Reference); Assert.Equal(MetadataReferenceProperties.Assembly.WithEmbedInteropTypes(true), parsedArgs.MetadataReferences[1].Properties); - parsedArgs = DefaultParse(new string[] { @"/addmodule:foo.dll", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { @"/addmodule:goo.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(2, parsedArgs.MetadataReferences.Length); Assert.Equal(typeof(object).Assembly.Location, parsedArgs.MetadataReferences[0].Reference); Assert.Equal(MetadataReferenceProperties.Assembly, parsedArgs.MetadataReferences[0].Properties); - Assert.Equal("foo.dll", parsedArgs.MetadataReferences[1].Reference); + Assert.Equal("goo.dll", parsedArgs.MetadataReferences[1].Reference); Assert.Equal(MetadataReferenceProperties.Module, parsedArgs.MetadataReferences[1].Properties); - parsedArgs = DefaultParse(new string[] { @"/r:a=foo.dll", "/l:b=bar.dll", "/addmodule:c=mod.dll", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { @"/r:a=goo.dll", "/l:b=bar.dll", "/addmodule:c=mod.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(4, parsedArgs.MetadataReferences.Length); Assert.Equal(typeof(object).Assembly.Location, parsedArgs.MetadataReferences[0].Reference); Assert.Equal(MetadataReferenceProperties.Assembly, parsedArgs.MetadataReferences[0].Properties); - Assert.Equal("foo.dll", parsedArgs.MetadataReferences[1].Reference); + Assert.Equal("goo.dll", parsedArgs.MetadataReferences[1].Reference); Assert.Equal(MetadataReferenceProperties.Assembly.WithAliases(new[] { "a" }), parsedArgs.MetadataReferences[1].Properties); Assert.Equal("bar.dll", parsedArgs.MetadataReferences[2].Reference); @@ -2152,25 +2152,25 @@ public void ParseReferences() [Fact] public void ParseAnalyzers() { - var parsedArgs = DefaultParse(new string[] { @"/a:foo.dll", "a.cs" }, _baseDirectory); + var parsedArgs = DefaultParse(new string[] { @"/a:goo.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(1, parsedArgs.AnalyzerReferences.Length); - Assert.Equal("foo.dll", parsedArgs.AnalyzerReferences[0].FilePath); + Assert.Equal("goo.dll", parsedArgs.AnalyzerReferences[0].FilePath); - parsedArgs = DefaultParse(new string[] { @"/analyzer:foo.dll", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { @"/analyzer:goo.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(1, parsedArgs.AnalyzerReferences.Length); - Assert.Equal("foo.dll", parsedArgs.AnalyzerReferences[0].FilePath); + Assert.Equal("goo.dll", parsedArgs.AnalyzerReferences[0].FilePath); - parsedArgs = DefaultParse(new string[] { "/analyzer:\"foo.dll\"", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { "/analyzer:\"goo.dll\"", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(1, parsedArgs.AnalyzerReferences.Length); - Assert.Equal("foo.dll", parsedArgs.AnalyzerReferences[0].FilePath); + Assert.Equal("goo.dll", parsedArgs.AnalyzerReferences[0].FilePath); - parsedArgs = DefaultParse(new string[] { @"/a:foo.dll;bar.dll", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new string[] { @"/a:goo.dll;bar.dll", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); Assert.Equal(2, parsedArgs.AnalyzerReferences.Length); - Assert.Equal("foo.dll", parsedArgs.AnalyzerReferences[0].FilePath); + Assert.Equal("goo.dll", parsedArgs.AnalyzerReferences[0].FilePath); Assert.Equal("bar.dll", parsedArgs.AnalyzerReferences[1].FilePath); parsedArgs = DefaultParse(new string[] { @"/a:", "a.cs" }, _baseDirectory); @@ -2826,33 +2826,33 @@ class C { public static void Main() { - Foo(0); + Goo(0); #line 10 ""c:\temp\a\1.cs"" - Foo(1); + Goo(1); #line 20 ""C:\a\..\b.cs"" - Foo(2); + Goo(2); #line 30 ""C:\a\../B.cs"" - Foo(3); + Goo(3); #line 40 ""../b.cs"" - Foo(4); + Goo(4); #line 50 ""..\b.cs"" - Foo(5); + Goo(5); #line 60 ""C:\X.cs"" - Foo(6); + Goo(6); #line 70 ""C:\x.cs"" - Foo(7); + Goo(7); #line 90 "" "" - Foo(9); + Goo(9); #line 100 ""C:\*.cs"" - Foo(10); + Goo(10); #line 110 """" - Foo(11); + Goo(11); #line hidden - Foo(12); + Goo(12); #line default - Foo(13); + Goo(13); #line 140 ""***"" - Foo(14); + Goo(14); } } "; @@ -2866,20 +2866,20 @@ public static void Main() // with /fullpaths off string expected = @" -a.cs(8,13): error CS0103: The name 'Foo' does not exist in the current context -c:\temp\a\1.cs(10,13): error CS0103: The name 'Foo' does not exist in the current context -C:\b.cs(20,13): error CS0103: The name 'Foo' does not exist in the current context -C:\B.cs(30,13): error CS0103: The name 'Foo' does not exist in the current context -" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Foo' does not exist in the current context -" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Foo' does not exist in the current context -C:\X.cs(60,13): error CS0103: The name 'Foo' does not exist in the current context -C:\x.cs(70,13): error CS0103: The name 'Foo' does not exist in the current context - (90,7): error CS0103: The name 'Foo' does not exist in the current context -C:\*.cs(100,7): error CS0103: The name 'Foo' does not exist in the current context -(110,7): error CS0103: The name 'Foo' does not exist in the current context -(112,13): error CS0103: The name 'Foo' does not exist in the current context -a.cs(32,13): error CS0103: The name 'Foo' does not exist in the current context -***(140,13): error CS0103: The name 'Foo' does not exist in the current context"; +a.cs(8,13): error CS0103: The name 'Goo' does not exist in the current context +c:\temp\a\1.cs(10,13): error CS0103: The name 'Goo' does not exist in the current context +C:\b.cs(20,13): error CS0103: The name 'Goo' does not exist in the current context +C:\B.cs(30,13): error CS0103: The name 'Goo' does not exist in the current context +" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context +" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context +C:\X.cs(60,13): error CS0103: The name 'Goo' does not exist in the current context +C:\x.cs(70,13): error CS0103: The name 'Goo' does not exist in the current context + (90,7): error CS0103: The name 'Goo' does not exist in the current context +C:\*.cs(100,7): error CS0103: The name 'Goo' does not exist in the current context +(110,7): error CS0103: The name 'Goo' does not exist in the current context +(112,13): error CS0103: The name 'Goo' does not exist in the current context +a.cs(32,13): error CS0103: The name 'Goo' does not exist in the current context +***(140,13): error CS0103: The name 'Goo' does not exist in the current context"; AssertEx.Equal( expected.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), @@ -2893,20 +2893,20 @@ public static void Main() Assert.Equal(1, exitCode); expected = @" -" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Foo' does not exist in the current context -c:\temp\a\1.cs(10,13): error CS0103: The name 'Foo' does not exist in the current context -C:\b.cs(20,13): error CS0103: The name 'Foo' does not exist in the current context -C:\B.cs(30,13): error CS0103: The name 'Foo' does not exist in the current context -" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Foo' does not exist in the current context -" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Foo' does not exist in the current context -C:\X.cs(60,13): error CS0103: The name 'Foo' does not exist in the current context -C:\x.cs(70,13): error CS0103: The name 'Foo' does not exist in the current context - (90,7): error CS0103: The name 'Foo' does not exist in the current context -C:\*.cs(100,7): error CS0103: The name 'Foo' does not exist in the current context -(110,7): error CS0103: The name 'Foo' does not exist in the current context -(112,13): error CS0103: The name 'Foo' does not exist in the current context -" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Foo' does not exist in the current context -***(140,13): error CS0103: The name 'Foo' does not exist in the current context"; +" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context +c:\temp\a\1.cs(10,13): error CS0103: The name 'Goo' does not exist in the current context +C:\b.cs(20,13): error CS0103: The name 'Goo' does not exist in the current context +C:\B.cs(30,13): error CS0103: The name 'Goo' does not exist in the current context +" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context +" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context +C:\X.cs(60,13): error CS0103: The name 'Goo' does not exist in the current context +C:\x.cs(70,13): error CS0103: The name 'Goo' does not exist in the current context + (90,7): error CS0103: The name 'Goo' does not exist in the current context +C:\*.cs(100,7): error CS0103: The name 'Goo' does not exist in the current context +(110,7): error CS0103: The name 'Goo' does not exist in the current context +(112,13): error CS0103: The name 'Goo' does not exist in the current context +" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context +***(140,13): error CS0103: The name 'Goo' does not exist in the current context"; AssertEx.Equal( expected.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries), @@ -3592,22 +3592,22 @@ public void ParseErrorLogAndOut() [Fact] public void ModuleAssemblyName() { - var parsedArgs = DefaultParse(new[] { @"/target:module", "/moduleassemblyname:foo", "a.cs" }, _baseDirectory); + var parsedArgs = DefaultParse(new[] { @"/target:module", "/moduleassemblyname:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); - Assert.Equal("foo", parsedArgs.CompilationName); + Assert.Equal("goo", parsedArgs.CompilationName); Assert.Equal("a.netmodule", parsedArgs.CompilationOptions.ModuleName); - parsedArgs = DefaultParse(new[] { @"/target:library", "/moduleassemblyname:foo", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { @"/target:library", "/moduleassemblyname:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify( // error CS0734: The /moduleassemblyname option may only be specified when building a target type of 'module' Diagnostic(ErrorCode.ERR_AssemblyNameOnNonModule)); - parsedArgs = DefaultParse(new[] { @"/target:exe", "/moduleassemblyname:foo", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { @"/target:exe", "/moduleassemblyname:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify( // error CS0734: The /moduleassemblyname option may only be specified when building a target type of 'module' Diagnostic(ErrorCode.ERR_AssemblyNameOnNonModule)); - parsedArgs = DefaultParse(new[] { @"/target:winexe", "/moduleassemblyname:foo", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { @"/target:winexe", "/moduleassemblyname:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify( // error CS0734: The /moduleassemblyname option may only be specified when building a target type of 'module' Diagnostic(ErrorCode.ERR_AssemblyNameOnNonModule)); @@ -3616,9 +3616,9 @@ public void ModuleAssemblyName() [Fact] public void ModuleName() { - var parsedArgs = DefaultParse(new[] { @"/target:module", "/modulename:foo", "a.cs" }, _baseDirectory); + var parsedArgs = DefaultParse(new[] { @"/target:module", "/modulename:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); - Assert.Equal("foo", parsedArgs.CompilationOptions.ModuleName); + Assert.Equal("goo", parsedArgs.CompilationOptions.ModuleName); parsedArgs = DefaultParse(new[] { @"/target:library", "/modulename:bar", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); @@ -3628,9 +3628,9 @@ public void ModuleName() parsedArgs.Errors.Verify(); Assert.Equal("CommonLanguageRuntimeLibrary", parsedArgs.CompilationOptions.ModuleName); - parsedArgs = DefaultParse(new[] { @"/target:winexe", "/modulename:foo", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { @"/target:winexe", "/modulename:goo", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); - Assert.Equal("foo", parsedArgs.CompilationOptions.ModuleName); + Assert.Equal("goo", parsedArgs.CompilationOptions.ModuleName); parsedArgs = DefaultParse(new[] { @"/target:exe", "/modulename:", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify( @@ -3998,17 +3998,17 @@ public void Usings() { CSharpCommandLineArguments parsedArgs; - parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Foo.Bar" }, _baseDirectory, s_defaultSdkDirectory); + parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Goo.Bar" }, _baseDirectory, s_defaultSdkDirectory); parsedArgs.Errors.Verify(); - AssertEx.Equal(new[] { "Foo.Bar" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); + AssertEx.Equal(new[] { "Goo.Bar" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); - parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Foo.Bar;Baz", "/using:System.Core;System" }, _baseDirectory, s_defaultSdkDirectory); + parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Goo.Bar;Baz", "/using:System.Core;System" }, _baseDirectory, s_defaultSdkDirectory); parsedArgs.Errors.Verify(); - AssertEx.Equal(new[] { "Foo.Bar", "Baz", "System.Core", "System" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); + AssertEx.Equal(new[] { "Goo.Bar", "Baz", "System.Core", "System" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); - parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Foo;;Bar" }, _baseDirectory, s_defaultSdkDirectory); + parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:Goo;;Bar" }, _baseDirectory, s_defaultSdkDirectory); parsedArgs.Errors.Verify(); - AssertEx.Equal(new[] { "Foo", "Bar" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); + AssertEx.Equal(new[] { "Goo", "Bar" }, parsedArgs.CompilationOptions.Usings.AsEnumerable()); parsedArgs = CSharpCommandLineParser.ScriptRunner.Parse(new string[] { "/u:" }, _baseDirectory, s_defaultSdkDirectory); parsedArgs.Errors.Verify( @@ -4747,10 +4747,10 @@ public void KeyContainerAndKeyFile() Assert.Null(parsedArgs.CompilationOptions.CryptoKeyContainer); // KEYFILE - parsedArgs = DefaultParse(new[] { @"/keyfile:\somepath\s""ome Fil""e.foo.bar", "a.cs" }, _baseDirectory); + parsedArgs = DefaultParse(new[] { @"/keyfile:\somepath\s""ome Fil""e.goo.bar", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify(); //EDMAURER let's not set the option in the event that there was an error. - //Assert.Equal(@"\somepath\some File.foo.bar", parsedArgs.CompilationOptions.CryptoKeyFile); + //Assert.Equal(@"\somepath\some File.goo.bar", parsedArgs.CompilationOptions.CryptoKeyFile); parsedArgs = DefaultParse(new[] { "/keyFile", "a.cs" }, _baseDirectory); parsedArgs.Errors.Verify( @@ -5100,10 +5100,10 @@ public void ResponseFileSplitting() // Quoting inside argument is valid. responseFile = new string[] { - @" /o:""foo.cs"" /o:""abc def""\baz ""/o:baz bar""bing", + @" /o:""goo.cs"" /o:""abc def""\baz ""/o:baz bar""bing", }; args = CSharpCommandLineParser.ParseResponseLines(responseFile); - AssertEx.Equal(new[] { @"/o:""foo.cs""", @"/o:""abc def""\baz", @"""/o:baz bar""bing" }, args); + AssertEx.Equal(new[] { @"/o:""goo.cs""", @"/o:""abc def""\baz", @"""/o:baz bar""bing" }, args); } [ConditionalFact(typeof(WindowsOnly))] @@ -7016,11 +7016,11 @@ static void Main() { } var fileName = Path.GetFileName(source); var outWriter = new StringWriter(CultureInfo.InvariantCulture); - int exitCode = new MockCSharpCompiler(null, _baseDirectory, new[] { "/nologo", "/target:library", "/out:foo.dll", "/nowarn:2008" }).Run(outWriter); + int exitCode = new MockCSharpCompiler(null, _baseDirectory, new[] { "/nologo", "/target:library", "/out:goo.dll", "/nowarn:2008" }).Run(outWriter); Assert.Equal(0, exitCode); Assert.Equal("", outWriter.ToString().Trim()); - System.IO.File.Delete(System.IO.Path.Combine(baseDir, "foo.dll")); + System.IO.File.Delete(System.IO.Path.Combine(baseDir, "goo.dll")); CleanupAllGeneratedFiles(source); } @@ -7721,14 +7721,14 @@ private static void TestCS2002(string[] commandLineArgs, string baseDirectory, i [Fact] public void ErrorLineEnd() { - var tree = SyntaxFactory.ParseSyntaxTree("class C public { }", path: "foo"); + var tree = SyntaxFactory.ParseSyntaxTree("class C public { }", path: "goo"); var comp = new MockCSharpCompiler(null, _baseDirectory, new[] { "/errorendlocation" }); var loc = new SourceLocation(tree.GetCompilationUnitRoot().FindToken(6)); var diag = new CSDiagnostic(new DiagnosticInfo(MessageProvider.Instance, (int)ErrorCode.ERR_MetadataNameTooLong), loc); var text = comp.DiagnosticFormatter.Format(diag); - string stringStart = "foo(1,7,1,8)"; + string stringStart = "goo(1,7,1,8)"; Assert.Equal(stringStart, text.Substring(0, stringStart.Length)); } @@ -7852,12 +7852,12 @@ public void ErrorPathsFromLineDirectives() Assert.True(text.StartsWith(".>", StringComparison.Ordinal)); sampleProgram = @" -#line 10 ""http://foo.bar/baz.aspx"" //URI +#line 10 ""http://goo.bar/baz.aspx"" //URI using System* "; syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "filename.cs"); text = comp.DiagnosticFormatter.Format(syntaxTree.GetDiagnostics().First()); - Assert.True(text.StartsWith("http://foo.bar/baz.aspx", StringComparison.Ordinal)); + Assert.True(text.StartsWith("http://goo.bar/baz.aspx", StringComparison.Ordinal)); } [WorkItem(1119609, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1119609")] diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests.cs index f95e768cb194a..71456bb2b591e 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -110,11 +110,11 @@ public static void Main() {} public class Derived: Base { internal const string Str = ""temp""; - public override int Foo { get { return 1; } } + public override int Goo { get { return 1; } } } public class Base { - public virtual int Foo { get { return 0; } } + public virtual int Goo { get { return 0; } } } "; CompileAndVerify(source); @@ -221,8 +221,8 @@ public void TestAttributesOnClassWithConstantDefinedInClass() { var compilation = CreateStandardCompilation(@" using System; -[Attr(Foo.p)] -class Foo +[Attr(Goo.p)] +class Goo { private const object p = null; } @@ -235,7 +235,7 @@ class C public static void Main() { } } "); - var attrs = compilation.SourceModule.GlobalNamespace.GetMember("Foo").GetAttributes(); + var attrs = compilation.SourceModule.GlobalNamespace.GetMember("Goo").GetAttributes(); Assert.Equal(1, attrs.Length); attrs.First().VerifyValue(0, TypedConstantKind.Primitive, null); } @@ -940,7 +940,7 @@ public void TestAttributesOnEnumField() // [module: AttrName(TypeField = typeof(System.IO.FileStream))] namespace AttributeTest { - class Foo + class Goo { public class NestedClass { @@ -981,7 +981,7 @@ enum NestedEnum attrs[1].VerifyNamedArgumentValue(0, "UShortField", TypedConstantKind.Primitive, 1234); var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var top = (NamedTypeSymbol)ns.GetMember("Foo"); + var top = (NamedTypeSymbol)ns.GetMember("Goo"); var type = top.GetMember("NestedClass"); var field = type.GetMember("Field"); @@ -1029,7 +1029,7 @@ public void TestAttributesOnDelegate() namespace AttributeTest { - public class Foo + public class Goo { [AllInheritMultiple(new object[] { 0, """", null }, 255, -127 - 1, AryProp = new object[] { new object[] { """", typeof(IList) } })] public delegate void NestedSubDele([AllInheritMultiple()]string p1, [Derived(typeof(string[, ,]))]string p2); @@ -1045,7 +1045,7 @@ public class Foo Action attributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("Foo"); + var type = (NamedTypeSymbol)ns.GetMember("Goo"); var dele = (NamedTypeSymbol)type.GetTypeMember("NestedSubDele"); var attrs = dele.GetAttributes(); @@ -1072,7 +1072,7 @@ public void TestAttributesUseBaseAttributeField() using System; namespace AttributeTest { - public interface IFoo + public interface IGoo { [CustomAttribute.Derived(new object[] { 1, null, ""Hi"" }, ObjectField = 2)] int F(int p); @@ -1087,7 +1087,7 @@ public interface IFoo Action attributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("IFoo"); + var type = (NamedTypeSymbol)ns.GetMember("IGoo"); var attrs = type.GetMember("F").GetAttributes(); Assert.Equal(@"CustomAttribute.DerivedAttribute({1, null, ""Hi""}, ObjectField = 2)", attrs.First().ToString()); @@ -1308,7 +1308,7 @@ public void TestAttributesWithParamArrayInCtor01() namespace AttributeTest { [AllInheritMultiple(new char[] { ' '}, """")] - public interface IFoo + public interface IGoo { } } @@ -1321,7 +1321,7 @@ public interface IFoo Action sourceAttributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("IFoo"); + var type = (NamedTypeSymbol)ns.GetMember("IGoo"); var attrs = type.GetAttributes(); attrs.First().VerifyValue(0, TypedConstantKind.Array, new char[] { ' ' }); attrs.First().VerifyValue(1, TypedConstantKind.Array, new string[] { "" }); @@ -1332,7 +1332,7 @@ public interface IFoo Action mdAttributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("IFoo"); + var type = (NamedTypeSymbol)ns.GetMember("IGoo"); var attrs = type.GetAttributes(); attrs.First().VerifyValue(0, TypedConstantKind.Array, new char[] { ' ' }); attrs.First().VerifyValue(1, TypedConstantKind.Array, new string[] { "" }); @@ -1445,7 +1445,7 @@ public void TestAttributesWithParamArrayInCtor3() namespace AttributeTest { [AllInheritMultiple(new char[] { ' ' }, new string[] { ""whatever"" })] - public interface IFoo + public interface IGoo { } } @@ -1458,7 +1458,7 @@ public interface IFoo Action sourceAttributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("IFoo"); + var type = (NamedTypeSymbol)ns.GetMember("IGoo"); var attrs = type.GetAttributes(); attrs.First().VerifyValue(0, TypedConstantKind.Array, new char[] { ' ' }); attrs.First().VerifyValue(1, TypedConstantKind.Array, new string[] { "whatever" }); @@ -1469,7 +1469,7 @@ public interface IFoo Action mdAttributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("IFoo"); + var type = (NamedTypeSymbol)ns.GetMember("IGoo"); var attrs = type.GetAttributes(); attrs.First().VerifyValue(0, TypedConstantKind.Array, new char[] { ' ' }); attrs.First().VerifyValue(1, TypedConstantKind.Array, new string[] { "whatever" }); @@ -1625,7 +1625,7 @@ public void TestAttributesOnReturnType() namespace AttributeTest { - public class Foo + public class Goo { int p; public int Property @@ -1657,7 +1657,7 @@ public static void Main() {} Action attributeValidator = (ModuleSymbol m) => { var ns = (NamespaceSymbol)m.GlobalNamespace.GetMember("AttributeTest"); - var type = (NamedTypeSymbol)ns.GetMember("Foo"); + var type = (NamedTypeSymbol)ns.GetMember("Goo"); var property = (PropertySymbol)type.GetMember("Property"); var getter = property.GetMethod; @@ -2504,19 +2504,19 @@ public void AttributeArgumentAsEnumFromMetadata() var ref1 = MetadataReference.CreateFromStream(metadataStream1); - var metadataStream2 = CSharpCompilation.Create("foo.dll", references: new[] { MscorlibRef, ref1 }, + var metadataStream2 = CSharpCompilation.Create("goo.dll", references: new[] { MscorlibRef, ref1 }, syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree( "public class Ca : System.Attribute { public Ca(object o) { } } " + "[Ca(Bar.Baz)]" + - "public class Foo { }") }).EmitToStream(options: new EmitOptions(metadataOnly: true)); + "public class Goo { }") }).EmitToStream(options: new EmitOptions(metadataOnly: true)); var ref2 = MetadataReference.CreateFromStream(metadataStream2); var compilation = CSharpCompilation.Create("moo.dll", references: new[] { MscorlibRef, ref1, ref2 }); - var foo = compilation.GetTypeByMetadataName("Foo"); - var ca = foo.GetAttributes().First().CommonConstructorArguments.First(); + var goo = compilation.GetTypeByMetadataName("Goo"); + var ca = goo.GetAttributes().First().CommonConstructorArguments.First(); Assert.Equal("Bar", ca.Type.Name); } @@ -2626,12 +2626,12 @@ class A : Attribute { } partial class Program { [A] - static partial void Foo(); - static partial void Foo() { } + static partial void Goo(); + static partial void Goo() { } static void Main() { - Console.WriteLine(((Action) Foo).Method.GetCustomAttributesData().Count); + Console.WriteLine(((Action) Goo).Method.GetCustomAttributesData().Count); } } "; @@ -2654,7 +2654,7 @@ partial class Program { [A1] [return: B1] - static partial void Foo<[C1] T, [D1] U>([E1]int x); + static partial void Goo<[C1] T, [D1] U>([E1]int x); } "; @@ -2672,7 +2672,7 @@ partial class Program { [A2] [return: B2] - static partial void Foo<[C2] U, [D2] T>([E2]int y) { } + static partial void Goo<[C2] U, [D2] T>([E2]int y) { } static void Main() {} @@ -2684,16 +2684,16 @@ static void Main() Action attributeValidator = (ModuleSymbol m) => { var programClass = m.GlobalNamespace.GetTypeMember("Program"); - var fooMethod = (MethodSymbol)programClass.GetMember("Foo"); + var gooMethod = (MethodSymbol)programClass.GetMember("Goo"); - TestAttributeOnPartialMethodHelper(m, fooMethod); + TestAttributeOnPartialMethodHelper(m, gooMethod); }; // Verify attributes from source and then load metadata to see attributes are written correctly. CompileAndVerify(compilation, sourceSymbolValidator: attributeValidator, symbolValidator: null, expectedOutput: ""); } - private void TestAttributeOnPartialMethodHelper(ModuleSymbol m, MethodSymbol fooMethod) + private void TestAttributeOnPartialMethodHelper(ModuleSymbol m, MethodSymbol gooMethod) { var a1Class = m.GlobalNamespace.GetTypeMember("A1"); var a2Class = m.GlobalNamespace.GetTypeMember("A2"); @@ -2706,21 +2706,21 @@ private void TestAttributeOnPartialMethodHelper(ModuleSymbol m, MethodSymbol foo var e1Class = m.GlobalNamespace.GetTypeMember("E1"); var e2Class = m.GlobalNamespace.GetTypeMember("E2"); - Assert.Equal(1, fooMethod.GetAttributes(a1Class).Count()); - Assert.Equal(1, fooMethod.GetAttributes(a2Class).Count()); + Assert.Equal(1, gooMethod.GetAttributes(a1Class).Count()); + Assert.Equal(1, gooMethod.GetAttributes(a2Class).Count()); - Assert.Equal(1, fooMethod.GetReturnTypeAttributes().Where(a => a.AttributeClass == b1Class).Count()); - Assert.Equal(1, fooMethod.GetReturnTypeAttributes().Where(a => a.AttributeClass == b2Class).Count()); + Assert.Equal(1, gooMethod.GetReturnTypeAttributes().Where(a => a.AttributeClass == b1Class).Count()); + Assert.Equal(1, gooMethod.GetReturnTypeAttributes().Where(a => a.AttributeClass == b2Class).Count()); - var typeParam1 = fooMethod.TypeParameters[0]; + var typeParam1 = gooMethod.TypeParameters[0]; Assert.Equal(1, typeParam1.GetAttributes(c1Class).Count()); Assert.Equal(1, typeParam1.GetAttributes(c2Class).Count()); - var typeParam2 = fooMethod.TypeParameters[1]; + var typeParam2 = gooMethod.TypeParameters[1]; Assert.Equal(1, typeParam2.GetAttributes(d1Class).Count()); Assert.Equal(1, typeParam2.GetAttributes(d2Class).Count()); - var param = fooMethod.Parameters[0]; + var param = gooMethod.Parameters[0]; Assert.Equal(1, param.GetAttributes(e1Class).Count()); Assert.Equal(1, param.GetAttributes(e2Class).Count()); } @@ -3601,7 +3601,7 @@ static class AttributeMod { [Derived('Q')] [Derived('C')] - public class Foo + public class Goo { } [BaseAttribute(1)] @@ -3871,7 +3871,7 @@ public void AttributeUsageIsNull() using System; [AttributeUsage(null)] public class Att1 : Attribute { } -public class Foo +public class Goo @@ -3893,20 +3893,20 @@ public static void Main() public void AttributeContainsGeneric() { string source = @" -[Foo] +[Goo] class G { } -class Foo +class Goo { } "; var compilation = CreateStandardCompilation(source); compilation.VerifyDiagnostics( - // (2,2): error CS0404: Cannot apply attribute class 'Foo' because it is generic - // [Foo] - Diagnostic(ErrorCode.ERR_AttributeCantBeGeneric, "Foo").WithArguments("Foo").WithLocation(2, 2)); + // (2,2): error CS0404: Cannot apply attribute class 'Goo' because it is generic + // [Goo] + Diagnostic(ErrorCode.ERR_AttributeCantBeGeneric, "Goo").WithArguments("Goo").WithLocation(2, 2)); } /// @@ -3921,7 +3921,7 @@ public void CS1502ERR_NullAttributeUsageArgument() [AttributeUsage(null)] public class Attr : Attribute { } -public class Foo +public class Goo { public static void Main() { @@ -3944,11 +3944,11 @@ public static void Main() public void CS0404ERR_GenericAttributeError() { string source = @" -[Foo] +[Goo] class G { } -class Foo +class Goo { } "; @@ -3956,9 +3956,9 @@ class Foo var compilation = CreateStandardCompilation(source); compilation.VerifyDiagnostics( - // (2,2): error CS0404: Cannot apply attribute class 'Foo' because it is generic - // [Foo] - Diagnostic(ErrorCode.ERR_AttributeCantBeGeneric, "Foo").WithArguments("Foo").WithLocation(2, 2)); + // (2,2): error CS0404: Cannot apply attribute class 'Goo' because it is generic + // [Goo] + Diagnostic(ErrorCode.ERR_AttributeCantBeGeneric, "Goo").WithArguments("Goo").WithLocation(2, 2)); } [WorkItem(541423, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541423")] @@ -5167,11 +5167,11 @@ partial class C { [return: B] [A] - static partial void Foo(); + static partial void Goo(); [return: B] [A] - static partial void Foo() { } + static partial void Goo() { } } "; CSharpCompilationOptions opt = TestOptions.ReleaseDll; @@ -5194,26 +5194,26 @@ class A : System.Attribute { } partial class C { - static partial void Foo<[A] T>(); - static partial void Foo<[A] T>() { } + static partial void Goo<[A] T>(); + static partial void Goo<[A] T>() { } // partial method without implementation, but another method with same name - static partial void Foo2<[A] T>(); - static void Foo2<[A] T>() { } + static partial void Goo2<[A] T>(); + static void Goo2<[A] T>() { } // partial method without implementation, but another member with same name - static partial void Foo3<[A] T>(); - private int Foo3; + static partial void Goo3<[A] T>(); + private int Goo3; // partial method without implementation - static partial void Foo4<[A][A] T>(); + static partial void Goo4<[A][A] T>(); // partial methods differing by signature - static partial void Foo5<[A] T>(int x); - static partial void Foo5<[A] T>(); + static partial void Goo5<[A] T>(int x); + static partial void Goo5<[A] T>(); // partial method without defining declaration - static partial void Foo6<[A][A] T>() { } + static partial void Goo6<[A][A] T>() { } } "; @@ -5221,27 +5221,27 @@ static partial void Foo6<[A][A] T>() { } var compilation = CreateStandardCompilation(source, null, options: opt); compilation.VerifyDiagnostics( - // (25,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Foo6()' - // static partial void Foo6<[A][A] T>() { } - Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Foo6").WithArguments("C.Foo6()").WithLocation(25, 25), - // (11,17): error CS0111: Type 'C' already defines a member called 'Foo2' with the same parameter types - // static void Foo2<[A] T>() { } - Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Foo2").WithArguments("Foo2", "C").WithLocation(11, 17), - // (15,17): error CS0102: The type 'C' already contains a definition for 'Foo3' - // private int Foo3; - Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "Foo3").WithArguments("C", "Foo3").WithLocation(15, 17), + // (25,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Goo6()' + // static partial void Goo6<[A][A] T>() { } + Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Goo6").WithArguments("C.Goo6()").WithLocation(25, 25), + // (11,17): error CS0111: Type 'C' already defines a member called 'Goo2' with the same parameter types + // static void Goo2<[A] T>() { } + Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Goo2").WithArguments("Goo2", "C").WithLocation(11, 17), + // (15,17): error CS0102: The type 'C' already contains a definition for 'Goo3' + // private int Goo3; + Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "Goo3").WithArguments("C", "Goo3").WithLocation(15, 17), // (18,34): error CS0579: Duplicate 'A' attribute - // static partial void Foo4<[A][A] T>(); + // static partial void Goo4<[A][A] T>(); Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(18, 34), // (25,34): error CS0579: Duplicate 'A' attribute - // static partial void Foo6<[A][A] T>() { } + // static partial void Goo6<[A][A] T>() { } Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(25, 34), // (7,30): error CS0579: Duplicate 'A' attribute - // static partial void Foo<[A] T>() { } + // static partial void Goo<[A] T>() { } Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(7, 30), - // (15,17): warning CS0169: The field 'C.Foo3' is never used - // private int Foo3; - Diagnostic(ErrorCode.WRN_UnreferencedField, "Foo3").WithArguments("C.Foo3").WithLocation(15, 17)); + // (15,17): warning CS0169: The field 'C.Goo3' is never used + // private int Goo3; + Diagnostic(ErrorCode.WRN_UnreferencedField, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17)); } [WorkItem(542625, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542625")] @@ -5253,26 +5253,26 @@ class A : System.Attribute { } partial class C { - static partial void Foo([param: A]int y); - static partial void Foo([A] int y) { } + static partial void Goo([param: A]int y); + static partial void Goo([A] int y) { } // partial method without implementation, but another method with same name - static partial void Foo2([A] int y); - static void Foo2([A] int y) { } + static partial void Goo2([A] int y); + static void Goo2([A] int y) { } // partial method without implementation, but another member with same name - static partial void Foo3([A] int y); - private int Foo3; + static partial void Goo3([A] int y); + private int Goo3; // partial method without implementation - static partial void Foo4([A][param: A] int y); + static partial void Goo4([A][param: A] int y); // partial methods differing by signature - static partial void Foo5([A] int y); - static partial void Foo5([A] int y, int z); + static partial void Goo5([A] int y); + static partial void Goo5([A] int y, int z); // partial method without defining declaration - static partial void Foo6([A][A] int y) { } + static partial void Goo6([A][A] int y) { } } "; CSharpCompilationOptions opt = TestOptions.ReleaseDll; @@ -5280,27 +5280,27 @@ static partial void Foo6([A][A] int y) { } var compilation = CreateStandardCompilation(source, null, options: opt); compilation.VerifyDiagnostics( - // (25,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Foo6(int)' - // static partial void Foo6([A][A] int y) { } - Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Foo6").WithArguments("C.Foo6(int)").WithLocation(25, 25), - // (11,17): error CS0111: Type 'C' already defines a member called 'Foo2' with the same parameter types - // static void Foo2([A] int y) { } - Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Foo2").WithArguments("Foo2", "C").WithLocation(11, 17), - // (15,17): error CS0102: The type 'C' already contains a definition for 'Foo3' - // private int Foo3; - Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "Foo3").WithArguments("C", "Foo3").WithLocation(15, 17), + // (25,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Goo6(int)' + // static partial void Goo6([A][A] int y) { } + Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Goo6").WithArguments("C.Goo6(int)").WithLocation(25, 25), + // (11,17): error CS0111: Type 'C' already defines a member called 'Goo2' with the same parameter types + // static void Goo2([A] int y) { } + Diagnostic(ErrorCode.ERR_MemberAlreadyExists, "Goo2").WithArguments("Goo2", "C").WithLocation(11, 17), + // (15,17): error CS0102: The type 'C' already contains a definition for 'Goo3' + // private int Goo3; + Diagnostic(ErrorCode.ERR_DuplicateNameInClass, "Goo3").WithArguments("C", "Goo3").WithLocation(15, 17), // (18,41): error CS0579: Duplicate 'A' attribute - // static partial void Foo4([A][param: A] int y); + // static partial void Goo4([A][param: A] int y); Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(18, 41), // (25,34): error CS0579: Duplicate 'A' attribute - // static partial void Foo6([A][A] int y) { } + // static partial void Goo6([A][A] int y) { } Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(25, 34), // (6,37): error CS0579: Duplicate 'A' attribute - // static partial void Foo([param: A]int y); + // static partial void Goo([param: A]int y); Diagnostic(ErrorCode.ERR_DuplicateAttribute, "A").WithArguments("A").WithLocation(6, 37), - // (15,17): warning CS0169: The field 'C.Foo3' is never used - // private int Foo3; - Diagnostic(ErrorCode.WRN_UnreferencedField, "Foo3").WithArguments("C.Foo3").WithLocation(15, 17)); + // (15,17): warning CS0169: The field 'C.Goo3' is never used + // private int Goo3; + Diagnostic(ErrorCode.WRN_UnreferencedField, "Goo3").WithArguments("C.Goo3").WithLocation(15, 17)); } [Fact] @@ -5343,17 +5343,17 @@ public void FalseDuplicateOnPartial() class A : Attribute { } partial class Program { - static partial void Foo(int x); + static partial void Goo(int x); [A] - static partial void Foo(int x) { } + static partial void Goo(int x) { } - static partial void Foo(); + static partial void Goo(); [A] - static partial void Foo() { } + static partial void Goo() { } static void Main() { - Console.WriteLine(((Action) Foo).Method.GetCustomAttributesData().Count); + Console.WriteLine(((Action) Goo).Method.GetCustomAttributesData().Count); } } "; @@ -5370,8 +5370,8 @@ class A : System.Attribute { } partial class C { - static partial void Foo(); - static partial void Foo<[A]>() { } + static partial void Goo(); + static partial void Goo<[A]>() { } }"; CSharpCompilationOptions opt = TestOptions.ReleaseDll; @@ -5379,11 +5379,11 @@ static partial void Foo<[A]>() { } compilation.VerifyDiagnostics( // (7,32): error CS1001: Identifier expected - // static partial void Foo<[A]>() { } + // static partial void Goo<[A]>() { } Diagnostic(ErrorCode.ERR_IdentifierExpected, ">"), - // (7,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Foo<>()' - // static partial void Foo<[A]>() { } - Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Foo").WithArguments("C.Foo<>()")); + // (7,25): error CS0759: No defining declaration found for implementing declaration of partial method 'C.Goo<>()' + // static partial void Goo<[A]>() { } + Diagnostic(ErrorCode.ERR_PartialMethodMustHaveLatent, "Goo").WithArguments("C.Goo<>()")); } [WorkItem(542909, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542909")] @@ -5775,13 +5775,13 @@ public void LambdaInAttributeArg2() using System; [AttributeUsage(AttributeTargets.All)] -public class Foo : Attribute +public class Goo : Attribute { - public Foo(int sName) { } + public Goo(int sName) { } } public class Class1 { - [field: Foo(((System.Func)(() => 5))())] + [field: Goo(((System.Func)(() => 5))())] public event EventHandler Click; public static void Main() @@ -5792,7 +5792,7 @@ public static void Main() CreateStandardCompilation(source).VerifyDiagnostics( // (11,17): error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type - // [field: Foo(((System.Func)(() => 5))())] + // [field: Goo(((System.Func)(() => 5))())] Diagnostic(ErrorCode.ERR_BadAttributeArgument, "((System.Func)(() => 5))()"), // (12,31): warning CS0067: The event 'Class1.Click' is never used // public event EventHandler Click; @@ -5887,7 +5887,7 @@ public class MyAttribute2 : Attribute public class Test { - public void foo([MyAttribute2(Types = new Type[ + public void goo([MyAttribute2(Types = new Type[ "; var compilation = CreateStandardCompilation(source); @@ -6034,9 +6034,9 @@ namespace X // Multiple from PE, one from Source with alias var source7 = @" using System; -using X = Foo; +using X = Goo; [X] -class Foo: Attribute +class Goo: Attribute { } "; @@ -6261,7 +6261,7 @@ .assembly extern FSharp.Core {} { } -.class public abstract auto ansi sealed Library1.Foo +.class public abstract auto ansi sealed Library1.Goo extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) @@ -6274,15 +6274,15 @@ .maxstack 8 IL_0002: ldc.i4.1 IL_0003: add IL_0004: ret - } // end of method Foo::inc + } // end of method Goo::inc -} // end of class Library1.Foo +} // end of class Library1.Goo "; var reference1 = CompileIL(source1, prependDefaultHeader: false); var compilation = CreateStandardCompilation("", new[] { reference1 }); - var type = compilation.GetTypeByMetadataName("Library1.Foo"); + var type = compilation.GetTypeByMetadataName("Library1.Goo"); Assert.Equal(0, type.GetAttributes()[0].ConstructorArguments.Count()); } diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_CallerInfoAttributes.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_CallerInfoAttributes.cs index 03e525f61aefc..82174076ba94b 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_CallerInfoAttributes.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_CallerInfoAttributes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Text; @@ -633,12 +633,12 @@ public void TestCallerLineNumberDuplicateAttribute() partial class D { - partial void Foo([CallerLineNumber] int x = 2); + partial void Goo([CallerLineNumber] int x = 2); } partial class D { - partial void Foo([CallerLineNumber] int x) + partial void Goo([CallerLineNumber] int x) { } @@ -660,12 +660,12 @@ public void TestUnconsumedCallerInfoAttributes() partial class D { - partial void Foo(int line, string member, string path); + partial void Goo(int line, string member, string path); } partial class D { - partial void Foo( + partial void Goo( [CallerLineNumber] int line, [CallerMemberName] string member, [CallerFilePath] string path) { } @@ -878,12 +878,12 @@ public void TestCallerLineNumberUnconsumedBadType() partial class D { - partial void Foo(string x = """"); + partial void Goo(string x = """"); } partial class D { - partial void Foo([CallerLineNumber] string x) + partial void Goo([CallerLineNumber] string x) { } @@ -907,19 +907,19 @@ public void TestCallerMemberNameUnconsumedBadType() partial class D { - partial void Foo(string x = """"); + partial void Goo(string x = """"); } partial class D { - partial void Foo([CallerMemberName] string x) + partial void Goo([CallerMemberName] string x) { Console.WriteLine(x); } public static void Main() { - new D().Foo(); + new D().Goo(); } }"; @@ -927,7 +927,7 @@ public static void Main() compilation.VerifyEmitDiagnostics( // (12,23): warning CS4026: The CallerMemberNameAttribute applied to parameter 'x' will have no effect because it applies to a member that is used in contexts that do not allow optional arguments - // partial void Foo([CallerMemberName] string x) + // partial void Goo([CallerMemberName] string x) Diagnostic(ErrorCode.WRN_CallerMemberNameParamForUnconsumedLocation, "CallerMemberName").WithArguments("x").WithLocation(12, 23)); CompileAndVerify(compilation, expectedOutput: ""); @@ -943,19 +943,19 @@ public void TestCallerMemberNameUnconsumedBadType02() partial class D { - partial void Foo([CallerMemberName] string x = """"); + partial void Goo([CallerMemberName] string x = """"); } partial class D { - partial void Foo(string x) + partial void Goo(string x) { Console.WriteLine(x); } public static void Main() { - new D().Foo(); + new D().Goo(); } }"; @@ -1297,10 +1297,10 @@ public static int Log([CallerMemberName] string callerName = """") public static void Main() { - Action foo = new Action(() => { }); + Action goo = new Action(() => { }); var e = new E(); - e.ThingHappened += foo; - e.ThingHappened -= foo; + e.ThingHappened += goo; + e.ThingHappened -= goo; } }"; @@ -1652,9 +1652,9 @@ public void TestRecursiveAttribute() using System.Diagnostics; using System.Runtime.InteropServices; -public class Foo: Attribute +public class Goo: Attribute { - public Foo([Foo] int y = 0) {} + public Goo([Goo] int y = 0) {} } class Test @@ -1674,14 +1674,14 @@ public static void Main() { } public void TestRecursiveAttributeMetadata() { var iLSource = @" -.class public auto ansi beforefieldinit Foo +.class public auto ansi beforefieldinit Goo extends [mscorlib]System.Attribute { .method public hidebysig specialname rtspecialname instance void .ctor([opt] int32 y) cil managed { .param [1] = int32(0x00000000) - .custom instance void Foo::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void Goo::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) // Code size 10 (0xa) .maxstack 8 IL_0000: ldarg.0 @@ -1690,9 +1690,9 @@ .maxstack 8 IL_0007: nop IL_0008: nop IL_0009: ret - } // end of method Foo::.ctor + } // end of method Goo::.ctor -} // end of class Foo +} // end of class Goo "; var source = @" @@ -1701,7 +1701,7 @@ .maxstack 8 class Driver { - [Foo] + [Goo] public static void AttrTarget() { } public static void Main() { } @@ -1756,7 +1756,7 @@ public static void Main() public void TestDuplicateCallerInfoMetadata() { var iLSource = @" -.class public auto ansi beforefieldinit Foo +.class public auto ansi beforefieldinit Goo extends [mscorlib]System.Object { .method public hidebysig static int32 Log([opt] int32 callerName) cil managed @@ -1781,7 +1781,7 @@ .locals init (int32 V_0) IL_001b: ldloc.0 IL_001c: ret - } // end of method Foo::Log + } // end of method Goo::Log .method public hidebysig static int32 Log2([opt] string callerName) cil managed { @@ -1804,7 +1804,7 @@ .locals init (int32 V_0) IL_0016: ldloc.0 IL_0017: ret - } // end of method Foo::Log2 + } // end of method Goo::Log2 .method public hidebysig static int32 Log3([opt] string callerName) cil managed { @@ -1827,7 +1827,7 @@ .locals init (int32 V_0) IL_0016: ldloc.0 IL_0017: ret - } // end of method Foo::Log3 + } // end of method Goo::Log3 .method public hidebysig specialname rtspecialname instance void .ctor() cil managed @@ -1837,9 +1837,9 @@ .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret - } // end of method Foo::.ctor + } // end of method Goo::.ctor -} // end of class Foo +} // end of class Goo "; var source = @" @@ -1848,9 +1848,9 @@ .maxstack 8 class Driver { public static void Main() { - Foo.Log(); - Foo.Log2(); - Foo.Log3(); + Goo.Log(); + Goo.Log2(); + Goo.Log3(); } } "; @@ -2630,11 +2630,11 @@ class Program { static void Main() { - var x = Foo.F1; - var y = new Foo().F2; + var x = Goo.F1; + var y = new Goo().F2; } } -public class Foo +public class Goo { static object Test([CallerMemberName] string bar = null) { @@ -2666,11 +2666,11 @@ class Program { static void Main() { - var x = Foo.F1; - var y = new Foo().F2; + var x = Goo.F1; + var y = new Goo().F2; } } -public class Foo +public class Goo { static object Test([CallerMemberName] string bar = null) { @@ -2702,7 +2702,7 @@ class Program { static void Main() { - var y = ((I1)new Foo()).F2; + var y = ((I1)new Goo()).F2; } } @@ -2711,7 +2711,7 @@ interface I1 object F2 {get;} } -public class Foo : I1 +public class Goo : I1 { static object Test([CallerMemberName] string bar = null) { diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Conditional.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Conditional.cs index 70447d4209af5..af709d0336d5c 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Conditional.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Conditional.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -604,13 +604,13 @@ public void ConditionalAttributeArgument_ValidConstantMember() using System.Diagnostics; using System.Runtime.InteropServices; -[Conditional(Foo.M)] +[Conditional(Goo.M)] [Conditional(Bar.M)] -public class Foo: Attribute +public class Goo: Attribute { public const string M = Bar.M; - public Foo([Optional][Foo]int y) {} - public static void Main() { var unused = new Foo(); } + public Goo([Optional][Goo]int y) {} + public static void Main() { var unused = new Goo(); } } class Bar @@ -622,13 +622,13 @@ class Bar { var globalNamespace = module.GlobalNamespace; - var classFoo = globalNamespace.GetMember("Foo"); - Assert.True(classFoo.IsConditional); + var classGoo = globalNamespace.GetMember("Goo"); + Assert.True(classGoo.IsConditional); - var fooCtor = classFoo.InstanceConstructors.First(); - Assert.Equal(1, fooCtor.ParameterCount); + var gooCtor = classGoo.InstanceConstructors.First(); + Assert.Equal(1, gooCtor.ParameterCount); - var paramY = fooCtor.Parameters[0]; + var paramY = gooCtor.Parameters[0]; Assert.True(paramY.IsOptional); var attributes = paramY.GetAttributes(); if (isFromSource) @@ -652,15 +652,15 @@ public void ConditionalAttributeArgument_InvalidMember() using System.Diagnostics; using System.Runtime.InteropServices; -[Conditional(Foo.M)] -[Conditional(Foo.M())] +[Conditional(Goo.M)] +[Conditional(Goo.M())] [Conditional(Bar.M)] [Conditional(Bar.M())] -public class Foo: Attribute +public class Goo: Attribute { public const string M = Bar.M; - public Foo([Optional][Foo]int y) {} - public static void Main() { var unused = new Foo(); } + public Goo([Optional][Goo]int y) {} + public static void Main() { var unused = new Goo(); } } class Bar @@ -672,9 +672,9 @@ class Bar // (12,33): error CS0428: Cannot convert method group 'M' to non-delegate type 'string'. Did you intend to invoke the method? // public const string M = Bar.M; Diagnostic(ErrorCode.ERR_MethGrpToNonDel, "M").WithArguments("M", "string"), - // (7,18): error CS1955: Non-invocable member 'Foo.M' cannot be used like a method. - // [Conditional(Foo.M())] - Diagnostic(ErrorCode.ERR_NonInvocableMemberCalled, "M").WithArguments("Foo.M"), + // (7,18): error CS1955: Non-invocable member 'Goo.M' cannot be used like a method. + // [Conditional(Goo.M())] + Diagnostic(ErrorCode.ERR_NonInvocableMemberCalled, "M").WithArguments("Goo.M"), // (8,14): error CS1503: Argument 1: cannot convert from 'method group' to 'string' // [Conditional(Bar.M)] Diagnostic(ErrorCode.ERR_BadArgType, "Bar.M").WithArguments("1", "method group", "string"), @@ -682,8 +682,8 @@ class Bar // [Conditional(Bar.M())] Diagnostic(ErrorCode.ERR_BadAttributeArgument, "Bar.M()"), // (6,14): error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type - // [Conditional(Foo.M)] - Diagnostic(ErrorCode.ERR_BadAttributeArgument, "Foo.M")); + // [Conditional(Goo.M)] + Diagnostic(ErrorCode.ERR_BadAttributeArgument, "Goo.M")); } #endregion diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Dynamic.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Dynamic.cs index 4fae7f970755e..dc1c86dedc6b6 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Dynamic.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Dynamic.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -1177,7 +1177,7 @@ public void IteratorYieldingDynamic() class C { - static IEnumerable Foo() + static IEnumerable Goo() { yield break; } @@ -1186,7 +1186,7 @@ static IEnumerable Foo() CompileAndVerify(source, additionalRefs: new[] { CSharpRef, SystemCoreRef }, options: TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All), symbolValidator: module => { var c = module.GlobalNamespace.GetMember("C"); - var iterator = c.GetMember("d__0"); + var iterator = c.GetMember("d__0"); var getEnumerator = iterator.GetMethod("System.Collections.Generic.IEnumerable.GetEnumerator"); var attrs = getEnumerator.GetAttributes(); diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Locations.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Locations.cs index 5d1b362d2ac2e..5b631c7ef46bc 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Locations.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Locations.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -513,7 +513,7 @@ public class A : Attribute { } class C { - int Foo + int Goo { [A] [assembly: A] @@ -565,7 +565,7 @@ public class A : Attribute { } class C { - int Foo + int Goo { get { return 0; } @@ -758,7 +758,7 @@ public class A : Attribute { } class C { - event Action Foo + event Action Goo { [A] [assembly: A] @@ -808,7 +808,7 @@ public class A : Attribute { } class C { - event Action Foo + event Action Goo { add { } @@ -1099,15 +1099,15 @@ public void AttributesWithInvalidLocationNotEmitted() var source = @" using System; -public class foo +public class goo { public static void Main() { - object[] o = typeof(foo).GetMethod(""Boo"").GetCustomAttributes(typeof(A), false); + object[] o = typeof(goo).GetMethod(""Boo"").GetCustomAttributes(typeof(A), false); Console.WriteLine(""Attribute Count={0}"", o.Length); } - [foo: A] + [goo: A] [method: A] public int Boo(int i) { @@ -1120,8 +1120,8 @@ public class A : Attribute { } "; CompileAndVerify(source, expectedOutput: "Attribute Count=1").VerifyDiagnostics( - // (12,6): warning CS0658: 'foo' is not a recognized attribute location. Valid attribute locations for this declaration are 'method, return'. All attributes in this block will be ignored. - Diagnostic(ErrorCode.WRN_InvalidAttributeLocation, "foo").WithArguments("foo", "method, return")); + // (12,6): warning CS0658: 'goo' is not a recognized attribute location. Valid attribute locations for this declaration are 'method, return'. All attributes in this block will be ignored. + Diagnostic(ErrorCode.WRN_InvalidAttributeLocation, "goo").WithArguments("goo", "method, return")); } [WorkItem(537613, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537613"), WorkItem(537738, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/537738")] diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Security.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Security.cs index 69390b97bc74d..6b90caf4c13fd 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Security.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Security.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -68,7 +68,7 @@ public void SuppressUnmanagedCodeSecurityAttribute() { string source = @" [System.Security.SuppressUnmanagedCodeSecurityAttribute] -class Foo +class Goo { [System.Security.SuppressUnmanagedCodeSecurityAttribute] public static void Main() {} @@ -709,7 +709,7 @@ namespace N public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -720,7 +720,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -800,7 +800,7 @@ public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -811,7 +811,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0002" + // number of attributes (small enough to fit in 1 byte) @@ -910,7 +910,7 @@ public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] [PrincipalPermission(SecurityAction.Assert, Role=@""User2"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -921,7 +921,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -940,7 +940,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Assert, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -1033,10 +1033,10 @@ namespace N public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo1() {} + public static void Goo1() {} [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo2() {} + public static void Goo2() {} } } "; @@ -1047,7 +1047,7 @@ public static void Foo2() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo1", + ParentNameOpt = @"Goo1", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -1066,7 +1066,7 @@ public static void Foo2() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo2", + ParentNameOpt = @"Goo2", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -1098,7 +1098,7 @@ namespace N public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -1170,7 +1170,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -1199,7 +1199,7 @@ namespace N public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -1246,7 +1246,7 @@ public static void Foo() {} { ActionFlags = DeclarativeSecurityAction.Demand, ParentKind = SymbolKind.Method, - ParentNameOpt = @"Foo", + ParentNameOpt = @"Goo", PermissionSet = "." + // always start with a dot "\u0001" + // number of attributes (small enough to fit in 1 byte) @@ -1280,7 +1280,7 @@ public class C { [PrincipalPermission(SecurityAction.Demand, Role=@""User1"")] [PrincipalPermission(SecurityAction.Demand, Role=@""User2"")] - public static void Foo() {} + public static void Goo() {} } } "; @@ -1290,7 +1290,7 @@ public static void Foo() {} var ns = module.GlobalNamespace.GetMember("N"); var namedType = ns.GetMember("C"); var type = (Cci.ITypeDefinition)namedType; - var method = (Cci.IMethodDefinition)namedType.GetMember("Foo"); + var method = (Cci.IMethodDefinition)namedType.GetMember("Goo"); if (isFromSource) { diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Synthesized.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Synthesized.cs index 6ce9d3ec69eaa..f33e04ab6fc6c 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Synthesized.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_Synthesized.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -160,7 +160,7 @@ public void Lambdas() class C { - void Foo() + void Goo() { int a = 1, b = 2; Func d = (x, y) => a*x+b*y; @@ -190,7 +190,7 @@ public void AnonymousTypes() string source = @" class C { - void Foo() + void Goo() { var x = new { X = 1, Y = 2 }; } @@ -257,7 +257,7 @@ public void AnonymousTypes_DebuggerDisplay() string source = @" public class C { - public void Foo() + public void Goo() { var _0 = new { }; var _1 = new { X0 = 1 }; @@ -380,11 +380,11 @@ public void Async() class C { - public async Task Foo() + public async Task Goo() { for (int x = 1; x < 10; x++) { - await Foo(); + await Goo(); } return 1; @@ -397,12 +397,12 @@ public async Task Foo() CompileAndVerify(comp, symbolValidator: m => { - var foo = m.GlobalNamespace.GetMember("C.Foo"); + var goo = m.GlobalNamespace.GetMember("C.Goo"); AssertEx.SetEqual(options.OptimizationLevel == OptimizationLevel.Debug ? new[] { "AsyncStateMachineAttribute", "DebuggerStepThroughAttribute" } : - new[] { "AsyncStateMachineAttribute" }, GetAttributeNames(foo.GetAttributes())); + new[] { "AsyncStateMachineAttribute" }, GetAttributeNames(goo.GetAttributes())); - var iter = m.GlobalNamespace.GetMember("C.d__0"); + var iter = m.GlobalNamespace.GetMember("C.d__0"); AssertEx.SetEqual(new[] { "CompilerGeneratedAttribute" }, GetAttributeNames(iter.GetAttributes())); foreach (var member in iter.GetMembers().Where(s => s.Kind == SymbolKind.Method)) diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs index d9ab67d64f699..40b7c42c59ccc 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/AttributeTests_WellKnownAttributes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -34,7 +34,7 @@ public void TestInteropAttributes01() [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] [TypeLibImportClass(typeof(object)), TypeLibType(TypeLibTypeFlags.FAggregatable)] [BestFitMapping(false, ThrowOnUnmappableChar = true)] -public interface IFoo +public interface IGoo { [AllowReversePInvokeCalls()] @@ -78,8 +78,8 @@ public static void Main() {} var tLTypeSym = interopNS.GetTypeMember("TypeLibTypeAttribute"); var bfmSym = interopNS.GetTypeMember("BestFitMappingAttribute"); - // IFoo - var ifoo = m.GlobalNamespace.GetTypeMember("IFoo"); + // IGoo + var ifoo = m.GlobalNamespace.GetTypeMember("IGoo"); Assert.Equal(6, ifoo.GetAttributes().Length); // get attr by NamedTypeSymbol @@ -142,10 +142,10 @@ public void TestInteropAttributes02() [assembly: Guid(""1234C65D-1234-447A-B786-64682CBEF136"")] [ComVisibleAttribute(false)] [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall, BestFitMapping = true, CharSet = CharSet.Ansi, SetLastError = true, ThrowOnUnmappableChar = true)] -public delegate void DFoo(char p1, sbyte p2); +public delegate void DGoo(char p1, sbyte p2); [ComDefaultInterface(typeof(object)), ProgId(""ProgId"")] -public class CFoo +public class CGoo { [DispIdAttribute(123)] [LCIDConversion(1), ComConversionLoss()] @@ -154,8 +154,8 @@ public void Method(sbyte p1, string p2) } } -[ComVisible(true), TypeIdentifier(""1234C65D-1234-447A-B786-64682CBEF136"", ""EFoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"")] -public enum EFoo +[ComVisible(true), TypeIdentifier(""1234C65D-1234-447A-B786-64682CBEF136"", ""EGoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"")] +public enum EGoo { One, [TypeLibVar(TypeLibVarFlags.FDisplayBind)] @@ -186,8 +186,8 @@ public static void Main() {} var comcSym = interopNS.GetTypeMember("ComConversionLossAttribute"); var globalNS = m.GlobalNamespace; - // delegate DFoo - var type1 = globalNS.GetTypeMember("DFoo"); + // delegate DGoo + var type1 = globalNS.GetTypeMember("DGoo"); Assert.Equal(2, type1.GetAttributes().Length); var attrSym = type1.GetAttribute(comvSym); @@ -202,8 +202,8 @@ public static void Main() {} attrSym.VerifyNamedArgumentValue(2, "SetLastError", TypedConstantKind.Primitive, true); attrSym.VerifyNamedArgumentValue(3, "ThrowOnUnmappableChar", TypedConstantKind.Primitive, true); - // class CFoo - var type2 = globalNS.GetTypeMember("CFoo"); + // class CGoo + var type2 = globalNS.GetTypeMember("CGoo"); Assert.Equal(2, type2.GetAttributes().Length); attrSym = type2.GetAttribute(comdSym); @@ -222,19 +222,19 @@ public static void Main() {} attrSym = method.GetAttribute(comcSym); Assert.Equal(0, attrSym.CommonConstructorArguments.Length); - //' enum EFoo + //' enum EGoo var sourceAssembly = assembly as SourceAssemblySymbol; if (sourceAssembly != null) { // Because this is a nopia local type it is only visible from the source assembly. - var type3 = globalNS.GetTypeMember("EFoo"); + var type3 = globalNS.GetTypeMember("EGoo"); Assert.Equal(2, type3.GetAttributes().Length); attrSym = type3.GetAttribute(comvSym); attrSym.VerifyValue(0, TypedConstantKind.Primitive, true); attrSym = type3.GetAttribute(tidSym); - attrSym.VerifyValue(1, TypedConstantKind.Primitive, "EFoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); + attrSym.VerifyValue(1, TypedConstantKind.Primitive, "EGoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); var field = (FieldSymbol)type3.GetMembers("One").First(); Assert.Equal(0, field.GetAttributes().Length); @@ -777,7 +777,7 @@ public void DPV_ImplicitConversion() public class C { - public void M([DefaultParameterValue((short)1)]int foo) + public void M([DefaultParameterValue((short)1)]int goo) { } }"; @@ -1190,13 +1190,13 @@ public void Bug13129() using System.Runtime.InteropServices; class C { - static void Foo([Optional][DefaultParameterValue(5)] decimal? x) + static void Goo([Optional][DefaultParameterValue(5)] decimal? x) { Console.WriteLine(x); } static void Main() { - Foo(); + Goo(); } }"; CompileAndVerify(source, additionalRefs: new[] { SystemRef }, expectedOutput: @"5"); @@ -1278,17 +1278,17 @@ public void OptionalAttributeOnPartialMethodParameters() partial class C { - partial void Foo([Optional] int x); - partial void Foo([DefaultParameterValue(0)] int x) { } + partial void Goo([Optional] int x); + partial void Goo([DefaultParameterValue(0)] int x) { } - partial void Foo2([DefaultParameterValue(0)] int x); - partial void Foo2([Optional] int x) { } + partial void Goo2([DefaultParameterValue(0)] int x); + partial void Goo2([Optional] int x) { } - partial void Foo3([Optional][DefaultParameterValue(0)] int x); - partial void Foo3(int x) { } + partial void Goo3([Optional][DefaultParameterValue(0)] int x); + partial void Goo3(int x) { } - partial void Foo4(int x); - partial void Foo4([Optional][DefaultParameterValue(0)] int x) { } + partial void Goo4(int x); + partial void Goo4([Optional][DefaultParameterValue(0)] int x) { } } "; Action partialValidator = (SourceOrdinaryMethodSymbol sourceMethod) => @@ -1308,16 +1308,16 @@ partial void Foo4([Optional][DefaultParameterValue(0)] int x) { } { var typeC = m.GlobalNamespace.GetTypeMember("C"); - var sourceMethod = typeC.GetMember("Foo"); + var sourceMethod = typeC.GetMember("Goo"); partialValidator(sourceMethod); - sourceMethod = typeC.GetMember("Foo2"); + sourceMethod = typeC.GetMember("Goo2"); partialValidator(sourceMethod); - sourceMethod = typeC.GetMember("Foo3"); + sourceMethod = typeC.GetMember("Goo3"); partialValidator(sourceMethod); - sourceMethod = typeC.GetMember("Foo4"); + sourceMethod = typeC.GetMember("Goo4"); partialValidator(sourceMethod); }; @@ -1332,10 +1332,10 @@ public void OptionalAttributeBindingCycle() using System; using System.Runtime.InteropServices; -[Foo] -public class Foo: Attribute +[Goo] +public class Goo: Attribute { - public Foo([Optional][Foo]int y) {} + public Goo([Optional][Goo]int y) {} public static void Main() {} }"; @@ -1357,19 +1357,19 @@ public OptionalAttribute(bool isOpt = true) {} } } -public class Foo: Attribute +public class Goo: Attribute { - public Foo([Optional(isOpt: false)][Foo]int y) {} + public Goo([Optional(isOpt: false)][Goo]int y) {} public static void Main() {} }"; CreateStandardCompilation(source).VerifyDiagnostics( // (15,17): warning CS0436: The type 'System.Runtime.InteropServices.OptionalAttribute' in '' conflicts with the imported type 'System.Runtime.InteropServices.OptionalAttribute' in 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using the type defined in ''. - // public Foo([Optional(isOpt: false)][Foo]int y) {} + // public Goo([Optional(isOpt: false)][Goo]int y) {} Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "Optional").WithArguments("", "System.Runtime.InteropServices.OptionalAttribute", "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "System.Runtime.InteropServices.OptionalAttribute").WithLocation(15, 17), - // (15,41): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Foo.Foo(int)' - // public Foo([Optional(isOpt: false)][Foo]int y) {} - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("y", "Foo.Foo(int)").WithLocation(15, 41)); + // (15,41): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Goo.Goo(int)' + // public Goo([Optional(isOpt: false)][Goo]int y) {} + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("y", "Goo.Goo(int)").WithLocation(15, 41)); } [Fact] @@ -1388,18 +1388,18 @@ public OptionalAttribute() {} } } -public class Foo: Attribute +public class Goo: Attribute { - public Foo([Optional][Foo]int y) {} + public Goo([Optional][Goo]int y) {} public static void Main() {} }"; CreateStandardCompilation(source).VerifyDiagnostics( // (16,17): warning CS0436: The type 'System.Runtime.InteropServices.OptionalAttribute' in '' conflicts with the imported type 'System.Runtime.InteropServices.OptionalAttribute' in 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using the type defined in ''. - // public Foo([Optional][Foo]int y) {} + // public Goo([Optional][Goo]int y) {} Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "Optional").WithArguments("", "System.Runtime.InteropServices.OptionalAttribute", "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "System.Runtime.InteropServices.OptionalAttribute"), // (16,17): error CS0592: Attribute 'Optional' is not valid on this declaration type. It is only valid on 'class' declarations. - // public Foo([Optional][Foo]int y) {} + // public Goo([Optional][Goo]int y) {} Diagnostic(ErrorCode.ERR_AttributeOnBadSymbolType, "Optional").WithArguments("Optional", "class")); } @@ -1419,22 +1419,22 @@ public OptionalAttribute(object o) {} } } -public class Foo: Attribute +public class Goo: Attribute { - public Foo([Optional(new Foo())][Foo]int y) {} + public Goo([Optional(new Goo())][Goo]int y) {} public static void Main() {} }"; CreateStandardCompilation(source).VerifyDiagnostics( // (16,17): warning CS0436: The type 'System.Runtime.InteropServices.OptionalAttribute' in '' conflicts with the imported type 'System.Runtime.InteropServices.OptionalAttribute' in 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using the type defined in ''. - // public Foo([Optional(new Foo())][Foo]int y) {} + // public Goo([Optional(new Goo())][Goo]int y) {} Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "Optional").WithArguments("", "System.Runtime.InteropServices.OptionalAttribute", "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "System.Runtime.InteropServices.OptionalAttribute").WithLocation(16, 17), - // (16,30): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Foo.Foo(int)' - // public Foo([Optional(new Foo())][Foo]int y) {} - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("y", "Foo.Foo(int)").WithLocation(16, 30), - // (16,38): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Foo.Foo(int)' - // public Foo([Optional(new Foo())][Foo]int y) {} - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("y", "Foo.Foo(int)").WithLocation(16, 38)); + // (16,30): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Goo.Goo(int)' + // public Goo([Optional(new Goo())][Goo]int y) {} + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("y", "Goo.Goo(int)").WithLocation(16, 30), + // (16,38): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'Goo.Goo(int)' + // public Goo([Optional(new Goo())][Goo]int y) {} + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("y", "Goo.Goo(int)").WithLocation(16, 38)); } [Fact, WorkItem(546624, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546624")] @@ -1769,20 +1769,20 @@ public void EnumAsDefaultParameterValue() class Program { - static void Foo([Optional][DefaultParameterValue(DayOfWeek.Monday)] Enum x) + static void Goo([Optional][DefaultParameterValue(DayOfWeek.Monday)] Enum x) { } static void Main() { - Foo(); + Goo(); } }"; var comp = CreateStandardCompilation(source, references: new[] { SystemRef }); comp.VerifyEmitDiagnostics( // (13,9): error CS0029: Cannot implicitly convert type 'int' to 'Enum' - // Foo(); - Diagnostic(ErrorCode.ERR_NoImplicitConv, "Foo()").WithArguments("int", "System.Enum").WithLocation(13, 9)); + // Goo(); + Diagnostic(ErrorCode.ERR_NoImplicitConv, "Goo()").WithArguments("int", "System.Enum").WithLocation(13, 9)); } #endregion @@ -1808,22 +1808,22 @@ public void DefaultParameterValueIntToObj() public class Parent { - public void Foo1([Optional][DecimalConstant(0, 0, (uint)0, (uint)0, (uint)100)] decimal i) + public void Goo1([Optional][DecimalConstant(0, 0, (uint)0, (uint)0, (uint)100)] decimal i) { Console.Write(i); } - public void Foo3([Optional][DateTimeConstant(200)] DateTime dt) + public void Goo3([Optional][DateTimeConstant(200)] DateTime dt) { Console.Write(dt.Ticks); } - public void Foo4([Optional][DefaultParameterValue(300)] int i) + public void Goo4([Optional][DefaultParameterValue(300)] int i) { Console.Write(i); } - public void Foo5([Optional][DefaultParameterValue(400)] object i) + public void Goo5([Optional][DefaultParameterValue(400)] object i) { Console.Write(i); } @@ -1834,10 +1834,10 @@ class Test public static void Main() { var p = new Parent(); - p.Foo1(); - p.Foo3(); - p.Foo4(); - p.Foo5(); + p.Goo1(); + p.Goo3(); + p.Goo4(); + p.Goo5(); } } "; @@ -2290,10 +2290,10 @@ class C [DllImport("""")] public extern static void F2(); - [DllImport(""foo"", EntryPoint = null)] + [DllImport(""goo"", EntryPoint = null)] public extern static void F3(); - [DllImport(""foo"", EntryPoint = """")] + [DllImport(""goo"", EntryPoint = """")] public extern static void F4(); [DllImport(null, EntryPoint = null)] @@ -2538,7 +2538,7 @@ public void TestPseudoAttributes_DllImport_OperatorsAndAccessors() public class C { - [DllImport(""foo"")] + [DllImport(""goo"")] public static extern int operator +(C a, C b); public extern static int F @@ -2569,7 +2569,7 @@ public extern static int F switch (entryPointName) { case "op_Addition": - Assert.Equal("foo", moduleName); + Assert.Equal("goo", moduleName); break; case "get_F": @@ -2935,92 +2935,92 @@ abstract class C [MethodImpl(MethodImplOptions.PreserveSig)] abstract public void f1(); - [DllImport(""foo"")] + [DllImport(""goo"")] public extern static void f2(); - [DllImport(""foo"", PreserveSig=true)] + [DllImport(""goo"", PreserveSig=true)] public extern static void f3(); // false - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] public extern static void f4(); [MethodImpl(MethodImplOptions.PreserveSig)] - [DllImport(""foo"", PreserveSig=true)] + [DllImport(""goo"", PreserveSig=true)] public extern static void f5(); // false [MethodImpl(MethodImplOptions.PreserveSig)] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] public extern static void f6(); [MethodImpl(MethodImplOptions.PreserveSig)] [PreserveSig] abstract public void f7(); - [DllImport(""foo"")] + [DllImport(""goo"")] [PreserveSig] public extern static void f8(); [PreserveSig] - [DllImport(""foo"", PreserveSig=true)] + [DllImport(""goo"", PreserveSig=true)] public extern static void f9(); - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [PreserveSig] public extern static void f10(); [MethodImpl(MethodImplOptions.PreserveSig)] - [DllImport(""foo"", PreserveSig=true)] + [DllImport(""goo"", PreserveSig=true)] [PreserveSig] public extern static void f11(); - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [PreserveSig] [MethodImpl(MethodImplOptions.PreserveSig)] public extern static void f12(); - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [MethodImpl(MethodImplOptions.PreserveSig)] [PreserveSig] public extern static void f13(); [PreserveSig] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [MethodImpl(MethodImplOptions.PreserveSig)] public extern static void f14(); // false [PreserveSig] [MethodImpl(MethodImplOptions.PreserveSig)] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] public extern static void f15(); // false [MethodImpl(MethodImplOptions.PreserveSig)] [PreserveSig] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] public extern static void f16(); [MethodImpl(MethodImplOptions.PreserveSig)] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [PreserveSig] public extern static void f17(); public static void f18() {} [MethodImpl(MethodImplOptions.Synchronized)] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [PreserveSig] public extern static void f19(); [PreserveSig] - [DllImport(""foo"")] + [DllImport(""goo"")] [MethodImpl(MethodImplOptions.Synchronized)] public extern static void f20(); [PreserveSig] - [DllImport(""foo"", PreserveSig=false)] + [DllImport(""goo"", PreserveSig=false)] [MethodImpl(MethodImplOptions.Synchronized)] public extern static void f21(); } @@ -3166,7 +3166,7 @@ public void DllImport_DefaultCharSet1() abstract class C { - [DllImport(""foo"")] + [DllImport(""goo"")] static extern void f1(); } "; @@ -3198,7 +3198,7 @@ public void DllImport_DefaultCharSet2() [StructLayout(LayoutKind.Explicit)] abstract class C { - [DllImport(""foo"")] + [DllImport(""goo"")] static extern void f1(); } "; @@ -3267,7 +3267,7 @@ class D { int[] arr = new[] { 1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0}; - void foo() + void goo() { int a = 1; int b = 2; @@ -3410,14 +3410,14 @@ public void TestComImportAttribute() [ComImport, Guid(""00020810-0000-0000-C000-000000000046"")] class A { - public static extern void Foo(); + public static extern void Goo(); } public class MainClass { public static int Main () { - A.Foo(); + A.Goo(); return 0; } }"; @@ -3432,8 +3432,8 @@ public static int Main () Assert.Equal(expectedMethodImplAttributes, ctorA.ImplementationAttributes); Assert.True(((Cci.IMethodDefinition)ctorA).IsExternal); - var methodFoo = (Cci.IMethodDefinition)typeA.GetMember("Foo"); - Assert.True(methodFoo.IsExternal); + var methodGoo = (Cci.IMethodDefinition)typeA.GetMember("Goo"); + Assert.True(methodGoo.IsExternal); }; Action metadataValidator = (ModuleSymbol m) => @@ -3445,8 +3445,8 @@ public static int Main () var ctorA = typeA.InstanceConstructors.First(); Assert.False(ctorA.IsExtern); - var methodFoo = (MethodSymbol)typeA.GetMember("Foo"); - Assert.False(methodFoo.IsExtern); + var methodGoo = (MethodSymbol)typeA.GetMember("Goo"); + Assert.False(methodGoo.IsExtern); }; // the resulting code does not need to verify @@ -4907,14 +4907,14 @@ public ObjectConstantAttribute(object objectValue) public class Test { - public void Foo2([Optional][ObjectConstant(1000)] object obj) + public void Goo2([Optional][ObjectConstant(1000)] object obj) { Console.WriteLine(obj); } public static void Main() { - new Test().Foo2(); + new Test().Goo2(); } } "; @@ -4926,7 +4926,7 @@ public static void Main() .maxstack 2 IL_0000: newobj ""Test..ctor()"" IL_0005: ldsfld ""object System.Type.Missing"" - IL_000a: call ""void Test.Foo2(object)"" + IL_000a: call ""void Test.Goo2(object)"" IL_000f: ret }"); } @@ -5382,13 +5382,13 @@ class SelfRecursive1Attribute : Attribute {} [Obsolete] public delegate int Mydeleg(int x); -[FooAttribute.BarAttribute.Baz] +[GooAttribute.BarAttribute.Baz] [Obsolete(""Blah"")] -class FooAttribute : Attribute +class GooAttribute : Attribute { class BazAttribute : Attribute { } - class BarAttribute : FooAttribute { } + class BarAttribute : GooAttribute { } } namespace TypeClashWithNS @@ -5402,11 +5402,11 @@ class TypeClashWithNS : Attribute class BarAttribute : Attribute { } } -interface IFoo {} +interface IGoo {} [Obsolete] -class SelfReferenceInBase : IFoo {} +class SelfReferenceInBase : IGoo {} -class SelfReferenceInBase1 : IFoo {} +class SelfReferenceInBase1 : IGoo {} "; CreateStandardCompilation(source).VerifyDiagnostics( @@ -5423,7 +5423,7 @@ class SelfReferenceInBase1 : IFoo {} // Class1 Prop1 { get; set; } Diagnostic(ErrorCode.ERR_DeprecatedSymbolStr, "Class1").WithArguments("Class1", "Do not use this type").WithLocation(7, 5), // (87,35): warning CS0612: 'SelfReferenceInBase' is obsolete - // class SelfReferenceInBase1 : IFoo {} + // class SelfReferenceInBase1 : IGoo {} Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "SelfReferenceInBase").WithArguments("SelfReferenceInBase").WithLocation(87, 35), // (6,5): error CS0619: 'Class1' is obsolete: 'Do not use this type' // Class1 field1; @@ -5748,10 +5748,10 @@ public void TestMethod() {} var source = @" public class Test { - public static void foo1(TestClass1 c) {} - public static void foo2(TestClass2 c) {} - public static void foo3(TestClass3 c) {} - public static void foo4(TestClass4 c) {} + public static void goo1(TestClass1 c) {} + public static void goo2(TestClass2 c) {} + public static void goo3(TestClass3 c) {} + public static void goo4(TestClass4 c) {} public static void Main() { @@ -5766,16 +5766,16 @@ public static void Main() "; CreateStandardCompilation(source, new[] { peReference }).VerifyDiagnostics( // (4,29): warning CS0612: 'TestClass1' is obsolete - // public static void foo1(TestClass1 c) {} + // public static void goo1(TestClass1 c) {} Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "TestClass1").WithArguments("TestClass1"), // (5,29): warning CS0618: 'TestClass2' is obsolete: 'TestClass2 is obsolete' - // public static void foo2(TestClass2 c) {} + // public static void goo2(TestClass2 c) {} Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "TestClass2").WithArguments("TestClass2", "TestClass2 is obsolete"), // (6,29): error CS0619: 'TestClass3' is obsolete: 'Do not use TestClass3' - // public static void foo3(TestClass3 c) {} + // public static void goo3(TestClass3 c) {} Diagnostic(ErrorCode.ERR_DeprecatedSymbolStr, "TestClass3").WithArguments("TestClass3", "Do not use TestClass3"), // (7,29): warning CS0618: 'TestClass4' is obsolete: 'TestClass4 is obsolete' - // public static void foo4(TestClass4 c) {} + // public static void goo4(TestClass4 c) {} Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "TestClass4").WithArguments("TestClass4", "TestClass4 is obsolete"), // (12,9): warning CS0618: 'TestClass.TestMethod()' is obsolete: 'Do not use TestMethod' // c.TestMethod(); @@ -5801,73 +5801,73 @@ public void TestObsoleteAttributeOnOverriddenMembers() using System; class C1 { - public virtual void foo() {} + public virtual void goo() {} } class C2 : C1 { [Obsolete] - public override void foo() {} + public override void goo() {} } class C3 : C1 { [Obsolete] - public new void foo() {} + public new void goo() {} } class C4 : C1 { - public override void foo() {} + public override void goo() {} } class C5 : C4 { [Obsolete] - public override void foo() {} + public override void goo() {} } class C6 : C5 { - public override void foo() {} + public override void goo() {} } class D1 { [Obsolete] - public virtual void foo() {} + public virtual void goo() {} } class D2 : D1 { - public override void foo() {} + public override void goo() {} } class D3 : D1 { - public new void foo() {} + public new void goo() {} } class D4 : D1 { [Obsolete] - public override void foo() {} + public override void goo() {} } class D5 : D4 { - public override void foo() {} + public override void goo() {} } class D6 : D5 { [Obsolete] - public override void foo() {} + public override void goo() {} } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (10,26): warning CS0809: Obsolete member 'C2.foo()' overrides non-obsolete member 'C1.foo()' - // public override void foo() {} - Diagnostic(ErrorCode.WRN_ObsoleteOverridingNonObsolete, "foo").WithArguments("C2.foo()", "C1.foo()"), - // (24,26): warning CS0809: Obsolete member 'C5.foo()' overrides non-obsolete member 'C1.foo()' - // public override void foo() {} - Diagnostic(ErrorCode.WRN_ObsoleteOverridingNonObsolete, "foo").WithArguments("C5.foo()", "C1.foo()"), - // (38,26): warning CS0672: Member 'D2.foo()' overrides obsolete member 'D1.foo()'. Add the Obsolete attribute to 'D2.foo()'. - // public override void foo() {} - Diagnostic(ErrorCode.WRN_NonObsoleteOverridingObsolete, "foo").WithArguments("D2.foo()", "D1.foo()"), - // (51,26): warning CS0672: Member 'D5.foo()' overrides obsolete member 'D1.foo()'. Add the Obsolete attribute to 'D5.foo()'. - // public override void foo() {} - Diagnostic(ErrorCode.WRN_NonObsoleteOverridingObsolete, "foo").WithArguments("D5.foo()", "D1.foo()")); + // (10,26): warning CS0809: Obsolete member 'C2.goo()' overrides non-obsolete member 'C1.goo()' + // public override void goo() {} + Diagnostic(ErrorCode.WRN_ObsoleteOverridingNonObsolete, "goo").WithArguments("C2.goo()", "C1.goo()"), + // (24,26): warning CS0809: Obsolete member 'C5.goo()' overrides non-obsolete member 'C1.goo()' + // public override void goo() {} + Diagnostic(ErrorCode.WRN_ObsoleteOverridingNonObsolete, "goo").WithArguments("C5.goo()", "C1.goo()"), + // (38,26): warning CS0672: Member 'D2.goo()' overrides obsolete member 'D1.goo()'. Add the Obsolete attribute to 'D2.goo()'. + // public override void goo() {} + Diagnostic(ErrorCode.WRN_NonObsoleteOverridingObsolete, "goo").WithArguments("D2.goo()", "D1.goo()"), + // (51,26): warning CS0672: Member 'D5.goo()' overrides obsolete member 'D1.goo()'. Add the Obsolete attribute to 'D5.goo()'. + // public override void goo() {} + Diagnostic(ErrorCode.WRN_NonObsoleteOverridingObsolete, "goo").WithArguments("D5.goo()", "D1.goo()")); } [Fact] @@ -5994,13 +5994,13 @@ public SomeAttr1(Action x) {} public void TestObsoleteAttributeCycles_02() { var source = @" -[Foo] -class Foo: Base {} +[Goo] +class Goo: Base {} -[Foo] +[Goo] class Base: System.Attribute { - public class Nested: Foo {} + public class Nested: Goo {} } "; CompileAndVerify(source); @@ -6012,7 +6012,7 @@ public class Nested: Foo {} public class SomeType { public static SomeType Instance; - public const string Message = ""foo""; + public const string Message = ""goo""; } public class SomeAttr : Attribute @@ -6047,7 +6047,7 @@ public void TestObsoleteAttributeSuppress() public class SomeType { public static SomeType Instance; - public const string Message = ""foo""; + public const string Message = ""goo""; } public class Test @@ -6068,7 +6068,7 @@ public class Test SomeType this[int x] { get { SomeType y = new SomeType(); return y; } } [Obsolete] - SomeType foo(SomeType x) + SomeType goo(SomeType x) { SomeType y = new SomeType(); return x; @@ -6119,7 +6119,7 @@ public void TestObsoleteAttributeP2PReference() [Obsolete] public class C { [Obsolete] - public void Foo() {} + public void Goo() {} } "; var other = CreateStandardCompilation(s); @@ -6129,7 +6129,7 @@ public class A { protected A(C o) { - o.Foo(); + o.Goo(); } } "; @@ -6137,9 +6137,9 @@ protected A(C o) // (3,17): warning CS0612: 'C' is obsolete // protected A(C o) Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "C").WithArguments("C"), - // (5,9): warning CS0612: 'C.Foo()' is obsolete - // o.Foo(); - Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "o.Foo()").WithArguments("C.Foo()")); + // (5,9): warning CS0612: 'C.Goo()' is obsolete + // o.Goo(); + Diagnostic(ErrorCode.WRN_DeprecatedSymbol, "o.Goo()").WithArguments("C.Goo()")); } [Fact] @@ -7870,7 +7870,7 @@ public void TestDeprecatedAttributeTH1() public class Test { [Deprecated(""hello"", DeprecationType.Deprecate, 1, typeof(int))] - public static void Foo() + public static void Goo() { } @@ -7889,7 +7889,7 @@ class Program { static void Main(string[] args) { - Test.Foo(); + Test.Goo(); Test.Bar(); } } @@ -7898,9 +7898,9 @@ static void Main(string[] args) var compilation2 = CreateCompilationWithMscorlibAndSystemCore(source2, new[] { compilation1.EmitToImageReference() }); compilation2.VerifyDiagnostics( - // (8,13): warning CS0618: 'Test.Foo()' is obsolete: 'hello' - // Test.Foo(); - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Foo()").WithArguments("Test.Foo()", "hello").WithLocation(8, 13), + // (8,13): warning CS0618: 'Test.Goo()' is obsolete: 'hello' + // Test.Goo(); + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Goo()").WithArguments("Test.Goo()", "hello").WithLocation(8, 13), // (9,13): warning CS0618: 'Test.Bar()' is obsolete: 'hi' // Test.Bar(); Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Bar()").WithArguments("Test.Bar()", "hi").WithLocation(9, 13) @@ -7909,9 +7909,9 @@ static void Main(string[] args) var compilation3 = CreateCompilationWithMscorlibAndSystemCore(source2, new[] { new CSharpCompilationReference(compilation1) }); compilation3.VerifyDiagnostics( - // (8,13): warning CS0618: 'Test.Foo()' is obsolete: 'hello' - // Test.Foo(); - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Foo()").WithArguments("Test.Foo()", "hello").WithLocation(8, 13), + // (8,13): warning CS0618: 'Test.Goo()' is obsolete: 'hello' + // Test.Goo(); + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Goo()").WithArguments("Test.Goo()", "hello").WithLocation(8, 13), // (9,13): warning CS0618: 'Test.Bar()' is obsolete: 'hi' // Test.Bar(); Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Bar()").WithArguments("Test.Bar()", "hi").WithLocation(9, 13) @@ -7953,7 +7953,7 @@ public void TestDeprecatedAttributeTH2() public class Test { [Deprecated(""hello"", DeprecationType.Deprecate, 1, ""hello"")] - public static void Foo() + public static void Goo() { } @@ -7972,7 +7972,7 @@ class Program { static void Main(string[] args) { - Test.Foo(); + Test.Goo(); Test.Bar(); } } @@ -7981,9 +7981,9 @@ static void Main(string[] args) var compilation2 = CreateCompilationWithMscorlibAndSystemCore(source2, new[] { compilation1.EmitToImageReference() }); compilation2.VerifyDiagnostics( - // (8,13): warning CS0618: 'Test.Foo()' is obsolete: 'hello' - // Test.Foo(); - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Foo()").WithArguments("Test.Foo()", "hello").WithLocation(8, 13), + // (8,13): warning CS0618: 'Test.Goo()' is obsolete: 'hello' + // Test.Goo(); + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Goo()").WithArguments("Test.Goo()", "hello").WithLocation(8, 13), // (9,13): warning CS0618: 'Test.Bar()' is obsolete: 'hi' // Test.Bar(); Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Bar()").WithArguments("Test.Bar()", "hi").WithLocation(9, 13) @@ -7992,9 +7992,9 @@ static void Main(string[] args) var compilation3 = CreateCompilationWithMscorlibAndSystemCore(source2, new[] { new CSharpCompilationReference(compilation1) }); compilation3.VerifyDiagnostics( - // (8,13): warning CS0618: 'Test.Foo()' is obsolete: 'hello' - // Test.Foo(); - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Foo()").WithArguments("Test.Foo()", "hello").WithLocation(8, 13), + // (8,13): warning CS0618: 'Test.Goo()' is obsolete: 'hello' + // Test.Goo(); + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Goo()").WithArguments("Test.Goo()", "hello").WithLocation(8, 13), // (9,13): warning CS0618: 'Test.Bar()' is obsolete: 'hi' // Test.Bar(); Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "Test.Bar()").WithArguments("Test.Bar()", "hi").WithLocation(9, 13) @@ -8013,76 +8013,76 @@ public static void Main(string[] args) { } - private static void TestFoo1(IFoo1 a, ConcreteFoo1 b) + private static void TestGoo1(IGoo1 a, ConcreteGoo1 b) { - a.Foo(); // IFoo1 - b.Foo(); // ConcreteFoo1 + a.Goo(); // IGoo1 + b.Goo(); // ConcreteGoo1 } - private static void TestFoo2(IFoo2 a, ConcreteFoo2 b) + private static void TestGoo2(IGoo2 a, ConcreteGoo2 b) { - a.Foo(); // IFoo2 - b.Foo(); // ConcreteFoo2 + a.Goo(); // IGoo2 + b.Goo(); // ConcreteGoo2 } - private static void TestFoo3(IFoo3 a, ConcreteFoo3 b) + private static void TestGoo3(IGoo3 a, ConcreteGoo3 b) { - a.Foo(); // IFoo3 - b.Foo(); // ConcreteFoo3 + a.Goo(); // IGoo3 + b.Goo(); // ConcreteGoo3 } } -public interface IFoo1 +public interface IGoo1 { - [Deprecated(""IFoo1.Foo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] - void Foo(); + [Deprecated(""IGoo1.Goo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] + void Goo(); } -public sealed class ConcreteFoo1 : IFoo1 +public sealed class ConcreteGoo1 : IGoo1 { - public void Foo() + public void Goo() { } } -public interface IFoo2 +public interface IGoo2 { - void Foo(); + void Goo(); } -public sealed class ConcreteFoo2 : IFoo2 +public sealed class ConcreteGoo2 : IGoo2 { - [Deprecated(""ConcreteFoo2.Foo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] - public void Foo() + [Deprecated(""ConcreteGoo2.Goo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] + public void Goo() { } } -public interface IFoo3 +public interface IGoo3 { - [Deprecated(""IFoo3.Foo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] - void Foo(); + [Deprecated(""IGoo3.Goo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] + void Goo(); } -public sealed class ConcreteFoo3 : IFoo3 +public sealed class ConcreteGoo3 : IGoo3 { - [Deprecated(""ConcreteFoo3.Foo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] - public void Foo() + [Deprecated(""ConcreteGoo3.Goo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] + public void Goo() { } } -public sealed class ConcreteFoo4 : IFoo1 +public sealed class ConcreteGoo4 : IGoo1 { - void IFoo1.Foo() + void IGoo1.Goo() { } } -public sealed class ConcreteFoo5 : IFoo1 +public sealed class ConcreteGoo5 : IGoo1 { - [Deprecated(""ConcreteFoo5.Foo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] - void IFoo1.Foo() + [Deprecated(""ConcreteGoo5.Goo has been deprecated"", DeprecationType.Deprecate, 0, Platform.Windows)] + void IGoo1.Goo() { } } @@ -8090,18 +8090,18 @@ void IFoo1.Foo() var compilation1 = CreateCompilation(source1, WinRtRefs, TestOptions.ReleaseDll); var expected = new[] { - // (12,9): warning CS0618: 'IFoo1.Foo()' is obsolete: 'IFoo1.Foo has been deprecated' - // a.Foo(); // IFoo1 - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "a.Foo()").WithArguments("IFoo1.Foo()", "IFoo1.Foo has been deprecated").WithLocation(12, 9), - // (19,9): warning CS0618: 'ConcreteFoo2.Foo()' is obsolete: 'ConcreteFoo2.Foo has been deprecated' - // b.Foo(); // ConcreteFoo2 - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "b.Foo()").WithArguments("ConcreteFoo2.Foo()", "ConcreteFoo2.Foo has been deprecated").WithLocation(19, 9), - // (24,9): warning CS0618: 'IFoo3.Foo()' is obsolete: 'IFoo3.Foo has been deprecated' - // a.Foo(); // IFoo3 - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "a.Foo()").WithArguments("IFoo3.Foo()", "IFoo3.Foo has been deprecated").WithLocation(24, 9), - // (25,9): warning CS0618: 'ConcreteFoo3.Foo()' is obsolete: 'ConcreteFoo3.Foo has been deprecated' - // b.Foo(); // ConcreteFoo3 - Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "b.Foo()").WithArguments("ConcreteFoo3.Foo()", "ConcreteFoo3.Foo has been deprecated").WithLocation(25, 9) + // (12,9): warning CS0618: 'IGoo1.Goo()' is obsolete: 'IGoo1.Goo has been deprecated' + // a.Goo(); // IGoo1 + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "a.Goo()").WithArguments("IGoo1.Goo()", "IGoo1.Goo has been deprecated").WithLocation(12, 9), + // (19,9): warning CS0618: 'ConcreteGoo2.Goo()' is obsolete: 'ConcreteGoo2.Goo has been deprecated' + // b.Goo(); // ConcreteGoo2 + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "b.Goo()").WithArguments("ConcreteGoo2.Goo()", "ConcreteGoo2.Goo has been deprecated").WithLocation(19, 9), + // (24,9): warning CS0618: 'IGoo3.Goo()' is obsolete: 'IGoo3.Goo has been deprecated' + // a.Goo(); // IGoo3 + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "a.Goo()").WithArguments("IGoo3.Goo()", "IGoo3.Goo has been deprecated").WithLocation(24, 9), + // (25,9): warning CS0618: 'ConcreteGoo3.Goo()' is obsolete: 'ConcreteGoo3.Goo has been deprecated' + // b.Goo(); // ConcreteGoo3 + Diagnostic(ErrorCode.WRN_DeprecatedSymbolStr, "b.Goo()").WithArguments("ConcreteGoo3.Goo()", "ConcreteGoo3.Goo has been deprecated").WithLocation(25, 9) }; compilation1.VerifyDiagnostics(expected); @@ -8135,7 +8135,7 @@ class Test { public static void F(IExceptionalInterface i) { - i.ExceptionalProp = ""foo""; + i.ExceptionalProp = ""goo""; Console.WriteLine(i.ExceptionalProp); } } @@ -8144,7 +8144,7 @@ public static void F(IExceptionalInterface i) var expected = new[] { // (8,9): error CS0619: 'IExceptionalInterface.ExceptionalProp.set' is obsolete: 'Changed my mind; don't put this prop.' - // i.ExceptionalProp = "foo"; + // i.ExceptionalProp = "goo"; Diagnostic(ErrorCode.ERR_DeprecatedSymbolStr, "i.ExceptionalProp").WithArguments("IExceptionalInterface.ExceptionalProp.set", "Changed my mind; don't put this prop.").WithLocation(8, 9), // (9,27): error CS0619: 'IExceptionalInterface.ExceptionalProp.get' is obsolete: 'Actually, don't even use the prop at all.' // Console.WriteLine(i.ExceptionalProp); diff --git a/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs b/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs index db72e72c81fb8..5a5ad98186833 100644 --- a/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -295,10 +295,10 @@ public void PubKeyFileNotFoundOptions() { string s = "public class C {}"; var other = CreateStandardCompilation(s, - options: TestOptions.ReleaseDll.WithCryptoKeyFile("foo").WithStrongNameProvider(s_defaultProvider)); + options: TestOptions.ReleaseDll.WithCryptoKeyFile("goo").WithStrongNameProvider(s_defaultProvider)); other.VerifyDiagnostics( - Diagnostic(ErrorCode.ERR_PublicKeyFileFailure).WithArguments("foo", CodeAnalysisResources.FileNotFound)); + Diagnostic(ErrorCode.ERR_PublicKeyFileFailure).WithArguments("goo", CodeAnalysisResources.FileNotFound)); Assert.True(other.Assembly.Identity.PublicKey.IsEmpty); } @@ -322,14 +322,14 @@ public void PubKeyContainerBogusOptions() { string s = "public class C {}"; var other = CreateStandardCompilation(s, - options: TestOptions.ReleaseDll.WithCryptoKeyContainer("foo").WithStrongNameProvider(s_defaultProvider)); + options: TestOptions.ReleaseDll.WithCryptoKeyContainer("goo").WithStrongNameProvider(s_defaultProvider)); - // error CS7028: Error signing output with public key from container 'foo' -- Keyset does not exist (Exception from HRESULT: 0x80090016) + // error CS7028: Error signing output with public key from container 'goo' -- Keyset does not exist (Exception from HRESULT: 0x80090016) var err = other.GetDiagnostics().Single(); Assert.Equal((int)ErrorCode.ERR_PublicKeyContainerFailure, err.Code); Assert.Equal(2, err.Arguments.Count); - Assert.Equal("foo", err.Arguments[0]); + Assert.Equal("goo", err.Arguments[0]); Assert.True(((string)err.Arguments[1]).EndsWith(" HRESULT: 0x80090016)", StringComparison.Ordinal)); Assert.True(other.Assembly.Identity.PublicKey.IsEmpty); @@ -683,7 +683,7 @@ public void PublicKeyFromOptions_InvalidCompilationOptions() public void IVTBasicCompilation() { string s = @"[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(""WantsIVTAccess"")] - public class C { internal void Foo() {} }"; + public class C { internal void Goo() {} }"; var other = CreateStandardCompilation(s, options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); @@ -694,7 +694,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -703,7 +703,7 @@ protected B(C o) options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); //compilation should not succeed, and internals should not be imported. - c.VerifyDiagnostics(Diagnostic(ErrorCode.ERR_BadAccess, "Foo").WithArguments("C.Foo()")); + c.VerifyDiagnostics(Diagnostic(ErrorCode.ERR_BadAccess, "Goo").WithArguments("C.Goo()")); var c2 = CreateStandardCompilation( @"public class A @@ -712,7 +712,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -727,7 +727,7 @@ protected B(C o) public void IVTBasicMetadata() { string s = @"[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(""WantsIVTAccess"")] - public class C { internal void Foo() {} }"; + public class C { internal void Goo() {} }"; var otherStream = CreateStandardCompilation(s, options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)).EmitToStream(); @@ -738,7 +738,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -747,7 +747,7 @@ protected B(C o) options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); //compilation should not succeed, and internals should not be imported. - c.VerifyDiagnostics(Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "Foo").WithArguments("C", "Foo")); + c.VerifyDiagnostics(Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "Goo").WithArguments("C", "Goo")); otherStream.Position = 0; @@ -758,7 +758,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -773,7 +773,7 @@ protected B(C o) public void IVTSigned() { string s = @"[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(""John, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b986f6b5ea5717d35c72d38561f413e267029efa9b5f107b9331d83df657381325b3a67b75812f63a9436ceccb49494de8f574f8e639d4d26c0fcf8b0e9a1a196b80b6f6ed053628d10d027e032df2ed1d60835e5f47d32c9ef6da10d0366a319573362c821b5f8fa5abc5bb22241de6f666a85d82d6ba8c3090d01636bd2bb"")] - public class C { internal void Foo() {} }"; + public class C { internal void Goo() {} }"; var other = CreateStandardCompilation(s, options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider), @@ -788,7 +788,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -803,7 +803,7 @@ protected B(C o) public void IVTErrorNotBothSigned() { string s = @"[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(""John, PublicKey=00240000048000009400000006020000002400005253413100040000010001002b986f6b5ea5717d35c72d38561f413e267029efa9b5f107b9331d83df657381325b3a67b75812f63a9436ceccb49494de8f574f8e639d4d26c0fcf8b0e9a1a196b80b6f6ed053628d10d027e032df2ed1d60835e5f47d32c9ef6da10d0366a319573362c821b5f8fa5abc5bb22241de6f666a85d82d6ba8c3090d01636bd2bb"")] - public class C { internal void Foo() {} }"; + public class C { internal void Goo() {} }"; var other = CreateStandardCompilation(s, assemblyName: "Paul", options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); other.VerifyDiagnostics(); @@ -815,7 +815,7 @@ internal class B { protected B(C o) { - o.Foo(); + o.Goo(); } } }", @@ -823,7 +823,7 @@ protected B(C o) assemblyName: "John", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider)); - // We allow John to access Paul's internal Foo even though strong-named John should not be referencing weak-named Paul. + // We allow John to access Paul's internal Goo even though strong-named John should not be referencing weak-named Paul. // Paul has, after all, specifically granted access to John. // TODO: During emit time we should produce an error that says that a strong-named assembly cannot reference @@ -989,7 +989,7 @@ namespace ClassLibrary2 { internal class A { - public void Foo(ClassLibrary1.Class1 a) + public void Goo(ClassLibrary1.Class1 a) { } } @@ -1014,7 +1014,7 @@ public void IVTHasCulture() [assembly: InternalsVisibleTo(""WantsIVTAccess, Culture=neutral"")] public class C { - static void Foo() {} + static void Goo() {} } ", options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); @@ -1110,7 +1110,7 @@ public void SignIt() @" public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider)); @@ -1353,7 +1353,7 @@ public void SignItWithOnlyPublicKey() @" public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithStrongNameProvider(s_defaultProvider)); @@ -1378,7 +1378,7 @@ public void DelaySignItWithOnlyPublicKey() [assembly: System.Reflection.AssemblyDelaySign(true)] public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithStrongNameProvider(s_defaultProvider)); using (var outStrm = new MemoryStream()) @@ -1396,7 +1396,7 @@ public void DelaySignButNoKey() [assembly: System.Reflection.AssemblyDelaySign(true)] public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithStrongNameProvider(s_defaultProvider)); @@ -1416,7 +1416,7 @@ public void SignInMemory() @" public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider)); var outStrm = new MemoryStream(); @@ -1432,7 +1432,7 @@ public void DelaySignConflict() [assembly: System.Reflection.AssemblyDelaySign(true)] public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithDelaySign(false).WithStrongNameProvider(s_defaultProvider)); var outStrm = new MemoryStream(); @@ -1450,7 +1450,7 @@ public void DelaySignNoConflict() [assembly: System.Reflection.AssemblyDelaySign(true)] public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithDelaySign(true).WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider)); var outStrm = new MemoryStream(); @@ -1477,7 +1477,7 @@ public void DelaySignWithAssemblySignatureKey() [assembly: System.Reflection.AssemblySignatureKey(""002400000c800000140100000602000000240000525341310008000001000100613399aff18ef1a2c2514a273a42d9042b72321f1757102df9ebada69923e2738406c21e5b801552ab8d200a65a235e001ac9adc25f2d811eb09496a4c6a59d4619589c69f5baf0c4179a47311d92555cd006acc8b5959f2bd6e10e360c34537a1d266da8085856583c85d81da7f3ec01ed9564c58d93d713cd0172c8e23a10f0239b80c96b07736f5d8b022542a4e74251a5f432824318b3539a5a087f8e53d2f135f9ca47f3bb2e10aff0af0849504fb7cea3ff192dc8de0edad64c68efde34c56d302ad55fd6e80f302d5efcdeae953658d3452561b5f36c542efdbdd9f888538d374cef106acf7d93a4445c3c73cd911f0571aaf3d54da12b11ddec375b3"", ""a5a866e1ee186f807668209f3b11236ace5e21f117803a3143abb126dd035d7d2f876b6938aaf2ee3414d5420d753621400db44a49c486ce134300a2106adb6bdb433590fef8ad5c43cba82290dc49530effd86523d9483c00f458af46890036b0e2c61d077d7fbac467a506eba29e467a87198b053c749aa2a4d2840c784e6d"")] public class C { - static void Foo() {} + static void Goo() {} }", new MetadataReference[] { MscorlibRef_v4_0_30316_17626 }, options: TestOptions.ReleaseDll.WithDelaySign(true).WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider)); @@ -1896,7 +1896,7 @@ public class C1 @" public class C { - internal void Foo() + internal void Goo() { var x = new System.Guid(); System.Console.WriteLine(x); @@ -1923,7 +1923,7 @@ public class C1 @" public class C { - internal void Foo() + internal void Goo() { var x = new C1(); System.Console.WriteLine(x); @@ -1995,7 +1995,7 @@ public void AssemblySignatureKeyAttribute_1() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2021,7 +2021,7 @@ public void AssemblySignatureKeyAttribute_2() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2049,7 +2049,7 @@ public void AssemblySignatureKeyAttribute_3() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_keyPairFile).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2076,7 +2076,7 @@ public void AssemblySignatureKeyAttribute_4() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithDelaySign(true).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2105,7 +2105,7 @@ public void AssemblySignatureKeyAttribute_5() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithDelaySign(true).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2129,7 +2129,7 @@ public void AssemblySignatureKeyAttribute_6() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithDelaySign(true).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); @@ -2158,7 +2158,7 @@ public void AssemblySignatureKeyAttribute_7() public class C { - static void Foo() {} + static void Goo() {} }", options: TestOptions.ReleaseDll.WithCryptoKeyFile(s_publicKeyFile).WithDelaySign(true).WithStrongNameProvider(s_defaultProvider), references: new[] { MscorlibRef_v4_0_30316_17626 }); diff --git a/src/Compilers/CSharp/Test/Emit/BreakingChanges.cs b/src/Compilers/CSharp/Test/Emit/BreakingChanges.cs index 4175f4019e8cc..46ec5da9b7192 100644 --- a/src/Compilers/CSharp/Test/Emit/BreakingChanges.cs +++ b/src/Compilers/CSharp/Test/Emit/BreakingChanges.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -258,15 +258,15 @@ void CS1730ERR_CantUseAttributeOnInvaildLocation() var test = @"using System; [AttributeUsage(AttributeTargets.All)] -public class Foo : Attribute +public class Goo : Attribute { public int Name; - public Foo(int sName) { Name = sName; } + public Goo(int sName) { Name = sName; } } public delegate void EventHandler(object sender, EventArgs e); -[assembly: Foo(5)] +[assembly: Goo(5)] public class Test { } "; @@ -359,8 +359,8 @@ class Test01 public static int Bar(int x, T y, params int[] z) { return 1; } public static int Bar(string y, int x) { return 0; } // Roslyn pick this one - public static int Foo(int x, T y) { return 1; } - public static int Foo(string y, int x) { return 0; } // Roslyn pick this one + public static int Goo(int x, T y) { return 1; } + public static int Goo(string y, int x) { return 0; } // Roslyn pick this one public static int AbcDef(int x, T y) { return 0; } // Roslyn pick this one public static int AbcDef(string y, int x, params int[] z) { return 1; } @@ -368,7 +368,7 @@ class Test01 public static void Main01() { Console.Write(Bar(x: 1, y: ""T1"")); // Dev10:CS0121 - Console.Write(Foo(x: 1, y: ""T2"")); // Dev10:CS0121 + Console.Write(Goo(x: 1, y: ""T2"")); // Dev10:CS0121 Console.Write(AbcDef(x: 1, y: ""T3"")); // Dev10:CS0121 } } @@ -449,14 +449,14 @@ class A { static void Main() { - Foo( delegate () { throw new Exception(); }); // both Dev10 & Roslyn no error - Foo(x: () => { throw new Exception(); }); // Dev10: CS0121, Roslyn: no error + Goo( delegate () { throw new Exception(); }); // both Dev10 & Roslyn no error + Goo(x: () => { throw new Exception(); }); // Dev10: CS0121, Roslyn: no error } - public static void Foo(Action x) + public static void Goo(Action x) { Console.WriteLine(1); } - public static void Foo(Func x) + public static void Goo(Func x) { Console.WriteLine(2); // Roslyn call this one } @@ -593,10 +593,10 @@ public void ExplicitUDCWithGenericConstraints() string source = @"using System; -public interface IFoo { void Method(); } -public class CT : IFoo { public void Method() { } } +public interface IGoo { void Method(); } +public class CT : IGoo { public void Method() { } } -public class GenC where T : IFoo +public class GenC where T : IGoo { public T valueT; public static explicit operator T(GenC val) @@ -610,7 +610,7 @@ public class Test { public static void Main() { - var _class = new GenC(); + var _class = new GenC(); var ret = (CT)_class; } } @@ -1115,7 +1115,7 @@ public static void Main() var demo = new test(); try { - foreach (var x in demo.Foo()) { } + foreach (var x in demo.Goo()) { } } catch (Exception) { @@ -1126,7 +1126,7 @@ public static void Main() class test { public int count = 0; - public IEnumerable Foo() + public IEnumerable Goo() { try { @@ -1152,7 +1152,7 @@ public IEnumerable Foo() var verifier = CompileAndVerify(source, expectedOutput: " ++ EX 1"); // must not load "<>4__this" - verifier.VerifyIL("Program.test.d__1.System.Collections.IEnumerator.MoveNext()", @" + verifier.VerifyIL("Program.test.d__1.System.Collections.IEnumerator.MoveNext()", @" { // Code size 101 (0x65) .maxstack 2 @@ -1161,7 +1161,7 @@ .locals init (bool V_0, .try { IL_0000: ldarg.0 - IL_0001: ldfld ""int Program.test.d__1.<>1__state"" + IL_0001: ldfld ""int Program.test.d__1.<>1__state"" IL_0006: stloc.1 IL_0007: ldloc.1 IL_0008: brfalse.s IL_0012 @@ -1173,22 +1173,22 @@ .locals init (bool V_0, IL_0010: leave.s IL_0063 IL_0012: ldarg.0 IL_0013: ldc.i4.m1 - IL_0014: stfld ""int Program.test.d__1.<>1__state"" + IL_0014: stfld ""int Program.test.d__1.<>1__state"" IL_0019: ldarg.0 IL_001a: ldc.i4.s -3 - IL_001c: stfld ""int Program.test.d__1.<>1__state"" + IL_001c: stfld ""int Program.test.d__1.<>1__state"" IL_0021: ldarg.0 IL_0022: ldnull - IL_0023: stfld ""object Program.test.d__1.<>2__current"" + IL_0023: stfld ""object Program.test.d__1.<>2__current"" IL_0028: ldarg.0 IL_0029: ldc.i4.1 - IL_002a: stfld ""int Program.test.d__1.<>1__state"" + IL_002a: stfld ""int Program.test.d__1.<>1__state"" IL_002f: ldc.i4.1 IL_0030: stloc.0 IL_0031: leave.s IL_0063 IL_0033: ldarg.0 IL_0034: ldc.i4.s -3 - IL_0036: stfld ""int Program.test.d__1.<>1__state"" + IL_0036: stfld ""int Program.test.d__1.<>1__state"" .try { IL_003b: ldc.i4.0 @@ -1201,21 +1201,21 @@ .locals init (bool V_0, IL_0040: leave.s IL_0042 } IL_0042: ldarg.0 - IL_0043: call ""void Program.test.d__1.<>m__Finally1()"" + IL_0043: call ""void Program.test.d__1.<>m__Finally1()"" IL_0048: br.s IL_0052 IL_004a: ldarg.0 - IL_004b: call ""void Program.test.d__1.<>m__Finally1()"" + IL_004b: call ""void Program.test.d__1.<>m__Finally1()"" IL_0050: leave.s IL_0063 IL_0052: leave.s IL_005b } fault { IL_0054: ldarg.0 - IL_0055: call ""void Program.test.d__1.Dispose()"" + IL_0055: call ""void Program.test.d__1.Dispose()"" IL_005a: endfinally } IL_005b: ldarg.0 - IL_005c: call ""void Program.test.d__1.Dispose()"" + IL_005c: call ""void Program.test.d__1.Dispose()"" IL_0061: ldc.i4.1 IL_0062: stloc.0 IL_0063: ldloc.0 @@ -1224,15 +1224,15 @@ .locals init (bool V_0, "); // must load "<>4__this" - verifier.VerifyIL("Program.test.d__1.<>m__Finally1()", @" + verifier.VerifyIL("Program.test.d__1.<>m__Finally1()", @" { // Code size 42 (0x2a) .maxstack 3 IL_0000: ldarg.0 IL_0001: ldc.i4.m1 - IL_0002: stfld ""int Program.test.d__1.<>1__state"" + IL_0002: stfld ""int Program.test.d__1.<>1__state"" IL_0007: ldarg.0 - IL_0008: ldfld ""Program.test Program.test.d__1.<>4__this"" + IL_0008: ldfld ""Program.test Program.test.d__1.<>4__this"" IL_000d: ldstr ""++ "" IL_0012: call ""void System.Console.Write(string)"" IL_0017: dup @@ -1303,7 +1303,7 @@ public class Kind { public static int Decimal; } public class ExpressionBinder { private static PredefinedTypes PredefinedTypes = null; - private void Foo() + private void Goo() { if (0 == (int)PredefinedTypes.Kind.Decimal) { } } @@ -1501,8 +1501,8 @@ public void NotRuntimeAmbiguousBecauseOfReturnTypes() class Base { - public virtual int Foo(ref S x) { return 0; } - public virtual string Foo(out T x) + public virtual int Goo(ref S x) { return 0; } + public virtual string Goo(out T x) { x = default(T); return ""Base.Out""; } @@ -1510,14 +1510,14 @@ public virtual string Foo(out T x) class Derived : Base { - public override string Foo(out int x) + public override string Goo(out int x) { x = 0; return ""Derived.Out""; } static void Main() { int x; - Console.WriteLine(new Derived().Foo(out x)); + Console.WriteLine(new Derived().Goo(out x)); } } "; @@ -1606,11 +1606,11 @@ class Test { static void Main() { - Console.Write(Util.Count(Foo())); - Console.Write(Util.Count(Foo())); + Console.Write(Util.Count(Goo())); + Console.Write(Util.Count(Goo())); } - static Wrapper Foo() where T : IEnumerable, IAdd, new() + static Wrapper Goo() where T : IEnumerable, IAdd, new() { return new Wrapper { Item = { 1, 2, 3} }; } @@ -1631,10 +1631,10 @@ class Test { static void Main() { - Console.Write(Util.Count(Foo())); + Console.Write(Util.Count(Goo())); } - static Wrapper Foo() where T : class, IEnumerable, IAdd, new() + static Wrapper Goo() where T : class, IEnumerable, IAdd, new() { return new Wrapper { Item = { 1, 2, 3} }; } @@ -1656,10 +1656,10 @@ class Test { static void Main() { - Console.Write(Util.Count(Foo())); + Console.Write(Util.Count(Goo())); } - static Wrapper Foo() where T : struct, IEnumerable, IAdd + static Wrapper Goo() where T : struct, IEnumerable, IAdd { return new Wrapper { Item = { 1, 2, 3} }; } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs index 55f12adb9a61f..0b6a5f4e9334e 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncEHTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -589,10 +589,10 @@ static void Main(string[] args) } static async Task Bar() { - NotImplementedException ex = await Foo(); + NotImplementedException ex = await Goo(); return 3; } - public static async Task Foo() where T : Exception + public static async Task Goo() where T : Exception { Task task = null; if (task != null) await task; diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs index 20c6e7dc0cafb..e294c2ce5e101 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncLocalsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -378,10 +378,10 @@ struct TestCase { public async Task Run() { - return await Foo(); + return await Goo(); } - public async Task Foo() + public async Task Goo() { return await Task.Factory.StartNew(() => 42); } @@ -416,10 +416,10 @@ struct TestCase { public IEnumerable Run() { - yield return Foo(); + yield return Goo(); } - public int Foo() + public int Goo() { return 42; } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs index 7a70a9b0cf810..92aefbda68f75 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncSpillTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1556,14 +1556,14 @@ public async void Run() try { MyStruct ms = new MyStruct(); - var x = ms[index: await Foo()]; + var x = ms[index: await Goo()]; } finally { Driver.CompletedSignal.Set(); } } - public async Task Foo() + public async Task Goo() { await Task.Delay(1); return 1; @@ -1847,7 +1847,7 @@ public async void Run() int[][] arr2 = new[] { new []{await GetVal(2),await GetVal(3)}, - await Foo() + await Goo() }; if (arr2[0][1] == 3 && arr2[1][1] == 2) Driver.Count++; @@ -1860,7 +1860,7 @@ await Foo() } } - public async Task Foo() + public async Task Goo() { await Task.Delay(1); return new int[] { 1, 2, 3 }; @@ -1994,7 +1994,7 @@ public async void Run() dynamic arr2 = new[] { new []{await GetVal(2),3}, - await Foo() + await Goo() }; if (arr2[0][1] == 3 && arr2[1][1] == 2) Driver.Count++; @@ -2007,7 +2007,7 @@ await Foo() } } - public async Task Foo() + public async Task Goo() { await Task.Delay(1); return new int[] { 1, 2, 3 }; @@ -2337,7 +2337,7 @@ public void SpillWithByRefArguments01() class BaseTestCase { - public void FooRef(ref decimal d, int x, out decimal od) + public void GooRef(ref decimal d, int x, out decimal od) { od = d; d++; @@ -2361,7 +2361,7 @@ public async void Run() decimal od; tests++; - base.FooRef(ref d, await base.GetVal(4), out od); + base.GooRef(ref d, await base.GetVal(4), out od); if (d == 2 && od == 1) Driver.Count++; } finally @@ -2513,15 +2513,15 @@ public void Async_StackSpill_Argument_Generic04() using System.Threading.Tasks; public class mc { - async public System.Threading.Tasks.Task Foo(T t, V u) { await Task.Delay(1); return u; } + async public System.Threading.Tasks.Task Goo(T t, V u) { await Task.Delay(1); return u; } } class Test { - static async Task Foo() + static async Task Goo() { dynamic mc = new mc(); - var rez = await mc.Foo(null, await ((Func>)(async () => { await Task.Delay(1); return ""Test""; }))()); + var rez = await mc.Goo(null, await ((Func>)(async () => { await Task.Delay(1); return ""Test""; }))()); if (rez == ""Test"") return 0; return 1; @@ -2529,7 +2529,7 @@ static async Task Foo() static void Main() { - Console.WriteLine(Foo().Result); + Console.WriteLine(Goo().Result); } }"; CompileAndVerify(source, "0", references: new[] { CSharpRef }); @@ -2649,7 +2649,7 @@ await GetValue(2) } } - public int Foo { get; set; } + public int Goo { get; set; } } class Driver @@ -2686,14 +2686,14 @@ class MyClass class TestCase { - public static int Foo(ref int x, int y) + public static int Goo(ref int x, int y) { return x + y; } public async Task Run() { - return Foo( + return Goo( ref (new MyClass() { Field = 21 }.Field), await Task.Factory.StartNew(() => 21)); } @@ -2853,12 +2853,12 @@ struct s1 { public int X; - public async void Foo1() + public async void Goo1() { Bar(ref this, await Task.FromResult(42)); } - public void Foo2() + public void Goo2() { Bar(ref this, 42); } @@ -2873,12 +2873,12 @@ class c1 { public int X; - public async void Foo1() + public async void Goo1() { Bar(this, await Task.FromResult(42)); } - public void Foo2() + public void Goo2() { Bar(this, 42); } @@ -2896,28 +2896,28 @@ public static void Main() { s1 s; s.X = -1; - s.Foo1(); + s.Goo1(); Console.WriteLine(s.X); } { s1 s; s.X = -1; - s.Foo2(); + s.Goo2(); Console.WriteLine(s.X); } { c1 c = new c1(); c.X = -1; - c.Foo1(); + c.Goo1(); Console.WriteLine(c.X); } { c1 c = new c1(); c.X = -1; - c.Foo2(); + c.Goo2(); Console.WriteLine(c.X); } } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs index ff0b15ff4bf24..730a8ba161db6 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -337,7 +337,7 @@ public void Conformance_Awaiting_Methods_Parameter003() class TestCase { public static int Count = 0; - public static T Foo(T t) + public static T Goo(T t) { return t; } @@ -352,9 +352,9 @@ public static async void Run() { try { - int x1 = Foo(await Bar(4)); + int x1 = Goo(await Bar(4)); Task t = Bar(5); - int x2 = Foo(await t); + int x2 = Goo(await t); if (x1 != 4) Count++; if (x2 != 5) @@ -879,7 +879,7 @@ public void Inference() struct Test { - public Task Foo + public Task Goo { get { return Task.Run(async () => { await Task.Delay(1); return ""abc""; }); } } @@ -905,12 +905,12 @@ public async void Run() Test t = new Test(); tests++; - var x1 = await TestCase.GetValue(await t.Foo); + var x1 = await TestCase.GetValue(await t.Goo); if (x1 == ""abc"") Driver.Count++; tests++; - var x2 = await TestCase.GetValue1(t.Foo); + var x2 = await TestCase.GetValue1(t.Goo); if (x2 == ""abc"") Driver.Count++; @@ -955,8 +955,8 @@ class TestCase public async void Run() { int tests = 0; - var x1 = ((await Foo1()) is object); - var x2 = ((await Foo2()) as string); + var x1 = ((await Goo1()) is object); + var x2 = ((await Goo2()) as string); if (x1 == true) tests++; if (x2 == ""string"") @@ -966,7 +966,7 @@ public async void Run() Driver.CompletedSignal.Set(); } - public async Task Foo1() + public async Task Goo1() { await Task.Delay(1); TestCase.Count++; @@ -974,7 +974,7 @@ public async Task Foo1() return i; } - public async Task Foo2() + public async Task Goo2() { await Task.Delay(1); TestCase.Count++; @@ -1196,9 +1196,9 @@ public void Conformance_OverloadResolution_1Class_Generic_regularMethod05() struct Test { //Regular methods - public int Foo(Func> f) { return 1; } - public int Foo(Func> f) { return 2; } - public int Foo(Func> f) { return 3; } + public int Goo(Func> f) { return 1; } + public int Goo(Func> f) { return 2; } + public int Goo(Func> f) { return 3; } } class TestCase @@ -1211,21 +1211,21 @@ public void Run() int rez = 0; // Pick double Driver.Tests++; - rez = test.Foo(async () => { return 1.0; }); + rez = test.Goo(async () => { return 1.0; }); if (rez == 3) Driver.Count++; //pick int Driver.Tests++; - rez = test.Foo(async delegate() { return 1; }); + rez = test.Goo(async delegate() { return 1; }); if (rez == 1) Driver.Count++; // The best overload is Func> Driver.Tests++; - rez = test.Foo(async () => { return """"; }); + rez = test.Goo(async () => { return """"; }); if (rez == 2) Driver.Count++; Driver.Tests++; - rez = test.Foo(async delegate() { return """"; }); + rez = test.Goo(async delegate() { return """"; }); if (rez == 2) Driver.Count++; } } @@ -1295,7 +1295,7 @@ public void Await15() struct DynamicClass { - public async Task Foo(T t) + public async Task Goo(T t) { await Task.Delay(1); return t; @@ -1320,7 +1320,7 @@ public async void Run() try { tests++; - var x1 = await dc.Foo(""""); + var x1 = await dc.Goo(""""); if (x1 == """") Driver.Count++; tests++; @@ -1328,7 +1328,7 @@ public async void Run() if (x2 == 123) Driver.Count++; tests++; - var x3 = await await dc.Bar(await dc.Foo(234)); + var x3 = await await dc.Bar(await dc.Goo(234)); if (x3 == 234) Driver.Count++; } finally @@ -1683,7 +1683,7 @@ public async void Run() { ms[index: null] = Task.Run>(async () => { await Task.Delay(1); Interlocked.Increment(ref TestCase.Count); return () => (123); }); this.tests++; - var x = await ms[index: await Foo(null)]; + var x = await ms[index: await Goo(null)]; if (x() == 123) this.tests++; } @@ -1695,7 +1695,7 @@ public async void Run() } } - public async Task>> Foo(Task> d) + public async Task>> Goo(Task> d) { await Task.Delay(1); Interlocked.Increment(ref TestCase.Count); @@ -1932,7 +1932,7 @@ public void Generic05() class TestCase { - public T Foo(T x, T y, int z) + public T Goo(T x, T y, int z) { return x; } @@ -1945,7 +1945,7 @@ public T GetVal(T t) public IEnumerable Run(T t) { dynamic d = GetVal(t); - yield return Foo(t, d, 3); + yield return Goo(t, d, 3); } } @@ -2856,11 +2856,11 @@ public void BetterConversionFromAsyncLambda() using System; class TestCase { - public static int Foo(Func> f) { return 12; } - public static int Foo(Func> f) { return 13; } + public static int Goo(Func> f) { return 12; } + public static int Goo(Func> f) { return 13; } public static void Main() { - Console.WriteLine(Foo(async delegate() { return 14; })); + Console.WriteLine(Goo(async delegate() { return 14; })); } } "; @@ -3028,10 +3028,10 @@ class Program { static void Main() { - Foo().Wait(); + Goo().Wait(); } - static async Task Foo() + static async Task Goo() { Console.WriteLine(""{0}"" as dynamic, await Task.FromResult(new T[] { })); } @@ -4938,19 +4938,19 @@ public void PatternTempsAreLongLived() { var source = @"using System; -public class Foo {} +public class Goo {} public class C { public static void Main(string[] args) { var c = new C(); - c.M(new Foo()); + c.M(new Goo()); c.M(new object()); } public async void M(object o) { switch (o) { - case Foo _: + case Goo _: Console.Write(0); break; default: @@ -4972,16 +4972,16 @@ public void PatternTempsSpill() using System.Threading.Tasks; public class C { - public class Foo + public class Goo { public int Value; } public static void Main(string[] args) { var c = new C(); - c.M(new Foo() { Value = 1 }); - c.M(new Foo() { Value = 2 }); - c.M(new Foo() { Value = 3 }); + c.M(new Goo() { Value = 1 }); + c.M(new Goo() { Value = 2 }); + c.M(new Goo() { Value = 3 }); c.M(new object()); } public void M(object o) @@ -4991,14 +4991,14 @@ public void M(object o) public async Task MAsync(object o) { switch (o) { - case Foo foo when await Copy(foo.Value) == 1: - Console.Write($""{foo.Value}=1 ""); + case Goo goo when await Copy(goo.Value) == 1: + Console.Write($""{goo.Value}=1 ""); break; - case Foo foo when await Copy(foo.Value) == 2: - Console.Write($""{foo.Value}=2 ""); + case Goo goo when await Copy(goo.Value) == 2: + Console.Write($""{goo.Value}=2 ""); break; - case Foo foo: - Console.Write($""{foo.Value} ""); + case Goo goo: + Console.Write($""{goo.Value} ""); break; default: Console.Write(""X ""); diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenCheckedTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenCheckedTests.cs index 1886c8c03e445..2cc1cbc630c8b 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenCheckedTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenCheckedTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -2282,13 +2282,13 @@ public class MyClass { public static void Main() { - short foo = 0; + short goo = 0; try { for (int i = 0; i < 2; i++) { - checked { foo += 32000; } - Console.Write(foo); + checked { goo += 32000; } + Console.Write(goo); } } catch (OverflowException) diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenClosureLambdaTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenClosureLambdaTests.cs index 53d6b309d2386..21fd1502a740b 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenClosureLambdaTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenClosureLambdaTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -742,7 +742,7 @@ public void CatchVarLifted2() class Program { - static bool Foo(Action x) + static bool Goo(Action x) { x(); return true; @@ -754,7 +754,7 @@ static void Main() { throw new Exception(""fail""); } - catch (Exception ex) when (Foo(() => { ex = new Exception(""pass""); })) + catch (Exception ex) when (Goo(() => { ex = new Exception(""pass""); })) { Console.Write(ex.Message); } @@ -792,7 +792,7 @@ .locals init (Program.<>c__DisplayClass1_0 V_0, //CS$<>8__locals0 IL_0025: ldloc.0 IL_0026: ldftn ""void Program.<>c__DisplayClass1_0.
b__0()"" IL_002c: newobj ""System.Action..ctor(object, System.IntPtr)"" - IL_0031: call ""bool Program.Foo(System.Action)"" + IL_0031: call ""bool Program.Goo(System.Action)"" IL_0036: ldc.i4.0 IL_0037: cgt.un IL_0039: endfilter @@ -818,7 +818,7 @@ public void CatchVarLifted2a() class Program { - static bool Foo(Action x) + static bool Goo(Action x) { x(); return true; @@ -830,11 +830,11 @@ static void Main() { throw new Exception(""fail""); } - catch (ArgumentException ex) when (Foo(() => { ex = new ArgumentException(""fail""); })) + catch (ArgumentException ex) when (Goo(() => { ex = new ArgumentException(""fail""); })) { Console.Write(ex.Message); } - catch (Exception ex) when (Foo(() => { ex = new Exception(""pass""); })) + catch (Exception ex) when (Goo(() => { ex = new Exception(""pass""); })) { Console.Write(ex.Message); } @@ -1172,11 +1172,11 @@ public static void Main(string[] args) Console.WriteLine(s); }; }; - d1(""foo""); + d1(""goo""); d0(); } }"; - CompileAndVerify(source, expectedOutput: "foo"); + CompileAndVerify(source, expectedOutput: "goo"); } [Fact] @@ -2675,13 +2675,13 @@ class C public static void Main(string[] args) { G.F(12); - G.F(""foo""); + G.F(""goo""); } }"; CompileAndVerify(source, expectedOutput: @" 12 -foo +goo "); } @@ -2708,13 +2708,13 @@ class C public static void Main(string[] args) { G.F(12); - G.F(""foo""); + G.F(""goo""); } }"; CompileAndVerify(source, expectedOutput: @" 12 -foo +goo "); } @@ -3116,7 +3116,7 @@ static void Main(string[] args) query = () => { i = 6; - Foo(i++); + Goo(i++); return i; }; } @@ -3125,7 +3125,7 @@ static void Main(string[] args) System.Console.WriteLine(query.Invoke()); } - public static int Foo(int i) + public static int Goo(int i) { i = 4; return i; @@ -3160,7 +3160,7 @@ public void StructDelegate1() using System; class Program { - public static void Foo(T x) + public static void Goo(T x) { Func f = x.ToString; Console.Write(f.Invoke()); @@ -3169,10 +3169,10 @@ public static void Foo(T x) static void Main() { string s = ""Hi""; - Foo(s); + Goo(s); int x = 42; - Foo(x); + Goo(x); } }" ; @@ -3320,8 +3320,8 @@ public static void Test5() public static void Test6() { - Func a1 = Foo.Bar(); - Func a2 = Foo.Bar(); + Func a1 = Goo.Bar(); + Func a2 = Goo.Bar(); Assert(ReferenceEquals(a1, a2)); // both native compiler and Roslyn miss this } @@ -3336,12 +3336,12 @@ public static void Main(string[] args) } } -class Foo +class Goo { static T t; public static Func Bar() { - return () => Foo.t; + return () => Goo.t; } }"; CompileAndVerify(source, expectedOutput: ""); @@ -3611,13 +3611,13 @@ public static void Main() class c1 { - public int foo = 42; + public int goo = 42; public object Test() { if (T()) { - Func a = (s) => s == foo && ((Func)(() => s == foo)).Invoke(); + Func a = (s) => s == goo && ((Func)(() => s == goo)).Invoke(); return a.Invoke(42); } @@ -3626,7 +3626,7 @@ public object Test() if (T()) { - Func a = (s) => aaa == foo; + Func a = (s) => aaa == goo; return a.Invoke(42); } @@ -4084,7 +4084,7 @@ namespace Lambda.Bugs { public interface I { - void Foo(int x); + void Goo(int x); } public class OuterGenericClass @@ -4093,7 +4093,7 @@ public class NestedClass : OuterGenericClass { } public class C : I { - void I.Foo(int x) + void I.Goo(int x) { Func f = () => x; Console.WriteLine(f()); @@ -4108,21 +4108,21 @@ public static void Main() I.NestedClass.NestedClass.NestedClass.NestedClass.NestedClass> x = new OuterGenericClass.C(); - x.Foo(1); + x.Goo(1); } } } "; CreateStandardCompilation(source).VerifyEmitDiagnostics( - // error CS7013: Name '.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo>b__0' exceeds the maximum length allowed in metadata. - Diagnostic(ErrorCode.ERR_MetadataNameTooLong).WithArguments(".NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo>b__0").WithLocation(1, 1), - // (17,81): error CS7013: Name 'Lambda.Bugs.I.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo' exceeds the maximum length allowed in metadata. - // void I.Foo(int x) - Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "Foo").WithArguments("Lambda.Bugs.I.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo").WithLocation(17, 81), - // (19,31): error CS7013: Name '.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo>b__0' exceeds the maximum length allowed in metadata. + // error CS7013: Name '.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo>b__0' exceeds the maximum length allowed in metadata. + Diagnostic(ErrorCode.ERR_MetadataNameTooLong).WithArguments(".NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo>b__0").WithLocation(1, 1), + // (17,81): error CS7013: Name 'Lambda.Bugs.I.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo' exceeds the maximum length allowed in metadata. + // void I.Goo(int x) + Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "Goo").WithArguments("Lambda.Bugs.I.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo").WithLocation(17, 81), + // (19,31): error CS7013: Name '.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo>b__0' exceeds the maximum length allowed in metadata. // Func f = () => x; - Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "() => x").WithArguments(".NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo>b__0").WithLocation(19, 31)); + Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "() => x").WithArguments(".NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass,Lambda.Bugs.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo>b__0").WithLocation(19, 31)); } [WorkItem(540049, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540049")] @@ -4196,12 +4196,12 @@ class Test static int Main() { Test t = new Test(); - t.foo(); + t.goo(); return 0; } - void foo() + void goo() { int l = 0; MyDel d = delegate @@ -4239,7 +4239,7 @@ public void CacheStaticAnonymousMethodInField() public class Gen { - public static void Foo(T t, U u) + public static void Goo(T t, U u) { ((D)delegate { @@ -4255,7 +4255,7 @@ public class Test { public static void Main() { - Gen.Foo(1, ""2""); + Gen.Goo(1, ""2""); Console.WriteLine(""PASS""); } } @@ -4279,7 +4279,7 @@ public A(int n) { this.N = n; } - public void Foo(A @this) + public void Goo(A @this) { Action a = () => Bar(@this); a.Invoke(); @@ -4294,7 +4294,7 @@ static void Main() { A a = new A(1); A b = new A(2); - a.Foo(b); + a.Goo(b); } } "; @@ -4360,10 +4360,10 @@ class Program { static void Main() { - Foo()()(); + Goo()()(); } - static Func> Foo() + static Func> Goo() { T[] x = new T[1]; return () => () => x[0]; @@ -4387,17 +4387,17 @@ static void Main() { } Func f = (x) => 0; - Func Foo() + Func Goo() { string s = """"; Console.WriteLine(s); return (a) => s; } }"; - // Dev11 emits "public", we emit "internal" visibility for b__1: + // Dev11 emits "public", we emit "internal" visibility for b__1: CompileAndVerify(source, expectedSignatures: new[] { - Signature("Test+<>c__DisplayClass2_0", "b__0", - ".method assembly hidebysig instance System.String b__0(System.String a) cil managed"), + Signature("Test+<>c__DisplayClass2_0", "b__0", + ".method assembly hidebysig instance System.String b__0(System.String a) cil managed"), }); } @@ -5217,7 +5217,7 @@ public void NestedLambdaWithExtensionMethodsInGeneric() public class BadBaby { IEnumerable Children; - public object Foo() + public object Goo() { return from child in Children select from T ch in Children select false; } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConditionalOperatorTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConditionalOperatorTests.cs index 4e664de4faf39..deb26291e27bd 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConditionalOperatorTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConditionalOperatorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Roslyn.Test.Utilities; @@ -1479,20 +1479,20 @@ class Program { static void Main(string[] args) { - Foo f1 = new Foo(), f2 = new Foo(), f3 = new Foo(); + Goo f1 = new Goo(), f2 = new Goo(), f3 = new Goo(); bool b = true; - f3 = b ? f1 = new Foo { i = 1 } : f2 = new Foo { i = 2 }; + f3 = b ? f1 = new Goo { i = 1 } : f2 = new Goo { i = 2 }; Console.WriteLine(f1.i); Console.WriteLine(f2.i); Console.WriteLine(f3.i); b = false; - f3 = b ? f1 = new Foo { i = 3 } : f2 = new Foo { i = 4 }; + f3 = b ? f1 = new Goo { i = 3 } : f2 = new Goo { i = 4 }; Console.WriteLine(f1.i); Console.WriteLine(f2.i); Console.WriteLine(f3.i); } } -class Foo +class Goo { public int i; } @@ -1517,19 +1517,19 @@ static void Main(string[] args) { bool b1 = true; bool b2 = false; - Foo f = new Foo + Goo f = new Goo { i = b1 ? 10 : -10 }; Console.WriteLine(f.i); - f = new Foo + f = new Goo { i = b2 ? 10 : -10 }; Console.WriteLine(f.i); } } -class Foo +class Goo { public int i; } @@ -1995,18 +1995,18 @@ public static class Program public static void Main() { int a = 1; - IFoo i = null; - FooVal e = new FooVal(); + IGoo i = null; + GooVal e = new GooVal(); i = a > 1 ? i : e; - System.Console.Write(i.Foo()); + System.Console.Write(i.Goo()); } - interface IFoo { T Foo(); } + interface IGoo { T Goo(); } - struct FooVal : IFoo + struct GooVal : IGoo { - public string Foo() { return ""Val ""; } + public string Goo() { return ""Val ""; } } }"; string expectedOutput = @"Val "; @@ -2014,25 +2014,25 @@ struct FooVal : IFoo { // Code size 38 (0x26) .maxstack 2 - .locals init (Program.IFoo V_0, //i - Program.FooVal V_1, //e - Program.IFoo V_2) + .locals init (Program.IGoo V_0, //i + Program.GooVal V_1, //e + Program.IGoo V_2) IL_0000: ldc.i4.1 IL_0001: ldnull IL_0002: stloc.0 IL_0003: ldloca.s V_1 - IL_0005: initobj ""Program.FooVal"" + IL_0005: initobj ""Program.GooVal"" IL_000b: ldc.i4.1 IL_000c: bgt.s IL_0018 IL_000e: ldloc.1 - IL_000f: box ""Program.FooVal"" + IL_000f: box ""Program.GooVal"" IL_0014: stloc.2 IL_0015: ldloc.2 IL_0016: br.s IL_0019 IL_0018: ldloc.0 IL_0019: stloc.0 IL_001a: ldloc.0 - IL_001b: callvirt ""string Program.IFoo.Foo()"" + IL_001b: callvirt ""string Program.IGoo.Goo()"" IL_0020: call ""void System.Console.Write(string)"" IL_0025: ret }"; @@ -2047,23 +2047,23 @@ public static class Program { public static void Main() { - IFoo i = null; - FooVal e = new FooVal(); - FooVal? n = e; + IGoo i = null; + GooVal e = new GooVal(); + GooVal? n = e; i = i ?? e; - System.Console.Write(i.Foo()); + System.Console.Write(i.Goo()); i = null; i = n ?? i; - System.Console.Write(i.Foo()); + System.Console.Write(i.Goo()); } - interface IFoo { T Foo(); } + interface IGoo { T Goo(); } - struct FooVal : IFoo + struct GooVal : IGoo { - public string Foo() { return ""Val ""; } + public string Goo() { return ""Val ""; } } }"; string expectedOutput = @"Val Val "; @@ -2071,42 +2071,42 @@ struct FooVal : IFoo { // Code size 81 (0x51) .maxstack 3 - .locals init (Program.IFoo V_0, //i - Program.FooVal V_1, //e - Program.FooVal? V_2, - Program.IFoo V_3) + .locals init (Program.IGoo V_0, //i + Program.GooVal V_1, //e + Program.GooVal? V_2, + Program.IGoo V_3) IL_0000: ldnull IL_0001: stloc.0 IL_0002: ldloca.s V_1 - IL_0004: initobj ""Program.FooVal"" + IL_0004: initobj ""Program.GooVal"" IL_000a: ldloc.1 - IL_000b: newobj ""Program.FooVal?..ctor(Program.FooVal)"" + IL_000b: newobj ""Program.GooVal?..ctor(Program.GooVal)"" IL_0010: ldloc.0 IL_0011: dup IL_0012: brtrue.s IL_001b IL_0014: pop IL_0015: ldloc.1 - IL_0016: box ""Program.FooVal"" + IL_0016: box ""Program.GooVal"" IL_001b: stloc.0 IL_001c: ldloc.0 - IL_001d: callvirt ""string Program.IFoo.Foo()"" + IL_001d: callvirt ""string Program.IGoo.Goo()"" IL_0022: call ""void System.Console.Write(string)"" IL_0027: ldnull IL_0028: stloc.0 IL_0029: stloc.2 IL_002a: ldloca.s V_2 - IL_002c: call ""bool Program.FooVal?.HasValue.get"" + IL_002c: call ""bool Program.GooVal?.HasValue.get"" IL_0031: brtrue.s IL_0036 IL_0033: ldloc.0 IL_0034: br.s IL_0044 IL_0036: ldloca.s V_2 - IL_0038: call ""Program.FooVal Program.FooVal?.GetValueOrDefault()"" - IL_003d: box ""Program.FooVal"" + IL_0038: call ""Program.GooVal Program.GooVal?.GetValueOrDefault()"" + IL_003d: box ""Program.GooVal"" IL_0042: stloc.3 IL_0043: ldloc.3 IL_0044: stloc.0 IL_0045: ldloc.0 - IL_0046: callvirt ""string Program.IFoo.Foo()"" + IL_0046: callvirt ""string Program.IGoo.Goo()"" IL_004b: call ""void System.Console.Write(string)"" IL_0050: ret }"; diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConversionTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConversionTests.cs index 78c934703f76d..1b141a3259b6c 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConversionTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenConversionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -96,20 +96,20 @@ class Program { static void Main() { - Foo(new A.C()); + Goo(new A.C()); } - static void Foo(I x) + static void Goo(I x) { - Console.WriteLine(""Foo(I x)""); + Console.WriteLine(""Goo(I x)""); } - static void Foo(J x) + static void Goo(J x) { - Console.WriteLine(""Foo(J x)""); + Console.WriteLine(""Goo(J x)""); } } "; - var compilationVerifier = CompileAndVerify(source, expectedOutput: @"Foo(J x) + var compilationVerifier = CompileAndVerify(source, expectedOutput: @"Goo(J x) "); } @@ -689,10 +689,10 @@ class Program { static void Main() { - Foo(new G.E(), new G.E()); + Goo(new G.E(), new G.E()); } - static void Foo(G.E x, G.E y) + static void Goo(G.E x, G.E y) { Console.Write(x is G.E); Console.Write(y is G.E); @@ -706,7 +706,7 @@ public enum E { } "; var compilation = CompileAndVerify(source, expectedOutput: "TrueTrue"); - compilation.VerifyIL("Program.Foo(G.E, G.E)", + compilation.VerifyIL("Program.Goo(G.E, G.E)", @" { // Code size 39 (0x27) diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs index 46260648f339c..ab94408b705f5 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDeconstructTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -718,13 +718,13 @@ class C static void Main() { int y; - (Foo()[Bar()], y) = new C(); + (Goo()[Bar()], y) = new C(); System.Console.WriteLine($""Final array values[2] {array.values[2]}""); } - static SomeArray Foo() + static SomeArray Goo() { - System.Console.WriteLine($""Foo""); + System.Console.WriteLine($""Goo""); array = new SomeArray(); return array; } @@ -753,7 +753,7 @@ public int this[int index] { } "; var expected = -@"Foo +@"Goo Bar Deconstruct indexSet (with value 101) @@ -6701,11 +6701,11 @@ static void Main() static (int, (string, long)) M() { - return (5, (""Foo"", 34983490)); + return (5, (""Goo"", 34983490)); } } "; - var comp = CompileAndVerify(source, expectedOutput: "5 (Foo, 34983490)", additionalRefs: s_valueTupleRefs); + var comp = CompileAndVerify(source, expectedOutput: "5 (Goo, 34983490)", additionalRefs: s_valueTupleRefs); comp.VerifyDiagnostics(); } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs index e466ec78602d8..8b9efb6c01cf3 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenDynamicTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -1008,20 +1008,20 @@ public void GenericContainer_Lambda() string source = @" class C { - static void Foo(T a, dynamic b) + static void Goo(T a, dynamic b) { - System.Action f = () => Foo(a, b); + System.Action f = () => Goo(a, b); } } "; - CompileAndVerifyIL(source, "C.<>c__DisplayClass0_0.b__0", @" + CompileAndVerifyIL(source, "C.<>c__DisplayClass0_0.b__0", @" { // Code size 123 (0x7b) .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__0.<>p__0"" IL_0005: brtrue.s IL_0050 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""Foo"" + IL_000c: ldstr ""Goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -7501,7 +7501,7 @@ public class Color string sourceScript = @" Color Color; -void Foo() +void Goo() { dynamic x = Color.F((dynamic)1); } @@ -7511,7 +7511,7 @@ void Foo() new[] { new CSharpCompilationReference(lib), SystemCoreRef, CSharpRef }, TestOptions.ReleaseDll.WithMetadataImportOptions(MetadataImportOptions.All)); - CompileAndVerify(script).VerifyIL("Foo", @" + CompileAndVerify(script).VerifyIL("Goo", @" { // Code size 99 (0x63) .maxstack 9 @@ -7957,7 +7957,7 @@ public class C { public dynamic M(dynamic d, int a) { - return d.m(foo: d, bar: a, baz: 123); + return d.m(goo: d, bar: a, baz: 123); } }"; CompileAndVerifyIL(source, "C.M", @" @@ -7982,7 +7982,7 @@ .maxstack 9 IL_0028: dup IL_0029: ldc.i4.1 IL_002a: ldc.i4.4 - IL_002b: ldstr ""foo"" + IL_002b: ldstr ""goo"" IL_0030: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" IL_0035: stelem.ref IL_0036: dup @@ -8943,20 +8943,20 @@ public void InvokeStaticMember_InLambda() string source = @" class C { - static void Foo(dynamic x) + static void Goo(dynamic x) { - System.Action a = () => Foo(x); + System.Action a = () => Goo(x); } } "; - CompileAndVerifyIL(source, "C.<>c__DisplayClass0_0.b__0", @" + CompileAndVerifyIL(source, "C.<>c__DisplayClass0_0.b__0", @" { // Code size 107 (0x6b) .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__0.<>p__0"" IL_0005: brtrue.s IL_0046 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""Foo"" + IL_000c: ldstr ""Goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -8998,14 +8998,14 @@ public class C public void M(dynamic d) { S s = new S(); - s.foo(d); + s.goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; // Dev11 produces more efficient code, see bug 547265: @@ -9020,7 +9020,7 @@ .locals init (S V_0) //s IL_0008: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__0.<>p__0"" IL_000d: brtrue.s IL_004e IL_000f: ldc.i4 0x100 - IL_0014: ldstr ""foo"" + IL_0014: ldstr ""goo"" IL_0019: ldnull IL_001a: ldtoken ""C"" IL_001f: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9059,14 +9059,14 @@ public class C { public void M(S s, dynamic d) { - s.foo(d); + s.goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9076,7 +9076,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__0.<>p__0"" IL_0005: brtrue.s IL_0046 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9171,14 +9171,14 @@ public class C public void M(dynamic d) { - s.foo(d); + s.goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9188,7 +9188,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__1.<>p__0"" IL_0005: brtrue.s IL_0045 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9231,14 +9231,14 @@ public class C public void M(dynamic d) { - s[0].foo(d); + s[0].goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9248,7 +9248,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__1.<>p__0"" IL_0005: brtrue.s IL_0046 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9295,14 +9295,14 @@ public void M(dynamic d) { S s = new S(); S* ptr = &s; - (*ptr).foo(d); + (*ptr).goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; // Dev11 produces more efficient code, see bug 547265: @@ -9320,7 +9320,7 @@ .locals init (S V_0, //s IL_000c: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__1.<>p__0"" IL_0011: brtrue.s IL_0052 IL_0013: ldc.i4 0x100 - IL_0018: ldstr ""foo"" + IL_0018: ldstr ""goo"" IL_001d: ldnull IL_001e: ldtoken ""C"" IL_0023: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9364,14 +9364,14 @@ public void M(dynamic d) { S s = new S(); S* ptr = &s; - ptr->foo(d); + ptr->goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; // Dev11 produces more efficient code, see bug 547265: @@ -9389,7 +9389,7 @@ .locals init (S V_0, //s IL_000c: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__1.<>p__0"" IL_0011: brtrue.s IL_0052 IL_0013: ldc.i4 0x100 - IL_0018: ldstr ""foo"" + IL_0018: ldstr ""goo"" IL_001d: ldnull IL_001e: ldtoken ""C"" IL_0023: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9432,14 +9432,14 @@ public unsafe class C public void M(dynamic d) { S* ptr = stackalloc S[2]; - ptr[1].foo(d); + ptr[1].goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; // Dev11 produces more efficient code, see bug 547265: @@ -9457,7 +9457,7 @@ .locals init (S* V_0) //ptr IL_000c: ldsfld ""System.Runtime.CompilerServices.CallSite<<>A{00000002}> C.<>o__1.<>p__0"" IL_0011: brtrue.s IL_0052 IL_0013: ldc.i4 0x100 - IL_0018: ldstr ""foo"" + IL_0018: ldstr ""goo"" IL_001d: ldnull IL_001e: ldtoken ""C"" IL_0023: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9612,14 +9612,14 @@ public class C { public void M(dynamic d, S s, S t) { - (s = t).foo(d); + (s = t).goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9629,7 +9629,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__0.<>p__0"" IL_0005: brtrue.s IL_0045 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9672,14 +9672,14 @@ public class C public void M(C c, dynamic d) { - c.P.foo(d); + c.P.goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9689,7 +9689,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__4.<>p__0"" IL_0005: brtrue.s IL_0045 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9732,14 +9732,14 @@ public class C public void M(C c, dynamic d) { - c[0].foo(d); + c[0].goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9749,7 +9749,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__3.<>p__0"" IL_0005: brtrue.s IL_0045 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9790,14 +9790,14 @@ public class C { public void M(System.Func f, dynamic d) { - f().foo(d); + f().goo(d); } } public struct S { public int X; - public void foo(int a) {} + public void goo(int a) {} } "; CompileAndVerifyIL(source, "C.M", @" @@ -9807,7 +9807,7 @@ .maxstack 9 IL_0000: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__0.<>p__0"" IL_0005: brtrue.s IL_0045 IL_0007: ldc.i4 0x100 - IL_000c: ldstr ""foo"" + IL_000c: ldstr ""goo"" IL_0011: ldnull IL_0012: ldtoken ""C"" IL_0017: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -9967,7 +9967,7 @@ public class C { public dynamic M(dynamic d, int a) { - return d(foo: d, bar: a, baz: 123); + return d(goo: d, bar: a, baz: 123); } }"; @@ -9991,7 +9991,7 @@ .maxstack 7 IL_0022: dup IL_0023: ldc.i4.1 IL_0024: ldc.i4.4 - IL_0025: ldstr ""foo"" + IL_0025: ldstr ""goo"" IL_002a: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" IL_002f: stelem.ref IL_0030: dup @@ -10030,7 +10030,7 @@ public class C { public void M(dynamic d, int a) { - d(foo: d, bar: a, baz: 123); + d(goo: d, bar: a, baz: 123); } }"; CompileAndVerifyIL(source, "C.M", @" @@ -10053,7 +10053,7 @@ .maxstack 7 IL_0026: dup IL_0027: ldc.i4.1 IL_0028: ldc.i4.4 - IL_0029: ldstr ""foo"" + IL_0029: ldstr ""goo"" IL_002e: call ""Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create(Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfoFlags, string)"" IL_0033: stelem.ref IL_0034: dup @@ -10300,9 +10300,9 @@ protected B(int x) { } class C : B { - C(dynamic x) : base((int)Foo(x)) { } + C(dynamic x) : base((int)Goo(x)) { } - static object Foo(object x) + static object Goo(object x) { return x; } @@ -10328,7 +10328,7 @@ .maxstack 12 IL_003c: ldsfld ""System.Runtime.CompilerServices.CallSite> C.<>o__0.<>p__0"" IL_0041: brtrue.s IL_007e IL_0043: ldc.i4.0 - IL_0044: ldstr ""Foo"" + IL_0044: ldstr ""Goo"" IL_0049: ldnull IL_004a: ldtoken ""C"" IL_004f: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" @@ -10376,9 +10376,9 @@ protected B(int x) { } class C : B { - C(dynamic x) : base((int)Foo(x)) { } + C(dynamic x) : base((int)Goo(x)) { } - static Action Foo; + static Action Goo; } "; CompileAndVerifyIL(source, "C..ctor", @" @@ -10424,7 +10424,7 @@ .maxstack 10 IL_0077: ldsfld ""System.Runtime.CompilerServices.CallSite, object, object>> C.<>o__0.<>p__0"" IL_007c: ldfld ""System.Func, object, object> System.Runtime.CompilerServices.CallSite, object, object>>.Target"" IL_0081: ldsfld ""System.Runtime.CompilerServices.CallSite, object, object>> C.<>o__0.<>p__0"" - IL_0086: ldsfld ""System.Action C.Foo"" + IL_0086: ldsfld ""System.Action C.Goo"" IL_008b: ldarg.1 IL_008c: callvirt ""object System.Func, object, object>.Invoke(System.Runtime.CompilerServices.CallSite, System.Action, object)"" IL_0091: callvirt ""int System.Func.Invoke(System.Runtime.CompilerServices.CallSite, object)"" @@ -10447,9 +10447,9 @@ protected B(int x) { } class C : B { - C(dynamic x) : base((int)Foo(x)) { } + C(dynamic x) : base((int)Goo(x)) { } - static Action Foo { get; set; } + static Action Goo { get; set; } } "; CompileAndVerifyIL(source, "C..ctor", @" @@ -10495,7 +10495,7 @@ .maxstack 10 IL_0077: ldsfld ""System.Runtime.CompilerServices.CallSite, object, object>> C.<>o__0.<>p__0"" IL_007c: ldfld ""System.Func, object, object> System.Runtime.CompilerServices.CallSite, object, object>>.Target"" IL_0081: ldsfld ""System.Runtime.CompilerServices.CallSite, object, object>> C.<>o__0.<>p__0"" - IL_0086: call ""System.Action C.Foo.get"" + IL_0086: call ""System.Action C.Goo.get"" IL_008b: ldarg.1 IL_008c: callvirt ""object System.Func, object, object>.Invoke(System.Runtime.CompilerServices.CallSite, System.Action, object)"" IL_0091: callvirt ""int System.Func.Invoke(System.Runtime.CompilerServices.CallSite, object)"" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs index 271379ef6f581..c444ef95eb49e 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenExprLambdaTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.IO; @@ -4224,7 +4224,7 @@ public class MemberInitializerTest public static void GenericMethod() { } public static void Run() { - Foo f = new Foo { + Goo f = new Goo { genD = (D) GenericMethod<((System.Linq.Expressions.Expression>)(() => int)).Compile()()> }; } @@ -4237,12 +4237,12 @@ public static void Run() // (9,123): error CS1525: Invalid expression term '}' // genD = (D) GenericMethod<((System.Linq.Expressions.Expression>)(() => int)).Compile()()> Diagnostic(ErrorCode.ERR_InvalidExprTerm, "").WithArguments("}"), - // (8,9): error CS0246: The type or namespace name 'Foo' could not be found (are you missing a using directive or an assembly reference?) - // Foo f = new Foo { - Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Foo").WithArguments("Foo"), - // (8,21): error CS0246: The type or namespace name 'Foo' could not be found (are you missing a using directive or an assembly reference?) - // Foo f = new Foo { - Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Foo").WithArguments("Foo"), + // (8,9): error CS0246: The type or namespace name 'Goo' could not be found (are you missing a using directive or an assembly reference?) + // Goo f = new Goo { + Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Goo").WithArguments("Goo"), + // (8,21): error CS0246: The type or namespace name 'Goo' could not be found (are you missing a using directive or an assembly reference?) + // Goo f = new Goo { + Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Goo").WithArguments("Goo"), // (9,20): error CS0030: Cannot convert type 'method' to 'MemberInitializerTest.D' // genD = (D) GenericMethod<((System.Linq.Expressions.Expression>)(() => int)).Compile()()> Diagnostic(ErrorCode.ERR_NoExplicitConv, "(D) GenericMethod").WithArguments("method", "MemberInitializerTest.D")); @@ -4271,11 +4271,11 @@ class Program { static void Main() { - int result = Foo(); + int result = Goo(); Console.WriteLine(result); } - static int Foo() where T : I, new() + static int Goo() where T : I, new() { Expression> f1 = () => new T { X = 1 }; var b = f1.Compile()(); @@ -5453,7 +5453,7 @@ public class Derived : Base public override int X { get { return 42; } } } -public class Foo +public class Goo { static Derived Bug(IQueryable query) { @@ -5491,7 +5491,7 @@ public class Derived : Base public override int X { set { System.Console.Write(value); } } } -public class Foo +public class Goo { static int Bug(IQueryable query) { @@ -6047,19 +6047,19 @@ class Program { static void Main(string[] args) { - Expression> e = () => foo((int)E1.b); + Expression> e = () => goo((int)E1.b); System.Console.WriteLine(e); } - static int foo(int x) + static int goo(int x) { return x; } } }"; - const string expectedOutput = @"() => foo(1)"; + const string expectedOutput = @"() => goo(1)"; CompileAndVerify( new[] { source, diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenForEachTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenForEachTests.cs index 5d055a2db4aef..99cda785a9ec4 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenForEachTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenForEachTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -1554,11 +1554,11 @@ class Program { static void Main() { - Foo(x => { foreach (var y in x) { } }); + Goo(x => { foreach (var y in x) { } }); } - static void Foo(Action a) { Console.WriteLine(1); } - static void Foo(Action a) { }} + static void Goo(Action a) { Console.WriteLine(1); } + static void Goo(Action a) { }} class A { diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitImplementationTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitImplementationTests.cs index bc07d03f5aaf6..260fc2d0b4703 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitImplementationTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitImplementationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -645,7 +645,7 @@ public void TestBaseInterfaceMetadata() var source = @" interface I1 { - void foo(); + void goo(); } interface I2 : I1 @@ -655,17 +655,17 @@ interface I2 : I1 class X : I1 { - void I1.foo() + void I1.goo() { - System.Console.WriteLine(""X::I1.foo""); + System.Console.WriteLine(""X::I1.goo""); } } class Y : X, I2 { - public virtual void foo() + public virtual void goo() { - System.Console.WriteLine(""Y.foo""); + System.Console.WriteLine(""Y.goo""); } void I2.bar() @@ -678,11 +678,11 @@ class Program static void Main() { I2 b = new Y(); - b.foo(); + b.goo(); } } "; - CompileAndVerify(source, expectedOutput: "Y.foo"); + CompileAndVerify(source, expectedOutput: "Y.goo"); } /// @@ -788,37 +788,37 @@ public void ImplementInterfaceWithMultipleBasesWithSameMethod() var source = @" interface IBase1 { - void BaseFoo(); + void BaseGoo(); } interface IBase2 { - void BaseFoo(); + void BaseGoo(); } interface IInterface : IBase1, IBase2 { - void InterfaceFoo(); + void InterfaceGoo(); } class C1 : IInterface { - public void BaseFoo() { System.Console.Write(""BaseFoo "");} - public void InterfaceFoo() { System.Console.Write(""InterfaceFoo ""); } + public void BaseGoo() { System.Console.Write(""BaseGoo "");} + public void InterfaceGoo() { System.Console.Write(""InterfaceGoo ""); } public void Test() { C1 c = new C1(); - c.BaseFoo(); - c.InterfaceFoo(); - ((IBase1)c).BaseFoo(); - ((IBase2)c).BaseFoo(); - ((IInterface)c).InterfaceFoo(); - ((IInterface)c).BaseFoo(); + c.BaseGoo(); + c.InterfaceGoo(); + ((IBase1)c).BaseGoo(); + ((IBase2)c).BaseGoo(); + ((IInterface)c).InterfaceGoo(); + ((IInterface)c).BaseGoo(); } } "; CreateStandardCompilation(source) .VerifyDiagnostics( - // (26,9): error CS0121: The call is ambiguous between the following methods or properties: 'IBase1.BaseFoo()' and 'IBase2.BaseFoo()' - // ((IInterface)c).BaseFoo(); - Diagnostic(ErrorCode.ERR_AmbigCall, "BaseFoo").WithArguments("IBase1.BaseFoo()", "IBase2.BaseFoo()")); + // (26,9): error CS0121: The call is ambiguous between the following methods or properties: 'IBase1.BaseGoo()' and 'IBase2.BaseGoo()' + // ((IInterface)c).BaseGoo(); + Diagnostic(ErrorCode.ERR_AmbigCall, "BaseGoo").WithArguments("IBase1.BaseGoo()", "IBase2.BaseGoo()")); } [WorkItem(540410, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/540410")] @@ -828,11 +828,11 @@ public void InterfaceDiamondInheritenceWithNewMember() var source = @" interface IBase { - void Foo(); + void Goo(); } interface ILeft : IBase { - new void Foo(); + new void Goo(); } interface IRight : IBase { @@ -843,18 +843,18 @@ class C1 : IDerived { public void Bar() { } - void IBase.Foo() { System.Console.Write(""IBase "");} + void IBase.Goo() { System.Console.Write(""IBase "");} - void ILeft.Foo() { System.Console.Write(""ILeft ""); } + void ILeft.Goo() { System.Console.Write(""ILeft ""); } } public static class MainClass { static void Test(IDerived d) { - d.Foo(); // Invokes ileft.foo() - ((IBase)d).Foo(); // Invokes ibase.foo() - ((ILeft)d).Foo(); // Invokes ileft.foo() - ((IRight)d).Foo(); // Invokes ibase.foo() + d.Goo(); // Invokes ileft.goo() + ((IBase)d).Goo(); // Invokes ibase.goo() + ((ILeft)d).Goo(); // Invokes ileft.goo() + ((IRight)d).Goo(); // Invokes ibase.goo() } public static void Main() { @@ -869,13 +869,13 @@ public static void Main() // Code size 25 (0x19) .maxstack 1 IL_0000: ldarg.0 - IL_0001: callvirt ""void ILeft.Foo()"" + IL_0001: callvirt ""void ILeft.Goo()"" IL_0006: ldarg.0 - IL_0007: callvirt ""void IBase.Foo()"" + IL_0007: callvirt ""void IBase.Goo()"" IL_000c: ldarg.0 - IL_000d: callvirt ""void ILeft.Foo()"" + IL_000d: callvirt ""void ILeft.Goo()"" IL_0012: ldarg.0 - IL_0013: callvirt ""void IBase.Foo()"" + IL_0013: callvirt ""void IBase.Goo()"" IL_0018: ret }"); } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitlyTypeArraysTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitlyTypeArraysTests.cs index fbfb1902a9b11..ac06e7f420d2c 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitlyTypeArraysTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenImplicitlyTypeArraysTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -944,7 +944,7 @@ namespace Test { public class Program { - public void Foo() + public void Goo() { var a3 = new[,,] { { { 3, 4 } }, 3, 4 }; } @@ -969,7 +969,7 @@ namespace Test { public class Program { - public void Foo() + public void Goo() { var a3 = new[,,] { { { 3, 4 } }, x, 4 }; } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenInterfaceImplementation.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenInterfaceImplementation.cs index 11ed41deb56c3..62aae7050cf10 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenInterfaceImplementation.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenInterfaceImplementation.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -2572,7 +2572,7 @@ public void ReverseArrayRankSpecifiersInExplicitImplementationName() interface I { - void Foo(); + void Goo(); } class C : I @@ -2580,15 +2580,15 @@ class C : I static void Main() { I x = new C(); - Action a = x.Foo; + Action a = x.Goo; Console.WriteLine(a.Method); } - void I.Foo() { } + void I.Goo() { } } "; // NOTE: order reversed from C# notation. - CompileAndVerify(source, expectedOutput: @"Void I.Foo()"); + CompileAndVerify(source, expectedOutput: @"Void I.Goo()"); } [Fact] diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIterators.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIterators.cs index 73a5870129368..9671faecdd451 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIterators.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenIterators.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -1923,7 +1923,7 @@ public void VerifyHelpers() class Program { - public static IEnumerable Foo() + public static IEnumerable Goo() { yield return 1; } @@ -1933,7 +1933,7 @@ public static IEnumerable Foo() var parsed = new[] { Parse(source) }; var comp = CreateCompilationWithMscorlib45(parsed); var verifier = this.CompileAndVerify(comp); - var il = verifier.VisualizeIL("Program.d__0.System.Collections.Generic.IEnumerable.GetEnumerator()"); + var il = verifier.VisualizeIL("Program.d__0.System.Collections.Generic.IEnumerable.GetEnumerator()"); Assert.Contains("System.Environment.CurrentManagedThreadId.get", il, StringComparison.Ordinal); } @@ -1947,7 +1947,7 @@ public void VerifyHelpers001() class Program { - public static IEnumerable Foo() + public static IEnumerable Goo() { yield return 1; } @@ -1966,7 +1966,7 @@ class Environment var comp = CreateStandardCompilation(parsed); comp.MakeMemberMissing(WellKnownMember.System_Threading_Thread__ManagedThreadId); var verifier = this.CompileAndVerify(comp); - var il = verifier.VisualizeIL("Program.d__0.System.Collections.Generic.IEnumerable.GetEnumerator()"); + var il = verifier.VisualizeIL("Program.d__0.System.Collections.Generic.IEnumerable.GetEnumerator()"); Assert.Contains("System.Environment.CurrentManagedThreadId.get", il, StringComparison.Ordinal); } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs index 1697cbfb59065..2b44cf5a87835 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLocalFunctionTests.cs @@ -1,4 +1,4 @@ -using Microsoft.CodeAnalysis.CSharp.Symbols; +using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; @@ -724,7 +724,7 @@ class Test { T Value; - public bool Foo(IEqualityComparer comparer) + public bool Goo(IEqualityComparer comparer) { bool local(T tmp) { @@ -1624,7 +1624,7 @@ public void Property() class Program { - static int Foo + static int Goo { get { @@ -1637,7 +1637,7 @@ int Local() } static void Main(string[] args) { - Console.Write(Foo); + Console.Write(Goo); } }"; VerifyOutput(source, "2"); @@ -1652,7 +1652,7 @@ public void PropertyIterator() class Program { - static int Foo + static int Goo { get { @@ -1670,7 +1670,7 @@ IEnumerable Local() } static void Main(string[] args) { - Console.Write(Foo); + Console.Write(Goo); } }"; VerifyOutput(source, "2"); @@ -1732,7 +1732,7 @@ public void InterpolatedString() var source = @" int x = 1; int Bar() => ++x; -var str = $@""{((Func)(() => { int Foo() => Bar(); return Foo(); }))()}""; +var str = $@""{((Func)(() => { int Goo() => Bar(); return Goo(); }))()}""; Console.Write(str + ' ' + x); "; VerifyOutputInMain(source, "2 2", "System"); @@ -1744,35 +1744,35 @@ public void InterpolatedString() public void StaticNoClosure() { var source = @" -T Foo(T x) +T Goo(T x) { return x; } -Console.Write(Foo(2)); +Console.Write(Goo(2)); "; var verify = VerifyOutputInMain(source, "2", "System"); - var foo = verify.FindLocalFunction("Foo"); - Assert.True(foo.IsStatic); - Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), foo.ContainingType); + var goo = verify.FindLocalFunction("Goo"); + Assert.True(goo.IsStatic); + Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType); } [Fact] public void StaticNoClosureDelegate() { var source = @" -T Foo(T x) +T Goo(T x) { return x; } -Func foo = Foo; -Console.Write(foo(2)); +Func goo = Goo; +Console.Write(goo(2)); "; var verify = VerifyOutputInMain(source, "2", "System"); - var foo = verify.FindLocalFunction("Foo"); + var goo = verify.FindLocalFunction("Goo"); var program = verify.Compilation.GetTypeByMetadataName("Program"); - Assert.False(foo.IsStatic); - Assert.Equal("<>c", foo.ContainingType.Name); - Assert.Equal(program, foo.ContainingType.ContainingType); + Assert.False(goo.IsStatic); + Assert.Equal("<>c", goo.ContainingType.Name); + Assert.Equal(program, goo.ContainingType.ContainingType); } [Fact] @@ -2284,19 +2284,19 @@ public void StructClosure() { var source = @" int x = 2; -void Foo() +void Goo() { Console.Write(x); } -Foo(); +Goo(); "; var verify = VerifyOutputInMain(source, "2", "System"); - var foo = verify.FindLocalFunction("Foo"); + var goo = verify.FindLocalFunction("Goo"); var program = verify.Compilation.GetTypeByMetadataName("Program"); - Assert.Equal(program, foo.ContainingType); - Assert.True(foo.IsStatic); - Assert.Equal(RefKind.Ref, foo.Parameters[0].RefKind); - Assert.True(foo.Parameters[0].Type.IsValueType); + Assert.Equal(program, goo.ContainingType); + Assert.True(goo.IsStatic); + Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind); + Assert.True(goo.Parameters[0].Type.IsValueType); } [Fact] @@ -2304,7 +2304,7 @@ public void StructClosureGeneric() { var source = @" int x = 2; -void Foo() +void Goo() { int y = x; void Bar() @@ -2313,23 +2313,23 @@ void Bar() } Bar(); } -Foo(); +Goo(); "; var verify = VerifyOutputInMain(source, "4", "System"); - var foo = verify.FindLocalFunction("Foo"); + var goo = verify.FindLocalFunction("Goo"); var bar = verify.FindLocalFunction("Bar"); - Assert.Equal(1, foo.Parameters.Length); + Assert.Equal(1, goo.Parameters.Length); Assert.Equal(2, bar.Parameters.Length); - Assert.Equal(RefKind.Ref, foo.Parameters[0].RefKind); + Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind); Assert.Equal(RefKind.Ref, bar.Parameters[0].RefKind); Assert.Equal(RefKind.Ref, bar.Parameters[1].RefKind); - Assert.True(foo.Parameters[0].Type.IsValueType); + Assert.True(goo.Parameters[0].Type.IsValueType); Assert.True(bar.Parameters[0].Type.IsValueType); Assert.True(bar.Parameters[1].Type.IsValueType); - Assert.Equal(foo.Parameters[0].Type.OriginalDefinition, bar.Parameters[0].Type.OriginalDefinition); - var fooFrame = (INamedTypeSymbol)foo.Parameters[0].Type; + Assert.Equal(goo.Parameters[0].Type.OriginalDefinition, bar.Parameters[0].Type.OriginalDefinition); + var gooFrame = (INamedTypeSymbol)goo.Parameters[0].Type; var barFrame = (INamedTypeSymbol)bar.Parameters[1].Type; - Assert.Equal(0, fooFrame.Arity); + Assert.Equal(0, gooFrame.Arity); Assert.Equal(1, barFrame.Arity); } @@ -2419,27 +2419,27 @@ public void RecursiveStructClosure() { var source = @" int x = 0; -void Foo() +void Goo() { if (x != 2) { x++; - Foo(); + Goo(); } else { Console.Write(x); } } -Foo(); +Goo(); "; var verify = VerifyOutputInMain(source, "2", "System"); - var foo = verify.FindLocalFunction("Foo"); + var goo = verify.FindLocalFunction("Goo"); var program = verify.Compilation.GetTypeByMetadataName("Program"); - Assert.Equal(program, foo.ContainingType); - Assert.True(foo.IsStatic); - Assert.Equal(RefKind.Ref, foo.Parameters[0].RefKind); - Assert.True(foo.Parameters[0].Type.IsValueType); + Assert.Equal(program, goo.ContainingType); + Assert.True(goo.IsStatic); + Assert.Equal(RefKind.Ref, goo.Parameters[0].RefKind); + Assert.True(goo.Parameters[0].Type.IsValueType); } [Fact] @@ -2447,13 +2447,13 @@ public void MutuallyRecursiveStructClosure() { var source = @" int x = 0; -void Foo(int depth) +void Goo(int depth) { int dummy = 0; void Bar(int depth2) { dummy++; - Foo(depth2); + Goo(depth2); } if (depth != 2) { @@ -2465,22 +2465,22 @@ void Bar(int depth2) Console.Write(x); } } -Foo(0); +Goo(0); "; var verify = VerifyOutputInMain(source, "2", "System"); var program = verify.Compilation.GetTypeByMetadataName("Program"); - var foo = verify.FindLocalFunction("Foo"); + var goo = verify.FindLocalFunction("Goo"); var bar = verify.FindLocalFunction("Bar"); - Assert.Equal(program, foo.ContainingType); + Assert.Equal(program, goo.ContainingType); Assert.Equal(program, bar.ContainingType); - Assert.True(foo.IsStatic); + Assert.True(goo.IsStatic); Assert.True(bar.IsStatic); - Assert.Equal(2, foo.Parameters.Length); + Assert.Equal(2, goo.Parameters.Length); Assert.Equal(3, bar.Parameters.Length); - Assert.Equal(RefKind.Ref, foo.Parameters[1].RefKind); + Assert.Equal(RefKind.Ref, goo.Parameters[1].RefKind); Assert.Equal(RefKind.Ref, bar.Parameters[1].RefKind); Assert.Equal(RefKind.Ref, bar.Parameters[2].RefKind); - Assert.True(foo.Parameters[1].Type.IsValueType); + Assert.True(goo.Parameters[1].Type.IsValueType); Assert.True(bar.Parameters[1].Type.IsValueType); Assert.True(bar.Parameters[2].Type.IsValueType); } @@ -2489,16 +2489,16 @@ void Bar(int depth2) public void Recursion() { var source = @" -void Foo(int depth) +void Goo(int depth) { if (depth > 10) { Console.WriteLine(2); return; } - Foo(depth + 1); + Goo(depth + 1); } -Foo(0); +Goo(0); "; VerifyOutputInMain(source, "2", "System"); } @@ -2507,7 +2507,7 @@ void Foo(int depth) public void MutualRecursion() { var source = @" -void Foo(int depth) +void Goo(int depth) { if (depth > 10) { @@ -2516,11 +2516,11 @@ void Foo(int depth) } void Bar(int depth2) { - Foo(depth2 + 1); + Goo(depth2 + 1); } Bar(depth + 1); } -Foo(0); +Goo(0); "; VerifyOutputInMain(source, "2", "System"); } @@ -3398,9 +3398,9 @@ void Local() "; // Should be a static method on "Program" itself, not a display class like "Program+<>c__DisplayClass0_0" var verify = VerifyOutputInMain(source, "2", "System"); - var foo = verify.FindLocalFunction("Local"); - Assert.True(foo.IsStatic); - Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), foo.ContainingType); + var goo = verify.FindLocalFunction("Local"); + Assert.True(goo.IsStatic); + Assert.Equal(verify.Compilation.GetTypeByMetadataName("Program"), goo.ContainingType); } [Fact] @@ -3582,11 +3582,11 @@ string async() } static string C() { - async Foo() + async Goo() { return new async(); } - return Foo().ToString(); + return Goo().ToString(); } static string D() { diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLockTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLockTests.cs index 7bca136e11e92..5dcd4e3d5c152 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLockTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenLockTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -1101,7 +1101,7 @@ public void NestedLock_2() class Test { private object syncroot = new object(); - public void foo() + public void goo() { lock (syncroot) { @@ -1112,7 +1112,7 @@ public void foo() } } "; - CompileAndVerify(text).VerifyIL("Test.foo", @" + CompileAndVerify(text).VerifyIL("Test.goo", @" { // Code size 57 (0x39) .maxstack 2 @@ -1209,7 +1209,7 @@ class Test { public static void Main() { } - public IEnumerable Foo() + public IEnumerable Goo() { lock (new object()) { @@ -1846,7 +1846,7 @@ static void Main(string[] args) System.Threading.Thread[] t = new System.Threading.Thread[20]; for (int i = 0; i < 20; i++) { - t[i] = new System.Threading.Thread(p.foo); + t[i] = new System.Threading.Thread(p.goo); t[i].Start(); } for (int i = 0; i < 20; i++) @@ -1861,7 +1861,7 @@ class D { private object syncroot = new object(); public int s; - public void foo() + public void goo() { lock (syncroot) { diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenMscorlib.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenMscorlib.cs index 9e12aaa34276f..933e417ec3caa 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenMscorlib.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenMscorlib.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -785,14 +785,14 @@ public unsafe override int GetHashCode() { return unchecked((int)((long)m_value)); } - public unsafe static IntPtr Foo() + public unsafe static IntPtr Goo() { return new IntPtr(0); } public unsafe static bool Bar(IntPtr value1) { - return value1.m_value == Foo().m_value; + return value1.m_value == Goo().m_value; } } @@ -892,7 +892,7 @@ .maxstack 2 .locals init (System.IntPtr V_0) IL_0000: ldarga.s V_0 IL_0002: ldfld ""void* System.IntPtr.m_value"" - IL_0007: call ""System.IntPtr System.IntPtr.Foo()"" + IL_0007: call ""System.IntPtr System.IntPtr.Goo()"" IL_000c: stloc.0 IL_000d: ldloca.s V_0 IL_000f: ldfld ""void* System.IntPtr.m_value"" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs index cd793d0cbb719..fb32dddbf96e8 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -480,7 +480,7 @@ public class C static void Main() { - string myStr = ""foo""; + string myStr = ""goo""; object o = myStr; bool b = o is string; @@ -842,7 +842,7 @@ public class C { static void Main() { - string myStr = ""foo""; + string myStr = ""goo""; object o = myStr; object b = o as string; @@ -1374,7 +1374,7 @@ static void Main() { } - static void Foo(T x) + static void Goo(T x) { var y = default(T) ?? x; } @@ -1387,7 +1387,7 @@ static void Foo(T x) } [Fact] - public void TestNullCoalesce_NoDuplicateCallsToFoo() + public void TestNullCoalesce_NoDuplicateCallsToGoo() { var source = @" // a ?? b @@ -1396,12 +1396,12 @@ public class Test { static void Main() { - object o = Foo() ?? Bar(); + object o = Goo() ?? Bar(); } - static object Foo() + static object Goo() { - System.Console.Write(""Foo""); + System.Console.Write(""Goo""); return new object(); } @@ -1412,12 +1412,12 @@ static object Bar() } } "; - var compilation = CompileAndVerify(source, expectedOutput: "Foo"); + var compilation = CompileAndVerify(source, expectedOutput: "Goo"); compilation.VerifyIL("Test.Main", @" { // Code size 14 (0xe) .maxstack 1 - IL_0000: call ""object Test.Foo()"" + IL_0000: call ""object Test.Goo()"" IL_0005: brtrue.s IL_000d IL_0007: call ""object Test.Bar()"" IL_000c: pop @@ -1465,10 +1465,10 @@ static void Main() List b = new List(); IEnumerable c = a ?? (IEnumerable)b; - Foo(c); + Goo(c); } - static void Foo(T x) + static void Goo(T x) { System.Console.WriteLine(typeof(T)); } @@ -1493,7 +1493,7 @@ .locals init (System.Collections.Generic.List V_0, //b IL_000f: brtrue.s IL_0013 IL_0011: pop IL_0012: ldloc.0 - IL_0013: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_0013: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_0018: ret } "); @@ -1513,10 +1513,10 @@ static void Main() IEnumerable b = new List(); IEnumerable c = b ?? a; - Foo(c); + Goo(c); } - static void Foo(T x) + static void Goo(T x) { System.Console.WriteLine(typeof(T)); } @@ -1540,7 +1540,7 @@ .locals init (int[] V_0, //a IL_000f: brtrue.s IL_0013 IL_0011: pop IL_0012: ldloc.0 - IL_0013: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_0013: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_0018: ret }"); } @@ -1559,11 +1559,11 @@ static void Main() IEnumerable b; IEnumerable c = (b = (IEnumerable)new List()) ?? a; - Foo(c); - Foo(b); + Goo(c); + Goo(b); } - static void Foo(T x) + static void Goo(T x) { System.Console.Write(typeof(T)); } @@ -1588,8 +1588,8 @@ .locals init (int[] V_0, //a IL_0010: brtrue.s IL_0014 IL_0012: pop IL_0013: ldloc.0 - IL_0014: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" - IL_0019: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_0014: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" + IL_0019: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_001e: ret }"); } @@ -1607,10 +1607,10 @@ static void Main() int[] a = new int[] { }; IEnumerable b = new List(); - Foo(b, b ?? a); + Goo(b, b ?? a); } - static void Foo(T x, U y) + static void Goo(T x, U y) { System.Console.Write(typeof(T)); } @@ -1635,7 +1635,7 @@ .locals init (int[] V_0, //a IL_0010: brtrue.s IL_0014 IL_0012: pop IL_0013: ldloc.0 - IL_0014: call ""void Test.Foo, System.Collections.Generic.IEnumerable>(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)"" + IL_0014: call ""void Test.Goo, System.Collections.Generic.IEnumerable>(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)"" IL_0019: ret } "); @@ -2088,14 +2088,14 @@ public void TestEqualEqualOnNestedStructGuid() public class Parent { - public System.Guid Foo(int d = 0, System.Guid g = default(System.Guid)) { return g; } + public System.Guid Goo(int d = 0, System.Guid g = default(System.Guid)) { return g; } } public class Test { public static void Main() { - var x = new Parent().Foo(); + var x = new Parent().Goo(); var ret = x == default(System.Guid); Console.Write(ret); } @@ -4004,10 +4004,10 @@ static void Main() IEnumerable b = new List(); IEnumerable c = C()? b : a; - Foo(c); + Goo(c); } - static void Foo(T x) + static void Goo(T x) { System.Console.WriteLine(typeof(T)); } @@ -4034,7 +4034,7 @@ .locals init (int[] V_0, //a IL_0016: ldloc.2 IL_0017: br.s IL_001a IL_0019: ldloc.1 - IL_001a: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_001a: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_001f: ret }"); } @@ -4055,11 +4055,11 @@ static void Main() IEnumerable b = null; IEnumerable c = C()? (b = (IEnumerable)new List()) : a; - Foo(c); - Foo(b); + Goo(c); + Goo(b); } - static void Foo(T x) + static void Goo(T x) { System.Console.Write(typeof(T)); } @@ -4090,9 +4090,9 @@ .locals init (int[] V_0, //a IL_001b: stloc.1 IL_001c: stloc.2 IL_001d: ldloc.2 - IL_001e: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_001e: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_0023: ldloc.1 - IL_0024: call ""void Test.Foo>(System.Collections.Generic.IEnumerable)"" + IL_0024: call ""void Test.Goo>(System.Collections.Generic.IEnumerable)"" IL_0029: ret }"); } @@ -4110,10 +4110,10 @@ static void Main() int[] a = new int[] { }; IEnumerable b = new List(); - Foo(b, b != null ? b : a); + Goo(b, b != null ? b : a); } - static void Foo(T x, U y) + static void Goo(T x, U y) { System.Console.Write(typeof(T)); } @@ -4141,7 +4141,7 @@ .locals init (int[] V_0, //a IL_0013: ldloc.2 IL_0014: br.s IL_0017 IL_0016: ldloc.1 - IL_0017: call ""void Test.Foo, System.Collections.Generic.IEnumerable>(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)"" + IL_0017: call ""void Test.Goo, System.Collections.Generic.IEnumerable>(System.Collections.Generic.IEnumerable, System.Collections.Generic.IEnumerable)"" IL_001c: ret } "); @@ -4893,12 +4893,12 @@ public int this[int i] set { x = value; } } - public static int Foo(c0 arg) + public static int Goo(c0 arg) { return 1; } - public int Foo() + public int Goo() { return 1; } @@ -4915,8 +4915,8 @@ public static void Repro1(T arg) public static void Repro2(T arg) { - arg.x = c0.Foo(arg); - arg.x = arg.Foo(); + arg.x = c0.Goo(arg); + arg.x = arg.Goo(); } } "; @@ -4966,13 +4966,13 @@ .maxstack 2 IL_0001: box ""T"" IL_0006: ldarg.0 IL_0007: box ""T"" - IL_000c: call ""int c0.Foo(c0)"" + IL_000c: call ""int c0.Goo(c0)"" IL_0011: stfld ""int c0.x"" IL_0016: ldarg.0 IL_0017: box ""T"" IL_001c: ldarg.0 IL_001d: box ""T"" - IL_0022: callvirt ""int c0.Foo()"" + IL_0022: callvirt ""int c0.Goo()"" IL_0027: stfld ""int c0.x"" IL_002c: ret } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefOutTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefOutTests.cs index e0504e3dadccc..63623eae9d0e4 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefOutTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefOutTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -79,11 +79,11 @@ public static void Main(string[] args) // Named parameters are in reversed order // Arguments have side effects // Arguments refer to the same array element - Foo(y: out GetArray(""A"")[GetIndex(""B"")], x: ref GetArray(""C"")[GetIndex(""D"")]); + Goo(y: out GetArray(""A"")[GetIndex(""B"")], x: ref GetArray(""C"")[GetIndex(""D"")]); System.Console.WriteLine(array[0]); } - static void Foo(ref int x, out int y) + static void Goo(ref int x, out int y) { x = 1; y = 2; diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefReturnTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefReturnTests.cs index 29c9bc1c23979..fc74e762c4c4d 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefReturnTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenRefReturnTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -2022,7 +2022,7 @@ public void RefReturnConditionalAccess04() class Program { - class C1 where T : IFoo, new() + class C1 where T : IGoo, new() { T inst = new T(); @@ -2040,21 +2040,21 @@ public void Test() static void Main(string[] args) { - var v = new C1(); + var v = new C1(); v.Test(); } } -interface IFoo +interface IGoo { void Blah(ref T arg); } -class Foo : IFoo +class Goo : IGoo { public int disposed; - public void Blah(ref Foo arg) + public void Blah(ref Goo arg) { arg = null; disposed++; @@ -2089,7 +2089,7 @@ .locals init (T V_0) IL_002f: ldarg.0 IL_0030: ldflda ""T Program.C1.inst"" IL_0035: constrained. ""T"" - IL_003b: callvirt ""void IFoo.Blah(ref T)"" + IL_003b: callvirt ""void IGoo.Blah(ref T)"" IL_0040: ldarg.0 IL_0041: ldfld ""T Program.C1.inst"" IL_0046: box ""T"" @@ -2108,7 +2108,7 @@ public void RefReturnConditionalAccess05() class Program { - class C1 where T : IFoo, new() + class C1 where T : IGoo, new() { T inst = new T(); @@ -2138,21 +2138,21 @@ public void Test() static void Main(string[] args) { - var v = new C1(); + var v = new C1(); v.Test(); } } -interface IFoo +interface IGoo { void Blah(ref T arg); } -class Foo : IFoo +class Goo : IGoo { public int disposed; - public void Blah(ref Foo arg) + public void Blah(ref Goo arg) { arg = null; disposed++; @@ -2193,7 +2193,7 @@ .locals init (T& V_0, //temp IL_0036: br.s IL_0044 IL_0038: ldloc.0 IL_0039: constrained. ""T"" - IL_003f: callvirt ""void IFoo.Blah(ref T)"" + IL_003f: callvirt ""void IGoo.Blah(ref T)"" IL_0044: ldloc.0 IL_0045: ldobj ""T"" IL_004a: box ""T"" @@ -2225,7 +2225,7 @@ .locals init (T& V_0, //temp IL_0097: br.s IL_00a5 IL_0099: ldloc.0 IL_009a: constrained. ""T"" - IL_00a0: callvirt ""void IFoo.Blah(ref T)"" + IL_00a0: callvirt ""void IGoo.Blah(ref T)"" IL_00a5: ldloc.0 IL_00a6: ldobj ""T"" IL_00ab: box ""T"" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenScriptTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenScriptTests.cs index 41ed010da9be8..35d78b9c19bc7 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenScriptTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenScriptTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -469,8 +469,8 @@ public abstract class C [Fact] public void ExprStmtWithMethodCall() { - var s0 = CreateSubmission("int Foo() { return 2;}"); - var s1 = CreateSubmission("(4 + 5) * Foo()", previous: s0); + var s0 = CreateSubmission("int Goo() { return 2;}"); + var s1 = CreateSubmission("(4 + 5) * Goo()", previous: s0); s0.VerifyEmitDiagnostics(); s1.VerifyEmitDiagnostics(); diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenShortCircuitOperatorTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenShortCircuitOperatorTests.cs index 450bfde187ccd..e8d3fe2f91987 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenShortCircuitOperatorTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenShortCircuitOperatorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Roslyn.Test.Utilities; @@ -4244,12 +4244,12 @@ class Program { interface I1 { - void Foo(I1 arg); + void Goo(I1 arg); } class C1 : I1 { - public void Foo(I1 arg) + public void Goo(I1 arg) { } } @@ -4263,13 +4263,13 @@ static void Main() static void Test1() { var c = new C1(); - c?.Foo(c); + c?.Goo(c); } static void Test2() where T : I1, new() { var c = new T(); - c?.Foo(c); + c?.Goo(c); } } "; @@ -4285,7 +4285,7 @@ .locals init (Program.C1 V_0) //c IL_0007: brfalse.s IL_0010 IL_0009: ldloc.0 IL_000a: ldloc.0 - IL_000b: call ""void Program.C1.Foo(Program.I1)"" + IL_000b: call ""void Program.C1.Goo(Program.I1)"" IL_0010: ret } ").VerifyIL("Program.Test2()", @" @@ -4302,7 +4302,7 @@ .locals init (T V_0) //c IL_0010: ldloc.0 IL_0011: box ""T"" IL_0016: constrained. ""T"" - IL_001c: callvirt ""void Program.I1.Foo(Program.I1)"" + IL_001c: callvirt ""void Program.I1.Goo(Program.I1)"" IL_0021: ret } "); @@ -5085,13 +5085,13 @@ class C static void Main() { System.Console.WriteLine(""---""); - Foo(new C()); + Goo(new C()); System.Console.WriteLine(""---""); - Foo(null); + Goo(null); System.Console.WriteLine(""---""); } - static void Foo(C x) + static void Goo(C x) { x?.M(); } @@ -5110,7 +5110,7 @@ public T M() --- ---"); - verifier.VerifyIL("C.Foo", @" + verifier.VerifyIL("C.Goo", @" { // Code size 11 (0xb) .maxstack 1 @@ -5133,13 +5133,13 @@ unsafe class C static void Main() { System.Console.WriteLine(""---""); - Foo(new C()); + Goo(new C()); System.Console.WriteLine(""---""); - Foo(null); + Goo(null); System.Console.WriteLine(""---""); } - static void Foo(C x) + static void Goo(C x) { x?.M(); } @@ -5156,7 +5156,7 @@ static void Foo(C x) --- ---"); - verifier.VerifyIL("C.Foo", @" + verifier.VerifyIL("C.Goo", @" { // Code size 14 (0xe) .maxstack 1 @@ -5743,19 +5743,19 @@ public void ConditionalInAsyncTask() using System; using System.Threading.Tasks; -class Foo +class Goo { public T Method(int i) { Console.Write(i); return default(T); // returns value of unconstrained type parameter type } - public void M1(Foo x) => x?.Method(4); - public async void M2(Foo x) => x?.Method(5); - public async Task M3(Foo x) => x?.Method(6); + public void M1(Goo x) => x?.Method(4); + public async void M2(Goo x) => x?.Method(5); + public async Task M3(Goo x) => x?.Method(6); public async Task M4() { - Foo a = new Foo(); - Foo b = null; + Goo a = new Goo(); + Goo b = null; Action f1 = async () => a?.Method(1); f1(); @@ -5778,7 +5778,7 @@ class Program public static void Main() { // this will complete synchronously as there are no truly async ops. - new Foo().M4(); + new Goo().M4(); } }"; var compilation = CreateCompilationWithMscorlib45( @@ -6095,10 +6095,10 @@ public static void Main() static async Task HasLength(string s, int len) { - return (s?.Foo(await Bar()) ?? await Bar() + await Bar()) + 1 == len; + return (s?.Goo(await Bar()) ?? await Bar() + await Bar()) + 1 == len; } - static int Foo(this string s, int arg) + static int Goo(this string s, int arg) { return s.Length; } @@ -6132,10 +6132,10 @@ public static void Main() static async Task HasLength(T s, int len) { - return (s?.Foo(await Bar()) ?? 2) + 1 == len; + return (s?.Goo(await Bar()) ?? 2) + 1 == len; } - static int Foo(this T s, int arg) + static int Goo(this T s, int arg) { return ((string)(object)s).Length; } @@ -6169,10 +6169,10 @@ public static void Main() static async Task HasLength(T s, int len) { - return (s?.Foo(await Bar(await Bar())) ?? 2) + 1 == len; + return (s?.Goo(await Bar(await Bar())) ?? 2) + 1 == len; } - static int Foo(this T s, int arg) + static int Goo(this T s, int arg) { return ((string)(object)s).Length; } @@ -6213,11 +6213,11 @@ public static void Main() static async Task HasLength(string s, int len) { - System.Console.WriteLine(s?.Foo(await Bar())?.Foo(await Bar()) + ""#""); - return s?.Foo(await Bar())?.Foo(await Bar()).Length == len; + System.Console.WriteLine(s?.Goo(await Bar())?.Goo(await Bar()) + ""#""); + return s?.Goo(await Bar())?.Goo(await Bar()).Length == len; } - static string Foo(this string s, string arg) + static string Goo(this string s, string arg) { return s + arg; } @@ -6251,10 +6251,10 @@ public static void Main() static async Task Test(string s) { - return (await Bar(s))?.Foo(await Bar())?.ToString()?.Length > 1; + return (await Bar(s))?.Goo(await Bar())?.ToString()?.Length > 1; } - static string Foo(this string s, string arg1) + static string Goo(this string s, string arg1) { return s + arg1; } @@ -6336,7 +6336,7 @@ struct S1 class C1 { - public S1 Foo() + public S1 Goo() { return new S1(); } @@ -6353,12 +6353,12 @@ public static void Main() static bool TestEq(C1 c, S1 arg) { - return c?.Foo() == arg; + return c?.Goo() == arg; } static bool TestNeq(C1 c, S1 arg) { - return c?.Foo() != arg; + return c?.Goo() != arg; } } @@ -6380,7 +6380,7 @@ .locals init (C.S1? V_0) IL_000b: ldloc.0 IL_000c: br.s IL_0019 IL_000e: ldarg.0 - IL_000f: call ""C.S1 C.C1.Foo()"" + IL_000f: call ""C.S1 C.C1.Goo()"" IL_0014: newobj ""C.S1?..ctor(C.S1)"" IL_0019: ldarg.1 IL_001a: newobj ""C.S1?..ctor(C.S1)"" @@ -6413,7 +6413,7 @@ struct S1 class C1 { - public S1 Foo() + public S1 Goo() { return new S1(); } @@ -6432,12 +6432,12 @@ public static void Main() static bool TestEq(C1 c, S1? arg) { - return c?.Foo() == arg; + return c?.Goo() == arg; } static bool TestNeq(C1 c, S1? arg) { - return c?.Foo() != arg; + return c?.Goo() != arg; } } @@ -6461,7 +6461,7 @@ .locals init (C.S1? V_0) IL_000b: ldloc.0 IL_000c: br.s IL_0019 IL_000e: ldarg.0 - IL_000f: call ""C.S1 C.C1.Foo()"" + IL_000f: call ""C.S1 C.C1.Goo()"" IL_0014: newobj ""C.S1?..ctor(C.S1)"" IL_0019: ldarg.1 IL_001a: call ""bool C.S1.op_Inequality(C.S1?, C.S1?)"" @@ -6493,7 +6493,7 @@ struct S1 class C1 { - public S1 Foo() + public S1 Goo() { return new S1(); } @@ -6510,12 +6510,12 @@ public static void Main() static bool TestEq(C1 c, S1 arg) { - return c?.Foo() == arg; + return c?.Goo() == arg; } static bool TestNeq(C1 c, S1 arg) { - return c?.Foo() != arg; + return c?.Goo() != arg; } } @@ -6534,7 +6534,7 @@ .maxstack 2 IL_0003: ldc.i4.1 IL_0004: ret IL_0005: ldarg.0 - IL_0006: call ""C.S1 C.C1.Foo()"" + IL_0006: call ""C.S1 C.C1.Goo()"" IL_000b: ldarg.1 IL_000c: call ""bool C.S1.op_Inequality(C.S1, C.S1)"" IL_0011: ret @@ -6565,7 +6565,7 @@ struct S1 class C1 { - public S1 Foo() + public S1 Goo() { return new S1(); } @@ -6584,12 +6584,12 @@ public static void Main() static bool TestEq(C1 c, S1? arg) { - return c?.Foo() == arg; + return c?.Goo() == arg; } static bool TestNeq(C1 c, S1? arg) { - return c?.Foo() != arg; + return c?.Goo() != arg; } } @@ -6613,7 +6613,7 @@ .locals init (C.S1 V_0, IL_0005: call ""bool C.S1?.HasValue.get"" IL_000a: ret IL_000b: ldarg.0 - IL_000c: call ""C.S1 C.C1.Foo()"" + IL_000c: call ""C.S1 C.C1.Goo()"" IL_0011: stloc.0 IL_0012: ldarg.1 IL_0013: stloc.1 diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenStructsAndEnum.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenStructsAndEnum.cs index 2fcd0c06e2e09..3fb2b1dc6dcf5 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenStructsAndEnum.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenStructsAndEnum.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Roslyn.Test.Utilities; @@ -178,21 +178,21 @@ public struct S1 { public int x; - public void Foo() + public void Goo() { x = 123; } } - public static S1 foo() + public static S1 goo() { return new S1(); } static void Main() { - foo().ToString(); - Console.Write(foo().x); + goo().ToString(); + Console.Write(goo().x); } }"; var compilation = CompileAndVerify(source, expectedOutput: @"0"); @@ -202,13 +202,13 @@ static void Main() // Code size 36 (0x24) .maxstack 1 .locals init (Program.S1 V_0) - IL_0000: call ""Program.S1 Program.foo()"" + IL_0000: call ""Program.S1 Program.goo()"" IL_0005: stloc.0 IL_0006: ldloca.s V_0 IL_0008: constrained. ""Program.S1"" IL_000e: callvirt ""string object.ToString()"" IL_0013: pop - IL_0014: call ""Program.S1 Program.foo()"" + IL_0014: call ""Program.S1 Program.goo()"" IL_0019: ldfld ""int Program.S1.x"" IL_001e: call ""void System.Console.Write(int)"" IL_0023: ret @@ -406,12 +406,12 @@ namespace NS namespace N2 { - public interface IFoo + public interface IGoo { void M(T t); } - struct S : IFoo + struct S : IGoo { public S(V v) { @@ -432,9 +432,9 @@ class N2 : N1 { } static void Main() { - IFoo foo = new S(255); - foo.M(""Abc""); - Console.WriteLine(((S)foo).field); + IGoo goo = new S(255); + goo.M(""Abc""); + Console.WriteLine(((S)goo).field); ary = new S[3]; ary[0] = ary[1] = ary[2] = new S('q'); @@ -458,7 +458,7 @@ .locals init (NS.N2.S V_0) IL_000a: box ""NS.N2.S"" IL_000f: dup IL_0010: ldstr ""Abc"" - IL_0015: callvirt ""void NS.N2.IFoo.M(string)"" + IL_0015: callvirt ""void NS.N2.IGoo.M(string)"" IL_001a: unbox ""NS.N2.S"" IL_001f: ldfld ""byte NS.N2.S.field"" IL_0024: call ""void System.Console.WriteLine(int)"" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs index b8eac7aeae28b..7094319c77d8b 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.IO; @@ -3014,21 +3014,21 @@ public class Moo public static int I; } - public static void Foo() + public static void Goo() { Moo.I = 42; } public static void Main() { - Foo(); + Goo(); System.Console.Write(Moo.I); } } "; var compilation = CompileAndVerify(source, expectedOutput: "42"); - compilation.VerifyIL("D.Foo", + compilation.VerifyIL("D.Goo", @"{ // Code size 8 (0x8) .maxstack 1 @@ -3761,7 +3761,7 @@ public Boo() { } - public void Foo(T x, R y, U z) + public void Goo(T x, R y, U z) { System.Collections.Generic.List lT = new System.Collections.Generic.List(); lT.Add(x); @@ -3790,13 +3790,13 @@ public void Foo(T x, R y, U z) public static void Main() { Outer.Boo b = new Outer.Boo(); - b.Foo(""hi"", 42, 123); + b.Goo(""hi"", 42, 123); } } "; var compilation = CompileAndVerify(source, expectedOutput: "hihi4242123123"); - compilation.VerifyIL("D.Outer.Boo.Foo", + compilation.VerifyIL("D.Outer.Boo.Goo", @" { // Code size 195 (0xc3) @@ -4024,7 +4024,7 @@ public class D { public class C1 { - public int Foo(int x, int y) + public int Goo(int x, int y) { System.Console.Write(""[""); System.Console.Write(x); @@ -4051,19 +4051,19 @@ public static void Main() { C1 c = new C1(); - c.Foo(y: GetInt(2), + c.Goo(y: GetInt(2), x: GetInt(3)); System.Console.Write("" ""); - c.Foo( GetInt(1), - c.Foo(y: GetInt(2), + c.Goo( GetInt(1), + c.Goo(y: GetInt(2), x: GetInt(3))); System.Console.Write("" ""); - c.Foo(y: GetInt(1), - x: c.Foo(y: GetInt(2), + c.Goo(y: GetInt(1), + x: c.Goo(y: GetInt(2), x: GetInt(3))); } } @@ -4089,7 +4089,7 @@ .locals init (D.C1 V_0, //c IL_000e: ldc.i4.3 IL_000f: call ""int D.GetInt(int)"" IL_0014: ldloc.1 - IL_0015: callvirt ""int D.C1.Foo(int, int)"" + IL_0015: callvirt ""int D.C1.Goo(int, int)"" IL_001a: pop IL_001b: ldstr "" "" IL_0020: call ""void System.Console.Write(string)"" @@ -4103,8 +4103,8 @@ .locals init (D.C1 V_0, //c IL_0034: ldc.i4.3 IL_0035: call ""int D.GetInt(int)"" IL_003a: ldloc.1 - IL_003b: callvirt ""int D.C1.Foo(int, int)"" - IL_0040: callvirt ""int D.C1.Foo(int, int)"" + IL_003b: callvirt ""int D.C1.Goo(int, int)"" + IL_0040: callvirt ""int D.C1.Goo(int, int)"" IL_0045: pop IL_0046: ldstr "" "" IL_004b: call ""void System.Console.Write(string)"" @@ -4119,9 +4119,9 @@ .locals init (D.C1 V_0, //c IL_0060: ldc.i4.3 IL_0061: call ""int D.GetInt(int)"" IL_0066: ldloc.2 - IL_0067: callvirt ""int D.C1.Foo(int, int)"" + IL_0067: callvirt ""int D.C1.Goo(int, int)"" IL_006c: ldloc.1 - IL_006d: callvirt ""int D.C1.Foo(int, int)"" + IL_006d: callvirt ""int D.C1.Goo(int, int)"" IL_0072: pop IL_0073: ret } @@ -4136,7 +4136,7 @@ public class D { public class C1 { - public int Foo(int x, int y) + public int Goo(int x, int y) { System.Console.Write(""[""); System.Console.Write(x); @@ -4163,9 +4163,9 @@ public static void Main() { C1 c = new C1(); - c.Foo(y: GetInt(1), - x: c.Foo(y: c.Foo(y: GetInt(1), - x: c.Foo(y: GetInt(2), + c.Goo(y: GetInt(1), + x: c.Goo(y: c.Goo(y: GetInt(1), + x: c.Goo(y: GetInt(2), x: GetInt(3))), x: GetInt(3))); } @@ -4200,16 +4200,16 @@ .locals init (int V_0, IL_001d: ldc.i4.3 IL_001e: call ""int D.GetInt(int)"" IL_0023: ldloc.3 - IL_0024: callvirt ""int D.C1.Foo(int, int)"" + IL_0024: callvirt ""int D.C1.Goo(int, int)"" IL_0029: ldloc.2 - IL_002a: callvirt ""int D.C1.Foo(int, int)"" + IL_002a: callvirt ""int D.C1.Goo(int, int)"" IL_002f: stloc.1 IL_0030: ldc.i4.3 IL_0031: call ""int D.GetInt(int)"" IL_0036: ldloc.1 - IL_0037: callvirt ""int D.C1.Foo(int, int)"" + IL_0037: callvirt ""int D.C1.Goo(int, int)"" IL_003c: ldloc.0 - IL_003d: callvirt ""int D.C1.Foo(int, int)"" + IL_003d: callvirt ""int D.C1.Goo(int, int)"" IL_0042: pop IL_0043: ret }"); @@ -4514,7 +4514,7 @@ public void AccessingThis() public class D { - public class Foo + public class Goo { public int x; @@ -4524,7 +4524,7 @@ public void Bar() } } - public struct FooS + public struct GooS { public int x; @@ -4536,12 +4536,12 @@ public void Bar() public static void Main() { - Foo f = new Foo(); + Goo f = new Goo(); System.Console.Write(f.x); f.Bar(); System.Console.Write(f.x); - FooS fs = new FooS(); + GooS fs = new GooS(); System.Console.Write(fs.x); fs.Bar(); System.Console.Write(fs.x); @@ -4550,24 +4550,24 @@ public static void Main() "; var compilation = CompileAndVerify(source, expectedOutput: @"0123401234"); - compilation.VerifyIL("D.Foo.Bar", + compilation.VerifyIL("D.Goo.Bar", @"{ // Code size 12 (0xc) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldc.i4 0x4d2 - IL_0006: stfld ""int D.Foo.x"" + IL_0006: stfld ""int D.Goo.x"" IL_000b: ret } "); - compilation.VerifyIL("D.FooS.Bar", + compilation.VerifyIL("D.GooS.Bar", @"{ // Code size 12 (0xc) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldc.i4 0x4d2 - IL_0006: stfld ""int D.FooS.x"" + IL_0006: stfld ""int D.GooS.x"" IL_000b: ret } "); @@ -4667,7 +4667,7 @@ public void AccessingBase() string source = @" public class D { - public class Foo + public class Goo { public int x; @@ -4677,7 +4677,7 @@ public void Bar() } } - public class FooD : Foo + public class GooD : Goo { public new int x = 5555; public void Baz() @@ -4689,27 +4689,27 @@ public void Baz() public static void Main() { - FooD fd = new FooD(); - System.Console.Write(((Foo)fd).x); + GooD fd = new GooD(); + System.Console.Write(((Goo)fd).x); fd.Bar(); - System.Console.Write(((Foo)fd).x); + System.Console.Write(((Goo)fd).x); fd.Baz(); - System.Console.Write(((Foo)fd).x); + System.Console.Write(((Goo)fd).x); } } "; var compilation = CompileAndVerify(source, expectedOutput: @"012344321"); - compilation.VerifyIL("D.FooD.Baz", + compilation.VerifyIL("D.GooD.Baz", @"{ // Code size 23 (0x17) .maxstack 2 IL_0000: ldarg.0 IL_0001: ldc.i4 0x10e1 - IL_0006: stfld ""int D.Foo.x"" + IL_0006: stfld ""int D.Goo.x"" IL_000b: ldarg.0 IL_000c: ldc.i4 0x1e61 - IL_0011: stfld ""int D.FooD.x"" + IL_0011: stfld ""int D.GooD.x"" IL_0016: ret } "); @@ -6174,7 +6174,7 @@ public class D { public static double x; - public static void Foo(double x) + public static void Goo(double x) { } @@ -6182,30 +6182,30 @@ public static void Main() { if (x == 0) // long branch { - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); } else { if (x == 0) // short branch { - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); - Foo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); + Goo(1.0); } } @@ -6223,47 +6223,47 @@ .maxstack 2 IL_0005: ldc.r8 0 IL_000e: bne.un IL_00a4 IL_0013: ldc.r8 1 - IL_001c: call ""void D.Foo(double)"" + IL_001c: call ""void D.Goo(double)"" IL_0021: ldc.r8 1 - IL_002a: call ""void D.Foo(double)"" + IL_002a: call ""void D.Goo(double)"" IL_002f: ldc.r8 1 - IL_0038: call ""void D.Foo(double)"" + IL_0038: call ""void D.Goo(double)"" IL_003d: ldc.r8 1 - IL_0046: call ""void D.Foo(double)"" + IL_0046: call ""void D.Goo(double)"" IL_004b: ldc.r8 1 - IL_0054: call ""void D.Foo(double)"" + IL_0054: call ""void D.Goo(double)"" IL_0059: ldc.r8 1 - IL_0062: call ""void D.Foo(double)"" + IL_0062: call ""void D.Goo(double)"" IL_0067: ldc.r8 1 - IL_0070: call ""void D.Foo(double)"" + IL_0070: call ""void D.Goo(double)"" IL_0075: ldc.r8 1 - IL_007e: call ""void D.Foo(double)"" + IL_007e: call ""void D.Goo(double)"" IL_0083: ldc.r8 1 - IL_008c: call ""void D.Foo(double)"" + IL_008c: call ""void D.Goo(double)"" IL_0091: ldc.r8 1 - IL_009a: call ""void D.Foo(double)"" + IL_009a: call ""void D.Goo(double)"" IL_009f: br IL_0132 IL_00a4: ldsfld ""double D.x"" IL_00a9: ldc.r8 0 IL_00b2: bne.un.s IL_0132 IL_00b4: ldc.r8 1 - IL_00bd: call ""void D.Foo(double)"" + IL_00bd: call ""void D.Goo(double)"" IL_00c2: ldc.r8 1 - IL_00cb: call ""void D.Foo(double)"" + IL_00cb: call ""void D.Goo(double)"" IL_00d0: ldc.r8 1 - IL_00d9: call ""void D.Foo(double)"" + IL_00d9: call ""void D.Goo(double)"" IL_00de: ldc.r8 1 - IL_00e7: call ""void D.Foo(double)"" + IL_00e7: call ""void D.Goo(double)"" IL_00ec: ldc.r8 1 - IL_00f5: call ""void D.Foo(double)"" + IL_00f5: call ""void D.Goo(double)"" IL_00fa: ldc.r8 1 - IL_0103: call ""void D.Foo(double)"" + IL_0103: call ""void D.Goo(double)"" IL_0108: ldc.r8 1 - IL_0111: call ""void D.Foo(double)"" + IL_0111: call ""void D.Goo(double)"" IL_0116: ldc.r8 1 - IL_011f: call ""void D.Foo(double)"" + IL_011f: call ""void D.Goo(double)"" IL_0124: ldc.r8 1 - IL_012d: call ""void D.Foo(double)"" + IL_012d: call ""void D.Goo(double)"" IL_0132: ldstr ""hi"" IL_0137: call ""void System.Console.Write(string)"" IL_013c: ret @@ -6279,7 +6279,7 @@ public class D { public static int x; - public static void Foo(double x) + public static void Goo(double x) { } @@ -6325,7 +6325,7 @@ public static void Main() { if (x == 0) { - Foo(1.0); + Goo(1.0); } } } @@ -6395,7 +6395,7 @@ .maxstack 1 IL_0084: ldsfld ""int D.x"" IL_0089: brtrue.s IL_0099 IL_008b: ldc.r8 1 - IL_0094: call ""void D.Foo(double)"" + IL_0094: call ""void D.Goo(double)"" IL_0099: ldstr ""hi"" IL_009e: call ""void System.Console.Write(string)"" IL_00a3: ret @@ -7216,7 +7216,7 @@ public class Test { public static short x; // = 9; NotImpl - public long Foo(sbyte y) + public long Goo(sbyte y) { while (y < x*x) { @@ -7255,13 +7255,13 @@ public long Foo(sbyte y) static void Main() { Test.x = 9; - Console.Write(new Test().Foo(6)); + Console.Write(new Test().Goo(6)); } } "; var compilation = CompileAndVerify(source, expectedOutput: @"2"); - compilation.VerifyIL("Program.Test.Foo", + compilation.VerifyIL("Program.Test.Goo", @"{ // Code size 118 (0x76) .maxstack 3 @@ -7332,12 +7332,12 @@ class Program { public class C { - public uint Foo(short p1, ushort p2) { return (ushort) (p1 + p2); } - public uint Foo(short p1, string p2) { return (uint) p1; } - public uint Foo(short p1, params ushort[] p2) { return (byte) (p2[0] + p2[1]); } - public uint Foo(short p1, ref ushort p2) { return p2; } - public uint Foo(out short p1, params ushort[] p2) { p1 = (sbyte)127; return (ushort)p1; } - public uint Foo(short p1, out string p2) { p2 = ""Abc123""; return (ushort) (p1 * 3); } + public uint Goo(short p1, ushort p2) { return (ushort) (p1 + p2); } + public uint Goo(short p1, string p2) { return (uint) p1; } + public uint Goo(short p1, params ushort[] p2) { return (byte) (p2[0] + p2[1]); } + public uint Goo(short p1, ref ushort p2) { return p2; } + public uint Goo(out short p1, params ushort[] p2) { p1 = (sbyte)127; return (ushort)p1; } + public uint Goo(short p1, out string p2) { p2 = ""Abc123""; return (ushort) (p1 * 3); } } public static uint field1, field2; @@ -7346,16 +7346,16 @@ public class C static void Main() { C obj = new C(); - field1 = obj.Foo(-99, 100) + obj.Foo(2, ""QC""); // 1 + 2 - field2 = obj.Foo(-1, 11, 22); // 33 + field1 = obj.Goo(-99, 100) + obj.Goo(2, ""QC""); // 1 + 2 + field2 = obj.Goo(-1, 11, 22); // 33 Console.WriteLine(String.Format(""F1={0}, F2={1}"", field1, field2)); field3 = 444; - Console.WriteLine(obj.Foo(12345, ref field3)); // 444 + Console.WriteLine(obj.Goo(12345, ref field3)); // 444 short out1 = 0; - uint local = obj.Foo(out out1, 1,2,3,4); // 127 + uint local = obj.Goo(out out1, 1,2,3,4); // 127 Console.WriteLine(local); - local = obj.Foo(2, out field4); + local = obj.Goo(2, out field4); Console.WriteLine(local); // 6 Console.WriteLine(field4); } @@ -7380,11 +7380,11 @@ .locals init (Program.C V_0, //obj IL_0006: ldloc.0 IL_0007: ldc.i4.s -99 IL_0009: ldc.i4.s 100 - IL_000b: callvirt ""uint Program.C.Foo(short, ushort)"" + IL_000b: callvirt ""uint Program.C.Goo(short, ushort)"" IL_0010: ldloc.0 IL_0011: ldc.i4.2 IL_0012: ldstr ""QC"" - IL_0017: callvirt ""uint Program.C.Foo(short, string)"" + IL_0017: callvirt ""uint Program.C.Goo(short, string)"" IL_001c: add IL_001d: stsfld ""uint Program.field1"" IL_0022: ldloc.0 @@ -7399,7 +7399,7 @@ .locals init (Program.C V_0, //obj IL_0030: ldc.i4.1 IL_0031: ldc.i4.s 22 IL_0033: stelem.i2 - IL_0034: callvirt ""uint Program.C.Foo(short, params ushort[])"" + IL_0034: callvirt ""uint Program.C.Goo(short, params ushort[])"" IL_0039: stsfld ""uint Program.field2"" IL_003e: ldstr ""F1={0}, F2={1}"" IL_0043: ldsfld ""uint Program.field1"" @@ -7413,7 +7413,7 @@ .locals init (Program.C V_0, //obj IL_006b: ldloc.0 IL_006c: ldc.i4 0x3039 IL_0071: ldsflda ""ushort Program.field3"" - IL_0076: callvirt ""uint Program.C.Foo(short, ref ushort)"" + IL_0076: callvirt ""uint Program.C.Goo(short, ref ushort)"" IL_007b: call ""void System.Console.WriteLine(uint)"" IL_0080: ldc.i4.0 IL_0081: stloc.1 @@ -7424,12 +7424,12 @@ .locals init (Program.C V_0, //obj IL_008b: dup IL_008c: ldtoken ""long .E9E8A66A117598333ABACF5B65971C2366E19B6C"" IL_0091: call ""void System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(System.Array, System.RuntimeFieldHandle)"" - IL_0096: callvirt ""uint Program.C.Foo(out short, params ushort[])"" + IL_0096: callvirt ""uint Program.C.Goo(out short, params ushort[])"" IL_009b: call ""void System.Console.WriteLine(uint)"" IL_00a0: ldloc.0 IL_00a1: ldc.i4.2 IL_00a2: ldsflda ""string Program.field4"" - IL_00a7: callvirt ""uint Program.C.Foo(short, out string)"" + IL_00a7: callvirt ""uint Program.C.Goo(short, out string)"" IL_00ac: call ""void System.Console.WriteLine(uint)"" IL_00b1: ldsfld ""string Program.field4"" IL_00b6: call ""void System.Console.WriteLine(string)"" @@ -7542,7 +7542,7 @@ public struct S { string field1; long field2; - public void Foo(string s, ref long n, params long[] ary) + public void Goo(string s, ref long n, params long[] ary) { field1 = s; // field = param Console.WriteLine(field1); @@ -7565,7 +7565,7 @@ static void Main() obj.n = 9; long[] ary = new long[3]; ary[0] = ary[1] = ary[2] = 123; - valobj.Foo(""Qc"", ref obj.n, ary); + valobj.Goo(""Qc"", ref obj.n, ary); Console.WriteLine(obj.n); Console.WriteLine(ary[0]); } @@ -7579,7 +7579,7 @@ static void Main() 12591 "); - compilation.VerifyIL("C.S.Foo", + compilation.VerifyIL("C.S.Goo", @"{ // Code size 81 (0x51) .maxstack 5 @@ -7675,7 +7675,7 @@ namespace N1 namespace N21 { - public interface IFoo + public interface IGoo { void M(T t, bool b); } @@ -7692,7 +7692,7 @@ public class C public System.String Field = null; } - public class Foo : IFoo + public class Goo : IGoo { public void M(C p, bool b) { @@ -7724,18 +7724,18 @@ static int Main() { C c = new C(); c.Field = ""Hello""; - global::N1.N21.IFoo foo = new global::N1.N22.Foo(); - foo.M(c, global); + global::N1.N21.IGoo goo = new global::N1.N22.Goo(); + goo.M(c, global); return 0; } bool M(Bob p, bool b) { - IFoo foo = null; + IGoo goo = null; if (p != null) b = true; - return b == (foo == null); + return b == (goo == null); } } } @@ -7752,10 +7752,10 @@ .locals init (N1.N22.C V_0) //c IL_0006: ldloc.0 IL_0007: ldstr ""Hello"" IL_000c: stfld ""string N1.N22.C.Field"" - IL_0011: newobj ""N1.N22.Foo..ctor()"" + IL_0011: newobj ""N1.N22.Goo..ctor()"" IL_0016: ldloc.0 IL_0017: ldsfld ""bool NS.Test.global"" - IL_001c: callvirt ""void N1.N21.IFoo.M(N1.N22.C, bool)"" + IL_001c: callvirt ""void N1.N21.IGoo.M(N1.N22.C, bool)"" IL_0021: ldc.i4.0 IL_0022: ret } @@ -9191,14 +9191,14 @@ struct C1 public decimal x; } - static C1 Foo() + static C1 Goo() { return new C1(); } static void Main() { - Console.Write(Foo().x.CompareTo(decimal.One)); + Console.Write(Goo().x.CompareTo(decimal.One)); } } "; @@ -9208,7 +9208,7 @@ static void Main() // Code size 29 (0x1d) .maxstack 2 .locals init (Test.C1 V_0) - IL_0000: call ""Test.C1 Test.Foo()"" + IL_0000: call ""Test.C1 Test.Goo()"" IL_0005: stloc.0 IL_0006: ldloca.s V_0 IL_0008: ldflda ""decimal Test.C1.x"" @@ -9290,12 +9290,12 @@ public void CallMethodFromInterface01() string source = @" namespace NS { - public interface IFoo + public interface IGoo { void M(); } - public struct Foo : IFoo + public struct Goo : IGoo { public void M() { @@ -9307,9 +9307,9 @@ class Test { static void Main() { - Foo foo = new Foo(); - foo.M(); - IFoo ifoo = foo; + Goo goo = new Goo(); + goo.M(); + IGoo ifoo = goo; ifoo.M(); } } @@ -9322,14 +9322,14 @@ static void Main() { // Code size 27 (0x1b) .maxstack 1 - .locals init (NS.Foo V_0) //foo + .locals init (NS.Goo V_0) //goo IL_0000: ldloca.s V_0 - IL_0002: initobj ""NS.Foo"" + IL_0002: initobj ""NS.Goo"" IL_0008: ldloca.s V_0 - IL_000a: call ""void NS.Foo.M()"" + IL_000a: call ""void NS.Goo.M()"" IL_000f: ldloc.0 - IL_0010: box ""NS.Foo"" - IL_0015: callvirt ""void NS.IFoo.M()"" + IL_0010: box ""NS.Goo"" + IL_0015: callvirt ""void NS.IGoo.M()"" IL_001a: ret }"); } @@ -9341,12 +9341,12 @@ public void CallMethodFromGenInterface01() string source = @" namespace NS { - public interface IFoo + public interface IGoo { void M(T t); } - public class Foo : IFoo + public class Goo : IGoo { public void M(int n) { @@ -9358,8 +9358,8 @@ class Test { static void Main() { - IFoo foo = new Foo(); - foo.M(123); + IGoo goo = new Goo(); + goo.M(123); } } } @@ -9370,9 +9370,9 @@ static void Main() @"{ // Code size 13 (0xd) .maxstack 2 - IL_0000: newobj ""NS.Foo..ctor()"" + IL_0000: newobj ""NS.Goo..ctor()"" IL_0005: ldc.i4.s 123 - IL_0007: callvirt ""void NS.IFoo.M(int)"" + IL_0007: callvirt ""void NS.IGoo.M(int)"" IL_000c: ret } "); @@ -10009,15 +10009,15 @@ public void MissingOutFlagForParameter() using System.Threading; delegate T GenDelegate(T p1, out T p2); -interface IFoo { U Function(U i, out U j); } -class Foo : IFoo { public U Function(U i, out U j) { j = i; return i; }} +interface IGoo { U Function(U i, out U j); } +class Goo : IGoo { public U Function(U i, out U j) { j = i; return i; }} class Test { public static int Main() { int i, j; -IFoo inst = new Foo(); +IGoo inst = new Goo(); GenDelegate MyDelegate = new GenDelegate(inst.Function); i = MyDelegate(10, out j); if ((i != 10) || (j != 10)) @@ -10146,11 +10146,11 @@ class Program { static void Main() { - Foo(Console.WriteLine); + Goo(Console.WriteLine); } - static void Foo(Action a) { a(""Hello""); } - static void Foo(Action a) { } + static void Goo(Action a) { a(""Hello""); } + static void Goo(Action a) { } } "; CompileAndVerify(source, expectedOutput: "Hello"); @@ -10209,20 +10209,20 @@ public void TestExternWithoutDLLImport() string source = @" class Test { - extern void Foo(); + extern void Goo(); static void Main() { - (new Test()).Foo(); + (new Test()).Goo(); } }"; var comp = CreateStandardCompilation(source, options: TestOptions.ReleaseDll); // Both Dev10 and Roslyn currently generate unverifiable code for this case... - // Dev10 reports warning CS0626: Method, operator, or accessor 'Test.Foo()' is marked external + // Dev10 reports warning CS0626: Method, operator, or accessor 'Test.Goo()' is marked external // and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. comp.VerifyDiagnostics( - // (4,17): warning CS0626: Method, operator, or accessor 'Test.Foo()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. - Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "Foo").WithArguments("Test.Foo()")); + // (4,17): warning CS0626: Method, operator, or accessor 'Test.Goo()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. + Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "Goo").WithArguments("Test.Goo()")); // NOTE: the resulting IL is unverifiable, but not an error for compat reasons CompileAndVerify(comp, verify: false).VerifyIL("Test.Main", @@ -10231,7 +10231,7 @@ static void Main() // Code size 11 (0xb) .maxstack 1 IL_0000: newobj ""Test..ctor()"" - IL_0005: call ""void Test.Foo()"" + IL_0005: call ""void Test.Goo()"" IL_000a: ret } "); @@ -10389,12 +10389,12 @@ partial class program { static void Main(string[] args) { - foo(name: string.Empty, age: 1, gender: 1 > 2); + goo(name: string.Empty, age: 1, gender: 1 > 2); } } partial class program { - static partial void foo(string name, int age, bool gender); + static partial void goo(string name, int age, bool gender); } "; CompileAndVerify(source); @@ -10611,7 +10611,7 @@ public void DecimalPositive() using System; using System.Linq; -class Foo +class Goo { static void Main() { @@ -10691,7 +10691,7 @@ public void DecimalNegative() using System; using System.Linq; -class Foo +class Goo { static void Main() { @@ -10771,7 +10771,7 @@ public void DecimalMaxValue() using System; using System.Linq; -class Foo +class Goo { static void Main() { @@ -10842,7 +10842,7 @@ public void DecimalConversion01() class C { - static int Foo() + static int Goo() { int i = 10; return (int)(decimal)(int)i; @@ -10855,7 +10855,7 @@ static int Bar() static void Main(string[] args) { - int i = Foo(); + int i = Goo(); int j = Bar(); Console.Write(i); @@ -10863,7 +10863,7 @@ static void Main(string[] args) } }"; var compilation = CompileAndVerify(source, expectedOutput: "101"); - compilation.VerifyIL("C.Foo", + compilation.VerifyIL("C.Goo", @"{ // Code size 13 (0xd) .maxstack 1 @@ -11440,7 +11440,7 @@ public void ImplicitConversionForOptional() { string source = @"class MyClass { - void Foo(decimal x = 10) { } + void Goo(decimal x = 10) { } } "; CompileAndVerify(source); @@ -11580,22 +11580,22 @@ public void DefaultParameterInGenericMethod() public class Program { - public static void Foo(string str2, string str = ""test1"") + public static void Goo(string str2, string str = ""test1"") { - Console.WriteLine(""Foo("" + str2 + "", "" + str + "")""); + Console.WriteLine(""Goo("" + str2 + "", "" + str + "")""); } - public static void Foo(T str2, string str = ""test2"") + public static void Goo(T str2, string str = ""test2"") { - Console.WriteLine(""Foo<"" + typeof(T) + "">("" + str2 + "", "" + str + "")""); + Console.WriteLine(""Goo<"" + typeof(T) + "">("" + str2 + "", "" + str + "")""); } public static void Main() { - Foo(""test3""); + Goo(""test3""); } }"; - CompileAndVerify(source, expectedOutput: "Foo(test3, test2)"); + CompileAndVerify(source, expectedOutput: "Goo(test3, test2)"); } [WorkItem(542920, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542920")] @@ -11606,7 +11606,7 @@ public void PassExceptionVarByRef() using System; class Test { - static void Foo(out Exception ex) + static void Goo(out Exception ex) { ex = new Exception(""bye""); } @@ -11616,7 +11616,7 @@ static void Main() try{ throw new Exception(""hi""); } catch (Exception ex){ - Foo(out ex); + Goo(out ex); Console.WriteLine(ex.Message); } } @@ -11639,7 +11639,7 @@ .locals init (System.Exception V_0) //ex { IL_000b: stloc.0 IL_000c: ldloca.s V_0 - IL_000e: call ""void Test.Foo(out System.Exception)"" + IL_000e: call ""void Test.Goo(out System.Exception)"" IL_0013: ldloc.0 IL_0014: callvirt ""string System.Exception.Message.get"" IL_0019: call ""void System.Console.WriteLine(string)"" @@ -11664,14 +11664,14 @@ public enum E public class Parent { - public int Foo(E e = E.e2) { return e == E.e2 ? 0 : 1; } + public int Goo(E e = E.e2) { return e == E.e2 ? 0 : 1; } } public class Test { public static int Main() { - var ret = new Parent().Foo(); + var ret = new Parent().Goo(); Console.WriteLine(ret); return ret; } @@ -11685,7 +11685,7 @@ public static int Main() .maxstack 2 IL_0000: newobj ""Parent..ctor()"" IL_0005: ldc.i4.3 - IL_0006: call ""int Parent.Foo(E)"" + IL_0006: call ""int Parent.Goo(E)"" IL_000b: dup IL_000c: call ""void System.Console.WriteLine(int)"" IL_0011: ret @@ -11701,14 +11701,14 @@ public void DefaultParamValueIsEnum() public class Parent { - public int Foo(ConsoleKey e = ConsoleKey.A) { return e == ConsoleKey.A ? 0 : 1; } + public int Goo(ConsoleKey e = ConsoleKey.A) { return e == ConsoleKey.A ? 0 : 1; } } public class Test { public static int Main() { - var ret = new Parent().Foo(); + var ret = new Parent().Goo(); Console.WriteLine(ret); return ret; } @@ -11728,12 +11728,12 @@ class A : Attribute { } class C { [return: A] - void Foo() { } + void Goo() { } static void Main() { var obj = new C(); - var attrs = ((Action)obj.Foo).Method.ReturnTypeCustomAttributes.GetCustomAttributes(false); + var attrs = ((Action)obj.Goo).Method.ReturnTypeCustomAttributes.GetCustomAttributes(false); Console.Write(attrs.Length); for (int i = 0; i < attrs.Length; i++) Console.WriteLine(attrs[i]); @@ -11836,8 +11836,8 @@ partial void Gen(T t) { } static void Main() { var obj = new C(); - var foo = ((Action)obj.Gen).Method; - var attrs = foo.GetParameters()[0].GetCustomAttributes(false); + var goo = ((Action)obj.Gen).Method; + var attrs = goo.GetParameters()[0].GetCustomAttributes(false); Console.Write(attrs.Length); for (int i = 0; i < attrs.Length; i++) Console.WriteLine(attrs[i]); @@ -11856,8 +11856,8 @@ public void OverloadResolutionWithParams() public class C { - public int Foo(object i = null, object j = null) { return 0; } - public int Foo(int i = 0, params object[] arr) { return 1; } + public int Goo(object i = null, object j = null) { return 0; } + public int Goo(int i = 0, params object[] arr) { return 1; } public int Bar(object o = null, int i = 1, params object[] arr) { return 1; } public int Bar(string s = ""PickMe"", int i = 1, object o = null) { return 0; } @@ -11868,7 +11868,7 @@ class Test public static void Main() { var obj = new C(); - Console.Write(obj.Foo()); + Console.Write(obj.Goo()); Console.Write(obj.Bar(i: 3)); } } @@ -11922,7 +11922,7 @@ public void OptionalTypeParameterWithDefaultT() public class Parent { - public int Foo(T t = default(T)) + public int Goo(T t = default(T)) { if (t == null) return 0; return 1; @@ -11934,7 +11934,7 @@ class Test public static void Main() { var p = new Parent(); - Console.Write(p.Foo()); + Console.Write(p.Goo()); } } "; @@ -12233,13 +12233,13 @@ class C { static void Main() { - foreach (var e in from x in new int[2] select Foo(ref x)) + foreach (var e in from x in new int[2] select Goo(ref x)) { System.Console.Write(e); } } - static int Foo(ref int x) + static int Goo(ref int x) { return ++x; } @@ -12248,7 +12248,7 @@ static int Foo(ref int x) // NOTE: this is a breaking change - dev10 builds and prints 11. CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( // (8,63): error CS1939: Cannot pass the range variable 'x' as an out or ref parameter - // foreach (var e in from x in new int[2] select Foo(ref x)) + // foreach (var e in from x in new int[2] select Goo(ref x)) Diagnostic(ErrorCode.ERR_QueryOutRefRangeVariable, "x").WithArguments("x")); } @@ -13144,13 +13144,13 @@ static void Main() Test(new D()); } - static void Test(U u) where U : C, IFoo + static void Test(U u) where U : C, IGoo { Console.WriteLine(u.ToString()); } } -interface IFoo +interface IGoo { string ToString(); } @@ -13163,27 +13163,27 @@ public override string ToString() } } -class D : C, IFoo +class D : C, IGoo { public override string ToString() { return ""D""; } - string IFoo.ToString() + string IGoo.ToString() { - return ""IFoo""; + return ""IGoo""; } } "; - // We will have IFoo.ToString and C.ToString (which is an override of object.ToString) + // We will have IGoo.ToString and C.ToString (which is an override of object.ToString) // in the candidate set. Does the rule apply to eliminate all interface methods? NO. The // rule only applies if the candidate set contains a method which originally came from a // class type other than object. The method C.ToString is the "slot" for // object.ToString, so this counts as coming from object. M should call the explicit // interface implementation. - CompileAndVerify(source, expectedOutput: "IFoo"); + CompileAndVerify(source, expectedOutput: "IGoo"); } // Same as above, but C.ToString is "new virtual", rather than "override". @@ -13201,13 +13201,13 @@ static void Main() Test(new D()); } - static void Test(U u) where U : C, IFoo + static void Test(U u) where U : C, IGoo { Console.WriteLine(u.ToString()); } } -interface IFoo +interface IGoo { string ToString(); } @@ -13220,16 +13220,16 @@ class C } } -class D : C, IFoo +class D : C, IGoo { public override string ToString() { return ""D""; } - string IFoo.ToString() + string IGoo.ToString() { - return ""IFoo""; + return ""IGoo""; } } "; @@ -13501,7 +13501,7 @@ private static bool IsZero(decimal x) public void Repro649805() { var source = @" -public class Foo +public class Goo { public static void Method(string s) { @@ -13511,10 +13511,10 @@ public static void Method(string s) } public class Test { - public Foo Foo { get; set; } + public Goo Goo { get; set; } public static void DoExample(dynamic d) { - Foo.Method(d.Prop); + Goo.Method(d.Prop); } public static int Result = -1; @@ -13522,7 +13522,7 @@ static void Main() { try { - DoExample(new Foo() { Prop = ""abc"" }); + DoExample(new Goo() { Prop = ""abc"" }); } catch (System.Exception) { @@ -13551,7 +13551,7 @@ public S1(int v) this.field = v; } - public void Foo() + public void Goo() { System.Console.WriteLine(field.ToString()); } @@ -13562,10 +13562,10 @@ class A static void Main(string[] args) { S1 s = new S1(); - (s = s).Foo(); + (s = s).Goo(); S1 s1 = new S1(42); - (s1 = s1).Foo(); + (s1 = s1).Goo(); } } "; @@ -13585,7 +13585,7 @@ .locals init (S1 V_0, //s IL_000a: stloc.0 IL_000b: stloc.2 IL_000c: ldloca.s V_2 - IL_000e: call ""void S1.Foo()"" + IL_000e: call ""void S1.Goo()"" IL_0013: ldloca.s V_1 IL_0015: ldc.i4.s 42 IL_0017: call ""S1..ctor(int)"" @@ -13594,7 +13594,7 @@ .locals init (S1 V_0, //s IL_001e: stloc.1 IL_001f: stloc.2 IL_0020: ldloca.s V_2 - IL_0022: call ""void S1.Foo()"" + IL_0022: call ""void S1.Goo()"" IL_0027: ret } "); @@ -13614,7 +13614,7 @@ public S1(int v) this.field = v; } - public void Foo() + public void Goo() { System.Console.WriteLine(field.ToString()); } @@ -13653,12 +13653,12 @@ class A { } class B : A { } class Program { - static void Foo(T[] array) where T : class + static void Goo(T[] array) where T : class { array[0] = null; } - static void Foo1(T[] array) where T : struct + static void Goo1(T[] array) where T : struct { array[0] = default(T); } @@ -13676,7 +13676,7 @@ static void Baz(T[][] array) static void Main(string[] args) { A[] array = new B[5]; - Foo(array); + Goo(array); Bar(array); A[][] array1 = new B[5][]; @@ -13686,7 +13686,7 @@ static void Main(string[] args) "; CompileAndVerify(source, expectedOutput: @"" -).VerifyIL("Program.Foo(T[])", +).VerifyIL("Program.Goo(T[])", @" { // Code size 17 (0x11) @@ -13700,7 +13700,7 @@ .locals init (T V_0) IL_000b: stelem ""T"" IL_0010: ret } -").VerifyIL("Program.Foo1(T[])", +").VerifyIL("Program.Goo1(T[])", @" { // Code size 14 (0xe) @@ -13752,7 +13752,7 @@ class A where T: class class Program { - static void Foo(A v) where T : class + static void Goo(A v) where T : class { v.field = null; v.field = default(T); @@ -13768,7 +13768,7 @@ static void Main(string[] args) "; CompileAndVerify(source, expectedOutput: @"" -).VerifyIL("Program.Foo(A)", +).VerifyIL("Program.Goo(A)", @" { // Code size 59 (0x3b) @@ -13816,25 +13816,25 @@ static void Main(string[] args) static void Test1(T arg) where T : cls1 { - arg.Foo(); + arg.Goo(); } static void Test2(T arg) where T : cls2 { - arg.Foo(); + arg.Goo(); } } interface i1 { - void Foo(); + void Goo(); } class cls1 : i1 { - public void Foo() + public void Goo() { - System.Console.Write(""Foo""); + System.Console.Write(""Goo""); } } @@ -13844,7 +13844,7 @@ class cls2 : cls1 "; - CompileAndVerify(source, expectedOutput: @"FooFooFoo"). + CompileAndVerify(source, expectedOutput: @"GooGooGoo"). VerifyIL("Program.Test1(T)", @" { @@ -13852,7 +13852,7 @@ class cls2 : cls1 .maxstack 1 IL_0000: ldarg.0 IL_0001: box ""T"" - IL_0006: callvirt ""void cls1.Foo()"" + IL_0006: callvirt ""void cls1.Goo()"" IL_000b: ret } "). @@ -13863,7 +13863,7 @@ .maxstack 1 .maxstack 1 IL_0000: ldarg.0 IL_0001: box ""T"" - IL_0006: callvirt ""void cls1.Foo()"" + IL_0006: callvirt ""void cls1.Goo()"" IL_000b: ret } "); @@ -14514,7 +14514,7 @@ public void TernaryConsequenceUsesLocal() class Program { - static bool foo() + static bool goo() { return true; } @@ -14522,7 +14522,7 @@ static bool foo() static void Main(string[] args) { bool arg; - var val = (arg = foo())? arg & arg : false; + var val = (arg = goo())? arg & arg : false; System.Console.WriteLine(val); } @@ -14537,7 +14537,7 @@ static void Main(string[] args) // Code size 21 (0x15) .maxstack 2 .locals init (bool V_0) //arg - IL_0000: call ""bool Program.foo()"" + IL_0000: call ""bool Program.goo()"" IL_0005: dup IL_0006: stloc.0 IL_0007: brtrue.s IL_000c @@ -14560,7 +14560,7 @@ public void CoalesceUsesLocal() class Program { - static string foo() + static string goo() { return ""hi""; } @@ -14568,7 +14568,7 @@ static string foo() static void Main(string[] args) { string str; - var val = (str = foo()) ?? str + ""aa""; + var val = (str = goo()) ?? str + ""aa""; System.Console.WriteLine(val); } @@ -14583,7 +14583,7 @@ static void Main(string[] args) // Code size 28 (0x1c) .maxstack 2 .locals init (string V_0) //str - IL_0000: call ""string Program.foo()"" + IL_0000: call ""string Program.goo()"" IL_0005: dup IL_0006: stloc.0 IL_0007: dup @@ -15317,8 +15317,8 @@ class Program static void Main(string[] args) { // should not optimize - System.Console.WriteLine(Foo1() * 0); - System.Console.WriteLine(0 * Foo1()); + System.Console.WriteLine(Goo1() * 0); + System.Console.WriteLine(0 * Goo1()); // should optimize var local = 123; @@ -15330,8 +15330,8 @@ static void Main(string[] args) System.Console.WriteLine(((Func)(()=>local * 0))()); // should not optimize - System.Console.WriteLine(Foo2() & false); - System.Console.WriteLine(false & Foo2()); + System.Console.WriteLine(Goo2() & false); + System.Console.WriteLine(false & Goo2()); // should optimize var local1 = true; @@ -15341,49 +15341,49 @@ static void Main(string[] args) System.Console.WriteLine(false & local1); // should optimize - System.Console.WriteLine(Foo2() && false); - System.Console.WriteLine(Foo2() && true); - System.Console.WriteLine(false && Foo2()); - System.Console.WriteLine(true && Foo2()); - System.Console.WriteLine(Foo2() || false); - System.Console.WriteLine(Foo2() || true); - System.Console.WriteLine(false || Foo2()); - System.Console.WriteLine(true || Foo2()); + System.Console.WriteLine(Goo2() && false); + System.Console.WriteLine(Goo2() && true); + System.Console.WriteLine(false && Goo2()); + System.Console.WriteLine(true && Goo2()); + System.Console.WriteLine(Goo2() || false); + System.Console.WriteLine(Goo2() || true); + System.Console.WriteLine(false || Goo2()); + System.Console.WriteLine(true || Goo2()); } - static int Foo1() + static int Goo1() { - System.Console.Write(""Foo1 ""); + System.Console.Write(""Goo1 ""); return 42; } - static bool Foo2() + static bool Goo2() { - System.Console.Write(""Foo2 ""); + System.Console.Write(""Goo2 ""); return true; } } "; var compilation = CompileAndVerify(source, expectedOutput: @" -Foo1 0 -Foo1 0 +Goo1 0 +Goo1 0 0 0 0 -Foo2 False -Foo2 False +Goo2 False +Goo2 False False False False False -Foo2 False -Foo2 True +Goo2 False +Goo2 True False -Foo2 True -Foo2 True -Foo2 True -Foo2 True +Goo2 True +Goo2 True +Goo2 True +Goo2 True True "); @@ -15392,11 +15392,11 @@ Foo2 True { // Code size 221 (0xdd) .maxstack 2 - IL_0000: call ""int Program.Foo1()"" + IL_0000: call ""int Program.Goo1()"" IL_0005: pop IL_0006: ldc.i4.0 IL_0007: call ""void System.Console.WriteLine(int)"" - IL_000c: call ""int Program.Foo1()"" + IL_000c: call ""int Program.Goo1()"" IL_0011: pop IL_0012: ldc.i4.0 IL_0013: call ""void System.Console.WriteLine(int)"" @@ -15417,11 +15417,11 @@ .maxstack 2 IL_0044: stsfld ""System.Func Program.<>c.<>9__0_0"" IL_0049: callvirt ""int System.Func.Invoke()"" IL_004e: call ""void System.Console.WriteLine(int)"" - IL_0053: call ""bool Program.Foo2()"" + IL_0053: call ""bool Program.Goo2()"" IL_0058: pop IL_0059: ldc.i4.0 IL_005a: call ""void System.Console.WriteLine(bool)"" - IL_005f: call ""bool Program.Foo2()"" + IL_005f: call ""bool Program.Goo2()"" IL_0064: pop IL_0065: ldc.i4.0 IL_0066: call ""void System.Console.WriteLine(bool)"" @@ -15434,27 +15434,27 @@ .maxstack 2 IL_007d: call ""void System.Console.WriteLine(bool)"" IL_0082: ldc.i4.0 IL_0083: call ""void System.Console.WriteLine(bool)"" - IL_0088: call ""bool Program.Foo2()"" + IL_0088: call ""bool Program.Goo2()"" IL_008d: brfalse.s IL_0092 IL_008f: ldc.i4.0 IL_0090: br.s IL_0093 IL_0092: ldc.i4.0 IL_0093: call ""void System.Console.WriteLine(bool)"" - IL_0098: call ""bool Program.Foo2()"" + IL_0098: call ""bool Program.Goo2()"" IL_009d: call ""void System.Console.WriteLine(bool)"" IL_00a2: ldc.i4.0 IL_00a3: call ""void System.Console.WriteLine(bool)"" - IL_00a8: call ""bool Program.Foo2()"" + IL_00a8: call ""bool Program.Goo2()"" IL_00ad: call ""void System.Console.WriteLine(bool)"" - IL_00b2: call ""bool Program.Foo2()"" + IL_00b2: call ""bool Program.Goo2()"" IL_00b7: call ""void System.Console.WriteLine(bool)"" - IL_00bc: call ""bool Program.Foo2()"" + IL_00bc: call ""bool Program.Goo2()"" IL_00c1: brtrue.s IL_00c6 IL_00c3: ldc.i4.1 IL_00c4: br.s IL_00c7 IL_00c6: ldc.i4.1 IL_00c7: call ""void System.Console.WriteLine(bool)"" - IL_00cc: call ""bool Program.Foo2()"" + IL_00cc: call ""bool Program.Goo2()"" IL_00d1: call ""void System.Console.WriteLine(bool)"" IL_00d6: ldc.i4.1 IL_00d7: call ""void System.Console.WriteLine(bool)"" diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs index 5074b331e7576..642dc2e1390f1 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenTupleTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -9892,7 +9892,7 @@ public void IncompleteInterfaceMethod() { var source = @" public interface MyInterface { - (int, int) Foo() + (int, int) Goo() } "; @@ -9900,7 +9900,7 @@ public interface MyInterface { references: s_valueTupleRefs); comp.VerifyDiagnostics( // (3,21): error CS1002: ; expected - // (int, int) Foo() + // (int, int) Goo() Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(3, 21) ); } @@ -21488,7 +21488,7 @@ namespace ClassLibrary1 { public class C1 { - public virtual ref (int, dynamic) Foo(int arg) + public virtual ref (int, dynamic) Goo(int arg) { return ref new (int, dynamic)[]{(1, arg)}[0]; } @@ -21505,7 +21505,7 @@ class Program { static void Main(string[] args) { - ref var x = ref new C2().Foo(42); + ref var x = ref new C2().Goo(42); System.Console.Write(x.Item2); x.Item2 = ""qq""; System.Console.WriteLine(x.Item2); @@ -21514,9 +21514,9 @@ static void Main(string[] args) class C2: ClassLibrary1.C1 { - public override ref (int, object) Foo(int arg) + public override ref (int, object) Goo(int arg) { - return ref base.Foo(arg); + return ref base.Goo(arg); } } } @@ -21524,11 +21524,11 @@ public override ref (int, object) Foo(int arg) var comp = CompileAndVerify(source, expectedOutput: "42qq", additionalRefs: new[] { libComp.ToMetadataReference() }.Concat(s_valueTupleRefs), options: TestOptions.DebugExe, verify: false); - var m = (MethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Foo").First()); - Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Foo(System.Int32 arg)", m.ToTestDisplayString()); + var m = (MethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); + Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Goo(System.Int32 arg)", m.ToTestDisplayString()); var b = m.OverriddenMethod; - Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Foo(System.Int32 arg)", b.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Goo(System.Int32 arg)", b.ToTestDisplayString()); } [WorkItem(14708, "https://github.com/dotnet/roslyn/issues/14708")] @@ -21542,7 +21542,7 @@ namespace ClassLibrary1 { public class C1 { - public virtual ref (int, dynamic) Foo(int arg) + public virtual ref (int, dynamic) Goo(int arg) { return ref new (int, dynamic)[]{(1, arg)}[0]; } @@ -21559,7 +21559,7 @@ class Program { static void Main(string[] args) { - ref var x = ref new C2().Foo(42); + ref var x = ref new C2().Goo(42); System.Console.Write(x.Item2); x.Item2 = ""qq""; System.Console.WriteLine(x.Item2); @@ -21568,9 +21568,9 @@ static void Main(string[] args) class C2: ClassLibrary1.C1 { - public override ref (int, object) Foo(int arg) + public override ref (int, object) Goo(int arg) { - return ref base.Foo(arg); + return ref base.Goo(arg); } } } @@ -21580,11 +21580,11 @@ public override ref (int, object) Foo(int arg) var comp = CompileAndVerify(source, expectedOutput: "42qq", additionalRefs: new[] { libCompRef }.Concat(s_valueTupleRefs), options: TestOptions.DebugExe, verify: false); - var m = (MethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Foo").First()); - Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Foo(System.Int32 arg)", m.ToTestDisplayString()); + var m = (MethodSymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); + Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Goo(System.Int32 arg)", m.ToTestDisplayString()); var b = m.OverriddenMethod; - Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Foo(System.Int32 arg)", b.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Goo(System.Int32 arg)", b.ToTestDisplayString()); } @@ -21862,7 +21862,7 @@ extends [mscorlib]System.Object { .method public hidebysig newslot virtual instance valuetype [System.ValueTuple]System.ValueTuple`2& - Foo(int32 arg) cil managed + Goo(int32 arg) cil managed { .param [0] // the dynamic flags array is too short - decoder expects a flag matching ""ref"", but it is missing here. @@ -21888,7 +21888,7 @@ .locals init (valuetype [System.ValueTuple]System.ValueTuple`2& V_ IL_0023: ldloc.0 IL_0024: ret - } // end of method C1::Foo + } // end of method C1::Goo .method public hidebysig specialname rtspecialname instance void .ctor() cil managed @@ -21912,7 +21912,7 @@ class Program { static void Main(string[] args) { - ref var x = ref new C2().Foo(42); + ref var x = ref new C2().Goo(42); System.Console.Write(x.Item2); x.Item2 = ""qq""; System.Console.WriteLine(x.Item2); @@ -21921,9 +21921,9 @@ static void Main(string[] args) class C2: ClassLibrary1.C1 { - public override ref (int, dynamic) Foo(int arg) + public override ref (int, dynamic) Goo(int arg) { - return ref base.Foo(arg); + return ref base.Goo(arg); } } } @@ -21933,13 +21933,13 @@ public override ref (int, dynamic) Foo(int arg) CompileAndVerify(comp, expectedOutput: "42qq", verify: false); - var m = (MethodSymbol)(comp.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Foo").First()); - Assert.Equal("ref (System.Int32, dynamic) ConsoleApplication5.C2.Foo(System.Int32 arg)", m.ToTestDisplayString()); + var m = (MethodSymbol)(comp.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); + Assert.Equal("ref (System.Int32, dynamic) ConsoleApplication5.C2.Goo(System.Int32 arg)", m.ToTestDisplayString()); var b = m.OverriddenMethod; // not (int, dynamic), // since dynamic flags were not aligned, we have ignored the flags - Assert.Equal("ref (System.Int32, System.Object) ClassLibrary1.C1.Foo(System.Int32 arg)", b.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, System.Object) ClassLibrary1.C1.Goo(System.Int32 arg)", b.ToTestDisplayString()); } @@ -21954,7 +21954,7 @@ namespace ClassLibrary1 { public class C1 { - public virtual ref (int, dynamic) Foo => ref new (int, dynamic)[]{(1, 42)}[0]; + public virtual ref (int, dynamic) Goo => ref new (int, dynamic)[]{(1, 42)}[0]; } } "; @@ -21968,7 +21968,7 @@ class Program { static void Main(string[] args) { - ref var x = ref new C2().Foo; + ref var x = ref new C2().Goo; System.Console.Write(x.Item2); x.Item2 = ""qq""; System.Console.WriteLine(x.Item2); @@ -21977,7 +21977,7 @@ static void Main(string[] args) class C2: ClassLibrary1.C1 { - public override ref (int, object) Foo => ref base.Foo; + public override ref (int, object) Goo => ref base.Goo; } } "; @@ -21986,13 +21986,13 @@ class C2: ClassLibrary1.C1 var comp = CompileAndVerify(source, expectedOutput: "42qq", additionalRefs: new[] { libCompRef }.Concat(s_valueTupleRefs), options: TestOptions.DebugExe, verify: false); - var m = (PropertySymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Foo").First()); - Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Foo { get; }", m.ToTestDisplayString()); - Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Foo.get", m.GetMethod.ToTestDisplayString()); + var m = (PropertySymbol)(comp.Compilation.GetTypeByMetadataName("ConsoleApplication5.C2").GetMembers("Goo").First()); + Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Goo { get; }", m.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, System.Object) ConsoleApplication5.C2.Goo.get", m.GetMethod.ToTestDisplayString()); var b = m.OverriddenProperty; - Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Foo { get; }", b.ToTestDisplayString()); - Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Foo.get", b.GetMethod.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Goo { get; }", b.ToTestDisplayString()); + Assert.Equal("ref (System.Int32, dynamic) ClassLibrary1.C1.Goo.get", b.GetMethod.ToTestDisplayString()); } [Fact] diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingStatementTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingStatementTests.cs index f7037a528989a..062a790064fa8 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingStatementTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenUsingStatementTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -1198,7 +1198,7 @@ public void OutParameterAsUsingResource() var source = @" class Program { - static void foo(ref MyManagedClass x, out MyManagedClass y) + static void goo(ref MyManagedClass x, out MyManagedClass y) { using (x) { @@ -1226,7 +1226,7 @@ public void NotImplementIDispose() var source = @" class Program { - static void foo() + static void goo() { MyManagedClass res = new MyManagedClass(); using (res) // Invalid @@ -1249,7 +1249,7 @@ public void NotImplementIDispose_Struct() var source = @" class Program { - static void foo() + static void goo() { MyManagedClass res = new MyManagedClass(); using (res) // Invalid @@ -1274,7 +1274,7 @@ public void ImplicitImplementIDispose() using System; class Program { - static void foo() + static void goo() { MyManagedClass res = new MyManagedClass(); using (res) @@ -1288,7 +1288,7 @@ public void Dispose() } } "; - CompileAndVerify(source).VerifyIL("Program.foo", @" + CompileAndVerify(source).VerifyIL("Program.goo", @" { // Code size 19 (0x13) .maxstack 1 @@ -1364,7 +1364,7 @@ public void ExplicitImplementIDispose() using System; class Program { - static void foo() + static void goo() { MyManagedClass res = new MyManagedClass(); using (res) @@ -1378,7 +1378,7 @@ public void Dispose() } } "; - CompileAndVerify(source).VerifyIL("Program.foo", @" + CompileAndVerify(source).VerifyIL("Program.goo", @" { // Code size 19 (0x13) .maxstack 1 @@ -2590,7 +2590,7 @@ public void AnonymousDelegateInUsing() delegate T D1(T t); class A1 { - static void Foo(T t) where T : IDisposable + static void Goo(T t) where T : IDisposable { T local = t; using (T t1 = ((D1)delegate(T tt) { return t; })(t)) diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CompoundAssignmentForDelegate.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CompoundAssignmentForDelegate.cs index 18ffcb2527b3c..85bc1802cbe9b 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/CompoundAssignmentForDelegate.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CompoundAssignmentForDelegate.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -82,12 +82,12 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - foo += p.bar; - foo += new boo(p.bar); - foo(); - foo -= p.bar; - foo -= new boo(p.bar); + boo goo = null; + goo += p.bar; + goo += new boo(p.bar); + goo(); + goo -= p.bar; + goo -= new boo(p.bar); } } "; @@ -107,11 +107,11 @@ class C { static void Main(string[] args) { - boo foo = null; - foo += (boo)null; - foo -= (boo)null; - foo += null; - foo -= null; + boo goo = null; + goo += (boo)null; + goo -= (boo)null; + goo += null; + goo -= null; } } "; @@ -155,15 +155,15 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - boo foo1 = new boo(abc.far); - foo += foo1; // Same type - foo(); - foo -= foo1; // Same type + boo goo = null; + boo goo1 = new boo(abc.far); + goo += goo1; // Same type + goo(); + goo -= goo1; // Same type boo[] arrfoo = { p.bar, abc.far }; - foo += (boo)Delegate.Combine(arrfoo); // OK - foo += (boo)Delegate.Combine(foo, foo1); // OK - foo(); + goo += (boo)Delegate.Combine(arrfoo); // OK + goo += (boo)Delegate.Combine(goo, goo1); // OK + goo(); } } "; @@ -187,14 +187,14 @@ class C { static void Main() { - boo foo = null; - foo += delegate (int x) + boo goo = null; + goo += delegate (int x) { System.Console.WriteLine(x); }; - foo(10); - Delegate[] del = foo.GetInvocationList(); - foo -= (boo)del[0]; + goo(10); + Delegate[] del = goo.GetInvocationList(); + goo -= (boo)del[0]; } } "; @@ -243,14 +243,14 @@ class C { static void Main() { - boo foo = null; - foo += (x) => + boo goo = null; + goo += (x) => { System.Console.WriteLine(x); }; - foo(""Hello""); - Delegate[] del = foo.GetInvocationList(); - foo -= (boo)del[0]; + goo(""Hello""); + Delegate[] del = goo.GetInvocationList(); + goo -= (boo)del[0]; } } "; @@ -302,13 +302,13 @@ class C static public void far(int x) { Console.WriteLine(""far:{0}"", x); } static void Main(string[] args) { - boo foo = far; - foo += (x) => + boo goo = far; + goo += (x) => System.Console.WriteLine(""lambda:{0}"", x); - foo(10); - Delegate[] del = foo.GetInvocationList(); - foo -= (boo)del[0]; - foo(20); + goo(10); + Delegate[] del = goo.GetInvocationList(); + goo -= (boo)del[0]; + goo(20); } } "; @@ -331,15 +331,15 @@ class C static public void far(int x) { Console.WriteLine(""far:{0}"", x); } static void Main(string[] args) { - boo foo = far; - foo += delegate(int x) + boo goo = far; + goo += delegate(int x) { System.Console.WriteLine(""Anonymous:{0}"", x); }; - foo(10); - Delegate[] del = foo.GetInvocationList(); - foo -= (boo)del[0]; - foo(20); + goo(10); + Delegate[] del = goo.GetInvocationList(); + goo -= (boo)del[0]; + goo(20); } } "; @@ -362,19 +362,19 @@ class C static public void far(int x) { Console.WriteLine(""far:{0}"", x); } static void Main(string[] args) { - boo foo = far; - foo += x => + boo goo = far; + goo += x => { System.Console.WriteLine(""Lambda:{0}"", x); }; - foo += delegate(int x) + goo += delegate(int x) { System.Console.WriteLine(""Anonymous:{0}"", x); }; - foo(10); - Delegate[] del = foo.GetInvocationList(); - foo -= (boo)del[0]; - foo(20); + goo(10); + Delegate[] del = goo.GetInvocationList(); + goo -= (boo)del[0]; + goo(20); } } "; @@ -485,15 +485,15 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = new boo(p.bar); - foo(); - foo -= p.bar; - foo = new boo(abc.far); - foo(); - foo -= abc.far; - foo += p.bar; - foo += abc.far; - foo(); + boo goo = new boo(p.bar); + goo(); + goo -= p.bar; + goo = new boo(abc.far); + goo(); + goo -= abc.far; + goo += p.bar; + goo += abc.far; + goo(); } } "; @@ -515,7 +515,7 @@ public class abc { public void bar() { System.Console.WriteLine(""bar""); } static public void far() { System.Console.WriteLine(""far""); } - public boo foo = null; + public boo goo = null; } class C @@ -523,12 +523,12 @@ class C static void Main(string[] args) { abc p = new abc(); - p.foo = null; - p.foo += abc.far; - p.foo += p.bar; - p.foo(); - p.foo -= abc.far; - p.foo -= p.bar; + p.goo = null; + p.goo += abc.far; + p.goo += p.bar; + p.goo(); + p.goo -= abc.far; + p.goo -= p.bar; } } "; @@ -556,15 +556,15 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - foo += loo() ? new boo(p.bar) : new boo(abc.far); - foo(); - foo -= loo() ? new boo(p.bar) : new boo(abc.far); + boo goo = null; + goo += loo() ? new boo(p.bar) : new boo(abc.far); + goo(); + goo -= loo() ? new boo(p.bar) : new boo(abc.far); boo left = null; boo right = null; - foo = !loo() ? left += new boo(abc.far) : right += new boo(p.bar); - foo(); - foo = !loo() ? left -= new boo(abc.far) : right -= new boo(p.bar); + goo = !loo() ? left += new boo(abc.far) : right += new boo(p.bar); + goo(); + goo = !loo() ? left -= new boo(abc.far) : right -= new boo(p.bar); } private static bool loo() @@ -596,11 +596,11 @@ public static void Hello(out int i, double d, ref float f, string s, char c, dec } static void Main(string[] args) { - boo foo = null; - foo += new boo(C.Hello); + boo goo = null; + goo += new boo(C.Hello); int i = 1; float ff = 0; - foo(out i, 5.5, ref ff, ""a string"", 'C', 0.555m, new C(), 3, 16); + goo(out i, 5.5, ref ff, ""a string"", 'C', 0.555m, new C(), 3, 16); } } "; @@ -631,9 +631,9 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - foo += new boo(p.bar); - foo(); + boo goo = null; + goo += new boo(p.bar); + goo(); } } "; @@ -710,7 +710,7 @@ static void Main(string[] args) CompileAndVerify(text, expectedOutput: expectedOutPut); } - // delegate-in-a-generic-class (C.foo(…)) += methodgroup-in-a-generic-class (C.bar(…)) + // delegate-in-a-generic-class (C.goo(…)) += methodgroup-in-a-generic-class (C.bar(…)) [Fact] public void CompAssignOperatorForGenericClass() { @@ -722,18 +722,18 @@ class C public void bar(short x) { System.Console.WriteLine(""bar""); } public static void far(T x) { System.Console.WriteLine(""far""); } public static void par(U x) { System.Console.WriteLine(""par""); } - public static boo foo = null; + public static boo goo = null; } class D { static void Main(string[] args) { C p = new C(); - C.foo += p.bar; - C.foo += C.far; - C.foo += C.par; - C.foo(short.MaxValue); - C.foo(short.MaxValue); + C.goo += p.bar; + C.goo += C.far; + C.goo += C.par; + C.goo(short.MaxValue); + C.goo(short.MaxValue); } } "; @@ -769,15 +769,15 @@ public static DerivedClass DelegatedMethod(DerivedClass x) } static void Main(string[] args) { - MyBaseDelegate foo = null; - foo += BaseClass.DelegatedMethod; - foo += DerivedClass.DelegatedMethod; - foo(new BaseClass()); - foo(new DerivedClass()); - MyDerivedDelegate foo1 = null; - //foo1 += BaseClass.DelegatedMethod; - foo1 += DerivedClass.DelegatedMethod; - foo1(new DerivedClass()); + MyBaseDelegate goo = null; + goo += BaseClass.DelegatedMethod; + goo += DerivedClass.DelegatedMethod; + goo(new BaseClass()); + goo(new DerivedClass()); + MyDerivedDelegate goo1 = null; + //goo1 += BaseClass.DelegatedMethod; + goo1 += DerivedClass.DelegatedMethod; + goo1(new DerivedClass()); } } "; @@ -824,16 +824,16 @@ public class DerivedClass : BaseClass } static void Main(string[] args) { - MyDelegate foo = null; - foo += BaseClass.DelegatedMethod; - foo += DerivedClass.DelegatedMethod; - foo(new BaseClass()); - foo(new DerivedClass()); - MyDelegate foo1 = null; - foo1 += BaseClass.DelegatedMethod; - foo1 += DerivedClass.DelegatedMethod; - //foo1(new BaseClass()); - foo1(new DerivedClass()); + MyDelegate goo = null; + goo += BaseClass.DelegatedMethod; + goo += DerivedClass.DelegatedMethod; + goo(new BaseClass()); + goo(new DerivedClass()); + MyDelegate goo1 = null; + goo1 += BaseClass.DelegatedMethod; + goo1 += DerivedClass.DelegatedMethod; + //goo1(new BaseClass()); + goo1(new DerivedClass()); } } "; @@ -878,21 +878,21 @@ public class DerivedClass : BaseClass static void Main(string[] args) { - MyDelegate foo = null; - foo += BaseClass.DelegatedMethod; - foo += DerivedClass.DelegatedMethod; - foo(new BaseClass()); - foo(new DerivedClass()); - MyDelegate foo1 = null; - foo1 += BaseClass.DelegatedMethod; - foo1 += DerivedClass.DelegatedMethod; - //foo1(new BaseClass()); - foo1(new DerivedClass()); - MyDelegate foo2 = null; - foo2 += BaseClass.DelegatedMethod; - foo2 += BaseClass.DelegatedMethod; - foo2 += DerivedClass.DelegatedMethod; - foo2(2); + MyDelegate goo = null; + goo += BaseClass.DelegatedMethod; + goo += DerivedClass.DelegatedMethod; + goo(new BaseClass()); + goo(new DerivedClass()); + MyDelegate goo1 = null; + goo1 += BaseClass.DelegatedMethod; + goo1 += DerivedClass.DelegatedMethod; + //goo1(new BaseClass()); + goo1(new DerivedClass()); + MyDelegate goo2 = null; + goo2 += BaseClass.DelegatedMethod; + goo2 += BaseClass.DelegatedMethod; + goo2 += DerivedClass.DelegatedMethod; + goo2(2); } } "; @@ -941,15 +941,15 @@ public class DerivedClass : BaseClass static void Main(string[] args) { - MyDelegate foo = null; - foo += BaseClass.DelegatedMethod; - foo += BaseClass.DelegatedMethod; - foo += DerivedClass.DelegatedMethod; - MyDelegate foo1 = null; - foo1 += foo; - foo += foo1; - foo(1); - foo1(1); + MyDelegate goo = null; + goo += BaseClass.DelegatedMethod; + goo += BaseClass.DelegatedMethod; + goo += DerivedClass.DelegatedMethod; + MyDelegate goo1 = null; + goo1 += goo; + goo += goo1; + goo(1); + goo1(1); } } "; diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/ForLoopsTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/ForLoopsTests.cs index 4b8b8a644a57c..c32db8366f754 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/ForLoopsTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/ForLoopsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -1457,12 +1457,12 @@ class C { static void Main(string[] args) { - for (Foo f = new Foo { i = 0, s = ""abc"" }; f.i < 5; f.i = f.i + 1) + for (Goo f = new Goo { i = 0, s = ""abc"" }; f.i < 5; f.i = f.i + 1) { } } } -public class Foo +public class Goo { public int i; public string s; @@ -1472,24 +1472,24 @@ public class Foo { // Code size 50 (0x32) .maxstack 3 - .locals init (Foo V_0) //f - IL_0000: newobj ""Foo..ctor()"" + .locals init (Goo V_0) //f + IL_0000: newobj ""Goo..ctor()"" IL_0005: dup IL_0006: ldc.i4.0 - IL_0007: stfld ""int Foo.i"" + IL_0007: stfld ""int Goo.i"" IL_000c: dup IL_000d: ldstr ""abc"" - IL_0012: stfld ""string Foo.s"" + IL_0012: stfld ""string Goo.s"" IL_0017: stloc.0 IL_0018: br.s IL_0028 IL_001a: ldloc.0 IL_001b: ldloc.0 - IL_001c: ldfld ""int Foo.i"" + IL_001c: ldfld ""int Goo.i"" IL_0021: ldc.i4.1 IL_0022: add - IL_0023: stfld ""int Foo.i"" + IL_0023: stfld ""int Goo.i"" IL_0028: ldloc.0 - IL_0029: ldfld ""int Foo.i"" + IL_0029: ldfld ""int Goo.i"" IL_002e: ldc.i4.5 IL_002f: blt.s IL_001a IL_0031: ret @@ -1845,12 +1845,12 @@ class Program { static void Main(string[] args) { - for (int i = 0; foo(i--) > -5;) + for (int i = 0; goo(i--) > -5;) { System.Console.WriteLine(i); } } - static int foo(int x) + static int goo(int x) { return x; } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/ForeachTest.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/ForeachTest.cs index af6bd59798412..f6803166ce6cd 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/ForeachTest.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/ForeachTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -360,7 +360,7 @@ public class Test { static public int Main(string[] args) { - foreach (var var in ""foo"") + foreach (var var in ""goo"") { if (!var.GetType().Equals(typeof(char))) { diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/GotoTest.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/GotoTest.cs index 284bf20c025c6..a080cc2e95d22 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/GotoTest.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/GotoTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -21,7 +21,7 @@ public class Program { public static void Main(string[] args) { - Console.WriteLine(""foo""); + Console.WriteLine(""goo""); goto bar; Console.Write(""you won't see me""); bar: Console.WriteLine(""bar""); @@ -29,7 +29,7 @@ public static void Main(string[] args) } } "; - string expectedOutput = @"foo + string expectedOutput = @"goo bar "; @@ -47,14 +47,14 @@ public class Program { public static void Main(string[] args) { - Console.WriteLine(""foo""); + Console.WriteLine(""goo""); goto bar; Console.Write(""you won't see me""); bar: Console.WriteLine(""bar""); } } "; - string expectedOutput = @"foo + string expectedOutput = @"goo bar "; diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/IndexerTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/IndexerTests.cs index 3a275fed4a86b..672c01aac42c1 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/IndexerTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/IndexerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -287,7 +287,7 @@ private static void ValidateIndexer(ModuleSymbol module, string getterDisplayStr private const string TypeWithIndexers = @" public class C { - public static int Foo(int x) + public static int Goo(int x) { System.Console.Write(x + "",""); return x * 10; @@ -338,34 +338,34 @@ static void Main() //// Normal - x = c[C.Foo(1), C.Foo(2)]; + x = c[C.Goo(1), C.Goo(2)]; System.Console.WriteLine(); //// Named parameters - x = c[C.Foo(1), y: C.Foo(2)]; //NB: Dev10 gets this wrong (2,1,10,20) + x = c[C.Goo(1), y: C.Goo(2)]; //NB: Dev10 gets this wrong (2,1,10,20) System.Console.WriteLine(); - x = c[x: C.Foo(1), y: C.Foo(2)]; + x = c[x: C.Goo(1), y: C.Goo(2)]; System.Console.WriteLine(); - x = c[y: C.Foo(2), x: C.Foo(1)]; + x = c[y: C.Goo(2), x: C.Goo(1)]; System.Console.WriteLine(); //// Optional parameters - x = c[C.Foo(1)]; + x = c[C.Goo(1)]; System.Console.WriteLine(); - x = c[x: C.Foo(1)]; + x = c[x: C.Goo(1)]; System.Console.WriteLine(); //// Parameter arrays - x = c[C.Foo(1), C.Foo(2), C.Foo(3)]; + x = c[C.Goo(1), C.Goo(2), C.Goo(3)]; System.Console.WriteLine(); - x = c[new int[] { C.Foo(1), C.Foo(2), C.Foo(3) }]; + x = c[new int[] { C.Goo(1), C.Goo(2), C.Goo(3) }]; System.Console.WriteLine(); } } @@ -487,34 +487,34 @@ static void Main() //// Normal - c[C.Foo(1), C.Foo(2)] = C.Foo(3); + c[C.Goo(1), C.Goo(2)] = C.Goo(3); System.Console.WriteLine(); //// Named parameters - c[C.Foo(1), y: C.Foo(2)] = C.Foo(3); + c[C.Goo(1), y: C.Goo(2)] = C.Goo(3); System.Console.WriteLine(); - c[x: C.Foo(1), y: C.Foo(2)] = C.Foo(3); //NB: dev10 gets this wrong (2,1,3,10,20,30,) + c[x: C.Goo(1), y: C.Goo(2)] = C.Goo(3); //NB: dev10 gets this wrong (2,1,3,10,20,30,) System.Console.WriteLine(); - c[y: C.Foo(2), x: C.Foo(1)] = C.Foo(3); + c[y: C.Goo(2), x: C.Goo(1)] = C.Goo(3); System.Console.WriteLine(); //// Optional parameters - c[C.Foo(1)] = C.Foo(3); + c[C.Goo(1)] = C.Goo(3); System.Console.WriteLine(); - c[x: C.Foo(1)] = C.Foo(3); + c[x: C.Goo(1)] = C.Goo(3); System.Console.WriteLine(); //// Parameter arrays - c[C.Foo(1), C.Foo(2), C.Foo(3)] = C.Foo(4); + c[C.Goo(1), C.Goo(2), C.Goo(3)] = C.Goo(4); System.Console.WriteLine(); - c[new int[] { C.Foo(1), C.Foo(2), C.Foo(3) }] = C.Foo(4); + c[new int[] { C.Goo(1), C.Goo(2), C.Goo(3) }] = C.Goo(4); System.Console.WriteLine(); } } @@ -635,34 +635,34 @@ static void Main() //// Normal - c[C.Foo(1), C.Foo(2)]++; + c[C.Goo(1), C.Goo(2)]++; System.Console.WriteLine(); //// Named parameters - c[C.Foo(1), y: C.Foo(2)]++; + c[C.Goo(1), y: C.Goo(2)]++; System.Console.WriteLine(); - c[x: C.Foo(1), y: C.Foo(2)]++; //NB: dev10 gets this wrong (2,1,10,20,10,20,-29,) + c[x: C.Goo(1), y: C.Goo(2)]++; //NB: dev10 gets this wrong (2,1,10,20,10,20,-29,) System.Console.WriteLine(); - c[y: C.Foo(2), x: C.Foo(1)]++; + c[y: C.Goo(2), x: C.Goo(1)]++; System.Console.WriteLine(); //// Optional parameters - c[C.Foo(1)]++; + c[C.Goo(1)]++; System.Console.WriteLine(); - c[x: C.Foo(1)]++; + c[x: C.Goo(1)]++; System.Console.WriteLine(); //// Parameter arrays - c[C.Foo(1), C.Foo(2), C.Foo(3)]++; + c[C.Goo(1), C.Goo(2), C.Goo(3)]++; System.Console.WriteLine(); - c[new int[] { C.Foo(1), C.Foo(2), C.Foo(3) }]++; + c[new int[] { C.Goo(1), C.Goo(2), C.Goo(3) }]++; System.Console.WriteLine(); } } @@ -848,34 +848,34 @@ static void Main() //// Normal - c[C.Foo(1), C.Foo(2)] += C.Foo(3); + c[C.Goo(1), C.Goo(2)] += C.Goo(3); System.Console.WriteLine(); //// Named parameters - c[C.Foo(1), y: C.Foo(2)] += C.Foo(3); + c[C.Goo(1), y: C.Goo(2)] += C.Goo(3); System.Console.WriteLine(); - c[x: C.Foo(1), y: C.Foo(2)] += C.Foo(3); //NB: dev10 gets this wrong (2,1,10,20,3,10,20,0,) + c[x: C.Goo(1), y: C.Goo(2)] += C.Goo(3); //NB: dev10 gets this wrong (2,1,10,20,3,10,20,0,) System.Console.WriteLine(); - c[y: C.Foo(2), x: C.Foo(1)] += C.Foo(3); + c[y: C.Goo(2), x: C.Goo(1)] += C.Goo(3); System.Console.WriteLine(); //// Optional parameters - c[C.Foo(1)] += C.Foo(3); + c[C.Goo(1)] += C.Goo(3); System.Console.WriteLine(); - c[x: C.Foo(1)] += C.Foo(3); + c[x: C.Goo(1)] += C.Goo(3); System.Console.WriteLine(); //// Parameter arrays - c[C.Foo(1), C.Foo(2), C.Foo(3)] += C.Foo(4); + c[C.Goo(1), C.Goo(2), C.Goo(3)] += C.Goo(4); System.Console.WriteLine(); - c[new int[] { C.Foo(1), C.Foo(2), C.Foo(3) }] += C.Foo(4); + c[new int[] { C.Goo(1), C.Goo(2), C.Goo(3) }] += C.Goo(4); System.Console.WriteLine(); } } @@ -1078,7 +1078,7 @@ static C NewC() static void Main() { - NewC()[y: C.Foo(1), x: NewC()[C.Foo(2)]] = NewC()[x: C.Foo(3), y: NewC()[C.Foo(4)]] += NewC()[C.Foo(5), C.Foo(6), NewC()[C.Foo(7)]]++; + NewC()[y: C.Goo(1), x: NewC()[C.Goo(2)]] = NewC()[x: C.Goo(3), y: NewC()[C.Goo(4)]] += NewC()[C.Goo(5), C.Goo(6), NewC()[C.Goo(7)]]++; System.Console.WriteLine(); } } diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/ObjectAndCollectionInitializerTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/ObjectAndCollectionInitializerTests.cs index d320fd95c3cbc..766711424a058 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/ObjectAndCollectionInitializerTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/ObjectAndCollectionInitializerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CodeGen; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -114,13 +114,13 @@ public Base() {} public static void Main() { - MemberInitializerTest.Foo(); + MemberInitializerTest.Goo(); } } public class MemberInitializerTest where T: Base, new() { - public static void Foo() + public static void Goo() { var i = new T() { x = 1, y = 2 }; System.Console.WriteLine(i.x); @@ -131,7 +131,7 @@ public static void Foo() string expectedOutput = @"1 2"; var compVerifier = CompileAndVerify(source, expectedOutput: expectedOutput); - compVerifier.VerifyIL("MemberInitializerTest.Foo", @" + compVerifier.VerifyIL("MemberInitializerTest.Goo", @" { // Code size 61 (0x3d) .maxstack 3 @@ -165,11 +165,11 @@ class MemberInitializerTest { static int Main() { - Console.WriteLine(Foo()); + Console.WriteLine(Goo()); return 0; } - static byte Foo() where T : I, new() + static byte Goo() where T : I, new() { var b = new T { X = 1 }; return b.X; @@ -188,7 +188,7 @@ struct S : I "; string expectedOutput = "1"; var compVerifier = CompileAndVerify(source, expectedOutput: expectedOutput); - compVerifier.VerifyIL("MemberInitializerTest.Foo", @" + compVerifier.VerifyIL("MemberInitializerTest.Goo", @" { // Code size 36 (0x24) .maxstack 2 @@ -219,11 +219,11 @@ class MemberInitializerTest { static int Main() { - Console.WriteLine(Foo().Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); + Console.WriteLine(Goo().Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); return 0; } - static Decimal? Foo() where T : I, new() + static Decimal? Goo() where T : I, new() { var b = new T { X = 1.1M }; return b.X; @@ -241,7 +241,7 @@ struct S : I }"; string expectedOutput = "1.1"; var compVerifier = CompileAndVerify(source, expectedOutput: expectedOutput); - compVerifier.VerifyIL("MemberInitializerTest.Foo", @" + compVerifier.VerifyIL("MemberInitializerTest.Goo", @" { // Code size 51 (0x33) .maxstack 6 @@ -399,10 +399,10 @@ public class MemberInitializerTest public static void Main() { - Foo(); + Goo(); } - public static void Foo(MemberInitializerTest nullArg = null) + public static void Goo(MemberInitializerTest nullArg = null) { MemberInitializerTest m = new MemberInitializerTest() { x = -1, y = -1, z = -1 }; @@ -431,7 +431,7 @@ public static int Bar(int i) -1 -1"; var compVerifier = CompileAndVerify(source, expectedOutput: expectedOutput); - compVerifier.VerifyIL("MemberInitializerTest.Foo", @" + compVerifier.VerifyIL("MemberInitializerTest.Goo", @" { // Code size 108 (0x6c) .maxstack 3 @@ -833,12 +833,12 @@ public class Test public int x, y; public static void Main() { - Test m = new Test() { x = Foo(out m), y = m.x }; + Test m = new Test() { x = Goo(out m), y = m.x }; System.Console.WriteLine(m.x); // Print 1 System.Console.WriteLine(m.y); // Print 0 } - public static int Foo(out Test m) + public static int Goo(out Test m) { m = new Test() { x = 0 }; return 1; @@ -856,7 +856,7 @@ .locals init (Test V_0) //m IL_0000: newobj ""Test..ctor()"" IL_0005: dup IL_0006: ldloca.s V_0 - IL_0008: call ""int Test.Foo(out Test)"" + IL_0008: call ""int Test.Goo(out Test)"" IL_000d: stfld ""int Test.x"" IL_0012: dup IL_0013: ldloc.0 diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs index 331b3a6f73023..5444b4126e805 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/SwitchTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -2351,10 +2351,10 @@ static void Main() break; } - Foo(1); + Goo(1); } - static void Foo(sbyte? p) + static void Goo(sbyte? p) { switch (p) { @@ -2395,7 +2395,7 @@ .locals init (sbyte? V_0, //local IL_0035: ldc.i4.1 IL_0036: conv.i1 IL_0037: newobj ""sbyte?..ctor(sbyte)"" - IL_003c: call ""void Program.Foo(sbyte?)"" + IL_003c: call ""void Program.Goo(sbyte?)"" IL_0041: ret }"); } @@ -2409,11 +2409,11 @@ class Program { static void Main() { - Foo(null); - Foo(100); + Goo(null); + Goo(100); } - static void Foo(short? p) + static void Goo(short? p) { switch (p) { @@ -2495,7 +2495,7 @@ static void Foo(short? p) } "; var verifier = CompileAndVerify(text, expectedOutput: "null default 100 default "); - verifier.VerifyIL("Program.Foo", @" + verifier.VerifyIL("Program.Goo", @" { // Code size 373 (0x175) .maxstack 2 @@ -2747,14 +2747,14 @@ public static bool F(long? x) { switch (x) { - case (int)Foo.X: + case (int)Goo.X: return true; default: return false; } } - public enum Foo : int { X = 1 } + public enum Goo : int { X = 1 } static void Main() { @@ -3666,7 +3666,7 @@ public void StringSwitch_HashTableSwitch_03() var text = @" using System; -class Foo +class Goo { public static void Main() { @@ -6339,22 +6339,22 @@ class SwitchTest public static int Main() { int n = 3; - int foo; // unassigned foo + int goo; // unassigned goo switch (n) { case 1: case 2: - foo = n; + goo = n; break; case 3: default: - foo = 0; + goo = 0; break; } - Console.Write(foo); // foo must be definitely assigned here - return foo; + Console.Write(goo); // goo must be definitely assigned here + return goo; } } "; @@ -6365,7 +6365,7 @@ public static int Main() // Code size 28 (0x1c) .maxstack 2 .locals init (int V_0, //n - int V_1) //foo + int V_1) //goo IL_0000: ldc.i4.3 IL_0001: stloc.0 IL_0002: ldloc.0 @@ -6400,13 +6400,13 @@ public static int Main() { int n = 3; int cost = 0; - int foo; // unassigned foo + int goo; // unassigned goo switch (n) { case 1: cost = 1; - foo = n; + goo = n; break; case 2: cost = 2; @@ -6415,7 +6415,7 @@ public static int Main() cost = 3; if(cost > n) { - foo = n - 1; + goo = n - 1; } else { @@ -6425,13 +6425,13 @@ public static int Main() default: cost = 4; - foo = n - 1; + goo = n - 1; break; } - if (foo != n) // foo must be reported as definitely assigned + if (goo != n) // goo must be reported as definitely assigned { - Console.Write(foo); + Console.Write(goo); } else { @@ -6453,7 +6453,7 @@ public static int Main() .maxstack 2 .locals init (int V_0, //n int V_1, //cost - int V_2) //foo + int V_2) //goo IL_0000: ldc.i4.3 IL_0001: stloc.0 IL_0002: ldc.i4.0 @@ -6517,7 +6517,7 @@ class SwitchTest { public static int Main() { - int foo; // unassigned foo + int goo; // unassigned goo switch (3) { case 1: @@ -6528,7 +6528,7 @@ public static int Main() } catch(Exception) { - foo = 0; + goo = 0; } break; case 2: @@ -6543,8 +6543,8 @@ public static int Main() break; } - Console.Write(foo); // foo should be definitely assigned here - return foo; + Console.Write(goo); // goo should be definitely assigned here + return goo; } } "; @@ -6563,7 +6563,7 @@ public static int Main() { // Code size 20 (0x14) .maxstack 1 - .locals init (int V_0) //foo + .locals init (int V_0) //goo IL_0000: nop .try { @@ -6596,7 +6596,7 @@ public void CS0469_NoImplicitConversionWarning() class A { - static void Foo(DayOfWeek x) + static void Goo(DayOfWeek x) { switch (x) { @@ -6616,7 +6616,7 @@ static void Main() {} // goto case 1; // warning CS0469: The 'goto case' value is not implicitly convertible to type 'System.DayOfWeek' Diagnostic(ErrorCode.WRN_GotoCaseShouldConvert, "goto case 1;").WithArguments("System.DayOfWeek")); - compVerifier.VerifyIL("A.Foo", @" + compVerifier.VerifyIL("A.Goo", @" { // Code size 7 (0x7) .maxstack 2 @@ -7273,7 +7273,7 @@ class Program { static string boo(int i) { switch (i) { case 42: - var x = ""foo""; + var x = ""goo""; if (x != ""bar"") break; return x; @@ -7297,7 +7297,7 @@ .locals init (string V_0) //x IL_0000: ldarg.0 IL_0001: ldc.i4.s 42 IL_0003: bne.un.s IL_001a - IL_0005: ldstr ""foo"" + IL_0005: ldstr ""goo"" IL_000a: stloc.0 IL_000b: ldloc.0 IL_000c: ldstr ""bar"" @@ -7323,7 +7323,7 @@ class Program { static string boo(int i) { switch (i) { case 42: - var x = ""foo""; + var x = ""goo""; if (x != ""bar"") break; break; @@ -7346,7 +7346,7 @@ .maxstack 2 IL_0000: ldarg.0 IL_0001: ldc.i4.s 42 IL_0003: bne.un.s IL_0015 - IL_0005: ldstr ""foo"" + IL_0005: ldstr ""goo"" IL_000a: ldstr ""bar"" IL_000f: call ""bool string.op_Inequality(string, string)"" IL_0014: pop @@ -7369,7 +7369,7 @@ static bool boo(int i) { var ii = i; switch (++ii) { case 42: - var x = ""foo""; + var x = ""goo""; if (x != ""bar"") { return false; @@ -7399,7 +7399,7 @@ .locals init (int V_0) IL_0004: ldloc.0 IL_0005: ldc.i4.s 42 IL_0007: bne.un.s IL_001c - IL_0009: ldstr ""foo"" + IL_0009: ldstr ""goo"" IL_000e: ldstr ""bar"" IL_0013: call ""bool string.op_Inequality(string, string)"" IL_0018: brfalse.s IL_001c @@ -7424,7 +7424,7 @@ static bool boo(int i) { var ii = i; switch (ii++) { case 42: - var x = ""foo""; + var x = ""goo""; if (x != ""bar"") { return false; @@ -7452,7 +7452,7 @@ .locals init (int V_0) IL_0002: ldloc.0 IL_0003: ldc.i4.s 42 IL_0005: bne.un.s IL_001a - IL_0007: ldstr ""foo"" + IL_0007: ldstr ""goo"" IL_000c: ldstr ""bar"" IL_0011: call ""bool string.op_Inequality(string, string)"" IL_0016: brfalse.s IL_001a diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/UnsafeTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/UnsafeTests.cs index 8d62aeaaa885b..80ed485316e3f 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/UnsafeTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/UnsafeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -138,10 +138,10 @@ void M() S2* p2 = &s.s; int* p3 = &s.s.x; - Foo(s, p1, p2, p3); + Goo(s, p1, p2, p3); } - void Foo(S1 s, S1* p1, S2* p2, int* p3) { } + void Goo(S1 s, S1* p1, S2* p2, int* p3) { } } struct S1 @@ -180,7 +180,7 @@ .locals init (S1 V_0, //s IL_001d: ldloc.1 IL_001e: ldloc.2 IL_001f: ldloc.3 - IL_0020: call ""void C.Foo(S1, S1*, S2*, int*)"" + IL_0020: call ""void C.Goo(S1, S1*, S2*, int*)"" IL_0025: ret } "); @@ -195,10 +195,10 @@ unsafe class C static void M() { int x = 123; - Foo(&x); // should not optimize into 'Foo(&123)' + Goo(&x); // should not optimize into 'Goo(&123)' } - static void Foo(int* p) { } + static void Goo(int* p) { } } "; var compVerifier = CompileAndVerify(text, options: TestOptions.UnsafeReleaseDll); @@ -211,7 +211,7 @@ .locals init (int V_0) //x IL_0002: stloc.0 IL_0003: ldloca.s V_0 IL_0005: conv.u - IL_0006: call ""void C.Foo(int*)"" + IL_0006: call ""void C.Goo(int*)"" IL_000b: ret } "); @@ -8179,11 +8179,11 @@ class Program { static void Main() { - Foo(x => { }); + Goo(x => { }); } - static void Foo(F1 f) { Console.WriteLine(1); } - static void Foo(F2 f) { Console.WriteLine(2); } + static void Goo(F1 f) { Console.WriteLine(1); } + static void Goo(F2 f) { Console.WriteLine(2); } } unsafe delegate void F1(int* x); @@ -8570,7 +8570,7 @@ public void FixedStatementInlambda() unsafe class C where T : struct { - public void Foo() + public void Goo() { Func d = delegate { @@ -8590,7 +8590,7 @@ class A { static void Main() { - new C().Foo(); + new C().Goo(); } } "; diff --git a/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs index 39a6a9f053160..7c86bace40bac 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/CompilationEmitTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -144,7 +144,7 @@ public static void Main() } } -namespace N.Foo; +namespace N.Goo; "); EmitResult emitResult; @@ -175,7 +175,7 @@ namespace N.Foo; public void EmitMetadataOnly() { CSharpCompilation comp = CreateStandardCompilation(@" -namespace Foo.Bar +namespace Goo.Bar { public class Test1 { @@ -192,7 +192,7 @@ public Test1() x = 17; } - public string foo(int a) + public string goo(int a) { return a.ToString(); } @@ -215,7 +215,7 @@ public string foo(int a) var srcUsing = @" using System; -using Foo.Bar; +using Goo.Bar; class Test2 { @@ -2185,7 +2185,7 @@ public void EmitAlwaysFalseExpression() CompileAndVerify(@" class C { - static bool Foo(int i) + static bool Goo(int i) { int y = 10; bool x = (y == null); // NYI: Implicit null conversion @@ -3355,14 +3355,14 @@ public void OptionalParamTypeAsDecimal() string source = @" public class Test { - public static decimal Foo(decimal d = 0) + public static decimal Goo(decimal d = 0) { return d; } public static void Main() { - System.Console.WriteLine(Foo()); + System.Console.WriteLine(Goo()); } } "; @@ -3963,17 +3963,17 @@ public static void Main() private void TestReferenceToNestedGenericType() { - string p1 = @"public class Foo { }"; + string p1 = @"public class Goo { }"; string p2 = @"using System; public class Test { public class C {} - public class J : C> { } + public class J : C> { } public static void Main() { - Console.WriteLine(typeof(J).BaseType.Equals(typeof(C>)) ? 0 : 1); + Console.WriteLine(typeof(J).BaseType.Equals(typeof(C>)) ? 0 : 1); } }"; var c1 = CreateStandardCompilation(p1, options: TestOptions.ReleaseDll, assemblyName: Guid.NewGuid().ToString()); @@ -4517,7 +4517,7 @@ public void BrokenOutStream() { //These tests ensure that users supplying a broken stream implementation via the emit API //get exceptions enabling them to attribute the failure to their code and to debug. - string source = @"class Foo {}"; + string source = @"class Goo {}"; var compilation = CreateStandardCompilation(source); var output = new BrokenStream(); @@ -4542,7 +4542,7 @@ public void BrokenOutStream() [Fact] public void BrokenPortablePdbStream() { - string source = @"class Foo {}"; + string source = @"class Goo {}"; var compilation = CreateStandardCompilation(source); using (var output = new MemoryStream()) @@ -4560,7 +4560,7 @@ public void BrokenPortablePdbStream() [Fact] public void BrokenPDBStream() { - string source = @"class Foo {}"; + string source = @"class Goo {}"; var compilation = CreateStandardCompilation(source, null, TestOptions.DebugDll); var output = new MemoryStream(); diff --git a/src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs index 25913088c4e44..1801d48950db4 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/DynamicAnalysis/DynamicInstrumentationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -293,7 +293,7 @@ public static void Main(string[] args) static void TestMain() { - Console.WriteLine(""foo""); + Console.WriteLine(""goo""); goto bar; Console.Write(""you won't see me""); bar: Console.WriteLine(""bar""); @@ -333,7 +333,7 @@ static void Fred() } } "; - string expectedOutput = @"foo + string expectedOutput = @"goo bar Flushing Method 1 @@ -1875,17 +1875,17 @@ public static void Main(string[] args) // Metho static void TestMain() // Method 2 { - foreach (var i in Foo()) + foreach (var i in Goo()) { Console.WriteLine(i); } - foreach (var i in Foo()) + foreach (var i in Goo()) { Console.WriteLine(i); } } - public static System.Collections.Generic.IEnumerable Foo() + public static System.Collections.Generic.IEnumerable Goo() { for (int i = 0; i < 5; ++i) { diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs index 8363862546bb6..45899243b3dfd 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EditAndContinue/EditAndContinueTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -7072,7 +7072,7 @@ public void BlobContainsInvalidValues() { static void F() { - string foo = ""abc""; + string goo = ""abc""; } }"; var source1 = @@ -7080,7 +7080,7 @@ static void F() { static void F() { - float foo = 10; + float goo = 10; } }"; var source2 = @@ -7088,7 +7088,7 @@ static void F() { static void F() { - bool foo = true; + bool goo = true; } }"; var compilation0 = CreateStandardCompilation(source0, options: TestOptions.DebugDll); @@ -7284,7 +7284,7 @@ public void UniqueSynthesizedNames_DynamicSiteContainer() var source0 = @" public class C { - public static void F(dynamic d) { d.Foo(); } + public static void F(dynamic d) { d.Goo(); } }"; var source1 = @" public class C diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EmitErrorTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EmitErrorTests.cs index 73446a9685296..d32a903998540 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EmitErrorTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EmitErrorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.Linq; @@ -89,7 +89,7 @@ public class A { public const int x = x; - public static int Foo(int y = x) { return y; } + public static int Goo(int y = x) { return y; } } "; var compilation1 = CreateStandardCompilation(source1); @@ -102,7 +102,7 @@ public class B { public static void Main() { - System.Console.WriteLine(A.Foo()); + System.Console.WriteLine(A.Goo()); } } "; @@ -121,7 +121,7 @@ public class A { public const decimal x = x; - public static decimal Foo(decimal y = x) { return y; } + public static decimal Goo(decimal y = x) { return y; } } "; var compilation1 = CreateStandardCompilation(source1); @@ -134,7 +134,7 @@ public class B { public static void Main() { - System.Console.WriteLine(A.Foo()); + System.Console.WriteLine(A.Goo()); } } "; @@ -156,13 +156,13 @@ public struct S public class A { - public static S Foo(S p = 42) { return p; } + public static S Goo(S p = 42) { return p; } } "; var compilation1 = CreateStandardCompilation(source1); compilation1.VerifyDiagnostics( // (9,27): error CS1750: A value of type 'int' cannot be used as a default parameter because there are no standard conversions to type 'S' - // public static S Foo(S p = 42) { return p; } + // public static S Goo(S p = 42) { return p; } Diagnostic(ErrorCode.ERR_NoConversionForDefaultParam, "p").WithArguments("int", "S").WithLocation(9, 27)); string source2 = @" @@ -170,7 +170,7 @@ public class B { public static void Main() { - System.Console.WriteLine(A.Foo()); + System.Console.WriteLine(A.Goo()); } } "; @@ -187,7 +187,7 @@ .locals init (S V_0) IL_0000: ldloca.s V_0 IL_0002: initobj ""S"" IL_0008: ldloc.0 - IL_0009: call ""S A.Foo(S)"" + IL_0009: call ""S A.Goo(S)"" IL_000e: box ""S"" IL_0013: call ""void System.Console.WriteLine(object)"" IL_0018: ret @@ -201,7 +201,7 @@ public void BadReturnTypeInOtherAssembly() string source1 = @" public class A { - public static Missing Foo() { return null; } + public static Missing Goo() { return null; } } "; var compilation1 = CreateStandardCompilation(source1); @@ -214,7 +214,7 @@ public class B { public static void Main() { - var f = A.Foo(); + var f = A.Goo(); System.Console.WriteLine(f); } } diff --git a/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs index 3238e661d21b8..9a7d0dd9b4a36 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/EmitMetadataTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1733,7 +1733,7 @@ public void RefEmit_MembersOfOpenGenericType() CompileAndVerify(@" class C { - void foo() + void goo() { System.Collections.Generic.Dictionary d = new System.Collections.Generic.Dictionary(); } @@ -2065,14 +2065,14 @@ public static class C { private static string msg = ""Hello""; - private static void Foo() + private static void Goo() { System.Console.WriteLine(msg); } public static void Main() { - Foo(); + Goo(); } } "; diff --git a/src/Compilers/CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs b/src/Compilers/CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs index 517057ee703f3..01f8c6ab2a3f1 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/NoPiaEmbedTypes.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.Cci; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -2142,13 +2142,13 @@ public void AddHandler_Simple() [ComEventInterface(typeof(InterfaceEvents), typeof(int))] public interface Interface1_Event { - event MyDelegate Foo; + event MyDelegate Goo; } [ComImport(), Guid(""84374891-a3b1-4f8f-8310-99ea58059b10"")] public interface InterfaceEvents { - void Foo(); + void Goo(); } "; @@ -2165,7 +2165,7 @@ public static void Main() public void Test(Interface1_Event x) { - x.Foo += Handler; + x.Goo += Handler; } void Handler() @@ -2197,7 +2197,7 @@ void Handler() Assert.Equal("System.Runtime.InteropServices.ComEventInterfaceAttribute(typeof(InterfaceEvents), typeof(InterfaceEvents))", attributes[1].ToString()); Assert.Equal(@"System.Runtime.InteropServices.TypeIdentifierAttribute(""f9c2d51d-4f44-45f0-9eda-c9d599b58257"", ""Interface1_Event"")", attributes[2].ToString()); - var foo = (PEEventSymbol)interface1_Event.GetMembers("Foo").Single(); + var goo = (PEEventSymbol)interface1_Event.GetMembers("Goo").Single(); var interfaceEvents = (PENamedTypeSymbol)module.GlobalNamespace.GetTypeMembers("InterfaceEvents").Single(); @@ -2207,7 +2207,7 @@ void Handler() Assert.Equal(@"System.Runtime.InteropServices.GuidAttribute(""84374891-a3b1-4f8f-8310-99ea58059b10"")", attributes[1].ToString()); Assert.Equal("System.Runtime.InteropServices.TypeIdentifierAttribute", attributes[2].ToString()); - var foo1 = (PEMethodSymbol)interfaceEvents.GetMembers("Foo").Single(); + var goo1 = (PEMethodSymbol)interfaceEvents.GetMembers("Goo").Single(); }; var expected = @@ -2217,7 +2217,7 @@ void Handler() .maxstack 4 IL_0000: ldtoken ""Interface1_Event"" IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" - IL_000a: ldstr ""Foo"" + IL_000a: ldstr ""Goo"" IL_000f: newobj ""System.Runtime.InteropServices.ComAwareEventInfo..ctor(System.Type, string)"" IL_0014: ldarg.1 IL_0015: ldarg.0 @@ -2253,13 +2253,13 @@ public void RemoveHandler_Simple() [ComEventInterface(typeof(InterfaceEvents), typeof(int))] public interface Interface1_Event { - event MyDelegate Foo; + event MyDelegate Goo; } [ComImport(), Guid(""84374891-a3b1-4f8f-8310-99ea58059b10"")] public interface InterfaceEvents { - void Foo(int x); + void Goo(int x); } [ComImport(), Guid(""84374c91-a3b1-4f8f-8310-99ea58059b10"")] @@ -2282,7 +2282,7 @@ public static void Main() public void Test(Interface1 x) { - x.Foo -= Handler; + x.Goo -= Handler; } void Handler() @@ -2304,7 +2304,7 @@ void Handler() .maxstack 4 IL_0000: ldtoken ""Interface1_Event"" IL_0005: call ""System.Type System.Type.GetTypeFromHandle(System.RuntimeTypeHandle)"" - IL_000a: ldstr ""Foo"" + IL_000a: ldstr ""Goo"" IL_000f: newobj ""System.Runtime.InteropServices.ComAwareEventInfo..ctor(System.Type, string)"" IL_0014: ldarg.1 IL_0015: ldarg.0 @@ -2340,7 +2340,7 @@ public void CS1766ERR_MissingMethodOnSourceInterface() [ComEventInterface(typeof(InterfaceEvents), typeof(int))] public interface Interface1_Event { - event MyDelegate Foo; + event MyDelegate Goo; } [ComImport(), Guid(""84374891-a3b1-4f8f-8310-99ea58059b10"")] @@ -2362,7 +2362,7 @@ public static void Main() public void Test(Interface1_Event x) { - x.Foo -= Handler; + x.Goo -= Handler; } void Handler() @@ -2371,9 +2371,9 @@ void Handler() "; DiagnosticDescription[] expected = { - // (10,6): error CS1766: Source interface 'InterfaceEvents' is missing method 'Foo' which is required to embed event 'Interface1_Event.Foo'. - // x.Foo -= Handler; - Diagnostic(ErrorCode.ERR_MissingMethodOnSourceInterface, "x.Foo -= Handler").WithArguments("InterfaceEvents", "Foo", "Interface1_Event.Foo") + // (10,6): error CS1766: Source interface 'InterfaceEvents' is missing method 'Goo' which is required to embed event 'Interface1_Event.Goo'. + // x.Goo -= Handler; + Diagnostic(ErrorCode.ERR_MissingMethodOnSourceInterface, "x.Goo -= Handler").WithArguments("InterfaceEvents", "Goo", "Interface1_Event.Goo") }; var compilation1 = CreateStandardCompilation(consumer, options: TestOptions.ReleaseExe, @@ -2484,7 +2484,7 @@ public void MissingComImport() [Guid(""84374891-a3b1-4f8f-8310-99ea58059b10"")] public interface Interface1_Event { - event MyDelegate Foo; + event MyDelegate Goo; } "; @@ -2501,7 +2501,7 @@ public static void Main() public void Test(Interface1_Event x) { - x.Foo -= Handler; + x.Goo -= Handler; } void Handler() @@ -2511,8 +2511,8 @@ void Handler() DiagnosticDescription[] expected = { // (10,6): error CS1756: Interop type 'Interface1_Event' cannot be embedded because it is missing the required 'System.Runtime.InteropServices.ComImportAttribute' attribute. - // x.Foo -= Handler; - Diagnostic(ErrorCode.ERR_InteropTypeMissingAttribute, "x.Foo -= Handler").WithArguments("Interface1_Event", "System.Runtime.InteropServices.ComImportAttribute") + // x.Goo -= Handler; + Diagnostic(ErrorCode.ERR_InteropTypeMissingAttribute, "x.Goo -= Handler").WithArguments("Interface1_Event", "System.Runtime.InteropServices.ComImportAttribute") }; DiagnosticDescription[] expectedMetadataOnly = { @@ -2588,20 +2588,20 @@ instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime man .class interface public abstract auto ansi import Interface1_Event { .method public hidebysig newslot specialname abstract virtual - instance void add_Foo(class MyDelegate 'value') cil managed + instance void add_Goo(class MyDelegate 'value') cil managed { - } // end of method Interface1_Event::add_Foo + } // end of method Interface1_Event::add_Goo .method public hidebysig newslot specialname abstract virtual - instance void remove_Foo(class MyDelegate 'value') cil managed + instance void remove_Goo(class MyDelegate 'value') cil managed { - } // end of method Interface1_Event::remove_Foo + } // end of method Interface1_Event::remove_Goo - .event MyDelegate Foo + .event MyDelegate Goo { - .removeon instance void Interface1_Event::remove_Foo(class MyDelegate) - .addon instance void Interface1_Event::add_Foo(class MyDelegate) - } // end of event Interface1_Event::Foo + .removeon instance void Interface1_Event::remove_Goo(class MyDelegate) + .addon instance void Interface1_Event::add_Goo(class MyDelegate) + } // end of event Interface1_Event::Goo } // end of class Interface1_Event "; @@ -2616,7 +2616,7 @@ public static void Main() public void Test(Interface1_Event x) { - x.Foo -= Handler; + x.Goo -= Handler; } void Handler() @@ -2626,8 +2626,8 @@ void Handler() DiagnosticDescription[] expected = { // (10,6): error CS1756: Interop type 'Interface1_Event' cannot be embedded because it is missing the required 'System.Runtime.InteropServices.GuidAttribute' attribute. - // x.Foo -= Handler; - Diagnostic(ErrorCode.ERR_InteropTypeMissingAttribute, "x.Foo -= Handler").WithArguments("Interface1_Event", "System.Runtime.InteropServices.GuidAttribute") + // x.Goo -= Handler; + Diagnostic(ErrorCode.ERR_InteropTypeMissingAttribute, "x.Goo -= Handler").WithArguments("Interface1_Event", "System.Runtime.InteropServices.GuidAttribute") }; DiagnosticDescription[] expectedMetadataOnly = { @@ -5585,13 +5585,13 @@ public void MissingComAwareEventInfo() [ComEventInterface(typeof(InterfaceEvents), typeof(int))] public interface Interface1_Event { - event MyDelegate Foo; + event MyDelegate Goo; } [ComImport(), Guid(""84374891-a3b1-4f8f-8310-99ea58059b10"")] public interface InterfaceEvents { - void Foo(); + void Goo(); } "; @@ -5608,7 +5608,7 @@ public static void Main() public void Test(Interface1_Event x) { - x.Foo += Handler; + x.Goo += Handler; } void Handler() @@ -5621,8 +5621,8 @@ void Handler() DiagnosticDescription[] expected = { // (10,6): error CS0656: Missing compiler required member 'System.Runtime.InteropServices.ComAwareEventInfo..ctor' - // x.Foo += Handler; - Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "x.Foo += Handler").WithArguments("System.Runtime.InteropServices.ComAwareEventInfo", ".ctor").WithLocation(10, 6) + // x.Goo += Handler; + Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "x.Goo += Handler").WithArguments("System.Runtime.InteropServices.ComAwareEventInfo", ".ctor").WithLocation(10, 6) }; VerifyEmitDiagnostics(compilation1, true, expected); diff --git a/src/Compilers/CSharp/Test/Emit/Emit/ResourceTests.cs b/src/Compilers/CSharp/Test/Emit/Emit/ResourceTests.cs index 79cd3955cb7c7..f0bf44e61eec7 100644 --- a/src/Compilers/CSharp/Test/Emit/Emit/ResourceTests.cs +++ b/src/Compilers/CSharp/Test/Emit/Emit/ResourceTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.ComponentModel; @@ -236,8 +236,8 @@ public void CS1508_DuplicateMainfestResourceIdentifier() var result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true), - new ResourceDescription("A", "y.foo", dataProvider, true) + new ResourceDescription("A", "x.goo", dataProvider, true), + new ResourceDescription("A", "y.goo", dataProvider, true) }); result.Diagnostics.Verify( @@ -269,8 +269,8 @@ public void CS1508_DuplicateMainfestResourceIdentifier_EmbeddedResource() result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true, isEmbedded: true, checkArgs: true), - new ResourceDescription("A", "x.foo", dataProvider, true, isEmbedded: false, checkArgs: true) + new ResourceDescription("A", "x.goo", dataProvider, true, isEmbedded: true, checkArgs: true), + new ResourceDescription("A", "x.goo", dataProvider, true, isEmbedded: false, checkArgs: true) }); result.Diagnostics.Verify( @@ -283,19 +283,19 @@ public void CS1508_DuplicateMainfestResourceIdentifier_EmbeddedResource() [Fact] public void CS7041_DuplicateMainfestResourceFileName() { - var c1 = CSharpCompilation.Create("foo", references: new[] { MscorlibRef }, options: TestOptions.ReleaseDll); + var c1 = CSharpCompilation.Create("goo", references: new[] { MscorlibRef }, options: TestOptions.ReleaseDll); Func dataProvider = () => new MemoryStream(new byte[] { }); var result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true), - new ResourceDescription("B", "x.foo", dataProvider, true) + new ResourceDescription("A", "x.goo", dataProvider, true), + new ResourceDescription("B", "x.goo", dataProvider, true) }); result.Diagnostics.Verify( - // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.foo' is specified more than once in this assembly - Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.foo") + // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.goo' is specified more than once in this assembly + Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.goo") ); } @@ -319,8 +319,8 @@ public void NoDuplicateMainfestResourceFileNameDiagnosticForEmbeddedResources() result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true, isEmbedded: true, checkArgs: true), - new ResourceDescription("B", "x.foo", dataProvider, true, isEmbedded: false, checkArgs: true) + new ResourceDescription("A", "x.goo", dataProvider, true, isEmbedded: true, checkArgs: true), + new ResourceDescription("B", "x.goo", dataProvider, true, isEmbedded: false, checkArgs: true) }); result.Diagnostics.Verify(); @@ -336,28 +336,28 @@ public void CS1508_CS7041_DuplicateMainfestResourceDiagnostics() var result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true), - new ResourceDescription("A", "x.foo", dataProvider, true) + new ResourceDescription("A", "x.goo", dataProvider, true), + new ResourceDescription("A", "x.goo", dataProvider, true) }); result.Diagnostics.Verify( // error CS1508: Resource identifier 'A' has already been used in this assembly Diagnostic(ErrorCode.ERR_ResourceNotUnique).WithArguments("A"), - // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.foo' is specified more than once in this assembly - Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.foo") + // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.goo' is specified more than once in this assembly + Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.goo") ); result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "x.foo", dataProvider, true), - new ResourceDescription("B", "x.foo", dataProvider, true), - new ResourceDescription("B", "y.foo", dataProvider, true) + new ResourceDescription("A", "x.goo", dataProvider, true), + new ResourceDescription("B", "x.goo", dataProvider, true), + new ResourceDescription("B", "y.goo", dataProvider, true) }); result.Diagnostics.Verify( - // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.foo' is specified more than once in this assembly - Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.foo"), + // error CS7041: Each linked resource and module must have a unique filename. Filename 'x.goo' is specified more than once in this assembly + Diagnostic(ErrorCode.ERR_ResourceFileNameNotUnique).WithArguments("x.goo"), // error CS1508: Resource identifier 'B' has already been used in this assembly Diagnostic(ErrorCode.ERR_ResourceNotUnique).WithArguments("B") ); @@ -365,7 +365,7 @@ public void CS1508_CS7041_DuplicateMainfestResourceDiagnostics() result = c1.Emit(new MemoryStream(), manifestResources: new[] { - new ResourceDescription("A", "foo.dll", dataProvider, true), + new ResourceDescription("A", "goo.dll", dataProvider, true), }); //make sure there's no problem when the name of the primary module conflicts with a file name of an added resource. @@ -396,7 +396,7 @@ public void AddManagedResource() // Do not name the compilation, a unique guid is used as a name by default. It prevents conflicts with other assemblies loaded via Assembly.ReflectionOnlyLoad. var c1 = CreateStandardCompilation(source); - var resourceFileName = "RoslynResourceFile.foo"; + var resourceFileName = "RoslynResourceFile.goo"; var output = new MemoryStream(); const string r1Name = "some.dotted.NAME"; @@ -450,7 +450,7 @@ public void AddResourceToModule() new[] { MscorlibRef }, TestOptions.ReleaseModule); - var resourceFileName = "RoslynResourceFile.foo"; + var resourceFileName = "RoslynResourceFile.goo"; var output = new MemoryStream(); const string r1Name = "some.dotted.NAME"; diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBConstantTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBConstantTests.cs index e437a3c52c722..a0dcdffa15621 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBConstantTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBConstantTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Globalization; using System.IO; @@ -490,8 +490,8 @@ class C { static void Main() { - const string foo = """ + longStringValue + @"""; - Console.Write(foo); + const string goo = """ + longStringValue + @"""; + Console.Write(goo); } } "; @@ -505,8 +505,8 @@ static void Main() /* * old behavior. This new warning was abandoned - result.Diagnostics.Verify(// warning CS7063: Constant string value of 'foo' is too long to be used in a PDB file. Only the debug experience may be affected. - Diagnostic(ErrorCode.WRN_PDBConstantStringValueTooLong).WithArguments("foo", longStringValue.Substring(0, 20) + "...")); + result.Diagnostics.Verify(// warning CS7063: Constant string value of 'goo' is too long to be used in a PDB file. Only the debug experience may be affected. + Diagnostic(ErrorCode.WRN_PDBConstantStringValueTooLong).WithArguments("goo", longStringValue.Substring(0, 20) + "...")); //make sure that this warning is suppressable compilation = CreateCompilationWithMscorlib(text, compOptions: Options.Exe.WithDebugInformationKind(Common.DebugInformationKind.Full).WithOptimizations(false). @@ -522,7 +522,7 @@ static void Main() result = compilation.Emit(exebits, null, "DontCare", pdbbits, null); Assert.False(result.Success); result.Diagnostics.Verify( - Diagnostic(ErrorCode.WRN_PDBConstantStringValueTooLong).WithArguments("foo", longStringValue.Substring(0, 20) + "...").WithWarningAsError(true)); + Diagnostic(ErrorCode.WRN_PDBConstantStringValueTooLong).WithArguments("goo", longStringValue.Substring(0, 20) + "...").WithWarningAsError(true)); * */ } diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBDynamicLocalsTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBDynamicLocalsTests.cs index 797f44cd4ec8f..e0ec021ef804d 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBDynamicLocalsTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBDynamicLocalsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -16,7 +16,7 @@ public void EmitPDBDynamicObjectVariable1() class Helper { int x; - public void foo(int y){} + public void goo(int y){} public Helper(){} public Helper(int x){} } @@ -32,7 +32,7 @@ public static void Main(string[] args) { dynamic d1 = new Helper(); dynamic d2 = new Point(); - D d4 = new D(d1.foo); + D d4 = new D(d1.goo); Helper d5 = new Helper(d1); } @@ -41,7 +41,7 @@ public static void Main(string[] args) c.VerifyPdb(@" - + @@ -54,7 +54,7 @@ public static void Main(string[] args) - + @@ -64,7 +64,7 @@ public static void Main(string[] args) - + @@ -74,7 +74,7 @@ public static void Main(string[] args) - + @@ -463,7 +463,7 @@ public void EmitPDBDynamicObjectVariable2() class Helper { int x; - public void foo(int y){} + public void goo(int y){} public Helper(){} public Helper(int x){} } @@ -479,14 +479,14 @@ public static void Main(string[] args) { Helper staticObj = new Helper(); dynamic d1 = new Helper(); - dynamic d3 = new D(staticObj.foo); + dynamic d3 = new D(staticObj.goo); } }"; var c = CreateCompilationWithMscorlibAndSystemCore(source, options: TestOptions.DebugDll); c.VerifyPdb(@" - + @@ -499,7 +499,7 @@ public static void Main(string[] args) - + @@ -509,7 +509,7 @@ public static void Main(string[] args) - + @@ -519,7 +519,7 @@ public static void Main(string[] args) - + @@ -1841,11 +1841,11 @@ class Program static void Main(string[] args) { dynamic yyy; - Foo zzz; + Goo zzz; } } -class Foo +class Goo { } @@ -1896,11 +1896,11 @@ class Program static void Main(string[] args) { dynamic yyy; - Foo> zzz; + Goo> zzz; } } -class Foo +class Goo { } @@ -1952,11 +1952,11 @@ static void Main(string[] args) { dynamic yyy; int dummy = 0; - Foo> zzz; + Goo> zzz; } } -class Foo +class Goo { } diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs index 17b8e7611a2c9..f3707d64c462b 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBIteratorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.Linq; @@ -22,7 +22,7 @@ public void SimpleIterator1() var text = @" class Program { - System.Collections.Generic.IEnumerable Foo() + System.Collections.Generic.IEnumerable Goo() { yield break; } @@ -32,12 +32,12 @@ System.Collections.Generic.IEnumerable Foo() c.VerifyPdb(@" - + - + - + @@ -63,7 +63,7 @@ public void SimpleIterator2() var text = @" class Program { - System.Collections.Generic.IEnumerable Foo() + System.Collections.Generic.IEnumerable Goo() { yield break; } @@ -74,12 +74,12 @@ System.Collections.Generic.IEnumerable Foo() c.VerifyPdb(@" - + - + - + @@ -105,7 +105,7 @@ public void SimpleIterator3() var text = @" class Program { - System.Collections.Generic.IEnumerable Foo() + System.Collections.Generic.IEnumerable Goo() { yield return 1; //hidden sequence point after this. } @@ -116,12 +116,12 @@ System.Collections.Generic.IEnumerable Foo() c.VerifyPdb(@" - + - + - + diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBLambdaTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBLambdaTests.cs index 0689618fd119e..d15fa13f68523 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBLambdaTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBLambdaTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -195,7 +195,7 @@ public void InitialSequencePoints() var source = @" class Test { - void Foo(int p) + void Goo(int p) { System.Func f1 = () => p; f1(); @@ -207,7 +207,7 @@ void Foo(int p) c.VerifyPdb(@" - + @@ -234,9 +234,9 @@ void Foo(int p) - + - + diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBSourceLinkTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBSourceLinkTests.cs index 0afa594315b6b..0c476e737cfc5 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBSourceLinkTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBSourceLinkTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Diagnostics; @@ -42,7 +42,7 @@ public static void Main() } "); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var pdbStream = new MemoryStream(); c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(format), pdbStream: pdbStream, sourceLinkStream: new MemoryStream(sourceLinkBlob)); @@ -72,7 +72,7 @@ public static void Main() } } "); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var peBlob = c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded), sourceLinkStream: new MemoryStream(sourceLinkBlob)); @@ -114,7 +114,7 @@ public static void Main() "; var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); }); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var pdbStream = format != DebugInformationFormat.Embedded ? new MemoryStream() : null; var result = c.Emit(new MemoryStream(), pdbStream, options: EmitOptions.Default.WithDebugInformationFormat(format), sourceLinkStream: sourceLinkStream); result.Diagnostics.Verify( @@ -140,7 +140,7 @@ public static void Main() "; var sourceLinkBlob = new byte[0]; - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var pdbStream = new MemoryStream(); c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(format), pdbStream: pdbStream, sourceLinkStream: new MemoryStream(sourceLinkBlob)); diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBUsingTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBUsingTests.cs index 61a8b5b5e53bf..82ca93773b123 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBUsingTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBUsingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.IO; @@ -2029,7 +2029,7 @@ public void WRN_DebugFullNameTooLong() using DICT1 = System.Collections.Generic.Dictionary; -namespace foo +namespace goo { using ACT = System.Action; @@ -2226,7 +2226,7 @@ public void ImportedNoPiaTypes() using System.Runtime.InteropServices; [assembly: Guid(""11111111-1111-1111-1111-111111111111"")] -[assembly: ImportedFromTypeLib(""Foo"")] +[assembly: ImportedFromTypeLib(""Goo"")] [assembly: TypeLibVersion(1, 0)] namespace N diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PDBWinMdExpTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PDBWinMdExpTests.cs index 67f0e87d1c4e0..014e08d9b4073 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PDBWinMdExpTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PDBWinMdExpTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -57,7 +57,7 @@ public async void Run() Driver.CompletedSignal.Set(); } - static partial void Foo(); + static partial void Goo(); static partial void Bar(); } diff --git a/src/Compilers/CSharp/Test/Emit/PDB/PortablePdbTests.cs b/src/Compilers/CSharp/Test/Emit/PDB/PortablePdbTests.cs index 37a5b6f1a81f1..b3498a08133ff 100644 --- a/src/Compilers/CSharp/Test/Emit/PDB/PortablePdbTests.cs +++ b/src/Compilers/CSharp/Test/Emit/PDB/PortablePdbTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Diagnostics; @@ -159,7 +159,7 @@ public static void Main() } } "; - var c = CreateStandardCompilation(Parse(source, "foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "goo.cs"), options: TestOptions.DebugDll); var peBlob = c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded).WithPdbFilePath(@"a/b/c/d.pdb")); @@ -181,7 +181,7 @@ public static void Main() using (var embeddedMetadataProvider = peReader.ReadEmbeddedPortablePdbDebugDirectoryData(embedded)) { var mdReader = embeddedMetadataProvider.GetMetadataReader(); - AssertEx.Equal(new[] { "foo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name))); + AssertEx.Equal(new[] { "goo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name))); pdbId = new BlobContentId(mdReader.DebugMetadataHeader.Id); } @@ -210,7 +210,7 @@ public static void Main() } } "; - var c = CreateStandardCompilation(Parse(source, "foo.cs"), options: TestOptions.DebugDll.WithDeterministic(true)); + var c = CreateStandardCompilation(Parse(source, "goo.cs"), options: TestOptions.DebugDll.WithDeterministic(true)); var peBlob = c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded).WithPdbFilePath(@"a/b/c/d.pdb")); @@ -233,7 +233,7 @@ public static void Main() using (var embeddedMetadataProvider = peReader.ReadEmbeddedPortablePdbDebugDirectoryData(embedded)) { var mdReader = embeddedMetadataProvider.GetMetadataReader(); - AssertEx.Equal(new[] { "foo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name))); + AssertEx.Equal(new[] { "goo.cs" }, mdReader.Documents.Select(doc => mdReader.GetString(mdReader.GetDocument(doc).Name))); pdbId = new BlobContentId(mdReader.DebugMetadataHeader.Id); } @@ -276,7 +276,7 @@ public static void Main() } "); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var pdbStream = new MemoryStream(); c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), pdbStream: pdbStream, sourceLinkStream: new MemoryStream(sourceLinkBlob)); @@ -317,7 +317,7 @@ public static void Main() } } "); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var peBlob = c.EmitToArray(EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.Embedded), sourceLinkStream: new MemoryStream(sourceLinkBlob)); @@ -356,7 +356,7 @@ public static void Main() "; var sourceLinkStream = new TestStream(canRead: true, readFunc: (_, __, ___) => { throw new Exception("Error!"); }); - var c = CreateStandardCompilation(Parse(source, "f:/build/foo.cs"), options: TestOptions.DebugDll); + var c = CreateStandardCompilation(Parse(source, "f:/build/goo.cs"), options: TestOptions.DebugDll); var result = c.Emit(new MemoryStream(), new MemoryStream(), options: EmitOptions.Default.WithDebugInformationFormat(DebugInformationFormat.PortablePdb), sourceLinkStream: sourceLinkStream); result.Diagnostics.Verify( // error CS0041: Unexpected error writing debug information -- 'Error!' @@ -377,7 +377,7 @@ public static void Main() } } "; - var tree = Parse(source, "f:/build/foo.cs"); + var tree = Parse(source, "f:/build/goo.cs"); var c = CreateStandardCompilation(tree, options: TestOptions.DebugDll); var pdbStream = new MemoryStream(); @@ -400,7 +400,7 @@ public static void Main() Text = pdbReader.GetEmbeddedSource(documentHandle) }).Single(); - Assert.Equal(embeddedSource.FilePath, "f:/build/foo.cs"); + Assert.Equal(embeddedSource.FilePath, "f:/build/goo.cs"); Assert.Equal(source, embeddedSource.Text.ToString()); } } @@ -419,7 +419,7 @@ public static void Main() } } "; - var tree = Parse(source, "f:/build/foo.cs"); + var tree = Parse(source, "f:/build/goo.cs"); var c = CreateStandardCompilation(tree, options: TestOptions.DebugDll); var pdbStream = new MemoryStream(); @@ -445,7 +445,7 @@ public static void Main() Text = pdbReader.GetEmbeddedSource(documentHandle) }).Single(); - Assert.Equal(embeddedSource.FilePath, "f:/build/foo.cs"); + Assert.Equal(embeddedSource.FilePath, "f:/build/goo.cs"); Assert.Equal(source, embeddedSource.Text.ToString()); } } diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs b/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs index e48a20a85e881..4dc47779b0ceb 100644 --- a/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Diagnostics/DiagnosticAnalyzerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1072,14 +1072,14 @@ private void TestGenericNameCore(string source, params DiagnosticAnalyzer[] anal public void TestNamespaceDeclarationAnalyzer() { var source = @" -namespace Foo.Bar.FooBar { } +namespace Goo.Bar.GooBar { } "; var analyzers = new DiagnosticAnalyzer[] { new CSharpNamespaceDeclarationAnalyzer() }; // Verify, no duplicate diagnostics on qualified name. CreateCompilationWithMscorlib45(source) .VerifyAnalyzerDiagnostics(analyzers, null, null, logAnalyzerExceptionAsDiagnostics: false, - expected: Diagnostic(CSharpNamespaceDeclarationAnalyzer.DiagnosticId, @"namespace Foo.Bar.FooBar { }").WithLocation(2, 1)); + expected: Diagnostic(CSharpNamespaceDeclarationAnalyzer.DiagnosticId, @"namespace Goo.Bar.GooBar { }").WithLocation(2, 1)); } [Fact, WorkItem(2980, "https://github.com/dotnet/roslyn/issues/2980")] diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs b/src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs index aedcb3f532a6a..361fe0d5e8a36 100644 --- a/src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Diagnostics/GetDiagnosticsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -95,7 +95,7 @@ public void TestDiagnosticWithSeverity() var source = @" class C { - public void Foo() + public void Goo() { int x; } diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs b/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs index ee45d0bc2cebd..ce0cadfb33a68 100644 --- a/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -794,9 +794,9 @@ enum E public void NullArgumentCSharp() { const string source = @" -class Foo +class Goo { - public Foo(string x) + public Goo(string x) {} } @@ -815,8 +815,8 @@ public void M2() public void M3() { - var f1 = new Foo(""""); - var f2 = new Foo(null); + var f1 = new Goo(""""); + var f2 = new Goo(null); } } "; @@ -840,7 +840,7 @@ struct Bar public bool Field; } -class Foo +class Goo { public int Field; public string Property1 { set; get; } @@ -851,21 +851,21 @@ class C { public void M1() { - var x1 = new Foo(); - var x2 = new Foo() { Field = 2}; - var x3 = new Foo() { Property1 = """"}; - var x4 = new Foo() { Property1 = """", Field = 2}; - var x5 = new Foo() { Property2 = new Bar { Field = true } }; + var x1 = new Goo(); + var x2 = new Goo() { Field = 2}; + var x3 = new Goo() { Property1 = """"}; + var x4 = new Goo() { Property1 = """", Field = 2}; + var x5 = new Goo() { Property2 = new Bar { Field = true } }; - var e1 = new Foo() { Property2 = 1 }; - var e2 = new Foo() { "" }; + var e1 = new Goo() { Property2 = 1 }; + var e2 = new Goo() { "" }; } } "; CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.RegularWithIOperationFeature) .VerifyDiagnostics( // (25,30): error CS1010: Newline in constant - // var e2 = new Foo() { " }; + // var e2 = new Goo() { " }; Diagnostic(ErrorCode.ERR_NewlineInConst, "").WithLocation(25, 30), // (26,6): error CS1002: ; expected // } @@ -874,7 +874,7 @@ public void M1() // } Diagnostic(ErrorCode.ERR_RbraceExpected, "").WithLocation(27, 2), // (24,42): error CS0029: Cannot implicitly convert type 'int' to 'Bar' - // var e1 = new Foo() { Property2 = 1 }; + // var e1 = new Goo() { Property2 = 1 }; Diagnostic(ErrorCode.ERR_NoImplicitConv, "1").WithArguments("int", "Bar").WithLocation(24, 42)) .VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new MemberInitializerTestAnalyzer() }, null, null, false, Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field = 2").WithLocation(19, 30), @@ -895,7 +895,7 @@ struct Bar public bool Field; } -class Foo +class Goo { public int Field; public string Property1 { set; get; } @@ -906,16 +906,16 @@ class C { public void M1() { - var x1 = new Foo(); - var x2 = new Foo() { Field = 2}; - var x3 = new Foo() { Property1 = """"}; - var x4 = new Foo() { Property1 = """", Field = 2}; - var x5 = new Foo() { Property2 = new Bar { Field = true } }; + var x1 = new Goo(); + var x2 = new Goo() { Field = 2}; + var x3 = new Goo() { Property1 = """"}; + var x4 = new Goo() { Property1 = """", Field = 2}; + var x5 = new Goo() { Property2 = new Bar { Field = true } }; } public void M2() { - var x1 = new Foo() { Property2 = new Bar { Field = true } }; + var x1 = new Goo() { Property2 = new Bar { Field = true } }; x1.Field = 10; x1.Property1 = null; @@ -1227,9 +1227,9 @@ class C { public int F1 = 44; public string F2 = ""Hello""; - public int F3 = Foo(); + public int F3 = Goo(); - static int Foo() { return 10; } + static int Goo() { return 10; } static int Bar(int P1 = 15, int F2 = 33) { return P1 + F2; } } "; @@ -1238,7 +1238,7 @@ class C .VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new EqualsValueTestAnalyzer() }, null, null, false, Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 44").WithLocation(4, 19), Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= \"Hello\"").WithLocation(5, 22), - Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= Foo()").WithLocation(6, 19), + Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= Goo()").WithLocation(6, 19), Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 33").WithLocation(9, 40) ); } @@ -1461,7 +1461,7 @@ class C public static void Bar() { } - void Foo() + void Goo() { C.E += D.Method; C.E(); @@ -1721,12 +1721,12 @@ public void InvalidArgumentCSharp() const string source = @" public class A { - public static void Foo(params int a) {} + public static void Goo(params int a) {} public static int Main() { - Foo(); - Foo(1); + Goo(); + Goo(1); return 1; } } @@ -1734,11 +1734,11 @@ public static int Main() CreateCompilationWithMscorlib45(source, parseOptions: TestOptions.RegularWithIOperationFeature) .VerifyDiagnostics( // (4,28): error CS0225: The params parameter must be a single dimensional array - // public static void Foo(params int a) {} + // public static void Goo(params int a) {} Diagnostic(ErrorCode.ERR_ParamsMustBeArray, "params").WithLocation(4, 28), - // (8,9): error CS7036: There is no argument given that corresponds to the required formal parameter 'a' of 'A.Foo(params int)' - // Foo(); - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("a", "A.Foo(params int)").WithLocation(8, 9)) + // (8,9): error CS7036: There is no argument given that corresponds to the required formal parameter 'a' of 'A.Goo(params int)' + // Goo(); + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("a", "A.Goo(params int)").WithLocation(8, 9)) .VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new InvocationTestAnalyzer() }, null, null, false); } diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs index 7df1285ebe215..54d4a8c6ee4ed 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowDiagnosticTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -237,7 +237,7 @@ public void WhileConstEqualsConst() using System; class Program { - bool foo() + bool goo() { const bool b = true; while (b == b) @@ -330,7 +330,7 @@ public void WhileConstEqualsConst2() using System; class Program { - bool foo() + bool goo() { const bool b = true; while (b == b) @@ -368,7 +368,7 @@ static void Main() int a; const bool b = true; } - void foo() + void goo() { y = 2; Console.WriteLine(z); @@ -751,9 +751,9 @@ public void UnreachableThrow() static void Main() { return; - throw Foo(); + throw Goo(); } - static System.Exception Foo() + static System.Exception Goo() { System.Console.WriteLine(""Hello""); return null; @@ -773,7 +773,7 @@ struct S { T x; - static void Foo() + static void Goo() { x.x = 1; } @@ -824,17 +824,17 @@ public void LambdaInUnimplementedPartial() partial class C { - static partial void Foo(Action a); + static partial void Goo(Action a); static void Main() { - Foo(() => { int x, y = x; }); + Goo(() => { int x, y = x; }); } }"; var comp = CreateStandardCompilation(program); comp.VerifyDiagnostics( // (9,32): error CS0165: Use of unassigned local variable 'x' - // Foo(() => { int x, y = x; }); + // Goo(() => { int x, y = x; }); Diagnostic(ErrorCode.ERR_UseDefViolation, "x").WithArguments("x") ); } @@ -849,9 +849,9 @@ class Program { static void Main(string[] args) { - var s = foo<,int>(123); + var s = goo<,int>(123); } - public static int foo(int i) + public static int goo(int i) { return 1; } @@ -1321,7 +1321,7 @@ public Program(int dummy) System.Console.WriteLine(x2.ii); } - public void Foo() + public void Goo() { } @@ -1370,7 +1370,7 @@ public Program(int dummy) System.Console.WriteLine(x2.ii); } - public void Foo() + public void Goo() { } @@ -1422,7 +1422,7 @@ public Program(int dummy) x2.i += 1; } - public void Foo() + public void Goo() { } @@ -1474,7 +1474,7 @@ public Program(int dummy) }; } - public void Foo() + public void Goo() { } @@ -1527,7 +1527,7 @@ public Program() }; } - public void Foo() + public void Goo() { } @@ -1569,7 +1569,7 @@ public Program(int arg) x2 = x; } - public void Foo() + public void Goo() { } @@ -1605,7 +1605,7 @@ public Program(int arg) x2 = x; } - public void Foo() + public void Goo() { } @@ -1638,20 +1638,20 @@ public struct S1 public Program(int arg) { - Foo(out x1); - Foo(ref x1); - Foo(out x2); - Foo(ref x2); - Foo(out x3); - Foo(ref x3); + Goo(out x1); + Goo(ref x1); + Goo(out x2); + Goo(ref x2); + Goo(out x3); + Goo(ref x3); } - public static void Foo(out S1 s) + public static void Goo(out S1 s) { s = default(S1); } - public static void Foo1(ref S1 s) + public static void Goo1(ref S1 s) { s = default(S1); } @@ -1666,28 +1666,28 @@ static void Main(string[] args) // no errors since S1 is empty comp.VerifyDiagnostics( // (15,17): error CS0206: A property or indexer may not be passed as an out or ref parameter - // Foo(out x1); + // Goo(out x1); Diagnostic(ErrorCode.ERR_RefProperty, "x1").WithArguments("Program.x1").WithLocation(15, 17), // (16,17): error CS0206: A property or indexer may not be passed as an out or ref parameter - // Foo(ref x1); + // Goo(ref x1); Diagnostic(ErrorCode.ERR_RefProperty, "x1").WithArguments("Program.x1").WithLocation(16, 17), // (17,17): error CS0206: A property or indexer may not be passed as an out or ref parameter - // Foo(out x2); + // Goo(out x2); Diagnostic(ErrorCode.ERR_RefProperty, "x2").WithArguments("Program.x2").WithLocation(17, 17), // (18,17): error CS0206: A property or indexer may not be passed as an out or ref parameter - // Foo(ref x2); + // Goo(ref x2); Diagnostic(ErrorCode.ERR_RefProperty, "x2").WithArguments("Program.x2").WithLocation(18, 17), // (20,17): error CS1620: Argument 1 must be passed with the 'out' keyword - // Foo(ref x3); + // Goo(ref x3); Diagnostic(ErrorCode.ERR_BadArgRef, "x3").WithArguments("1", "out").WithLocation(20, 17), // (15,17): error CS8079: Use of automatically implemented property 'x1' whose backing field is possibly unassigned - // Foo(out x1); + // Goo(out x1); Diagnostic(ErrorCode.ERR_UseDefViolationProperty, "x1").WithArguments("x1").WithLocation(15, 17), // (16,9): error CS0188: The 'this' object cannot be used before all of its fields are assigned to - // Foo(ref x1); - Diagnostic(ErrorCode.ERR_UseDefViolationThis, "Foo").WithArguments("this").WithLocation(16, 9), + // Goo(ref x1); + Diagnostic(ErrorCode.ERR_UseDefViolationThis, "Goo").WithArguments("this").WithLocation(16, 9), // (17,17): error CS8079: Use of automatically implemented property 'x2' whose backing field is possibly unassigned - // Foo(out x2); + // Goo(out x2); Diagnostic(ErrorCode.ERR_UseDefViolationProperty, "x2").WithArguments("x2").WithLocation(17, 17), // (6,20): warning CS0649: Field 'Program.S1.x' is never assigned to, and will always have its default value 0 // public int x; @@ -1775,7 +1775,7 @@ public void DefiniteAssignGenericStruct() struct C { public int num; - public int Foo1() + public int Goo1() { return this.num; } @@ -1786,7 +1786,7 @@ static void Main(string[] args) { C c; c.num = 1; - bool verify = c.Foo1() == 1; + bool verify = c.Goo1() == 1; Console.WriteLine(verify); } } @@ -2065,8 +2065,8 @@ public void InitializerAndConstructorWithOutParameter() string program = @"class Program { - private int field = Foo(); - static int Foo() { return 12; } + private int field = Goo(); + static int Goo() { return 12; } public Program(out int x) { x = 13; @@ -2291,18 +2291,18 @@ struct S int x; S(dynamic y) { - Foo(y, null); + Goo(y, null); } } - static void Foo(int y) + static void Goo(int y) { } }"; CSharpCompilation comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics( - // (8,13): error CS1501: No overload for method 'Foo' takes 2 arguments - // Foo(y, null); - Diagnostic(ErrorCode.ERR_BadArgCount, "Foo").WithArguments("Foo", "2"), + // (8,13): error CS1501: No overload for method 'Goo' takes 2 arguments + // Goo(y, null); + Diagnostic(ErrorCode.ERR_BadArgCount, "Goo").WithArguments("Goo", "2"), // (6,9): error CS0171: Field 'C.S.x' must be fully assigned before control is returned to the caller // S(dynamic y) Diagnostic(ErrorCode.ERR_UnassignedThis, "S").WithArguments("C.S.x"), diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs index da343b3f968da..77129f7240234 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/IterationJumpYieldStatementTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -20,7 +20,7 @@ public void TestBreakStatement() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; while (true) { @@ -54,7 +54,7 @@ public void TestContinueStatement() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; while (true) { @@ -87,7 +87,7 @@ public void TestLoopWithConstantBooleanFalse() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int? x; /**/ @@ -117,7 +117,7 @@ public void TestLoopWithConstantBooleanTrue() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -147,7 +147,7 @@ public void TestLoopWithConstantBooleanXor() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -177,7 +177,7 @@ public void TestLoopWithConstantBooleanNew() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -207,7 +207,7 @@ public void TestLoopWithConstantBooleanChecked() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -236,7 +236,7 @@ public void TestLoopWithAssignmentInCondition() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { bool x; /**/ @@ -266,7 +266,7 @@ public void TestLoopWithConstantEnumEquality() var analysisResults = CompileAndAnalyzeControlFlowStatements(@" using System; class C { - static void Foo() + static void Goo() { /**/ while (DayOfWeek.Sunday == 0) { } @@ -282,7 +282,7 @@ public void TestLoopWithConstantNaNComparison() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -311,7 +311,7 @@ public void TestLoopWithConstantNaNComparison2() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -340,7 +340,7 @@ public void TestLoopWithConstantStringEquality() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -369,7 +369,7 @@ public void TestLoopWithConstantStringEqualityWithUnicodeEscapes() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -398,7 +398,7 @@ public void TestLoopWithConstantVerbatimStringEquality() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -427,7 +427,7 @@ public void TestLoopWithEmptyBlockAfterIt() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int x; /**/ @@ -985,7 +985,7 @@ public void TestReturnStatementWithExpression() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static int Foo() + static int Goo() { int x = 1, y = x; /**/ @@ -1013,7 +1013,7 @@ public void TestReturnStatementWithAssignmentExpressions() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static int? Foo() + static int? Goo() { int x = 0; /**/ @@ -1041,7 +1041,7 @@ public void TestReturnStatementWithAssignmentExpressions2() { var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static int Foo() + static int Goo() { int? x; /**/ diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs index 4c2c7462f52c8..88e900e70b0d9 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/LocalFunctions.cs @@ -1,4 +1,4 @@ -using Microsoft.CodeAnalysis.Test.Utilities; +using Microsoft.CodeAnalysis.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; @@ -1166,24 +1166,24 @@ class C void M() { { - Foo(); + Goo(); int x = 0; - void Foo() => x++; + void Goo() => x++; } { - System.Action a = Foo; + System.Action a = Goo; int x = 0; - void Foo() => x++; + void Goo() => x++; } } }"); comp.VerifyDiagnostics( // (7,13): error CS0165: Use of unassigned local variable 'x' - // Foo(); - Diagnostic(ErrorCode.ERR_UseDefViolation, "Foo()").WithArguments("x").WithLocation(7, 13), + // Goo(); + Diagnostic(ErrorCode.ERR_UseDefViolation, "Goo()").WithArguments("x").WithLocation(7, 13), // (12,31): error CS0165: Use of unassigned local variable 'x' - // System.Action a = Foo; - Diagnostic(ErrorCode.ERR_UseDefViolation, "Foo").WithArguments("x").WithLocation(12, 31)); + // System.Action a = Goo; + Diagnostic(ErrorCode.ERR_UseDefViolation, "Goo").WithArguments("x").WithLocation(12, 31)); } [Fact] @@ -1198,18 +1198,18 @@ static void Main(object[] args) switch(args[0]) { case string x: - Foo(); + Goo(); break; case int x: - void Foo() => System.Console.WriteLine(x); + void Goo() => System.Console.WriteLine(x); break; } } }"); comp.VerifyDiagnostics( // (9,17): error CS0165: Use of unassigned local variable 'x' - // Foo(); - Diagnostic(ErrorCode.ERR_UseDefViolation, "Foo()").WithArguments("x").WithLocation(9, 17)); + // Goo(); + Diagnostic(ErrorCode.ERR_UseDefViolation, "Goo()").WithArguments("x").WithLocation(9, 17)); } [Fact] @@ -1389,23 +1389,23 @@ class c { static void Main(string[] args) { - System.Collections.Generic.IEnumerable getFoo(int count, out bool output) + System.Collections.Generic.IEnumerable getGoo(int count, out bool output) { output = true; - yield return ""foo""; + yield return ""goo""; } - getFoo(1, out bool myBool); + getGoo(1, out bool myBool); } }"); comp.VerifyDiagnostics( // (6,83): error CS1623: Iterators cannot have ref or out parameters - // System.Collections.Generic.IEnumerable getFoo(int count, out bool foobar) + // System.Collections.Generic.IEnumerable getGoo(int count, out bool goobar) Diagnostic(ErrorCode.ERR_BadIteratorArgType, "output"), - // (6,56): error CS0177: The out parameter 'foobar' must be assigned to before control leaves the current method - // System.Collections.Generic.IEnumerable getFoo(int count, out bool foobar) - Diagnostic(ErrorCode.ERR_ParamUnassigned, "getFoo").WithArguments("output").WithLocation(6, 56)); + // (6,56): error CS0177: The out parameter 'goobar' must be assigned to before control leaves the current method + // System.Collections.Generic.IEnumerable getGoo(int count, out bool goobar) + Diagnostic(ErrorCode.ERR_ParamUnassigned, "getGoo").WithArguments("output").WithLocation(6, 56)); } [Fact] @@ -1417,28 +1417,28 @@ class c { static void Main(string[] args) { - System.Collections.Generic.IEnumerable getFoo(int count, out bool output) + System.Collections.Generic.IEnumerable getGoo(int count, out bool output) { output = false; for (int i = 0; i < count; i++) { - foreach (var val in getFoo(3, out var bar)) - yield return ""foo""; + foreach (var val in getGoo(3, out var bar)) + yield return ""goo""; } - yield return ""foo""; + yield return ""goo""; } - getFoo(1, out bool myBool); + getGoo(1, out bool myBool); } }"); comp.VerifyDiagnostics( // (6,83): error CS1623: Iterators cannot have ref or out parameters - // System.Collections.Generic.IEnumerable getFoo(int count, out bool foobar) + // System.Collections.Generic.IEnumerable getGoo(int count, out bool goobar) Diagnostic(ErrorCode.ERR_BadIteratorArgType, "output"), - // (6,56): error CS0177: The out parameter 'foobar' must be assigned to before control leaves the current method - // System.Collections.Generic.IEnumerable getFoo(int count, out bool foobar) - Diagnostic(ErrorCode.ERR_ParamUnassigned, "getFoo").WithArguments("output").WithLocation(6, 56)); + // (6,56): error CS0177: The out parameter 'goobar' must be assigned to before control leaves the current method + // System.Collections.Generic.IEnumerable getGoo(int count, out bool goobar) + Diagnostic(ErrorCode.ERR_ParamUnassigned, "getGoo").WithArguments("output").WithLocation(6, 56)); } } } diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs index 216df0119a38d..3ac9c784d9708 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/RegionAnalysisTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -933,7 +933,7 @@ class C { static void Main() { int x = 0; - Foo(ref + Goo(ref /**/ x /**/ @@ -941,7 +941,7 @@ static void Main() System.Console.WriteLine(x); } - static void Foo(ref int x) { } + static void Goo(ref int x) { } } "); Assert.Equal(null, GetSymbolNamesJoined(dataFlowAnalysisResults.VariablesDeclared)); @@ -1729,14 +1729,14 @@ public static void Main() public void TestObjectInitializerExpression_NestedObjectInitializer() { var analysis = CompileAndAnalyzeDataFlowExpression(@" -public class Foo +public class Goo { public int z; } public class MemberInitializerTest { public int x; - public Foo y { get; set; } + public Goo y { get; set; } public static void Main() { @@ -1763,7 +1763,7 @@ public static void Main() public void TestObjectInitializerExpression_VariableCaptured() { var analysis = CompileAndAnalyzeDataFlowExpression(@" -public class Foo +public class Goo { public delegate int D(); public D z; @@ -1771,7 +1771,7 @@ public class Foo public class MemberInitializerTest { public int x; - public Foo y { get; set; } + public Goo y { get; set; } public static void Main() { @@ -2335,7 +2335,7 @@ public void TestDictionaryInitializer() var analysisResults = CompileAndAnalyzeControlAndDataFlowStatements(@" class C { - static void Foo() + static void Goo() { int i, j; /**/ @@ -2401,7 +2401,7 @@ public void DateFlowAnalyzeForLocalWithInvalidRHS() public class Test { public delegate int D(); - public void foo(ref D d) + public void goo(ref D d) { /**/ d = { return 10;}; @@ -3252,11 +3252,11 @@ static void Main() { int x = 1, y = 1; /**/ - Foo(x); + Goo(x); /**/ } - static void Foo(int x) { } + static void Goo(int x) { } } "); var controlFlowAnalysisResults = analysisResults.Item1; @@ -3284,12 +3284,12 @@ static void Main() { int x = 1, y = 1; /**/ - Foo(x = y, y = 2); + Goo(x = y, y = 2); /**/ int z = x + y; } - static void Foo(int x, int y) { } + static void Goo(int x, int y) { } } "); var controlFlowAnalysisResults = analysisResults.Item1; @@ -4908,7 +4908,7 @@ public void DefaultValueOfOptionalParam() var dataFlowAnalysisResults = CompileAndAnalyzeDataFlowExpression(@" public class Derived { - public void Foo(int x = /**/ 2 /**/) + public void Goo(int x = /**/ 2 /**/) { } } @@ -4985,7 +4985,7 @@ public void AnalysisWithMissingMember() var source = @"class C { - void Foo(string[] args) + void Goo(string[] args) { foreach (var s in args) { diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs index e0d01759e9ec7..a65d71b55ce4e 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/StructTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -146,7 +146,7 @@ internal bool this[int bit] _data = value ? _data | bit : _data & ~bit; } } - internal bool Foo(int bit) + internal bool Goo(int bit) { return this[bit]; } @@ -155,7 +155,7 @@ internal bool Foo(int bit) class SectionInformation { SafeBitVector _flags; - internal bool Foo(int x) + internal bool Goo(int x) { return _flags[x]; } @@ -164,9 +164,9 @@ internal bool Foo(int x) class SectionInformation2 { SafeBitVector _flags; - internal bool Foo(int x) + internal bool Goo(int x) { - return _flags.Foo(x); + return _flags.Goo(x); } }"; var comp = CreateStandardCompilation(program); diff --git a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs index 9fde4a03ef347..275321f37bf37 100644 --- a/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/FlowAnalysis/TryLockUsingStatementTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -1572,12 +1572,12 @@ public static void Main() string name = ""; object obj = new object(); /**/ - lock (new { p1 = name, p2 = foo(obj) }) + lock (new { p1 = name, p2 = goo(obj) }) { } /**/ } - static int foo(object x) + static int goo(object x) { return 1; } } "); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/AccessCheckTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/AccessCheckTests.cs index 604573fcea9d1..60b13ec4a10ee 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/AccessCheckTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/AccessCheckTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -719,7 +719,7 @@ class A static private int priv; static public int pub; protected int prot; - static private Foo unknowntype; + static private Goo unknowntype; private class K {} diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/AccessibilityTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/AccessibilityTests.cs index 6f68347e05a8b..1c40afc56fe54 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/AccessibilityTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/AccessibilityTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -212,12 +212,12 @@ public class M { } protected class Z : RuleE.N { - protected RuleE.N Foo; + protected RuleE.N Goo; } private class Z1 { - protected RuleE.N Foo; + protected RuleE.N Goo; } protected class z4 where S : RuleE.N { } @@ -253,9 +253,9 @@ static void Main() } }"; CreateStandardCompilation(source).VerifyDiagnostics( - // (16,32): warning CS0649: Field 'RuleE.Z1.Foo' is never assigned to, and will always have its default value null - // protected RuleE.N Foo; - Diagnostic(ErrorCode.WRN_UnassignedInternalField, "Foo").WithArguments("RuleE.Z1.Foo", "null"), + // (16,32): warning CS0649: Field 'RuleE.Z1.Goo' is never assigned to, and will always have its default value null + // protected RuleE.N Goo; + Diagnostic(ErrorCode.WRN_UnassignedInternalField, "Goo").WithArguments("RuleE.Z1.Goo", "null"), // (23,26): warning CS0169: The field 'RuleE.Fld3' is never used // private RuleE.N Fld3; Diagnostic(ErrorCode.WRN_UnreferencedField, "Fld3").WithArguments("RuleE.Fld3"), diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ArglistTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ArglistTests.cs index 4b14f6dd113be..5d81f94934c77 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ArglistTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ArglistTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1314,7 +1314,7 @@ public void BoxReceiverTest() using System; class C { - static void Foo() + static void Goo() { RuntimeArgumentHandle rah = default(RuntimeArgumentHandle); ArgIterator ai = default(ArgIterator); @@ -1490,7 +1490,7 @@ public void LambdaWithUnsafeParameter() namespace ConsoleApplication21 { - public unsafe class FooBar : IDisposable + public unsafe class GooBar : IDisposable { public void Dispose() { @@ -1505,9 +1505,9 @@ public void Dispose() } "; CreateStandardCompilation(source, options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( - // (12,44): error CS7036: There is no argument given that corresponds to the required formal parameter 'context' of 'FooBar.AllocateNativeOverlapped(IOCompletionCallback, object, byte[])' + // (12,44): error CS7036: There is no argument given that corresponds to the required formal parameter 'context' of 'GooBar.AllocateNativeOverlapped(IOCompletionCallback, object, byte[])' // NativeOverlapped* overlapped = AllocateNativeOverlapped(() => { }); - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "AllocateNativeOverlapped").WithArguments("context", "ConsoleApplication21.FooBar.AllocateNativeOverlapped(System.Threading.IOCompletionCallback, object, byte[])").WithLocation(12, 44) + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "AllocateNativeOverlapped").WithArguments("context", "ConsoleApplication21.GooBar.AllocateNativeOverlapped(System.Threading.IOCompletionCallback, object, byte[])").WithLocation(12, 44) ); } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/AwaitExpressionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/AwaitExpressionTests.cs index b41ceb3dadc7e..9bc83f44aa244 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/AwaitExpressionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/AwaitExpressionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -25,7 +25,7 @@ public void TestAwaitInfo() class C { - async void Foo(Task t) + async void Goo(Task t) { int c = 1 + await t; } @@ -139,7 +139,7 @@ public void Bug576316() class C { - static async Task Foo() + static async Task Goo() { Console.WriteLine(new TypedReference().Equals(await Task.FromResult(0))); } @@ -160,7 +160,7 @@ public void TestAwaitInNonAsync() class C { - void Foo(Task t) + void Goo(Task t) { var v = await t; } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAsyncTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAsyncTests.cs index f8e1a77a38d08..c6ab72533b910 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAsyncTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAsyncTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -831,7 +831,7 @@ class Test class await { } - static int Foo(int[] arr = await t) + static int Goo(int[] arr = await t) { return arr.Length; } @@ -844,7 +844,7 @@ static int Main() CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (10,32): error CS4032: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. - // static int Foo(int[] arr = await t) + // static int Goo(int[] arr = await t) Diagnostic(ErrorCode.ERR_BadAwaitWithoutAsyncMethod, "await t").WithArguments("int").WithLocation(10, 32) ); } @@ -1589,10 +1589,10 @@ class Test public async void Meth() { await Task.Delay(10); - Foo(); + Goo(); } - public async Task Foo() + public async Task Goo() { await Task.Delay(10); return 1; @@ -1605,8 +1605,8 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (16,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -1621,19 +1621,19 @@ class Test { public async Task Meth() { - Foo(); + Goo(); foreach (var x in new int[] { 1, 2 }) { - Foo(); + Goo(); } - while (await Foo()) + while (await Goo()) { - Foo(); + Goo(); } } - public async Task Foo() + public async Task Goo() { return 1; } @@ -1645,17 +1645,17 @@ static int Main() }"; CreateCompilationWithMscorlib45(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics( // (19,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (22,13): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (27,13): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (31,32): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // public async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // public async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } [Fact] @@ -1670,24 +1670,24 @@ class Test { static async Task Meth() { - Foo(); + Goo(); - Bar bar = Foo; + Bar bar = Goo; bar(); return (object)""""; } - static async Task Foo() + static async Task Goo() { return null; } static Task Meth2() { - Foo(); + Goo(); - Bar bar = Foo; + Bar bar = Goo; bar(); return Task.Run(async () => { await Task.Delay(10); }); } @@ -1699,8 +1699,8 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (21,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (24,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. // bar(); Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "bar()"), @@ -1708,11 +1708,11 @@ static int Main() // static async Task Meth() Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Meth"), // (29,33): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // static async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo"), + // static async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo"), // (36,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -1738,11 +1738,11 @@ static async Task Meth(T t) { int i = 0; i.MethExt(); - Foo(1); + Goo(1); return t; } - static Task Foo(T t) + static Task Goo(T t) { return Task.Run(async () => { return t; }); } @@ -1757,8 +1757,8 @@ static int Main() // i.MethExt(); Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "i.MethExt()").WithLocation(19, 9), // (20,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(1); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo(1)").WithLocation(20, 9), + // Goo(1); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo(1)").WithLocation(20, 9), // (16,26): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. // static async Task Meth(T t) Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Meth").WithLocation(16, 26), @@ -1782,18 +1782,18 @@ class Test static async Task Meth1() { throw new EntryPointNotFoundException(); - Foo(); + Goo(); return """"; } static async Task Meth2() { - Foo(); + Goo(); throw new DuplicateWaitObjectException(); return null; } - static async Task Foo() + static async Task Goo() { return null; } @@ -1808,23 +1808,23 @@ static int Main() // static async Task Meth1() Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Meth1"), // (23,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (23,9): warning CS0162: Unreachable code detected - // Foo(); - Diagnostic(ErrorCode.WRN_UnreachableCode, "Foo"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnreachableCode, "Goo"), // (27,33): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. // static async Task Meth2() Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Meth2"), // (29,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (31,9): warning CS0162: Unreachable code detected // return null; Diagnostic(ErrorCode.WRN_UnreachableCode, "return"), // (34,33): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // static async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // static async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } [Fact] @@ -1839,16 +1839,16 @@ class Test static async Task Meth1() { return """"; - Foo(); + Goo(); } static int Meth2() { return 2; - Foo(); + Goo(); } - static async Task Foo() + static async Task Goo() { return null; } @@ -1860,23 +1860,23 @@ static int Main() }"; CreateCompilationWithMscorlib45(source, references: new MetadataReference[] { CSharpRef, SystemCoreRef }).VerifyDiagnostics( // (22,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (19,32): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. // static async Task Meth1() Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Meth1"), // (22,9): warning CS0162: Unreachable code detected - // Foo(); - Diagnostic(ErrorCode.WRN_UnreachableCode, "Foo"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnreachableCode, "Goo"), // (28,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (28,9): warning CS0162: Unreachable code detected - // Foo(); - Diagnostic(ErrorCode.WRN_UnreachableCode, "Foo"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnreachableCode, "Goo"), // (31,32): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // static async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // static async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } [Fact] @@ -1895,7 +1895,7 @@ static async Task Meth(T t) return t; } - static async Task Foo(T t) + static async Task Goo(T t) { Func> f = async () => { @@ -2091,7 +2091,7 @@ static async Task Meth(T t) return t; } - static async Task Foo() + static async Task Goo() { try { @@ -2123,8 +2123,8 @@ static int Main() // Meth((decimal?)2); Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Meth((decimal?)2)"), // (24,23): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // static async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // static async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } [Fact] @@ -2145,7 +2145,7 @@ public static async Task Meth(this int i, T t) class Test { - static async Task Foo(T t) + static async Task Goo(T t) { var i = 0; Func f = async delegate() @@ -2227,7 +2227,7 @@ public Task Prop } } - public async Task Foo() + public async Task Goo() { await Bar(); Bar(); //the callee return type is dynamic, it will not give warning @@ -2281,7 +2281,7 @@ async partial void Bar() Meth("""", null); } - async public Task Foo() + async public Task Goo() { Bar(); Meth(Task.Run(async () => 1), Meth(1)); @@ -2303,8 +2303,8 @@ static int Main() // Meth(Task.Run(async () => 1), Meth(1)); Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "=>").WithLocation(25, 32), // (22,23): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // async public Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo").WithLocation(22, 23)); + // async public Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo").WithLocation(22, 23)); } [WorkItem(611150, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/611150")] @@ -2322,7 +2322,7 @@ static async Task Meth(T t) return t; } - static async Task Foo() + static async Task Goo() { checked { @@ -2373,7 +2373,7 @@ public void UnobservedAwaitableExpression_ForgetAwait12_breaking() class Test { - static async Task Foo() + static async Task Goo() { await Task.Factory.StartNew(() => { }); lock (new object()) @@ -2420,7 +2420,7 @@ public Test() Meth(1); //warning CS4014 } - public async Task Foo() + public async Task Goo() { var test = new Test(); test.Prop; //error CS0201 @@ -2444,8 +2444,8 @@ static int Main() // test[1]; //error CS0201 Diagnostic(ErrorCode.ERR_IllegalStatement, "test[1]"), // (44,23): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // public async Task Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // public async Task Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } [Fact] @@ -2463,7 +2463,7 @@ static async Task Meth(T t) return t; } - static async Task Foo() + static async Task Goo() { for (Meth(""""); await Meth(false); Meth((float?)null)) { @@ -2528,7 +2528,7 @@ public async Task Meth2() public class Test { - public async Task Foo() + public async Task Goo() { var testB = new TestB(); for (testB.Meth2(); await testB.Meth(false); testB.Meth((float?)null)) @@ -2578,10 +2578,10 @@ class Test { public void Meth() { - Foo(); + Goo(); } - public async Task Foo() + public async Task Goo() { await Task.Delay(10); return 1; @@ -2593,8 +2593,8 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (15,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -2644,17 +2644,17 @@ class Test public delegate T Del(T item); public T Meth(T t) { - Foo(); + Goo(); Del del = x => { - Foo(); + Goo(); return 1; }; return t; } - static async Task Foo() + static async Task Goo() { await Task.Delay(10); return new Task(() => { Task.Delay(10); }); @@ -2666,11 +2666,11 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (18,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (21,17): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -2685,14 +2685,14 @@ class Test public delegate T Del(); public T Meth(T t) { - Foo(); + Goo(); Del> del =async delegate() { await Task.Delay(10); - Foo(); + Goo(); Del del2 = () => { - Foo(); + Goo(); return 1; }; return """"; @@ -2702,7 +2702,7 @@ public T Meth(T t) } - public Task Foo() + public Task Goo() { return Task.Run(async() => { @@ -2716,8 +2716,8 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (21,13): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -2734,14 +2734,14 @@ class Testcase static Test test = null; public void Meth() { - Foo(); + Goo(); Func> fun = () => { - return Foo(); + return Goo(); }; } - public Task Foo() + public Task Goo() { return Task.Run( () => { @@ -2808,21 +2808,21 @@ class Test { public void Meth() { - Func> Foo = async () => + Func> Goo = async () => { await Task.Delay(10); return """"; }; - Foo(); + Goo(); Task.Run(() => { - Foo(); + Goo(); Func> fun = async () => { await Task.Delay(10); return Task.Run(() => { - Foo(); + Goo(); }); }; }); @@ -2890,12 +2890,12 @@ static class Extension { public static Task ExMeth(this int i) { - Func> Foo = async () => + Func> Goo = async () => { await Task.Delay(10); return ++i; }; - return (Task) Foo(); + return (Task) Goo(); } } class Test @@ -2926,7 +2926,7 @@ public async Task Meth() await Task.Delay(10); return int.MaxValue; } - public Task Foo() + public Task Goo() { int i = int.MaxValue; return Task.Run(async () => { return i; }); @@ -2937,12 +2937,12 @@ static int Main() checked { test.Meth(); - test.Foo(); + test.Goo(); } unchecked { test.Meth(); - test.Foo(); + test.Goo(); } return 0; } @@ -2970,15 +2970,15 @@ class Testcase { ~Testcase() { - Foo(); - Foo2(); + Goo(); + Goo2(); } - public async Task Foo() + public async Task Goo() { await Task.Delay(10); - return ""Foo""; + return ""Goo""; } - public Task Foo2() + public Task Goo2() { return Task.Run(() => { }); } @@ -2997,8 +2997,8 @@ static int Main() }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (17,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()")); + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()")); } [Fact] @@ -3010,19 +3010,19 @@ public void UnobservedAwaitableExpression_ForgetAwait27() class Test : IDisposable { - public async Task Foo() + public async Task Goo() { await Task.Delay(10); } public void Dispose() { - Foo(); + Goo(); } static int Main() { using (Test test = new Test()) { - test.Foo(); + test.Goo(); } return 0; } @@ -3031,11 +3031,11 @@ static int Main() CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (22,9): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Foo()"), + // Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "Goo()"), // (28,13): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. - // test.Foo(); - Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "test.Foo()")); + // test.Goo(); + Diagnostic(ErrorCode.WRN_UnobservedAwaitableExpression, "test.Goo()")); } [Fact] @@ -3449,16 +3449,16 @@ static int Main() return 1; } - public async void Foo(ref int x) + public async void Goo(ref int x) { } }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (9,35): error CS1988: Async methods cannot have ref or out parameters - // public async void Foo(ref int x) + // public async void Goo(ref int x) Diagnostic(ErrorCode.ERR_BadAsyncArgType, "x"), // (9,23): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // public async void Foo(ref int x) - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo")); + // public async void Goo(ref int x) + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo")); } @@ -3586,7 +3586,7 @@ public void AsyncAsLambdaParameter() class C { - async void Foo() + async void Goo() { Action x = (await) => { }; // should be a syntax error await Task.Delay(1); @@ -3656,7 +3656,7 @@ public void ReturnExpressionNotConvertible() class Program { - static async Task Foo() + static async Task Goo() { await Task.Delay(1); return 1; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs index 62e4e9d4a02f0..28f750d3c221d 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/BindingAwaitTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -36,13 +36,13 @@ static void Main() { } static async void f() { - await foo; + await goo; } }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( - // (8,15): error CS0103: The name 'foo' does not exist in the current context - // await foo; - Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo")); + // (8,15): error CS0103: The name 'goo' does not exist in the current context + // await goo; + Diagnostic(ErrorCode.ERR_NameNotInContext, "goo").WithArguments("goo")); } [Fact] @@ -2583,15 +2583,15 @@ class C { async void M() { - using (await foo()) + using (await goo()) { } } }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( - // (6,22): error CS0103: The name 'foo' does not exist in the current context - // using (await foo()) - Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo")); + // (6,22): error CS0103: The name 'goo' does not exist in the current context + // using (await goo()) + Diagnostic(ErrorCode.ERR_NameNotInContext, "goo").WithArguments("goo")); } [Fact] @@ -2600,11 +2600,11 @@ public void BadAwaitArgIntrinsic() var source = @" class Test { - public void foo() { } + public void goo() { } public async void awaitVoid() { - await foo(); + await goo(); } public async void awaitNull() @@ -2614,7 +2614,7 @@ public async void awaitNull() public async void awaitMethodGroup() { - await foo; + await goo; } public async void awaitLambda() @@ -2626,14 +2626,14 @@ public static void Main() { } }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (8,9): error CS4008: Cannot await 'void' - // await foo(); - Diagnostic(ErrorCode.ERR_BadAwaitArgVoidCall, "await foo()"), + // await goo(); + Diagnostic(ErrorCode.ERR_BadAwaitArgVoidCall, "await goo()"), // (13,9): error CS4001: Cannot await ';' // await null; Diagnostic(ErrorCode.ERR_BadAwaitArgIntrinsic, "await null").WithArguments(""), // (18,9): error CS4001: Cannot await 'method group' - // await foo; - Diagnostic(ErrorCode.ERR_BadAwaitArgIntrinsic, "await foo").WithArguments("method group"), + // await goo; + Diagnostic(ErrorCode.ERR_BadAwaitArgIntrinsic, "await goo").WithArguments("method group"), // (23,9): error CS4001: Cannot await 'lambda expression' // await (x => x); Diagnostic(ErrorCode.ERR_BadAwaitArgIntrinsic, "await (x => x)").WithArguments("lambda expression")); @@ -2647,22 +2647,22 @@ public void BadAwaitArgVoidCall() class Test { - public async void foo() + public async void goo() { await Task.Factory.StartNew(() => { }); } public async void bar() { - await foo(); + await goo(); } public static void Main() { } }"; CreateCompilationWithMscorlib45(source).VerifyDiagnostics( // (10,9): error CS4008: Cannot await 'void' - // await foo(); - Diagnostic(ErrorCode.ERR_BadAwaitArgVoidCall, "await foo()")); + // await goo(); + Diagnostic(ErrorCode.ERR_BadAwaitArgVoidCall, "await goo()")); } [Fact, WorkItem(531356, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/531356")] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ColorColorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ColorColorTests.cs index 03a0676591211..8fd807cb200ce 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ColorColorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ColorColorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -1440,14 +1440,14 @@ public void FieldAndMethodSameName() @"class A { delegate void D(); - static void Foo() { } + static void Goo() { } class B { - const int Foo = 123; + const int Goo = 123; static void Main() { - Foo(); - Bar(Foo); + Goo(); + Bar(Goo); } static void Bar(int x) { } static void Bar(D x) { } @@ -1463,16 +1463,16 @@ public void TypeAndMethodSameName() var text = @"class A { - static void Foo(object x) { } + static void Goo(object x) { } class B { - class Foo + class Goo { public const int N = 3; } static void Main() { - Foo(Foo.N); + Goo(Goo.N); } static void Bar(int x) { } } @@ -1548,13 +1548,13 @@ .locals init (int V_0, //Int32 public void ShadowedTypeReceiver_1() { const string source1 = @" -namespace Foo +namespace Goo { public class A { public static int I { get { return -42; } } } }"; const string source2 = @" -namespace Foo +namespace Goo { public class A { public static int I { get { return 42; } } } @@ -1575,13 +1575,13 @@ static void Main() CompileAndVerify(source2, new[] { ref1 }, expectedOutput: "42").VerifyDiagnostics( // (8,16): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '04f2260a-2ee6-4e74-938a-c47b6dc61d9c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return null; } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 16), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 16), // (8,39): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '59c700fa-e88d-45e4-acec-fd0bae894f9d, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 39), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 39), // (12,38): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '04f2260a-2ee6-4e74-938a-c47b6dc61d9c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // System.Console.WriteLine(A.I); - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(12, 38)); + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(12, 38)); } [WorkItem(938389, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/938389")] @@ -1589,13 +1589,13 @@ static void Main() public void ShadowedTypeReceiver_2() { const string source1 = @" -namespace Foo +namespace Goo { public class A { public int I { get { return -42; } } } }"; const string source2 = @" -namespace Foo +namespace Goo { public class A { public int I { get { return 42; } } } @@ -1616,10 +1616,10 @@ static void Main() CompileAndVerify(source2, new[] { ref1 }, expectedOutput: "42").VerifyDiagnostics( // (8,16): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '59c700fa-e88d-45e4-acec-fd0bae894f9d, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 16), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 16), // (8,39): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '59c700fa-e88d-45e4-acec-fd0bae894f9d, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 39)); + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 39)); } [WorkItem(938389, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/938389")] @@ -1627,13 +1627,13 @@ static void Main() public void ShadowedTypeReceiver_3() { const string source1 = @" -namespace Foo +namespace Goo { public class A { public int I { get { return -42; } } } }"; const string source2 = @" -namespace Foo +namespace Goo { public class A { public static int I { get { return 42; } } } @@ -1654,13 +1654,13 @@ static void Main() CompileAndVerify(source2, new[] { ref1 }, expectedOutput: "42").VerifyDiagnostics( // (8,16): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '499975c2-0b0d-4d9b-8f1f-4d91133627db, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return null; } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 16), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 16), // (8,39): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '59c700fa-e88d-45e4-acec-fd0bae894f9d, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 39), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 39), // (12,38): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in '499975c2-0b0d-4d9b-8f1f-4d91133627db, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // System.Console.WriteLine(A.I); - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(12, 38)); + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(12, 38)); } [WorkItem(938389, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/938389")] @@ -1668,13 +1668,13 @@ static void Main() public void ShadowedTypeReceiver_4() { const string source1 = @" -namespace Foo +namespace Goo { public class A { public static int I { get { return -42; } } } }"; const string source2 = @" -namespace Foo +namespace Goo { public class A { public int I { get { return 42; } } } @@ -1695,10 +1695,10 @@ static void Main() CompileAndVerify(source2, new[] { ref1 }, expectedOutput: "42").VerifyDiagnostics( // (8,16): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in 'cb07e894-1bb8-4db2-93ba-747f45e89f22, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 16), + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 16), // (8,39): warning CS0436: The type 'A' in '' conflicts with the imported type 'A' in 'cb07e894-1bb8-4db2-93ba-747f45e89f22, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''. // static A A { get { return new A(); } } - Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Foo.A", refIdentity, "Foo.A").WithLocation(8, 39)); + Diagnostic(ErrorCode.WRN_SameFullNameThisAggAgg, "A").WithArguments("", "Goo.A", refIdentity, "Goo.A").WithLocation(8, 39)); } [WorkItem(1095020, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1095020")] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ConditionalOperatorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ConditionalOperatorTests.cs index 0dbe49068c520..94d17764dc71e 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ConditionalOperatorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ConditionalOperatorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -175,11 +175,11 @@ public void TestInvalidCondition() TestConditional("1 ? 2 : 3", null, Diagnostic(ErrorCode.ERR_NoImplicitConv, "1").WithArguments("int", "bool")); - TestConditional("foo ? 'a' : 'b'", null, - Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo")); + TestConditional("goo ? 'a' : 'b'", null, + Diagnostic(ErrorCode.ERR_NameNotInContext, "goo").WithArguments("goo")); - TestConditional("new Foo() ? GetObject() : null", null, - Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Foo").WithArguments("Foo")); + TestConditional("new Goo() ? GetObject() : null", null, + Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "Goo").WithArguments("Goo")); // CONSIDER: dev10 reports ERR_ConstOutOfRange TestConditional("1 ? null : null", null, diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ConstantTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ConstantTests.cs index 1fdf7065c5d9f..b6fdc013657b2 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ConstantTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ConstantTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -165,12 +165,12 @@ static void Main(string[] args) { } - static void Foo(S1 s = new S1()) + static void Goo(S1 s = new S1()) { } - static void Foo(S2 s = new S2()) + static void Goo(S2 s = new S2()) { } @@ -182,7 +182,7 @@ static void Main(string[] args) // public S2() Diagnostic(ErrorCode.ERR_StructsCantContainDefaultConstructor, "S2").WithLocation(10, 12), // (26,28): error CS1736: Default parameter value for 's' must be a compile-time constant - // static void Foo(S2 s = new S2()) + // static void Goo(S2 s = new S2()) Diagnostic(ErrorCode.ERR_DefaultValueMustBeConstant, "new S2()").WithArguments("s").WithLocation(26, 28) ); } @@ -1969,7 +1969,7 @@ public void MultiplyingConstantsInCheckedStatement() // multiplying constants in checked statement that causes overflow behaves like unchecked var source = @" -public class foo +public class goo { const int i = 1000000; const int j = 1000000; @@ -2472,7 +2472,7 @@ class MyAttribute : Attribute } [MyAttribute(A + B + 3)] - void Foo() + void Goo() { } }"); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/DynamicTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/DynamicTests.cs index 157e093b26d78..0bcee5f7e2c0b 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/DynamicTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/DynamicTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -167,14 +167,14 @@ public void ArgList_Error() string source = @" class C { - void Foo(__arglist) + void Goo(__arglist) { } void Main() { dynamic d = 1; - Foo(d); + Goo(d); } }"; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( @@ -188,13 +188,13 @@ public void ArgList_OK() string source = @" class C { - void Foo(__arglist) { } - void Foo(bool a) { } + void Goo(__arglist) { } + void Goo(bool a) { } void Main() { dynamic d = 1; - Foo(d); + Goo(d); } }"; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics(); @@ -346,12 +346,12 @@ public void OverrideChangesTypeAndParameterNames() class C { - public virtual void Foo(Action a) { } + public virtual void Goo(Action a) { } } class D : C { - public override void Foo(Action b) { } + public override void Goo(Action b) { } } class Program @@ -359,8 +359,8 @@ class Program static void Main() { var d = new D(); - d.Foo(x => x.Bar()); - d.Foo(b: x => x.Bar()); + d.Goo(x => x.Bar()); + d.Goo(b: x => x.Bar()); } } "; @@ -375,14 +375,14 @@ public void OverrideChangesTypeGeneric() class C { - public virtual void Foo(T t, Action a) where T : struct + public virtual void Goo(T t, Action a) where T : struct { } } class D : C { - public override void Foo(T t, Action a) { } + public override void Goo(T t, Action a) { } } class Program @@ -390,7 +390,7 @@ class Program static void Main() { var d = new D(); - d.Foo(1, x => x.Bar()); + d.Goo(1, x => x.Bar()); } } "; @@ -1225,25 +1225,25 @@ class C static void M(dynamic d) { int z; - d.Foo(__arglist(123, 456)); - d.Foo(x: 123, y: 456, 789); - d.Foo(ref z); - d.Foo(System.Console.WriteLine()); + d.Goo(__arglist(123, 456)); + d.Goo(x: 123, y: 456, 789); + d.Goo(ref z); + d.Goo(System.Console.WriteLine()); } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics( // (7,15): error CS1978: Cannot use an expression of type '__arglist' as an argument to a dynamically dispatched operation. - // d.Foo(__arglist(123, 456)); + // d.Goo(__arglist(123, 456)); Diagnostic(ErrorCode.ERR_BadDynamicMethodArg, "__arglist(123, 456)").WithArguments("__arglist"), // (8,31): error CS1738: Named argument specifications must appear after all fixed arguments have been specified - // d.Foo(x: 123, y: 456, 789); + // d.Goo(x: 123, y: 456, 789); Diagnostic(ErrorCode.ERR_NamedArgumentSpecificationBeforeFixedArgument, "789"), // (9,19): error CS0165: Use of unassigned local variable 'z' - // d.Foo(ref z); + // d.Goo(ref z); Diagnostic(ErrorCode.ERR_UseDefViolation, "z").WithArguments("z"), // (10,15): error CS1978: Cannot use an expression of type 'void' as an argument to a dynamically dispatched operation. - // d.Foo(System.Console.WriteLine()); + // d.Goo(System.Console.WriteLine()); Diagnostic(ErrorCode.ERR_BadDynamicMethodArg, "System.Console.WriteLine()").WithArguments("void")); } @@ -1253,19 +1253,19 @@ public void TestDynamicArgumentsToCallsErrors() string source = @" class C { - public void Foo() {} - public void Foo(int x, int y) {} + public void Goo() {} + public void Goo(int x, int y) {} public void M(dynamic d, C c) { // We know that this cannot possibly succeed when dynamically bound, so we give an error at compile time. - c.Foo(d); + c.Goo(d); } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics( - // (9,11): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'C.Foo(int, int)' - // c.Foo(d); - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("y", "C.Foo(int, int)").WithLocation(9, 11) + // (9,11): error CS7036: There is no argument given that corresponds to the required formal parameter 'y' of 'C.Goo(int, int)' + // c.Goo(d); + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("y", "C.Goo(int, int)").WithLocation(9, 11) ); } @@ -1275,28 +1275,28 @@ public void TestDynamicArgumentsToCalls() string source = @" class C { - public void Foo() {} - public void Foo(int x) {} - public void Foo(string x) {} - public void Foo(int x, int y) where T : class {} - public void Foo(string x, string y) where T : class {} + public void Goo() {} + public void Goo(int x) {} + public void Goo(string x) {} + public void Goo(int x, int y) where T : class {} + public void Goo(string x, string y) where T : class {} static void M(dynamic d, C c) { // This could be either of the one-parameter overloads so we allow it. - c.Foo(d); + c.Goo(d); // Doesn't constraints of generic overloads. - c.Foo(d, d); + c.Goo(d, d); } }"; // Dev11: doesn't report an error var comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics( - // (16,9): error CS0452: The type 'short' must be a reference type in order to use it as parameter 'T' in the generic type or method 'C.Foo(int, int)' - // c.Foo(d, d); - Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "c.Foo(d, d)").WithArguments("C.Foo(int, int)", "T", "short")); + // (16,9): error CS0452: The type 'short' must be a reference type in order to use it as parameter 'T' in the generic type or method 'C.Goo(int, int)' + // c.Goo(d, d); + Diagnostic(ErrorCode.ERR_RefConstraintNotSatisfied, "c.Goo(d, d)").WithArguments("C.Goo(int, int)", "T", "short")); } [Fact] @@ -1313,7 +1313,7 @@ public void M(int x) { } public class B { - public void Foo() + public void Goo() { dynamic d = null; F(d); @@ -1368,7 +1368,7 @@ class C static void Bar(dynamic d, T a) { } static void Bar(dynamic d, int a) { } - static void Foo() + static void Goo() { Bar(1, 2); } @@ -1513,10 +1513,10 @@ class C static void Main() { dynamic x = """"; - Foo(x, """"); + Goo(x, """"); } - static void Foo(T x, S y) where S : IComparable + static void Goo(T x, S y) where S : IComparable { } } @@ -1534,16 +1534,16 @@ class Program { static void Main() { - Foo((dynamic)1, 1); + Goo((dynamic)1, 1); } - static void Foo(int x, T y) where T : IEnumerable + static void Goo(int x, T y) where T : IEnumerable { } } "; // Dev11 reports error CS0315: The type 'int' cannot be used as type parameter 'T' in the generic type or method - // 'Program.Foo(int, T)'. There is no boxing conversion from 'int' to 'System.Collections.IEnumerable'. + // 'Program.Goo(int, T)'. There is no boxing conversion from 'int' to 'System.Collections.IEnumerable'. CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics(); } @@ -1558,18 +1558,18 @@ class Program { static void Main() { - Foo((dynamic)1, 1); + Goo((dynamic)1, 1); } - static void Foo(int x, T y) where T : IEnumerable + static void Goo(int x, T y) where T : IEnumerable { } } "; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( - // (8,9): error CS0315: The type 'int' cannot be used as type parameter 'T' in the generic type or method 'Program.Foo(int, T)'. + // (8,9): error CS0315: The type 'int' cannot be used as type parameter 'T' in the generic type or method 'Program.Goo(int, T)'. // There is no boxing conversion from 'int' to 'System.Collections.IEnumerable'. - Diagnostic(ErrorCode.ERR_GenericConstraintNotSatisfiedValType, "Foo((dynamic)1, 1)").WithArguments("Program.Foo(int, T)", "System.Collections.IEnumerable", "T", "int")); + Diagnostic(ErrorCode.ERR_GenericConstraintNotSatisfiedValType, "Goo((dynamic)1, 1)").WithArguments("Program.Goo(int, T)", "System.Collections.IEnumerable", "T", "int")); } [Fact] @@ -1863,12 +1863,12 @@ public void Erasure_InterfaceSet() abstract class A { - public abstract void Foo(S x) where S : List, IList; + public abstract void Goo(S x) where S : List, IList; } class B : A { - public override void Foo(S x) + public override void Goo(S x) { x.First(); } @@ -1885,12 +1885,12 @@ public void Erasure_Delegate1() abstract class A { - public abstract void Foo(S x) where S : T; + public abstract void Goo(S x) where S : T; } class B : A> { - public override void Foo(S x) + public override void Goo(S x) { x.Invoke(1).Bar(); } @@ -1910,12 +1910,12 @@ public void Erasure_Delegate2() abstract class A { - public abstract void Foo(S x) where S : T; + public abstract void Goo(S x) where S : T; } unsafe class B : A.E*[]>, int>> { - public override void Foo(S x) + public override void Goo(S x) { x.Invoke(1); } @@ -2497,7 +2497,7 @@ static void Main() Expression> e1 = () => new C { D = 1 }; // ok Expression> e2 = () => new C { D = { X = { Y = 1 }, Z = 1 } }; Expression> e3 = () => new C() { { d }, { d, d, d } }; - Expression> e4 = x => x.foo(); + Expression> e4 = x => x.goo(); Expression> e5 = x => x[1]; Expression> e6 = x => x.y.z; Expression> e7 = x => x + 1; @@ -2547,11 +2547,11 @@ static void Main() // Expression> e3 = () => new C() { { d }, { d, d, d } }; Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "{ d, d, d }"), // (29,54): error CS1963: An expression tree may not contain a dynamic operation - // Expression> e4 = x => x.foo(); - Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "x.foo()"), + // Expression> e4 = x => x.goo(); + Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "x.goo()"), // (29,54): error CS1963: An expression tree may not contain a dynamic operation - // Expression> e4 = x => x.foo(); - Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "x.foo"), + // Expression> e4 = x => x.goo(); + Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "x.goo"), // (30,54): error CS1963: An expression tree may not contain a dynamic operation // Expression> e5 = x => x[1]; Diagnostic(ErrorCode.ERR_ExpressionTreeContainsDynamicOperation, "x[1]"), @@ -2601,10 +2601,10 @@ class Program { static void Main() { - Expression> e = x => Foo(ref x); + Expression> e = x => Goo(ref x); } - static void Foo(ref T x) { } + static void Goo(ref T x) { } } "; CompileAndVerify(source, new[] { SystemCoreRef, CSharpRef }); @@ -2744,7 +2744,7 @@ static void M() { var x = from a in new Q() select a; - x.foo(); + x.goo(); } } "; @@ -3259,10 +3259,10 @@ static void Main() IEnumerable objectSource = null; Action dynamicAction = null; // Fails under Roslyn, compiles under C# 5 compiler - Foo(objectSource, dynamicAction); + Goo(objectSource, dynamicAction); } - static void Foo(IEnumerable source, Action action) + static void Goo(IEnumerable source, Action action) { System.Console.WriteLine(typeof(T)); } @@ -3272,8 +3272,8 @@ static void Foo(IEnumerable source, Action action) var tree = verifier.Compilation.SyntaxTrees.Single(); var model = verifier.Compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Foo").Single(); - Assert.Equal("void Test.Foo(System.Collections.Generic.IEnumerable source, System.Action action)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); + var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Goo").Single(); + Assert.Equal("void Test.Goo(System.Collections.Generic.IEnumerable source, System.Action action)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); } [Fact, WorkItem(922611, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/922611"), WorkItem(56, "CodePlex")] @@ -3290,10 +3290,10 @@ static void Main() IEnumerable objectSource = null; Action dynamicAction = null; // Fails under Roslyn, compiles under C# 5 compiler - Foo(dynamicAction, objectSource); + Goo(dynamicAction, objectSource); } - static void Foo(Action action, IEnumerable source) + static void Goo(Action action, IEnumerable source) { System.Console.WriteLine(typeof(T)); } @@ -3305,8 +3305,8 @@ static void Foo(Action action, IEnumerable source) var tree = verifier.Compilation.SyntaxTrees.Single(); var model = verifier.Compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Foo").Single(); - Assert.Equal("void Test.Foo(System.Action action, System.Collections.Generic.IEnumerable source)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); + var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Goo").Single(); + Assert.Equal("void Test.Goo(System.Action action, System.Collections.Generic.IEnumerable source)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); } [Fact, WorkItem(875140, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/875140")] @@ -3321,10 +3321,10 @@ class Program unsafe static void Main() { Action action = delegate { }; - void* p = Pointer.Unbox(Foo(action)); + void* p = Pointer.Unbox(Goo(action)); } - static T Foo(Action x) { throw null; } + static T Goo(Action x) { throw null; } } "; var verifier = CompileAndVerify(source, options: TestOptions.DebugDll.WithAllowUnsafe(true)).VerifyDiagnostics(); @@ -3332,8 +3332,8 @@ unsafe static void Main() var tree = verifier.Compilation.SyntaxTrees.Single(); var model = verifier.Compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Foo").Single(); - Assert.Equal("System.Object Program.Foo(System.Action x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); + var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Goo").Single(); + Assert.Equal("System.Object Program.Goo(System.Action x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); } [Fact, WorkItem(875140, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/875140")] @@ -3348,10 +3348,10 @@ class Program unsafe static void Main() { Action action = delegate { }; - void* p = Pointer.Unbox(Foo(action)); + void* p = Pointer.Unbox(Goo(action)); } - static T Foo(Action x) { throw null; } + static T Goo(Action x) { throw null; } } "; var verifier = CompileAndVerify(source, options: TestOptions.DebugDll.WithAllowUnsafe(true)).VerifyDiagnostics(); @@ -3359,8 +3359,8 @@ unsafe static void Main() var tree = verifier.Compilation.SyntaxTrees.Single(); var model = verifier.Compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Foo").Single(); - Assert.Equal("System.Object Program.Foo(System.Action x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); + var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Goo").Single(); + Assert.Equal("System.Object Program.Goo(System.Action x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); } [Fact, WorkItem(875140, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/875140")] @@ -3375,16 +3375,16 @@ class Program unsafe static void Main() { Func action = null; - void* p = Pointer.Unbox(Foo(action)); + void* p = Pointer.Unbox(Goo(action)); } - static T Foo(Func x) { throw null; } + static T Goo(Func x) { throw null; } } "; CreateStandardCompilation(source, options: TestOptions.DebugDll.WithAllowUnsafe(true)).VerifyDiagnostics( - // (10,33): error CS0411: The type arguments for method 'Program.Foo(Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. - // void* p = Pointer.Unbox(Foo(action)); - Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Foo").WithArguments("Program.Foo(System.Func)").WithLocation(10, 33) + // (10,33): error CS0411: The type arguments for method 'Program.Goo(Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. + // void* p = Pointer.Unbox(Goo(action)); + Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Goo").WithArguments("Program.Goo(System.Func)").WithLocation(10, 33) ); } @@ -3399,10 +3399,10 @@ class Program static void Main() { Func action = null; - Foo(action).M1(); + Goo(action).M1(); } - static T Foo(Func x) { throw null; } + static T Goo(Func x) { throw null; } } "; var verifier = CompileAndVerify(source, new[] { CSharpRef, SystemCoreRef }, options: TestOptions.DebugDll).VerifyDiagnostics(); @@ -3410,8 +3410,8 @@ static void Main() var tree = verifier.Compilation.SyntaxTrees.Single(); var model = verifier.Compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Foo").Single(); - Assert.Equal("dynamic Program.Foo(System.Func x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); + var node = tree.GetRoot().DescendantNodes().OfType().Where(n => n.Identifier.ValueText == "Goo").Single(); + Assert.Equal("dynamic Program.Goo(System.Func x)", model.GetSymbolInfo(node).Symbol.ToTestDisplayString()); } [Fact, WorkItem(1149588, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/1149588")] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ExpressionBodiedMemberTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ExpressionBodiedMemberTests.cs index 21295f2e07fa7..1bae58be0c4cc 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ExpressionBodiedMemberTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ExpressionBodiedMemberTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -23,12 +23,12 @@ public void PartialMethods() var comp = CreateCompilationWithMscorlib45(@" public partial class C { - static partial void foo() => System.Console.WriteLine(""test""); + static partial void goo() => System.Console.WriteLine(""test""); } public partial class C { - static partial void foo(); + static partial void goo(); } "); var tree = comp.SyntaxTrees[0]; @@ -39,20 +39,20 @@ public partial class C .OfType() .ElementAt(1); - var fooDef = model.GetDeclaredSymbol(node) as SourceOrdinaryMethodSymbol; - Assert.NotNull(fooDef); - Assert.True(fooDef.IsPartial); - Assert.True(fooDef.IsPartialDefinition); - Assert.False(fooDef.IsPartialImplementation); - Assert.Null(fooDef.PartialDefinitionPart); + var gooDef = model.GetDeclaredSymbol(node) as SourceOrdinaryMethodSymbol; + Assert.NotNull(gooDef); + Assert.True(gooDef.IsPartial); + Assert.True(gooDef.IsPartialDefinition); + Assert.False(gooDef.IsPartialImplementation); + Assert.Null(gooDef.PartialDefinitionPart); - var fooImpl = fooDef.PartialImplementationPart + var gooImpl = gooDef.PartialImplementationPart as SourceOrdinaryMethodSymbol; - Assert.NotNull(fooImpl); - Assert.True(fooImpl.IsPartial); - Assert.True(fooImpl.IsPartialImplementation); - Assert.False(fooImpl.IsPartialDefinition); - Assert.True(fooImpl.IsExpressionBodied); + Assert.NotNull(gooImpl); + Assert.True(gooImpl.IsPartial); + Assert.True(gooImpl.IsPartialImplementation); + Assert.False(gooImpl.IsPartialDefinition); + Assert.True(gooImpl.IsExpressionBodied); } [Fact] @@ -923,7 +923,7 @@ public void BlockBodyAndExpressionBody_15() var comp = CreateStandardCompilation(@" public class C { - void Foo() + void Goo() { int Bar() { return 0; } => 0; } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/FieldInitializerBindingTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/FieldInitializerBindingTests.cs index 5bc31ce152ea5..864dd01970172 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/FieldInitializerBindingTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/FieldInitializerBindingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -78,16 +78,16 @@ public void ExpressionInstanceInitializer() class C { static int s1; - int i1 = 1 + Foo(); + int i1 = 1 + Goo(); - static int Foo() { return 1; } + static int Goo() { return 1; } }"; IEnumerable expectedStaticInitializers = null; IEnumerable expectedInstanceInitializers = new ExpectedInitializer[] { - new ExpectedInitializer("i1", "1 + Foo()", lineNumber: 4), + new ExpectedInitializer("i1", "1 + Goo()", lineNumber: 4), }; CompileAndCheckInitializers(source, expectedInstanceInitializers, expectedStaticInitializers); @@ -99,15 +99,15 @@ public void ExpressionStaticInitializer() var source = @" class C { - static int s1 = 1 + Foo(); + static int s1 = 1 + Goo(); int i1; - static int Foo() { return 1; } + static int Goo() { return 1; } }"; IEnumerable expectedStaticInitializers = new ExpectedInitializer[] { - new ExpectedInitializer("s1", "1 + Foo()", lineNumber: 3), + new ExpectedInitializer("s1", "1 + Goo()", lineNumber: 3), }; IEnumerable expectedInstanceInitializers = null; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ForEachTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ForEachTests.cs index 656e878fc855a..39ea7767db063 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ForEachTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ForEachTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Linq; @@ -289,14 +289,14 @@ public void TestErrorPatternNullableGetEnumerator() var text = @" struct C { - static void Foo(Enumerable? e) + static void Goo(Enumerable? e) { foreach (long x in e) { } } static void Main() { - Foo(new Enumerable()); + Goo(new Enumerable()); } } @@ -751,7 +751,7 @@ public void TestErrorMultipleIEnumerableT() class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (int x in e) { } } @@ -779,7 +779,7 @@ public void TestErrorMultipleIEnumerableT2() class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (int x in e) { } } @@ -938,7 +938,7 @@ public void TestErrorNonEnumerable() var text = @" class C { - void Foo(int i) + void Goo(int i) { foreach (int x in i) { } } @@ -956,7 +956,7 @@ public void TestErrorModifyIterationVariable() var text = @" class C { - void Foo(int[] a) + void Goo(int[] a) { foreach (int x in a) { x++; } } @@ -974,9 +974,9 @@ public void TestErrorImplicitlyTypedCycle() var text = @" class C { - System.Collections.IEnumerable Foo(object y) + System.Collections.IEnumerable Goo(object y) { - foreach (var x in Foo(x)) { } + foreach (var x in Goo(x)) { } return null; } } @@ -993,7 +993,7 @@ public void TestErrorDynamicEnumerator() var text = @" class C { - void Foo(DynamicEnumerable e) + void Goo(DynamicEnumerable e) { foreach (int x in e) { } } @@ -1037,7 +1037,7 @@ public void TestErrorTypeNonEnumerable() var text = @" class C { - void Foo() + void Goo() { foreach (int x in System.Console) { } } @@ -1183,7 +1183,7 @@ public void TestSuccessArray() var text = @" class C { - void Foo(int[] a) + void Goo(int[] a) { foreach (int x in a) { } } @@ -1215,7 +1215,7 @@ public void TestSuccessString() var text = @" class C { - void Foo(string s) + void Goo(string s) { foreach (char c in s) { } } @@ -1247,7 +1247,7 @@ public void TestSuccessPattern() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (long x in e) { } } @@ -1290,7 +1290,7 @@ public void TestSuccessPatternStruct() var text = @" struct C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (long x in e) { } } @@ -1333,7 +1333,7 @@ public void TestSuccessInterfacePattern() var text = @" class C { - void Foo(System.Collections.IEnumerable e) + void Goo(System.Collections.IEnumerable e) { foreach (long x in e) { } } @@ -1365,7 +1365,7 @@ public void TestSuccessInterfaceNonPatternGeneric() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (long x in e) { } } @@ -1404,7 +1404,7 @@ public void TestSuccessInterfaceNonPatternInaccessibleGeneric() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (object x in e) { } } @@ -1445,7 +1445,7 @@ public void TestSuccessInterfaceNonPatternNonGeneric() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (long x in e) { } } @@ -1483,7 +1483,7 @@ public void TestSuccessImplicitlyTypedArray() var text = @" class C { - void Foo(int[] a) + void Goo(int[] a) { foreach (var x in a) { } } @@ -1513,7 +1513,7 @@ public void TestSuccessImplicitlyTypedString() var text = @" class C { - void Foo(string s) + void Goo(string s) { foreach (var x in s) { } } @@ -1543,7 +1543,7 @@ public void TestSuccessImplicitlyTypedPattern() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (var x in e) { } } @@ -1572,7 +1572,7 @@ public void TestSuccessImplicitlyTypedInterface() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (var x in e) { } } @@ -1596,7 +1596,7 @@ public void TestSuccessExplicitlyTypedVar() var text = @" class C { - void Foo(var[] a) + void Goo(var[] a) { foreach (var x in a) { } } @@ -1628,7 +1628,7 @@ public void TestSuccessDynamicEnumerable() var text = @" class C { - void Foo(dynamic d) + void Goo(dynamic d) { foreach (int x in d) { } } @@ -1660,7 +1660,7 @@ public void TestSuccessImplicitlyTypedDynamicEnumerable() var text = @" class C { - void Foo(dynamic d) + void Goo(dynamic d) { foreach (var x in d) { } } @@ -1809,7 +1809,7 @@ interface MyEnumerator Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); } - // Copied from TestSuccessPatternStruct - only change is that Foo parameter is now nullable. + // Copied from TestSuccessPatternStruct - only change is that Goo parameter is now nullable. [WorkItem(544908, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544908")] [Fact] public void TestSuccessNullableCollection() @@ -1817,7 +1817,7 @@ public void TestSuccessNullableCollection() var text = @" struct C { - void Foo(Enumerable? e) + void Goo(Enumerable? e) { foreach (long x in e) { } } @@ -2174,7 +2174,7 @@ public void MissingObjectType() var text = @" class C { - void Foo(Enumerable e) + void Goo(Enumerable e) { foreach (Element x in e) { } } @@ -2230,7 +2230,7 @@ public interface IEnumerator class C { - void Foo(System.Collections.Generic.IEnumerable? e) + void Goo(System.Collections.Generic.IEnumerable? e) { foreach (var c in e) { } } @@ -2266,7 +2266,7 @@ public class Enumerable : System.Collections.Generic.IEnumerable { } class C { - void Foo(System.Collections.Generic.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.Generic.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2328,7 +2328,7 @@ System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable class C { - void Foo(System.Collections.Generic.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.Generic.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2398,7 +2398,7 @@ System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable class C { - void Foo(System.Collections.Generic.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.Generic.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2468,7 +2468,7 @@ System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable class C { - void Foo(System.Collections.Generic.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.Generic.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2513,7 +2513,7 @@ public class Enumerable : System.Collections.IEnumerable { } class C { - void Foo(System.Collections.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2578,7 +2578,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() class C { - void Foo(System.Collections.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2641,7 +2641,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() class C { - void Foo(System.Collections.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2704,7 +2704,7 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() class C { - void Foo(System.Collections.IEnumerable e1, Enumerable e2) + void Goo(System.Collections.IEnumerable e1, Enumerable e2) { foreach (var c in e1) { } // Pattern foreach (var c in e2) { } // Interface @@ -2735,14 +2735,14 @@ class Program { static void Main() { - foreach(var x in Foo) { } + foreach(var x in Goo) { } } } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (6,26): error CS0103: The name 'Foo' does not exist in the current context - // foreach(var x in Foo) { } - Diagnostic(ErrorCode.ERR_NameNotInContext, "Foo").WithArguments("Foo").WithLocation(6, 26)); + // (6,26): error CS0103: The name 'Goo' does not exist in the current context + // foreach(var x in Goo) { } + Diagnostic(ErrorCode.ERR_NameNotInContext, "Goo").WithArguments("Goo").WithLocation(6, 26)); } [WorkItem(847507, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/847507")] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/HideByNameTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/HideByNameTests.cs index de77f307c49a8..3503a67d9fb74 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/HideByNameTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/HideByNameTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -29,7 +29,7 @@ instance void .ctor() cil managed ret } - .method public static string Foo(string x) cil managed + .method public static string Goo(string x) cil managed { ldarg.0 ret @@ -48,7 +48,7 @@ instance void .ctor() cil managed ret } - .method public static void Foo(int32 x) cil managed + .method public static void Goo(int32 x) cil managed { ret } @@ -60,13 +60,13 @@ class Program { static void Main() { - B.Foo(""""); + B.Goo(""""); } }"; CreateCompilationWithCustomILSource(csharp, il).VerifyDiagnostics( // (6,15): error CS1503: Argument 1: cannot convert from 'string' to 'int' - // B.Foo(""); + // B.Goo(""); Diagnostic(ErrorCode.ERR_BadArgType, @"""""").WithArguments("1", "string", "int")); } @@ -85,7 +85,7 @@ instance void .ctor() cil managed ret } - .method public instance string Foo(string x) cil managed + .method public instance string Goo(string x) cil managed { ldarg.0 ret @@ -104,7 +104,7 @@ instance void .ctor() cil managed ret } - .method public instance void Foo(int32 x) cil managed + .method public instance void Goo(int32 x) cil managed { ret } @@ -116,13 +116,13 @@ class Program { static void Main() { - new B().Foo(""""); + new B().Goo(""""); } }"; CreateCompilationWithCustomILSource(csharp, il).VerifyDiagnostics( // (6,21): error CS1503: Argument 1: cannot convert from 'string' to 'int' - // new B().Foo(""); + // new B().Goo(""); Diagnostic(ErrorCode.ERR_BadArgType, @"""""").WithArguments("1", "string", "int")); } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ImplicitlyTypedLocalsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ImplicitlyTypedLocalsTests.cs index 31bc0b4be851c..78a123fc59e7c 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ImplicitlyTypedLocalsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ImplicitlyTypedLocalsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -62,19 +62,19 @@ class Program { static void Main(string[] args) { - var x = y.Foo(x); - var y = x.Foo(y); + var x = y.Goo(x); + var y = x.Goo(y); } }"; CreateStandardCompilation(text).VerifyDiagnostics( // (6,23): error CS0841: Cannot use local variable 'x' before it is declared - // var x = y.Foo(x); + // var x = y.Goo(x); Diagnostic(ErrorCode.ERR_VariableUsedBeforeDeclaration, "x").WithArguments("x").WithLocation(6, 23), // (6,17): error CS0841: Cannot use local variable 'y' before it is declared - // var x = y.Foo(x); + // var x = y.Goo(x); Diagnostic(ErrorCode.ERR_VariableUsedBeforeDeclaration, "y").WithArguments("y").WithLocation(6, 17), // (7,23): error CS0841: Cannot use local variable 'y' before it is declared - // var y = x.Foo(y); + // var y = x.Goo(y); Diagnostic(ErrorCode.ERR_VariableUsedBeforeDeclaration, "y").WithArguments("y").WithLocation(7, 23) ); } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/InheritanceBindingTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/InheritanceBindingTests.cs index b533aa3c63b3e..d508374aa4841 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/InheritanceBindingTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/InheritanceBindingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Linq; @@ -22,7 +22,7 @@ public class InheritanceBindingTests : CompilingTestBase public void TestModifiersOnExplicitImpl() { var text = @" -interface IFoo +interface IGoo { void Method1(); void Method2(); @@ -39,67 +39,67 @@ interface IFoo void Method13(); } -abstract partial class AbstractFoo : IFoo +abstract partial class AbstractGoo : IGoo { - abstract void IFoo.Method1() { } - virtual void IFoo.Method2() { } - override void IFoo.Method3() { } + abstract void IGoo.Method1() { } + virtual void IGoo.Method2() { } + override void IGoo.Method3() { } - sealed void IFoo.Method4() { } + sealed void IGoo.Method4() { } - new void IFoo.Method5() { } + new void IGoo.Method5() { } - public void IFoo.Method6() { } - protected void IFoo.Method7() { } - internal void IFoo.Method8() { } - protected internal void IFoo.Method9() { } //roslyn considers 'protected internal' one modifier (two in dev10) - private void IFoo.Method10() { } + public void IGoo.Method6() { } + protected void IGoo.Method7() { } + internal void IGoo.Method8() { } + protected internal void IGoo.Method9() { } //roslyn considers 'protected internal' one modifier (two in dev10) + private void IGoo.Method10() { } - extern void IFoo.Method11(); //not an error (in dev10 or roslyn) - static void IFoo.Method12() { } - partial void IFoo.Method13(); + extern void IGoo.Method11(); //not an error (in dev10 or roslyn) + static void IGoo.Method12() { } + partial void IGoo.Method13(); }"; CreateStandardCompilation(text).VerifyDiagnostics( // (21,24): error CS0106: The modifier 'abstract' is not valid for this item - // abstract void IFoo.Method1() { } + // abstract void IGoo.Method1() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method1").WithArguments("abstract"), // (22,23): error CS0106: The modifier 'virtual' is not valid for this item - // virtual void IFoo.Method2() { } + // virtual void IGoo.Method2() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method2").WithArguments("virtual"), // (23,24): error CS0106: The modifier 'override' is not valid for this item - // override void IFoo.Method3() { } + // override void IGoo.Method3() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method3").WithArguments("override"), // (25,22): error CS0106: The modifier 'sealed' is not valid for this item - // sealed void IFoo.Method4() { } + // sealed void IGoo.Method4() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method4").WithArguments("sealed"), // (27,19): error CS0106: The modifier 'new' is not valid for this item - // new void IFoo.Method5() { } + // new void IGoo.Method5() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method5").WithArguments("new"), // (29,22): error CS0106: The modifier 'public' is not valid for this item - // public void IFoo.Method6() { } + // public void IGoo.Method6() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method6").WithArguments("public"), // (30,25): error CS0106: The modifier 'protected' is not valid for this item - // protected void IFoo.Method7() { } + // protected void IGoo.Method7() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method7").WithArguments("protected"), // (31,24): error CS0106: The modifier 'internal' is not valid for this item - // internal void IFoo.Method8() { } + // internal void IGoo.Method8() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method8").WithArguments("internal"), // (32,34): error CS0106: The modifier 'protected internal' is not valid for this item - // protected internal void IFoo.Method9() { } //roslyn considers 'protected internal' one modifier (two in dev10) + // protected internal void IGoo.Method9() { } //roslyn considers 'protected internal' one modifier (two in dev10) Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method9").WithArguments("protected internal"), // (33,23): error CS0106: The modifier 'private' is not valid for this item - // private void IFoo.Method10() { } + // private void IGoo.Method10() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method10").WithArguments("private"), // (36,22): error CS0106: The modifier 'static' is not valid for this item - // static void IFoo.Method12() { } + // static void IGoo.Method12() { } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Method12").WithArguments("static"), // (37,23): error CS0754: A partial method may not explicitly implement an interface method - // partial void IFoo.Method13(); + // partial void IGoo.Method13(); Diagnostic(ErrorCode.ERR_PartialMethodNotExplicit, "Method13"), - // (35,22): warning CS0626: Method, operator, or accessor 'AbstractFoo.IFoo.Method11()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. - // extern void IFoo.Method11(); //not an error (in dev10 or roslyn) - Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "Method11").WithArguments("AbstractFoo.IFoo.Method11()") + // (35,22): warning CS0626: Method, operator, or accessor 'AbstractGoo.IGoo.Method11()' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. + // extern void IGoo.Method11(); //not an error (in dev10 or roslyn) + Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "Method11").WithArguments("AbstractGoo.IGoo.Method11()") ); } @@ -107,7 +107,7 @@ static void IFoo.Method12() { } public void TestModifiersOnExplicitPropertyImpl() { var text = @" -interface IFoo +interface IGoo { int Property1 { set; } int Property2 { set; } @@ -123,24 +123,24 @@ interface IFoo int Property12 { set; } } -abstract class AbstractFoo : IFoo +abstract class AbstractGoo : IGoo { - abstract int IFoo.Property1 { set { } } - virtual int IFoo.Property2 { set { } } - override int IFoo.Property3 { set { } } + abstract int IGoo.Property1 { set { } } + virtual int IGoo.Property2 { set { } } + override int IGoo.Property3 { set { } } - sealed int IFoo.Property4 { set { } } + sealed int IGoo.Property4 { set { } } - new int IFoo.Property5 { set { } } + new int IGoo.Property5 { set { } } - public int IFoo.Property6 { set { } } - protected int IFoo.Property7 { set { } } - internal int IFoo.Property8 { set { } } - protected internal int IFoo.Property9 { set { } } //roslyn considers 'protected internal' one modifier (two in dev10) - private int IFoo.Property10 { set { } } + public int IGoo.Property6 { set { } } + protected int IGoo.Property7 { set { } } + internal int IGoo.Property8 { set { } } + protected internal int IGoo.Property9 { set { } } //roslyn considers 'protected internal' one modifier (two in dev10) + private int IGoo.Property10 { set { } } - extern int IFoo.Property11 { set; } //not an error (in dev10 or roslyn) - static int IFoo.Property12 { set { } } + extern int IGoo.Property11 { set; } //not an error (in dev10 or roslyn) + static int IGoo.Property12 { set { } } }"; CreateStandardCompilation(text).VerifyDiagnostics( @@ -166,15 +166,15 @@ static int IFoo.Property12 { set { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Property10").WithArguments("private"), // (35,21): error CS0106: The modifier 'static' is not valid for this item Diagnostic(ErrorCode.ERR_BadMemberFlag, "Property12").WithArguments("static"), - // (34,34): warning CS0626: Method, operator, or accessor 'AbstractFoo.IFoo.Property11.set' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. - Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "set").WithArguments("AbstractFoo.IFoo.Property11.set")); + // (34,34): warning CS0626: Method, operator, or accessor 'AbstractGoo.IGoo.Property11.set' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. + Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "set").WithArguments("AbstractGoo.IGoo.Property11.set")); } [Fact] public void TestModifiersOnExplicitIndexerImpl() { var text = @" -interface IFoo +interface IGoo { int this[int x1, int x2, int x3, int x4] { set; } int this[int x1, int x2, int x3, long x4] { set; } @@ -190,24 +190,24 @@ interface IFoo int this[long x1, int x2, long x3, long x4] { set; } } -abstract class AbstractFoo : IFoo +abstract class AbstractGoo : IGoo { - abstract int IFoo.this[int x1, int x2, int x3, int x4] { set { } } - virtual int IFoo.this[int x1, int x2, int x3, long x4] { set { } } - override int IFoo.this[int x1, int x2, long x3, int x4] { set { } } + abstract int IGoo.this[int x1, int x2, int x3, int x4] { set { } } + virtual int IGoo.this[int x1, int x2, int x3, long x4] { set { } } + override int IGoo.this[int x1, int x2, long x3, int x4] { set { } } - sealed int IFoo.this[int x1, int x2, long x3, long x4] { set { } } + sealed int IGoo.this[int x1, int x2, long x3, long x4] { set { } } - new int IFoo.this[int x1, long x2, int x3, int x4] { set { } } + new int IGoo.this[int x1, long x2, int x3, int x4] { set { } } - public int IFoo.this[int x1, long x2, int x3, long x4] { set { } } - protected int IFoo.this[int x1, long x2, long x3, int x4] { set { } } - internal int IFoo.this[int x1, long x2, long x3, long x4] { set { } } - protected internal int IFoo.this[long x1, int x2, int x3, int x4] { set { } } //roslyn considers 'protected internal' one modifier (two in dev10) - private int IFoo.this[long x1, int x2, int x3, long x4] { set { } } + public int IGoo.this[int x1, long x2, int x3, long x4] { set { } } + protected int IGoo.this[int x1, long x2, long x3, int x4] { set { } } + internal int IGoo.this[int x1, long x2, long x3, long x4] { set { } } + protected internal int IGoo.this[long x1, int x2, int x3, int x4] { set { } } //roslyn considers 'protected internal' one modifier (two in dev10) + private int IGoo.this[long x1, int x2, int x3, long x4] { set { } } - extern int IFoo.this[long x1, int x2, long x3, int x4] { set; } //not an error (in dev10 or roslyn) - static int IFoo.this[long x1, int x2, long x3, long x4] { set { } } + extern int IGoo.this[long x1, int x2, long x3, int x4] { set; } //not an error (in dev10 or roslyn) + static int IGoo.this[long x1, int x2, long x3, long x4] { set { } } }"; CreateStandardCompilation(text).VerifyDiagnostics( @@ -233,15 +233,15 @@ abstract class AbstractFoo : IFoo Diagnostic(ErrorCode.ERR_BadMemberFlag, "this").WithArguments("private"), // (35,21): error CS0106: The modifier 'static' is not valid for this item Diagnostic(ErrorCode.ERR_BadMemberFlag, "this").WithArguments("static"), - // (34,62): warning CS0626: Method, operator, or accessor 'AbstractFoo.IFoo.this[long, int, long, int].set' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. - Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "set").WithArguments("AbstractFoo.IFoo.this[long, int, long, int].set")); + // (34,62): warning CS0626: Method, operator, or accessor 'AbstractGoo.IGoo.this[long, int, long, int].set' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation. + Diagnostic(ErrorCode.WRN_ExternMethodNoImplementation, "set").WithArguments("AbstractGoo.IGoo.this[long, int, long, int].set")); } [Fact, WorkItem(542158, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/542158")] public void TestModifiersOnExplicitEventImpl() { var text = @" -interface IFoo +interface IGoo { event System.Action Event1; event System.Action Event2; @@ -257,24 +257,24 @@ interface IFoo event System.Action Event12; } -abstract class AbstractFoo : IFoo +abstract class AbstractGoo : IGoo { - abstract event System.Action IFoo.Event1 { add { } remove { } } - virtual event System.Action IFoo.Event2 { add { } remove { } } - override event System.Action IFoo.Event3 { add { } remove { } } + abstract event System.Action IGoo.Event1 { add { } remove { } } + virtual event System.Action IGoo.Event2 { add { } remove { } } + override event System.Action IGoo.Event3 { add { } remove { } } - sealed event System.Action IFoo.Event4 { add { } remove { } } + sealed event System.Action IGoo.Event4 { add { } remove { } } - new event System.Action IFoo.Event5 { add { } remove { } } + new event System.Action IGoo.Event5 { add { } remove { } } - public event System.Action IFoo.Event6 { add { } remove { } } - protected event System.Action IFoo.Event7 { add { } remove { } } - internal event System.Action IFoo.Event8 { add { } remove { } } - protected internal event System.Action IFoo.Event9 { add { } remove { } } //roslyn considers 'protected internal' one modifier (two in dev10) - private event System.Action IFoo.Event10 { add { } remove { } } + public event System.Action IGoo.Event6 { add { } remove { } } + protected event System.Action IGoo.Event7 { add { } remove { } } + internal event System.Action IGoo.Event8 { add { } remove { } } + protected internal event System.Action IGoo.Event9 { add { } remove { } } //roslyn considers 'protected internal' one modifier (two in dev10) + private event System.Action IGoo.Event10 { add { } remove { } } - extern event System.Action IFoo.Event11 { add { } remove { } } - static event System.Action IFoo.Event12 { add { } remove { } } + extern event System.Action IGoo.Event11 { add { } remove { } } + static event System.Action IGoo.Event12 { add { } remove { } } }"; // It seems Dev11 doesn't report ERR_ExternHasBody errors for Event11 accessors // if there are other explicitly implemented members with erroneous modifiers other than extern and abstract. @@ -283,43 +283,43 @@ static event System.Action IFoo.Event12 { add { } remove { } } CreateStandardCompilation(text).VerifyDiagnostics( // (20,39): error CS0106: The modifier 'abstract' is not valid for this item - // abstract event System.Action IFoo.Event1 { add { } remove { } } + // abstract event System.Action IGoo.Event1 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event1").WithArguments("abstract"), // (21,38): error CS0106: The modifier 'virtual' is not valid for this item - // virtual event System.Action IFoo.Event2 { add { } remove { } } + // virtual event System.Action IGoo.Event2 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event2").WithArguments("virtual"), // (22,39): error CS0106: The modifier 'override' is not valid for this item - // override event System.Action IFoo.Event3 { add { } remove { } } + // override event System.Action IGoo.Event3 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event3").WithArguments("override"), // (24,37): error CS0106: The modifier 'sealed' is not valid for this item - // sealed event System.Action IFoo.Event4 { add { } remove { } } + // sealed event System.Action IGoo.Event4 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event4").WithArguments("sealed"), // (26,34): error CS0106: The modifier 'new' is not valid for this item - // new event System.Action IFoo.Event5 { add { } remove { } } + // new event System.Action IGoo.Event5 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event5").WithArguments("new"), // (28,37): error CS0106: The modifier 'public' is not valid for this item - // public event System.Action IFoo.Event6 { add { } remove { } } + // public event System.Action IGoo.Event6 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event6").WithArguments("public"), // (29,40): error CS0106: The modifier 'protected' is not valid for this item - // protected event System.Action IFoo.Event7 { add { } remove { } } + // protected event System.Action IGoo.Event7 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event7").WithArguments("protected"), // (30,39): error CS0106: The modifier 'internal' is not valid for this item - // internal event System.Action IFoo.Event8 { add { } remove { } } + // internal event System.Action IGoo.Event8 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event8").WithArguments("internal"), // (31,49): error CS0106: The modifier 'protected internal' is not valid for this item - // protected internal event System.Action IFoo.Event9 { add { } remove { } } //roslyn considers 'protected internal' one modifier (two in dev10) + // protected internal event System.Action IGoo.Event9 { add { } remove { } } //roslyn considers 'protected internal' one modifier (two in dev10) Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event9").WithArguments("protected internal"), // (32,38): error CS0106: The modifier 'private' is not valid for this item - // private event System.Action IFoo.Event10 { add { } remove { } } + // private event System.Action IGoo.Event10 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event10").WithArguments("private"), - // (34,47): error CS0179: 'AbstractFoo.IFoo.Event11.add' cannot be extern and declare a body - // extern event System.Action IFoo.Event11 { add { } remove { } } - Diagnostic(ErrorCode.ERR_ExternHasBody, "add").WithArguments("AbstractFoo.IFoo.Event11.add"), - // (34,55): error CS0179: 'AbstractFoo.IFoo.Event11.remove' cannot be extern and declare a body - // extern event System.Action IFoo.Event11 { add { } remove { } } - Diagnostic(ErrorCode.ERR_ExternHasBody, "remove").WithArguments("AbstractFoo.IFoo.Event11.remove"), + // (34,47): error CS0179: 'AbstractGoo.IGoo.Event11.add' cannot be extern and declare a body + // extern event System.Action IGoo.Event11 { add { } remove { } } + Diagnostic(ErrorCode.ERR_ExternHasBody, "add").WithArguments("AbstractGoo.IGoo.Event11.add"), + // (34,55): error CS0179: 'AbstractGoo.IGoo.Event11.remove' cannot be extern and declare a body + // extern event System.Action IGoo.Event11 { add { } remove { } } + Diagnostic(ErrorCode.ERR_ExternHasBody, "remove").WithArguments("AbstractGoo.IGoo.Event11.remove"), // (35,37): error CS0106: The modifier 'static' is not valid for this item - // static event System.Action IFoo.Event12 { add { } remove { } } + // static event System.Action IGoo.Event12 { add { } remove { } } Diagnostic(ErrorCode.ERR_BadMemberFlag, "Event12").WithArguments("static")); } @@ -389,14 +389,14 @@ void Test() public void TestHidesAbstractMethod() { var text = @" -abstract class AbstractFoo +abstract class AbstractGoo { public abstract void Method1(); public abstract void Method2(); public abstract void Method3(); } -abstract class Foo : AbstractFoo +abstract class Goo : AbstractGoo { public void Method1() { } public abstract void Method2(); @@ -417,14 +417,14 @@ public virtual void Method3() { } public void TestHidesAbstractProperty() { var text = @" -abstract class AbstractFoo +abstract class AbstractGoo { public abstract long Property1 { set; } public abstract long Property2 { set; } public abstract long Property3 { set; } } -abstract class Foo : AbstractFoo +abstract class Goo : AbstractGoo { public long Property1 { set { } } public abstract long Property2 { set; } @@ -445,14 +445,14 @@ public virtual long Property3 { set { } } public void TestHidesAbstractIndexer() { var text = @" -abstract class AbstractFoo +abstract class AbstractGoo { public abstract long this[int x] { set; } public abstract long this[string x] { set; } public abstract long this[char x] { set; } } -abstract class Foo : AbstractFoo +abstract class Goo : AbstractGoo { public long this[int x] { set { } } public abstract long this[string x] { set; } @@ -473,14 +473,14 @@ public virtual long this[char x] { set { } } public void TestHidesAbstractEvent() { var text = @" -abstract class AbstractFoo +abstract class AbstractGoo { public abstract event System.Action Event1; public abstract event System.Action Event2; public abstract event System.Action Event3; } -abstract class Foo : AbstractFoo +abstract class Goo : AbstractGoo { public event System.Action Event1 { add { } remove { } } public abstract event System.Action Event2; @@ -488,24 +488,24 @@ public virtual event System.Action Event3 { add { } remove { } } } "; CreateStandardCompilation(text).VerifyDiagnostics( - // (11,32): error CS0533: 'Foo.Event1' hides inherited abstract member 'AbstractFoo.Event1' + // (11,32): error CS0533: 'Goo.Event1' hides inherited abstract member 'AbstractGoo.Event1' // public event System.Action Event1 { add { } remove { } } - Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event1").WithArguments("Foo.Event1", "AbstractFoo.Event1"), - // (11,32): warning CS0114: 'Foo.Event1' hides inherited member 'AbstractFoo.Event1'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. + Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event1").WithArguments("Goo.Event1", "AbstractGoo.Event1"), + // (11,32): warning CS0114: 'Goo.Event1' hides inherited member 'AbstractGoo.Event1'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. // public event System.Action Event1 { add { } remove { } } - Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event1").WithArguments("Foo.Event1", "AbstractFoo.Event1"), - // (12,41): error CS0533: 'Foo.Event2' hides inherited abstract member 'AbstractFoo.Event2' + Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event1").WithArguments("Goo.Event1", "AbstractGoo.Event1"), + // (12,41): error CS0533: 'Goo.Event2' hides inherited abstract member 'AbstractGoo.Event2' // public abstract event System.Action Event2 { add { } remove { } } - Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event2").WithArguments("Foo.Event2", "AbstractFoo.Event2"), - // (12,41): warning CS0114: 'Foo.Event2' hides inherited member 'AbstractFoo.Event2'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. + Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event2").WithArguments("Goo.Event2", "AbstractGoo.Event2"), + // (12,41): warning CS0114: 'Goo.Event2' hides inherited member 'AbstractGoo.Event2'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. // public abstract event System.Action Event2 { add { } remove { } } - Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event2").WithArguments("Foo.Event2", "AbstractFoo.Event2"), - // (13,40): error CS0533: 'Foo.Event3' hides inherited abstract member 'AbstractFoo.Event3' + Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event2").WithArguments("Goo.Event2", "AbstractGoo.Event2"), + // (13,40): error CS0533: 'Goo.Event3' hides inherited abstract member 'AbstractGoo.Event3' // public virtual event System.Action Event3 { add { } remove { } } - Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event3").WithArguments("Foo.Event3", "AbstractFoo.Event3"), - // (13,40): warning CS0114: 'Foo.Event3' hides inherited member 'AbstractFoo.Event3'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. + Diagnostic(ErrorCode.ERR_HidingAbstractMethod, "Event3").WithArguments("Goo.Event3", "AbstractGoo.Event3"), + // (13,40): warning CS0114: 'Goo.Event3' hides inherited member 'AbstractGoo.Event3'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. // public virtual event System.Action Event3 { add { } remove { } } - Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event3").WithArguments("Foo.Event3", "AbstractFoo.Event3")); + Diagnostic(ErrorCode.WRN_NewOrOverrideExpected, "Event3").WithArguments("Goo.Event3", "AbstractGoo.Event3")); } [Fact] @@ -1985,20 +1985,20 @@ public override event System.Action Event2 { add { } remove { } } public void TestDoNotChangeGenericMethodReturnType() { var text = @" -interface IFoo +interface IGoo { } class Base { public virtual T Method1(T t) { return t; } - public virtual IFoo Method2(U u) { return null; } + public virtual IGoo Method2(U u) { return null; } } class Derived : Base { public override M Method1(M t) { return t; } - public override IFoo Method2(X u) { return null; } + public override IGoo Method2(X u) { return null; } } "; CompileAndVerifyDiagnostics(text, new ErrorDescription[] { diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/InteractiveSemanticModelTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/InteractiveSemanticModelTests.cs index e185f64e1c21b..f21095064c3f9 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/InteractiveSemanticModelTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/InteractiveSemanticModelTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -18,17 +18,17 @@ public partial class SemanticModelTests : CSharpTestBase public void NamespaceBindingInInteractiveCode() { var compilation = CreateStandardCompilation(@" -using Z = Foo.Bar.Script.C; +using Z = Goo.Bar.Script.C; class C { } -namespace Foo.Bar +namespace Goo.Bar { class B : Z { } } ", parseOptions: TestOptions.Script, - options: TestOptions.ReleaseExe.WithScriptClassName("Foo.Bar.Script") + options: TestOptions.ReleaseExe.WithScriptClassName("Goo.Bar.Script") ); var tree = compilation.SyntaxTrees[0]; @@ -47,10 +47,10 @@ public void CompilationChain_OverloadsWithParams() { CompileAndVerifyBindInfo(@" public static string[] str = null; -public static void Foo(string[] r, string i) { str = r;} -public static void Foo(params string[] r) { str = r;} -/**/ Foo(""1"", ""2"") /**/;", -"Foo(params string[])"); +public static void Goo(string[] r, string i) { str = r;} +public static void Goo(params string[] r) { str = r;} +/**/ Goo(""1"", ""2"") /**/;", +"Goo(params string[])"); } [Fact] @@ -71,8 +71,8 @@ class InnerClass public void MethodCallBinding() { var testSrc = @" -void Foo() {}; -/**/Foo()/**/; +void Goo() {}; +/**/Goo()/**/; "; // Get the bind info for the text identified within the commented tags var bindInfo = GetBindInfoForTest(testSrc); @@ -255,7 +255,7 @@ public void BindQueryVariable() string testSrc = @" using System.Linq; -var x = from c in ""foo"" select /**/c/**/"; +var x = from c in ""goo"" select /**/c/**/"; // Get the bind info for the text identified within the commented tags var semanticInfo = GetBindInfoForTest(testSrc); Assert.Equal("c", semanticInfo.Symbol.Name); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs index a71a59e9c6939..d0b076718b5a3 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LambdaTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; @@ -233,18 +233,18 @@ interface I : IComparable> { } class C { - static void Foo(Func> x) { } - static void Foo(Func x) {} + static void Goo(Func> x) { } + static void Goo(Func x) {} static void M() { - Foo(() => null); + Goo(() => null); } } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (12,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(Func>)' and 'C.Foo(Func)' - // Foo(() => null); - Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("C.Foo(System.Func>)", "C.Foo(System.Func)").WithLocation(12, 9)); + // (12,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Goo(Func>)' and 'C.Goo(Func)' + // Goo(() => null); + Diagnostic(ErrorCode.ERR_AmbigCall, "Goo").WithArguments("C.Goo(System.Func>)", "C.Goo(System.Func)").WithLocation(12, 9)); } [WorkItem(539976, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539976")] @@ -276,8 +276,8 @@ public void MissingReferenceInOverloadResolution() using System; public static class A { - public static void Foo(Func func) { } - public static void Foo(Func func) { } + public static void Goo(Func func) { } + public static void Goo(Func func) { } } public class B @@ -305,7 +305,7 @@ class Program { static void Main() { - A.Foo(x => x.GetUrl()); + A.Goo(x => x.GetUrl()); } } "; @@ -328,11 +328,11 @@ public void OverloadResolutionWithEmbeddedInteropType() public static class A { - public static void Foo(Func func) + public static void Goo(Func func) { System.Console.WriteLine(""X""); } - public static void Foo(Func func) + public static void Goo(Func func) { System.Console.WriteLine(""Y""); } @@ -352,7 +352,7 @@ public class Program { public static void Main() { - A.Foo(() => delegate { }); + A.Goo(() => delegate { }); } } "; @@ -427,9 +427,9 @@ End Namespace Public Module M - Sub Foo(x as Action(Of String)) + Sub Goo(x as Action(Of String)) End Sub - Sub Foo(x as Action(Of GC)) + Sub Goo(x as Action(Of GC)) End Sub End Module "; @@ -444,7 +444,7 @@ class Program { static void Main() { - M.Foo(x => { }); + M.Goo(x => { }); } } "; @@ -788,11 +788,11 @@ class Program { static void Main() { - Foo(() => () => { var x = (IEnumerable)null; return x; }); + Goo(() => () => { var x = (IEnumerable)null; return x; }); } - static void Foo(Func> x) { } - static void Foo(Func> x) { } + static void Goo(Func> x) { } + static void Goo(Func> x) { } } "; var compilation = CreateStandardCompilation(source); @@ -804,7 +804,7 @@ static void Foo(Func> x) { } // Used to throw a NRE because of the ExpressionSyntax's null SyntaxTree. model.GetSpeculativeSymbolInfo( invocation.SpanStart, - SyntaxFactory.ParseExpression("Foo(() => () => { var x = null; return x; })"), // cast removed + SyntaxFactory.ParseExpression("Goo(() => () => { var x = null; return x; })"), // cast removed SpeculativeBindingOption.BindAsExpression); } @@ -1290,11 +1290,11 @@ class Program static void Main() { ICloneable c = """"; - Foo(() => (c.Clone()), null); + Goo(() => (c.Clone()), null); } - static void Foo(Action x, string y) { } - static void Foo(Func x, object y) { Console.WriteLine(42); } + static void Goo(Action x, string y) { } + static void Goo(Func x, object y) { Console.WriteLine(42); } }", options: TestOptions.ReleaseExe); comp.VerifyDiagnostics(); @@ -2007,7 +2007,7 @@ class Program static void Main(string[] args) { var z = args.Select(a => a. - var foo = + var goo = } }"; var compilation = CreateCompilationWithMscorlibAndSystemCore(source); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs index f096d6b3ad759..0df385f59d2d2 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -1592,7 +1592,7 @@ void Local() Console.Write(x); } Label: - Action foo = Local; + Action goo = Local; } static void Main(string[] args) { @@ -1604,7 +1604,7 @@ static void Main(string[] args) // int x = 2; Diagnostic(ErrorCode.WRN_UnreachableCode, "int").WithLocation(9, 9), // (15,22): error CS0165: Use of unassigned local variable 'x' - // Action foo = Local; + // Action goo = Local; Diagnostic(ErrorCode.ERR_UseDefViolation, "Local").WithArguments("x").WithLocation(15, 22) ); } @@ -2152,7 +2152,7 @@ class Program { static void Main(string[] args) { - int Foo + int Goo { get { @@ -2165,7 +2165,7 @@ int Foo "; VerifyDiagnostics(source, // (6,16): error CS1002: ; expected - // int Foo + // int Goo Diagnostic(ErrorCode.ERR_SemicolonExpected, "").WithLocation(6, 16), // (8,16): error CS1002: ; expected // get @@ -2188,9 +2188,9 @@ int Foo // (13,9): warning CS0162: Unreachable code detected // int Bar => 2; Diagnostic(ErrorCode.WRN_UnreachableCode, "int").WithLocation(13, 9), - // (6,13): warning CS0168: The variable 'Foo' is declared but never used - // int Foo - Diagnostic(ErrorCode.WRN_UnreferencedVar, "Foo").WithArguments("Foo").WithLocation(6, 13), + // (6,13): warning CS0168: The variable 'Goo' is declared but never used + // int Goo + Diagnostic(ErrorCode.WRN_UnreferencedVar, "Goo").WithArguments("Goo").WithLocation(6, 13), // (13,13): warning CS0168: The variable 'Bar' is declared but never used // int Bar => 2; Diagnostic(ErrorCode.WRN_UnreferencedVar, "Bar").WithArguments("Bar").WithLocation(13, 13) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LockTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LockTests.cs index f7671d95af8b3..993b7ee2e7052 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LockTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LockTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -245,7 +245,7 @@ public void RequireRefType_Nullable() var source = @" class C { - public void foo() + public void goo() { int? a = null; lock (a) @@ -433,7 +433,7 @@ public void MalformedLock_1() var source = @" class D { - public void foo() + public void goo() { lock (varnew object) { diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LookupTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LookupTests.cs index 32804964bae37..483f07f6d1959 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LookupTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LookupTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -656,14 +656,14 @@ public void LookupProtectedInBase() class A { private void Hidden() { } - protected void Foo() { } + protected void Goo() { } } class B : A { void Bar() { - /**/base/**/.Foo(); + /**/base/**/.Goo(); } } "; @@ -688,10 +688,10 @@ void Bar() Assert.Equal("A", baseExprType.Name); var symbols = model.LookupBaseMembers(baseExprLocation); - Assert.Equal("void A.Foo()", symbols.Single().ToTestDisplayString()); + Assert.Equal("void A.Goo()", symbols.Single().ToTestDisplayString()); var names = model.LookupNames(baseExprLocation, useBaseReferenceAccessibility: true); - Assert.Equal("Foo", names.Single()); + Assert.Equal("Goo", names.Single()); } [WorkItem(528263, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/528263")] @@ -1741,7 +1741,7 @@ public void Bug1078958() const string source = @" class C { - static void Foo() + static void Goo() { /**/T/**/(); } @@ -1760,14 +1760,14 @@ public void Bug1078961() class C { const int T = 42; - static void Foo(int x = /**/T/**/) + static void Goo(int x = /**/T/**/) { System.Console.Write(x); } static void Main() { - Foo(); + Goo(); } }"; @@ -1788,7 +1788,7 @@ class C { const int T = 42; - static void Foo([A(/**/T/**/)] int x) + static void Goo([A(/**/T/**/)] int x) { } }"; @@ -1811,7 +1811,7 @@ class C const int T = 42; [A(/**/T/**/)] - static void Foo(int x) + static void Goo(int x) { } }"; @@ -1833,7 +1833,7 @@ class C { const int T = 42; - static void Foo<[A(/**/T/**/)] T>(int x) + static void Goo<[A(/**/T/**/)] T>(int x) { } }"; @@ -1850,14 +1850,14 @@ class C { class T { } - static void Foo(T x = default(/**/T/**/)) + static void Goo(T x = default(/**/T/**/)) { System.Console.Write((object)x == null); } static void Main() { - Foo(); + Goo(); } }"; @@ -1873,14 +1873,14 @@ class C { class T { } - static void Foo(T x = default(/**/T/**/)) + static void Goo(T x = default(/**/T/**/)) { System.Console.Write((object)x == null); } static void Main() { - Foo(); + Goo(); } }"; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/MethodBodyModelTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/MethodBodyModelTests.cs index e20f4ea4f99d8..f848234e07391 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/MethodBodyModelTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/MethodBodyModelTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -25,7 +25,7 @@ public void BindAliasWithSameNameClass() namespace A { - class Foo { } + class Goo { } } namespace B @@ -34,14 +34,14 @@ class Test { class NSA { - public NSA(int Foo) { this.Foo = Foo; } - int Foo; + public NSA(int Goo) { this.Goo = Goo; } + int Goo; } static int Main() { - NSA::Foo foo = new NSA::Foo(); // shouldn't error here - if (foo == null) {} + NSA::Goo goo = new NSA::Goo(); // shouldn't error here + if (goo == null) {} return 0; } } @@ -86,9 +86,9 @@ class Program static void Main() { uint ui = 2; - foo(ui + 2); + goo(ui + 2); } - static void foo(uint x) + static void goo(uint x) { } }"; @@ -107,11 +107,11 @@ class Program { static void Main() { - object x = foo(); + object x = goo(); if (x == null) {} - Console.WriteLine(foo()); + Console.WriteLine(goo()); } - static void foo() + static void goo() { } }"; @@ -537,12 +537,12 @@ public void PropertyAmbiguity() var text = @" interface IA { - int Foo { get; } + int Goo { get; } } interface IB { - int Foo { get; } + int Goo { get; } } interface IC : IA, IB { } @@ -552,16 +552,16 @@ class C static void Main() { IC x = null; - int y = x.Foo; + int y = x.Goo; } } "; var tree = Parse(text); var comp = CreateStandardCompilation(tree); comp.VerifyDiagnostics( - // (19,19): error CS0229: Ambiguity between 'IA.Foo' and 'IB.Foo' - // int y = x.Foo; - Diagnostic(ErrorCode.ERR_AmbigMember, "Foo").WithArguments("IA.Foo", "IB.Foo"), + // (19,19): error CS0229: Ambiguity between 'IA.Goo' and 'IB.Goo' + // int y = x.Goo; + Diagnostic(ErrorCode.ERR_AmbigMember, "Goo").WithArguments("IA.Goo", "IB.Goo"), // (18,12): warning CS0219: The variable 'x' is assigned but its value is never used // IC x = null; Diagnostic(ErrorCode.WRN_UnreferencedVarAssg, "x").WithArguments("x") @@ -653,7 +653,7 @@ public static void T() { } class A : B { - static void Foo() + static void Goo() { T(); } @@ -963,7 +963,7 @@ public void CastAmbiguousMethodGroupTypeProducesCorrectErrorMessage() var text = @" using System; -public delegate void Foo (); +public delegate void Goo (); class D { @@ -972,7 +972,7 @@ public static implicit operator D (Action d) return new D (); } - public static explicit operator D (Foo d) + public static explicit operator D (Goo d) { return new D (); } @@ -989,9 +989,9 @@ static void Main() var tree = Parse(text); var comp = CreateStandardCompilation(tree); comp.GetMethodBodyDiagnostics().Verify( - // (23,15): error CS0457: Ambiguous user defined conversions 'D.explicit operator D(Foo)' and 'D.implicit operator D(Action)' when converting from 'method group' to 'D' + // (23,15): error CS0457: Ambiguous user defined conversions 'D.explicit operator D(Goo)' and 'D.implicit operator D(Action)' when converting from 'method group' to 'D' // D d = (D) Main; - Diagnostic(ErrorCode.ERR_AmbigUDConv, "(D) Main").WithArguments("D.explicit operator D(Foo)", "D.implicit operator D(System.Action)", "method group", "D").WithLocation(23, 15) + Diagnostic(ErrorCode.ERR_AmbigUDConv, "(D) Main").WithArguments("D.explicit operator D(Goo)", "D.implicit operator D(System.Action)", "method group", "D").WithLocation(23, 15) ); } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/MethodTypeInferenceTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/MethodTypeInferenceTests.cs index 9660a5baf1f71..25ec7934d5717 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/MethodTypeInferenceTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/MethodTypeInferenceTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -494,18 +494,18 @@ class C static void Main() { dynamic d = null; - Foo(ref d); + Goo(ref d); } - static void Foo(ref T[] x) + static void Goo(ref T[] x) { } } "; CreateCompilationWithMscorlibAndSystemCore(source, new[] { CSharpRef }).VerifyEmitDiagnostics( - // (7,9): error CS0411: The type arguments for method 'C.Foo(ref T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly. - // Foo(ref d); - Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Foo").WithArguments("C.Foo(ref T[])")); + // (7,9): error CS0411: The type arguments for method 'C.Goo(ref T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly. + // Goo(ref d); + Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Goo").WithArguments("C.Goo(ref T[])")); } [WorkItem(541810, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541810")] @@ -516,7 +516,7 @@ public void TestMethodTypeInferenceWhenFixedParameterIsOpenGenericType() using System.Collections.Generic; class Test { - static void Foo(V x) + static void Goo(V x) { I i = null; var y = new List(); @@ -524,7 +524,7 @@ static void Foo(V x) } static void Main() { - Foo(1); + Goo(1); } interface I { @@ -549,15 +549,15 @@ static void Main() public static void Run(T t, U u) { I i = new Outer(); - i.Foo(u, new List()); + i.Goo(u, new List()); } interface I { - void Foo(A a, List y); + void Goo(A a, List y); } class Outer : I

{ - void I

.Foo(P p, List y) + void I

.Goo(P p, List y) { } } @@ -614,18 +614,18 @@ class Program { static void Main(string[] args) { - var s = Foo<>(123, 345); + var s = Goo<>(123, 345); } - public static int Foo(T t, U u) + public static int Goo(T t, U u) { return 1; } } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (6,17): error CS0305: Using the generic method 'Program.Foo(T, U)' requires 2 type arguments - // var s = Foo<>(123, 345); - Diagnostic(ErrorCode.ERR_BadArity, "Foo<>").WithArguments("Program.Foo(T, U)", "method", "2")); + // (6,17): error CS0305: Using the generic method 'Program.Goo(T, U)' requires 2 type arguments + // var s = Goo<>(123, 345); + Diagnostic(ErrorCode.ERR_BadArity, "Goo<>").WithArguments("Program.Goo(T, U)", "method", "2")); } [WorkItem(541887, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/541887")] @@ -640,9 +640,9 @@ class Program { static void Main(string[] args) { - var s = Foo(123, 345); + var s = Goo(123, 345); } - public static int Foo(T t, U u) + public static int Goo(T t, U u) { return 1; } @@ -650,13 +650,13 @@ public static int Foo(T t, U u) "; CreateStandardCompilation(source).VerifyDiagnostics( // (6,26): error CS1031: Type expected - // var s = Foo(123, 345); + // var s = Goo(123, 345); Diagnostic(ErrorCode.ERR_TypeExpected, ">"), // CONSIDER: we would prefer not to report this cascading diagnostic. // (6,33): error CS1503: Argument 2: cannot convert from 'int' to '?' - // var s = Foo(123, 345); + // var s = Goo(123, 345); Diagnostic(ErrorCode.ERR_BadArgType, "345").WithArguments("2", "int", "?")); } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NameCollisionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NameCollisionTests.cs index 857647f33b54b..fcc753523f102 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NameCollisionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NameCollisionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Roslyn.Test.Utilities; using Xunit; @@ -391,19 +391,19 @@ public void TestCollisionOfDelegateWithConst() var source = @"class A { delegate void D(); - static void Foo() { } + static void Goo() { } class B { - const int Foo = 123; + const int Goo = 123; static void Main() { - Foo(); - Bar(Foo); + Goo(); + Bar(Goo); } static void Main2() { - Bar(Foo); - Foo(); + Bar(Goo); + Goo(); } static void Bar(int x) { } static void Bar(D x) { } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NameLengthTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NameLengthTests.cs index 3faf45b9ebe6c..30711463487c7 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NameLengthTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NameLengthTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -282,25 +282,25 @@ public void DllImport() class C1 {{ - [DllImport(""foo.dll"", EntryPoint = ""Short1"")] + [DllImport(""goo.dll"", EntryPoint = ""Short1"")] static extern void {0}(); // Name is fine, entrypoint is fine. - [DllImport(""foo.dll"", EntryPoint = ""Short2"")] + [DllImport(""goo.dll"", EntryPoint = ""Short2"")] static extern void {0}1(); // Name is too long, entrypoint is fine. }} class C2 {{ - [DllImport(""foo.dll"", EntryPoint = ""{0}"")] + [DllImport(""goo.dll"", EntryPoint = ""{0}"")] static extern void Short1(); // Name is fine, entrypoint is fine. - [DllImport(""foo.dll"", EntryPoint = ""{0}1"")] + [DllImport(""goo.dll"", EntryPoint = ""{0}1"")] static extern void Short2(); // Name is fine, entrypoint is too long. }} class C3 {{ - [DllImport(""foo.dll"")] + [DllImport(""goo.dll"")] static extern void {0}(); // Name is fine, entrypoint is unspecified. - [DllImport(""foo.dll"")] + [DllImport(""goo.dll"")] static extern void {0}1(); // Name is too long, entrypoint is unspecified. }} "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NameOfTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NameOfTests.cs index 6f69a5c5a0cd5..01637eb1d934a 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NameOfTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NameOfTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -695,8 +695,8 @@ public void SymbolInfoForMethodGroup01() var source = @"public class SomeClass { - public const string FooName = nameof(SomeClass.Foo); - public static int Foo() + public const string GooName = nameof(SomeClass.Goo); + public static int Goo() { return 1; } @@ -704,10 +704,10 @@ public static int Foo() var compilation = CreateStandardCompilation(source); var tree = compilation.SyntaxTrees[0]; var model = compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Foo").OfType().First(); + var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType().First(); var symbolInfo = model.GetSymbolInfo(node, default(CancellationToken)); Assert.Equal(CandidateReason.MemberGroup, symbolInfo.CandidateReason); - Assert.Equal("Foo", symbolInfo.CandidateSymbols[0].Name); + Assert.Equal("Goo", symbolInfo.CandidateSymbols[0].Name); } [Fact] @@ -717,12 +717,12 @@ public void SymbolInfoForMethodGroup02() var source = @"public class SomeClass { - public const string FooName = nameof(SomeClass.Foo); - public static int Foo() + public const string GooName = nameof(SomeClass.Goo); + public static int Goo() { return 1; } - public static string Foo() + public static string Goo() { return string.Empty; } @@ -730,7 +730,7 @@ public static string Foo() var compilation = CreateStandardCompilation(source); var tree = compilation.SyntaxTrees[0]; var model = compilation.GetSemanticModel(tree); - var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Foo").OfType().First(); + var node = tree.GetRoot().DescendantNodes().Where(n => n.ToString() == "SomeClass.Goo").OfType().First(); var symbolInfo = model.GetSymbolInfo(node, default(CancellationToken)); Assert.Equal(CandidateReason.MemberGroup, symbolInfo.CandidateReason); Assert.Equal(2, symbolInfo.CandidateSymbols.Length); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NamedAndOptionalTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NamedAndOptionalTests.cs index 3ab84541c32fd..3b574ac83c447 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NamedAndOptionalTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NamedAndOptionalTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -55,18 +55,18 @@ public void Test13861() class Program { - public static void Foo1([Optional][DecimalConstant(0, 0, low: (uint)100, mid: (uint)0, hi: (uint)0)] decimal i) + public static void Goo1([Optional][DecimalConstant(0, 0, low: (uint)100, mid: (uint)0, hi: (uint)0)] decimal i) { System.Console.Write(i); } - public static void Foo2([Optional][DecimalConstant(0, 0, 0, 0, 200)] decimal i) + public static void Goo2([Optional][DecimalConstant(0, 0, 0, 0, 200)] decimal i) { System.Console.Write(i); } static void Main(string[] args) { - Foo1(); - Foo2(); + Goo1(); + Goo2(); } }"; string expected = "100200"; @@ -131,7 +131,7 @@ public void TestNamedAndOptionalParamsErrors() class Base { - public virtual void Foo(int reqParam1, + public virtual void Goo(int reqParam1, int optParam1 = 0, int optParam2 = default(int), int optParam3 = new int(), @@ -144,7 +144,7 @@ public virtual void Foo(int reqParam1, class Middle : Base { //override and change the parameters names - public override void Foo(int reqChParam1, + public override void Goo(int reqChParam1, int optChParam1 = 0, int optChParam2 = default(int), int optChParam3 = new int(), @@ -162,22 +162,22 @@ public void M() { var c = new C(); // calling child class parameters with base names - // error CS1739: The best overload for 'Foo' does not have a parameter named 'optParam3' - c.Foo(optParam3: 333, reqParam1: 111 , optParam2: 222, optParam1: 1111); + // error CS1739: The best overload for 'Goo' does not have a parameter named 'optParam3' + c.Goo(optParam3: 333, reqParam1: 111 , optParam2: 222, optParam1: 1111); // error CS1738: Named argument specifications must appear after all fixed arguments have been specified - c.Foo(optArg1: 3333, 11111); + c.Goo(optArg1: 3333, 11111); } }"; CreateStandardCompilation(source).VerifyDiagnostics( - // (37,15): error CS1739: The best overload for 'Foo' does not have a parameter named 'optParam3' - // c.Foo(optParam3: 333, reqParam1: 111 , optParam2: 222, optParam1: 1111); - Diagnostic(ErrorCode.ERR_BadNamedArgument, "optParam3").WithArguments("Foo", "optParam3").WithLocation(37, 15), + // (37,15): error CS1739: The best overload for 'Goo' does not have a parameter named 'optParam3' + // c.Goo(optParam3: 333, reqParam1: 111 , optParam2: 222, optParam1: 1111); + Diagnostic(ErrorCode.ERR_BadNamedArgument, "optParam3").WithArguments("Goo", "optParam3").WithLocation(37, 15), // (39,30): error CS1738: Named argument specifications must appear after all fixed arguments have been specified - // c.Foo(optArg1: 3333, 11111); + // c.Goo(optArg1: 3333, 11111); Diagnostic(ErrorCode.ERR_NamedArgumentSpecificationBeforeFixedArgument, "11111").WithLocation(39, 30), - // (39,15): error CS1739: The best overload for 'Foo' does not have a parameter named 'optArg1' - // c.Foo(optArg1: 3333, 11111); - Diagnostic(ErrorCode.ERR_BadNamedArgument, "optArg1").WithArguments("Foo", "optArg1").WithLocation(39, 15) + // (39,15): error CS1739: The best overload for 'Goo' does not have a parameter named 'optArg1' + // c.Goo(optArg1: 3333, 11111); + Diagnostic(ErrorCode.ERR_BadNamedArgument, "optArg1").WithArguments("Goo", "optArg1").WithLocation(39, 15) ); } @@ -649,7 +649,7 @@ class D { public int this[string s = ""four""] { get { return s.Length; } set { } } public int this[int x = 2, int y = 5] { get { return x + y; } set { } } - public int this[string str = ""foo"", int i = 13] + public int this[string str = ""goo"", int i = 13] { get { Console.WriteLine(""D.this[str: '{0}', i: {1}].get"", str, i); return i;} set { Console.WriteLine(""D.this[str: '{0}', i: {1}].set"", str, i); } @@ -686,7 +686,7 @@ static void Main() 5 3 5 -D.this[str: 'foo', i: 1].set +D.this[str: 'goo', i: 1].set D.this[str: 'bar', i: 13].set D.this[str: 'baz', i: 2].set D.this[str: 'bah', i: 3].set"; @@ -878,7 +878,7 @@ public void GenericOptionalParameters() var source = @"class C { - static void Foo(T t = default(T)) {} + static void Goo(T t = default(T)) {} }"; CreateStandardCompilation(source).VerifyDiagnostics(); } @@ -891,7 +891,7 @@ public void OptionalValueTypeFromReferencedAssembly() // public struct S{} // public class C // { - // public static void Foo(string s, S t = default(S)) {} + // public static void Goo(string s, S t = default(S)) {} // } string ilSource = @" // =============== CLASS MEMBERS DECLARATION =================== @@ -906,7 +906,7 @@ .size 1 .class public auto ansi beforefieldinit C extends [mscorlib]System.Object { - .method public hidebysig static void Foo(string s, + .method public hidebysig static void Goo(string s, [opt] valuetype S t) cil managed { .param [2] = nullref @@ -914,7 +914,7 @@ .method public hidebysig static void Foo(string s, .maxstack 8 IL_0000: nop IL_0001: ret - } // end of method C::Foo + } // end of method C::Goo } // end of class C "; @@ -925,7 +925,7 @@ public class D { public static void Caller() { - C.Foo(""""); + C.Goo(""""); } }"; @@ -940,7 +940,7 @@ public void OptionalParameterDeclaredWithAttributes() using System.Runtime.InteropServices; public class Parent{ - public int Foo([Optional]object i = null) { + public int Goo([Optional]object i = null) { return 1; } @@ -952,7 +952,7 @@ public int Bar([DefaultParameterValue(1)]int i = 2) { class Test{ public static int Main(){ Parent p = new Parent(); - return p.Foo(); + return p.Goo(); } } "; @@ -964,7 +964,7 @@ public static int Main(){ // public int Bar([DefaultParameterValue(1)]int i = 2) { Diagnostic(ErrorCode.ERR_ParamDefaultValueDiffersFromAttribute, "2").WithLocation(9, 54), // (5,21): error CS1745: Cannot specify default parameter value in conjunction with DefaultParameterAttribute or OptionalAttribute - // public int Foo([Optional]object i = null) { + // public int Goo([Optional]object i = null) { Diagnostic(ErrorCode.ERR_DefaultValueUsedWithAttributes, "Optional").WithLocation(5, 21) ); } @@ -990,25 +990,25 @@ public static void Main() [Fact] public void RefParameterDeclaredWithOptionalAttribute() { - // The native compiler produces "CS1501: No overload for method 'Foo' takes 0 arguments." + // The native compiler produces "CS1501: No overload for method 'Goo' takes 0 arguments." // Roslyn produces a slightly more informative error message. string source = @" using System.Runtime.InteropServices; public class Parent { - public static void Foo([Optional] ref int x) {} + public static void Goo([Optional] ref int x) {} static void Main() { - Foo(); + Goo(); } } "; var comp = CreateStandardCompilation(source, new[] { SystemRef }); comp.VerifyDiagnostics( - // (8,10): error CS7036: There is no argument given that corresponds to the required formal parameter 'x' of 'Parent.Foo(ref int)' - // Foo(); - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Foo").WithArguments("x", "Parent.Foo(ref int)")); + // (8,10): error CS7036: There is no argument given that corresponds to the required formal parameter 'x' of 'Parent.Goo(ref int)' + // Goo(); + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "Goo").WithArguments("x", "Parent.Goo(ref int)")); } [Fact, WorkItem(544491, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544491")] @@ -1546,7 +1546,7 @@ public enum E public class C { - public void Foo( + public void Goo( [Optional][DateTimeConstant(100000)]DateTime dateTime, decimal dec = 12345678901234567890m, int? x = 0, @@ -1621,7 +1621,7 @@ static void Main() = System.Globalization.CultureInfo.InvariantCulture; C c = new C(); - c.Foo(); + c.Goo(); c.Baz(); } } @@ -1667,7 +1667,7 @@ .locals init (int? V_0, IL_0040: ldloca.s V_1 IL_0042: initobj ""S?"" IL_0048: ldloc.1 - IL_0049: callvirt ""void C.Foo(System.DateTime, decimal, int?, int?, short, int, S?)"" + IL_0049: callvirt ""void C.Goo(System.DateTime, decimal, int?, int?, short, int, S?)"" IL_004e: ldc.i4.0 IL_004f: newobj ""E?..ctor(E)"" IL_0054: ldc.i4.0 diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableTests.cs index 1acad855faa2f..58e48dea0648c 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -1739,13 +1739,13 @@ public void ConflictImportedMethodWithNullableOptionalParam() string source = @" public class Parent { - public int Foo(int? d = 0) { return (int)d; } + public int Goo(int? d = 0) { return (int)d; } } "; string source2 = @" public class Parent { - public int Foo(int? d = 0) { return (int)d; } + public int Goo(int? d = 0) { return (int)d; } } public class Test @@ -1753,7 +1753,7 @@ public class Test public static void Main() { Parent p = new Parent(); - System.Console.Write(p.Foo(0)); + System.Console.Write(p.Goo(0)); } } "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs index 8a48f3f3c50fb..e6dd2d5838761 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ObjectAndCollectionInitializerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -64,13 +64,13 @@ public Base() {} public int y { get; set; } public static void Main() { - MemberInitializerTest.Foo(); + MemberInitializerTest.Goo(); } } public class MemberInitializerTest where T: Base, new() { - public static void Foo() + public static void Goo() { var i = new T() { x = 0, y = 0 }; } @@ -803,10 +803,10 @@ public void CS0246_ERR_SingleTypeNameNotFound_02() var source = @" static class Ext { - static int Width(this Foo f) { return 0; } + static int Width(this Goo f) { return 0; } } -class Foo +class Goo { void M() { @@ -903,20 +903,20 @@ public void CS0747_ERR_InvalidInitializerElementInitializer_MethodCall() public class MemberInitializerTest { public int x; - public MemberInitializerTest Foo() { return new MemberInitializerTest(); } + public MemberInitializerTest Goo() { return new MemberInitializerTest(); } public static void Main() { - var i = new MemberInitializerTest() { x = 0, Foo() = new MemberInitializerTest() }; + var i = new MemberInitializerTest() { x = 0, Goo() = new MemberInitializerTest() }; } } "; CreateStandardCompilation(source).VerifyDiagnostics( // (8,54): error CS0747: Invalid initializer member declarator - // var i = new MemberInitializerTest() { x = 0, Foo() = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Foo() = new MemberInitializerTest()").WithLocation(8, 54), - // (8,54): error CS0120: An object reference is required for the non-static field, method, or property 'MemberInitializerTest.Foo()' - // var i = new MemberInitializerTest() { x = 0, Foo() = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_ObjectRequired, "Foo").WithArguments("MemberInitializerTest.Foo()").WithLocation(8, 54)); + // var i = new MemberInitializerTest() { x = 0, Goo() = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Goo() = new MemberInitializerTest()").WithLocation(8, 54), + // (8,54): error CS0120: An object reference is required for the non-static field, method, or property 'MemberInitializerTest.Goo()' + // var i = new MemberInitializerTest() { x = 0, Goo() = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_ObjectRequired, "Goo").WithArguments("MemberInitializerTest.Goo()").WithLocation(8, 54)); } [Fact] @@ -927,18 +927,18 @@ public void CS0747_ERR_InvalidInitializerElementInitializer_AssignmentExpression public class MemberInitializerTest { public int x; - static MemberInitializerTest Foo() { return new MemberInitializerTest(); } + static MemberInitializerTest Goo() { return new MemberInitializerTest(); } public static void Main() { - var i = new List { 1, Foo().x = 1}; + var i = new List { 1, Goo().x = 1}; } } "; CreateStandardCompilation(source).VerifyDiagnostics( // (10,36): error CS0747: Invalid initializer member declarator - // var i = new List { 1, Foo().x = 1}; - Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Foo().x = 1").WithLocation(10, 36)); + // var i = new List { 1, Goo().x = 1}; + Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Goo().x = 1").WithLocation(10, 36)); } [Fact] @@ -966,17 +966,17 @@ public void CS1913ERR_MemberCannotBeInitialized() var source = @" public class MemberInitializerTest { - public MemberInitializerTest Foo() { return new MemberInitializerTest(); } + public MemberInitializerTest Goo() { return new MemberInitializerTest(); } public static void Main() { - var i = new MemberInitializerTest() { Foo = new MemberInitializerTest() }; + var i = new MemberInitializerTest() { Goo = new MemberInitializerTest() }; } } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (7,47): error CS1913: Member 'Foo' cannot be initialized. It is not a field or property. - // var i = new MemberInitializerTest() { Foo = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_MemberCannotBeInitialized, "Foo").WithArguments("Foo").WithLocation(7, 47)); + // (7,47): error CS1913: Member 'Goo' cannot be initialized. It is not a field or property. + // var i = new MemberInitializerTest() { Goo = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_MemberCannotBeInitialized, "Goo").WithArguments("Goo").WithLocation(7, 47)); } [Fact] @@ -1227,23 +1227,23 @@ public void CS1922ERR_CollectionInitRequiresIEnumerable_MethodCall() var source = @" public class MemberInitializerTest { - public MemberInitializerTest Foo() { return new MemberInitializerTest(); } + public MemberInitializerTest Goo() { return new MemberInitializerTest(); } public static void Main() { - var i = new MemberInitializerTest() { Foo() = new MemberInitializerTest() }; + var i = new MemberInitializerTest() { Goo() = new MemberInitializerTest() }; } } "; CreateStandardCompilation(source).VerifyDiagnostics( // (7,45): error CS1922: Cannot initialize type 'MemberInitializerTest' with a collection initializer because it does not implement 'System.Collections.IEnumerable' - // var i = new MemberInitializerTest() { Foo() = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_CollectionInitRequiresIEnumerable, "{ Foo() = new MemberInitializerTest() }").WithArguments("MemberInitializerTest").WithLocation(7, 45), + // var i = new MemberInitializerTest() { Goo() = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_CollectionInitRequiresIEnumerable, "{ Goo() = new MemberInitializerTest() }").WithArguments("MemberInitializerTest").WithLocation(7, 45), // (7,47): error CS0747: Invalid initializer member declarator - // var i = new MemberInitializerTest() { Foo() = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Foo() = new MemberInitializerTest()").WithLocation(7, 47), - // (7,47): error CS0120: An object reference is required for the non-static field, method, or property 'MemberInitializerTest.Foo()' - // var i = new MemberInitializerTest() { Foo() = new MemberInitializerTest() }; - Diagnostic(ErrorCode.ERR_ObjectRequired, "Foo").WithArguments("MemberInitializerTest.Foo()").WithLocation(7, 47)); + // var i = new MemberInitializerTest() { Goo() = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_InvalidInitializerElementInitializer, "Goo() = new MemberInitializerTest()").WithLocation(7, 47), + // (7,47): error CS0120: An object reference is required for the non-static field, method, or property 'MemberInitializerTest.Goo()' + // var i = new MemberInitializerTest() { Goo() = new MemberInitializerTest() }; + Diagnostic(ErrorCode.ERR_ObjectRequired, "Goo").WithArguments("MemberInitializerTest.Goo()").WithLocation(7, 47)); } [Fact] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/OperatorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/OperatorTests.cs index dc5a4585788a7..6199cbc67478c 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/OperatorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/OperatorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -30,7 +30,7 @@ internal enum TestEnum AllProperties = FilePath | Visibility } class C { - public void Foo(){ + public void Goo(){ var x = TestEnum.FilePath | TestEnum.Visibility; } } @@ -838,18 +838,18 @@ class Program static void Main() { Action a = null; - Foo(c => c == a); + Goo(c => c == a); } - static void Foo(Func, IComparable> x) { } - static void Foo(Func, IConvertible> x) { } + static void Goo(Func, IComparable> x) { } + static void Goo(Func, IConvertible> x) { } } "; - // Dev11 considers Action == Action ambiguous and thus chooses Foo(Func, IComparable>) overload. + // Dev11 considers Action == Action ambiguous and thus chooses Goo(Func, IComparable>) overload. CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( - // (9,9): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Foo(System.Func, System.IComparable>)' and 'Program.Foo(System.Func, System.IConvertible>)' - Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("Program.Foo(System.Func, System.IComparable>)", "Program.Foo(System.Func, System.IConvertible>)")); + // (9,9): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Goo(System.Func, System.IComparable>)' and 'Program.Goo(System.Func, System.IConvertible>)' + Diagnostic(ErrorCode.ERR_AmbigCall, "Goo").WithArguments("Program.Goo(System.Func, System.IComparable>)", "Program.Goo(System.Func, System.IConvertible>)")); } [Fact] @@ -3191,7 +3191,7 @@ class X public static void Main() { } - public static DateTime Foo() + public static DateTime Goo() { return default(DateTime); } @@ -3452,10 +3452,10 @@ class Program { static void Main() { - Foo(); + Goo(); } - static void Foo() where T : class + static void Goo() where T : class { object o = Main() as T; } @@ -3479,10 +3479,10 @@ class Program { static void Main() { - Foo(); + Goo(); } - static void Foo() where T : class + static void Goo() where T : class { bool b = Main() is T; } @@ -3509,7 +3509,7 @@ public void TestIsOperatorWithGenericContainingType() var source = @" class Program { - static void Foo( + static void Goo( Outer.C c1, Outer.C c2, Outer.S s1, Outer.S s2, Outer.E e1, Outer.E e2) @@ -3579,7 +3579,7 @@ public void TestIsOperatorWithTypesThatCannotUnify() var source = @" class Program { - static void Foo(Outer.S s1, Outer.S s2) + static void Goo(Outer.S s1, Outer.S s2) { bool b; b = s1 is Outer.S; // T -> int[] @@ -3611,7 +3611,7 @@ public void TestIsOperatorWithSpecialTypes() class Program { - static void Foo(Outer.E e1, Outer.E e2, int i, T t, TClass tc, TStruct ts) + static void Goo(Outer.E e1, Outer.E e2, int i, T t, TClass tc, TStruct ts) where TClass : class where TStruct : struct { @@ -3718,10 +3718,10 @@ class Program { static void Main() { - Foo(null); + Goo(null); } - static U Foo(T t) + static U Goo(T t) where T : U where U : class { @@ -3774,9 +3774,9 @@ public void TestIsAsOperator_UserDefinedConversionsNotAllowed() var source = @" // conversion.cs -class Foo { public Foo(Bar b){} } +class Goo { public Goo(Bar b){} } -class Foo2 { public Foo2(Bar b){} } +class Goo2 { public Goo2(Bar b){} } struct Bar { @@ -3786,16 +3786,16 @@ static public implicit operator Bar(int value) return new Bar(); } - // Declare an explicit conversion from a Bar to Foo - static public explicit operator Foo(Bar value) + // Declare an explicit conversion from a Bar to Goo + static public explicit operator Goo(Bar value) { - return new Foo(value); + return new Goo(value); } - // Declare an implicit conversion from a Bar to Foo2 - static public implicit operator Foo2(Bar value) + // Declare an implicit conversion from a Bar to Goo2 + static public implicit operator Goo2(Bar value) { - return new Foo2(value); + return new Goo2(value); } } @@ -3807,36 +3807,36 @@ static public void Main() numeral = 10; - object a1 = numeral as Foo; + object a1 = numeral as Goo; object a2 = 1 as Bar; - object a3 = numeral as Foo2; + object a3 = numeral as Goo2; - bool b1 = numeral is Foo; + bool b1 = numeral is Goo; bool b2 = 1 is Bar; - bool b3 = numeral is Foo2; + bool b3 = numeral is Goo2; } } "; var comp = CreateStandardCompilation(source); comp.VerifyDiagnostics( - // (37,21): error CS0039: Cannot convert type 'Bar' to 'Foo' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion - // object a1 = numeral as Foo; - Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "numeral as Foo").WithArguments("Bar", "Foo"), + // (37,21): error CS0039: Cannot convert type 'Bar' to 'Goo' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion + // object a1 = numeral as Goo; + Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "numeral as Goo").WithArguments("Bar", "Goo"), // (38,21): error CS0077: The as operator must be used with a reference type or nullable type ('Bar' is a non-nullable value type) // object a2 = 1 as Bar; Diagnostic(ErrorCode.ERR_AsMustHaveReferenceType, "1 as Bar").WithArguments("Bar"), - // (39,21): error CS0039: Cannot convert type 'Bar' to 'Foo2' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion - // object a3 = numeral as Foo2; - Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "numeral as Foo2").WithArguments("Bar", "Foo2"), - // (41,19): warning CS0184: The given expression is never of the provided ('Foo') type - // bool b1 = numeral is Foo; - Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "numeral is Foo").WithArguments("Foo"), + // (39,21): error CS0039: Cannot convert type 'Bar' to 'Goo2' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion + // object a3 = numeral as Goo2; + Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "numeral as Goo2").WithArguments("Bar", "Goo2"), + // (41,19): warning CS0184: The given expression is never of the provided ('Goo') type + // bool b1 = numeral is Goo; + Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "numeral is Goo").WithArguments("Goo"), // (42,19): warning CS0184: The given expression is never of the provided ('Bar') type // bool b2 = 1 is Bar; Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "1 is Bar").WithArguments("Bar"), - // (43,19): warning CS0184: The given expression is never of the provided ('Foo2') type - // bool b3 = numeral is Foo2; - Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "numeral is Foo2").WithArguments("Foo2")); + // (43,19): warning CS0184: The given expression is never of the provided ('Goo2') type + // bool b3 = numeral is Goo2; + Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "numeral is Goo2").WithArguments("Goo2")); } [WorkItem(543455, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543455")] @@ -3997,13 +3997,13 @@ public void TestEqualityOperator_NullableStructs() public struct NonGenericStruct { } public struct GenericStruct { } -public class Foo +public class Goo { public NonGenericStruct? ngsq; public GenericStruct? gsiq; } -public class GenFoo +public class GenGoo { public GenericStruct? gstq; } @@ -4012,11 +4012,11 @@ public class Test { public static bool Run() { - Foo f = new Foo(); + Goo f = new Goo(); f.ngsq = new NonGenericStruct(); f.gsiq = new GenericStruct(); - GenFoo gf = new GenFoo(); + GenGoo gf = new GenGoo(); gf.gstq = new GenericStruct(); return (f.ngsq != null) && (f.gsiq != null) && (gf.gstq != null); @@ -4268,13 +4268,13 @@ public void TestEqualityOperator_NullableDecimal() @" public class Test { - public static bool Foo(decimal? deq) + public static bool Goo(decimal? deq) { return deq == null; } public static void Main() { - Foo(null); + Goo(null); } } "; @@ -8862,7 +8862,7 @@ class EnumRepro { public static void Main() { - EnumWrapper wrappedEnum = FlagsEnum.Foo; + EnumWrapper wrappedEnum = FlagsEnum.Goo; wrappedEnum |= FlagsEnum.Bar; System.Console.Write(wrappedEnum.Enum); } @@ -8888,11 +8888,11 @@ public static implicit operator EnumWrapper(T source) public enum FlagsEnum { None = 0, - Foo = 1, + Goo = 1, Bar = 2, } "; - var verifier = CompileAndVerify(source, expectedOutput: "Foo, Bar"); + var verifier = CompileAndVerify(source, expectedOutput: "Goo, Bar"); verifier.VerifyDiagnostics(); } @@ -8904,7 +8904,7 @@ public void IsWarningWithNonNullConstant() { public static void Main(string[] args) { - const string d = ""foo""; + const string d = ""goo""; var x = d is string; } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/OutVarTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/OutVarTests.cs index 68f5271b5c23a..44c8246392da7 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/OutVarTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/OutVarTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -30702,15 +30702,15 @@ public void OutVarDeclaredInReceiverUsedInArgument() public class C { - public string[] Foo2(out string x) { x = """"; return null; } - public string[] Foo3(bool b) { return null; } + public string[] Goo2(out string x) { x = """"; return null; } + public string[] Goo3(bool b) { return null; } - public string[] Foo5(string u) { return null; } + public string[] Goo5(string u) { return null; } public void Test() { - var t1 = Foo2(out var x1).Concat(Foo5(x1)); - var t2 = Foo3(t1 is var x2).Concat(Foo5(x2.First())); + var t1 = Goo2(out var x1).Concat(Goo5(x1)); + var t2 = Goo3(t1 is var x2).Concat(Goo5(x2.First())); } } "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/OverloadResolutionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/OverloadResolutionTests.cs index 59c2c7ab9d07e..83bf051b2554e 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/OverloadResolutionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/OverloadResolutionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -29,10 +29,10 @@ class Program { static void Main() { - Foo(delegate { }); // No error; chooses the non-expression version. + Goo(delegate { }); // No error; chooses the non-expression version. } - static void Foo(Action a) { } - static void Foo(Expression a) { } + static void Goo(Action a) { } + static void Goo(Expression a) { } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics(); @@ -1229,30 +1229,30 @@ public void TestRefOutAnonymousDelegate() using System.Linq.Expressions; class p { - static void Foo(ref Func a) { } + static void Goo(ref Func a) { } static void Bar(out Func a) { a = null; } - static void Foo2(ref Expression> a) { } + static void Goo2(ref Expression> a) { } static void Bar2(out Expression> a) { a = null; } static void Main() { - Foo(x => x); + Goo(x => x); Bar(x => x); - Foo2(x => x); + Goo2(x => x); Bar2(x => x); } }"; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( // (14,21): error CS1503: Argument 1: cannot convert from 'lambda expression' to 'ref Func' - // Foo(x => x); + // Goo(x => x); Diagnostic(ErrorCode.ERR_BadArgType, "x => x").WithArguments("1", "lambda expression", "ref System.Func").WithLocation(14, 21), // (15,21): error CS1503: Argument 1: cannot convert from 'lambda expression' to 'out Func' // Bar(x => x); Diagnostic(ErrorCode.ERR_BadArgType, "x => x").WithArguments("1", "lambda expression", "out System.Func").WithLocation(15, 21), // (16,22): error CS1503: Argument 1: cannot convert from 'lambda expression' to 'ref Expression>' - // Foo2(x => x); + // Goo2(x => x); Diagnostic(ErrorCode.ERR_BadArgType, "x => x").WithArguments("1", "lambda expression", "ref System.Linq.Expressions.Expression>").WithLocation(16, 22), // (17,22): error CS1503: Argument 1: cannot convert from 'lambda expression' to 'out Expression>' // Bar2(x => x); @@ -1400,14 +1400,14 @@ class C { public static void M() { - Foo(); + Goo(); } - static void Foo(params T[] x) { } + static void Goo(params T[] x) { } }"; CreateStandardCompilation(source).VerifyDiagnostics( - // (6,9): error CS0411: The type arguments for method 'C.Foo(params T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly. - // Foo(); - Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Foo").WithArguments("C.Foo(params T[])").WithLocation(6, 9)); + // (6,9): error CS0411: The type arguments for method 'C.Goo(params T[])' cannot be inferred from the usage. Try specifying the type arguments explicitly. + // Goo(); + Diagnostic(ErrorCode.ERR_CantInferMethTypeArgs, "Goo").WithArguments("C.Goo(params T[])").WithLocation(6, 9)); } [Fact] @@ -1975,20 +1975,20 @@ public class A public A(long x) { Console.WriteLine(""long""); } - public void Foo() { A a = new A(C); } + public void Goo() { A a = new A(C); } static void Main() { A a = new A(C); - a.Foo(); - B.Foo(); + a.Goo(); + B.Goo(); } } public class B { const int C = 1; - public static void Foo() { A a = new A(C);} + public static void Goo() { A a = new A(C);} } "; @@ -2012,20 +2012,20 @@ public class A public A(long x) { Console.WriteLine(""long""); } - public void Foo() { A a = new A(C); } + public void Goo() { A a = new A(C); } static void Main() { A a = new A(C); - a.Foo(); - B.Foo(); + a.Goo(); + B.Goo(); } } public class B { const int C = 1; - public static void Foo() { A a = new A(C);} + public static void Goo() { A a = new A(C);} } "; @@ -2116,20 +2116,20 @@ public class A public void AA(long x) { Console.Write(""long""); } - public void Foo() { A a = new A(); a.AA(C); } + public void Goo() { A a = new A(); a.AA(C); } static void Main() { A a = new A(); - a.Foo(); - B.Foo(); + a.Goo(); + B.Goo(); } } public class B { const int C = 1; - public static void Foo() { A a = new A(); a.AA(C);} + public static void Goo() { A a = new A(); a.AA(C);} } "; @@ -2155,10 +2155,10 @@ class DynamicWrapper static void M() { DynamicWrapper[] array = null; - Foo(array, x => x.Value, (x, y) => string.Empty); //-C.Foo(System.Collections.Generic.IEnumerable, System.Func>, System.Func) + Goo(array, x => x.Value, (x, y) => string.Empty); //-C.Goo(System.Collections.Generic.IEnumerable, System.Func>, System.Func) } - static IEnumerable Foo( + static IEnumerable Goo( object source, Func> collectionSelector, Func resultSelector) @@ -2166,7 +2166,7 @@ static IEnumerable Foo( return null; } - static IEnumerable Foo( + static IEnumerable Goo( IEnumerable source, Func> collectionSelector, Func resultSelector) @@ -2200,7 +2200,7 @@ public PArray(TCommon t, params object[] p) } } -class Foo +class Goo { void M() { @@ -2443,7 +2443,7 @@ public int M(ref int x, ref int y, ref int z) class Test { - public static int Foo(ref int x) + public static int Goo(ref int x) { Console.WriteLine(x); x++; @@ -2455,17 +2455,17 @@ public static int Main() IRef1 ref1 = new Ref1Impl(); int a = 10; int ret = ref1.M( - z: Foo(ref a), // Print 10 + z: Goo(ref a), // Print 10 y: ref1.M(z: ref a, y: a, x: ref a), - x: Foo(ref a)); // Print -3 + x: Goo(ref a)); // Print -3 Console.WriteLine(a); // Print -2 Console.WriteLine(ret); // Print 42 int b = 1, c = 2; ret = ref1.M( - z: Foo(ref c), // Print 2 + z: Goo(ref c), // Print 2 y: ref1.M(z: ref b, y: b + c, x: b), - x: Foo(ref b)); // Print -3 + x: Goo(ref b)); // Print -3 Console.WriteLine(b); // Print -2 Console.WriteLine(c); // Print 3 Console.WriteLine(ret); // Print 7 @@ -2510,7 +2510,7 @@ public int M(ref int x, ref int y) class Test { - public static int Foo(ref int x) + public static int Goo(ref int x) { Console.WriteLine(x); x++; @@ -2763,10 +2763,10 @@ public Attr2(ref int x) {} [ComImport] [Guid(""A88A175D-2448-447A-B786-64682CBEF156"")] -[Attr(new Foo().M1(1, 1))] -[Attr(Foo.M2(1, 1))] +[Attr(new Goo().M1(1, 1))] +[Attr(Goo.M2(1, 1))] [Attr2(1)] -public class Foo +public class Goo { public extern int M1(ref int x, int y); public static extern int M2(ref int x, int y); @@ -2779,10 +2779,10 @@ public class Foo // public Attr2(ref int x) {} Diagnostic(ErrorCode.ERR_ComImportWithUserCtor, "Attr2").WithLocation(15, 12), // (20,20): error CS1620: Argument 1 must be passed with the 'ref' keyword - // [Attr(new Foo().M1(1, 1))] + // [Attr(new Goo().M1(1, 1))] Diagnostic(ErrorCode.ERR_BadArgRef, "1").WithArguments("1", "ref").WithLocation(20, 20), // (21,14): error CS1620: Argument 1 must be passed with the 'ref' keyword - // [Attr(Foo.M2(1, 1))] + // [Attr(Goo.M2(1, 1))] Diagnostic(ErrorCode.ERR_BadArgRef, "1").WithArguments("1", "ref").WithLocation(21, 14), // (22,8): error CS1620: Argument 1 must be passed with the 'ref' keyword // [Attr2(1)] @@ -2840,7 +2840,7 @@ abstract class C } class D : C { - public static void Foo() + public static void Goo() { short x = 123; sbyte s = 123; @@ -2874,10 +2874,10 @@ abstract class E } class F : E { - [DllImport(""foo"")] + [DllImport(""goo"")] extern public void M(sbyte p); - public static void Foo() + public static void Goo() { short x = 123; sbyte s = 123; @@ -2900,7 +2900,7 @@ class H : G { extern public void M(ref short p); - public static void Foo() + public static void Goo() { short x = 123; sbyte s = 123; @@ -2923,7 +2923,7 @@ class J : I extern public void M(sbyte p); extern public void M(ref short p); - public static void Foo() + public static void Goo() { short x = 123; sbyte s = 123; @@ -2939,7 +2939,7 @@ public static void Foo() "; CreateStandardCompilation(source).VerifyDiagnostics( // (12,6): error CS0601: The DllImport attribute must be specified on a method marked 'static' and 'extern' - // [DllImport("foo")] + // [DllImport("goo")] Diagnostic(ErrorCode.ERR_DllImportOnInvalidMethod, "DllImport"), // (20,19): error CS1503: Argument 1: cannot convert from 'short' to 'sbyte' // new F().M(x); @@ -2990,7 +2990,7 @@ class C: B public void M(ref short p) {} public void M(sbyte p) {} - public static void Foo() + public static void Goo() { short x = 123; sbyte s = 123; @@ -3034,7 +3034,7 @@ class K class H where T: K, new() { - public static void Foo() + public static void Goo() { short x = 123; T t = new T(); @@ -3064,7 +3064,7 @@ static class E class Y { - public static void Foo() + public static void Goo() { short x = 123; E.M(x); // Dev11 reports CS1620 (missing 'ref') @@ -3142,7 +3142,7 @@ public static void I(this C c, ref int p) {} class X { - public static void Foo() + public static void Goo() { short x = 123; C c = new C(); @@ -6329,20 +6329,20 @@ static void Main() // causes ambiguity because first and third method, but depending on the order, the compiler // reports them incorrectly. VSWhidbey:133503 - static void overload1(byte b, foo f) { } + static void overload1(byte b, goo f) { } static void overload1(sbyte b, bar f) { } static void overload1(int b, baz f) { } static void overload2(int b, baz f) { } static void overload2(sbyte b, bar f) { } - static void overload2(byte b, foo f) { } + static void overload2(byte b, goo f) { } } -class foo +class goo { - public static implicit operator foo(int i) + public static implicit operator goo(int i) { - return new foo(); + return new goo(); } } @@ -6360,19 +6360,19 @@ public static implicit operator baz(int i) { return new baz(); } - public static implicit operator baz(foo f) + public static implicit operator baz(goo f) { return new baz(); } } "; CreateStandardCompilation(source).VerifyDiagnostics( - // (6,9): error CS0121: The call is ambiguous between the following methods or properties: 'Ambig.overload1(byte, foo)' and 'Ambig.overload1(int, baz)' + // (6,9): error CS0121: The call is ambiguous between the following methods or properties: 'Ambig.overload1(byte, goo)' and 'Ambig.overload1(int, baz)' // overload1(1, 1); - Diagnostic(ErrorCode.ERR_AmbigCall, "overload1").WithArguments("Ambig.overload1(byte, foo)", "Ambig.overload1(int, baz)").WithLocation(6, 9), - // (7,9): error CS0121: The call is ambiguous between the following methods or properties: 'Ambig.overload2(int, baz)' and 'Ambig.overload2(byte, foo)' + Diagnostic(ErrorCode.ERR_AmbigCall, "overload1").WithArguments("Ambig.overload1(byte, goo)", "Ambig.overload1(int, baz)").WithLocation(6, 9), + // (7,9): error CS0121: The call is ambiguous between the following methods or properties: 'Ambig.overload2(int, baz)' and 'Ambig.overload2(byte, goo)' // overload2(1, 1); - Diagnostic(ErrorCode.ERR_AmbigCall, "overload2").WithArguments("Ambig.overload2(int, baz)", "Ambig.overload2(byte, foo)").WithLocation(7, 9) + Diagnostic(ErrorCode.ERR_AmbigCall, "overload2").WithArguments("Ambig.overload2(int, baz)", "Ambig.overload2(byte, goo)").WithLocation(7, 9) ); } @@ -6892,12 +6892,12 @@ public void GenericVsOptionalParameter() using System; class C { - public static int Foo(int x, string y = null) { return 1; } - public static int Foo(T x) { return 0; } + public static int Goo(int x, string y = null) { return 1; } + public static int Goo(T x) { return 0; } public static void Main() { - System.Console.WriteLine(Foo(0)); + System.Console.WriteLine(Goo(0)); } } "; @@ -6913,17 +6913,17 @@ public void TypeParameterInterfaceVersusNonInterface() string source = @" interface IA { - int Foo(int x = 0); + int Goo(int x = 0); } class C : IA { - public int Foo(int x) + public int Goo(int x) { return x; } static int M(T x) where T : A, IA { - return x.Foo(); //-IA.Foo(int) + return x.Goo(); //-IA.Goo(int) } } "; @@ -6940,11 +6940,11 @@ public class Test { public delegate dynamic nongenerics(dynamic id); public delegate T generics< T>(dynamic id); - public dynamic Foo(nongenerics Meth, dynamic id) + public dynamic Goo(nongenerics Meth, dynamic id) { return null; } - public T Foo(generics Meth, dynamic id) + public T Goo(generics Meth, dynamic id) { return default(T); } @@ -6952,9 +6952,9 @@ public dynamic method(dynamic id) { return System.String.Empty; } - public dynamic testFoo(dynamic id) + public dynamic testGoo(dynamic id) { - return Foo(method, ""abc""); + return Goo(method, ""abc""); } static void Main(string[] args) { @@ -6962,9 +6962,9 @@ static void Main(string[] args) }"; // Doesn't assert. CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( - // (20,16): error CS0121: The call is ambiguous between the following methods or properties: 'Test.Foo(Test.nongenerics, dynamic)' and 'Test.Foo(Test.generics, dynamic)' - // return Foo(method, "abc"); - Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("Test.Foo(Test.nongenerics, dynamic)", "Test.Foo(Test.generics, dynamic)") + // (20,16): error CS0121: The call is ambiguous between the following methods or properties: 'Test.Goo(Test.nongenerics, dynamic)' and 'Test.Goo(Test.generics, dynamic)' + // return Goo(method, "abc"); + Diagnostic(ErrorCode.ERR_AmbigCall, "Goo").WithArguments("Test.Goo(Test.nongenerics, dynamic)", "Test.Goo(Test.generics, dynamic)") ); } @@ -6976,7 +6976,7 @@ public void GenericMethodConversionToDelegateWithDynamic() using System; public delegate void D002(T1 t1, T2 t2); public delegate void D003(dynamic t1, object t2); -public class Foo +public class Goo { static internal void M11(T1 t1, T2 t2) { @@ -6989,13 +6989,13 @@ static public void Main() { dynamic d1 = null; object o1 = null; - Foo.M11(d1, o1); - Foo.M11(d1, o1); - D002 dd02 = new D002(Foo.M11); - D002 dd03 = Foo.M11; - D002 dd04 = (D002)Foo.M11; - D003 dd05 = Foo.M11; - M(Foo.M11); + Goo.M11(d1, o1); + Goo.M11(d1, o1); + D002 dd02 = new D002(Goo.M11); + D002 dd03 = Goo.M11; + D002 dd04 = (D002)Goo.M11; + D003 dd05 = Goo.M11; + M(Goo.M11); Console.WriteLine(dd02); } }"; @@ -7154,7 +7154,7 @@ public void OverloadInheritanceAsync() using System; class Test { - public virtual async Task Foo(Func> f) + public virtual async Task Goo(Func> f) { await Task.Delay(10); return 1; @@ -7162,19 +7162,19 @@ public virtual async Task Foo(Func> f) } class TestCase : Test { - public override async Task Foo(Func> f) + public override async Task Goo(Func> f) { await Task.Delay(10); return 3; } - public async Task Foo(Func> f) + public async Task Goo(Func> f) { await Task.Delay(10); return 2; } public async void Run() { - var xxx = await Foo(async () => { // Roslyn error here + var xxx = await Goo(async () => { // Roslyn error here await Task.Delay(10); return 5m; }); Console.WriteLine(xxx); // 3; @@ -7191,20 +7191,20 @@ public void OverloadInheritance001() using System; class Test { - public virtual int Foo(Func f) + public virtual int Goo(Func f) { return 1; } } class TestCase : Test { - public override int Foo(Func f) + public override int Goo(Func f) { return 3; } public void Run() { - var xxx = Foo(() => { // Roslyn error here + var xxx = Goo(() => { // Roslyn error here return 5m; }); Console.WriteLine(xxx); // 3; } @@ -7255,20 +7255,20 @@ public void ExtensionMethodOnComInterfaceMissingRefToken() string source = @"using System; using System.Runtime.InteropServices; [ComImport, Guid(""cb4ac859-0589-483e-934d-b27845d5fe74"")] -interface IFoo +interface IGoo { } static class Program { - public static void Bar(this IFoo self, ref Guid id) + public static void Bar(this IGoo self, ref Guid id) { id = Guid.NewGuid(); } static void Main() { - Foo(null); + Goo(null); } - static void Foo(IFoo o) + static void Goo(IGoo o) { Guid g = Guid.NewGuid(); Console.WriteLine(g); @@ -7400,18 +7400,18 @@ public void TestBug528811() delegate byte DL(); class Test { - void foo() + void goo() { EventHandler y = null; - y += foo; + y += goo; y += x => 2; } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(source); comp.VerifyDiagnostics( - // (9,14): error CS0123: No overload for 'foo' matches delegate 'System.EventHandler' - // y += foo; - Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "foo").WithArguments("foo", "System.EventHandler"), + // (9,14): error CS0123: No overload for 'goo' matches delegate 'System.EventHandler' + // y += goo; + Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "goo").WithArguments("goo", "System.EventHandler"), // (10,14): error CS1593: Delegate 'System.EventHandler' does not take 1 arguments // y += x => 2; Diagnostic(ErrorCode.ERR_BadDelArgCount, "x => 2").WithArguments("System.EventHandler", "1") @@ -7517,11 +7517,11 @@ class C { static void Main() { - Foo(() => { return () => 0; ; }); - Foo(() => { return () => 0; }); + Goo(() => { return () => 0; ; }); + Goo(() => { return () => 0; }); } - static void Foo(Func> x) { Console.WriteLine(1); } - static void Foo(Func> x) { Console.WriteLine(2); } + static void Goo(Func> x) { Console.WriteLine(1); } + static void Goo(Func> x) { Console.WriteLine(2); } } "; @@ -7543,11 +7543,11 @@ static void Main() static void Test(bool val) { - Foo(() => { if (val) return () => 0; else return () => (short)0; }); - Foo(() => { if (val) return () => (short)0; else return () => 0; }); + Goo(() => { if (val) return () => 0; else return () => (short)0; }); + Goo(() => { if (val) return () => (short)0; else return () => 0; }); } - static void Foo(Func> x) { Console.WriteLine(1); } - static void Foo(Func> x) { Console.WriteLine(2); } + static void Goo(Func> x) { Console.WriteLine(1); } + static void Goo(Func> x) { Console.WriteLine(2); } } "; @@ -7569,10 +7569,10 @@ static void Main() static void Test(bool val) { - Foo(() => { if (val) return () => 0; else return () => 0; }); + Goo(() => { if (val) return () => 0; else return () => 0; }); } - static void Foo(Func> x) { Console.WriteLine(1); } - static void Foo(Func> x) { Console.WriteLine(2); } + static void Goo(Func> x) { Console.WriteLine(1); } + static void Goo(Func> x) { Console.WriteLine(2); } } "; @@ -7591,17 +7591,17 @@ class C static void Main() { #pragma warning disable 1998 - Foo(async () => { return 0; ; }); - Foo(async () => { return 0; }); - Foo(async () => 0); + Goo(async () => { return 0; ; }); + Goo(async () => { return 0; }); + Goo(async () => 0); - Foo(async () => { return (short)0; ; }); - Foo(async () => { return (short)0; }); - Foo(async () => (short)0); + Goo(async () => { return (short)0; ; }); + Goo(async () => { return (short)0; }); + Goo(async () => (short)0); } - static void Foo(Func> x) { Console.WriteLine(1); } - static void Foo(Func> x) { Console.WriteLine(2); } + static void Goo(Func> x) { Console.WriteLine(1); } + static void Goo(Func> x) { Console.WriteLine(2); } } "; @@ -7626,15 +7626,15 @@ class C static void Main() { #pragma warning disable 1998 - Foo(() => async () => { return 0; ; }); - Foo(() => async () => { return 0; }); - Foo(() => async () => 0); - Foo(() => { return async () => 0; ; }); - Foo(() => { return async () => 0; }); + Goo(() => async () => { return 0; ; }); + Goo(() => async () => { return 0; }); + Goo(() => async () => 0); + Goo(() => { return async () => 0; ; }); + Goo(() => { return async () => 0; }); } - static void Foo(Func>> x) { Console.WriteLine(1); } - static void Foo(Func>> x) { Console.WriteLine(2); } + static void Goo(Func>> x) { Console.WriteLine(1); } + static void Goo(Func>> x) { Console.WriteLine(2); } } "; @@ -7658,11 +7658,11 @@ class C static void Main() { #pragma warning disable 1998 - Foo(async () => { return () => 0; }); - Foo(async () => { return () => (short)0; }); + Goo(async () => { return () => 0; }); + Goo(async () => { return () => (short)0; }); } - static void Foo(Func>> x) { Console.WriteLine(1); } - static void Foo(Func>> x) { Console.WriteLine(2); } + static void Goo(Func>> x) { Console.WriteLine(1); } + static void Goo(Func>> x) { Console.WriteLine(2); } } "; @@ -7733,8 +7733,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static bool IsThing(Foo t) { return false; } + public class Goo { + public static bool IsThing(Goo t) { return false; } } public class Bar where T : class { @@ -7751,7 +7751,7 @@ public static Bar Create(Func propertyPrev, Func filter = n } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7771,8 +7771,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static bool IsThing(Foo t) { return false; } + public class Goo { + public static bool IsThing(Goo t) { return false; } } public class Bar where T : class { @@ -7789,7 +7789,7 @@ public static Bar Create(Func propertyPrev, params Func[] f } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7799,7 +7799,7 @@ static void Main(string[] args) compilation.VerifyDiagnostics( // (25,38): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar.Create(Func)' and 'Program.Bar.Create(Func, params Func[])' - // var x = Bar.Create(Foo.IsThing); + // var x = Bar.Create(Goo.IsThing); Diagnostic(ErrorCode.ERR_AmbigCall, "Create").WithArguments("ConsoleApplication2.Program.Bar.Create(System.Func)", "ConsoleApplication2.Program.Bar.Create(System.Func, params System.Func[])").WithLocation(25, 38) ); } @@ -7813,8 +7813,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static double IsThing(Foo t) { return 0; } + public class Goo { + public static double IsThing(Goo t) { return 0; } } public class Bar where T : class { @@ -7831,7 +7831,7 @@ public static Bar Create(Func propertyPrev, Func filter = n } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7851,8 +7851,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static double IsThing(Foo t) { return 0; } + public class Goo { + public static double IsThing(Goo t) { return 0; } } public class Bar where T : class { @@ -7869,7 +7869,7 @@ public static Bar Create(Func propertyPrev) } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7879,7 +7879,7 @@ static void Main(string[] args) compilation.VerifyDiagnostics( // (25,38): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar.Create(Func, params int[])' and 'Program.Bar.Create(Func)' - // var x = Bar.Create(Foo.IsThing); + // var x = Bar.Create(Goo.IsThing); Diagnostic(ErrorCode.ERR_AmbigCall, "Create").WithArguments("ConsoleApplication2.Program.Bar.Create(System.Func, params int[])", "ConsoleApplication2.Program.Bar.Create(System.Func)").WithLocation(25, 38) ); } @@ -7893,8 +7893,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static double IsThing(Foo t) { return 0; } + public class Goo { + public static double IsThing(Goo t) { return 0; } } public class Bar where T : class { @@ -7911,7 +7911,7 @@ public static Bar Create(Func filter, params int[] dummy) } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7921,7 +7921,7 @@ static void Main(string[] args) compilation.VerifyDiagnostics( // (25,38): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar.Create(Func)' and 'Program.Bar.Create(Func, params int[])' - // var x = Bar.Create(Foo.IsThing); + // var x = Bar.Create(Goo.IsThing); Diagnostic(ErrorCode.ERR_AmbigCall, "Create").WithArguments("ConsoleApplication2.Program.Bar.Create(System.Func)", "ConsoleApplication2.Program.Bar.Create(System.Func, params int[])").WithLocation(25, 38) ); } @@ -7935,8 +7935,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static bool IsThing(Foo t) { return false; } + public class Goo { + public static bool IsThing(Goo t) { return false; } } public class Bar where T : class { @@ -7953,7 +7953,7 @@ public static Bar Create(Func filter) } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -7963,7 +7963,7 @@ static void Main(string[] args) compilation.VerifyDiagnostics( // (25,38): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar.Create(Func, params Func[])' and 'Program.Bar.Create(Func)' - // var x = Bar.Create(Foo.IsThing); + // var x = Bar.Create(Goo.IsThing); Diagnostic(ErrorCode.ERR_AmbigCall, "Create").WithArguments("ConsoleApplication2.Program.Bar.Create(System.Func, params System.Func[])", "ConsoleApplication2.Program.Bar.Create(System.Func)").WithLocation(25, 38) ); } @@ -7977,8 +7977,8 @@ namespace ConsoleApplication2 { class Program { - public class Foo { - public static bool IsThing(Foo t) { return false; } + public class Goo { + public static bool IsThing(Goo t) { return false; } } public class Bar where T : class { @@ -7993,7 +7993,7 @@ public static Bar Create(Func propertyPrev, params int[] extra) } static void Main(string[] args) { - var x = Bar.Create(Foo.IsThing); + var x = Bar.Create(Goo.IsThing); } } } @@ -8003,7 +8003,7 @@ static void Main(string[] args) compilation.VerifyDiagnostics( // (23,38): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Bar.Create(Func, params int[])' and 'Program.Bar.Create(Func, params int[])' - // var x = Bar.Create(Foo.IsThing); + // var x = Bar.Create(Goo.IsThing); Diagnostic(ErrorCode.ERR_AmbigCall, "Create").WithArguments("ConsoleApplication2.Program.Bar.Create(System.Func, params int[])", "ConsoleApplication2.Program.Bar.Create(System.Func, params int[])").WithLocation(23, 38) ); } @@ -8015,7 +8015,7 @@ public void Bug1081302_0() using System; namespace ConsoleApplication2 { - public static class Foo + public static class Goo { public static U IfNotNull(this T value, Func selector, U defaultValue = default(U)) { @@ -8034,7 +8034,7 @@ static void Main(string[] args) { double? val = null; var d1 = val.IfNotNull(v => v / 100); - var d2 = Foo.IfNotNull(val, v => v / 100); + var d2 = Goo.IfNotNull(val, v => v / 100); } } } @@ -8054,7 +8054,7 @@ public void Bug1081302_1() using System; namespace ConsoleApplication2 { - public static class Foo + public static class Goo { public static U IfNotNull(this T value, Func selector, params U[] defaultValue) { @@ -8073,7 +8073,7 @@ static void Main(string[] args) { double? val = null; var d1 = val.IfNotNull(v => v / 100); - var d2 = Foo.IfNotNull(val, v => v / 100); + var d2 = Goo.IfNotNull(val, v => v / 100); } } } @@ -8090,7 +8090,7 @@ public void Bug1081302_2() using System; namespace ConsoleApplication2 { - public static class Foo + public static class Goo { public static U IfNotNull(this T? source, Func selector) where T : struct { @@ -8109,7 +8109,7 @@ static void Main(string[] args) { double? val = null; var d1 = val.IfNotNull(v => v / 100); - var d2 = Foo.IfNotNull(val, v => v / 100); + var d2 = Goo.IfNotNull(val, v => v / 100); } } } @@ -8244,7 +8244,7 @@ public void InvalidParamsPositionCSharp() const string source = @" public class A { - public static void Foo(params int[] vals, bool truth) + public static void Goo(params int[] vals, bool truth) { } @@ -8252,17 +8252,17 @@ public static void Foo(params int[] vals, bool truth) public static void Bar() { // 1 shouldn't show CS1503 Argument 1: cannot convert from 'int' to 'int' - Foo(1, true); + Goo(1, true); } } "; var comp = CreateStandardCompilation(source); comp.VerifyDiagnostics( // (4,28): error CS0231: A params parameter must be the last parameter in a formal parameter list - // public static void Foo(params int[] vals, bool truth) + // public static void Goo(params int[] vals, bool truth) Diagnostic(ErrorCode.ERR_ParamsLast, "params int[] vals"), // (12,13): error CS1503: Argument 1: cannot convert from 'int' to 'params int[]' - // Foo(1, true); + // Goo(1, true); Diagnostic(ErrorCode.ERR_BadArgType, "1").WithArguments("1", "int", "params int[]").WithLocation(12, 13)); } @@ -8843,7 +8843,7 @@ namespace ClassLibraryOverloadResolution { public class Class1 { - void foo() + void goo() { Dictionary dict = null; dict.Should(); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs index 2de0f17df1054..dbcfd3cf17d35 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -154,7 +154,7 @@ public class X public static void Main() { Test(1); - Test(""foo""); + Test(""goo""); Test(1); Test(1.2); Test(1.2); @@ -177,7 +177,7 @@ public static void Test(object x) { var expectedOutput = @"expression 1 is not String -expression foo is not Int32 +expression goo is not Int32 expression 1 is Int32 1 expression 1.2 is not Int32 expression 1.2 is Double 1.2 @@ -553,7 +553,7 @@ public struct X { public static void Main() { - var oa = new object[] { 1, 10, 20L, 1.2, ""foo"", true, null, new X(), new Exception(""boo"") }; + var oa = new object[] { 1, 10, 20L, 1.2, ""goo"", true, null, new X(), new Exception(""boo"") }; foreach (var o in oa) { switch (o) @@ -593,7 +593,7 @@ public static void Main() int 10 long 20 double 1.2 -class String foo +class String goo struct Boolean True null struct X X @@ -3198,7 +3198,7 @@ public static void Main() Console.WriteLine(1L is int.MaxValue); // OK, but false Console.WriteLine(1 is int.MaxValue); // false Console.WriteLine(int.MaxValue is int.MaxValue); // true - Console.WriteLine(""foo"" is System.String); // true + Console.WriteLine(""goo"" is System.String); // true Console.WriteLine(Int32.MaxValue is Int32.MaxValue); // true Console.WriteLine(new int[] {1, 2} is int[] a); // true object o = null; @@ -3220,8 +3220,8 @@ public static void Main() var compilation = CreateCompilationWithMscorlib45(source, options: TestOptions.DebugExe); compilation.VerifyDiagnostics( // (11,27): warning CS0183: The given expression is always of the provided ('string') type - // Console.WriteLine("foo" is System.String); // true - Diagnostic(ErrorCode.WRN_IsAlwaysTrue, @"""foo"" is System.String").WithArguments("string").WithLocation(11, 27) + // Console.WriteLine("goo" is System.String); // true + Diagnostic(ErrorCode.WRN_IsAlwaysTrue, @"""goo"" is System.String").WithArguments("string").WithLocation(11, 27) ); CompileAndVerify(compilation, expectedOutput: @"True @@ -3871,7 +3871,7 @@ class Program { public static void Main(string[] args) { - foreach (var s in new[] { ""0123"", ""foo"" }) + foreach (var s in new[] { ""0123"", ""goo"" }) { Console.Write(s + "" ""); try @@ -3896,7 +3896,7 @@ static int Ver(string s) ); var comp = CompileAndVerify(compilation, expectedOutput: @"0123 123 -foo throws"); +goo throws"); } [Fact] @@ -3984,7 +3984,7 @@ static async Task MainAsync() { try { - var used = (await Foo(i))?.ToString() ?? throw await Bar(i); + var used = (await Goo(i))?.ToString() ?? throw await Bar(i); } catch (Exception ex) { @@ -3992,7 +3992,7 @@ static async Task MainAsync() } } } - static async Task Foo(int i) + static async Task Goo(int i) { await Task.Yield(); return (i == 1) ? i : (object)null; @@ -4268,15 +4268,15 @@ public void PatternVarDeclaredInReceiverUsedInArgument() public class C { - public string[] Foo2(out string x) { x = """"; return null; } - public string[] Foo3(bool b) { return null; } + public string[] Goo2(out string x) { x = """"; return null; } + public string[] Goo3(bool b) { return null; } - public string[] Foo5(string u) { return null; } + public string[] Goo5(string u) { return null; } public void Test() { - var t1 = Foo2(out var x1).Concat(Foo5(x1)); - var t2 = Foo3(t1 is var x2).Concat(Foo5(x2.First())); + var t1 = Goo2(out var x1).Concat(Goo5(x1)); + var t2 = Goo3(t1 is var x2).Concat(Goo5(x2.First())); } } "; @@ -5942,7 +5942,7 @@ public static void Main(string[] args) if (null as string is string s1) { } const string s = null; if (s is string s2) { } - if (""foo"" is string s3) { } + if (""goo"" is string s3) { } } void M1(int? i) { diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs index 0d0ec0ccc4cdf..eb4898baf7ee8 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternSwitchTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -121,7 +121,7 @@ public static void Main() { case var n: break; - case ""foo"": ; // error: subsumed by previous case + case ""goo"": ; // error: subsumed by previous case case null: ; // error: subsumed by previous case } } @@ -130,8 +130,8 @@ public static void Main() Assert.True(compilation.GetDiagnostics().HasAnyErrors()); compilation.VerifyDiagnostics( // (10,13): error CS8120: The switch case has already been handled by a previous case. - // case "foo": ; // error: subsumed by previous case - Diagnostic(ErrorCode.ERR_PatternIsSubsumed, @"case ""foo"":").WithLocation(10, 13), + // case "goo": ; // error: subsumed by previous case + Diagnostic(ErrorCode.ERR_PatternIsSubsumed, @"case ""goo"":").WithLocation(10, 13), // (11,13): error CS8120: The switch case has already been handled by a previous case. // case null: ; // error: subsumed by previous case Diagnostic(ErrorCode.ERR_PatternIsSubsumed, "case null:").WithLocation(11, 13) @@ -151,7 +151,7 @@ public static void Main() { case bool n: break; - case ""foo"": // wrong type + case ""goo"": // wrong type break; // unreachable } } @@ -160,8 +160,8 @@ public static void Main() Assert.True(compilation.GetDiagnostics().HasAnyErrors()); compilation.VerifyDiagnostics( // (10,18): error CS0029: Cannot implicitly convert type 'string' to 'bool' - // case "foo": // wrong type - Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""foo""").WithArguments("string", "bool").WithLocation(10, 18), + // case "goo": // wrong type + Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""goo""").WithArguments("string", "bool").WithLocation(10, 18), // (11,17): warning CS0162: Unreachable code detected // break; // unreachable Diagnostic(ErrorCode.WRN_UnreachableCode, "break").WithLocation(11, 17) @@ -707,7 +707,7 @@ public void Subsumption08() { public static void Main(string[] args) { - switch (""foo"") + switch (""goo"") { case null when true: break; @@ -767,28 +767,28 @@ public static void Main() case true: case false: break; - case ""foo"": // wrong type + case ""goo"": // wrong type break; } } }"; CreateCompilationWithMscorlib45(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular6).VerifyDiagnostics( // (10,18): error CS0029: Cannot implicitly convert type 'string' to 'bool' - // case "foo": // wrong type - Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""foo""").WithArguments("string", "bool").WithLocation(11, 18) + // case "goo": // wrong type + Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""goo""").WithArguments("string", "bool").WithLocation(11, 18) ); CreateCompilationWithMscorlib45(source, options: TestOptions.DebugExe, parseOptions: TestOptions.Regular6WithV7SwitchBinder).VerifyDiagnostics( // (11,18): error CS0029: Cannot implicitly convert type 'string' to 'bool' - // case "foo": // wrong type - Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""foo""").WithArguments("string", "bool").WithLocation(11, 18), + // case "goo": // wrong type + Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""goo""").WithArguments("string", "bool").WithLocation(11, 18), // (12,17): warning CS0162: Unreachable code detected // break; Diagnostic(ErrorCode.WRN_UnreachableCode, "break").WithLocation(12, 17) ); CreateCompilationWithMscorlib45(source, options: TestOptions.DebugExe).VerifyDiagnostics( // (10,18): error CS0029: Cannot implicitly convert type 'string' to 'bool' - // case "foo": // wrong type - Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""foo""").WithArguments("string", "bool").WithLocation(11, 18) + // case "goo": // wrong type + Diagnostic(ErrorCode.ERR_NoImplicitConv, @"""goo""").WithArguments("string", "bool").WithLocation(11, 18) ); } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs index 70baf65e25392..2a76321f37293 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/QueryTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; @@ -1205,8 +1205,8 @@ class Program { static int Main() { - int [] foo = new int [] {1}; - var q = from x in foo + int [] goo = new int [] {1}; + var q = from x in goo select x + 1 into z select z.T "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/RefLocalsAndReturnsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/RefLocalsAndReturnsTests.cs index 89b8c08b75b7e..818da349cf2c2 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/RefLocalsAndReturnsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RefLocalsAndReturnsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Xunit; @@ -550,23 +550,23 @@ public struct S1 { public char x; - public ref S1 FooS() + public ref S1 GooS() { return ref this; } - public ref char Foo() + public ref char Goo() { return ref x; } - public ref char Foo1() + public ref char Goo1() { return ref this.x; } } - static ref T Foo(ref T arg) + static ref T Goo(ref T arg) { return ref arg; } @@ -578,21 +578,21 @@ static ref char Test1() if (1.ToString() != null) { - return ref Foo(ref M1); + return ref Goo(ref M1); } if (2.ToString() != null) { - return ref Foo(ref M2.x); + return ref Goo(ref M2.x); } if (3.ToString() != null) { - return ref Foo(ref M2).x; + return ref Goo(ref M2).x; } else { - return ref M2.Foo(); + return ref M2.Goo(); } } @@ -616,23 +616,23 @@ public ref C M() // return ref this.x; Diagnostic(ErrorCode.ERR_RefReturnStructThis, "this.x").WithArguments("this").WithLocation(20, 24), // (36,32): error CS8168: Cannot return local 'M1' by reference because it is not a ref local - // return ref Foo(ref M1); + // return ref Goo(ref M1); Diagnostic(ErrorCode.ERR_RefReturnLocal, "M1").WithArguments("M1").WithLocation(36, 32), - // (36,24): error CS8164: Cannot return by reference a result of 'Test.Foo(ref char)' because the argument passed to parameter 'arg' cannot be returned by reference - // return ref Foo(ref M1); - Diagnostic(ErrorCode.ERR_RefReturnCall, "Foo(ref M1)").WithArguments("Test.Foo(ref char)", "arg").WithLocation(36, 24), + // (36,24): error CS8164: Cannot return by reference a result of 'Test.Goo(ref char)' because the argument passed to parameter 'arg' cannot be returned by reference + // return ref Goo(ref M1); + Diagnostic(ErrorCode.ERR_RefReturnCall, "Goo(ref M1)").WithArguments("Test.Goo(ref char)", "arg").WithLocation(36, 24), // (41,32): error CS8169: Cannot return a member of local 'M2' by reference because it is not a ref local - // return ref Foo(ref M2.x); + // return ref Goo(ref M2.x); Diagnostic(ErrorCode.ERR_RefReturnLocal2, "M2").WithArguments("M2").WithLocation(41, 32), - // (41,24): error CS8164: Cannot return by reference a result of 'Test.Foo(ref char)' because the argument passed to parameter 'arg' cannot be returned by reference - // return ref Foo(ref M2.x); - Diagnostic(ErrorCode.ERR_RefReturnCall, "Foo(ref M2.x)").WithArguments("Test.Foo(ref char)", "arg").WithLocation(41, 24), + // (41,24): error CS8164: Cannot return by reference a result of 'Test.Goo(ref char)' because the argument passed to parameter 'arg' cannot be returned by reference + // return ref Goo(ref M2.x); + Diagnostic(ErrorCode.ERR_RefReturnCall, "Goo(ref M2.x)").WithArguments("Test.Goo(ref char)", "arg").WithLocation(41, 24), // (46,32): error CS8168: Cannot return local 'M2' by reference because it is not a ref local - // return ref Foo(ref M2).x; + // return ref Goo(ref M2).x; Diagnostic(ErrorCode.ERR_RefReturnLocal, "M2").WithArguments("M2").WithLocation(46, 32), - // (46,24): error CS8165: Cannot return by reference a member of result of 'Test.Foo(ref Test.S1)' because the argument passed to parameter 'arg' cannot be returned by reference - // return ref Foo(ref M2).x; - Diagnostic(ErrorCode.ERR_RefReturnCall2, "Foo(ref M2)").WithArguments("Test.Foo(ref Test.S1)", "arg").WithLocation(46, 24), + // (46,24): error CS8165: Cannot return by reference a member of result of 'Test.Goo(ref Test.S1)' because the argument passed to parameter 'arg' cannot be returned by reference + // return ref Goo(ref M2).x; + Diagnostic(ErrorCode.ERR_RefReturnCall2, "Goo(ref M2)").WithArguments("Test.Goo(ref Test.S1)", "arg").WithLocation(46, 24), // (58,24): error CS1605: Cannot use 'this' as a ref or out value because it is read-only // return ref this; Diagnostic(ErrorCode.ERR_RefReadonlyLocal, "this").WithArguments("this").WithLocation(58, 24)); @@ -746,7 +746,7 @@ public struct S1 public char x; } - ref char Foo(ref char a, ref char b) + ref char Goo(ref char a, ref char b) { return ref a; } @@ -768,7 +768,7 @@ ref char Test1(char arg1, S1 arg2) if (3.ToString() == null) { ref char a = ref (new char[1])[0]; - ref char invalid = ref Foo(ref a, ref a); + ref char invalid = ref Goo(ref a, ref a); // valid return ref r; @@ -777,7 +777,7 @@ ref char Test1(char arg1, S1 arg2) if (4.ToString() == null) { ref char a = ref (new char[1])[0]; - ref char valid = ref Foo(ref a, ref arg1); + ref char valid = ref Goo(ref a, ref arg1); // valid return ref valid; //4 @@ -786,7 +786,7 @@ ref char Test1(char arg1, S1 arg2) if (5.ToString() == null) { ref char a = ref (new char[1])[0]; - ref char r = ref Foo(ref a, ref r); + ref char r = ref Goo(ref a, ref r); // invalid return ref r; //5 @@ -819,7 +819,7 @@ ref char Test1(char arg1, S1 arg2) // ref S1 r = ref r; Diagnostic(ErrorCode.ERR_UseDefViolation, "r").WithArguments("r").WithLocation(24, 28), // (49,45): error CS0165: Use of unassigned local variable 'r' - // ref char r = ref Foo(ref a, ref r); + // ref char r = ref Goo(ref a, ref r); Diagnostic(ErrorCode.ERR_UseDefViolation, "r").WithArguments("r").WithLocation(49, 45) ); @@ -833,18 +833,18 @@ public class Test { public static void Main() { - ref char Foo(ref char a, ref char b) + ref char Goo(ref char a, ref char b) { // valid return ref a; } - char Foo1(ref char a, ref char b) + char Goo1(ref char a, ref char b) { return ref b; } - ref char Foo2(ref char c, ref char b) + ref char Goo2(ref char c, ref char b) { return c; } @@ -859,15 +859,15 @@ ref char Foo2(ref char c, ref char b) // (19,13): error CS8150: By-value returns may only be used in methods that return by value // return c; Diagnostic(ErrorCode.ERR_MustHaveRefReturn, "return").WithLocation(19, 13), - // (6,18): warning CS8321: The local function 'Foo' is declared but never used - // ref char Foo(ref char a, ref char b) - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo").WithArguments("Foo").WithLocation(6, 18), - // (12,14): warning CS8321: The local function 'Foo1' is declared but never used - // char Foo1(ref char a, ref char b) - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo1").WithArguments("Foo1").WithLocation(12, 14), - // (17,18): warning CS8321: The local function 'Foo2' is declared but never used - // ref char Foo2(ref char c, ref char b) - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo2").WithArguments("Foo2").WithLocation(17, 18)); + // (6,18): warning CS8321: The local function 'Goo' is declared but never used + // ref char Goo(ref char a, ref char b) + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo").WithArguments("Goo").WithLocation(6, 18), + // (12,14): warning CS8321: The local function 'Goo1' is declared but never used + // char Goo1(ref char a, ref char b) + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo1").WithArguments("Goo1").WithLocation(12, 14), + // (17,18): warning CS8321: The local function 'Goo2' is declared but never used + // ref char Goo2(ref char c, ref char b) + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo2").WithArguments("Goo2").WithLocation(17, 18)); } [Fact] @@ -879,11 +879,11 @@ public class Test public static void Main() { // valid - ref char Foo(ref char a, ref char b) => ref a; + ref char Goo(ref char a, ref char b) => ref a; - char Foo1(ref char a, ref char b) => ref b; + char Goo1(ref char a, ref char b) => ref b; - ref char Foo2(ref char c, ref char b) => c; + ref char Goo2(ref char c, ref char b) => c; var arr = new int[1]; ref var r = ref arr[0]; @@ -896,10 +896,10 @@ public static void Main() var comp = CreateCompilationWithMscorlib45(text, parseOptions: options); comp.VerifyDiagnostics( // (9,50): error CS8149: By-reference returns may only be used in methods that return by reference - // char Foo1(ref char a, ref char b) => ref b; + // char Goo1(ref char a, ref char b) => ref b; Diagnostic(ErrorCode.ERR_MustNotHaveRefReturn, "b").WithLocation(9, 50), // (11,50): error CS8150: By-value returns may only be used in methods that return by value - // ref char Foo2(ref char c, ref char b) => c; + // ref char Goo2(ref char c, ref char b) => c; Diagnostic(ErrorCode.ERR_MustHaveRefReturn, "c").WithLocation(11, 50), // (16,54): error CS8175: Cannot use ref local 'r' inside an anonymous method, lambda expression, or query expression // ref char Moo1(ref char a, ref char b) => ref r; @@ -913,15 +913,15 @@ public static void Main() // (17,46): error CS0266: Cannot implicitly convert type 'int' to 'char'. An explicit conversion exists (are you missing a cast?) // char Moo3(ref char a, ref char b) => r; Diagnostic(ErrorCode.ERR_NoImplicitConvCast, "r").WithArguments("int", "char").WithLocation(17, 46), - // (7,18): warning CS8321: The local function 'Foo' is declared but never used - // ref char Foo(ref char a, ref char b) => ref a; - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo").WithArguments("Foo").WithLocation(7, 18), - // (9,14): warning CS8321: The local function 'Foo1' is declared but never used - // char Foo1(ref char a, ref char b) => ref b; - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo1").WithArguments("Foo1").WithLocation(9, 14), - // (11,18): warning CS8321: The local function 'Foo2' is declared but never used - // ref char Foo2(ref char c, ref char b) => c; - Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Foo2").WithArguments("Foo2").WithLocation(11, 18), + // (7,18): warning CS8321: The local function 'Goo' is declared but never used + // ref char Goo(ref char a, ref char b) => ref a; + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo").WithArguments("Goo").WithLocation(7, 18), + // (9,14): warning CS8321: The local function 'Goo1' is declared but never used + // char Goo1(ref char a, ref char b) => ref b; + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo1").WithArguments("Goo1").WithLocation(9, 14), + // (11,18): warning CS8321: The local function 'Goo2' is declared but never used + // ref char Goo2(ref char c, ref char b) => c; + Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Goo2").WithArguments("Goo2").WithLocation(11, 18), // (16,18): warning CS8321: The local function 'Moo1' is declared but never used // ref char Moo1(ref char a, ref char b) => ref r; Diagnostic(ErrorCode.WRN_UnreferencedLocalFunction, "Moo1").WithArguments("Moo1").WithLocation(16, 18), @@ -1652,7 +1652,7 @@ class Program { static int field = 0; - static async void Foo() + static async void Goo() { ref int i = ref field; } @@ -1664,8 +1664,8 @@ static async void Foo() // ref int i = ref field; Diagnostic(ErrorCode.ERR_BadAsyncLocalType, "i = ref field").WithLocation(8, 17), // (6,23): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. - // static async void Foo() - Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Foo").WithLocation(6, 23)); + // static async void Goo() + Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Goo").WithLocation(6, 23)); } [Fact] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/ScriptSemanticsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/ScriptSemanticsTests.cs index b267845800fae..d1f4aa82ef924 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/ScriptSemanticsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/ScriptSemanticsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Immutable; @@ -318,7 +318,7 @@ public void Namespaces() var c = CreateSubmission(@" namespace N1 { - class A { public int Foo() { return 2; }} + class A { public int Goo() { return 2; }} } "); c.VerifyDiagnostics( @@ -337,23 +337,23 @@ public void NestedNamespace() // be declared within the Script class. // // Consider the following code parsed with ParseOptions(kind: SourceCodeKind.Script) and added - // to a compilation with CompilationOptions(scriptClassName: "Foo.Script"). + // to a compilation with CompilationOptions(scriptClassName: "Goo.Script"). // // public class A { } - // namespace Foo + // namespace Goo // { // public class B : Script.A { } // } // // The resulting compilation will contain the following types in the global namespace. // - // * Foo.Script - // * Foo.Script.A - // * Foo.B : Foo.Script.A + // * Goo.Script + // * Goo.Script.A + // * Goo.B : Goo.Script.A string test = @" public class A { } -namespace Foo +namespace Goo { public class B : Script.A { } } @@ -362,22 +362,22 @@ public class B : Script.A { } var compilation = CSharpCompilation.Create( assemblyName: "Test", - options: TestOptions.ReleaseExe.WithScriptClassName("Foo.Script"), + options: TestOptions.ReleaseExe.WithScriptClassName("Goo.Script"), syntaxTrees: new[] { tree }); var global = compilation.GlobalNamespace; - var foo = global.GetMembers().Single() as NamespaceSymbol; - Assert.Equal("Foo", foo.Name); + var goo = global.GetMembers().Single() as NamespaceSymbol; + Assert.Equal("Goo", goo.Name); - var script = foo.GetTypeMembers("Script").Single(); - Assert.Equal("Foo.Script", script.ToTestDisplayString()); + var script = goo.GetTypeMembers("Script").Single(); + Assert.Equal("Goo.Script", script.ToTestDisplayString()); var a = script.GetTypeMembers("A").Single(); - Assert.Equal("Foo.Script.A", a.ToTestDisplayString()); + Assert.Equal("Goo.Script.A", a.ToTestDisplayString()); - var b = foo.GetTypeMembers("B").Single(); - Assert.Equal("Foo.B", b.ToTestDisplayString()); + var b = goo.GetTypeMembers("B").Single(); + Assert.Equal("Goo.B", b.ToTestDisplayString()); Assert.Same(a, b.BaseType); } @@ -385,7 +385,7 @@ public class B : Script.A { } public void NamespaceWithBothInteractiveAndNoninteractiveImplicitTypes() { string test = @" -namespace Foo { void F() { } } +namespace Goo { void F() { } } void G() { } G(); "; @@ -393,14 +393,14 @@ void G() { } var compilation = CSharpCompilation.Create( assemblyName: "Test", - options: TestOptions.ReleaseExe.WithScriptClassName("Foo.Script"), + options: TestOptions.ReleaseExe.WithScriptClassName("Goo.Script"), syntaxTrees: new[] { tree }); var global = compilation.GlobalNamespace; var members = global.GetMembers(); Assert.Equal(1, members.Length); - Assert.Equal("Foo", members[0].Name); + Assert.Equal("Goo", members[0].Name); Assert.IsAssignableFrom(typeof(NamespaceSymbol), members[0]); var ns = (NamespaceSymbol)members[0]; members = ns.GetMembers(); @@ -705,12 +705,12 @@ sealed protected override void F() { } [Fact] public void PrivateNested() { - var c0 = CreateSubmission(@"public class C { private static int foo() { return 1; } }"); - var c1 = CreateSubmission(@"C.foo()", previous: c0); + var c0 = CreateSubmission(@"public class C { private static int goo() { return 1; } }"); + var c1 = CreateSubmission(@"C.goo()", previous: c0); c1.VerifyDiagnostics( // error CS0122: '{0}' is inaccessible due to its protection level - Diagnostic(ErrorCode.ERR_BadAccess, "foo").WithArguments("C.foo()")); + Diagnostic(ErrorCode.ERR_BadAccess, "goo").WithArguments("C.goo()")); } [Fact] @@ -809,7 +809,7 @@ public void CompilationChain_InStaticContext() int w = 4; "); var c1 = CreateSubmission(@" -static int Foo() { return x; } +static int Goo() { return x; } static int Bar { get { return y; } set { return z(); } } static int Baz = w; ", previous: c0); @@ -826,35 +826,35 @@ public void CompilationChain_InStaticContext() public void AccessToGlobalMemberFromNestedClass1() { var c0 = CreateSubmission(@" -int foo() { return 1; } +int goo() { return 1; } class D { - int bar() { return foo(); } + int bar() { return goo(); } } "); c0.VerifyDiagnostics( - // (6,24): error CS0120: An object reference is required for the non-static field, method, or property 'foo()' - Diagnostic(ErrorCode.ERR_ObjectRequired, "foo").WithArguments("foo()")); + // (6,24): error CS0120: An object reference is required for the non-static field, method, or property 'goo()' + Diagnostic(ErrorCode.ERR_ObjectRequired, "goo").WithArguments("goo()")); } [Fact] public void AccessToGlobalMemberFromNestedClass2() { var c0 = CreateSubmission(@" -int foo() { return 1; } +int goo() { return 1; } "); var c1 = CreateSubmission(@" class D { - int bar() { return foo(); } + int bar() { return goo(); } } ", previous: c0); c1.VerifyDiagnostics( - // (4,24): error CS0120: An object reference is required for the non-static field, method, or property 'foo()' - Diagnostic(ErrorCode.ERR_ObjectRequired, "foo").WithArguments("foo()")); + // (4,24): error CS0120: An object reference is required for the non-static field, method, or property 'goo()' + Diagnostic(ErrorCode.ERR_ObjectRequired, "goo").WithArguments("goo()")); } /// @@ -901,7 +901,7 @@ public void HostObjectBinding_MissingHostObjectContext() public void HostObjectBinding_InStaticContext() { var source = @" -static int Foo() { return x; } +static int Goo() { return x; } static int Bar { get { return Y; } set { return Z(); } } static int Baz = w; "; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticAnalyzerTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticAnalyzerTests.cs index 0a252568dcce4..ec54431d020b5 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticAnalyzerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticAnalyzerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -903,7 +903,7 @@ public void TestAssignmentWarnings_Dynamic() string source = @" class Program { - void foo(dynamic d) + void goo(dynamic d) { d = (int)d; } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs index 2f14a44e910b8..be6ef7b2224ef 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/SemanticErrorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -129,37 +129,37 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - boo foo1 = new boo(abc.far); + boo goo = null; + boo goo1 = new boo(abc.far); boo[] arrfoo = { p.bar, abc.far }; - foo += arrfoo; // Invalid - foo -= arrfoo; // Invalid - foo += new boo[] { p.bar, abc.far }; // Invalid - foo -= new boo[] { p.bar, abc.far }; // Invalid - foo += Delegate.Combine(arrfoo); // Invalid - foo += Delegate.Combine(foo, foo1); // Invalid + goo += arrfoo; // Invalid + goo -= arrfoo; // Invalid + goo += new boo[] { p.bar, abc.far }; // Invalid + goo -= new boo[] { p.bar, abc.far }; // Invalid + goo += Delegate.Combine(arrfoo); // Invalid + goo += Delegate.Combine(goo, goo1); // Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (16,16): error CS0029: Cannot implicitly convert type 'boo[]' to 'boo' - // foo += arrfoo; // Invalid + // goo += arrfoo; // Invalid Diagnostic(ErrorCode.ERR_NoImplicitConv, "arrfoo").WithArguments("boo[]", "boo"), // (17,16): error CS0029: Cannot implicitly convert type 'boo[]' to 'boo' - // foo -= arrfoo; // Invalid + // goo -= arrfoo; // Invalid Diagnostic(ErrorCode.ERR_NoImplicitConv, "arrfoo").WithArguments("boo[]", "boo"), // (18,16): error CS0029: Cannot implicitly convert type 'boo[]' to 'boo' - // foo += new boo[] { p.bar, abc.far }; // Invalid + // goo += new boo[] { p.bar, abc.far }; // Invalid Diagnostic(ErrorCode.ERR_NoImplicitConv, "new boo[] { p.bar, abc.far }").WithArguments("boo[]", "boo"), // (19,16): error CS0029: Cannot implicitly convert type 'boo[]' to 'boo' - // foo -= new boo[] { p.bar, abc.far }; // Invalid + // goo -= new boo[] { p.bar, abc.far }; // Invalid Diagnostic(ErrorCode.ERR_NoImplicitConv, "new boo[] { p.bar, abc.far }").WithArguments("boo[]", "boo"), // (20,16): error CS0266: Cannot implicitly convert type 'System.Delegate' to 'boo'. An explicit conversion exists (are you missing a cast?) - // foo += Delegate.Combine(arrfoo); // Invalid + // goo += Delegate.Combine(arrfoo); // Invalid Diagnostic(ErrorCode.ERR_NoImplicitConvCast, "Delegate.Combine(arrfoo)").WithArguments("System.Delegate", "boo"), // (21,16): error CS0266: Cannot implicitly convert type 'System.Delegate' to 'boo'. An explicit conversion exists (are you missing a cast?) - // foo += Delegate.Combine(foo, foo1); // Invalid - Diagnostic(ErrorCode.ERR_NoImplicitConvCast, "Delegate.Combine(foo, foo1)").WithArguments("System.Delegate", "boo") + // goo += Delegate.Combine(goo, goo1); // Invalid + Diagnostic(ErrorCode.ERR_NoImplicitConvCast, "Delegate.Combine(goo, goo1)").WithArguments("System.Delegate", "boo") ); } @@ -199,24 +199,24 @@ class C { static void Main(string[] args) { - boo foo = null; - foo += delegate (string x) { System.Console.WriteLine(x); };// Invalid - foo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid + boo goo = null; + goo += delegate (string x) { System.Console.WriteLine(x); };// Invalid + goo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (7,16): error CS1661: Cannot convert anonymous method to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo += delegate (string x) { System.Console.WriteLine(x); };// Invalid + // goo += delegate (string x) { System.Console.WriteLine(x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, "delegate (string x) { System.Console.WriteLine(x); }").WithArguments("anonymous method", "boo"), // (7,33): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo += delegate (string x) { System.Console.WriteLine(x); };// Invalid + // goo += delegate (string x) { System.Console.WriteLine(x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int"), // (8,16): error CS1661: Cannot convert anonymous method to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid + // goo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, "delegate (string x) { System.Console.WriteLine(x); }").WithArguments("anonymous method", "boo"), // (8,33): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid + // goo -= delegate (string x) { System.Console.WriteLine(x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int") ); } @@ -232,24 +232,24 @@ class C { static void Main(string[] args) { - boo foo = null; - foo += (string x) => { };// Invalid - foo -= (string x) => { };// Invalid + boo goo = null; + goo += (string x) => { };// Invalid + goo -= (string x) => { };// Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (7,16): error CS1661: Cannot convert lambda expression to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo += (string x) => { };// Invalid + // goo += (string x) => { };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, "(string x) => { }").WithArguments("lambda expression", "boo"), // (7,24): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo += (string x) => { };// Invalid + // goo += (string x) => { };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int"), // (8,16): error CS1661: Cannot convert lambda expression to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo -= (string x) => { };// Invalid + // goo -= (string x) => { };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, "(string x) => { }").WithArguments("lambda expression", "boo"), // (8,24): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo -= (string x) => { };// Invalid + // goo -= (string x) => { };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int") ); } @@ -269,10 +269,10 @@ class C static void Main(string[] args) { C p = new C(); - boo foo = null; - foo += p.bar + far;// Invalid - foo += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); } + far;// Invalid - foo += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); } + far;// Invalid + boo goo = null; + goo += p.bar + far;// Invalid + goo += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); } + far;// Invalid + goo += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); } + far;// Invalid } } "; @@ -331,7 +331,7 @@ static void Main(string[] args) ); } - // generic-delegate (foo(...)) += non generic-methodgroup(bar(...)) + // generic-delegate (goo(...)) += non generic-methodgroup(bar(...)) [WorkItem(539906, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539906")] [Fact] public void CS0019ERR_BadBinaryOps10() @@ -346,67 +346,67 @@ class C static void Main(string[] args) { C p = new C(); - boo foo = null; - foo += p.bar;// OK - foo += p.bar1;// Invalid - foo += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// OK - foo += (string x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// Invalid - foo += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// OK - foo += delegate (string x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// Invalid - - boo foo1 = null; - foo1 += p.bar;// Invalid - foo1 += p.bar1;// OK - foo1 += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// OK - foo1 += (int x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// Invalid - foo1 += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// Invalid - foo1 += delegate (string x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// OK - foo += foo1;// Invalid - foo1 += foo;// Invalid + boo goo = null; + goo += p.bar;// OK + goo += p.bar1;// Invalid + goo += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// OK + goo += (string x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// Invalid + goo += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// OK + goo += delegate (string x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// Invalid + + boo goo1 = null; + goo1 += p.bar;// Invalid + goo1 += p.bar1;// OK + goo1 += (x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// OK + goo1 += (int x) => { System.Console.WriteLine(""Lambda:{0}"", x); };// Invalid + goo1 += delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// Invalid + goo1 += delegate (string x) { System.Console.WriteLine(""Anonymous:{0}"", x); };// OK + goo += goo1;// Invalid + goo1 += goo;// Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (12,18): error CS0123: No overload for 'bar1' matches delegate 'boo' - // foo += p.bar1;// Invalid + // goo += p.bar1;// Invalid Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "bar1").WithArguments("bar1", "boo"), // (14,16): error CS1661: Cannot convert lambda expression to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo += (string x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid + // goo += (string x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, @"(string x) => { System.Console.WriteLine(""Lambda:{0}"", x); }").WithArguments("lambda expression", "boo"), // (14,24): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo += (string x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid + // goo += (string x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int"), // (16,16): error CS1661: Cannot convert anonymous method to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo += delegate (string x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid + // goo += delegate (string x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, @"delegate (string x) { System.Console.WriteLine(""Anonymous:{0}"", x); }").WithArguments("anonymous method", "boo"), // (16,33): error CS1678: Parameter 1 is declared as type 'string' but should be 'int' - // foo += delegate (string x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid + // goo += delegate (string x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "string", "", "int"), // (19,19): error CS0123: No overload for 'bar' matches delegate 'boo' - // foo1 += p.bar;// Invalid + // goo1 += p.bar;// Invalid Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "bar").WithArguments("bar", "boo"), // (22,17): error CS1661: Cannot convert lambda expression to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo1 += (int x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid + // goo1 += (int x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, @"(int x) => { System.Console.WriteLine(""Lambda:{0}"", x); }").WithArguments("lambda expression", "boo"), // (22,22): error CS1678: Parameter 1 is declared as type 'int' but should be 'string' - // foo1 += (int x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid + // goo1 += (int x) => { System.Console.WriteLine("Lambda:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "int", "", "string"), // (23,17): error CS1661: Cannot convert anonymous method to delegate type 'boo' because the parameter types do not match the delegate parameter types - // foo1 += delegate (int x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid + // goo1 += delegate (int x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_CantConvAnonMethParams, @"delegate (int x) { System.Console.WriteLine(""Anonymous:{0}"", x); }").WithArguments("anonymous method", "boo"), // (23,31): error CS1678: Parameter 1 is declared as type 'int' but should be 'string' - // foo1 += delegate (int x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid + // goo1 += delegate (int x) { System.Console.WriteLine("Anonymous:{0}", x); };// Invalid Diagnostic(ErrorCode.ERR_BadParamType, "x").WithArguments("1", "", "int", "", "string"), // (25,16): error CS0029: Cannot implicitly convert type 'boo' to 'boo' - // foo += foo1;// Invalid - Diagnostic(ErrorCode.ERR_NoImplicitConv, "foo1").WithArguments("boo", "boo"), + // goo += goo1;// Invalid + Diagnostic(ErrorCode.ERR_NoImplicitConv, "goo1").WithArguments("boo", "boo"), // (26,17): error CS0029: Cannot implicitly convert type 'boo' to 'boo' - // foo1 += foo;// Invalid - Diagnostic(ErrorCode.ERR_NoImplicitConv, "foo").WithArguments("boo", "boo") + // goo1 += goo;// Invalid + Diagnostic(ErrorCode.ERR_NoImplicitConv, "goo").WithArguments("boo", "boo") ); } - // generic-delegate (foo(...)) += generic-methodgroup(bar(...)) + // generic-delegate (goo(...)) += generic-methodgroup(bar(...)) [WorkItem(539906, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539906")] [Fact] public void CS0019ERR_BadBinaryOps11() @@ -419,20 +419,20 @@ static void far(T x) { } static void Main(string[] args) { C p = new C(); - boo foo = null; - foo += far;// OK - foo += far;// Invalid + boo goo = null; + goo += far;// OK + goo += far;// Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (10,16): error CS0123: No overload for 'far' matches delegate 'boo' - // foo += far;// Invalid + // goo += far;// Invalid Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "far").WithArguments("far", "boo") ); } - // non generic-delegate (foo(...)) += generic-methodgroup(bar(...)) + // non generic-delegate (goo(...)) += generic-methodgroup(bar(...)) [WorkItem(539906, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539906")] [Fact] public void CS0019ERR_BadBinaryOps12() @@ -445,15 +445,15 @@ static void far(T x) { } static void Main(string[] args) { C p = new C(); - boo foo = null; - foo += far;// OK - foo += far;// Invalid + boo goo = null; + goo += far;// OK + goo += far;// Invalid } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (10,16): error CS0123: No overload for 'far' matches delegate 'boo' - // foo += far;// Invalid + // goo += far;// Invalid Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "far").WithArguments("far", "boo") ); } @@ -1148,7 +1148,7 @@ public void CS0023ERR_BadUnaryOp_VoidMissingInstanceMethod() { void M() { - M().Foo(); + M().Goo(); } } "; @@ -1344,8 +1344,8 @@ public void CS0027ERR_ThisInBadContext_Interactive() this.c = this.a; int prop { get { return 1; } set { this.a = 1;} } -void foo() { - this.foo(); +void goo() { + this.goo(); this.a = this.b; object c = this; } @@ -1358,9 +1358,9 @@ class C { } - void foo() + void goo() { - this.foo(); + this.goo(); } }"; var comp = CreateCompilationWithMscorlib45( @@ -1882,10 +1882,10 @@ enum MyEnum static int Main() { - return Foo((MyEnum)null); + return Goo((MyEnum)null); } - static int Foo(MyEnum x) + static int Goo(MyEnum x) { return 1; } @@ -2311,7 +2311,7 @@ public void CS0119ERR_BadSKunknown01_switch() { public static void Main() { } - void foo(color color1) + void goo(color color1) { switch (color) { @@ -2710,14 +2710,14 @@ class C static void Main(string[] args) { abc p = new abc(); - boo foo = null; - foo += new boo(I.bar); - foo(); + boo goo = null; + goo += new boo(I.bar); + goo(); } }") .VerifyDiagnostics( // (16,24): error CS0120: An object reference is required for the non-static field, method, or property 'I.bar()' - // foo += new boo(I.bar); + // goo += new boo(I.bar); Diagnostic(ErrorCode.ERR_ObjectRequired, "I.bar").WithArguments("I.bar()"), // (14,13): warning CS0219: The variable 'p' is assigned but its value is never used // abc p = new abc(); @@ -2864,7 +2864,7 @@ class D object field2; object Property2 { get; set; } - public void Foo() + public void Goo() { object f = field; object p = Property; @@ -2879,13 +2879,13 @@ public static void Bar() object f2 = field2; object p2 = Property2; - Foo(); + Goo(); } } class E : C { - public void Foo() + public void Goo() { object f3 = field; object p3 = Property; @@ -2918,9 +2918,9 @@ public void Foo() // (27,25): error CS0120: An object reference is required for the non-static field, method, or property 'C.D.Property2' // object p2 = Property2; Diagnostic(ErrorCode.ERR_ObjectRequired, "Property2").WithArguments("C.D.Property2"), - // (28,13): error CS0120: An object reference is required for the non-static field, method, or property 'C.D.Foo()' - // Foo(); - Diagnostic(ErrorCode.ERR_ObjectRequired, "Foo").WithArguments("C.D.Foo()"), + // (28,13): error CS0120: An object reference is required for the non-static field, method, or property 'C.D.Goo()' + // Goo(); + Diagnostic(ErrorCode.ERR_ObjectRequired, "Goo").WithArguments("C.D.Goo()"), // (4,12): warning CS0649: Field 'C.field' is never assigned to, and will always have its default value null // object field; Diagnostic(ErrorCode.WRN_UnassignedInternalField, "field").WithArguments("C.field", "null"), @@ -3089,11 +3089,11 @@ interface I { } class Error { - static void Foo(I i) { } + static void Goo(I i) { } static void Main() { - Foo(new A.B()); + Goo(new A.B()); } } "; @@ -3116,7 +3116,7 @@ static void Main() Assert.Equal(CandidateReason.OverloadResolutionFailure, boundCall.CandidateReason); var constructedMethodSymbol = (MethodSymbol)(boundCall.CandidateSymbols[0]); - Assert.Equal("void Error.Foo(I i)", constructedMethodSymbol.ToTestDisplayString()); + Assert.Equal("void Error.Goo(I i)", constructedMethodSymbol.ToTestDisplayString()); var typeArgSymbol = constructedMethodSymbol.TypeArguments.Single(); Assert.Equal("A.ProtectedClass", typeArgSymbol.ToTestDisplayString()); @@ -3126,7 +3126,7 @@ static void Main() Assert.Equal("I", paramTypeSymbol.ToTestDisplayString()); Assert.False(model.IsAccessible(callPosition, typeArgSymbol), "Type should be inaccessible since type argument is inaccessible"); - // The original test attempted to verify that "Error.Foo" is an + // The original test attempted to verify that "Error.Goo" is an // inaccessible method when inside Error.Main. The C# specification nowhere gives // a special rule for constructed generic methods; the accessibility domain of // a method depends only on its declared accessibility and the declared accessibility @@ -3138,8 +3138,8 @@ static void Main() // Assert.False(model.IsAccessible(callPosition, constructedMethodSymbol), "Method should be inaccessible since parameter type is inaccessible"); compilation.VerifyDiagnostics( - // (16,9): error CS0122: 'Error.Foo(I)' is inaccessible due to its protection level - Diagnostic(ErrorCode.ERR_BadAccess, "Foo").WithArguments("Error.Foo(I)")); + // (16,9): error CS0122: 'Error.Goo(I)' is inaccessible due to its protection level + Diagnostic(ErrorCode.ERR_BadAccess, "Goo").WithArguments("Error.Goo(I)")); } [WorkItem(539628, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/539628")] @@ -3217,9 +3217,9 @@ static void far(T x) { } static void Main(string[] args) { C p = new C(); - boo foo = null; - foo += far;// Invalid - foo += far;// OK + boo goo = null; + goo += far;// Invalid + goo += far;// OK } }"; CreateStandardCompilation(text).VerifyDiagnostics( @@ -3238,7 +3238,7 @@ class C { public static void far(T x) { } public static void par(U x) { System.Console.WriteLine(""par""); } - public static boo foo = null; + public static boo goo = null; } class D @@ -3246,18 +3246,18 @@ class D static void Main(string[] args) { C p = new C(); - C.foo += C.far; - C.foo += C.par; - C.foo(byte.MaxValue); - C.foo(long.MaxValue); - C.foo(long.MaxValue); + C.goo += C.far; + C.goo += C.par; + C.goo(byte.MaxValue); + C.goo(long.MaxValue); + C.goo(long.MaxValue); } }"; CreateStandardCompilation(text).VerifyDiagnostics( // (15,24): error CS0123: No overload for 'C.far(long)' matches delegate 'boo' Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "C.far").WithArguments("C.far(long)", "boo").WithLocation(15, 24), // (16,32): error CS0123: No overload for 'par' matches delegate 'boo' - // C.foo += C.par; + // C.goo += C.par; Diagnostic(ErrorCode.ERR_MethDelegateMismatch, "par").WithArguments("par", "boo").WithLocation(16, 32), // (18,21): error CS1503: Argument 1: cannot convert from 'long' to 'short' Diagnostic(ErrorCode.ERR_BadArgType, "long.MaxValue").WithArguments("1", "long", "short").WithLocation(18, 21), @@ -5004,7 +5004,7 @@ static void Main(string[] args) { goto Label; } - public static void Foo() + public static void Goo() { Label: ; @@ -5435,7 +5435,7 @@ public void M1() { try { - Foo(); + Goo(); } catch (EG) { @@ -5445,7 +5445,7 @@ public void M1() } } - void Foo() { } + void Goo() { } }"; CreateStandardCompilation(source).VerifyDiagnostics( // (17,16): error CS0160: A previous catch clause already catches all exceptions of this or of a super type ('EG') @@ -5467,7 +5467,7 @@ public void M1() { try { - Foo(); + Goo(); } catch (EA) { @@ -5477,7 +5477,7 @@ public void M1() } } - void Foo() { } + void Goo() { } }"; CreateStandardCompilation(source).VerifyDiagnostics( // (18,16): error CS0160: A previous catch clause already catches all exceptions of this or of a super type ('EA') @@ -5503,7 +5503,7 @@ public override void M() { try { - Foo(); + Goo(); } catch (EG) { @@ -5516,7 +5516,7 @@ public override void M() } } - void Foo() { } + void Goo() { } } "; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( @@ -5564,7 +5564,7 @@ public override void M() va = (V[])egda; } - void Foo() { } + void Goo() { } } "; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics(); @@ -5590,7 +5590,7 @@ public override void M() { try { - Foo(); + Goo(); } catch (EG) { @@ -5603,7 +5603,7 @@ public override void M() } } - void Foo() { } + void Goo() { } } "; CreateCompilationWithMscorlibAndSystemCore(source).VerifyDiagnostics( @@ -6487,14 +6487,14 @@ struct S { public int a; - void Foo() + void Goo() { } S(int i) { // a = i; - Foo(); // CS0188 + Goo(); // CS0188 } } public static void Main() @@ -6505,8 +6505,8 @@ public static void Main() CreateStandardCompilation(text). VerifyDiagnostics( // (17,17): error CS0188: The 'this' object cannot be used before all of its fields are assigned to - // Foo(); // CS0188 - Diagnostic(ErrorCode.ERR_UseDefViolationThis, "Foo").WithArguments("this"), + // Goo(); // CS0188 + Diagnostic(ErrorCode.ERR_UseDefViolationThis, "Goo").WithArguments("this"), // (8,24): warning CS0649: Field 'MyNamespace.MyClass.S.a' is never assigned to, and will always have its default value 0 // public int a; Diagnostic(ErrorCode.WRN_UnassignedInternalField, "a").WithArguments("MyNamespace.MyClass.S.a", "0")); @@ -6942,30 +6942,30 @@ static MyDerived() public void WriteOfReadonlyStaticMemberOfAnotherInstantiation01() { var text = -@"public static class Foo +@"public static class Goo { - static Foo() + static Goo() { - Foo.X = 1; - Foo.Y = 2; - Foo.Y = 3; + Goo.X = 1; + Goo.Y = 2; + Goo.Y = 3; } public static readonly int X; public static int Y { get; } }"; CreateStandardCompilation(text, options: TestOptions.ReleaseDll).VerifyDiagnostics( - // (6,9): error CS0200: Property or indexer 'Foo.Y' cannot be assigned to -- it is read only - // Foo.Y = 2; - Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "Foo.Y").WithArguments("Foo.Y").WithLocation(6, 9) + // (6,9): error CS0200: Property or indexer 'Goo.Y' cannot be assigned to -- it is read only + // Goo.Y = 2; + Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "Goo.Y").WithArguments("Goo.Y").WithLocation(6, 9) ); CreateStandardCompilation(text, options: TestOptions.ReleaseDll, parseOptions: TestOptions.Regular.WithStrictFeature()).VerifyDiagnostics( // (5,9): error CS0198: A static readonly field cannot be assigned to (except in a static constructor or a variable initializer) - // Foo.X = 1; - Diagnostic(ErrorCode.ERR_AssgReadonlyStatic, "Foo.X").WithLocation(5, 9), - // (6,9): error CS0200: Property or indexer 'Foo.Y' cannot be assigned to -- it is read only - // Foo.Y = 2; - Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "Foo.Y").WithArguments("Foo.Y").WithLocation(6, 9) + // Goo.X = 1; + Diagnostic(ErrorCode.ERR_AssgReadonlyStatic, "Goo.X").WithLocation(5, 9), + // (6,9): error CS0200: Property or indexer 'Goo.Y' cannot be assigned to -- it is read only + // Goo.Y = 2; + Diagnostic(ErrorCode.ERR_AssgReadonlyProp, "Goo.Y").WithArguments("Goo.Y").WithLocation(6, 9) ); } @@ -6979,19 +6979,19 @@ class Program { static void Main(string[] args) { - Console.WriteLine(Foo.x); - Console.WriteLine(Foo.x); - Console.WriteLine(Foo.x); - Console.WriteLine(Foo.x); + Console.WriteLine(Goo.x); + Console.WriteLine(Goo.x); + Console.WriteLine(Goo.x); + Console.WriteLine(Goo.x); } } -public static class Foo +public static class Goo { - static Foo() + static Goo() { Console.WriteLine(""initializing for "" + typeof(T)); - Foo.x = typeof(T).Name; + Goo.x = typeof(T).Name; } public static readonly string x; @@ -8233,7 +8233,7 @@ public void CS0236ERR_FieldInitRefNonstatic_ObjectInitializer() { CreateStandardCompilation( @" -public class Foo +public class Goo { public int i; public string s; @@ -8243,7 +8243,7 @@ public class MemberInitializerTest { private int i =10; private string s = ""abc""; - private Foo f = new Foo{i = i, s = s}; + private Goo f = new Goo{i = i, s = s}; public static void Main() { @@ -8252,10 +8252,10 @@ public static void Main() ") .VerifyDiagnostics( // (12,33): error CS0236: A field initializer cannot reference the non-static field, method, or property 'MemberInitializerTest.i' - // private Foo f = new Foo{i = i, s = s}; + // private Goo f = new Goo{i = i, s = s}; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "i").WithArguments("MemberInitializerTest.i").WithLocation(12, 33), // (12,40): error CS0236: A field initializer cannot reference the non-static field, method, or property 'MemberInitializerTest.s' - // private Foo f = new Foo{i = i, s = s}; + // private Goo f = new Goo{i = i, s = s}; Diagnostic(ErrorCode.ERR_FieldInitRefNonstatic, "s").WithArguments("MemberInitializerTest.s").WithLocation(12, 40)); } @@ -9939,10 +9939,10 @@ public static DerivedClass DelegatedMethod(DerivedClass x) } static void Main(string[] args) { - MyDerivedDelegate foo1 = null; - foo1 += BaseClass.DelegatedMethod; - foo1 += DerivedClass.DelegatedMethod; - foo1(new DerivedClass()); + MyDerivedDelegate goo1 = null; + goo1 += BaseClass.DelegatedMethod; + goo1 += DerivedClass.DelegatedMethod; + goo1(new DerivedClass()); } } "; @@ -10148,14 +10148,14 @@ public void CS0431ERR_ColColWithTypeAlias() using AliasC = C; class C { - public class Foo { } + public class Goo { } } class Test { class C { } static int Main() { - AliasC::Foo foo = new AliasC::Foo(); + AliasC::Goo goo = new AliasC::Goo(); return 0; } }"; @@ -10913,7 +10913,7 @@ public void CS0623ERR_ArrayInitInBadPlace() var text = @" class X { - public void foo(int a) + public void goo(int a) { int[] x = { { 4 } }; //CS0623 } @@ -11456,7 +11456,7 @@ public static int Main() public void CS0819ERR_ImplicitlyTypedVariableMultipleDeclarator_Fields() { CreateCompilationWithMscorlib45(@" -var foo = 4, bar = 4.5; +var goo = 4, bar = 4.5; ", parseOptions: TestOptions.Script).VerifyDiagnostics( // (2,1): error CS0819: Implicitly-typed fields cannot have multiple declarators Diagnostic(ErrorCode.ERR_ImplicitlyTypedVariableMultipleDeclarator, "var")); @@ -11563,8 +11563,8 @@ public void CS0822ERR_ImplicitlyTypedVariableCannotBeConst_Fields() public void CS0825ERR_ImplicitlyTypedVariableCannotBeUsedAsTheTypeOfAParameter_Fields() { CreateCompilationWithMscorlib45(@" -void foo(var arg) { } -var foo(int arg) { return 2; } +void goo(var arg) { } +var goo(int arg) { return 2; } ", parseOptions: TestOptions.Script).VerifyDiagnostics( // (1,10): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code Diagnostic(ErrorCode.ERR_TypeVarNotFound, "var"), @@ -11576,8 +11576,8 @@ void foo(var arg) { } public void CS0825ERR_ImplicitlyTypedVariableCannotBeUsedAsTheTypeOfAParameter_Fields2() { CreateCompilationWithMscorlib45(@" -T foo() { return default(T); } -foo(); +T goo() { return default(T); } +goo(); ", parseOptions: TestOptions.Script).VerifyDiagnostics( // (2,5): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code Diagnostic(ErrorCode.ERR_TypeVarNotFound, "var")); @@ -11878,7 +11878,7 @@ public MyClass(object obj) } [MyClass(new { })] // CS0836 -public class ClassFoo +public class ClassGoo { } @@ -13163,19 +13163,19 @@ public void CS1503ERR_BadArgType_MixedMethodsAndTypes() var text = @" class A { - public static void Foo(int x) { } + public static void Goo(int x) { } } class B : A { - public class Foo { } + public class Goo { } } class C : B { - public static void Foo(string x) { } + public static void Goo(string x) { } static void Main() { - ((Foo))(1); + ((Goo))(1); } } "; @@ -13262,25 +13262,25 @@ public void CS1510ERR_RefLvalueExpected_04() var text = @"class C { - void Foo(ref System.Action t) {} - void Foo(ref System.Action t) {} + void Goo(ref System.Action t) {} + void Goo(ref System.Action t) {} void M() { - Foo(ref x => x = 1); - Foo(ref (x,y) => x = 1); - Foo(ref delegate (int x) {x = 1;}); + Goo(ref x => x = 1); + Goo(ref (x,y) => x = 1); + Goo(ref delegate (int x) {x = 1;}); } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (7,22): error CS1510: A ref or out argument must be an assignable variable - // Foo(ref x => x = 1); + // Goo(ref x => x = 1); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), // (8,27): error CS1510: A ref or out argument must be an assignable variable - // Foo(ref (x,y) => x = 1); + // Goo(ref (x,y) => x = 1); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), // (9,22): error CS1510: A ref or out argument must be an assignable variable - // Foo(ref delegate (int x) {x = 1;}); + // Goo(ref delegate (int x) {x = 1;}); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); } @@ -13290,25 +13290,25 @@ public void CS1510ERR_RefLvalueExpected_05() var text = @"class C { - void Foo(out System.Action t) {t = null;} - void Foo(out System.Action t) {t = null;} + void Goo(out System.Action t) {t = null;} + void Goo(out System.Action t) {t = null;} void M() { - Foo(out x => x = 1); - Foo(out (x,y) => x = 1); - Foo(out delegate (int x) {x = 1;}); + Goo(out x => x = 1); + Goo(out (x,y) => x = 1); + Goo(out delegate (int x) {x = 1;}); } } "; CreateStandardCompilation(text).VerifyDiagnostics( // (7,22): error CS1510: A ref or out argument must be an assignable variable - // Foo(out x => x = 1); + // Goo(out x => x = 1); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x = 1").WithLocation(7, 22), // (8,27): error CS1510: A ref or out argument must be an assignable variable - // Foo(out (x,y) => x = 1); + // Goo(out (x,y) => x = 1); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "(x,y) => x = 1").WithLocation(8, 27), // (9,22): error CS1510: A ref or out argument must be an assignable variable - // Foo(out delegate (int x) {x = 1;}); + // Goo(out delegate (int x) {x = 1;}); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "delegate (int x) {x = 1;}").WithLocation(9, 22)); } @@ -14146,13 +14146,13 @@ public void CS1618ERR_DelegateOnConditional_02() class MakeAnError { - class Foo: Attribute + class Goo: Attribute { - public Foo(object o) {} + public Goo(object o) {} } [Conditional(""DEBUG"")] - [Foo(new del(ConditionalMethod))] // CS1618 + [Goo(new del(ConditionalMethod))] // CS1618 public static void ConditionalMethod() { } @@ -14160,7 +14160,7 @@ public static void ConditionalMethod() "; CreateStandardCompilation(text).VerifyDiagnostics( // (15,18): error CS1618: Cannot create delegate with 'MakeAnError.ConditionalMethod()' because it has a Conditional attribute - // [Foo(new del(ConditionalMethod))] // CS1618 + // [Goo(new del(ConditionalMethod))] // CS1618 Diagnostic(ErrorCode.ERR_DelegateOnConditional, "ConditionalMethod").WithArguments("MakeAnError.ConditionalMethod()").WithLocation(15, 18)); } @@ -14500,7 +14500,7 @@ public void CS1636ERR_VarargsIterator() public class Test { - IEnumerable Foo(__arglist) + IEnumerable Goo(__arglist) { yield return 1; } @@ -14514,8 +14514,8 @@ static int Main(string[] args) var comp = CreateStandardCompilation(text); comp.VerifyDiagnostics( // (5,17): error CS1636: __arglist is not allowed in the parameter list of iterators -// IEnumerable Foo(__arglist) -Diagnostic(ErrorCode.ERR_VarargsIterator, "Foo")); +// IEnumerable Goo(__arglist) +Diagnostic(ErrorCode.ERR_VarargsIterator, "Goo")); } [Fact] @@ -15647,7 +15647,7 @@ public void CS1737ERR_DefaultValueBeforeRequiredValue() var text = @" class C { - public void Foo(string s = null, int x) + public void Goo(string s = null, int x) { } }"; @@ -15663,7 +15663,7 @@ public void DevDiv4792_OptionalBeforeParams() var text = @" class C { - public void Foo(string s = null, params int[] ints) + public void Goo(string s = null, params int[] ints) { } } @@ -17396,20 +17396,20 @@ static void Main() { dynamic d = 1; B b = new B(); - b.Foo(d); + b.Goo(d); } } public class B { } static public class Extension { - public static void Foo(this B b, int x) { } + public static void Goo(this B b, int x) { } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(text); comp.VerifyDiagnostics( -// (8,9): error CS1973: 'B' has no applicable method named 'Foo' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax. -// b.Foo(d); -Diagnostic(ErrorCode.ERR_BadArgTypeDynamicExtension, "b.Foo(d)").WithArguments("B", "Foo")); +// (8,9): error CS1973: 'B' has no applicable method named 'Goo' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax. +// b.Goo(d); +Diagnostic(ErrorCode.ERR_BadArgTypeDynamicExtension, "b.Goo(d)").WithArguments("B", "Goo")); } [Fact] @@ -17462,14 +17462,14 @@ class Program { static void M(dynamic d) { - d.Foo(M); + d.Goo(M); } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(text); comp.VerifyDiagnostics( // (6,15): error CS1976: Cannot use a method group as an argument to a dynamically dispatched operation. Did you intend to invoke the method? - // d.Foo(M); + // d.Goo(M); Diagnostic(ErrorCode.ERR_BadDynamicMethodArgMemgrp, "M")); } @@ -17481,17 +17481,17 @@ class Program { static void M(dynamic d) { - d.Foo(()=>{}); - d.Foo(delegate () {}); + d.Goo(()=>{}); + d.Goo(delegate () {}); } }"; var comp = CreateCompilationWithMscorlibAndSystemCore(text); comp.VerifyDiagnostics( // (6,15): error CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type. - // d.Foo(()=>{}); + // d.Goo(()=>{}); Diagnostic(ErrorCode.ERR_BadDynamicMethodArgLambda, "()=>{}"), // (7,15): error CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type. - // d.Foo(delegate () {}); + // d.Goo(delegate () {}); Diagnostic(ErrorCode.ERR_BadDynamicMethodArgLambda, "delegate () {}")); } @@ -17598,12 +17598,12 @@ class Program { unsafe static void M(dynamic d, int* i, System.TypedReference tr) { - d.Foo(i); - d.Foo(tr); - d.Foo(ref tr); - d.Foo(out tr); - d.Foo(out i); - d.Foo(ref i); + d.Goo(i); + d.Goo(tr); + d.Goo(ref tr); + d.Goo(out tr); + d.Goo(out i); + d.Goo(ref i); } } "; @@ -17636,7 +17636,7 @@ public void CS1763ERR_NotNullRefDefaultParameter02() string text = @" class Program { - public void Foo(T t = default(U)) where U : T + public void Goo(T t = default(U)) where U : T { } static void Main(string[] args) @@ -17646,7 +17646,7 @@ static void Main(string[] args) }"; CreateStandardCompilation(text).VerifyDiagnostics( // (4,29): error CS1763: 't' is of type 'T'. A default parameter value of a reference type other than string can only be initialized with null - // public void Foo(T t = default(U)) where U : T + // public void Goo(T t = default(U)) where U : T Diagnostic(ErrorCode.ERR_NotNullRefDefaultParameter, "t").WithArguments("t", "T")); } @@ -18937,11 +18937,11 @@ public static void TestVolatileByRef() Interlocked.Exchange(ref Method1(ref x).y, 0); // CS0420 for x // located as a function argument - foo(Interlocked.Increment(ref x)); // no CS0420 + goo(Interlocked.Increment(ref x)); // no CS0420 } - public static int foo(int x) + public static int goo(int x) { return x; } @@ -18978,21 +18978,21 @@ public void Repro728380() class Test { static volatile int x; - unsafe static void foo(int* pX) { } + unsafe static void goo(int* pX) { } static int Main() { - unsafe { Test.foo(&x); } + unsafe { Test.goo(&x); } return 1; } } "; CreateStandardCompilation(source, options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( // (9,27): error CS0212: You can only take the address of an unfixed expression inside of a fixed statement initializer - // unsafe { Test.foo(&x); } + // unsafe { Test.goo(&x); } Diagnostic(ErrorCode.ERR_FixedNeeded, "&x"), // (9,28): warning CS0420: 'Test.x': a reference to a volatile field will not be treated as volatile - // unsafe { Test.foo(&x); } + // unsafe { Test.goo(&x); } Diagnostic(ErrorCode.WRN_VolatileByRef, "x").WithArguments("Test.x")); } @@ -20347,8 +20347,8 @@ class Test { static int Main() { - VeryLong foo = null; - Console.WriteLine(foo); + VeryLong goo = null; + Console.WriteLine(goo); return 1; } } @@ -21486,14 +21486,14 @@ class Myclass static void Main() { dynamic d = null; - // Warning because Foo might be conditional. - Foo(d); + // Warning because Goo might be conditional. + Goo(d); // No warning; only the two-parameter Bar is conditional. Bar(d); } [Conditional(""DEBUG"")] - static void Foo(string d) {} + static void Goo(string d) {} [Conditional(""DEBUG"")] static void Bar(int x, int y) {} @@ -21503,9 +21503,9 @@ static void Bar(string x) {} var comp = CreateCompilationWithMscorlibAndSystemCore(text); comp.VerifyDiagnostics( -// (9,9): warning CS1974: The dynamically dispatched call to method 'Foo' may fail at runtime because one or more applicable overloads are conditional methods. -// Foo(d); -Diagnostic(ErrorCode.WRN_DynamicDispatchToConditionalMethod, "Foo(d)").WithArguments("Foo")); +// (9,9): warning CS1974: The dynamically dispatched call to method 'Goo' may fail at runtime because one or more applicable overloads are conditional methods. +// Goo(d); +Diagnostic(ErrorCode.WRN_DynamicDispatchToConditionalMethod, "Goo(d)").WithArguments("Goo")); } [Fact] @@ -21685,7 +21685,7 @@ namespace Namespace1.Namespace2 { public interface I { - void Foo(); + void Goo(); } public class OuterGenericClass @@ -21694,7 +21694,7 @@ public class NestedClass : OuterGenericClass { } public class C : I { - void I.Foo() + void I.Goo() { } } @@ -21703,7 +21703,7 @@ public class C : I "; // This error will necessarily have a very long error string. CreateStandardCompilation(text).VerifyEmitDiagnostics( - Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "Foo").WithArguments("Namespace1.Namespace2.I.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Foo")); + Diagnostic(ErrorCode.ERR_MetadataNameTooLong, "Goo").WithArguments("Namespace1.Namespace2.I.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass,Namespace1.Namespace2.OuterGenericClass.NestedClass>.NestedClass>.NestedClass>.NestedClass>.NestedClass>.Goo")); } #endregion @@ -21781,9 +21781,9 @@ public void DelegateCreationWithRefOut() using System; public class Program { - static Func Foo(Func t) { return t; } - static Func Bar = Foo(x => x); - static Func BarP => Foo(x => x); + static Func Goo(Func t) { return t; } + static Func Bar = Goo(x => x); + static Func BarP => Goo(x => x); static T Id(T id) => id; static void Test(Func Baz) @@ -21793,11 +21793,11 @@ static void Test(Func Baz) var z2 = new Func(ref Baz); // compat var z3 = new Func(ref k); // compat var z4 = new Func(ref x => x); - var z5 = new Func(ref Foo(x => x)); + var z5 = new Func(ref Goo(x => x)); var z6 = new Func(ref BarP); var z7 = new Func(ref new Func(x => x)); var z8 = new Func(ref Program.BarP); - var z9 = new Func(ref Program.Foo(x => x)); + var z9 = new Func(ref Program.Goo(x => x)); var z10 = new Func(ref Id); // compat } }"; @@ -21806,8 +21806,8 @@ static void Test(Func Baz) // var z4 = new Func(ref x => x); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), // (17,47): error CS1510: A ref or out argument must be an assignable variable - // var z5 = new Func(ref Foo(x => x)); - Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Foo(x => x)").WithLocation(17, 47), + // var z5 = new Func(ref Goo(x => x)); + Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo(x => x)").WithLocation(17, 47), // (18,43): error CS0206: A property or indexer may not be passed as an out or ref parameter // var z6 = new Func(ref BarP); Diagnostic(ErrorCode.ERR_RefProperty, "ref BarP").WithArguments("Program.BarP").WithLocation(18, 43), @@ -21818,8 +21818,8 @@ static void Test(Func Baz) // var z8 = new Func(ref Program.BarP); Diagnostic(ErrorCode.ERR_RefProperty, "ref Program.BarP").WithArguments("Program.BarP").WithLocation(20, 43), // (21,47): error CS1510: A ref or out argument must be an assignable variable - // var z9 = new Func(ref Program.Foo(x => x)); - Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Foo(x => x)").WithLocation(21, 47)); + // var z9 = new Func(ref Program.Goo(x => x)); + Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo(x => x)").WithLocation(21, 47)); CreateStandardCompilation(source, parseOptions: TestOptions.Regular.WithStrictFeature()).VerifyDiagnostics( // (13,47): error CS0149: Method name expected @@ -21835,8 +21835,8 @@ static void Test(Func Baz) // var z4 = new Func(ref x => x); Diagnostic(ErrorCode.ERR_RefLvalueExpected, "x => x").WithLocation(16, 47), // (17,47): error CS1510: A ref or out argument must be an assignable variable - // var z5 = new Func(ref Foo(x => x)); - Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Foo(x => x)").WithLocation(17, 47), + // var z5 = new Func(ref Goo(x => x)); + Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Goo(x => x)").WithLocation(17, 47), // (18,47): error CS0206: A property or indexer may not be passed as an out or ref parameter // var z6 = new Func(ref BarP); Diagnostic(ErrorCode.ERR_RefProperty, "BarP").WithArguments("Program.BarP").WithLocation(18, 47), @@ -21847,8 +21847,8 @@ static void Test(Func Baz) // var z8 = new Func(ref Program.BarP); Diagnostic(ErrorCode.ERR_RefProperty, "Program.BarP").WithArguments("Program.BarP").WithLocation(20, 47), // (21,47): error CS1510: A ref or out argument must be an assignable variable - // var z9 = new Func(ref Program.Foo(x => x)); - Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Foo(x => x)").WithLocation(21, 47), + // var z9 = new Func(ref Program.Goo(x => x)); + Diagnostic(ErrorCode.ERR_RefLvalueExpected, "Program.Goo(x => x)").WithLocation(21, 47), // (22,48): error CS1657: Cannot pass 'Id' as a ref or out argument because it is a 'method group' // var z10 = new Func(ref Id); // compat Diagnostic(ErrorCode.ERR_RefReadonlyLocalCause, "Id").WithArguments("Id", "method group").WithLocation(22, 48)); @@ -21863,8 +21863,8 @@ public void DelegateCreationWithRefOut_Parens() using System; public class Program { - static Func Foo(Func t) { return t; } - static Func Bar = Foo(x => x); + static Func Goo(Func t) { return t; } + static Func Bar = Goo(x => x); static T Id(T id) => id; @@ -22292,7 +22292,7 @@ class C builder.AppendFormat("int {0}1;\n", longE); builder.AppendFormat("event System.Action {0}2;\n", longE); builder.AppendFormat("public void {0}3() {{ }}\n", longE); - builder.AppendFormat("public void foo(int {0}4) {{ }}\n", longE); + builder.AppendFormat("public void goo(int {0}4) {{ }}\n", longE); builder.AppendFormat("public string {0}5 {{ get; set; }}\n", longE); builder.AppendLine(@" @@ -22719,7 +22719,7 @@ public void Bug630799() class Program { - static void Foo() where T : S where S : Exception + static void Goo() where T : S where S : Exception { try { @@ -23016,7 +23016,7 @@ class Program { static void Main(string[] args) { - var o = new Foo(); + var o = new Goo(); var x = o.E.Compile()().Pop(); System.Console.WriteLine(x); } @@ -23027,7 +23027,7 @@ static class StackExtensions public static void Add(this Stack s, T x) => s.Push(x); } - class Foo + class Goo { public Expression>> E = () => new Stack { 42 }; } @@ -23242,7 +23242,7 @@ static void Main() System.Console.WriteLine(i); } - static void Foo() + static void Goo() { int i; var s = new Dictionary () {[i = 1] = 2}; diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/StructsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/StructsTests.cs index 99357d8b8970b..315abfd8bd604 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/StructsTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/StructsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting; @@ -90,12 +90,12 @@ static void Main() public void TestConstructorStruct() { var text = @" -struct Foo +struct Goo { - public Foo(int x) : this(5, 6) + public Goo(int x) : this(5, 6) { } - public Foo(int x, int y) + public Goo(int x, int y) { m_x = x; m_y = y; @@ -279,7 +279,7 @@ public void TestConstructorForGenericStruct() struct C { public int num; - public int Foo1() + public int Goo1() { return this.num; } @@ -290,7 +290,7 @@ static void Main(string[] args) { C c; c.num = 1; - bool verify = c.Foo1() == 1; + bool verify = c.Goo1() == 1; Console.WriteLine(verify); } } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/SuppressAccessibilityChecksTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/SuppressAccessibilityChecksTests.cs index b4b00adcc4837..41cd2e124fc03 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/SuppressAccessibilityChecksTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/SuppressAccessibilityChecksTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; using System.Linq; @@ -79,7 +79,7 @@ public void TestAccessChecksInSpeculativeSemanticModel() SemanticModel speculativeSemanticModel; - var statement = SyntaxFactory.ParseStatement("var foo = new A().M();"); + var statement = SyntaxFactory.ParseStatement("var goo = new A().M();"); semanticModel.TryGetSpeculativeSemanticModel(position, statement, out speculativeSemanticModel); var creationExpression = diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/SwitchTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/SwitchTests.cs index 85304f7b140a1..61d8e50f7d5d3 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/SwitchTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/SwitchTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; @@ -100,7 +100,7 @@ public void CS0119_TypeUsedAsSwitchExpression() { public static void Main() { } - void foo(color color1) + void goo(color color1) { switch (color) { @@ -198,7 +198,7 @@ public static int Main() return 1; } - public void foo(char c) + public void goo(char c) { switch (c) { @@ -260,7 +260,7 @@ public static int Main() return 1; } - public void foo(int i) + public void goo(int i) { switch (i) { @@ -271,7 +271,7 @@ public void foo(int i) } } - public void foo2(char i) + public void goo2(char i) { switch (i) { @@ -2798,9 +2798,9 @@ static int Main() public void CS0165_SwitchScopeUnassignedVariable() { var text = @" -public class Foo +public class Goo { - public Foo() { i = 99; } + public Goo() { i = 99; } public void Bar() { i = 0; } public int GetI() { return(i); } int i; @@ -2814,7 +2814,7 @@ public static int Main(string [] args) switch (s) { case 21: int j = 0; - Foo f = new Foo(); + Goo f = new Goo(); j++; break; case 23: @@ -2848,52 +2848,52 @@ class SwitchTest { public static int Main() { - int foo; // unassigned foo + int goo; // unassigned goo switch (3) { case 1: - foo = 1; + goo = 1; break; case 2: - foo = 2; + goo = 2; goto case 1; } - Console.WriteLine(foo); + Console.WriteLine(goo); return 1; } }"; CreateStandardCompilation(text, parseOptions: TestOptions.Regular6).VerifyDiagnostics( // (10,17): warning CS0162: Unreachable code detected - // foo = 1; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(10, 17), + // goo = 1; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(10, 17), // (13,17): warning CS0162: Unreachable code detected - // foo = 2; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(13, 17), - // (17,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(17, 27)); + // goo = 2; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(13, 17), + // (17,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(17, 27)); CreateStandardCompilation(text, parseOptions: TestOptions.Regular6WithV7SwitchBinder).VerifyDiagnostics( // (10,17): warning CS0162: Unreachable code detected - // foo = 1; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(10, 17), + // goo = 1; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(10, 17), // (13,17): warning CS0162: Unreachable code detected - // foo = 2; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(13, 17), - // (17,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(17, 27)); + // goo = 2; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(13, 17), + // (17,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(17, 27)); CreateStandardCompilation(text).VerifyDiagnostics( // (10,17): warning CS0162: Unreachable code detected - // foo = 1; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(10, 17), + // goo = 1; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(10, 17), // (13,17): warning CS0162: Unreachable code detected - // foo = 2; - Diagnostic(ErrorCode.WRN_UnreachableCode, "foo").WithLocation(13, 17), - // (17,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(17, 27)); + // goo = 2; + Diagnostic(ErrorCode.WRN_UnreachableCode, "goo").WithLocation(13, 17), + // (17,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(17, 27)); } [Fact] @@ -2905,7 +2905,7 @@ class SwitchTest public static int Main() { int i = 3; - int foo; // unassigned foo + int goo; // unassigned goo switch (i) { @@ -2916,13 +2916,13 @@ public static int Main() { if (i > 0) { - break; // foo is not definitely assigned here + break; // goo is not definitely assigned here } throw new System.ApplicationException(); } catch(Exception) { - foo = 1; + goo = 1; break; } case 2: @@ -2930,31 +2930,31 @@ public static int Main() case 3: if (true) { - foo = 1; + goo = 1; goto case 2; } default: - foo = 1; + goo = 1; break; } - Console.WriteLine(foo); // CS0165 - return foo; + Console.WriteLine(goo); // CS0165 + return goo; } } "; CreateStandardCompilation(text, parseOptions: TestOptions.Regular6).VerifyDiagnostics( - // (40,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); // CS0165 - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(40, 27)); + // (40,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); // CS0165 + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(40, 27)); CreateStandardCompilation(text, parseOptions: TestOptions.Regular6WithV7SwitchBinder).VerifyDiagnostics( - // (40,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); // CS0165 - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(40, 27)); + // (40,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); // CS0165 + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(40, 27)); CreateStandardCompilation(text).VerifyDiagnostics( - // (40,27): error CS0165: Use of unassigned local variable 'foo' - // Console.WriteLine(foo); // CS0165 - Diagnostic(ErrorCode.ERR_UseDefViolation, "foo").WithArguments("foo").WithLocation(40, 27)); + // (40,27): error CS0165: Use of unassigned local variable 'goo' + // Console.WriteLine(goo); // CS0165 + Diagnostic(ErrorCode.ERR_UseDefViolation, "goo").WithArguments("goo").WithLocation(40, 27)); } #endregion diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/SynthesizedStaticConstructorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/SynthesizedStaticConstructorTests.cs index 85b03d522aa6b..f70fa0815924b 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/SynthesizedStaticConstructorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/SynthesizedStaticConstructorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -33,7 +33,7 @@ class C { int i1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -50,7 +50,7 @@ class C int i1; static int s1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -67,7 +67,7 @@ class C int i1; static int s1 = 1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -84,7 +84,7 @@ class C int i1; const int s1 = 1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -118,7 +118,7 @@ static C() { } int i1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -137,7 +137,7 @@ static C() { } int i1; static int s1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -156,7 +156,7 @@ static C() { } int i1; static int s1 = 1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); @@ -175,7 +175,7 @@ static C() { } int i1; const int s1 = 1; - static void Foo() { } + static void Goo() { } }"; var typeSymbol = CompileAndExtractTypeSymbol(source); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs index e2483a77e1e47..7298a477edc62 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -107,7 +107,7 @@ public void CompilationNotUnsafe2() var text = @" class C { - unsafe void Foo() + unsafe void Goo() { } } @@ -115,7 +115,7 @@ unsafe void Foo() CreateStandardCompilation(text, options: TestOptions.UnsafeReleaseDll.WithAllowUnsafe(false)).VerifyDiagnostics( // (4,17): error CS0227: Unsafe code may only appear if compiling with /unsafe - Diagnostic(ErrorCode.ERR_IllegalUnsafe, "Foo")); + Diagnostic(ErrorCode.ERR_IllegalUnsafe, "Goo")); CreateStandardCompilation(text, options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics(); } @@ -126,7 +126,7 @@ public void CompilationNotUnsafe3() var text = @" class C { - void Foo() + void Goo() { unsafe { } } @@ -146,7 +146,7 @@ public void IteratorUnsafe1() var text = @" unsafe class C { - System.Collections.Generic.IEnumerator Foo() + System.Collections.Generic.IEnumerator Goo() { yield return 1; } @@ -162,7 +162,7 @@ public void IteratorUnsafe2() var text = @" class C { - unsafe System.Collections.Generic.IEnumerator Foo() + unsafe System.Collections.Generic.IEnumerator Goo() { yield return 1; } @@ -171,7 +171,7 @@ unsafe System.Collections.Generic.IEnumerator Foo() CreateStandardCompilation(text, options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( // (4,56): error CS1629: Unsafe code may not appear in iterators - Diagnostic(ErrorCode.ERR_IllegalInnerUnsafe, "Foo")); + Diagnostic(ErrorCode.ERR_IllegalInnerUnsafe, "Goo")); } [Fact] @@ -180,7 +180,7 @@ public void IteratorUnsafe3() var text = @" class C { - System.Collections.Generic.IEnumerator Foo() + System.Collections.Generic.IEnumerator Goo() { unsafe { } yield return 1; @@ -199,7 +199,7 @@ public void IteratorUnsafe4() var text = @" unsafe class C { - System.Collections.Generic.IEnumerator Foo() + System.Collections.Generic.IEnumerator Goo() { unsafe { } yield return 1; @@ -219,7 +219,7 @@ public void IteratorUnsafe5() var text = @" unsafe class C { - System.Collections.Generic.IEnumerator Foo() + System.Collections.Generic.IEnumerator Goo() { System.Action a = () => { unsafe { } }; yield return 1; @@ -971,47 +971,47 @@ public void UnsafeCallParamArrays() {{ {1} static void Main() {{ - {{ Foo(); }} - {{ Foo(null); }} - {{ Foo((int*)1); }} - {{ Foo(new int*[2]); }} + {{ Goo(); }} + {{ Goo(null); }} + {{ Goo((int*)1); }} + {{ Goo(new int*[2]); }} }} - {1} static void Foo(params int*[] x) {{ }} + {1} static void Goo(params int*[] x) {{ }} }} "; CompareUnsafeDiagnostics(template, // (12,29): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // static void Foo(params int*[] x) { } + // static void Goo(params int*[] x) { } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (6,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo()"), + // { Goo(); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo()"), // (7,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(null); } + // { Goo(null); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "null"), // (7,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(null); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo(null)"), + // { Goo(null); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo(null)"), // (8,16): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } + // { Goo((int*)1); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (8,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } + // { Goo((int*)1); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "(int*)1"), // (8,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo((int*)1)"), + // { Goo((int*)1); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo((int*)1)"), // (9,19): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(new int*[2]); } + // { Goo(new int*[2]); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (9,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(new int*[2]); } + // { Goo(new int*[2]); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "new int*[2]"), // (9,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(new int*[2]); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo(new int*[2])") + // { Goo(new int*[2]); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo(new int*[2])") ); } @@ -1024,37 +1024,37 @@ public void UnsafeCallOptionalParameters() {{ {1} static void Main() {{ - {{ Foo(); }} - {{ Foo(null); }} - {{ Foo((int*)1); }} + {{ Goo(); }} + {{ Goo(null); }} + {{ Goo((int*)1); }} }} - {1} static void Foo(int* p = null) {{ }} + {1} static void Goo(int* p = null) {{ }} }} "; CompareUnsafeDiagnostics(template, // (11,22): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // static void Foo(int* p = null) { } + // static void Goo(int* p = null) { } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (6,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo()"), + // { Goo(); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo()"), // (7,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(null); } + // { Goo(null); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "null"), // (7,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo(null); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo(null)"), + // { Goo(null); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo(null)"), // (8,16): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } + // { Goo((int*)1); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (8,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } + // { Goo((int*)1); } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "(int*)1"), // (8,11): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { Foo((int*)1); } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo((int*)1)") + // { Goo((int*)1); } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo((int*)1)") ); } @@ -1403,24 +1403,24 @@ public void UnsafeDelegateAssignment() D d; {{ d = delegate {{ }}; }} {{ d = null; }} - {{ d = Foo; }} + {{ d = Goo; }} }} {1} delegate void D(int* x = null); - {1} static void Foo(int* x = null) {{ }} + {1} static void Goo(int* x = null) {{ }} }} "; CompareUnsafeDiagnostics(template, // (9,15): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // { d = Foo; } - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo"), + // { d = Goo; } + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo"), // (12,22): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context // delegate void D(int* x = null); Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*"), // (13,22): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // static void Foo(int* x = null) { } + // static void Goo(int* x = null) { } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "int*")); } @@ -1453,24 +1453,24 @@ public void MethodCallWithNullAsPointerArg() var template = @" {0} class Test {{ - {1} static void Foo(void* p) {{ }} + {1} static void Goo(void* p) {{ }} {1} static void Main() {{ - Foo(null); + Goo(null); }} }} "; CompareUnsafeDiagnostics(template, // (4,22): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // static void Foo(void* p) { } + // static void Goo(void* p) { } Diagnostic(ErrorCode.ERR_UnsafeNeeded, "void*"), // (7,13): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // Foo(null); + // Goo(null); Diagnostic(ErrorCode.ERR_UnsafeNeeded, "null"), // (7,9): error CS0214: Pointers and fixed size buffers may only be used in an unsafe context - // Foo(null); - Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Foo(null)") + // Goo(null); + Diagnostic(ErrorCode.ERR_UnsafeNeeded, "Goo(null)") ); } @@ -3108,18 +3108,18 @@ unsafe class C { int M(int param) { - var z = from x in new int[2] select Foo(&x); + var z = from x in new int[2] select Goo(&x); return 0; } - int Foo(int* p) { return 0; } + int Goo(int* p) { return 0; } } "; // NOTE: this is a breaking change - dev10 allows this. CreateCompilationWithMscorlibAndSystemCore(text, options: TestOptions.UnsafeReleaseDll).VerifyDiagnostics( // (8,50): error CS0211: Cannot take the address of the given expression - // var z = from x in new int[2] select Foo(&x); + // var z = from x in new int[2] select Goo(&x); Diagnostic(ErrorCode.ERR_InvalidAddrOp, "x").WithArguments("x")); } @@ -3208,7 +3208,7 @@ int M(int param) p = &1; //CS0211 (can't addr) p = &array[0]; //CS0212 (need fixed) p = &(local = 1); //CS0211 - p = &foo; //CS0103 (no foo) + p = &goo; //CS0103 (no goo) p = &base.f; //CS0212 p = &(local + local); //CS0211 p = &M(local); //CS0211 @@ -3249,7 +3249,7 @@ int M(int param) return 0; } - int Foo(int* p) { return 0; } + int Goo(int* p) { return 0; } static void Main() { } } @@ -3277,9 +3277,9 @@ enum Color // (25,15): error CS0211: Cannot take the address of the given expression // p = &(local = 1); //CS0211 Diagnostic(ErrorCode.ERR_InvalidAddrOp, "local = 1"), - // (26,14): error CS0103: The name 'foo' does not exist in the current context - // p = &foo; //CS0103 (no foo) - Diagnostic(ErrorCode.ERR_NameNotInContext, "foo").WithArguments("foo"), + // (26,14): error CS0103: The name 'goo' does not exist in the current context + // p = &goo; //CS0103 (no goo) + Diagnostic(ErrorCode.ERR_NameNotInContext, "goo").WithArguments("goo"), // (27,13): error CS0212: You can only take the address of an unfixed expression inside of a fixed statement initializer // p = &base.f; //CS0212 Diagnostic(ErrorCode.ERR_FixedNeeded, "&base.f"), @@ -3762,7 +3762,7 @@ unsafe public struct Test { private delegate int D(); public fixed int i[1]; - public int foo() + public int goo() { Test t = this; t.i[0] = 5; @@ -6265,7 +6265,7 @@ unsafe class C int f; int[] a; - void Foo() + void Goo() { fixed (int* q = &f, r = &q[1]) //CS0213 { @@ -7723,17 +7723,17 @@ public void PathalogicalRefStructPtrMultiDimensionalArray() var text = @" class C { - class Foo3 { + class Goo3 { internal struct Struct1 {} } - unsafe void NMethodCecilNameHelper_Parameter_AllTogether(ref Foo3.Struct1**[][,,] ppi) { } + unsafe void NMethodCecilNameHelper_Parameter_AllTogether(ref Goo3.Struct1**[][,,] ppi) { } } "; CreateStandardCompilation(text, options: TestOptions.UnsafeDebugDll).VerifyDiagnostics( - // (8,67): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('C.Foo3.Struct1') - // unsafe void NMethodCecilNameHelper_Parameter_AllTogether(ref Foo3.Struct1**[][,,] ppi) { } - Diagnostic(ErrorCode.ERR_ManagedAddr, "Foo3.Struct1*").WithArguments("C.Foo3.Struct1").WithLocation(8, 67)); + // (8,67): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('C.Goo3.Struct1') + // unsafe void NMethodCecilNameHelper_Parameter_AllTogether(ref Goo3.Struct1**[][,,] ppi) { } + Diagnostic(ErrorCode.ERR_ManagedAddr, "Goo3.Struct1*").WithArguments("C.Goo3.Struct1").WithLocation(8, 67)); } @@ -8091,7 +8091,7 @@ public void UnboxPointer() var text = @" class C { - unsafe void Foo(object obj) + unsafe void Goo(object obj) { var x = (int*)obj; } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UseSiteErrorTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UseSiteErrorTests.cs index 7d9897e33375e..929008df10dad 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UseSiteErrorTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UseSiteErrorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -963,16 +963,16 @@ public void TestDelegatesWithNoInvoke() { - public static T foo(DelegateWithoutInvoke.DelegateGenericFunctionWithoutInvoke del) + public static T goo(DelegateWithoutInvoke.DelegateGenericFunctionWithoutInvoke del) { - return del(""foo""); // will show ERR_InvalidDelegateType instead of ERR_NoSuchMemberOrExtension + return del(""goo""); // will show ERR_InvalidDelegateType instead of ERR_NoSuchMemberOrExtension } public static void Main() { DelegateWithoutInvoke.DelegateSubWithoutInvoke myDelegate1 = bar; - myDelegate1.Invoke(""foo""); // will show an ERR_NoSuchMemberOrExtension + myDelegate1.Invoke(""goo""); // will show an ERR_NoSuchMemberOrExtension DelegateWithoutInvoke.DelegateSubWithoutInvoke myDelegate2 = new DelegateWithoutInvoke.DelegateSubWithoutInvoke(myDelegate1); object myDelegate3 = new DelegateWithoutInvoke.DelegateSubWithoutInvoke(bar2); DelegateWithoutInvoke.DelegateSubWithoutInvoke myDelegate4 = x => System.Console.WriteLine(""Hello World""); @@ -993,13 +993,13 @@ public static void bar2(int p) var delegatesWithoutInvokeReference = TestReferences.SymbolsTests.DelegateImplementation.DelegatesWithoutInvoke; CreateStandardCompilation(text, new MetadataReference[] { delegatesWithoutInvokeReference }).VerifyDiagnostics( // (7,16): error CS7023: Delegate 'DelegateWithoutInvoke.DelegateGenericFunctionWithoutInvoke' has no invoke method or an invoke method with a return type or parameter types that are not supported. - // return del("foo"); // will show ERR_InvalidDelegateType instead of ERR_NoSuchMemberOrExtension - Diagnostic(ErrorCode.ERR_InvalidDelegateType, @"del(""foo"")").WithArguments("DelegateWithoutInvoke.DelegateGenericFunctionWithoutInvoke"), + // return del("goo"); // will show ERR_InvalidDelegateType instead of ERR_NoSuchMemberOrExtension + Diagnostic(ErrorCode.ERR_InvalidDelegateType, @"del(""goo"")").WithArguments("DelegateWithoutInvoke.DelegateGenericFunctionWithoutInvoke"), // (13,70): error CS7023: Delegate 'DelegateWithoutInvoke.DelegateSubWithoutInvoke' has no invoke method or an invoke method with a return type or parameter types that are not supported. // DelegateWithoutInvoke.DelegateSubWithoutInvoke myDelegate1 = bar; Diagnostic(ErrorCode.ERR_InvalidDelegateType, "bar").WithArguments("DelegateWithoutInvoke.DelegateSubWithoutInvoke"), // (14,21): error CS1061: 'DelegateWithoutInvoke.DelegateSubWithoutInvoke' does not contain a definition for 'Invoke' and no extension method 'Invoke' accepting a first argument of type 'DelegateWithoutInvoke.DelegateSubWithoutInvoke' could be found (are you missing a using directive or an assembly reference?) - // myDelegate1.Invoke("foo"); // will show an ERR_NoSuchMemberOrExtension + // myDelegate1.Invoke("goo"); // will show an ERR_NoSuchMemberOrExtension Diagnostic(ErrorCode.ERR_NoSuchMemberOrExtension, "Invoke").WithArguments("DelegateWithoutInvoke.DelegateSubWithoutInvoke", "Invoke"), // (15,70): error CS7023: Delegate 'DelegateWithoutInvoke.DelegateSubWithoutInvoke' has no invoke method or an invoke method with a return type or parameter types that are not supported. // DelegateWithoutInvoke.DelegateSubWithoutInvoke myDelegate2 = new DelegateWithoutInvoke.DelegateSubWithoutInvoke(myDelegate1); @@ -1022,15 +1022,15 @@ public void TestDelegatesWithUseSiteErrors() var text = @"class C { - public static T foo(CSharpErrors.DelegateParameterType3 del) + public static T goo(CSharpErrors.DelegateParameterType3 del) { - return del.Invoke(""foo""); + return del.Invoke(""goo""); } public static void Main() { CSharpErrors.DelegateReturnType1 myDelegate1 = bar; - myDelegate1(""foo""); + myDelegate1(""goo""); CSharpErrors.DelegateReturnType1 myDelegate2 = new CSharpErrors.DelegateReturnType1(myDelegate1); object myDelegate3 = new CSharpErrors.DelegateReturnType1(bar); CSharpErrors.DelegateReturnType1 myDelegate4 = x => System.Console.WriteLine(""Hello World""); @@ -1052,14 +1052,14 @@ public static void bar2(int p) var ilAssemblyReference = TestReferences.SymbolsTests.UseSiteErrors.IL; CreateStandardCompilation(text, new MetadataReference[] { csharpAssemblyReference, ilAssemblyReference }).VerifyDiagnostics( // (5,16): error CS0012: The type 'UnavailableClass<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. - // return del.Invoke("foo"); + // return del.Invoke("goo"); Diagnostic(ErrorCode.ERR_NoTypeDef, "del.Invoke").WithArguments("UnavailableClass<>", "Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), // (13,56): error CS0012: The type 'UnavailableClass' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // CSharpErrors.DelegateReturnType1 myDelegate1 = bar; Diagnostic(ErrorCode.ERR_NoTypeDef, "bar").WithArguments("UnavailableClass", "Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), // (14,9): error CS0012: The type 'UnavailableClass' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. - // myDelegate1("foo"); - Diagnostic(ErrorCode.ERR_NoTypeDef, @"myDelegate1(""foo"")").WithArguments("UnavailableClass", "Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), + // myDelegate1("goo"); + Diagnostic(ErrorCode.ERR_NoTypeDef, @"myDelegate1(""goo"")").WithArguments("UnavailableClass", "Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), // (15,56): error CS0012: The type 'UnavailableClass' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. // CSharpErrors.DelegateReturnType1 myDelegate2 = new CSharpErrors.DelegateReturnType1(myDelegate1); Diagnostic(ErrorCode.ERR_NoTypeDef, "new CSharpErrors.DelegateReturnType1(myDelegate1)").WithArguments("UnavailableClass", "Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), @@ -1125,12 +1125,12 @@ public class X {} var libSource = @" public interface I { - void Foo(X a); + void Goo(X a); } public class C { - public void Foo(X a) { } + public void Goo(X a) { } } "; var lib = CreateStandardCompilation(libSource, new[] { xRef }, assemblyName: "Test"); @@ -1157,12 +1157,12 @@ public class X {} var libSource = @" public interface I { - void Foo(X a); + void Goo(X a); } public class C { - public virtual void Foo(X a) { } + public virtual void Goo(X a) { } } "; var lib = CreateStandardCompilation(libSource, new[] { xRef }, assemblyName: "Lib"); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UserDefinedConversionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UserDefinedConversionTests.cs index ed5e79d615d85..615c5378769aa 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UserDefinedConversionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UserDefinedConversionTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; @@ -1371,7 +1371,7 @@ public void TestBug11216() { // An ambiguous user-defined conversion should be considered a valid conversion // for the purposes of overload resolution; that is, this program should say that - // Foo(B) and Foo(C) are both applicable candidates, and that neither is better, + // Goo(B) and Goo(C) are both applicable candidates, and that neither is better, // even though the conversion from A to B is ambiguous. string source = @" @@ -1380,11 +1380,11 @@ class Program static void Main() { A x = null; - Foo(x); + Goo(x); } - static void Foo(B x) { } - static void Foo(C x) { } + static void Goo(B x) { } + static void Goo(C x) { } } class A @@ -1404,9 +1404,9 @@ class C "; var comp = CreateStandardCompilation(source); - comp.VerifyDiagnostics(// (7,17): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Foo(B)' and 'Program.Foo(C)' - // Foo(x); - Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("Program.Foo(B)", "Program.Foo(C)")); + comp.VerifyDiagnostics(// (7,17): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Goo(B)' and 'Program.Goo(C)' + // Goo(x); + Diagnostic(ErrorCode.ERR_AmbigCall, "Goo").WithArguments("Program.Goo(B)", "Program.Goo(C)")); } [Fact, WorkItem(543446, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543446")] diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/VarianceTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/VarianceTests.cs index 188a7a4d14b12..efb3ecfe7f302 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/VarianceTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/VarianceTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; @@ -258,17 +258,17 @@ interface I : IIn> { } class C { - static void Foo(D> x) { } - static void Foo(D x) { } + static void Goo(D> x) { } + static void Goo(D x) { } static void M() { - Foo(null); + Goo(null); } } "; CreateStandardCompilation(text).VerifyDiagnostics( - // (13,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Foo(D>)' and 'C.Foo(D)' - Diagnostic(ErrorCode.ERR_AmbigCall, "Foo").WithArguments("C.Foo(D>)", "C.Foo(D)")); + // (13,9): error CS0121: The call is ambiguous between the following methods or properties: 'C.Goo(D>)' and 'C.Goo(D)' + Diagnostic(ErrorCode.ERR_AmbigCall, "Goo").WithArguments("C.Goo(D>)", "C.Goo(D)")); } /// http://blogs.msdn.com/b/ericlippert/archive/2008/05/07/covariance-and-contravariance-part-twelve-to-infinity-but-not-beyond.aspx @@ -287,7 +287,7 @@ class C static void M() { IC bar = null; - IN> foo = bar; + IN> goo = bar; } } "; diff --git a/src/Compilers/CSharp/Test/Symbol/BadSymbolReference.cs b/src/Compilers/CSharp/Test/Symbol/BadSymbolReference.cs index 703602f765f4b..20877183d2f2e 100644 --- a/src/Compilers/CSharp/Test/Symbol/BadSymbolReference.cs +++ b/src/Compilers/CSharp/Test/Symbol/BadSymbolReference.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; using Microsoft.CodeAnalysis.CSharp.Symbols; @@ -755,7 +755,7 @@ public class Point { } public interface I { - void Foo(Point p); + void Goo(Point p); } "; @@ -764,7 +764,7 @@ public interface I public class C { - public void Foo(Point p) { } + public void Goo(Point p) { } } "; diff --git a/src/Compilers/CSharp/Test/Symbol/Compilation/CSharpCompilationOptionsTests.cs b/src/Compilers/CSharp/Test/Symbol/Compilation/CSharpCompilationOptionsTests.cs index 7e0f014526988..dcfedbc89f87d 100644 --- a/src/Compilers/CSharp/Test/Symbol/Compilation/CSharpCompilationOptionsTests.cs +++ b/src/Compilers/CSharp/Test/Symbol/Compilation/CSharpCompilationOptionsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; @@ -67,13 +67,13 @@ private static void TestPropertyGeneric(TOptions oldOptions, Func old.WithOutputKind(value), opt => opt.OutputKind, OutputKind.DynamicallyLinkedLibrary); - TestHiddenProperty((old, value) => old.WithModuleName(value), opt => opt.ModuleName, "foo.dll"); - TestHiddenProperty((old, value) => old.WithMainTypeName(value), opt => opt.MainTypeName, "Foo.Bar"); + TestHiddenProperty((old, value) => old.WithModuleName(value), opt => opt.ModuleName, "goo.dll"); + TestHiddenProperty((old, value) => old.WithMainTypeName(value), opt => opt.MainTypeName, "Goo.Bar"); TestHiddenProperty((old, value) => old.WithScriptClassName(value), opt => opt.ScriptClassName, "