File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 13
13
Warning 8 : this pattern- matching is not exhaustive.
14
14
Here is an example of a case that is not matched:
15
15
Error _
16
- Compiling gen_tcp .erl OK
16
+ Compiling gen_tcp_types .erl OK
17
17
Compiling echo.erl OK
18
18
$ cat gen_tcp.erl
19
+ cat: gen_tcp.erl: No such file or directory
20
+ [1 ]
19
21
$ cat gen_tcp_types.erl
22
+ % Source code generated with Caramel.
23
+ - module (gen_tcp_types).
24
+ - export_type ([connection/ 0 ]).
25
+ - export_type ([listen_opt/ 0 ]).
26
+ - export_type ([packet/ 0 ]).
27
+ - export_type ([socket/ 0 ]).
28
+
29
+
30
+ - opaque socket () :: reference ().
31
+
32
+ - opaque connection () :: reference ().
33
+
34
+ - type packet () :: http
35
+ | line
36
+ .
37
+
38
+ - type listen_opt () :: {active, boolean ()}
39
+ | {packet, packet ()}
40
+ .
41
+
42
+
20
43
$ cat echo.erl
21
44
% Source code generated with Caramel.
22
45
- module (echo).
25
48
- export ([loop / 1 ]).
26
49
- export ([start/ 1 ]).
27
50
28
- - spec handle (gen_tcp :connection ()) -> ok.
51
+ - spec handle (gen_tcp_types :connection ()) -> ok.
29
52
handle (Conn) ->
30
53
gen_tcp:send (Conn, << "hello world" >> ),
31
54
gen_tcp:close (Conn).
32
55
33
- - spec loop (gen_tcp :socket ()) -> any ().
56
+ - spec loop (gen_tcp_types :socket ()) -> any ().
34
57
loop (Socket) ->
35
58
case gen_tcp:accept (Socket) of
36
59
{ok, Conn} -> Handler = process:make (fun
You can’t perform that action at this time.
0 commit comments