History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-463
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Joshua W. Biagio
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Support for Int16/UInt16 literals (e.g. Int16.MaxValue)

Created: 28/Aug/05 04:27 PM   Updated: 28/Aug/05 06:14 PM
Component/s: Emitter, Compiler
Affects Version/s: 0.6
Fix Version/s: 0.7

Time Tracking:
Not Specified

Environment: Windows 2000/SP4, .NET 1.1 SP1


 Description  « Hide
I noticed while playing with the "booish" tool that
"""
i as short
print i.MaxValue
"""
didn't work, failing with the following error: "ERROR: Language feature still not implemented: 'Literal: Int16'."

After some investigation, I discovered that short/ushort/Int16/UInt16 was not implemented as a case in Boo.Lang.Compiler/Steps/EmitAssembly.cs.

I added the following two cases to my copy of EmitAssembly.cs:

case TypeCode.Int16:
{
_il.Emit(OpCodes.Ldc_I4, (int)(short)value);
break;
}

case TypeCode.UInt16:
{
_il.Emit(OpCodes.Ldc_I4, (int)(ushort)value);
break;
}

These cases seemed to do the trick, as I can now use shorts in booish and access their static methods. I'm not sure why this was left out, but I wanted to thank all of people involved in this project for working to make Boo a very useful tool!

Finally, I apologize for not submitting a proper diff



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Rodrigo B. de Oliveira - 28/Aug/05 06:14 PM
thanks!