Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

issues with field initializers #108

@ericlippert

Description

@ericlippert

The grammar and semantics of field initializers are not quite right in chapter 10.

  field-initializer:
    single-quoted-string-literal  =>  expression
    integer-literal  =>  expression
    qualified-name  =>  expression
    scope-resolution-expression  =>  expression

First, integer literals are -- bizarrely -- not legal on the left side of a field initializer. Named constants that have integer values are legal, which falls under "qualified name". "integer-literal" should be removed.

Second, double-quoted string literals are legal on the left side, provided that they do not contain any evaluated expressions. So "X" would be legal, but "$x" would not. We should add a note to that effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions