Skip to content

as is usable as infix operator but its existence and precedence are not documented #13409

@metagn

Description

@metagn

https://nim-lang.org/docs/manual.html#precedence https://nim-lang.org/docs/manual.html#lexical-analysis-operators

Example

template `as`[T, U](x: T, _: typedesc[U]): U = U(x)

echo(65 as char)

Current Output

A

Possible Solution

  • List it as an operator in the manual and add it to the operators with precedence 5
$ nim -v
Nim Compiler Version 1.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to documentation content (not generation).Showstopper

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions