Fulfilling Type

A class is a Type.
Fulfilling type means that,
A partly fulfilled class is also a Type.
We can partly fulfill a class by apply it to arguments, its fields will be fulfilled one by one.
The object construction works as usual.
NOTE Subtyping is working in progress.
For examples,
  • ABC(Trivial) will be a subtype of ABC;
  • ABC(Trivial, sole) will be a subtype of ABC(Trivial).
Except be fulfilled, a class can also be prefilled.
class PrefilledABC {
  a: Type = Trivial,
  b: a,
  c: String,

check {
  a: Trivial,
  b: sole,
  c: "c",
}: PrefilledABC
Prefilled fields need not to be at the beginning.
Prefilled class can also be fulfilled by applying the class to arguments, note that the prefilled fields must be the same.