FlatLang / Flat

(Deprecated) Soon-to-be legacy Flat compiler all in one
6 stars 0 forks source link

Public interface fields break immutable classes that implement them #352

Open BSteffaniak opened 7 years ago

BSteffaniak commented 7 years ago

Immutable classes cannot have public variables for obvious reasons.

Possible solutions:

immutable class Thing<K> implements List<K> {
    // would be generated automatically
    public K first => super.first {
        set {
            let newData = ...

            return new Thing(newData)
        }
    }
}