Skip to content

Allow using normal division operator for integer division #211

Open
@viper-admin

Description

@viper-admin

Created by @marcoeilers on 2017-06-28 13:36
Last updated on 2017-11-27 14:28

Silver currently interprets "/" as a division resulting in a permission, and "" as integer division. Since "/" is the normal division operator people know from other languages, it would be preferable if it could also be used for integer division. The type checker can figure out which one is meant from the expected type of the expression.

However, in some expressions, the type is ambiguous (e.g. (1/2) * (2/1), this could either be equal to a full permission or to zero). In these cases, the user needs to be able to reliably get the result they want. The type checker should therefore default to a perm-expression if both options are valid, and the user can simply use the old "" operator in these cases (which we might want to keep anyway for backwards compatibility).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions