Browse Source

deactivate native pattern match handling in macros

Simon Krajewski 12 năm trước cách đây
mục cha
commit
b908c30673
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -2079,7 +2079,7 @@ and type_switch ctx e cases def (with_type:with_type) p =
 	try
 	try
 		if (Common.defined ctx.com Common.Define.NoPatternMatching) then raise Exit;
 		if (Common.defined ctx.com Common.Define.NoPatternMatching) then raise Exit;
 		let dt = match_expr ctx e cases def with_type p in
 		let dt = match_expr ctx e cases def with_type p in
-		if ctx.com.config.pf_pattern_matching then mk (TPatMatch dt) dt.dt_type p else Codegen.PatternMatchConversion.to_typed_ast ctx dt p
+		if not ctx.in_macro && ctx.com.config.pf_pattern_matching then mk (TPatMatch dt) dt.dt_type p else Codegen.PatternMatchConversion.to_typed_ast ctx dt p
 	with Exit ->
 	with Exit ->
 		type_switch_old ctx e cases def with_type p
 		type_switch_old ctx e cases def with_type p