Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsii-dotnet-generator): Use FQ type returns in conflict. #258

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using Amazon.JSII.JsonModel.Spec;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Amazon.JSII.JsonModel.Spec;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
using Type = Amazon.JSII.JsonModel.Spec.Type;
using TypeKind = Amazon.JSII.JsonModel.Spec.TypeKind;

namespace Amazon.JSII.Generator
{
Expand Down Expand Up @@ -53,7 +54,7 @@ TypeMetadata GetMetadata(Type type)
{
switch (type.Kind)
{
case JsonModel.Spec.TypeKind.Class:
case TypeKind.Class:
{
var classType = (ClassType) type;
if (classType.IsAbstract)
Expand All @@ -62,11 +63,11 @@ TypeMetadata GetMetadata(Type type)
}
return new ClassTypeMetadata((ClassType)type, assembly);
}
case JsonModel.Spec.TypeKind.Enum:
case TypeKind.Enum:
{
return new EnumTypeMetadata((EnumType)type, assembly);
}
case JsonModel.Spec.TypeKind.Interface:
case TypeKind.Interface:
{
return new InterfaceTypeMetadata((InterfaceType)type, assembly);
}
Expand Down Expand Up @@ -415,7 +416,7 @@ public TypeSyntax GetTypeSyntax(TypeReference typeReference)
{
Type type = GetTypeFromFullyQualifiedName(typeReference.FullyQualifiedName);

return SF.ParseTypeName(GetName(type));
return SF.ParseTypeName(GetName(type, true));
}

throw new ArgumentException("Invalid type reference", nameof(typeReference));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ protected UseCalcBase(DeputyProps props): base(props)
}

[JsiiMethod("hello", "{\"fqn\":\"@scope/jsii-calc-base.Base\"}", "[]")]
public virtual Base Hello()
public virtual Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base Hello()
{
return InvokeInstanceMethod<Base>(new object[]{});
return InvokeInstanceMethod<Amazon.JSII.Tests.CalculatorNamespace.BaseNamespace.Base>(new object[]{});
}
}
}