Skip to content

Commit

Permalink
Addressed PR feedback
Browse files Browse the repository at this point in the history
Error wording.
Simply if.
  • Loading branch information
333fred committed Mar 27, 2020
1 parent c196e3b commit 28bc3db
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ internal bool MethodIsCompatibleWithDelegateOrFunctionPointer(BoundExpression? r

if (delegateType.IsFunctionPointer())
{
if (method.ParameterCount != numParams)
if (isExtensionMethod)
{
Error(diagnostics, ErrorCode.ERR_CannotUseReducedExtensionMethodInAddressOf, errorLocation);
diagnostics.Add(errorLocation, useSiteDiagnostics);
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -6077,6 +6077,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<value>Cannot convert method group to function pointer (Are you missing a '&amp;'?)</value>
</data>
<data name="ERR_CannotUseReducedExtensionMethodInAddressOf" xml:space="preserve">
<value>Cannot use a reduced extension method as the target of a '&amp;' operator.</value>
<value>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</value>
</data>
</root>
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
4 changes: 2 additions & 2 deletions src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<note />
</trans-unit>
<trans-unit id="ERR_CannotUseReducedExtensionMethodInAddressOf">
<source>Cannot use a reduced extension method as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a reduced extension method as the target of a '&amp;' operator.</target>
<source>Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</source>
<target state="new">Cannot use a an extension method with a receiver as the target of a '&amp;' operator.</target>
<note />
</trans-unit>
<trans-unit id="ERR_CantUseInOrOutInArglist">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3083,7 +3083,7 @@ static void M(C c)
// (10,35): error CS8757: No overload for 'M1' matches function pointer 'delegate*<C,void>'
// delegate*<C, void> ptr1 = &c.M1;
Diagnostic(ErrorCode.ERR_MethFuncPtrMismatch, "&c.M1").WithArguments("M1", "delegate*<C,void>").WithLocation(10, 35),
// (11,32): error CS8788: Cannot use a reduced extension method as the target of a '&' operator.
// (11,32): error CS8788: Cannot use a an extension method with a receiver as the target of a '&amp;' operator.
// delegate*<void> ptr2 = &c.M1;
Diagnostic(ErrorCode.ERR_CannotUseReducedExtensionMethodInAddressOf, "&c.M1").WithLocation(11, 32)
);
Expand Down

0 comments on commit 28bc3db

Please sign in to comment.