Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust ERR_PartialMisplaced diagnostic message #48524

Merged
merged 1 commit into from
Oct 13, 2020
Merged
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
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/CSharpResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@
<value>Cannot implicitly convert type '{0}' to '{1}'. An explicit conversion exists (are you missing a cast?)</value>
</data>
<data name="ERR_PartialMisplaced" xml:space="preserve">
<value>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</value>
<value>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</value>
</data>
<data name="ERR_ImportedCircularBase" xml:space="preserve">
<value>Imported type '{0}' is invalid. It contains a circular base type dependency.</value>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Modifikátor partial se smí objevit jenom bezprostředně před klíčovým slovem class, struct, interface nebo void.</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Der "partial"-Modifizierer kann nur unmittelbar vor "class", "struct", "interface" oder "void" verwendet werden.</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">El modificador 'partial' solo puede aparecer inmediatamente antes de 'class', 'struct', 'interface' o 'void'</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Le modificateur 'partial' ne peut apparaître qu'immédiatement avant 'class', 'struct', 'interface' ou 'void'</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Il modificatore 'partial' può trovarsi solo immediatamente prima di 'class', 'struct', 'interface' o 'void'</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">partial' 修飾子は、'class'、'struct'、'interface'、または 'void' の直前にのみ指定できます</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">partial' 한정자는 'class', 'struct', 'interface' 또는 'void' 바로 앞에만 올 수 있습니다.</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Modyfikator „partial” może się pojawić tylko bezpośrednio przed typem „class”, „struct”, „interface” lub „void”</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4105,7 +4105,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">O modificador 'partial' só pode aparecer imediatamente antes de 'class', 'struct', 'interface' ou 'void'</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">Модификатор "partial" может использоваться только перед "class", "struct", "interface" или "void".</target>
<note />
</trans-unit>
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">partial' değiştiricisi yalnızca 'class', 'struct', 'interface' veya 'void' sözcüklerinden hemen önce gelebilir</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">"partial" 修饰符的后面只能紧跟 "class"、"struct"、"interface" 或 "void"</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,7 @@
<note />
</trans-unit>
<trans-unit id="ERR_PartialMisplaced">
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'</source>
<source>The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.</source>
<target state="needs-review-translation">partial' 修飾元只可緊接在 'class'、'struct'、'interface' 或 'void' 之前。</target>
<note />
</trans-unit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23881,7 +23881,7 @@ partial public record C // CS0267
";

CreateCompilation(test).VerifyDiagnostics(
// (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial public class C // CS0267
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(2, 1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9465,7 +9465,7 @@ void M3()
// (10,27): error CS0762: Cannot create delegate from method 'I1.M2()' because it is a partial method without an implementing declaration
// new System.Action(M2).Invoke();
Diagnostic(ErrorCode.ERR_PartialMethodToDelegate, "M2").WithArguments("I1.M2()").WithLocation(10, 27),
// (13,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (13,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial static void M4();
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(13, 5)
);
Expand Down Expand Up @@ -38726,10 +38726,10 @@ interface I19
// (62,20): error CS0106: The modifier 'virtual' is not valid for this item
// virtual static I13() => throw null;
Diagnostic(ErrorCode.ERR_BadMemberFlag, "I13").WithArguments("virtual").WithLocation(62, 20),
// (66,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (66,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial static I14();
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(66, 5),
// (66,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (66,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial static I14();
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(66, 5),
// (70,12): error CS0246: The type or namespace name 'partial' could not be found (are you missing a using directive or an assembly reference?)
Expand All @@ -38741,10 +38741,10 @@ interface I19
// (70,20): error CS0542: 'I15': member names cannot be the same as their enclosing type
// static partial I15();
Diagnostic(ErrorCode.ERR_MemberNameSameAsType, "I15").WithArguments("I15").WithLocation(70, 20),
// (74,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (74,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial static I16() {}
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(74, 5),
// (74,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (74,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial static I16() {}
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(74, 5),
// (78,12): error CS0246: The type or namespace name 'partial' could not be found (are you missing a using directive or an assembly reference?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ partial public record C
}
";
CreateCompilation(src).VerifyDiagnostics(
// (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (2,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial public record C
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(2, 1)
);
Expand Down
6 changes: 3 additions & 3 deletions src/Compilers/CSharp/Test/Symbol/Symbols/SymbolErrorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13685,13 +13685,13 @@ partial int this[int index]
";
var comp = CreateCompilation(text);
comp.VerifyDiagnostics(
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial int f;
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(4, 5),
// (5,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (5,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial object P { get { return null; } }
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(5, 5),
// (6,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (6,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial int this[int index]
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(6, 5),
// (4,17): warning CS0169: The field 'C.f' is never used
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ partial class C

var comp = CreateCompilation(text);
comp.VerifyDiagnostics(
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial public static int operator + (C c1, C c2) { return 0; }
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(4, 5),
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (4,5): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial public static int operator + (C c1, C c2) { return 0; }
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(4, 5),
// (5,34): error CS0106: The modifier 'abstract' is not valid for this item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5726,10 +5726,10 @@ public void TestPartialEnum()
{
var text = @"partial enum E{}";
CreateCompilationWithMscorlib45(text).VerifyDiagnostics(
// (1,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (1,1): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial enum E{}
Diagnostic(ErrorCode.ERR_PartialMisplaced, "partial").WithLocation(1, 1),
// (1,14): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or 'void'
// (1,14): error CS0267: The 'partial' modifier can only appear immediately before 'class', 'record', 'struct', 'interface', or a method return type.
// partial enum E{}
Diagnostic(ErrorCode.ERR_PartialMisplaced, "E").WithLocation(1, 14));
}
Expand Down
Loading