Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
25c21be
NRT enable code
CyrusNajmabadi Jun 15, 2022
78aeb05
NRT enable code
CyrusNajmabadi Jun 15, 2022
5cd6964
NRT enable code
CyrusNajmabadi Jun 15, 2022
75e94f8
NRT enable code
CyrusNajmabadi Jun 15, 2022
8d8b172
NRT enable code
CyrusNajmabadi Jun 15, 2022
9462d2b
NRT enable code
CyrusNajmabadi Jun 15, 2022
98d01d7
NRT enable code
CyrusNajmabadi Jun 15, 2022
ffd3420
NRT enable code
CyrusNajmabadi Jun 15, 2022
4c13017
NRT enable code
CyrusNajmabadi Jun 15, 2022
19e5769
NRT enable code
CyrusNajmabadi Jun 15, 2022
9fe660c
NRT enable code
CyrusNajmabadi Jun 15, 2022
c89c3db
In progress
CyrusNajmabadi Jun 15, 2022
8bb81a2
NRT enable code
CyrusNajmabadi Jun 15, 2022
a588eca
In progress
CyrusNajmabadi Jun 15, 2022
bb409f1
NRT enable code
CyrusNajmabadi Jun 15, 2022
a731465
NRT enable code
CyrusNajmabadi Jun 15, 2022
26ba8f0
NRT enable code
CyrusNajmabadi Jun 15, 2022
7823c42
NRT enable code
CyrusNajmabadi Jun 15, 2022
027ccba
NRT enable code
CyrusNajmabadi Jun 15, 2022
c4b4611
NRT enable code
CyrusNajmabadi Jun 15, 2022
784a98c
NRT enable code
CyrusNajmabadi Jun 15, 2022
c526be8
NRT enable code
CyrusNajmabadi Jun 15, 2022
7f39b56
NRT enable code
CyrusNajmabadi Jun 15, 2022
4009518
NRT enable code
CyrusNajmabadi Jun 15, 2022
1fc6e09
NRT enable code
CyrusNajmabadi Jun 15, 2022
aebd377
NRT enable code
CyrusNajmabadi Jun 15, 2022
a7322b3
NRT enable code
CyrusNajmabadi Jun 15, 2022
08cb9e5
NRT enable code
CyrusNajmabadi Jun 15, 2022
e8d65ef
NRT enable code
CyrusNajmabadi Jun 15, 2022
edc55ac
NRT enable code
CyrusNajmabadi Jun 15, 2022
9c85aff
NRT enable code
CyrusNajmabadi Jun 15, 2022
726a73a
NRT enable code
CyrusNajmabadi Jun 15, 2022
78a4d30
NRT enable code
CyrusNajmabadi Jun 15, 2022
66f6e8b
NRT enable code
CyrusNajmabadi Jun 15, 2022
e945e2e
Fix for generated docs
CyrusNajmabadi Jun 15, 2022
f8ff828
Merge remote-tracking branch 'upstream/main' into nrtSymbolFinder
CyrusNajmabadi Jun 15, 2022
afcab44
Merge pull request #61921 from CyrusNajmabadi/nrtSymbolFinder
CyrusNajmabadi Jun 16, 2022
68b5bc7
Convert connection lost exceptions to cancellations to avoid overrepo…
tmat Jun 16, 2022
bd2bf93
Avoid accessing Document from formatter services (#61928)
tmat Jun 16, 2022
73de4e9
Don't use exceptions for flow control (#61948)
davidwengier Jun 16, 2022
97a528f
Use 'Clear' to empty a CWT when on .net core
CyrusNajmabadi Jun 16, 2022
e4d1ce6
Add support for additional file diagnostics in workspace pull (#61930)
dibarbet Jun 16, 2022
e8dbd42
Merge pull request #61952 from CyrusNajmabadi/clearCWT
CyrusNajmabadi Jun 16, 2022
d1fd203
Improve error message for lookup on a type parameter. (#61967)
AlekseyTs Jun 16, 2022
2f9faa0
SerializableOptionSet and IOptionService cleanup (#61839)
tmat Jun 16, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -6525,7 +6525,7 @@ BoundExpression tryBindMemberAccessWithBoundTypeLeft(
}
else if (lookupResult.IsClear)
{
Error(diagnostics, ErrorCode.ERR_BadSKunknown, boundLeft.Syntax, leftType, MessageID.IDS_SK_TYVAR.Localize());
Error(diagnostics, ErrorCode.ERR_LookupInTypeVariable, boundLeft.Syntax, leftType);
return BadExpression(node, LookupResultKind.NotAValue, boundLeft);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Compilers/CSharp/Portable/Binder/Binder_Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression r
{
if (ultimateReceiver.Type.TypeKind == TypeKind.TypeParameter)
{
// https://github.com/dotnet/roslyn/issues/53796: Do we really want to enable usage of static abstract members here?
// We don't want to enable usage of static abstract members here
Error(diagnostics, ErrorCode.ERR_BadSKunknown, ultimateReceiver.Syntax, ultimateReceiver.Type, MessageID.IDS_SK_TYVAR.Localize());
}
}
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 @@ -2058,7 +2058,7 @@ If such a class is used as a base class and if the deriving class defines a dest
<value>Inconsistent accessibility: constraint type '{1}' is less accessible than '{0}'</value>
</data>
<data name="ERR_LookupInTypeVariable" xml:space="preserve">
<value>Cannot do member lookup in '{0}' because it is a type parameter</value>
<value>Cannot do non-virtual member lookup in '{0}' because it is a type parameter</value>
</data>
<data name="ERR_BadConstraintType" xml:space="preserve">
<value>Invalid constraint type. A type used as a constraint must be an interface, a non-sealed class or a type parameter.</value>
Expand Down
4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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.

4 changes: 2 additions & 2 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 @@ -7623,12 +7623,12 @@ public MyAttribute(string name1) { }

comp = CreateCompilation(source, parseOptions: TestOptions.RegularNext);
comp.VerifyDiagnostics(
// (13,20): error CS0119: 'TParameter' is a type parameter, which is not valid in the given context
// (13,20): error CS0704: Cannot do non-virtual member lookup in 'TParameter' because it is a type parameter
// [My(nameof(TParameter.Constant))] // 1
Diagnostic(ErrorCode.ERR_BadSKunknown, "TParameter").WithArguments("TParameter", "type parameter").WithLocation(13, 20),
// (17,16): error CS0119: 'TParameter' is a type parameter, which is not valid in the given context
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "TParameter").WithArguments("TParameter").WithLocation(13, 20),
// (17,16): error CS0704: Cannot do non-virtual member lookup in 'TParameter' because it is a type parameter
// [My(nameof(TParameter.Constant))] // 2
Diagnostic(ErrorCode.ERR_BadSKunknown, "TParameter").WithArguments("TParameter", "type parameter").WithLocation(17, 16)
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "TParameter").WithArguments("TParameter").WithLocation(17, 16)
);

VerifyTParameter(comp, 0, "void local<TParameter>()");
Expand Down Expand Up @@ -8473,9 +8473,9 @@ public MyAttribute(string name) { }
", targetFramework: TargetFramework.NetCoreApp);

comp.VerifyDiagnostics(
// (2,5): error CS0119: 'TParameter' is a type parameter, which is not valid in the given context
// (2,5): error CS0704: Cannot do non-virtual member lookup in 'TParameter' because it is a type parameter
// [My(TParameter.Constant)]
Diagnostic(ErrorCode.ERR_BadSKunknown, "TParameter").WithArguments("TParameter", "type parameter").WithLocation(2, 5)
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "TParameter").WithArguments("TParameter").WithLocation(2, 5)
);

VerifyTParameter(comp, 0, "C<TParameter>");
Expand Down Expand Up @@ -8563,9 +8563,9 @@ public MyAttribute(string name1) { }
";
var comp = CreateCompilation(source, targetFramework: TargetFramework.NetCoreApp);
comp.VerifyDiagnostics(
// (2,12): error CS0119: 'TParameter' is a type parameter, which is not valid in the given context
// (2,12): error CS0704: Cannot do non-virtual member lookup in 'TParameter' because it is a type parameter
// [My(nameof(TParameter.Constant))]
Diagnostic(ErrorCode.ERR_BadSKunknown, "TParameter").WithArguments("TParameter", "type parameter").WithLocation(2, 12)
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "TParameter").WithArguments("TParameter").WithLocation(2, 12)
);
VerifyTParameter(comp, 0, "R<TParameter>");
}
Expand Down Expand Up @@ -8643,9 +8643,9 @@ public interface I
";
var comp = CreateCompilation(source, targetFramework: TargetFramework.NetCoreApp);
comp.VerifyDiagnostics(
// (2,5): error CS0119: 'TParameter' is a type parameter, which is not valid in the given context
// (2,5): error CS0704: Cannot do non-virtual member lookup in 'TParameter' because it is a type parameter
// [My(TParameter.Constant)]
Diagnostic(ErrorCode.ERR_BadSKunknown, "TParameter").WithArguments("TParameter", "type parameter").WithLocation(2, 5)
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "TParameter").WithArguments("TParameter").WithLocation(2, 5)
);
VerifyTParameter(comp, 0, "R<TParameter>");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2564,15 +2564,15 @@ static void M(T t)
}
}";
CreateCompilation(source).VerifyDiagnostics(
// (10,27): error CS0119: 'T' is a type parameter, which is not valid in the given context
// (10,9): error CS0704: Cannot do non-virtual member lookup in 'U' because it is a type parameter
// U.ReferenceEquals(T.F, null);
Diagnostic(ErrorCode.ERR_BadSKunknown, "T").WithArguments("T", "type parameter"),
// (10,9): error CS0119: 'U' is a type parameter, which is not valid in the given context
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "U").WithArguments("U").WithLocation(10, 9),
// (10,27): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// U.ReferenceEquals(T.F, null);
Diagnostic(ErrorCode.ERR_BadSKunknown, "U").WithArguments("U", "type parameter"),
// (11,9): error CS0119: 'T' is a type parameter, which is not valid in the given context
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T").WithArguments("T").WithLocation(10, 27),
// (11,9): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// T.M();
Diagnostic(ErrorCode.ERR_BadSKunknown, "T").WithArguments("T", "type parameter"),
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T").WithArguments("T").WithLocation(11, 9),
// (3,28): warning CS0649: Field 'A.F' is never assigned to, and will always have its default value null
// internal static object F;
Diagnostic(ErrorCode.WRN_UnassignedInternalField, "F").WithArguments("A.F", "null")
Expand Down Expand Up @@ -11747,30 +11747,30 @@ static object M<U>()
}
}";
CreateCompilation(text).VerifyDiagnostics(
// (9,15): error CS0704: Cannot do member lookup in 'T' because it is a type parameter class E : T.B { }
// (9,15): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter class E : T.B { }
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.B").WithArguments("T"),
// (10,30): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (10,30): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// interface I<U> where U : T.B { }
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.B").WithArguments("T"),
// (11,6): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (11,6): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// [T.B]
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.B").WithArguments("T"),
// (14,9): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (14,9): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// T.C<object> b1 = new T.C<object>();
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.C<object>").WithArguments("T"),
// (14,30): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (14,30): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// T.C<object> b1 = new T.C<object>();
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.C<object>").WithArguments("T"),
// (15,9): error CS0307: The type parameter 'T' cannot be used with type arguments
// T<U>.B b2 = null;
Diagnostic(ErrorCode.ERR_TypeArgsNotAllowed, "T<U>").WithArguments("T", "type parameter"),
// (16,22): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (16,22): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// b1 = default(T.B);
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.B").WithArguments("T"),
// (17,27): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (17,27): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// object o = typeof(T.C<A>);
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.C<A>").WithArguments("T"),
// (18,18): error CS0704: Cannot do member lookup in 'T' because it is a type parameter
// (18,18): error CS0704: Cannot do non-virtual member lookup in 'T' because it is a type parameter
// o = o as T.B;
Diagnostic(ErrorCode.ERR_LookupInTypeVariable, "T.B").WithArguments("T")
);
Expand Down
Loading