checking return type is a type

This commit is contained in:
Torsten Ruger
2015-10-14 14:02:34 +03:00
parent e33a20dd41
commit d899d542a4
5 changed files with 17 additions and 15 deletions

View File

@ -7,7 +7,7 @@ module Register
# so it is responsible for initial setup
def __init__ context
function = Virtual::MethodSource.create_method(:Kernel,:int,:__init__ , [])
function.source.return_type = Phisol::Type.int
function.source.set_return_type Phisol::Type.int
# no method enter or return (automatically added), remove
function.source.blocks.first.codes.pop # no Method enter
function.source.blocks.last.codes.pop # no Method return
@ -26,7 +26,7 @@ module Register
end
def exit context
function = Virtual::MethodSource.create_method(:Kernel,:int,:exit , [])
function.source.return_type = Phisol::Type.int
function.source.set_return_type Phisol::Type.int
return function
ret = Virtual::RegisterMachine.instance.exit(function)
function.set_return ret
@ -34,7 +34,7 @@ module Register
end
def __send context
function = Virtual::MethodSource.create_method(:Kernel,:int ,:__send , [] )
function.source.return_type = Phisol::Type.int
function.source.set_return_type Phisol::Type.int
return function
end