Integer literal in `imagine` block inferred as decimal type

Open
#28 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, sql
Domain
compilers

Research direction

Reproduce the vendor-specific tsql/imagine example and compare the inferred type of csum with the cast(0 as int) variant. Read the linked Literal documentation for the expected integer-literal rule, then identify the type-inference path responsible. Done means an uncast 0 is inferred as an int while the existing cast behavior remains correct.

Written by the indexing model from the issue text.

Description

This vendor-specific code

    vendor tsql {
        select *, checksum(*) as csum from person
    } imagine {
        select *, 0 as csum from person
    }

infers the type of the csum column as decimal type. Changing the column expression to cast(0 as int) changes the type to int.

From the documentation I expect digits with no decimal point to be interpreted as an int literal.

Dominant language
F#
Stars
680
Forks
23
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/Rezoom.SQL

All issues in fsprojects/Rezoom.SQL

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.