@@ -2038,7 +2038,7 @@ namespace nzsl::Ast
20382038 if (!rightExprType)
20392039 return DontVisitChildren{};
20402040
2041- binaryExpression.cachedExpressionType = ValidateBinaryOp (binaryExpression.op , ResolveAlias ( *leftExprType), ResolveAlias ( *rightExprType) , binaryExpression.sourceLocation , BuildStringifier (binaryExpression.sourceLocation ));
2041+ binaryExpression.cachedExpressionType = ValidateBinaryOp (binaryExpression.op , *leftExprType, *rightExprType, binaryExpression.sourceLocation , BuildStringifier (binaryExpression.sourceLocation ));
20422042 return DontVisitChildren{};
20432043 }
20442044
@@ -2381,55 +2381,6 @@ namespace nzsl::Ast
23812381 if (!exprType)
23822382 return DontVisitChildren{};
23832383
2384- const ExpressionType& resolvedExprType = ResolveAlias (*exprType);
2385-
2386- switch (node.op )
2387- {
2388- case UnaryType::BitwiseNot:
2389- {
2390- if (resolvedExprType != ExpressionType (PrimitiveType::Int32) && resolvedExprType != ExpressionType (PrimitiveType::UInt32))
2391- throw CompilerUnaryUnsupportedError{ node.sourceLocation , ToString (*exprType, node.sourceLocation ) };
2392-
2393- break ;
2394- }
2395-
2396- case UnaryType::LogicalNot:
2397- {
2398- if (resolvedExprType != ExpressionType (PrimitiveType::Boolean))
2399- throw CompilerUnaryUnsupportedError{ node.sourceLocation , ToString (*exprType, node.sourceLocation ) };
2400-
2401- break ;
2402- }
2403-
2404- case UnaryType::Minus:
2405- case UnaryType::Plus:
2406- {
2407- PrimitiveType basicType;
2408- if (IsPrimitiveType (resolvedExprType))
2409- basicType = std::get<PrimitiveType>(resolvedExprType);
2410- else if (IsVectorType (resolvedExprType))
2411- basicType = std::get<VectorType>(resolvedExprType).type ;
2412- else
2413- throw CompilerUnaryUnsupportedError{ node.sourceLocation , ToString (*exprType, node.sourceLocation ) };
2414-
2415- switch (basicType)
2416- {
2417- case PrimitiveType::Float32:
2418- case PrimitiveType::Float64:
2419- case PrimitiveType::Int32:
2420- case PrimitiveType::UInt32:
2421- case PrimitiveType::FloatLiteral:
2422- case PrimitiveType::IntLiteral:
2423- break ;
2424-
2425- default :
2426- throw CompilerUnaryUnsupportedError{ node.sourceLocation , ToString (*exprType, node.sourceLocation ) };
2427- }
2428-
2429- break ;
2430- }
2431- }
2432-
24332384 node.cachedExpressionType = *exprType;
24342385 return DontVisitChildren{};
24352386 }
@@ -2847,7 +2798,7 @@ namespace nzsl::Ast
28472798 {
28482799 ConstantValue& optionValue = optionValueIt->second ;
28492800 EnsureLiteralValue (optType, optionValue, declOption.sourceLocation );
2850-
2801+
28512802 declOption.optIndex = RegisterConstant (declOption.optName , TransformerContext::ConstantData{ m_states->currentModuleId , optionValue }, declOption.optIndex , declOption.sourceLocation );
28522803 }
28532804 else
0 commit comments