diff --git a/.run/spice.run.xml b/.run/spice.run.xml index 4fc0069e4..c69468147 100644 --- a/.run/spice.run.xml +++ b/.run/spice.run.xml @@ -1,5 +1,5 @@ - + diff --git a/build.bat b/build.bat index 04d6d88ea..d6c063f64 100644 --- a/build.bat +++ b/build.bat @@ -1,12 +1,19 @@ @echo off -REM - Check for LLVM_DIR env var +:: Check for LLVM_DIR env var set LLVM_DIR=".\llvm\build-release\lib\cmake\llvm" -REM - Build -mkdir bin 2> NUL +:: Prepare +if not exist bin ( + mkdir bin +) pushd bin + +:: Build cmake -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_CXX_FLAGS_RELEASE="-O2" .. -cmake --build . --target spice +cmake --build . --target spice spicetest + +:: Cleanup move src\spice.exe spice.exe +move test\spicetest.exe spicetest.exe popd \ No newline at end of file diff --git a/build.sh b/build.sh index 915105adc..8f50820b0 100755 --- a/build.sh +++ b/build.sh @@ -1,16 +1,17 @@ #!/bin/sh set -eu -# Create bin dir -mkdir bin - -# Check for LLVM_DIR env var +# Prepare +if [ ! -d bin ]; then + mkdir -p bin +fi export LLVM_DIR=./llvm/build-release/lib/cmake/llvm # Build ( cd ./bin || exit cmake -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_CXX_FLAGS_RELEASE="-O2" .. - cmake --build . --target spice + cmake --build . --target spice spicetest mv ./src/spice spice + mv ./test/spicetest spicetest ) \ No newline at end of file diff --git a/dev-setup.bat b/dev-setup.bat index 541a0abb3..404d7e375 100644 --- a/dev-setup.bat +++ b/dev-setup.bat @@ -2,28 +2,28 @@ echo [Step 1] Checking installations ... -REM - Check if MinGW is installed +:: Check if MinGW is installed where g++ > nul 2>&1 if errorlevel 1 ( echo MinGW-w64 was not found. Please install the latest version from https://winlibs.com goto end ) -REM - Check if lld is installed +:: Check if lld is installed where lld > nul 2>&1 if errorlevel 1 ( echo LLD linker was not found. Please install the latest version from https://winlibs.com goto end ) -REM - Check if Ninja is installed +:: Check if Ninja is installed where ninja > nul 2>&1 if errorlevel 1 ( echo Ninja was not found. Please install the latest version from https://github.com/ninja-build/ninja/releases goto end ) -REM - Check if CMake is installed +:: Check if CMake is installed where cmake > nul 2>&1 if errorlevel 1 ( echo CMake was not found. Please install the latest version from https://cmake.org/download @@ -32,12 +32,12 @@ if errorlevel 1 ( echo done. -REM - Clone LLVM +:: Clone LLVM echo [Step 2] Cloning LLVM (Could take a while) ... git clone --depth 1 --branch llvmorg-17.0.6 https://github.com/llvm/llvm-project llvm echo done. -REM - Build LLVM +:: Build LLVM echo [Step 3] Building LLVM (Could take a whole while, please be patient) ... mkdir .\llvm\build-release pushd .\llvm\build-release @@ -46,17 +46,17 @@ cmake --build . popd echo done. -REM - Download third-party libs +:: Download third-party libs echo [Step 4] Downloading third-party libraries ... cmd /c .\setup-libs.bat > nul 2>&1 echo done. -REM - Build in dev context +:: Build in dev context echo [Step 5] Building Spice ... cmd /c .\build.bat echo done. -REM - End message +:: End message echo The setup is done. Have fun coding! echo Whenever you need to build Spice again, use the ./build.sh script. diff --git a/media/test-project/test.spice b/media/test-project/test.spice index 4c95a9f9a..cf5cddefa 100644 --- a/media/test-project/test.spice +++ b/media/test-project/test.spice @@ -1,11 +1,29 @@ -import "../../src-bootstrap/lexer/lexer"; +type Visitable interface { + p print(); +} + +type Test1 struct : Visitable { + int f1 +} + +p Test1.print() { + printf("Foo: %d", this.f1); +} + +f main() { + Test1 t1 = Test1{123}; + Visitable* v = &t1; + v.print(); +} + +/*import "../../src-bootstrap/lexer/lexer"; import "../../src-bootstrap/parser/parser"; f main() { Lexer lexer = Lexer("./file.spice"); Parser parser = Parser(lexer); parser.parse(); -} +}*/ /*import "../../src-bootstrap/lexer/lexer"; import "std/time/timer"; diff --git a/setup-libs.bat b/setup-libs.bat index 24ff0704a..f131ccba3 100644 --- a/setup-libs.bat +++ b/setup-libs.bat @@ -1,18 +1,26 @@ @echo off -mkdir lib +:: Check if the backup directory exists, if not create it +if not exist lib ( + mkdir lib +) pushd lib +:: Download ANTLR4 git clone --quiet --depth 1 --branch 4.13.1 https://github.com/antlr/antlr4.git +:: Download Google Test git clone --quiet --depth 1 --branch v1.14.0 https://github.com/google/googletest.git +:: Download JSON for Modern C++ mkdir json curl -SsL "https://github.com/nlohmann/json/releases/download/v3.11.2/json.hpp" --output json/json.hpp +:: Download Thread Pool mkdir thread-pool -curl -SsL "https://raw.githubusercontent.com/bshoshany/thread-pool/master/include/BS_thread_pool.hpp" --output thread-pool/thread-pool.hpp +curl -SsL "https://raw.githubusercontent.com/bshoshany/thread-pool/v3.5.0/include/BS_thread_pool.hpp" --output thread-pool/thread-pool.hpp +:: Download CLI11 mkdir cli11 curl -SsL "https://github.com/spicelang/CLI11/releases/download/v2.3.2-spice/CLI11.hpp" --output cli11/CLI11.hpp diff --git a/setup-libs.sh b/setup-libs.sh index f933a0516..415529d0d 100755 --- a/setup-libs.sh +++ b/setup-libs.sh @@ -1,18 +1,25 @@ #!/bin/sh -mkdir lib +if [ ! -d lib ]; then + mkdir -p lib +fi cd lib || exit +# Download ANTLR4 git clone --quiet --depth 1 --branch 4.13.1 https://github.com/antlr/antlr4.git +# Download Google Test git clone --quiet --depth 1 --branch v1.14.0 https://github.com/google/googletest.git +# Download JSON for Modern C++ mkdir json curl -SsL "https://github.com/nlohmann/json/releases/download/v3.11.2/json.hpp" --output json/json.hpp +# Download Thread Pool mkdir thread-pool -curl -SsL "https://raw.githubusercontent.com/bshoshany/thread-pool/master/include/BS_thread_pool.hpp" --output thread-pool/thread-pool.hpp +curl -SsL "https://raw.githubusercontent.com/bshoshany/thread-pool/v3.5.0/include/BS_thread_pool.hpp" --output thread-pool/thread-pool.hpp +# Download CLI11 mkdir cli11 curl -SsL "https://github.com/spicelang/CLI11/releases/download/v2.3.2-spice/CLI11.hpp" --output cli11/CLI11.hpp diff --git a/src-bootstrap/parser/parser.spice b/src-bootstrap/parser/parser.spice index 26f039e6a..385757228 100644 --- a/src-bootstrap/parser/parser.spice +++ b/src-bootstrap/parser/parser.spice @@ -148,7 +148,7 @@ public f Parser.parseFctDef() { return this.concludeNode(fctDefNode); } -public f Parser.parseProcDef() { +public f Parser.parseProcDef() { dyn procDefNode = this.createNode(); // Parse topLevelDefAttr @@ -484,7 +484,7 @@ f Parser.parseDoWhileLoop() { return this.concludeNode(doWhileLoopNode); } -f Parser.parseIfStmt() { +f Parser.parseIfStmt() { dyn ifStmtNode = this.createNode(); this.lexer.expect(TokenType::IF); @@ -503,7 +503,7 @@ f Parser.parseIfStmt() { return this.concludeNode(ifStmtNode); } -f Parser.parseElseStmt() { +f Parser.parseElseStmt() { dyn elseStmtNode = this.createNode(); this.lexer.expect(TokenType::ELSE); diff --git a/src/irgenerator/DebugInfoGenerator.cpp b/src/irgenerator/DebugInfoGenerator.cpp index 3f7a09a0b..0db899018 100644 --- a/src/irgenerator/DebugInfoGenerator.cpp +++ b/src/irgenerator/DebugInfoGenerator.cpp @@ -89,12 +89,22 @@ void DebugInfoGenerator::generateFunctionDebugInfo(llvm::Function *llvmFunction, const ASTNode *node = spiceFunc->declNode; const size_t lineNo = spiceFunc->getDeclCodeLoc().line; - // Prepare information + // Prepare flags llvm::DIScope *scope = diFile; llvm::DINode::DIFlags flags = llvm::DINode::FlagPrototyped; + if (spiceFunc->entry && spiceFunc->entry->getType().specifiers.isPublic) + flags |= llvm::DINode::FlagPublic; + + // Prepare spFlags llvm::DISubprogram::DISPFlags spFlags = llvm::DISubprogram::SPFlagDefinition; if (isLambda) spFlags |= llvm::DISubprogram::SPFlagLocalToUnit; + if (spiceFunc->isVirtual) { + if (spiceFunc->thisType.is(TY_INTERFACE)) + spFlags |= llvm::DISubprogram::SPFlagPureVirtual; + else + spFlags |= llvm::DISubprogram::SPFlagVirtual; + } // Collect arguments std::vector argTypes; @@ -324,15 +334,15 @@ llvm::DIType *DebugInfoGenerator::getDITypeForSymbolType(const ASTNode *node, co const size_t lineNo = spiceStruct->getDeclCodeLoc().line; llvm::Type *structType = spiceStruct->entry->getType().toLLVMType(irGenerator->context, irGenerator->currentScope); assert(structType != nullptr); - const llvm::StructLayout *structLayout = - irGenerator->module->getDataLayout().getStructLayout(reinterpret_cast(structType)); - const uint32_t alignInBits = irGenerator->module->getDataLayout().getABITypeAlign(structType).value(); + llvm::DataLayout dataLayout = irGenerator->module->getDataLayout(); + const llvm::StructLayout *structLayout = dataLayout.getStructLayout(reinterpret_cast(structType)); + const uint32_t alignInBits = dataLayout.getABITypeAlign(structType).value(); // Create struct type const std::string mangledName = NameMangling::mangleStruct(*spiceStruct); llvm::DICompositeType *structDiType = diBuilder->createStructType( diFile, spiceStruct->name, diFile, lineNo, structLayout->getSizeInBits(), alignInBits, - llvm::DINode::FlagTypePassByValue | llvm::DINode::FlagNonTrivial, nullptr, {}, 0, nullptr, mangledName); + llvm::DINode::FlagTypePassByReference | llvm::DINode::FlagNonTrivial, nullptr, {}, 0, nullptr, mangledName); baseDiType = spiceStruct->diType = structDiType; // Collect DI types for fields @@ -373,15 +383,19 @@ llvm::DIType *DebugInfoGenerator::getDITypeForSymbolType(const ASTNode *node, co const size_t lineNo = spiceInterface->getDeclCodeLoc().line; llvm::Type *interfaceType = spiceInterface->entry->getType().toLLVMType(irGenerator->context, irGenerator->currentScope); assert(interfaceType != nullptr); - const llvm::StructLayout *structLayout = - irGenerator->module->getDataLayout().getStructLayout(static_cast(interfaceType)); - const uint32_t alignInBits = irGenerator->module->getDataLayout().getABITypeAlign(interfaceType).value(); + llvm::DataLayout dataLayout = irGenerator->module->getDataLayout(); + const llvm::StructLayout *structLayout = dataLayout.getStructLayout(reinterpret_cast(interfaceType)); + const uint32_t alignInBits = dataLayout.getABITypeAlign(interfaceType).value(); // Create interface type const std::string mangledName = NameMangling::mangleInterface(*spiceInterface); llvm::DICompositeType *interfaceDiType = diBuilder->createStructType( diFile, spiceInterface->name, diFile, lineNo, structLayout->getSizeInBits(), alignInBits, - llvm::DINode::FlagTypePassByValue | llvm::DINode::FlagNonTrivial, nullptr, {}, 0, nullptr, mangledName); + llvm::DINode::FlagTypePassByReference | llvm::DINode::FlagNonTrivial, nullptr, {}, 0, nullptr, mangledName); + + // Set vtable holder to itself for interfaces + interfaceDiType->replaceVTableHolder(interfaceDiType); + baseDiType = spiceInterface->diType = interfaceDiType; break; } diff --git a/src/irgenerator/GenVTable.cpp b/src/irgenerator/GenVTable.cpp index b47c8530e..5d88a11c1 100644 --- a/src/irgenerator/GenVTable.cpp +++ b/src/irgenerator/GenVTable.cpp @@ -50,8 +50,8 @@ llvm::Constant *IRGenerator::generateTypeInfo(StructBase *spiceStruct) { if (!sourceFile->isRttiRT()) { // Add external global pointer for TypeInfo vtable assert(sourceFile->isRuntimeModuleAvailable(RuntimeModule::RTTI_RT)); - const std::string mangledName = NameMangling::mangleVTable("TypeInfo"); - llvm::Constant *typeInfoExtPtr = module->getOrInsertGlobal(mangledName, builder.getPtrTy()); + const std::string typeInfoMangledName = NameMangling::mangleVTable("TypeInfo"); + llvm::Constant *typeInfoExtPtr = module->getOrInsertGlobal(typeInfoMangledName, builder.getPtrTy()); typeInfoVTable = llvm::ConstantExpr::getInBoundsGetElementPtr(ptrTy, typeInfoExtPtr, builder.getInt64(2)); } std::vector fieldValues; @@ -60,8 +60,8 @@ llvm::Constant *IRGenerator::generateTypeInfo(StructBase *spiceStruct) { for (const SymbolType &interfaceType : interfaceTypes) { Interface *interface = interfaceType.getInterface(nullptr); assert(interface != nullptr && interface->typeInfo != nullptr); - const std::string mangledName = NameMangling::mangleTypeInfo(interface); - llvm::Constant *global = module->getOrInsertGlobal(mangledName, builder.getPtrTy()); + const std::string interfaceMangledName = NameMangling::mangleTypeInfo(interface); + llvm::Constant *global = module->getOrInsertGlobal(interfaceMangledName, builder.getPtrTy()); fieldValues.push_back(global); } llvm::Constant *typeInfo = llvm::ConstantStruct::get(spiceStruct->typeInfoType, fieldValues); diff --git a/src/symboltablebuilder/Scope.cpp b/src/symboltablebuilder/Scope.cpp index ec576192e..e2ee3fd8d 100644 --- a/src/symboltablebuilder/Scope.cpp +++ b/src/symboltablebuilder/Scope.cpp @@ -294,8 +294,17 @@ void Scope::collectWarnings(std::vector &warnings) const { // N break; } case TY_INTERFACE: { - warningType = UNUSED_INTERFACE; - warningMessage = "The interface '" + entry.name + "' is unused"; + if (entry.scope->type == ScopeType::GLOBAL) { + // Skip generic struct entries + if (!entry.getType().getTemplateTypes().empty()) + continue; + + warningType = UNUSED_INTERFACE; + warningMessage = "The interface '" + entry.name + "' is unused"; + } else { + warningType = UNUSED_VARIABLE; + warningMessage = "The variable '" + entry.name + "' is unused"; + } break; } case TY_IMPORT: { diff --git a/src/typechecker/OpRuleManager.cpp b/src/typechecker/OpRuleManager.cpp index 17cfcf59c..14a8f8500 100644 --- a/src/typechecker/OpRuleManager.cpp +++ b/src/typechecker/OpRuleManager.cpp @@ -47,8 +47,9 @@ SymbolType OpRuleManager::getAssignResultType(const ASTNode *node, SymbolType lh // Allow char* = string if (lhs.isPtrOf(TY_CHAR) && rhs.is(TY_STRING) && lhs.specifiers == rhs.specifiers) return lhs; - // Allow interface = struct that implements this interface - if (lhs.isBaseType(TY_INTERFACE) && rhs.isBaseType(TY_STRUCT) && lhs.typeChain.size() == rhs.typeChain.size()) { + // Allow interface* = struct* that implements this interface + const bool sameChainDepth = lhs.typeChain.size() == rhs.typeChain.size(); + if (lhs.isPtr() && rhs.isPtr() && sameChainDepth && lhs.isBaseType(TY_INTERFACE) && rhs.isBaseType(TY_STRUCT)) { SymbolType lhsCopy = lhs; SymbolType rhsCopy = rhs; SymbolType::unwrapBoth(lhsCopy, rhsCopy); diff --git a/test/test-files/irgenerator/debug-info/success-dbg-info-complex/ir-code.ll b/test/test-files/irgenerator/debug-info/success-dbg-info-complex/ir-code.ll index 05bfe3468..67fe7b488 100644 --- a/test/test-files/irgenerator/debug-info/success-dbg-info-complex/ir-code.ll +++ b/test/test-files/irgenerator/debug-info/success-dbg-info-complex/ir-code.ll @@ -523,8 +523,8 @@ attributes #3 = { cold noreturn nounwind } !25 = !DILocalVariable(name: "_argc", arg: 1, scope: !15, file: !5, line: 6, type: !18) !26 = !DILocalVariable(name: "_argv", arg: 2, scope: !15, file: !5, line: 6, type: !19) !27 = !DILocalVariable(name: "vi", scope: !15, file: !5, line: 8, type: !28) -!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "Vector", scope: !29, file: !29, line: 22, size: 192, align: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !30, identifier: "struct.Vector") -!29 = !DIFile(filename: "vector.spice", directory: "C:\\Users\\Marc\\Documents\\JustForFunGitHubClonesFast\\spice\\std\\data") +!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "Vector", scope: !29, file: !29, line: 22, size: 192, align: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !30, identifier: "struct.Vector") +!29 = !DIFile(filename: "vector.spice", directory: "C:\\Users\\I516467\\Documents\\JustForFunGitHubClones\\spice\\std\\data") !30 = !{!31, !33, !35} !31 = !DIDerivedType(tag: DW_TAG_member, name: "contents", scope: !28, file: !29, line: 23, baseType: !32, size: 64) !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 64) @@ -541,8 +541,8 @@ attributes #3 = { cold noreturn nounwind } !43 = !{!"branch_weights", i32 2000, i32 1} !44 = !DILocation(line: 15, column: 22, scope: !15) !45 = !DILocalVariable(name: "it", scope: !15, file: !5, line: 15, type: !46) -!46 = !DICompositeType(tag: DW_TAG_structure_type, name: "VectorIterator", scope: !47, file: !47, line: 13, size: 192, align: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !48, identifier: "struct.VectorIterator") -!47 = !DIFile(filename: "vector-iterator.spice", directory: "C:\\Users\\Marc\\Documents\\JustForFunGitHubClonesFast\\spice\\std\\iterator") +!46 = !DICompositeType(tag: DW_TAG_structure_type, name: "VectorIterator", scope: !47, file: !47, line: 13, size: 192, align: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !48, identifier: "struct.VectorIterator") +!47 = !DIFile(filename: "vector-iterator.spice", directory: "C:\\Users\\I516467\\Documents\\JustForFunGitHubClones\\spice\\std\\iterator") !48 = !{!49, !51} !49 = !DIDerivedType(tag: DW_TAG_member, name: "vector", scope: !46, file: !47, line: 14, baseType: !50, size: 64, offset: 64) !50 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64) @@ -560,8 +560,8 @@ attributes #3 = { cold noreturn nounwind } !62 = !DILocation(line: 22, column: 5, scope: !15) !63 = !DILocation(line: 23, column: 16, scope: !15) !64 = !DILocalVariable(name: "pair", scope: !15, file: !5, line: 23, type: !65) -!65 = !DICompositeType(tag: DW_TAG_structure_type, name: "Pair", scope: !66, file: !66, line: 8, size: 128, align: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !67, identifier: "struct.Pair") -!66 = !DIFile(filename: "pair.spice", directory: "C:\\Users\\Marc\\Documents\\JustForFunGitHubClonesFast\\spice\\std\\data") +!65 = !DICompositeType(tag: DW_TAG_structure_type, name: "Pair", scope: !66, file: !66, line: 8, size: 128, align: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !67, identifier: "struct.Pair") +!66 = !DIFile(filename: "pair.spice", directory: "C:\\Users\\I516467\\Documents\\JustForFunGitHubClones\\spice\\std\\data") !67 = !{!68, !69} !68 = !DIDerivedType(tag: DW_TAG_member, name: "first", scope: !65, file: !66, line: 9, baseType: !34, size: 64) !69 = !DIDerivedType(tag: DW_TAG_member, name: "second", scope: !65, file: !66, line: 10, baseType: !32, size: 64, offset: 64) diff --git a/test/test-files/irgenerator/debug-info/success-dbg-info-simple/ir-code.ll b/test/test-files/irgenerator/debug-info/success-dbg-info-simple/ir-code.ll index 4e0baef64..a4e81944b 100644 --- a/test/test-files/irgenerator/debug-info/success-dbg-info-simple/ir-code.ll +++ b/test/test-files/irgenerator/debug-info/success-dbg-info-simple/ir-code.ll @@ -120,13 +120,13 @@ attributes #3 = { nofree nounwind } !25 = !DISubroutineType(types: !26) !26 = !{!27, !28} !27 = !DIBasicType(name: "void", encoding: DW_ATE_unsigned) -!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "TestStruct", scope: !7, file: !7, line: 1, size: 320, align: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !29, identifier: "struct.TestStruct") +!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "TestStruct", scope: !7, file: !7, line: 1, size: 320, align: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !29, identifier: "struct.TestStruct") !29 = !{!30, !32, !42} !30 = !DIDerivedType(tag: DW_TAG_member, name: "lng", scope: !28, file: !7, line: 2, baseType: !31, size: 64) !31 = !DIBasicType(name: "long", size: 64, encoding: DW_ATE_signed) !32 = !DIDerivedType(tag: DW_TAG_member, name: "str", scope: !28, file: !7, line: 3, baseType: !33, size: 192, align: 8, offset: 64) -!33 = !DICompositeType(tag: DW_TAG_structure_type, name: "String", scope: !34, file: !34, line: 20, size: 192, align: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !35, identifier: "struct.String") -!34 = !DIFile(filename: "string_rt.spice", directory: "C:\\Users\\Marc\\Documents\\JustForFunGitHubClonesFast\\spice\\std\\runtime") +!33 = !DICompositeType(tag: DW_TAG_structure_type, name: "String", scope: !34, file: !34, line: 20, size: 192, align: 8, flags: DIFlagTypePassByReference | DIFlagNonTrivial, elements: !35, identifier: "struct.String") +!34 = !DIFile(filename: "string_rt.spice", directory: "C:\\Users\\I516467\\Documents\\JustForFunGitHubClones\\spice\\std\\runtime") !35 = !{!36, !39, !41} !36 = !DIDerivedType(tag: DW_TAG_member, name: "contents", scope: !33, file: !34, line: 21, baseType: !37, size: 64) !37 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !38, size: 64) diff --git a/test/test-files/typechecker/interfaces/error-assign-struct-to-interface/exception.out b/test/test-files/typechecker/interfaces/error-assign-struct-to-interface/exception.out new file mode 100644 index 000000000..1e96c65b6 --- /dev/null +++ b/test/test-files/typechecker/interfaces/error-assign-struct-to-interface/exception.out @@ -0,0 +1,5 @@ +[Error|Semantic] ./test-files/typechecker/interfaces/error-assign-struct-to-interface/source.spice:14:5: +Wrong data type for operator: Cannot apply '=' operator on types Iterable and A + +14 Iterable a = A{5}; + ^^^^^^^^^^^^^^^^^ \ No newline at end of file diff --git a/test/test-files/typechecker/interfaces/error-cannot-call-method-interface/source.spice b/test/test-files/typechecker/interfaces/error-assign-struct-to-interface/source.spice similarity index 100% rename from test/test-files/typechecker/interfaces/error-cannot-call-method-interface/source.spice rename to test/test-files/typechecker/interfaces/error-assign-struct-to-interface/source.spice diff --git a/test/test-files/typechecker/interfaces/error-cannot-call-method-interface/exception.out b/test/test-files/typechecker/interfaces/error-cannot-call-method-interface/exception.out deleted file mode 100644 index 968c996ac..000000000 --- a/test/test-files/typechecker/interfaces/error-cannot-call-method-interface/exception.out +++ /dev/null @@ -1,8 +0,0 @@ -[Error|Compiler]: -Unresolved soft errors: There are unresolved errors. Please fix them and recompile. - -[Error|Semantic] ./test-files/typechecker/interfaces/error-cannot-call-method-interface/source.spice:15:5: -Member access is only allowed on structs and Strings: Cannot call a method on an interface - -15 a.print(); - ^^^^^^^^^ \ No newline at end of file