Skip to content

Commit 7385ca7

Browse files
committed
Added comments to Codegen module and checks to Default Values data
1 parent 4363956 commit 7385ca7

2 files changed

Lines changed: 202 additions & 42 deletions

File tree

crates/bindings-csharp/Codegen/Diag.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,33 @@ string typeName
150150
$"Field {field.Name} is marked as [ClientVisibilityFilter] but it is not public static readonly",
151151
field => field
152152
);
153+
154+
public static readonly ErrorDescriptor<
155+
IFieldSymbol
156+
> IncompatibleDefaultAttributesCombination =
157+
new(
158+
group,
159+
"Invalid Combination: AutoInc, Unique or PrimaryKey cannot have a Default value",
160+
field =>
161+
$"Field {field.Name} contains a default value and has a AutoInc, Unique or PrimaryKey attributes, which is not allowed.",
162+
field => field
163+
);
164+
165+
public static readonly ErrorDescriptor<IFieldSymbol> InvalidDefaultValueType =
166+
new(
167+
group,
168+
"Invalid Default Value Type",
169+
field =>
170+
$"Default value for field {field.Name} cannot be converted to provided type",
171+
field => field
172+
);
173+
174+
public static readonly ErrorDescriptor<IFieldSymbol> InvalidDefaultValueFormat =
175+
new(
176+
group,
177+
"Invalid Default Value Format",
178+
field =>
179+
$"Default value for field {field.Name} has invalid format for provided type ",
180+
field => field
181+
);
153182
}

0 commit comments

Comments
 (0)