Skip to content

Multi-line as, as?, is_a?, and other special methods cause syntax error #8318

Closed
@icy-arctic-fox

Description

The following code generates a syntax error:

x = 42.as(Int32?)
x.as(Int32
)
Error: expecting token ')', not 'NEWLINE'

This seems to happen with all "special" or "pseudo" methods. These also produce the issue:
as?, is_a?, sizeof, pointerof, typeof

Crystal v0.31.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    kind:bugA bug in the code. Does not apply to documentation, specs, etc.topic:compiler:parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions