Skip to content

Cannot initialize types that have static values. #1605

Open
@lucteo

Description

See the following code:

type MyEnum {
  memberwise init

  internal let value: Int

  public static let static_value: MyEnum = construct_some_value()

  public static fun construct_some_value() -> MyEnum {
    return .new(value: 0)
  }
}

Compiling this yields:

Bug.hylo:9.12-16: error: incompatible labels: found '(value:)', expected '(value:static_value:)'
    return .new(value: 0)
           ~~~~
make: *** [bug] Error 1

It seems that the initializer incorrectly also requires the static value to be constructed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions