diff --git a/src/ast/analysis/PolymorphicObjects.cpp b/src/ast/analysis/PolymorphicObjects.cpp index 4ac67840e05..348796ec40f 100644 --- a/src/ast/analysis/PolymorphicObjects.cpp +++ b/src/ast/analysis/PolymorphicObjects.cpp @@ -30,7 +30,7 @@ void PolymorphicObjectsAnalysis::run(const TranslationUnit& translationUnit) { visitDepthFirst(program, [&](const NumericConstant& numericConstant) { // Constant has a fixed type if (numericConstant.hasFixedType()) { - constantType[&numericConstant] = numericConstant.getType().value(); + constantType[&numericConstant] = numericConstant.getFixedType().value(); return; } diff --git a/src/parser/parser.yy b/src/parser/parser.yy index 5a6083d888b..234ce58634d 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -698,7 +698,7 @@ arg auto nested_arg = *$nested_arg; const auto* asNumeric = dynamic_cast(&*nested_arg); if (asNumeric && !isPrefix("-", asNumeric->getConstant())) { - $$ = mk("-" + asNumeric->getConstant(), asNumeric->getType(), @nested_arg); + $$ = mk("-" + asNumeric->getConstant(), asNumeric->getFixedType(), @nested_arg); } else { // Otherwise, create a functor. $$ = mk(@$, FUNCTOR_INTRINSIC_PREFIX_NEGATE_NAME, std::move(nested_arg)); }