@@ -252,6 +252,25 @@ FASTPythonSSATest >> testFunctionParameterUsed [
252252 self assert: parameterUsage ssaVersion identicalTo: parameterDeclaration ssaVersion
253253]
254254
255+ { #category : ' tests' }
256+ FASTPythonSSATest >> testGlobalReferencedInDefaultParameter [
257+
258+ | assignedVar usedVar |
259+ self parseAndResolve: ' x = 5
260+
261+ def function(arg = x):
262+ return arg' .
263+
264+ assignedVar := model module statements first left.
265+ self assert: assignedVar ssaVersion version equals: 1 .
266+ self assert: assignedVar ssaName equals: ' x_1' .
267+ self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration.
268+ self assert: assignedVar ssaVersion localUses size equals: 2 .
269+
270+ usedVar := model module statements second parameters first defaultValue.
271+ self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion
272+ ]
273+
255274{ #category : ' tests - parameters' }
256275FASTPythonSSATest >> testLambdaParameterUsed [
257276
@@ -819,6 +838,24 @@ FASTPythonSSATest >> testSubscriptAssignement [
819838 self assert: assignedVar ssaVersion localUses size equals: 1
820839]
821840
841+ { #category : ' tests - subscripts' }
842+ FASTPythonSSATest >> testSubscriptAssignementAndUsage [
843+
844+ | assignedVar usedVar |
845+ self parseAndResolve: ' x[3] = 5
846+
847+ print(x[3])' .
848+
849+ assignedVar := model module statements first left.
850+ self assert: assignedVar ssaVersion version equals: 1 .
851+ self assert: assignedVar ssaName equals: ' x[3]_1' .
852+ self assert: assignedVar ssaVersion localDeclaration equals: assignedVar localDeclaration.
853+ self assert: assignedVar ssaVersion localUses size equals: 2 .
854+
855+ usedVar := model module statements second arguments first.
856+ self assert: usedVar ssaVersion identicalTo: assignedVar ssaVersion
857+ ]
858+
822859{ #category : ' tests - assignments' }
823860FASTPythonSSATest >> testTupleAssignement [
824861
0 commit comments