@@ -229,13 +229,15 @@ def test_homogeneous_list_annotation_int(stc_language):
229
229
def homogeneous_list_annotation ():
230
230
a : 'list[int]' # pylint: disable=unused-variable
231
231
a = [1 , 2 , 3 , 4 ]
232
+ return a [0 ], a [1 ], a [2 ], a [3 ]
232
233
epyc_homogeneous_list_annotation = epyccel (homogeneous_list_annotation , language = stc_language )
233
234
assert epyc_homogeneous_list_annotation () == homogeneous_list_annotation ()
234
235
assert isinstance (epyc_homogeneous_list_annotation (), type (homogeneous_list_annotation ()))
235
236
236
237
def test_homogeneous_list_without_annotation (stc_language ):
237
238
def homogeneous_list ():
238
239
a = [1 , 2 , 3 , 4 ] # pylint: disable=unused-variable
240
+ return a [0 ], a [1 ], a [2 ], a [3 ]
239
241
epyc_homogeneous_list = epyccel (homogeneous_list , language = stc_language )
240
242
assert epyc_homogeneous_list () == homogeneous_list ()
241
243
assert isinstance (epyc_homogeneous_list (), type (homogeneous_list ()))
@@ -244,6 +246,7 @@ def test_homogeneous_list_annotation_float(stc_language):
244
246
def homogeneous_list_annotation ():
245
247
a : 'list[float]' # pylint: disable=unused-variable
246
248
a = [1.1 , 2.2 , 3.3 , 4.4 ]
249
+ return a [0 ], a [1 ], a [2 ], a [3 ]
247
250
epyc_homogeneous_list_annotation = epyccel (homogeneous_list_annotation , language = stc_language )
248
251
assert epyc_homogeneous_list_annotation () == homogeneous_list_annotation ()
249
252
assert isinstance (epyc_homogeneous_list_annotation (), type (homogeneous_list_annotation ()))
@@ -252,6 +255,7 @@ def test_homogeneous_list_annotation_bool(stc_language):
252
255
def homogeneous_list_annotation ():
253
256
a : 'list[bool]' # pylint: disable=unused-variable
254
257
a = [False , True , True , False ]
258
+ return a [0 ], a [1 ], a [2 ], a [3 ]
255
259
epyc_homogeneous_list_annotation = epyccel (homogeneous_list_annotation , language = stc_language )
256
260
assert epyc_homogeneous_list_annotation () == homogeneous_list_annotation ()
257
261
assert isinstance (epyc_homogeneous_list_annotation (), type (homogeneous_list_annotation ()))
@@ -260,6 +264,7 @@ def test_homogeneous_list_annotation_complex(stc_language):
260
264
def homogeneous_list_annotation ():
261
265
a : 'list[complex]' # pylint: disable=unused-variable
262
266
a = [1 + 1j , 2 + 2j , 3 + 3j , 4 + 4j ]
267
+ return a [0 ], a [1 ], a [2 ], a [3 ]
263
268
epyc_homogeneous_list_annotation = epyccel (homogeneous_list_annotation , language = stc_language )
264
269
assert epyc_homogeneous_list_annotation () == homogeneous_list_annotation ()
265
270
assert isinstance (epyc_homogeneous_list_annotation (), type (homogeneous_list_annotation ()))
@@ -268,6 +273,7 @@ def test_homogeneous_list_annotation_embedded_complex(stc_language):
268
273
def homogeneous_list_annotation ():
269
274
a : 'list[complex]' = [1j , 2j ]
270
275
b = [a ] # pylint: disable=unused-variable
276
+ return b [0 ][0 ]
271
277
epyc_homogeneous_list_annotation = epyccel (homogeneous_list_annotation , language = stc_language )
272
278
assert epyc_homogeneous_list_annotation () == homogeneous_list_annotation ()
273
279
assert isinstance (epyc_homogeneous_list_annotation (), type (homogeneous_list_annotation ()))
0 commit comments