diff options
author | John Högberg <[email protected]> | 2019-01-24 08:52:21 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-01-24 08:52:21 +0100 |
commit | a0104bc16c8c6f57c2725d07b811bf3bcb0a2455 (patch) | |
tree | 02ea5e7585b66c04c3d775b42f8ccfa9a68a6d8b /lib/compiler/test/apply_SUITE.erl | |
parent | 5a9adb7b9b600fc2a406e677a673047045a494d8 (diff) | |
parent | 294d66a295f6c2101fe3c2da630979ad4e736c08 (diff) | |
download | otp-a0104bc16c8c6f57c2725d07b811bf3bcb0a2455.tar.gz otp-a0104bc16c8c6f57c2725d07b811bf3bcb0a2455.tar.bz2 otp-a0104bc16c8c6f57c2725d07b811bf3bcb0a2455.zip |
Merge pull request #2100 from jhogberg/john/compiler/module-type-optimization
Apply type optimizations across local function calls
Diffstat (limited to 'lib/compiler/test/apply_SUITE.erl')
-rw-r--r-- | lib/compiler/test/apply_SUITE.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compiler/test/apply_SUITE.erl b/lib/compiler/test/apply_SUITE.erl index 0f82a56fb7..2ee518b1a0 100644 --- a/lib/compiler/test/apply_SUITE.erl +++ b/lib/compiler/test/apply_SUITE.erl @@ -73,6 +73,7 @@ mfa(Config) when is_list(Config) -> {'EXIT',_} = (catch ?APPLY2(Mod, (id(bazzzzzz)), a, b)), {'EXIT',_} = (catch ?APPLY2({}, baz, a, b)), {'EXIT',_} = (catch ?APPLY2(?MODULE, [], a, b)), + {'EXIT',_} = (catch bad_literal_call(1)), ok = apply(Mod, foo, id([])), {[a,b|c]} = apply(Mod, bar, id([[a,b|c]])), @@ -92,6 +93,13 @@ mfa(Config) when is_list(Config) -> apply(Mod, foo, []). +%% The single call to this function with a literal argument caused type +%% optimization to swap out the 'mod' field of a #b_remote{}, which was +%% mishandled during code generation as it assumed that the module would always +%% be an atom. +bad_literal_call(I) -> + I:foo(). + foo() -> ok. |