# Buggy code
def reduce_CreateConstraint_CreateFunctionArgs(self, *kids):
    r"""%reduce ABSTRACT CONSTRAINT NodeName CreateFunctionArgs \
                    OptOnExpr OptExtendingSimple"""
    self.val = qlast.CreateConstraint(
        name=kids[2].val,
        params=kids[3].val,
        subject=kids[4].val,
        extends=kids[5].val,
    )


# Traceback (AttributeError)
db> CREATE ABSTRACT CONSTRAINT `🚀🍿` EXTENDING max_len_value;
OK: CREATE
db> CREATE SCALAR TYPE foo EXTENDING str {
...     CREATE CONSTRAINT `🚀🍿`(10);
... };
ERROR: InternalServerError: 'NoneType' object has no attribute 'get_parameter_name'
Hint: This is most likely a bug in EdgeDB. Please consider opening an issue ticket at https://github.com/edgedb/edgedb/issues/new?template=bug_report.md
Server traceback:
Traceback (most recent call last):
File "/home/victor/dev/magicstack/edgedb/edb/server/procpool/worker.py", line 75, in worker
res = await meth(*args)
File "/home/victor/dev/magicstack/edgedb/edb/server/compiler/compiler.py", line 1480, in compile_eql_tokens
return self._compile(ctx=ctx, tokens=eql_tokens)
File "/home/victor/dev/magicstack/edgedb/edb/server/compiler/compiler.py", line 1141, in _compile
comp: dbstate.BaseQuery = self._compile_dispatch_ql(ctx, stmt)
File "/home/victor/dev/magicstack/edgedb/edb/server/compiler/compiler.py", line 1076, in _compile_dispatch_ql
return self._compile_ql_ddl(ctx, ql)
File "/home/victor/dev/magicstack/edgedb/edb/server/compiler/compiler.py", line 763, in _compile_ql_ddl
cmd = s_ddl.delta_from_ddl(
File "/home/victor/dev/magicstack/edgedb/edb/schema/ddl.py", line 466, in delta_from_ddl
_, cmd = _delta_from_ddl(ddl_stmt, schema=schema, modaliases=modaliases,
File "/home/victor/dev/magicstack/edgedb/edb/schema/ddl.py", line 496, in _delta_from_ddl
schema = cmd.apply(schema, context)
File "/home/victor/dev/magicstack/edgedb/edb/schema/delta.py", line 1531, in apply
schema = self._create_innards(schema, context)
File "/home/victor/dev/magicstack/edgedb/edb/schema/inheriting.py", line 622, in _create_innards
return super()._create_innards(schema, context)
File "/home/victor/dev/magicstack/edgedb/edb/schema/delta.py", line 1498, in _create_innards
schema = op.apply(schema, context=context)
File "/home/victor/dev/magicstack/edgedb/edb/schema/delta.py", line 1527, in apply
schema = self._create_begin(schema, context)
File "/home/victor/dev/magicstack/edgedb/edb/schema/constraints.py", line 641, in _create_begin
constr_base, attrs, inh = Constraint.get_concrete_constraint_attrs(
File "/home/victor/dev/magicstack/edgedb/edb/schema/constraints.py", line 226, in get_concrete_constraint_attrs
args_map = qlutils.index_parameters(
File "/home/victor/dev/magicstack/edgedb/edb/edgeql/utils.py", line 92, in index_parameters
result[p.get_parameter_name(schema)] = e
AttributeError: 'NoneType' object has no attribute 'get_parameter_name'

# Fixed code
def reduce_CreateConstraint_CreateFunctionArgs(self, *kids):
    r"""%reduce ABSTRACT CONSTRAINT NodeName CreateFunctionArgs \
                    OptOnExpr OptExtendingSimple"""
    self.val = qlast.CreateConstraint(
        name=kids[2].val,
        params=kids[3].val,
        subject=kids[4].val,
        bases=kids[5].val,
    )