@@ -1194,15 +1194,15 @@ defmodule Module do
1194
1194
arity = length ( args )
1195
1195
pair = { name , arity }
1196
1196
1197
- # Docs must come first as they read the impl callback
1198
- compile_doc ( table , pair , env , kind , args )
1197
+ impl = compile_impl ( table , name , env , kind , args )
1198
+ compile_doc ( table , pair , env , kind , args , impl )
1199
1199
compile_deprecated ( table , pair )
1200
- compile_impl ( table , name , env , kind , args )
1200
+
1201
1201
:ok
1202
1202
end
1203
1203
1204
- defp compile_doc ( table , pair , env , kind , args ) do
1205
- { line , doc } = get_doc_info ( table , env )
1204
+ defp compile_doc ( table , pair , env , kind , args , impl ) do
1205
+ { line , doc } = get_doc_info ( table , env , impl )
1206
1206
1207
1207
# TODO: Store @since alongside the docs
1208
1208
_ = get_since_info ( table )
@@ -1248,13 +1248,12 @@ defmodule Module do
1248
1248
[ { :impl , value , _ , _ } ] ->
1249
1249
impls = :ets . lookup_element ( table , { :elixir , :impls } , 2 )
1250
1250
{ total , defaults } = args_count ( args , 0 , 0 )
1251
-
1252
1251
impl = { { name , total } , defaults , kind , line , file , value }
1253
-
1254
1252
:ets . insert ( table , { { :elixir , :impls } , [ impl | impls ] } )
1253
+ value
1255
1254
1256
1255
[ ] ->
1257
- :ok
1256
+ false
1258
1257
end
1259
1258
end
1260
1259
@@ -1714,16 +1713,16 @@ defmodule Module do
1714
1713
value
1715
1714
end
1716
1715
1717
- defp get_doc_info ( table , env ) do
1716
+ defp get_doc_info ( table , env , impl ) do
1718
1717
case :ets . take ( table , :doc ) do
1719
1718
[ { :doc , { _ , _ } = pair , _ , _ } ] ->
1720
1719
pair
1721
1720
1721
+ [ ] when impl == false ->
1722
+ { env . line , nil }
1723
+
1722
1724
[ ] ->
1723
- case :ets . lookup ( table , :impl ) do
1724
- [ { :impl , value , _ , _ } ] when value != false -> { env . line , false }
1725
- _ -> { env . line , nil }
1726
- end
1725
+ { env . line , false }
1727
1726
end
1728
1727
end
1729
1728
0 commit comments