I'm Getting Weird Bugs Today

I’ve written simple code like this a bunch of times, for some reason it chooses to stop working now. Why is this not working? It’s saying SaveGame doesn’t denote a valid type.

var posX : float;
var posY : float;
var sceneManager: GameObject;

function OnGUI(){
	var status : SaveGame = sceneManager.GetComponent(SaveGame);	
	
    GUI.Label (Rect(posX, posY, 100, 20), "Cash: " + status.money);
}

Is there a function called SaveGame in this script? That will cause the same error. Also you should not be getting that component in OnGUI or in Update(this means getting the component 1 or more times per frame). Throw that in Start() instead.

public var posX : float;
public var posY : float;
public var sceneManager: GameObject;

private var saveGame:SaveGame;

function Start()
{
    saveGame=sceneManager.GetComponent(SaveGame);
}