Page MenuHomePhabricator

Eo: Add `Error.Success_Flag` alias wrapping boolean property return values.
Closed, ResolvedPublic

Description

Property setters returning booleans could return an alias to bool like Eina.Success_Flag instead of a plain bool to tell the users that the return type should be checked for error.

This is intended to be able to convey the bool intent while keeping compatibility with existing stable API.

lauromoura triaged this task as Normal priority.

I would call it Eina.Success_Flag.

  • Eina.Flag does not convey that this is an error/success indicator.
  • Eina.Error_Flag is consistent with Eina.Error but the problem is that 0 means "no error" for Eina.Error, whereas in setters returning booleans 0 usually means "operation failed". This would be my preferred option if it wasn't for this problem.
  • Eina.Success does not convey that this is a boolean, and looks weird having Eina.Error and Eina.Success.

Right, Eina.Success_Flag is a good one.

lauromoura reassigned this task from lauromoura to jptiz.Dec 18 2019, 11:25 AM
lauromoura moved this task from Backlog to InProgress on the efl: language bindings board.
lauromoura renamed this task from Eo: Add `Error.Flag` alias wrapping boolean property return values. to Eo: Add `Error.Success_Flag` alias wrapping boolean property return values..Dec 18 2019, 11:28 AM
lauromoura updated the task description. (Show Details)

The parent task (T8048) has a table of the properties (at the time) returning non-void values in setters.

lauromoura raised the priority of this task from Normal to High.Dec 18 2019, 2:36 PM
felipealmeida closed this task as Resolved.Feb 18 2020, 12:56 PM