Hello.
Here is the SQL to reproduce the server crash:
CREATE SCHEMA bug1 AUTHORIZATION postgres;
SET search_path = bug1, pg_catalog;
CREATE FUNCTION bug1.domain_check (integer) RETURNS boolean
AS
$body$
SELECT $1 <> 0
$body$
LANGUAGE sql IMMUTABLE STRICT;
CREATE DOMAIN bug1."domain" AS integer
CONSTRAINT "check" CHECK (bug1.domain_check(VALUE));
CREATE TYPE bug1.composite AS (
id domain
);
select '(1)'::bug1.composite;