Skip to content
Browse files

[fix] compiler, syntax: We want coerce also on pattern binding

  • Loading branch information...
1 parent 4b041c8 commit 5cdbd53a32d27908743a8b32673c9ef1f2e7efcf @BourgerieQuentin BourgerieQuentin committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 opalang/js_syntax/opa_parser.trx
View
5 opalang/js_syntax/opa_parser.trx
@@ -507,7 +507,10 @@ binding_pattern_lambda <- binding_lambda:b {{binding_to_pattern_binding b }}
binding_pattern_module <- binding_module:b {{binding_to_pattern_binding b }}
-binding_pattern_simple <- pattern:p assign expr:e {{ p, e }}
+binding_pattern_simple <-
+ (=type_maybe(
+ pattern:p assign expr:e {{ function t -> p, may_coerce_expr e t }}
+ ))
binding_ident <-
/ binding_lambda

0 comments on commit 5cdbd53

Please sign in to comment.
Something went wrong with that request. Please try again.