Cannot implicitly convert type `UnityEngine.Vector2' to `UnityEngine.Ray2D'

I am new with Unity and I need rays to work in 2d, so I am trying to use Ray2D, but I got this weird error:

Cannot implicitly convert type `UnityEngine.Vector2' to `UnityEngine.Ray2D'

Here is the code line which causes error:

Ray2D ray = new Vector2 (Camera.main.ScreenToWorldPoint(Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y);

And here is whole function that causes error:

void touching2D (Vector3 touchPosition, int touchNumber)
	{

		Ray2D ray = new Vector2 (Camera.main.ScreenToWorldPoint(Input.mousePosition).x, Camera.main.ScreenToWorldPoint(Input.mousePosition).y);
		RaycastHit hit = new RaycastHit();
		
		if(Physics2D.Raycast(ray, out hit,130))
		{
			hit.collider.SendMessage("pressed");
			touchedSomething = "Yes!";
		}
	}

A Vector2 is a direction. A Ray is a position (origin) and a direction. It looks to me like you want to cast a ray from the current position of the object this script is attached to in the direction of the mouse cursor. Assuming an orthographic camera, this should work to construct your ray:

Vector2 v = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
Ray2D ray = new Ray(transform.position, v);