From f69d1d03c150c1ecdc7913db24a3c46cefddfc7a Mon Sep 17 00:00:00 2001 From: Jonathan Casey Date: Fri, 24 Nov 2023 15:08:05 +0000 Subject: [PATCH] feat(*): handles type concerto.scalar.UUID Signed-off-by: Jonathan Casey --- lib/codegen/fromcto/csharp/csharpvisitor.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/codegen/fromcto/csharp/csharpvisitor.js b/lib/codegen/fromcto/csharp/csharpvisitor.js index f3835e4f..ce5e351d 100644 --- a/lib/codegen/fromcto/csharp/csharpvisitor.js +++ b/lib/codegen/fromcto/csharp/csharpvisitor.js @@ -1,3 +1,4 @@ +/* eslint-disable no-unreachable */ /* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -327,7 +328,8 @@ class CSharpVisitor { } else if (ModelUtil.isScalar(mapDeclaration.getKey())) { const scalarDeclaration = mapDeclaration.getModelFile().getType(mapDeclaration.getKey().getType()); - const scalarType = scalarDeclaration.getType(); + const keyFQN = ModelUtil.removeNamespaceVersionFromFullyQualifiedName(scalarDeclaration.getFullyQualifiedName()); + const scalarType = keyFQN === 'concerto.scalar.UUID' ? keyFQN : scalarDeclaration.getType(); keyType = this.toCSharpType(scalarType); } @@ -337,7 +339,8 @@ class CSharpVisitor { } else if (ModelUtil.isScalar(mapDeclaration.getValue())) { const scalarDeclaration = mapDeclaration.getModelFile().getType(mapDeclaration.getValue().getType()); - const scalarType = scalarDeclaration.getType(); + const keyFQN = ModelUtil.removeNamespaceVersionFromFullyQualifiedName(scalarDeclaration.getFullyQualifiedName()); + const scalarType = keyFQN === 'concerto.scalar.UUID' ? keyFQN : scalarDeclaration.getType(); valueType = this.toCSharpType(scalarType); } else { valueType = mapValueType;