mirror of
https://github.com/irmen/prog8.git
synced 2024-11-22 15:33:02 +00:00
fix ast error on inline sub
This commit is contained in:
parent
0cbc56b82e
commit
db794752cb
@ -326,8 +326,8 @@ class IntermediateAstMaker(private val program: Program, private val options: Co
|
||||
var returntype = srcSub.returntypes.singleOrNull()
|
||||
if(returntype==DataType.STR)
|
||||
returntype=DataType.UWORD // if a sub returns 'str', replace with uword. Intermediate AST and I.R. don't contain 'str' datatype anymore.
|
||||
if(srcSub.inline)
|
||||
throw FatalAstException("non-asm subs cannot be inline")
|
||||
|
||||
// do not bother about the 'inline' hint of the source subroutine.
|
||||
val sub = PtSub(srcSub.name,
|
||||
srcSub.parameters.map { PtSubroutineParameter(it.name, it.type, it.position) },
|
||||
returntype,
|
||||
|
@ -188,8 +188,8 @@ class TestCompilerOnExamplesVirtual: FunSpec({
|
||||
val (displayName, filepath) = prepareTestFiles(it, false, target)
|
||||
test(displayName) {
|
||||
val src = filepath.readText()
|
||||
compileText(target, false, src, writeAssembly = true) shouldNotBe null
|
||||
compileText(target, false, src, writeAssembly = true) shouldNotBe null
|
||||
compileText(target, true, src, writeAssembly = true) shouldNotBe null
|
||||
compileText(target, true, src, writeAssembly = true) shouldNotBe null
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user