Git Product home page Git Product logo

Comments (2)

swernli avatar swernli commented on June 11, 2024

It's possible this would be less of an issue with the idea to skip monomorphization in favor of untyped pointers in code generation. We should avoid introducing new errors for this until it we have a better understanding of what the actual error cases are.

from qsharp.

bamarsha avatar bamarsha commented on June 11, 2024

I disagree - we should still treat ambiguous types as an error. For one, we can't rule out wanting monomorphization in the future.

Other than codegen, ambiguous types also create issues for type classes and bounded polymorphism, which we probably want to add to Q# in the future. If a bounded type parameter is instantiated ambiguously, then there is no way to know which type class instance to use. Since the choice can change the behavior of the program, it means that the program has no meaning, which means the type system has failed.

Ambiguous type errors also aren't "new errors" - the old Q# compiler disallowed ambiguous types, too. And although the two potential problems above are both future problems only, relaxing the restrictions now and then adding them back later is a lot harder (in terms of breaking changes) than just keeping the errors in.

from qsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.