Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,9 @@ If such a class is used as a base class and if the deriving class defines a dest
<data name="ERR_DllImportOnInvalidMethod" xml:space="preserve">
<value>The DllImport attribute must be specified on a method marked 'extern' that is either 'static' or an extension member</value>
</data>
<data name="ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime" xml:space="preserve">
<value>Update requires emitting explicit interface implementation, which is not supported by the runtime without restarting the application.</value>
</data>
<data name="ERR_EncUpdateFailedMissingSymbol" xml:space="preserve">
<value>Cannot emit update; {0} '{1}' is missing.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public PEDeltaAssemblyBuilder(
public override SymbolChanges? EncSymbolChanges => _changes;
public override EmitBaseline PreviousGeneration => _changes.DefinitionMap.Baseline;
public override bool FieldRvaSupported => _options.EmitFieldRva;
public override bool MethodImplSupported => !_options.DisallowExplicitMethodImplementations;

internal override Cci.ITypeReference EncTranslateLocalVariableType(TypeSymbol type, DiagnosticBag diagnostics)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ internal sealed class PEAssemblyBuilder(
public override EmitBaseline? PreviousGeneration => null;
public override SymbolChanges? EncSymbolChanges => null;
public override bool FieldRvaSupported => true;
public override bool MethodImplSupported => true;

public override INamedTypeSymbolInternal? TryGetOrCreateSynthesizedHotReloadExceptionType()
=> null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected override void AddEmbeddedResourcesFromAddedModules(ArrayBuilder<Cci.Ma
public override EmitBaseline? PreviousGeneration => null;
public override SymbolChanges? EncSymbolChanges => null;
public override bool FieldRvaSupported => true;
public override bool MethodImplSupported => true;

public override INamedTypeSymbolInternal? TryGetOrCreateSynthesizedHotReloadExceptionType()
=> null;
Expand Down
1 change: 1 addition & 0 deletions src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2441,6 +2441,7 @@ internal enum ErrorCode
ERR_AmbigOperator = 9342,

ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList = 9343,
ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime = 9344,

// Note: you will need to do the following after adding errors:
// 1) Update ErrorFacts.IsBuildOnlyDiagnostic (src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs)
Expand Down
1 change: 1 addition & 0 deletions src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,7 @@ or ErrorCode.ERR_SingleInapplicableBinaryOperator
or ErrorCode.ERR_SingleInapplicableUnaryOperator
or ErrorCode.ERR_AmbigOperator
or ErrorCode.ERR_UnexpectedArgumentListInBaseTypeWithoutParameterList
or ErrorCode.ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime
=> 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
1 change: 1 addition & 0 deletions src/Compilers/CSharp/Portable/Errors/MessageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnost
public override int ERR_InvalidDebugInfo => (int)ErrorCode.ERR_InvalidDebugInfo;
public override int ERR_FunctionPointerTypesInAttributeNotSupported => (int)ErrorCode.ERR_FunctionPointerTypesInAttributeNotSupported;
public override int ERR_DataSectionStringLiteralHashCollision => (int)ErrorCode.ERR_DataSectionStringLiteralHashCollision;
public override int ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime => (int)ErrorCode.ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime;

// Generators:
public override int WRN_GeneratorFailedDuringInitialization => (int)ErrorCode.WRN_GeneratorFailedDuringInitialization;
Expand Down
5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21913,8 +21913,8 @@ class C
.Verify();
}

[ConditionalFact(typeof(CoreClrOnly))]
public void PrivateImplDetails_CollectionExpressions_ReadOnlyListTypes()
[Fact]
public void PrivateImplDetails_CollectionExpressions_ReadOnlyListTypes_MethodImplSupported()
{
using var _ = new EditAndContinueTest(targetFramework: TargetFramework.Net80, verification: Verification.Skipped)
.AddBaseline(
Expand Down Expand Up @@ -22076,5 +22076,81 @@ class C
})
.Verify();
}

[Fact]
[WorkItem("https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/2631743")]
public void PrivateImplDetails_CollectionExpressions_ReadOnlyListTypes_MethodImplNotSupported()
{
using var _ = new EditAndContinueTest(targetFramework: TargetFramework.NetFramework, verification: Verification.Skipped)
.AddBaseline(
source: """
using System.Collections.Generic;
class C
{
static IEnumerable<int> F(int x, int y, IEnumerable<int> e) => [x, y];
}
""")

.AddGeneration(
"""
using System.Collections.Generic;
class C
{
static IEnumerable<int> F(int x, int y, IEnumerable<int> e) => [x, y, default];
}
""",
edits:
[
Edit(SemanticEditKind.Update, symbolProvider: c => c.GetMember("C.F")),
],
options: new EmitDifferenceOptions()
{
DisallowExplicitMethodImplementations = true
},
expectedErrors:
[
Diagnostic(ErrorCode.ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime)
])
.Verify();
}

[Fact]
[WorkItem("https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/2631743")]
public void ExplicitInterfaceImplementation_MethodImplNotSupported()
{
using var _ = new EditAndContinueTest(targetFramework: TargetFramework.NetFramework, verification: Verification.Skipped)
.AddBaseline(
source: """
interface I
{
void M();
}
""")

.AddGeneration(
"""
interface I
{
void M();
}
class C : I
{
void I.M() { }
}
""",
edits:
[
Edit(SemanticEditKind.Insert, symbolProvider: c => c.GetMember("C")),
],
options: new EmitDifferenceOptions()
{
DisallowExplicitMethodImplementations = true
},
expectedErrors:
[
Diagnostic(ErrorCode.ERR_EncUpdateRequiresEmittingExplicitInterfaceImplementationNotSupportedByTheRuntime)
])
.Verify();
}
}
}
Loading
Loading