Giter VIP home page Giter VIP logo

Comments (2)

rspeele avatar rspeele commented on June 1, 2024

This is working as designed but I can see how it would be good for the design to change.

All numeric literals regardless of format (even hex) are inferred as <numeric>.
This placeholder within the type hierarchy allows them to be unified with any other numeric type. The way it currently works, if we inferred 0 as <integral> then it wouldn't unify with any types under the <fractional> branch of the hierarchy, so e.g. select SomeFloatingPointColumn + 1 wouldn't work.

When a type comes out of inference as one of those placeholders like <numeric> or <fractional> or whatever, instead of a concrete type like int64, we just default to the most general type. In the case of <numeric> decimal is considered to be the most general.

Maybe we could track a little extra information in the type so that literals like 0 can still be treated as "any ol' number" for unification purposes, but if they get through all of typechecking without further info, could get a default type assigned based on the characteristics of the literal (fits in int32? has decimal point? hex?).

from rezoom.sql.

adam-c-anderson avatar adam-c-anderson commented on June 1, 2024

If it's working as designed, then maybe all that's needed is to clarify the linked documentation, adding a bullet point to the bottom of the page to indicate that all numbers are inferred as decimal unless explicitly cast.

from rezoom.sql.

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.