@@ -102,9 +102,18 @@ def bar():
102102 self.foo()
103103 A.foo()
104104 assert 1 != 12
105+ self.ctor_and_runtime()
105106
106107@internal
107108def only_from_ctor():
109+ self.ctor_recursive()
110+
111+ @internal
112+ def ctor_recursive():
113+ self.ctor_and_runtime()
114+
115+ @internal
116+ def ctor_and_runtime():
108117 pass
109118
110119@deploy
@@ -122,19 +131,24 @@ def __init__():
122131
123132 assert "foo (0)" in function_infos
124133 assert "foo (1)" in function_infos
125- assert "bar (2)" in function_infos
126- assert "only_from_ctor (4)" in function_infos
134+ assert "ctor_and_runtime (2)" in function_infos
135+ assert "bar (3)" in function_infos
136+ assert "ctor_recursive (5)" in function_infos
137+ assert "only_from_ctor (6)" in function_infos
127138 # faa is unreachable, should not be in metadata or bytecode
128139 assert not any ("faa" in key for key in function_infos .keys ())
129140
130141 assert function_infos ["foo (0)" ]["function_id" ] == 0
131142 assert function_infos ["foo (1)" ]["function_id" ] == 1
132- assert function_infos ["bar (2)" ]["function_id" ] == 2
143+ assert function_infos ["ctor_and_runtime (2)" ]["function_id" ] == 2
144+ assert function_infos ["bar (3)" ]["function_id" ] == 3
145+ assert function_infos ["ctor_recursive (5)" ]["function_id" ] == 5
146+ assert function_infos ["only_from_ctor (6)" ]["function_id" ] == 6
133147
134148 assert function_infos ["foo (0)" ]["module_path" ] == "B.vy"
135149 assert function_infos ["foo (1)" ]["module_path" ] == "A.vy"
136- assert function_infos ["bar (2 )" ]["module_path" ] == "B.vy"
150+ assert function_infos ["bar (3 )" ]["module_path" ] == "B.vy"
137151
138152 assert function_infos ["foo (0)" ]["source_id" ] == input_bundle .load_file ("B.vy" ).source_id
139153 assert function_infos ["foo (1)" ]["source_id" ] == input_bundle .load_file ("A.vy" ).source_id
140- assert function_infos ["bar (2 )" ]["source_id" ] == input_bundle .load_file ("B.vy" ).source_id
154+ assert function_infos ["bar (3 )" ]["source_id" ] == input_bundle .load_file ("B.vy" ).source_id
0 commit comments