Skip to content

Spec disallows double ~/ double as constant expression, implementations allow. #3468

Open
@lrhn

Description

@lrhn

The specification groups ~/ with the shift operators, which is only allowed as constant on int operands.

The operator is allowed and well-defined on doubles, and both analyzer and CFE accepts const c = 3.5 ~/ 2.2; without complains.
We should just move it into the same group of constant operations as -, *, etc., which are defined if the operands are instances of either int or double.

(Also, while in the constant section, line 8594, in the "constant set literal" section. says:

if the list literal evaluates to an object.

Should say "set".)

@eernstg

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThere is a mistake in the language specification or in an active document

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions