Skip to content

Type mismatch when instantiating a tuple with a natural number #828

@xtagon

Description

@xtagon
type
  TSemVer* = tuple
    major, minor, patch: natural
    special: string

const VERSION: TSemVer = (0, 1, 0, "")

This causes the error type mismatch: got (tuple[int, int, int, string]) but expected 'TSemVer'

If you change natural to int, it compiles fine. What is the way to use natural numbers?

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