-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make SourceClonedParameterSymbol abstract
- Loading branch information
1 parent
5f44ff6
commit 55b6ebe
Showing
5 changed files
with
70 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...CSharp/Portable/Symbols/Source/SourceDelegateClonedParameterSymbolForBeginAndEndInvoke.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Immutable; | ||
using Roslyn.Utilities; | ||
|
||
namespace Microsoft.CodeAnalysis.CSharp.Symbols | ||
{ | ||
internal sealed class SourceDelegateClonedParameterSymbolForBeginAndEndInvoke : SourceClonedParameterSymbol | ||
{ | ||
internal SourceDelegateClonedParameterSymbolForBeginAndEndInvoke(SourceParameterSymbol originalParam, Symbol newOwner, int newOrdinal) | ||
: base(originalParam, newOwner, newOrdinal, suppressOptional: true) | ||
{ | ||
} | ||
|
||
internal override bool IsCallerFilePath => _originalParam.IsCallerFilePath; | ||
|
||
internal override bool IsCallerLineNumber => _originalParam.IsCallerLineNumber; | ||
|
||
internal override bool IsCallerMemberName => _originalParam.IsCallerMemberName; | ||
|
||
internal override int CallerArgumentExpressionParameterIndex => throw ExceptionUtilities.Unreachable; | ||
|
||
internal override ParameterSymbol WithCustomModifiersAndParams(TypeSymbol newType, ImmutableArray<CustomModifier> newCustomModifiers, ImmutableArray<CustomModifier> newRefCustomModifiers, bool newIsParams) | ||
{ | ||
return new SourceDelegateClonedParameterSymbolForBeginAndEndInvoke( | ||
_originalParam.WithCustomModifiersAndParamsCore(newType, newCustomModifiers, newRefCustomModifiers, newIsParams), | ||
ContainingSymbol, | ||
Ordinal); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...mpilers/CSharp/Portable/Symbols/Source/SourcePropertyClonedParameterSymbolForAccessors.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Immutable; | ||
using Roslyn.Utilities; | ||
|
||
namespace Microsoft.CodeAnalysis.CSharp.Symbols | ||
{ | ||
internal sealed class SourcePropertyClonedParameterSymbolForAccessors : SourceClonedParameterSymbol | ||
{ | ||
internal SourcePropertyClonedParameterSymbolForAccessors(SourceParameterSymbol originalParam, Symbol newOwner) | ||
: base(originalParam, newOwner, originalParam.Ordinal, suppressOptional: false) | ||
{ | ||
} | ||
|
||
internal override bool IsCallerFilePath => _originalParam.IsCallerFilePath; | ||
|
||
internal override bool IsCallerLineNumber => _originalParam.IsCallerLineNumber; | ||
|
||
internal override bool IsCallerMemberName => _originalParam.IsCallerMemberName; | ||
|
||
internal override int CallerArgumentExpressionParameterIndex => _originalParam.CallerArgumentExpressionParameterIndex; | ||
|
||
internal override ParameterSymbol WithCustomModifiersAndParams(TypeSymbol newType, ImmutableArray<CustomModifier> newCustomModifiers, ImmutableArray<CustomModifier> newRefCustomModifiers, bool newIsParams) | ||
{ | ||
return new SourcePropertyClonedParameterSymbolForAccessors( | ||
_originalParam.WithCustomModifiersAndParamsCore(newType, newCustomModifiers, newRefCustomModifiers, newIsParams), | ||
this.ContainingSymbol); | ||
} | ||
} | ||
} |