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.

Code generation failure when mapping Q# namespaces to C# namespaces  #46

@vadym-kl

Description

@vadym-kl

Describe the bug

Consider two files A.B.qs and B.qs with namespaces A.B and B and operation Foo defined in B.qs. Fully qualified call B.Foo() in A.B.qs is valid Q# code that leads to invalid C# code,
because in C# B.Foo() is equivalent to A.B.Foo() in this case.

To Reproduce

First file:

namespace Buggy {

    operation Foo() : Unit is Adj {
    }
}

Second file:

namespace BuggyBuggy.Buggy {

    operation Foo2 () : Unit {
        Buggy.Foo();
    }   
}

Expected behavior

Successful compilation of Q# program.

Actual behavior

C# compilation error

 error CS0234: The type or namespace name 'Foo' does not exist in the namespace 'BuggyBuggy.Buggy' (are you missing an assembly reference?)

System information

  • OS: Windows

Additional context
Not critical, the simple workaround is to avoid the situation by naming namespaces differently.

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