pufuwozu/roy — Issue #118: TypeError: Cannot read property 'aliased' of undefined
Author: gregwebs
Created: 2012-02-24 02:23:42+00:00
State: open

``` javascript
let f d =
if d then
null
else
null
// don't show unknown if that is all there is
```

```
/home/gweber/proj/js/roy/src/typeinference.js:28
var alias = t1.aliased || t2.aliased;
^
TypeError: Cannot read property 'aliased' of undefined
at /home/gweber/proj/js/roy/src/typeinference.js:28:33
at Object.visitIfThenElse (/home/gweber/proj/js/roy/src/typeinference.js:218:13)
at [object Object].accept (/home/gweber/proj/js/roy/src/nodes.js:188:26)
at /home/gweber/proj/js/roy/src/typeinference.js:142:17
at /home/gweber/proj/js/roy/src/typeinference.js:188:24
at Array.map (native)
at Function.map (/home/gweber/.node_libraries/.npm/underscore/1.2.0/package/underscore.js:93:56)
at Object.visitFunction (/home/gweber/proj/js/roy/src/typeinference.js:187:32)
at [object Object].accept (/home/gweber/proj/js/roy/src/nodes.js:33:26)
at /home/gweber/proj/js/roy/src/typeinference.js:142:17
```

I think Roy would be on a lot better footing if it started with the coffeescript compiler and worked its way backwards. I would be fine with using coffeescript syntax actually. I would only protest if Roy switched from layout-based to brackets or used the full 'function' keyword. Roy isn't about copying Haskell syntax, it is about types!