Page 1 of 1

[ticket:125,128] attachment

PostPosted: Mon Jan 05, 2009 8:44 pm
by gauthier
file attachment size is damn small...

the code:

namespace here
use NUnit.Framework
use Castle.MonoRail.Framework
use Castle.MonoRail.Framework.Test
use Castle.MonoRail.TestSupport
class SomeTestFixture
has TestFixture
inherits BaseViewComponentTest
def setup
has SetUp
body
pass
def compileFail
has Test
body
pass
class Program
shared
def main
pass


    Cassini.dll
    Castle.Components.Binder.dll
    Castle.Components.Common.EmailSender.dll
    Castle.Components.Pagination.dll
    Castle.Components.Validator.dll
    Castle.Core.dll
    Castle.MonoRail.Framework.dll
    Castle.MonoRail.TestSupport.dll
    Newtonsoft.Json.dll
    nunit.framework.dll

download them from: http://builds.castleproject.org/cruise/ ... umber=1007

the ticket: http://cobra-language.com/trac/cobra/ticket/125


Newtonsoft.Json.dll is 3.5 dll

Re: [ticket:125] attachment

PostPosted: Mon Jan 05, 2009 11:19 pm
by Charles
I'll take a look, but the first thing I see that is wrong is that when I visit http://builds.castleproject.org/cruise/DownloadBuild.castle?number=1007 it says the files are for .NET 3.5. Cobra is currently running against .NET 2.0...

Re: [ticket:125] attachment

PostPosted: Mon Jan 05, 2009 11:59 pm
by Charles
Okay, I made the compiler more robust and now it gives this error:
Code: Select all
main.cobra(17): error: Cannot instantiate the namespace "Castle.MonoRail.Framework.Test".

Now the question is if we think the symbol resolution is off. Cobra is finding "Test" in the "Castle.MonoRail.Framework" namespace before it finds a class of that name anywhere else.

Re: [ticket:125] attachment

PostPosted: Tue Jan 06, 2009 4:26 am
by gauthier
it says the files are for .NET 3.5. Cobra is currently running against .NET 2.0...


Castle require 3.5 for compile time only (no dependency over 3.5 system assembly), it run fine on 2 only runtime.

Since 3.5 it's the same runtime anyway, it seems to me cobra should parse 3.5 assemblies just as well as a 2.0

Now the question is if we think the symbol resolution is off. Cobra is finding "Test" in the "Castle.MonoRail.Framework" namespace before it finds a class of that name anywhere else.


is that the problem ? I've commented the namespace and checked the dependencies, but still get the new message.

Re: [ticket:125,128] attachment

PostPosted: Tue Jan 06, 2009 12:25 pm
by gauthier
I created another ticket with activerecord dependency: http://cobra-language.com/trac/cobra/ticket/128

namespace Here
use System
use System.Collections.Generic
use Castle.ActiveRecord
use Castle.ActiveRecord.Framework.Internal
use Castle.ActiveRecord.Tests
use NUnit.Framework


class Foo
has ActiveRecord

pro key from var as Guid?
has PrimaryKey("key", generator = PrimaryKeyType.GuidComb)

pro bar from var as String?
has Property


class DataChangeSetRecordTestFixture
has TestFixture
inherits AbstractActiveRecordTest
var collection as ActiveRecordModelCollection?


def setup
has SetUp
listen ActiveRecordStarter.modelsCreated, do(models as ActiveRecordModelCollection, source as IConfigurationSource)
.collection = models
for m as ActiveRecordModel in models
if m.primaryKey
m.primaryKey.primaryKeyAtt.column = "_key_"
.recreate

def findAll_works_and_return_0_records
has Test
ensure
foos
foos.length == 0
body
using scope = SessionScope()
#foos = ActiveRecordMediator<of Foo>.findAll # doesn't compile
foos = ActiveRecordMediator.findAll(Foo.getType)


Code: Select all
Cobra Command Line 0.8.0 post-release
Copyright (C) 2003-2009 by Cobra Language LLC.

OS Version:   Microsoft Windows NT 5.1.2600 Service Pack 2
CLR Platform: .NET
CLR Version:  2.0.50727.1433
Current Directory: C:\home\dev\tmp\cobratickets\activerecord
Current Exe: C:\Cobra\Cobra-0.8.0-post\bin\cobra.exe
Option Dictionary:
    reveal-internal-exceptions: true
    verbosity: 3
    reference: List<of String>['Castle.ActiveRecord.dll', 'Castle.ActiveRecord.Tests.dll', 'Castle.Components.Validator.dll']
    contracts: 'inline'
    correct-source: Set<of String>['none']
    debugging-tips: true
    embed-run-time: false
    include-asserts: true
    include-nil-checks: true
    include-tests: true
    include-traces: true
    number: 'decimal'
Paths:
    test.cobra
Adding reference to Cobra.Lang.dll
Reading assembly:  mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Reading assembly:  System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 at C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll
Final assembly reference list:
0. Castle.ActiveRecord.dll
1. Castle.ActiveRecord.Tests.dll
2. Castle.Components.Validator.dll
3. Cobra.Lang.dll
Loading reference: Castle.ActiveRecord.dll
Reading assembly:  Castle.ActiveRecord, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc at C:\home\dev\tmp\cobratickets\activerecord\Castle.ActiveRecord.dll
Loading reference: Castle.ActiveRecord.Tests.dll
Reading assembly:  Castle.ActiveRecord.Tests, Version=1.0.3.0, Culture=neutral, PublicKeyToken=null at C:\home\dev\tmp\cobratickets\activerecord\Castle.ActiveRecord.Tests.dll
Loading reference: Castle.Components.Validator.dll
Reading assembly:  Castle.Components.Validator, Version=1.0.3.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc at C:\home\dev\tmp\cobratickets\activerecord\Castle.Component
s.Validator.dll
Loading reference: Cobra.Lang.dll
Reading assembly:  Cobra.Lang, Version=0.8.0.1, Culture=neutral, PublicKeyToken=0a4783a5c7c9616e at C:\Cobra\Cobra-0.8.0-post\bin\Cobra.Lang.dll
Parsing test.cobra
Binding use directives
Loading reference: NUnit.Framework.dll
Reading assembly:  nunit.framework, Version=2.5.0.8189, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 at C:\WINDOWS\assembly\GAC_MSIL\nunit.framework\2.5.0.8189__96d09a1eb7
f44a77\nunit.framework.dll
Binding inheritance
Binding interface
Binding implementation
test.cobra(11): error: Cannot instantiate the namespace "Castle.ActiveRecord".
Compilation failed - 1 error, 0 warnings
Not running due to errors above.


note: it seems the generic version of class with same name is not usable (ActiveRecordMediator<of T> won't work)

Re: [ticket:125,128] attachment

PostPosted: Thu Jan 08, 2009 6:38 pm
by Charles
Regarding ticket:125, I have added a comment. Please review.

Regarding ticket:128, it's not clear that I should look into it until we resolve 125. Cobra does support have types A, A<of T>, A<of T, U> etc. like C#, both for consumption and declaration.

Re: [ticket:125,128] attachment

PostPosted: Fri Jan 16, 2009 9:02 pm
by Charles
ticket:125 is closed. See also Namespace clarifications.