Skip to content

Commit

Permalink
Enabling ?LET macros to use user defined types
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Löscher committed Apr 21, 2016
1 parent 5b92e9f commit 6e7a43a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/proper_transformer.erl
Expand Up @@ -276,6 +276,12 @@ rewrite_expr({call,Line,
NewRawType = rewrite_type(RawType, ModInfo),
NewProp = rewrite_expr(Prop, ModInfo),
{call,Line,FunRef,[NewRawType,NewProp]};
rewrite_expr({call, Line,
{remote,_,{atom,_,proper_types}, {atom, _, bind}} = FunRef,
[RawType, Gen, ShrinkToParts]}, ModInfo) ->
NewRawType = rewrite_type(RawType, ModInfo),
NewGen = rewrite_expr(Gen, ModInfo),
{call, Line, FunRef, [NewRawType,NewGen, ShrinkToParts]};
rewrite_expr({call,Line,FunRef,Args}, ModInfo) ->
NewFunRef = rewrite_expr(FunRef, ModInfo),
NewArgs = [rewrite_expr(A,ModInfo) || A <- Args],
Expand Down
2 changes: 1 addition & 1 deletion test/proper_tests.erl
Expand Up @@ -743,7 +743,7 @@ parse_transform_test_() ->
[?_passes(auto_export_test1:prop_1()),
?_assertError(undef, auto_export_test2:prop_1()),
?_assertError(undef, no_native_parse_test:prop_1()),
?_assertError(undef, no_out_of_forall_test:prop_1())].
?_passes(no_out_of_forall_test:prop_1())].

native_type_props_test_() ->
[?_passes(?FORALL({X,Y}, {my_native_type(),my_proper_type()},
Expand Down

0 comments on commit 6e7a43a

Please sign in to comment.