diff --git a/alib2abstraction/src/common/CastHelper.cpp b/alib2abstraction/src/common/CastHelper.cpp index a0a51bd889e75b3d814e991ee1b6c6ec17fac8cb..2c7417fdc2973159e2d28696b219d3ea50a40b35 100644 --- a/alib2abstraction/src/common/CastHelper.cpp +++ b/alib2abstraction/src/common/CastHelper.cpp @@ -6,7 +6,7 @@ namespace abstraction { std::shared_ptr < abstraction::Value > CastHelper::eval ( abstraction::TemporariesHolder & environment, std::shared_ptr < abstraction::Value > param, const core::type_details & type ) { - if ( abstraction::Registry::isCastNoOp ( type, param->getActualType ( ) ) ) { + if ( abstraction::Registry::isCastNoOp ( param->getActualType ( ), type ) ) { return param; } diff --git a/alib2abstraction/src/common/EvalHelper.cpp b/alib2abstraction/src/common/EvalHelper.cpp index c1b10abd5c8d6e7aed74b27b539e3793dd462776..d7b40256db5835d991c3be91ea99f78bc812f233 100644 --- a/alib2abstraction/src/common/EvalHelper.cpp +++ b/alib2abstraction/src/common/EvalHelper.cpp @@ -70,9 +70,7 @@ std::shared_ptr < abstraction::Value > EvalHelper::evalAbstraction ( abstraction unsigned i = 0; ext::vector < std::shared_ptr < abstraction::Value > > casted_params; for ( std::shared_ptr < abstraction::Value > param : params ) { - if ( ! abstraction::Registry::isCastNoOp ( param->getActualType ( ), abstraction->getParamType ( i ) ) ) { - param = abstraction::CastHelper::eval ( environment, param, abstraction->getParamType ( i ) ); - } + param = abstraction::CastHelper::eval ( environment, param, abstraction->getParamType ( i ) ); if ( abstraction::Registry::hasDenormalize ( abstraction->getParamType ( i ) ) && abstraction->getParamType ( i ) != param->getDeclaredType ( ) ) { std::unique_ptr < abstraction::OperationAbstraction > denormalize = abstraction::Registry::getDenormalizeAbstraction ( abstraction->getParamType ( i ) ); diff --git a/alib2cli/src/ast/statements/ContainerStatement.cpp b/alib2cli/src/ast/statements/ContainerStatement.cpp index c001889958655fa5024b45b40660e154e9e6050d..a9213a0cb12105a00d5c497f78b703fbe98e7a6d 100644 --- a/alib2cli/src/ast/statements/ContainerStatement.cpp +++ b/alib2cli/src/ast/statements/ContainerStatement.cpp @@ -24,11 +24,7 @@ std::shared_ptr < abstraction::Value > ContainerStatement::translateAndEval ( co int i = 0; ext::vector < std::shared_ptr < abstraction::Value > > casted_params; for ( const std::shared_ptr < abstraction::Value > & param : params ) { - if ( abstraction::Registry::isCastNoOp ( algo->getParamType ( i ), param->getDeclaredType ( ) ) ) { - casted_params.push_back ( param ); - } else { - casted_params.push_back ( abstraction::CastHelper::eval ( environment, param, algo->getParamType ( i ) ) ); - } + casted_params.push_back ( abstraction::CastHelper::eval ( environment, param, algo->getParamType ( i ) ) ); ++ i; }