From 5a509f5bfeb3abef9246dbece6826540b73c5cf8 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 12 Dec 2018 14:26:00 +0100 Subject: [PATCH] compiler: support some more types in interfaces --- compiler/interface.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/interface.go b/compiler/interface.go index a94fa6f01..7600d4628 100644 --- a/compiler/interface.go +++ b/compiler/interface.go @@ -51,7 +51,7 @@ func (c *Compiler) parseMakeInterface(val llvm.Value, typ types.Type, global str itfValue = c.builder.CreateIntToPtr(val, c.i8ptrType, "makeinterface.cast.int") case llvm.PointerTypeKind: itfValue = c.builder.CreateBitCast(val, c.i8ptrType, "makeinterface.cast.ptr") - case llvm.StructTypeKind: + case llvm.StructTypeKind, llvm.FloatTypeKind, llvm.DoubleTypeKind, llvm.VectorTypeKind: // A bitcast would be useful here, but bitcast doesn't allow // aggregate types. So we'll bitcast it using an alloca. // Hopefully this will get optimized away.