Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'fix_deep_matching' into where_syntax

  • Loading branch information...
commit 57e79e5b61bff806b910031ab7b6a0f242730de2 2 parents 83aa301 + 26b152e
@taku0 authored
Showing with 9 additions and 2 deletions.
  1. +2 −2 src/typeinference.js
  2. +7 −0 test/deep_matching.roy
View
4 src/typeinference.js
@@ -513,8 +513,8 @@ var analyse = function(node, env, nonGeneric, data, aliases) {
if(v.value in data) {
unify(currentValue, fresh(prune(newEnv[v.value]), newNonGeneric));
} else {
- newEnv[v.value] = currentValue;
- newNonGeneric.push(newEnv[v.value]);
+ newEnv[v.value] = data[p.tag.value][i];
+ newNonGeneric.push(currentValue);
}
argNames[v.value] = newEnv[v.value];
},
View
7 test/deep_matching.roy
@@ -8,3 +8,10 @@ console.log (xor (Left (Left 100)))
console.log (xor (Left (Right 100)))
console.log (xor (Right (Left 100)))
console.log (xor (Right (Right 100)))
+
+data XX = X
+data YY = Y XX
+let yy = Y X
+let idXX (x:XX) = x
+match yy
+ case (Y x) = idXX x
Please sign in to comment.
Something went wrong with that request. Please try again.