texodus/forml — pull request #23 by taku0 (2012-12-18 13:18:55+00:00)
Title: Fixed order of types of accessors.

Fixed order of types of accessors.

### Summary
The symbols for the type of accessor expressions is reversed.

### Sample Code

tmp.forml
```
module foo
f x = x.y.z
```

Then compile with -t option.

`forml -no-test -no-opt -t tmp.forml`

### Expected
```
foo
f: {y = {z = a, _ }, _ } → a
```

### Actual
```
foo
f: {z = {y = a, _ }, _ } → a
```

Note that the compiled code is correct: `x["y"]["z"]`.

### Cause
The `infer` function for `AccessorExpression` translates the code `x.y.z` into `(.y)((.z) x)`.

### Fix
Reversed symbols.

### Another Problem
The following code in prelude.forml cannot be typed if we apply the fix above.
```
let ...
desc = spec.description.split "__::__" !! 1
...
line = get_line spec.description
```
The type of `spec.description` is inferred as `{split = String → Array v1399, _ }` while `get_line` expects `String`.

### Fix
Using the `split` function instead of `split` method of String.