diff options
author | Anthony Ramine <[email protected]> | 2013-06-06 22:25:07 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-06-07 10:45:41 +0200 |
commit | 29c2de1044d25c5ae641797e527ca72df8495355 (patch) | |
tree | c9f85082d44aece3f821369a969d6c88f1777e2f /lib/compiler/src | |
parent | b1da47eff2e41013d60dacebbdfa31ce60357d23 (diff) | |
download | otp-29c2de1044d25c5ae641797e527ca72df8495355.tar.gz otp-29c2de1044d25c5ae641797e527ca72df8495355.tar.bz2 otp-29c2de1044d25c5ae641797e527ca72df8495355.zip |
Silence a misleading warning with some comprehensions
When compiling comprehensions with generators which are foldable to
'true', a misleading warning is emitted by sys_core_fold because a
clause resulting from the compilation of the comprehension to Core
Erlang is not marked as generated by the compiler.
An example of such a comprehension is [ true || true ].
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index eea54b30a2..f243127b66 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -956,7 +956,8 @@ lc_tq(Line, E, [Fil0|Qs0], Mc, St0) -> args=[], clauses=[#iclause{anno=LAnno,pats=[], guard=Gs,body=Lps ++ [Lc]}], - fc=#iclause{anno=LAnno,pats=[],guard=[],body=[Mc]}}, + fc=#iclause{anno=LAnno#a{anno=[compiler_generated|LA]}, + pats=[],guard=[],body=[Mc]}}, [],St2}; false -> {Lc,Lps,St1} = lc_tq(Line, E, Qs0, Mc, St0), @@ -1101,7 +1102,8 @@ bc_tq1(Line, E, [Fil0|Qs0], AccVar, St0) -> clauses=[#iclause{anno=LAnno, pats=[], guard=Gs,body=Bps ++ [Bc]}], - fc=#iclause{anno=LAnno,pats=[],guard=[],body=[AccVar]}}, + fc=#iclause{anno=LAnno#a{anno=[compiler_generated|LA]}, + pats=[],guard=[],body=[AccVar]}}, [],St}; false -> {Bc,Bps,St1} = bc_tq1(Line, E, Qs0, AccVar, St0), |