diff --git a/src/qweb/compiler.ts b/src/qweb/compiler.ts
index 7b080daa..e9f438b4 100644
--- a/src/qweb/compiler.ts
+++ b/src/qweb/compiler.ts
@@ -1029,7 +1029,6 @@ export class QWebCompiler {
const subCtx: Context = createContext(ctx);
this.compileAST(ast.slots[slotName], subCtx);
if (this.hasRef) {
- slot.signature = "ctx => node => {";
slot.code.unshift(` const refs = ctx.__owl__.refs`);
slotStr.push(`'${slotName}': ${name}(${ctxStr})`);
} else {
diff --git a/tests/components/__snapshots__/refs.test.ts.snap b/tests/components/__snapshots__/refs.test.ts.snap
index e2caae75..9b9678be 100644
--- a/tests/components/__snapshots__/refs.test.ts.snap
+++ b/tests/components/__snapshots__/refs.test.ts.snap
@@ -41,7 +41,7 @@ exports[`refs refs are properly bound in slots 2`] = `
let block1 = createBlock(\`
\`);
+
+ const slot2 = ctx => (node, key) => {
+ const refs = ctx.__owl__.refs
+ let d1 = (el) => refs[\`div\`] = el;
+ let b2 = block2([d1]);
+ let b3 = component(\`Child\`, {}, key + \`__3\`, node, ctx);
+ return multi([b2, b3]);
+ }
+
+ return function template(ctx, node, key = \\"\\") {
+ const refs = ctx.__owl__.refs;
+ return assign(component(\`Child\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot2(ctx)}});
+ }
+}"
+`;
+
exports[`slots can render only empty slot 1`] = `
"function anonymous(bdom, helpers
) {
diff --git a/tests/components/slots.test.ts b/tests/components/slots.test.ts
index 9fbea862..65c5b0ab 100644
--- a/tests/components/slots.test.ts
+++ b/tests/components/slots.test.ts
@@ -1347,4 +1347,22 @@ describe("slots", () => {
expect(error).toBeNull();
expect(fixture.innerHTML).toEqual("");
});
+
+ test("can render node with t-ref and Component in same slot", async () => {
+ class Child extends Component {
+ static template = xml`
`;
+ }
+
+ class Parent extends Component {
+ static template = xml`
`;
+ static components = { Child };
+ }
+ let error = null;
+ try {
+ await mount(Parent, fixture);
+ } catch (e) {
+ error = e;
+ }
+ expect(error).toBeNull();
+ });
});