Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson committed May 29, 2024
1 parent 73f258c commit 05ece7d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 98 deletions.
60 changes: 27 additions & 33 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -7929,7 +7929,33 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<data name="ERR_AddressOfInIterator" xml:space="preserve">
<value>The '&amp;' operator cannot be used on parameters or local variables in iterator methods.</value>
</data>
<<<<<<< HEAD
<data name="IDS_FeatureRefStructInterfaces" xml:space="preserve">
<value>ref struct interfaces</value>
</data>
<data name="ERR_RuntimeDoesNotSupportByRefLikeGenerics" xml:space="preserve">
<value>Target runtime doesn't support by-ref-like generics.</value>
</data>
<data name="ERR_RefStructConstraintAlreadySpecified" xml:space="preserve">
<value>'ref struct' is already specified.</value>
</data>
<data name="ERR_AllowsClauseMustBeLast" xml:space="preserve">
<value>The 'allows' constraint clause must be the last constraint specified</value>
</data>
<data name="ERR_ClassIsCombinedWithRefStruct" xml:space="preserve">
<value>Cannot allow ref structs for a type parameter known from other constraints to be a class</value>
</data>
<data name="ERR_NotRefStructConstraintNotSatisfied" xml:space="preserve">
<value>The type '{2}' may not be a ref struct or a type parameter allowing ref structs in order to use it as parameter '{1}' in the generic type or method '{0}'</value>
</data>
<data name="ERR_RefStructDoesNotSupportDefaultInterfaceImplementationForMember" xml:space="preserve">
<value>'{0}' cannot implement interface member '{1}' for ref struct '{2}'.</value>
</data>
<data name="ERR_BadNonVirtualInterfaceMemberAccessOnAllowsRefLike" xml:space="preserve">
<value>A non-virtual instance interface member cannot be accessed on a type parameter that allows ref struct.</value>
</data>
<data name="ERR_BadAllowByRefLikeEnumerator" xml:space="preserve">
<value>foreach statement cannot operate on enumerators of type '{0}' because it is a type parameter that allows ref struct and it is not known at compile time to implement IDisposable.</value>
</data>
<data name="ERR_PartialPropertyMissingImplementation" xml:space="preserve">
<value>Partial property '{0}' must have an implementation part.</value>
</data>
Expand Down Expand Up @@ -7964,35 +7990,3 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<value>Both partial property declarations must be required or neither may be required</value>
</data>
</root>
||||||| 799727efe4c
</root>
=======
<data name="IDS_FeatureRefStructInterfaces" xml:space="preserve">
<value>ref struct interfaces</value>
</data>
<data name="ERR_RuntimeDoesNotSupportByRefLikeGenerics" xml:space="preserve">
<value>Target runtime doesn't support by-ref-like generics.</value>
</data>
<data name="ERR_RefStructConstraintAlreadySpecified" xml:space="preserve">
<value>'ref struct' is already specified.</value>
</data>
<data name="ERR_AllowsClauseMustBeLast" xml:space="preserve">
<value>The 'allows' constraint clause must be the last constraint specified</value>
</data>
<data name="ERR_ClassIsCombinedWithRefStruct" xml:space="preserve">
<value>Cannot allow ref structs for a type parameter known from other constraints to be a class</value>
</data>
<data name="ERR_NotRefStructConstraintNotSatisfied" xml:space="preserve">
<value>The type '{2}' may not be a ref struct or a type parameter allowing ref structs in order to use it as parameter '{1}' in the generic type or method '{0}'</value>
</data>
<data name="ERR_RefStructDoesNotSupportDefaultInterfaceImplementationForMember" xml:space="preserve">
<value>'{0}' cannot implement interface member '{1}' for ref struct '{2}'.</value>
</data>
<data name="ERR_BadNonVirtualInterfaceMemberAccessOnAllowsRefLike" xml:space="preserve">
<value>A non-virtual instance interface member cannot be accessed on a type parameter that allows ref struct.</value>
</data>
<data name="ERR_BadAllowByRefLikeEnumerator" xml:space="preserve">
<value>foreach statement cannot operate on enumerators of type '{0}' because it is a type parameter that allows ref struct and it is not known at compile time to implement IDisposable.</value>
</data>
</root>
>>>>>>> upstream/main
21 changes: 8 additions & 13 deletions src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2443,8 +2443,14 @@ or ErrorCode.INF_TooManyBoundLambdas
or ErrorCode.WRN_BadYieldInLock
or ErrorCode.ERR_BadYieldInUnsafe
or ErrorCode.ERR_AddressOfInIterator
<<<<<<< HEAD

or ErrorCode.ERR_RuntimeDoesNotSupportByRefLikeGenerics
or ErrorCode.ERR_RefStructConstraintAlreadySpecified
or ErrorCode.ERR_AllowsClauseMustBeLast
or ErrorCode.ERR_ClassIsCombinedWithRefStruct
or ErrorCode.ERR_NotRefStructConstraintNotSatisfied
or ErrorCode.ERR_RefStructDoesNotSupportDefaultInterfaceImplementationForMember
or ErrorCode.ERR_BadNonVirtualInterfaceMemberAccessOnAllowsRefLike
or ErrorCode.ERR_BadAllowByRefLikeEnumerator
or ErrorCode.ERR_PartialPropertyMissingImplementation
or ErrorCode.ERR_PartialPropertyMissingDefinition
or ErrorCode.ERR_PartialPropertyDuplicateDefinition
Expand All @@ -2455,17 +2461,6 @@ or ErrorCode.ERR_PartialPropertyInitMismatch
or ErrorCode.ERR_PartialPropertyTypeDifference
or ErrorCode.WRN_PartialPropertySignatureDifference
or ErrorCode.ERR_PartialPropertyRequiredDifference
||||||| 799727efe4c
=======
or ErrorCode.ERR_RuntimeDoesNotSupportByRefLikeGenerics
or ErrorCode.ERR_RefStructConstraintAlreadySpecified
or ErrorCode.ERR_AllowsClauseMustBeLast
or ErrorCode.ERR_ClassIsCombinedWithRefStruct
or ErrorCode.ERR_NotRefStructConstraintNotSatisfied
or ErrorCode.ERR_RefStructDoesNotSupportDefaultInterfaceImplementationForMember
or ErrorCode.ERR_BadNonVirtualInterfaceMemberAccessOnAllowsRefLike
or ErrorCode.ERR_BadAllowByRefLikeEnumerator
>>>>>>> upstream/main
=> false,
};
#pragma warning restore CS8524 // The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value.
Expand Down
14 changes: 3 additions & 11 deletions src/Compilers/CSharp/Portable/Errors/MessageID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,11 @@ internal enum MessageID
IDS_FeatureParamsCollections = MessageBase + 12842,

IDS_FeatureRefUnsafeInIteratorAsync = MessageBase + 12843,
<<<<<<< HEAD

IDS_FeatureRefStructInterfaces = MessageBase + 12844,

// PROTOTYPE(partial-properties): pack
IDS_FeaturePartialProperties = MessageBase + 13000,
||||||| 799727efe4c
=======

IDS_FeatureRefStructInterfaces = MessageBase + 12844,
>>>>>>> upstream/main
}

// Message IDs may refer to strings that need to be localized.
Expand Down Expand Up @@ -478,12 +474,8 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
case MessageID.IDS_FeatureLockObject:
case MessageID.IDS_FeatureParamsCollections:
case MessageID.IDS_FeatureRefUnsafeInIteratorAsync:
<<<<<<< HEAD
case MessageID.IDS_FeaturePartialProperties:
||||||| 799727efe4c
=======
case MessageID.IDS_FeatureRefStructInterfaces:
>>>>>>> upstream/main
case MessageID.IDS_FeaturePartialProperties:
return LanguageVersion.Preview;

// C# 12.0 features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,8 @@ public static SourceParameterSymbol Create(
!isExtensionMethodThis &&
(syntax.Default == null) &&
(syntax.AttributeLists.Count == 0) &&
<<<<<<< HEAD
!owner.IsPartialMember())
||||||| 799727efe4c
!owner.IsPartialMethod())
=======
!owner.IsPartialMethod() &&
!owner.IsPartialMember() &&
scope == ScopedKind.None)
>>>>>>> upstream/main
{
return new SourceSimpleParameterSymbol(owner, parameterType, ordinal, refKind, name, location);
}
Expand Down
48 changes: 14 additions & 34 deletions src/EditorFeatures/CSharpTest/NavigateTo/NavigateToTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,44 +592,10 @@ static Goo()
});
}

<<<<<<< HEAD

This comment has been minimized.

Copy link
@RikkiGibson

RikkiGibson May 29, 2024

Author Contributor

This conflict looks a little wonky, but basically it was just merging in a change to use file-scoped namespaces. Resolved by taking the main version of the file and pasting the new test back in at the appropriate position and indentation.

var items = await _aggregator.GetItemsAsync("Bar");

VerifyNavigateToResultItems(expecteditems, items);
});
}

[Theory, CombinatorialData]
public async Task FindPartialProperties(TestHost testHost, Composition composition)
{
await TestAsync(testHost, composition, "partial class Goo { partial int Prop { get; set; } } partial class Goo { partial int Prop { get => 1; set { } } }", async w =>
{
var expecteditem1 = new NavigateToItem("Prop", NavigateToItemKind.Property, "csharp", null, null, s_emptyExactPatternMatch, null);
var expecteditems = new List<NavigateToItem> { expecteditem1, expecteditem1 };

var items = await _aggregator.GetItemsAsync("Prop");

VerifyNavigateToResultItems(expecteditems, items);
});
}

[Theory, CombinatorialData]
public async Task FindPartialMethodDefinitionOnly(TestHost testHost, Composition composition)
||||||| 799727efe4c
var items = await _aggregator.GetItemsAsync("Bar");

VerifyNavigateToResultItems(expecteditems, items);
});
}

[Theory, CombinatorialData]
public async Task FindPartialMethodDefinitionOnly(TestHost testHost, Composition composition)
=======
[Theory, CombinatorialData]
public async Task FindPartialMethods(TestHost testHost, Composition composition)
{
await TestAsync(testHost, composition, "partial class Goo { partial void Bar(); } partial class Goo { partial void Bar() { Console.Write(\"hello\"); } }", async w =>
>>>>>>> upstream/main
{
var expecteditem1 = new NavigateToItem("Bar", NavigateToItemKind.Method, "csharp", null, null, s_emptyExactPatternMatch, null);
var expecteditems = new List<NavigateToItem> { expecteditem1, expecteditem1 };
Expand All @@ -640,6 +606,20 @@ public async Task FindPartialMethods(TestHost testHost, Composition composition)
});
}

[Theory, CombinatorialData]
public async Task FindPartialProperties(TestHost testHost, Composition composition)
{
await TestAsync(testHost, composition, "partial class Goo { partial int Prop { get; set; } } partial class Goo { partial int Prop { get => 1; set { } } }", async w =>
{
var expecteditem1 = new NavigateToItem("Prop", NavigateToItemKind.Property, "csharp", null, null, s_emptyExactPatternMatch, null);
var expecteditems = new List<NavigateToItem> { expecteditem1, expecteditem1 };

var items = await _aggregator.GetItemsAsync("Prop");

VerifyNavigateToResultItems(expecteditems, items);
});
}

[Theory, CombinatorialData]
public async Task FindPartialMethodDefinitionOnly(TestHost testHost, Composition composition)
{
Expand Down

0 comments on commit 05ece7d

Please sign in to comment.