Giter Club home page Giter Club logo

Comments (4)

titzer avatar titzer commented on June 8, 2024

Can you write a seman testcase that should pass and add to test/fail?

from virgil.

k-sareen avatar k-sareen commented on June 8, 2024

I've been reading the type checking code in vst/Verifier.v3 and I don't understand why the ve.expr has to be null, i.e. why the match case has to be the unqualified type (see these lines).

from virgil.

k-sareen avatar k-sareen commented on June 8, 2024

For the error generated by test/fail/adt_type_infer03.v3 (in PR), I think the TypeSystem.isPromotable() should return true because, well A<u4>.C and A<u8>.C are the exact same type. Unless is there some internal representation issue? Even then it should just be equal, no?

EDIT: Or well, more precisely the TypeSystem.isSubtype() for variants needs updating.

from virgil.

titzer avatar titzer commented on June 8, 2024

This is a subtle thing that needs to be explained better. Integer types like u4 and u8 are not related by subtyping but by promotion. That is because they could be represented differently. E.g. on a 32-bit machine a u32 will be represented by one word and u64 two words. Subtyping is only for values whose representation doesn't change when assigning a value from a subtype to a supertype location (i.e. the assignment is always pass-through, nop).

from virgil.

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.