Skip to content

Commit 9d1a28f

Browse files
committed
.
1 parent 2d1a75a commit 9d1a28f

File tree

2 files changed

+56
-56
lines changed

2 files changed

+56
-56
lines changed

crates/bindings-csharp/Codegen.Tests/Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static IEnumerable<Diagnostic> GetCompilationErrors(Compilation compilation)
124124
.Emit(Stream.Null)
125125
.Diagnostics.Where(diag => diag.Severity != DiagnosticSeverity.Hidden)
126126
// The order of diagnostics is not predictable, sort them by location to make the test deterministic.
127-
.OrderBy(diag => diag.ToString());
127+
.OrderBy(diag => diag.GetMessage() + diag.Location.ToString());
128128
}
129129

130130
[Fact]

crates/bindings-csharp/Codegen.Tests/fixtures/diag/snapshots/ExtraCompilationErrors.verified.txt

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[
22
{/*
3-
public Exception UnsupportedSystemType;
4-
public UnresolvedType UnresolvedType;
5-
^^^^^^^^^^^^^^
6-
public LocalEnum UnsupportedEnum;
3+
SpacetimeDB.Internal.Module.RegisterTable<global::TestUniqueNotEquatable, SpacetimeDB.Internal.TableHandles.TestUniqueNotEquatable>();
4+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FILTER);
5+
^^^^^^^^^
6+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOURTH_FILTER);
77
*/
8-
Message: The type or namespace name 'UnresolvedType' could not be found (are you missing a using directive or an assembly reference?),
8+
Message: 'Module.MY_FILTER' is inaccessible due to its protection level,
99
Severity: Error,
1010
Descriptor: {
11-
Id: CS0246,
11+
Id: CS0122,
1212
Title: ,
13-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0246),
14-
MessageFormat: The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?),
13+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
14+
MessageFormat: '{0}' is inaccessible due to its protection level,
1515
Category: Compiler,
1616
DefaultSeverity: Error,
1717
IsEnabledByDefault: true,
@@ -46,18 +46,18 @@
4646
}
4747
},
4848
{/*
49-
{
50-
internal static readonly TRW Field = new();
51-
^^^
49+
50+
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
51+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5252

5353
*/
54-
Message: The type or namespace name 'TRW' could not be found (are you missing a using directive or an assembly reference?),
54+
Message: 'TestTypeParams<T>' does not implement interface member 'IEquatable<TestTypeParams>.Equals(TestTypeParams?)',
5555
Severity: Error,
5656
Descriptor: {
57-
Id: CS0246,
57+
Id: CS0535,
5858
Title: ,
59-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0246),
60-
MessageFormat: The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?),
59+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0535),
60+
MessageFormat: '{0}' does not implement interface member '{1}',
6161
Category: Compiler,
6262
DefaultSeverity: Error,
6363
IsEnabledByDefault: true,
@@ -69,18 +69,18 @@
6969
}
7070
},
7171
{/*
72-
73-
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
74-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75-
72+
var ___hashUnsupportedSystemType = UnsupportedSystemType == null ? 0 : UnsupportedSystemType.GetHashCode();
73+
var ___hashUnresolvedType = UnresolvedType == null ? 0 : UnresolvedType.GetHashCode();
74+
^^^^^^^^^^^
75+
var ___hashUnsupportedEnum = UnsupportedEnum.GetHashCode();
7676
*/
77-
Message: 'TestTypeParams<T>' does not implement interface member 'IEquatable<TestTypeParams>.Equals(TestTypeParams?)',
77+
Message: 'UnresolvedType' does not contain a definition for 'GetHashCode' and no accessible extension method 'GetHashCode' accepting a first argument of type 'UnresolvedType' could be found (are you missing a using directive or an assembly reference?),
7878
Severity: Error,
7979
Descriptor: {
80-
Id: CS0535,
80+
Id: CS1061,
8181
Title: ,
82-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0535),
83-
MessageFormat: '{0}' does not implement interface member '{1}',
82+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
83+
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
8484
Category: Compiler,
8585
DefaultSeverity: Error,
8686
IsEnabledByDefault: true,
@@ -92,18 +92,18 @@ partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, Spacetime
9292
}
9393
},
9494
{/*
95-
96-
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
97-
^^^^^^^^^^^^^^
98-
95+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_SECOND_FILTER);
96+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THIRD_FILTER);
97+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+
}
9999
*/
100-
Message: Using the generic type 'TestTypeParams<T>' requires 1 type arguments,
100+
Message: Argument 1: cannot convert from 'string' to 'SpacetimeDB.Filter',
101101
Severity: Error,
102102
Descriptor: {
103-
Id: CS0305,
103+
Id: CS1503,
104104
Title: ,
105-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0305),
106-
MessageFormat: Using the generic {1} '{0}' requires {2} type arguments,
105+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1503),
106+
MessageFormat: Argument {0}: cannot convert from '{1}' to '{2}',
107107
Category: Compiler,
108108
DefaultSeverity: Error,
109109
IsEnabledByDefault: true,
@@ -115,18 +115,18 @@ partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, Spacetime
115115
}
116116
},
117117
{/*
118-
var ___hashUnsupportedSystemType = UnsupportedSystemType == null ? 0 : UnsupportedSystemType.GetHashCode();
119-
var ___hashUnresolvedType = UnresolvedType == null ? 0 : UnresolvedType.GetHashCode();
120-
^^^^^^^^^^^
121-
var ___hashUnsupportedEnum = UnsupportedEnum.GetHashCode();
118+
{
119+
internal static readonly TRW Field = new();
120+
^^^
121+
122122
*/
123-
Message: 'UnresolvedType' does not contain a definition for 'GetHashCode' and no accessible extension method 'GetHashCode' accepting a first argument of type 'UnresolvedType' could be found (are you missing a using directive or an assembly reference?),
123+
Message: The type or namespace name 'TRW' could not be found (are you missing a using directive or an assembly reference?),
124124
Severity: Error,
125125
Descriptor: {
126-
Id: CS1061,
126+
Id: CS0246,
127127
Title: ,
128-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1061),
129-
MessageFormat: '{0}' does not contain a definition for '{1}' and no accessible extension method '{1}' accepting a first argument of type '{0}' could be found (are you missing a using directive or an assembly reference?),
128+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0246),
129+
MessageFormat: The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?),
130130
Category: Compiler,
131131
DefaultSeverity: Error,
132132
IsEnabledByDefault: true,
@@ -138,18 +138,18 @@ var ___hashUnsupportedEnum = UnsupportedEnum.GetHashCode();
138138
}
139139
},
140140
{/*
141-
SpacetimeDB.Internal.Module.RegisterTable<global::TestUniqueNotEquatable, SpacetimeDB.Internal.TableHandles.TestUniqueNotEquatable>();
142-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FILTER);
143-
^^^^^^^^^
144-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOURTH_FILTER);
141+
public Exception UnsupportedSystemType;
142+
public UnresolvedType UnresolvedType;
143+
^^^^^^^^^^^^^^
144+
public LocalEnum UnsupportedEnum;
145145
*/
146-
Message: 'Module.MY_FILTER' is inaccessible due to its protection level,
146+
Message: The type or namespace name 'UnresolvedType' could not be found (are you missing a using directive or an assembly reference?),
147147
Severity: Error,
148148
Descriptor: {
149-
Id: CS0122,
149+
Id: CS0246,
150150
Title: ,
151-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
152-
MessageFormat: '{0}' is inaccessible due to its protection level,
151+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0246),
152+
MessageFormat: The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?),
153153
Category: Compiler,
154154
DefaultSeverity: Error,
155155
IsEnabledByDefault: true,
@@ -161,18 +161,18 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOU
161161
}
162162
},
163163
{/*
164-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_SECOND_FILTER);
165-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THIRD_FILTER);
166-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167-
}
164+
165+
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
166+
^^^^^^^^^^^^^^
167+
168168
*/
169-
Message: Argument 1: cannot convert from 'string' to 'SpacetimeDB.Filter',
169+
Message: Using the generic type 'TestTypeParams<T>' requires 1 type arguments,
170170
Severity: Error,
171171
Descriptor: {
172-
Id: CS1503,
172+
Id: CS0305,
173173
Title: ,
174-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1503),
175-
MessageFormat: Argument {0}: cannot convert from '{1}' to '{2}',
174+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0305),
175+
MessageFormat: Using the generic {1} '{0}' requires {2} type arguments,
176176
Category: Compiler,
177177
DefaultSeverity: Error,
178178
IsEnabledByDefault: true,

0 commit comments

Comments
 (0)