microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
426 stars 86 forks source link

`internal` and attributes allowed on items in local scopes #1574

Closed sezna closed 1 month ago

sezna commented 4 months ago

Describe the bug

The following code snippet compiles without errors, although the internal and @Config have no meaning on the inner callable:

namespace MyQuantumProgram {

    @EntryPoint()
    operation Main() : Result[] {

        @Config(Base) 
        internal operation Foo(): Unit {

        }

        return [];
    }
}

Maybe we could produce a lint warning, or disallow in these cases?

sezna commented 1 month ago

Closing as internal does nothing anymore (the default is internal), so this is inconsequential.