[erlang-questions] Non-typed errors in catch

Salikhov Dinislam Dinislam.Salikhov@REDACTED
Thu May 16 18:08:28 CEST 2019


Hello,

I have the following module:

    -module(exception).

    -export([
         foo/1
    ]).

    foo(Any) ->
         try Any + 1 of
             Any -> ok
         catch
             Error -> {not_typed, Error};                 % warn?
             any:Error -> {any_error, Error};           % warn?
             Type:Error -> {typed_error, {Type, Error}}
         end.

Compiler doesn't complain about the marked lines. Neither does dialyzer.
Is there any rationale for such behaviour? Or is it a bug?

P.S. I use Erlang/OTP 20 [erts-9.3.2].

Regards,
Dinislam Salikhov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190516/52d78d38/attachment.htm>


More information about the erlang-questions mailing list