sebbekarlsson / tscc

Typescript to C compiler (TSCC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`number` type is always an integer

sebbekarlsson opened this issue · comments

The compiler currently treats the number type as an integer, always.
This causes problems, for example; this:

    let age:number = 33.5;

becomes this:

    int age = 33.5;

This could probably be solved by changing the datatype if the right expression is a float.
Here is a situation where it's a bit more difficult:

    age: number;

    number = 33.5;

In this situation, we cannot change the datatype of the initialization.