Skip to content

Immutability Example does not generate error #530

@jimwillis

Description

@jimwillis

Bug Report

Attempting to replicate the Sample Code found at https://www.kcl-lang.io/docs/reference/lang/tour#schema.

1. Minimal reproduce step (Required)

schema Person:
    age: int = 1  # Immutable attribute
    _name: str = "Alice"  # Mutable attribute

    age = 10  # Error
    _name = "Bob"  # Ok

p:Person = Person{}

2. What did you expect to see? (Required)

An error message specific to Immutability

3. What did you see instead (Required)

❯ kcl person.k
p:
  age: 10

4. What is your KCL components version? (Required)

❯ kcl --version
kcl version v0.11.1

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