Skip to content

Commit 2d1a75a

Browse files
committed
Determinism is a fading dream
1 parent 0edd403 commit 2d1a75a

File tree

2 files changed

+60
-60
lines changed

2 files changed

+60
-60
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.Location.SourceSpan.ToString());
127+
.OrderBy(diag => diag.ToString());
128128
}
129129

130130
[Fact]

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

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
[
2+
{/*
3+
public Exception UnsupportedSystemType;
4+
public UnresolvedType UnresolvedType;
5+
^^^^^^^^^^^^^^
6+
public LocalEnum UnsupportedEnum;
7+
*/
8+
Message: The type or namespace name 'UnresolvedType' could not be found (are you missing a using directive or an assembly reference?),
9+
Severity: Error,
10+
Descriptor: {
11+
Id: CS0246,
12+
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?),
15+
Category: Compiler,
16+
DefaultSeverity: Error,
17+
IsEnabledByDefault: true,
18+
CustomTags: [
19+
Compiler,
20+
Telemetry,
21+
NotConfigurable
22+
]
23+
}
24+
},
225
{/*
326
// Valid Filter, but [ClientVisibilityFilter] is disabled
427
[SpacetimeDB.ClientVisibilityFilter]
@@ -23,12 +46,12 @@
2346
}
2447
},
2548
{/*
26-
public Exception UnsupportedSystemType;
27-
public UnresolvedType UnresolvedType;
28-
^^^^^^^^^^^^^^
29-
public LocalEnum UnsupportedEnum;
49+
{
50+
internal static readonly TRW Field = new();
51+
^^^
52+
3053
*/
31-
Message: The type or namespace name 'UnresolvedType' could not be found (are you missing a using directive or an assembly reference?),
54+
Message: The type or namespace name 'TRW' could not be found (are you missing a using directive or an assembly reference?),
3255
Severity: Error,
3356
Descriptor: {
3457
Id: CS0246,
@@ -46,18 +69,18 @@
4669
}
4770
},
4871
{/*
49-
SpacetimeDB.Internal.Module.RegisterTable<global::TestUniqueNotEquatable, SpacetimeDB.Internal.TableHandles.TestUniqueNotEquatable>();
50-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FILTER);
51-
^^^^^^^^^
52-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOURTH_FILTER);
72+
73+
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
74+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75+
5376
*/
54-
Message: 'Module.MY_FILTER' is inaccessible due to its protection level,
77+
Message: 'TestTypeParams<T>' does not implement interface member 'IEquatable<TestTypeParams>.Equals(TestTypeParams?)',
5578
Severity: Error,
5679
Descriptor: {
57-
Id: CS0122,
80+
Id: CS0535,
5881
Title: ,
59-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
60-
MessageFormat: '{0}' is inaccessible due to its protection level,
82+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0535),
83+
MessageFormat: '{0}' does not implement interface member '{1}',
6184
Category: Compiler,
6285
DefaultSeverity: Error,
6386
IsEnabledByDefault: true,
@@ -69,18 +92,18 @@ SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_FOU
6992
}
7093
},
7194
{/*
72-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_SECOND_FILTER);
73-
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THIRD_FILTER);
74-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
75-
}
95+
96+
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
97+
^^^^^^^^^^^^^^
98+
7699
*/
77-
Message: Argument 1: cannot convert from 'string' to 'SpacetimeDB.Filter',
100+
Message: Using the generic type 'TestTypeParams<T>' requires 1 type arguments,
78101
Severity: Error,
79102
Descriptor: {
80-
Id: CS1503,
103+
Id: CS0305,
81104
Title: ,
82-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1503),
83-
MessageFormat: Argument {0}: cannot convert from '{1}' to '{2}',
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,
84107
Category: Compiler,
85108
DefaultSeverity: Error,
86109
IsEnabledByDefault: true,
@@ -115,18 +138,18 @@ var ___hashUnsupportedEnum = UnsupportedEnum.GetHashCode();
115138
}
116139
},
117140
{/*
118-
{
119-
internal static readonly TRW Field = new();
120-
^^^
121-
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);
122145
*/
123-
Message: The type or namespace name 'TRW' could not be found (are you missing a using directive or an assembly reference?),
146+
Message: 'Module.MY_FILTER' is inaccessible due to its protection level,
124147
Severity: Error,
125148
Descriptor: {
126-
Id: CS0246,
149+
Id: CS0122,
127150
Title: ,
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?),
151+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0122),
152+
MessageFormat: '{0}' is inaccessible due to its protection level,
130153
Category: Compiler,
131154
DefaultSeverity: Error,
132155
IsEnabledByDefault: true,
@@ -138,41 +161,18 @@ var ___hashUnsupportedEnum = UnsupportedEnum.GetHashCode();
138161
}
139162
},
140163
{/*
141-
142-
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
143-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
144-
145-
*/
146-
Message: 'TestTypeParams<T>' does not implement interface member 'IEquatable<TestTypeParams>.Equals(TestTypeParams?)',
147-
Severity: Error,
148-
Descriptor: {
149-
Id: CS0535,
150-
Title: ,
151-
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0535),
152-
MessageFormat: '{0}' does not implement interface member '{1}',
153-
Category: Compiler,
154-
DefaultSeverity: Error,
155-
IsEnabledByDefault: true,
156-
CustomTags: [
157-
Compiler,
158-
Telemetry,
159-
NotConfigurable
160-
]
164+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_SECOND_FILTER);
165+
SpacetimeDB.Internal.Module.RegisterClientVisibilityFilter(global::Module.MY_THIRD_FILTER);
166+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161167
}
162-
},
163-
{/*
164-
165-
partial struct TestTypeParams<T> : System.IEquatable<TestTypeParams>, SpacetimeDB.BSATN.IStructuralReadWrite {
166-
^^^^^^^^^^^^^^
167-
168168
*/
169-
Message: Using the generic type 'TestTypeParams<T>' requires 1 type arguments,
169+
Message: Argument 1: cannot convert from 'string' to 'SpacetimeDB.Filter',
170170
Severity: Error,
171171
Descriptor: {
172-
Id: CS0305,
172+
Id: CS1503,
173173
Title: ,
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,
174+
HelpLink: https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS1503),
175+
MessageFormat: Argument {0}: cannot convert from '{1}' to '{2}',
176176
Category: Compiler,
177177
DefaultSeverity: Error,
178178
IsEnabledByDefault: true,

0 commit comments

Comments
 (0)