In the type language, we may want to express to distinct kinds of types:
- a structural object type with a p:int field, and possibly other fields, which the type system allows access to (really, a dynamic object type)
- a structural object type with a p:int field, and no other fields that the type system allows access to (a non-dynamic object type)
If we wish to support both, then the syntax {p:int,*} and {p:int} seems to work well. A next question is which is Object like?
A related issue is:
-- Object or {} denotes the empty object, which is distinct from the dynamic object {*}. However, Array or [] denotes the dynamically-typed array, which is equivalent to [*]. Although not a bug per se, there is a certain lack of symmetry here.