Can't figure out where to put 'new' when using c#

Hello, I’m trying to use c#, but the following line

float x = ((SpriteRenderer)holeObject.GetComponent(SpriteRenderer)).sprite.bounds.size.x;

generates the error

error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected

I have read that in c# you need to use the ‘new’ statement, but I cant figure out where, or why the error is occouring.

Thank you.

use typeof:

float x = ((SpriteRenderer)holeObject.GetComponent(typeof(SpriteRenderer))).sprite.bounds.size.x;

or generics:

float x = ((SpriteRenderer)holeObject.GetComponent<SpriteRenderer>()).sprite.bounds.size.x;