private void AddIncorrectDefinitionError(Type sourceType, FieldInfo fieldInfo) => this.CodeGenErrors.Add(new CodegenError { ErrorNumber = "Incorrect definition", ErrorText = $"FixedArray can be only used in class '{sourceType}'", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(fieldInfo), });
private void AddMissingFieldReadonlyModifierError(Type sourceType, FieldInfo fieldInfo) => this.CodeGenErrors.Add(new CodegenError { ErrorNumber = "Missing field readonly modifier", ErrorText = $"Fixed size array field {fieldInfo.Name} of class '{sourceType.ToString()}' should be readonly", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(fieldInfo), });
private void AddInvalidAlignmentSizeError(Type sourceType, FieldInfo fieldInfo) => this.CodeGenErrors.Add(new CodegenError { ErrorNumber = "Invalid alignment size", ErrorText = "Alignment size is required to be a power of 2.", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(fieldInfo), });
private void AddUntaggedOrNoneScalarPublicSettingRegistryField(Type sourceType, FieldInfo fieldInfo) => this.CodeGenErrors.Add(new CodegenError { ErrorNumber = "Untagged or non-scalar public SettingRegistry field", ErrorText = $"Public field '{fieldInfo.Name}' in SettingsRegistry type '{sourceType.FullName}' is not a scalar or not tagged as an Mlos code gened field.", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(fieldInfo), });
private void AddUnsupportedFieldTypeError(Type sourceType, FieldInfo fieldInfo) => this.CodeGenErrors.Add(new CodegenError { ErrorNumber = "Not supported type", ErrorText = $"Unsupported field type of class '{sourceType.ToString()}'", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(fieldInfo), });
private void AddIncorrectStructAccessModifier(Type sourceType) => CodeGenErrors.Add( new CodegenError { ErrorNumber = "Incorrect struct access modifier", ErrorText = $"Codegen type struct must be declared as public '{sourceType}'", IsWarning = false, FileLinePosition = SourceCompilation.GetFileLinePosition(sourceType), });