Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

C# compilation error for invoking generic callables #299

@ScottCarda-MS

Description

@ScottCarda-MS

When executing this program:

namespace test {
    @EntryPoint()
    operation Main() : Result {
        Generic<Double, Int, Int>();
        return Zero;
    }
    operation Generic<'A, 'B, 'C>() : Unit { }
}

The following error occurs:
error CS0305: Using the generic type 'Generic<__A__, __B__, __C__>' requires 3 type arguments

When inspecting the generated C# for this file, under the Main partial class, in the Init method, there is the following line:
this.Generic = this.Factory.Get<ICallable<QVoid, QVoid>>(typeof(Generic));

This line uses the Generic type without any of the type arguments, which is causing the error. If the line is changed to
this.Generic = this.Factory.Get<ICallable<QVoid, QVoid>>(typeof(Generic<Double, Int32, Int32>));
then the error goes away.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions