[jira] Created: (BOO-1340) Invoking a closure on a method inside a generic type causes Bad IL and BadImageFormatException

Invoking a closure on a method inside a generic type causes Bad IL and BadImageFormatException
----------------------------------------------------------------------------------------------

                 Key: BOO-1340
                 URL: https://jira.codehaus.org/browse/BOO-1340
             Project: Boo
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 0.9.4
         Environment: .net 3.5 and 4.0
            Reporter: Giovanni Bassi
            Priority: Minor

Attempting to call a regular method which references a generic parameter from it's type fails if you try to
pass a closure referencing the generic type.

{code:title=fails.boo|borderStyle=solid}
class Entity: 
	public Prop as string

class Repository[of T(Entity)]:
	def Get(p):
		Where({ p | p.Prop == p})
	def Where(predicate as System.Func[of T, bool]):
		pass
{code}

If you use a closure on an object where the generic parameter is already defined, it doesn't fail. This will pass:

{code:title=works.boo|borderStyle=solid}
(Continue reading)

[jira] Created: (BOO-1339) Generic constraint not correctly applied when type is declared on a field

Generic constraint not correctly applied when type is declared on a field 
--------------------------------------------------------------------------

                 Key: BOO-1339
                 URL: https://jira.codehaus.org/browse/BOO-1339
             Project: Boo
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 0.9.4
         Environment: .NET 3.5 and 4.0, x64
            Reporter: Giovanni Bassi

When you declare a field's type explicitly, if it's type is a generic class with a constraint, then under
certain conditions the type will no longer have the generic constraint, only the generic constraint remains.

This will not compile as expected, class Repository will be defined as Repository[of T] instead of
Repository[of T(Entity)]:

class Other:
	rep as Repository of Entity = Repository of Entity()
class Repository[of T(Entity)]:
	pass
class Entity:
	pass

But if you leave the class Other at the bottom, it works as expected:

class Repository[of T(Entity)]:
	pass
class Entity:
(Continue reading)

Tristan Zajonc (JIRA | 28 Aug 20:25

[jira] Created: (BOO-1338) IQuackFu cache does not distinguish properly between set/get/invoke

IQuackFu cache does not distinguish properly between set/get/invoke
-------------------------------------------------------------------

                 Key: BOO-1338
                 URL: https://jira.codehaus.org/browse/BOO-1338
             Project: Boo
          Issue Type: Bug
          Components: Runtime (Boo.Lang)
    Affects Versions: 0.9.5
            Reporter: Tristan Zajonc

The cache in Boo.Lang.Runtime.RuntimeServices._cache contains only name of the method, and types of
arguments. It doesn't distinguish between property and method calls.  This causes bugs when
implementing IQuackFu.

The possible fix is to change Boo.Lang.Runtime.RuntimeServices.SetProperty
from:
        public static object SetProperty(object target, string name, object value)
        {
            object[] args = new[] { value };
            var dispatcher = GetDispatcher(target, args, name, () => CreatePropSetDispatcher(target, name, value));
            return dispatcher(target, args);
        }
to:
        public static object SetProperty(object target, string name, object value)
        {
            var setterName = "set_" + name;
            object[] args = new[] { value };
            var dispatcher = GetDispatcher(target, args, setterName, () => CreatePropSetDispatcher(target,
setterName, value));
(Continue reading)

[jira] Created: (BOO-1337) \x## escaping for ASCII values

\x## escaping for ASCII values
------------------------------

                 Key: BOO-1337
                 URL: https://jira.codehaus.org/browse/BOO-1337
             Project: Boo
          Issue Type: New Feature
          Components: Parser
         Environment: (Independent)
            Reporter: Philip Peterson

Boo should support Python's syntax for escaped ASCII values within string literals (is there any
alternative syntax for this already?)

Ex:

>>> print "\x50"
P

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

[jira] Created: (BOO-1336) Generics not reported in casting error

Generics not reported in casting error
--------------------------------------

                 Key: BOO-1336
                 URL: https://jira.codehaus.org/browse/BOO-1336
             Project: Boo
          Issue Type: Improvement
          Components: Parser
            Reporter: Philip Peterson

When assigning a value to a variable where the value cannot be cast because of a generic specification, the
warning is unhelpful.

t = List[of int]()
t = List()

ERROR: Cannot convert 'Boo.Lang.List' to 'Boo.Lang.List'.

A better error message would be: ERROR: Cannot convert 'Boo.Lang.List[of object]' to 'Boo.Lang.List[of int]'.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

(Continue reading)

James Gardiner (JIRA | 22 Jul 05:17

[jira] Created: (BOO-1335) Certain TimeSpan literals create incorrect results

Certain TimeSpan literals create incorrect results
--------------------------------------------------

                 Key: BOO-1335
                 URL: https://jira.codehaus.org/browse/BOO-1335
             Project: Boo
          Issue Type: Bug
    Affects Versions: 0.9.4, 0.9.3
         Environment: Windows Vista .NET 4.0
            Reporter: James Gardiner
            Priority: Minor

4m to 7m do not seem to correctly be translated. Also seems to happen with .06h and 240s and .004d . Don't think
it's with mscorlib. TimeSpan values can be correctly set with constructor.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

fagim sadykov (JIRA | 21 Jul 09:20

[jira] Created: (BOO-1334) Mixing WSA and non-WSA parsing in single CompileUnit

Mixing WSA and non-WSA parsing in single CompileUnit
----------------------------------------------------

                 Key: BOO-1334
                 URL: https://jira.codehaus.org/browse/BOO-1334
             Project: Boo
          Issue Type: Improvement
          Components: Compiler, Parser
    Affects Versions: 0.9.4
         Environment: Any
            Reporter: fagim sadykov

Boo have great thing - 2 lexer model for Python-like and Basic-like block behaviour.
I'm using brail and day before wrote a compiler that collects all *.brail files
and compiles single library for caching views.
But my version of brail supports both Python and Basic block types (using self-rewriting brail).
So to create such compiler I have to rewrite and replace Parsing step with custom step
which perform pre-view on code, found pragma #pragma boo in title of source code file 
and then decides which parser it must use.

It's will be MUCH clear if:
1) there is one fixed class for Parse step  ALWAYS , because many pipeline extensions are applyed as
InsertAfter and InsertBefore Parsing phase and
replacing of parser may crash some of such solutions
2) Compiler must have parameter DefaultWSABehaviour from some enum with values NonWSA, WSA, Default = NonWSA
3) Compiler has legal support for code module pragmas (processing instructions) - maybe as extension to
InputSource, because pragmas must be parsed before any code processing
4) parsing step determines parser/lexer due two rules - if code module contains special pragma (for
example #pragma wsa) it uses that setting, otherwise DefaultWSABehaviour used

(Continue reading)

fagim sadykov (JIRA | 21 Jul 09:07

[jira] Created: (BOO-1333) New style of interpolations is well feature but have some overheads, want to have normal core-bound solution

New style of interpolations is well feature but have some overheads, want to have normal core-bound solution
------------------------------------------------------------------------------------------------------------

                 Key: BOO-1333
                 URL: https://jira.codehaus.org/browse/BOO-1333
             Project: Boo
          Issue Type: Improvement
          Components: Parser
    Affects Versions: 0.9.4
         Environment: Any
            Reporter: fagim sadykov

Before 0.9.4 it was only interpolation syntax ${...} now where are $literal, and $(...).
I't good for the one hand, but I'v caught an problem.
Main approach of Brail using in my projects is HTML generation (improoved version of Brail) and DSL for
custom formulas.
Both actively uses generation/parsing of strings.
So, in Brail i have some peaces of JS generation and where many strings like "$(e).hide()" and so on.
On other hand on DSL i have some formula syntax wich uses $xxx and $(...) notation.
On 0.9.1 all works well because it does not rewrite such strings, in 0.9.4 i've got
a problem - and rewriting on \$\( style not what I want.

I have avoid it with two custom steps :
1) preprocess brail code and escape all $xxx and $(...) to _ESCAPED_USD_xxx and _ESCAPED_USD_(...) so,
parser will not treat it as interpolations
2) after parsing i call step which visit all StringLiteralExpression and replace _ESCAPED_USD_ to $, but
for compiler it's just strings for now (interpolation detection is parse-time stuff)

BUT it's not that is Cool for such thing as Boo.

(Continue reading)

fagim sadykov (JIRA | 21 Jul 08:55

[jira] Created: (BOO-1332) COMPILATION ERROR: Cannot define valid generic parameters for method if one of parameter is a generic delegate

COMPILATION ERROR: Cannot define valid generic parameters for method if one of parameter is a generic delegate
--------------------------------------------------------------------------------------------------------------

                 Key: BOO-1332
                 URL: https://jira.codehaus.org/browse/BOO-1332
             Project: Boo
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 0.9.4
         Environment: Windows .NET 4.0, 
            Reporter: fagim sadykov
            Priority: Critical
             Fix For: 0.9.1
         Attachments: BOOBUG_CannotResolveGenericsOnClosures.cs

Given method in some class:
public class A {
    public T call<T>(Func<T> innercall){ return innercall();}
}

Given Boo call:
x = A().call({'test'})

In 0.9.1 version all of generics was resolved, and treated as:
x as string = A().call[of string]({'test'})

But on 0.9.4 (maybe on 0.9.3 too, I haven't use it) it cause a compiler error:

"Cannot find overload for ... call ... with parameters (error)..."

(Continue reading)

Rolly Noel (JIRA | 27 Jun 17:26

[jira] Created: (BOO-1331) Generator expression as method argument causes InvalidCastException

Generator expression as method argument causes InvalidCastException
-------------------------------------------------------------------

                 Key: BOO-1331
                 URL: https://jira.codehaus.org/browse/BOO-1331
             Project: Boo
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 0.9.4
         Environment: Windows 7 64 bit
            Reporter: Rolly Noel

def ShowDouble (num as int):
        print num * 2

ShowDouble (i for i in range(5))

causes:
InvalidCastSystem.InvalidCastException: Unable to cast object of type '$Main$1' to type 'System.IConvertible'.
 at static Int32 Boo.Lang.Runtime.RuntimeServices.UnboxInt32(Object value) at static void
ProgramModule.Main(String[] argv)

Rodrigo B. de Oliveira says it should be a compile time error.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe from this list, please visit:
(Continue reading)

Daniel Brauer (JIRA | 27 May 22:35

[jira] Created: (BOO-1329) Extension property setter incorrectly claims that it cannot be used without parameters

Extension property setter incorrectly claims that it cannot be used without parameters
--------------------------------------------------------------------------------------

                 Key: BOO-1329
                 URL: http://jira.codehaus.org/browse/BOO-1329
             Project: Boo
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 0.9.4
            Reporter: Daniel Brauer
         Attachments: extensionPropertySetterTest.boo

An extension property setter defined like this:

class RectExtensions:
____[extension] static position[this as Rect] as Vector2:
________set:
____________this.x = value.x
____________this.y = value.y

...cannot be used like this:

rect = Rect()
v = Vector2()
v.x = v.y = 1f
rect.position = v

...because of this error:

The property 'RectExtensions.position' cannot be used without parameters.
(Continue reading)


Gmane