...
This commit is contained in:
@@ -672,10 +672,10 @@ public class TypeChecker
|
||||
throw BasicError($"Enum '{variantType.EnumType}' does not have a variant named '{variantType.Variant}'", expression.Type);
|
||||
|
||||
if (expression.Value == null && variant.Type is not null)
|
||||
throw BasicError($"Enum variant '{variantType.EnumType}' expects a value of type '{variant.Type}'", expression.Type);
|
||||
throw BasicError($"Enum variant '{variantType}' expects a value of type '{variant.Type}'", expression.Type);
|
||||
|
||||
if (expression.Value != null && variant.Type is null)
|
||||
throw BasicError($"Enum variant '{variantType.EnumType}' does not expect any data", expression.Value);
|
||||
throw BasicError($"Enum variant '{variantType}' does not expect any data", expression.Value);
|
||||
|
||||
var value = expression.Value == null ? null : CheckExpression(expression.Value, variant.Type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user