diff options
author | Björn Gustavsson <[email protected]> | 2010-05-30 08:27:57 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-11-02 12:12:30 +0100 |
commit | b9e610cf12419c6ffe2c19df4f70009bd98ae50c (patch) | |
tree | 21f7c7d2e0b5296e4553d0c372c4834795e63c05 /lib/compiler/test | |
parent | 71f2687e53ef52ae94ab3569a601456d1e906a59 (diff) | |
download | otp-b9e610cf12419c6ffe2c19df4f70009bd98ae50c.tar.gz otp-b9e610cf12419c6ffe2c19df4f70009bd98ae50c.tar.bz2 otp-b9e610cf12419c6ffe2c19df4f70009bd98ae50c.zip |
Test calling a parameterized module within a fun
It is tempting to transform code such as:
fun(X) -> M:foo(X) end
to:
fun M:foo/1
Unfortunately, that transformation is not safe if
M happens to be a parameterized module. Add a test
case so that we don't attempt to do such an optimization
in the future.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/pmod_SUITE.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/test/pmod_SUITE.erl b/lib/compiler/test/pmod_SUITE.erl index 9a317b5762..3d02adaf52 100644 --- a/lib/compiler/test/pmod_SUITE.erl +++ b/lib/compiler/test/pmod_SUITE.erl @@ -96,6 +96,10 @@ basic_1(Config, Opts) -> ?line error = Prop4:bar_bar({s,a,b}), ?line error = Prop4:bar_bar([]), + %% Call from a fun. + Fun = fun(Arg) -> Prop4:bar(Arg) end, + ?line ok = Fun({s,0}), + ok. otp_8447(Config) when is_list(Config) -> |