void SymbolResolvingVisitor::resolveTypeReference(TypeReference *typeRef) const
	{
		if(typeRef->isResolved())
			return;

		TypeName typeName = typeRef->getTypeName();
		SymbolBase *symbol = globalScope_->findSymbol(typeName);

		if(!symbol)
			errorSink_->error(typeRef->getLocation(), (boost::format("Referenced type '%s' was not found") % typeName.getFullName()).str());

		TypeBase *foundType = dynamic_cast<TypeBase*>(symbol);
		assert(foundType != nullptr); //TODO: a human readable message in the case of unknown types
		typeRef->setType(foundType);
	}