Skip to content

Commit 9bdf3d9

Browse files
committed
Update
1 parent 87e4331 commit 9bdf3d9

5 files changed

Lines changed: 53 additions & 8 deletions

File tree

TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [70%] Variables
1212
- [70%] Virtual variables
1313
- [70%] Methods
14-
- [ ] Aliases
14+
- [x] Aliases
1515
- [ ] Generics
1616
- [ ] Lexical scopes
1717
- [ ] Default lexical scope

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@
3434
- [Interfaces](./interfaces.md)
3535
- [Variables](./variables.md)
3636
- [Virtual variables](./virtual-variables.md)
37-
- [Methods](./methods.md)
37+
- [Methods](./methods.md)
38+
- [Aliases](./aliases.md)

src/aliases.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Aliases
2+
3+
Aliases are used in different places of the language:
4+
5+
```
6+
import CT = com.business.coreRT.enum.ContactType;
7+
type U = (decimal, String);
8+
namespace special_version;
9+
```
10+
11+
## Documentation comment
12+
13+
An alias may be prefixed by a documentation comment.
14+
15+
```
16+
/** Comment */
17+
type Params = {
18+
x : decimal,
19+
};
20+
```

src/packages.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,32 @@ A `package` definition may have a prefix documentation comment, allowing to docu
5858
* Enumerations used in the core runtime.
5959
*/
6060
package com.business.coreRT.enum {}
61+
```
62+
63+
## Package wildcard import
64+
65+
A package wildcard import is aliased for the following directive:
66+
67+
```
68+
import q = com.business.quantum.*;
69+
```
70+
71+
Then `q` may be used as a qualifier to resolve to a name in the `quantum` package (excluding subpackages).
72+
73+
```
74+
q::x
75+
```
76+
77+
## Package recursive import
78+
79+
A package recursive import is aliased for the following directive:
80+
81+
```
82+
import q = com.business.quantum.**;
83+
```
84+
85+
Then `q` may be used as a qualifier to resolve to a name in the `quantum` package and its subpackages in a recursive way.
86+
87+
```
88+
q::x
6189
```

src/types/structural-object.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Structural object
22

3-
Structural object types, `{ ... }`, are simple property records, whose field order and documentation comments are sensitive. Those types are compiled into efficient structures.
3+
Structural object types, `{ ... }`, are simple property records, whose field order is sensitive. Those types are compiled into efficient structures.
44

55
```
66
type N1 = { x : decimal, y : decimal };
@@ -22,13 +22,9 @@ All fields are optional; however, if it is desired to default to `undefined`, a
2222

2323
Due to sensitive field order, structural object types with equivalent fields but in different orders will be incompatible.
2424

25-
## Documentation comments
26-
27-
Due to sensitive documentation comments, structural object types with equivalent fields (including their order) but differing documentation comments in their fields will be incompatible.
28-
2925
## Compatibility
3026

31-
Two structural object types are compatible only if either a\) one is used as a subset of another or b\) fields are equivalent and consist of the same order and the same documentation comments.
27+
Two structural object types are compatible only if either a\) one is used as a subset of another or b\) fields are equivalent and appear in the same order.
3228

3329
## Rest
3430

0 commit comments

Comments
 (0)