Inner class property's method doesn't behave as expected

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Tsiruan

Hey, guys!
I’m new to GDScript, and ran into a weird problem (to me)
Here is a simplified version of my script:

class Map:
	var vertexArray := PoolVector2Array()

func _ready():
	var map := Map.new()
	map.vertexArray.push_back(Vector2( 0, 0 ))
	print(map.vertexArray.size())    # prints 0

Can anyone explain why the output is zero, and how should I have done this?