taskThe Nosica programming language - Tasks: task #986, Literals

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #986: Literals

Submitted by:  David Jobet <djobet>
Submitted on:  Mon Oct 25 21:06:16 2004  
Should Start On: Mon Oct 25 00:00:00 2004Should be Finished on: Mon Oct 25 00:00:00 2004
Category: CompilerPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenEffort: 0.00

Mon Oct 25 21:06:16 2004, original submission:

There is currently a dumb compil error in this code :
int8 i = 126; // won't compil

because the method net.nosica.compiler.TypeChecker.TypeCheckVisitor.createLiteral() first checks the value against 0..255 and returns a word8.
The next test is to look the value against -127..128 and returns an int8.
Of course in that case it does not work.

One solution is to returns a special structure which can hold a set of possible types. In that case, it will contain {word8, int8}. Only when doing the lhs assignment would the real type be chosen.

David Jobet <djobet>
Project Administrator


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by djobet (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup