Skip to content

Commit

Permalink
Merge pull request #365 from EliasC/fix/arrow-type-result-map
Browse files Browse the repository at this point in the history
Fix #364
  • Loading branch information
supercooldave committed Apr 7, 2016
2 parents 57e1173 + d3fc30a commit b3bf67c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/tests/encore/basic/functionCast.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def fun() : (String, String) {
("Hello", "world")
}

class Main {
def main() : void {
let foo = fun : () -> (String, String);
match foo() with
(h, w) => print("{} {}\n", h, w)
}
}
1 change: 1 addition & 0 deletions src/tests/encore/basic/functionCast.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world
2 changes: 1 addition & 1 deletion src/types/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ typeMapM f ty@CapabilityType{capability} = do
f ty{capability = capability'}
typeMapM f ty@ArrowType{argTypes, resultType} = do
argTypes' <- mapM (typeMapM f) argTypes
resultType' <- f resultType
resultType' <- typeMapM f resultType
f ty{argTypes = argTypes'
,resultType = resultType'}
typeMapM f ty@TupleType{argTypes} = do
Expand Down

0 comments on commit b3bf67c

Please sign in to comment.