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.

Callables with the same fully-qualified name modulo dots cannot be called together #243

@bamarsha

Description

@bamarsha

Consider the following valid Q# program:

namespace Program {
    @EntryPoint()
    function Main() : Unit {
        FooBar.Baz();
        Foo.Bar.Baz();
    }
}

namespace FooBar {
    function Baz() : Unit { }
}

namespace Foo.Bar {
    function Baz() : Unit { }
}

This produces a C# compile error:

obj\qsharp\src\Program.g.cs(105,43): error CS0102: The type "Main" already contains a definition for "FooBarBaz".

The problem is that C# generation creates properties in the containing callable's generated class for both of them, but it strips out dots from their fully-qualified names, so they end up with the same name:

        protected ICallable<QVoid, QVoid> FooBarBaz
        {
            get;
            set;
        }

        protected ICallable<QVoid, QVoid> FooBarBaz
        {
            get;
            set;
        }

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