public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
To: Andrew Dunstan <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Extend compatibility of PostgreSQL::Test::Cluster
Date: Fri, 31 Dec 2021 16:20:03 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

Andrew Dunstan <[email protected]> writes:

> +		my $subclass = __PACKAGE__ . "::V_$maj";
> +		bless $node, $subclass;
> +		unless ($node->isa(__PACKAGE__))
> +		{
> +			# It's not a subclass, so re-bless back into the main package
> +			bless($node, __PACKAGE__);
> +			carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
> +		}

The ->isa() method works on package names as well as blessed objects, so
the back-and-forth blessing can be avoided.

	my $subclass = __PACKAGE__ . "::V_$maj";
	if ($subclass->isa(__PACKAGE__))
	{
		bless($node, $subclass);
	}
	else
	{
		carp "PostgreSQL::Test::Cluster isn't fully compatible with version $ver";
	}

- ilmari





view thread (9+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Extend compatibility of PostgreSQL::Test::Cluster
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox