소스 검색

mention that a macro returned null when it did (closes #3225)

Simon Krajewski 11 년 전
부모
커밋
8f61a0bb83
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      typer.ml

+ 4 - 1
typer.ml

@@ -4562,7 +4562,10 @@ let type_macro ctx mode cpath f (el:Ast.expr list) p =
 					(EBlock [],p)
 				)
 			with Interp.Invalid_expr ->
-				error "The macro didn't return a valid result" p
+				if v = Interp.VNull then
+					error "Unexpected null value returned from macro" p
+				else
+					error "The macro didn't return a valid result" p
 	in
 	let e = (if ctx.in_macro then begin
 		(*