Updated When . . . ticket summary component version milestone type owner status Created When _description _reporter Aug 3 2014 Sun 377 Erroneous incompatible types when casting to enum Cobra Compiler 0.9.6 defect closed Jul 31 2014 "It's very possible that I'm missing something obvious here, but I am getting an error on what appears to be a safe down-cast from {{{Object?}}} to (a subclass of) {{{Enum?}}}. The specific method is {{{Enum.parse}}}, which is throwing the following error: {{{ Incompatible types. Cannot assign value of type Object? on the right to TestEnum? on the left. }}} Full example: {{{ enum TestEnum A, B, C class PossibleEnumCompileIssue def main is shared # This doesn't work/compile: # x as TestEnum? = Enum.parse(TestEnum, 'A') # This works, though: y as TestEnum Enum.tryParse('A', out y) # I believe the first line should be equivalent to this? sharp'global::TestEnum z = (global::TestEnum) System.Enum.Parse(typeof(global::TestEnum), ""A"")' }}} The compiler rejects the cast even if I check the type of x before casting." Jonno Mar 31 2014 Mon 367 Relax class pass warning on partial classes Cobra Compiler 0.9.6 enhancement closed Mar 5 2014 "Theres a warning on use of ""pass"" in a class that already has some box members (!CobraParser.cobra .classPass) as in {{{ #!cobra class X is partial pass }}} where class X is already declared {{{ #!cobra class X def foo print 'foo.' def main is shared x = X() x.foo }}} It seems it might be worthwhile to relax this if the class is declared partial which would allow the specification of partial classes as placeholders for additional work (placeholder/reminder for new named methods and fields to be added later) ( This is what is being done in the compiler for some of the backends - classes to be filled out eventually but in interim the partial classes are entered with 'pass' as the only content.. Can see the result if you rebuild the compiler selfhosting (rebuild it with itself) Get 142 warnings for {{{ warning: Encountered ""pass"" in a class that already has declared members. }}} An alternative option would be to introduce a 'todo' or 'tobeimplemented' keyword that could be placed in such classes (same as pass) to note such use as temp placeholders.." hopscc Mar 28 2014 Fri 201 Add Cobra support for namespace aliasing/Masking Cobra Compiler 0.8.0 enhancement Chuck closed May 2 2010 "C# allows dismabiguation of colliding namespaces or aliasing a complex namespace name to something simpler with syntax on its '''using''' statement Cobra should provide a similar capability for similar purposes e.g. Namespace with own version of type Console ambiguous with System.Console. {{{ using Console = Wrapper.Console; }}} See [http://cobra-language.com/forums/viewtopic.php?f=4&t=592 Discussion Topic]" hopscc Mar 11 2014 Tue 160 Get Cobra working with Silverlight Cobra Compiler 0.8.0 enhancement closed Jun 16 2009 "To my knowledge, no one has tried. Obviously, this would entail an automated test case. " Chuck Mar 8 2014 Sat 34 Compile error with both isnames and assignment on class var Cobra Compiler 0.8.0 defect Chuck closed Aug 2 2008 " lines of this form cause a compile error {{{ var name = 'xxx' is public # or any isname }}} Heres a sample program {{{ class VarIsNameAssign var myVal0 is shared var myVal1 = 'works' var myValBroke = ""now not broke"" is shared # def main is shared assert not .myVal0 v = VarIsNameAssign() assert v.myVal1 == 'works' a = v b = VarIsNameAssign() assert a is v assert .myValBroke == 'now not broke' # compile error here when broken # error: Expecting an expression. ""shared"" is a reserved keyword that is not expected here. assert a is v assert a is not b }}} Due to use of full expr when parsing the assignment - it sucks up the 'is isnameValue' thinking its an 'isRef' check. The compiler has code to support this (assignment and isnames) but theres no test case for it. " hopscc Feb 26 2014 Wed 365 "Regression with ""has"" and initial value on fields from changeset 3104" Cobra Compiler 0.9.6 defect closed Feb 24 2014 "Changeset 3104 has introduced a regression regarding attributes on fields that have an initializer. Test case below. {{{ class SomeAttribute inherits Attribute pass class Program # used to work and still works var someVar has SomeAttribute # regression: used to work before changeset 3104 # expecting DEDENT, but got ""has"" instead var someOtherVar = ""initialValue"" has SomeAttribute # never worked and still doesn't # Expecting EOL but got ""has"" instead #var foo has SomeAttribute def main pass }}} ""has"" and ""is"" should probably work the same way. The workaround I imagine is to initialize these in an init cue which I have not tried yet. This affects the MD/XS add-in." nerdzero Feb 2 2014 Sun 358 Stackoverflow on cyclical inheritance Cobra Compiler 0.9.6 defect Charles closed Jan 27 2014 "{{{ #!cobra class Program def main pass interface IFoo inherits IFooBar var x as int interface IBar inherits IFoo var y as int interface IFooBar inherits IFoo, IBar # the order of the interfaces is what blows it up pass }}} " Charles Feb 2 2014 Sun 362 False compilation error for invariants from other namespaces Cobra Compiler 0.9.6 defect closed Feb 1 2014 "The following code declares an invariant which is then implicitly used and inlined by a subclass in a different namespace. The code generation fails to fully qualify a reference to the base type which results in a false error about the type not being found. {{{ namespace Foo class A invariant .isSomething pro isSomething from var as bool namespace Baz use Foo class B inherits A pass class P def main pass }}} " Charles Feb 1 2014 Sat 360 getters should always supply a return value Cobra Compiler 0.8.0 defect closed Feb 1 2014 "currently cobra accepts code such as this: get hasSubCmds return _sub.count > 0 however it seems to get confused about the type, in the call site. I suggest making it mandatory to supply a return value, (which the user may simply forget sometimes). get hasSubCmds as bool return _sub.count > 0" kobi7 Jan 21 2014 Tue 17 MSBuild support Cobra IDE: Miscellaneous 0.8.0 task closed May 8 2008 "Implement MSBuild support. This is needed by both Visual Studio and #develop. (It might also be used by MonoDevelop. I haven't checked.) " Chuck Jan 21 2014 Tue 353 Internal error on certain multi-target assignments Cobra Compiler 0.9.6 defect closed Jan 16 2014 "{{{ #!cobra class X def foo a, b = 'x', .bar('y') a, b = 'x', _bar('y') # <--- causes internal error CobraCore.noOp(a, b) def bar(s as String) as int return 1 def _bar(s as String) as int return 1 def main print 'done.' }}} " Charles Jan 20 2014 Mon 266 Returning different exit codes from the compiler Cobra Compiler 0.8.0 enhancement Charles closed Dec 3 2010 "Currently when the Cobra compiler is run 0 is returned for all results: successful compilation, unsuccessful compilation, internal error, etc. '''Proposal''' Return different values depending on the state that the compiler exited." todd.a Jan 20 2014 Mon 227 With -color the output of the running program is printed in color. Cobra Compiler 0.8.0 defect nevdelap closed Jul 30 2010 " {{{ class A def main is shared print '1' }}} Prints the 1 in blue." nevdelap Jan 19 2014 Sun 355 Internal error with -namespace option Cobra Compiler 0.9.6 defect Charles closed Jan 17 2014 "An internal compiler error is triggered when the -namespace option is used and the value has the same name as a declaration in the source code. {{{ @args -namespace:Program class Program def main print 'hola!' }}} {{{ error: COBRA INTERNAL ERROR / Exception / In (global) there is a already non-namespace declaration named ""Program"" }}}" nerdzero Jan 19 2014 Sun 354 Shared protected var is not visible to subclass if base class is defined in reference Cobra Compiler 0.9.6 defect closed Jan 17 2014 " {{{ Cobra svn:3097 (post 0.9.6) / 2014-01-13 on Mono 3.2.7 CLR v4.0.30319 on Ubuntu 13.10 }}} The following snippet compiles without issue. {{{ @args -t:lib class Foo shared var _bar = 1 class Bar inherits Foo def testing print _bar }}} This next one fails with the following message: ''error: For ""print"" arg 1: Cannot find ""_bar"".'' {{{ @ref ""Foo.dll"" class Program inherits Foo def main print _bar }}} Shared variables with protected accessibility are not visible to subclasses if the base class is defined in a referenced assembly." nerdzero Jan 12 2014 Sun 352 `in` does not work with a string lits in a dynamic var pointing to a string Cobra Compiler 0.9.6 defect closed Jan 12 2014 "The last test fails: {{{ #!cobra class X def main assert 'ao' in 'aoeu' s = 'aoeu' assert 'ao' in s t = 'aoeu' to dynamic assert 'ao' in t }}} The generated code calls: {{{ CobraCoreInternal.CobraImp.In(""ao"",t)/* G *//* E */ }}} ...which looks fine, so probably just the native function needs to be fixed. " Charles Jan 12 2014 Sun 351 Compiler should not warn user about names of Attributes declared in referenced library Cobra Compiler 0.9.6 defect closed Jan 10 2014 "Recently I had to make use of an attribute defined in an assembly whose name did not end in ""Attribute"". I received the following warning from the Cobra compiler: {{{ (empty)(1): warning: When attributes are declared, they should be suffixed with ""Attribute"". }}} A patch is included to suppress this warning when the Attribute declaration is coming from a referenced library." nerdzero Jan 3 2014 Fri 349 Internal error for forward reference Cobra Compiler 0.9.6 defect closed Jan 2 2014 "The following code causes an internal error: {{{ #!cobra class A var _foo = B.bar class B def bar as String is shared return '' }}} Note that the equivalent C# works fine: {{{ class A { protected string _foo = B.Bar(); } class B { public static string Bar() { return """"; } } }}} Though C# has no ""var"" at the member var level, nor ""from var"" for declaring properties. " Charles Dec 14 2013 Sat 347 Cannot make use of optional arguments declared in a library Cobra Compiler 0.9.4 defect Charles closed Dec 9 2013 "The optional argument support in Cobra doesn't work across libraries. In other words, if the method is declared like so: {{{ #!cobra class X def foo(verbose = false) as int return if(verbose, 1, 0) }}} Then trying to invoke the method without an argument will work in the same code base, but fail in another project with: error: The method ""foo"" is expecting 1 argument, but no arguments are being supplied in this call. The declaration is ""foo(verbose as bool)"" This all came up because I tried using optional args in Cobra.Core after which some test cases failed the above error. The solution will almost certainly be the generation and scanning of attributes on the argument. Ideally, we would use the same conventions as the C# compiler for maximum compatibility between Cobra and C#. " Charles Dec 8 2013 Sun 324 Move to .Net 4.0: Use 'var' for type inference ( cobra codegen and RTL) Cobra Compiler 0.9.4 enhancement closed May 29 2013 "C# .Net 4.0 supports type inference using a '''var''' keyword on a declaration. Where necessary or useful perhaps modify cobra codegen to use it. Modify C# native (RTL Native.cs) code to do same. (I've a reservation for the task wrt doing this entirely in codegen because cobra does a pretty good job already without it and pushing this entirely to the backend makes porting/support for other backends dependent on them having type inference as well ( I'm looking at you Java) Still there may be some possibilities)." hopscc Oct 29 2013 Tue 336 Provide arg vs parameter sanity checking on (PostCallExpr) constructor calls Cobra Compiler 0.9.4 enhancement Chuck closed Jun 26 2013 "Cobra currently doesnt check args vs parameters on (!PostCallExpr) constructor calls instead relying/falling through to backend compiler checks/errors. Cobra should do its own checks and sanity checking for some/all of this. Do as follow on to ticket:326 as liable to some confounding with both named args and extended property inits." hopscc Sep 17 2013 Tue 345 Misleading warning can be generated in ensure contract Cobra Compiler 0.9.4 defect closed Sep 16 2013 "This code... {{{ class Example var _x = 0 def main print _x .foo print _x def foo ensure old._x < _x _x += 1 }}} generates this warning... {{{ warning: An explicit dot (""."") is unnecessary for accessing underscored members of the current object. You can remove ""."" }}} The warning is referring to old._x but you cannot remove the dot in this case. The warning should not be displayed." nerdzero Aug 22 2013 Thu 344 Compiler chokes on newline between property doctstring and body Cobra Compiler 0.9.4 defect closed Aug 21 2013 "Apologies if this is known / by design - this is my first day with Cobra. Working through the howto, I producted the following code: {{{ class Person var _name as String cue init(name as String) base.init _name = name pro name as String """""" Name of the Person. """""" get return _name set _name = value.trim def printName print .name def sayHello print 'Hi, my name is [.name]' class Program def main p = Person('chuck') print p.name assert p.name == 'chuck' p.name = 'Chuck' }}} which caused the compiler to produce: {{{ error: Expecting ""get"" or ""set"" for the property. }}} which is seemingly due to the newline following the docblock in the `name` property. Removing the newline allows the code to compile, but this feels strange as the limitation does not seem to be in place for classes or methods. " Jonno Aug 6 2013 Tue 326 Move to .Net 4.0: Support Named Parameters Cobra Compiler 0.9.4 enhancement hopscc closed May 29 2013 "C# 4.0 supports Named parameters on method paramlist so methods can be called giving params in any order tagged by their name. Cobra should support this also see [http://www.codeproject.com/Articles/37795/C-4-0-s-New-Features-Explained C# 4.0 New Features] '''Named Parameters''' C# uses name:arg in arglist to tag the arg to the parameter. Cobra should probably use assignment name=arg. {{{ #!cobra myArrayList = ArrayList() Process( ""foo"", true ) # valid, moreData omitted Process( ""foo"", true, myArrayList ) # valid Process( ""foo"", moreData = myArrayList) # valid, ignoreWS omitted Process( ""foo"", moreData=myArrayList, ignoreWS=false ) # valid, but silly }}} Support this after addressing ticket:325 (Optional Parameters) Watch out for complications from existing support for auto property assignment (in initializer calls). " hopscc Aug 4 2013 Sun 337 Confusing message on missed 'of' in generics call Cobra Compiler 0.9.4 enhancement Chuck closed Jul 2 2013 "Found by Chasm Below program gives error msg ""The method ""method"" is expecting 1 argument, but no arguments are being supplied in this call. The declaration is ""method(argument as T)"""" {{{ class Program def main .method(14) def method(argument as T) pass }}} Call is incorrect but parsed as a (invalid) !ChainedCompare. Probably easy enough to do if used to C* languages generics support. vs in cobra. Perhaps trap this (based on comparison being to a Type) and emit a soothing corrective suggestion. See [http://cobra-language.com/forums/viewtopic.php?f=4&t=9113 ForumTopic]" hopscc Aug 4 2013 Sun 335 Token on line after end of docstring causes parser confusion and 'useless error' Cobra Compiler 0.9.4 defect closed Jun 22 2013 "Also found by Chasm. see [http://cobra-language.com/forums/viewtopic.php?f=4&t=8037 Useless Error] Token(s) after a closing docstring token causes end of docstring to be unrecognised so text is then absorbed to start of next docstring. first two tokens of that docstring look like a reversed var declaration which causes the 'local variable' message. Suggest adjusting end of docstring token to allow (but ignore and warn on) non wspace to eoln after closing ''' (!CobraTokeniser) (I downrated this slightly to medium cos its a pretty obscure situation (accidental) but the resulting error message and source fingering is utterly unhelpful.)" hopscc Aug 4 2013 Sun 343 A field and property that differ only by case of a type with the same name triggers an internal compiler error Cobra Compiler 0.9.4 defect closed Aug 3 2013 "MonoDevelop recently made this change: https://github.com/mono/monodevelop/commit/f57fbcd49275c4f99ee11e12f5b17e3937a573ee#L3R711 It adds a field called ""diffTracker"" of type ""DiffTracker"" and a property called ""DiffTracker"" also of type ""DiffTracker"". This triggers a duplicate key exception in Container.addDecl when reading the MonoDevelop library. This prevents compilation of the Cobra addin for MD/XS. Sad face. Here's part of the stack trace: {{{ Unhandled Exception: System.ArgumentException: An element with the same key already exists in the dictionary. at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (System.Collections.Generic.TKey key, System.Collections.Generic.TValue value) [0x00000] in :0 at Container`1[IBoxMember].AddDecl (IBoxMember decl) [0x00000] in :0 at Box._scanClrProperties () [0x00000] in :0 at Class.ScanNativeTypeClr () [0x00000] in :0 at ClrBackEnd.ScanNativeType (Box box) [0x00000] in :0 at Box._scanNativeType () [0x00000] in :0 at Box._bindInh () [0x00000] in :0 at ClassOrStruct._bindInh () [0x00000] in :0 at Node.BindInh () [0x00000] in :0 at Box.BindInh () [0x00000] in :0 at Box.__prepLibraryInh () [0x00000] in :0 at Box._prepLibraryInh () [0x00000] in :0 at Box._prepLibraryBox () [0x00000] in :0 at Box.PrepIfNeeded () [0x00000] in :0 at Box.__memberForName (System.String name) [0x00000] in :0 at Box.__memberForNameIncludingExtensions (System.String name) [0x00000] in :0 at Box.MemberForName (System.String name) [0x00000] in :0 at Class.MemberForName (System.String name) [0x00000] in :0 at NameExpr.MemberForName (System.String name) [0x00000] in :0 at CallExpr._bindImp () [0x00000] in :0 at Node.BindImp () [0x00000] in :0 at Stmt.BindImp () [0x00000] in :0 ... }}}" nerdzero Aug 3 2013 Sat 340 Cobra internal error when mixin declared after class Cobra Compiler 0.9.4 defect closed Jul 12 2013 "The following program executes correctly when the mixin is declared before the class but not if declared after: {{{ interface IFoo get bar as int class Foo adds FooBehavior implements IFoo mixin FooBehavior get bar as int return 1 class Program def main f = Foo() print f.bar }}} Note that this same issue is encountered when the mixin is declared in a different file from the class declaration and the order of the files specifies the file containing the class before the file containing mixin." nerdzero Jun 27 2013 Thu 334 Cobra Internal error if source file ends in comma separated expression Cobra Compiler 0.9.4 defect Chuck closed Jun 22 2013 "Reported by Chasm See [http://cobra-language.com/forums/viewtopic.php?f=4&t=8099 forum item] test program {{{ class Program def main variable as int streamReader = StreamReader(""Something.txt"") streamReader.getType(variable, }}} When looking for separators or terminators, !CobraParser commaSepExpr handling does some .peek calls and immediately derefs the result. If there is no token ( end of Stream) this gets a !NullReferenceException which generates a COBRA INTERNAL ERROR. specific patch on its way pending testing but more generally perhaps use of this this pattern {{{ .peek.which.isOneOf(...) }}} needs hardening..." hopscc Jun 22 2013 Sat 325 Move to .Net 4.0: Support Optional Parameters Cobra Compiler 0.9.4 enhancement Chuck closed May 29 2013 "C# .Net 4.0 supports optional parameters (default parameter values) on method calls. Enhance cobra to do same. This would allow methods (and hopefully initializers) to be called without multiple convenience overloads being declared. See [http://www.codeproject.com/Articles/37795/C-4-0-s-New-Features-Explained C# 4.0 New Features] for C# examples the obvious Cobra equivalent would be something like {{{ #!cobra def Process( data as String, ignoreWS as bool = false, moreData as ArrayList? = nil ) pass # actual work done here }}} called as {{{ #!cobra Process( ""foo"", false, nil ) Process( ""foo"", false ) Process( ""foo"" ) }}} Replacing {{{ #!cobra def Process( data as String ) Process( data, false ) def Process( data as String, ignoreWS as Bool ) Process( data, ignoreWS, nil ) def Process( data as String, ignoreWS as Bool, moreData as ArrayList? ) pass # Actual work done here }}} Try and support initializer declaration (removing initializer chaining the same way) - assuming C# supports this on ctors (?) If you use the same syntax as above (ideally): - watch out for complications from handling immediate property assignment in Constructors. - watch out for erroneous expression token capture between typing and assignment (see ticket:34) (an obvious enhancement to this is type inference on optional params since an assignment like form give the possibility of inferring the param type)." hopscc Jun 14 2013 Fri 330 Move to .Net 4.0: Change cobra Set to inherit from HashSet Cobra Compiler 0.9.4 enhancement chuck closed May 29 2013 "Net 4.0 has new Set implementation !HashSet. Fixup existing cobra Set implementation to use .Net !HashSet as baseclass rather than using our own." hopscc Jun 14 2013 Fri 108 Modifier sections in type declarations Cobra Compiler 0.8.0 Cobra 0.9 enhancement Chuck closed Dec 21 2008 "Cobra already has this, but with `shared` only. Extend this to any modifier keywords and allow multiple ones separated by commas. {{{ class X private, shared def foo pass def bar is shared .foo class Y inherits X def main is shared .bar .foo # .error. }}} Implementation: This has been partially coded for in CobraParser in _isNamesStack (which should probably be renamed _modifierNamesStack). " Chuck May 30 2013 Thu 323 Internal error for dynamic argument Cobra Compiler 0.9.4 defect Chuck closed May 27 2013 "The program below works in Cobra 0.9.3, but not 0.9.4: {{{ #!cobra class X def foo(c as char) pass def foo(s as String) pass def foo(obj as Object) pass def main x = 'aoeu' to dynamic .foo(x) }}} changeset:2966 from ticket:189 caused the change Commenting out this code in Expr.cobra (around line 752) will allow the above program to compile and run without error: {{{ #!cobra /# if winner inherits BoxMember # .no-warnings. # to-do: 2012-07-01 CE: the following just isn't ready if winner.name not in ['format', 'invoke', 'split', 'sort'] # to-do: hack params = winner.params if _checkParamsCount(winner, args, params) if needInferOutArgs, _inferOutArgs(args, params, false) _checkArgsAssignable(winner, args, params) #/ }}} " Charles May 16 2013 Thu 318 Internal Error (FallThrough Exception) Cobra Compiler 0.9.3 defect Chuck closed Mar 15 2013 "I received the following internal error: error: COBRA INTERNAL ERROR / FallThroughException / info='_type is nil. this=BoxVar-sh(6613, name=bufferSize, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(ID, 'bufferSize', 'bufferSize', ln 301, col 7, C:\Users\seanm\Desktop\Cobra\NajaNode.cobra), name=bufferSize, isNames=['shared', 'readonly'], parentBox=Class-mi(6611, name=Config, didStartBindInh=true, didBindInh=true, didBindInt=false, didBindImp=false, token=Token(CLASS, 'class', 'class', ln 300, col 2, C:\Users\seanm\Desktop\Cobra\NajaNode.cobra), didBindInh=true, isGeneric=false, isGenericDef=false, needsConstruction=false, 6611), typeNode=TypeIdentifier-mi(6612, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(INT, 'int', 'int', ln 301, col 21, C:\Users\seanm\Desktop\Cobra\NajaNode.cobra), name=int, didResolveType=true, 6612), 6613)' Compilation failed - 1 error, 0 warnings >Exit code: 1 This is w/ the latest code in SVN (as of 3/14/2013). The error seems to be around this class: {{{ class Config var bufferSize as int is shared, readonly var traceLogging as bool is shared, readonly cue init is shared .bufferSize = 1024 .traceLogging = false }}} This is a first pass attempt at porting as C# port of Node.js (from a few years back). The original C#: http://newcome.wordpress.com/2010/05/08/node-net-node-js-implemented-in-javascript-on-the-net-runtime/ . Right now, I'm just trying to get it to compile..." torial May 15 2013 Wed 264 False compilation error for complex expression Cobra Compiler 0.8.0 defect Chuck closed Nov 29 2010 "An expression that indexes a list of types, instantiates the type and then invokes a method, fails with a false compilation error: {{{ #!cobra class A def blah print ""A!"" class B def blah print ""B!"" class C def blah print ""C!"" class Program def main myList = [A, B, C] for i, type in myList.numbered # This works: type = myList[i] type().blah # This fails at compile time: myList[i]().blah }}} Reported by Dr_Asik in the forums at http://cobra-language.com/forums/viewtopic.php?f=4&t=699#p3632 " Charles May 15 2013 Wed 189 When method calls have incorrect number of arguments or types, give the method sigs Cobra Compiler 0.8.0 enhancement Chuck closed Nov 6 2009 "Suppose you get this error: error: The method ""invoke"" is expecting 8 arguments, but 3 are being supplied in this call. It would be productive if Cobra displayed the method signature. Don't forget about overloads. Don't forget errors can occur because of typing rather than wrong number. In addition to ""error"" and ""warning"", perhaps we need a 3rd kind of message: ""info"" " Chuck May 14 2013 Tue 215 -test option doesn't handle @args -target:lib Cobra Compiler 0.8.0 defect Chuck closed Jul 12 2010 "{{{ """""" Given the ""@args -target:lib"" below, the command ""cobra foo.cobra"" works as expected. However, ""cobra -test foo.cobra"" gives an error: error: Cannot specify -main if building a module or library So there is a deficiency in the implementation of -test. """""" @args -target:lib class A test a = A() assert a.two == 2 get two as int return 2 }}} " Chuck May 13 2013 Mon 316 Blind Watch Maker 1 Cobra Compiler 0.9.3 defect closed Jan 21 2013 Hi. I'm new to Cobra. I was writing one of the sample programs and I received this error (please see attached). wrechtin May 6 2013 Mon 295 Installer: Cobra.Compiler.dll gets version number 0.0 Cobra Compiler 0.8.0 defect Charles closed Sep 27 2012 "Should be 0.9 (or whatever the current version is). http://cobra-language.com/forums/viewtopic.php?f=4&t=1007#p5150 reported-by:nerdzero " Charles Apr 26 2013 Fri 249 property without type works in cobra, is exposed to C# as object Cobra Compiler 0.8.0 defect closed Aug 23 2010 "{{{ class P get x # Cobra doesn't need 'as bool', and works fine when return 1 > 2 # used from cobra, but when used from C# (gmcs) it complains... # error CS0266: Cannot implicitly convert type 'object' to 'bool' def y as bool # Requires the as bool. return 1 > 3 def main print .x print .y }}} " nevdelap Apr 24 2013 Wed 221 Error message if place whitespace in methodcall between method name and arglist Cobra Compiler 0.8.0 defect Chuck closed Jul 18 2010 "If this is a necessary restriction a better error message would be good, but I don't think it should be restricted this way because it prevents aligning things nicely. {{{ class Program def main a = .someCall (""abc"") and _ .anotherCall(""def"") print a def someCall as bool return true def anotherCall as bool return true }}} test.cobra(4): error: Unexpected call." nevdelap Apr 23 2013 Tue 302 cobra internal error on mixin method collision Cobra Compiler 0.8.0 defect Chuck closed Nov 6 2012 "Error: error: COBRA INTERNAL ERROR / ArgumentException / ”˜‰ˆ ’ Ž”š‡ †„„ …‘“ ‹˜. (generic_project) [[BR]] caused by: two mixins with the same method (method conflict) example: {{{ mixin MixA def sayhello pass mixin MixB def sayhello pass class Hello adds MixA, MixB def main pass }}} " kobi7 Apr 20 2013 Sat 77 Eliminate false 'inherits' warning on 'passthrough' type Cobra Compiler 0.8.0 defect Chuck closed Nov 16 2008 "Get rid of this warning: {{{ ... a inherits B ... warning: The expression (of type ""passthrough"") is never of type ""Foo"". }}} It comes up as part of error recovery, but you can simulate it: {{{ class A def main is shared x as int = 1 to passthrough if x inherits A print 'A' }}} " Chuck Apr 17 2013 Wed 151 incomplete support for vari nilable parameters Cobra Compiler 0.8.0 defect Chuck closed Feb 16 2009 "The following code does not behave as expected: {{{ class Test def takesVari(x as vari String) is shared for y in x print y def takesArray(x as String[]) is shared for y in x print y def main is shared .takesVari(@['hola', nil]) # compiles fine, no runtime assertion .takesArray(@['hola', nil]) # does not even compile }}} The call to ""takesVari"" should have caused a compilation error, just like the [] version does. Cobra accepts the syntax fun(x as vari String?), but the resulting code behaves as if the ""?"" wasn't there at all. " jonathandavid Apr 5 2013 Fri 294 Installer: Fails awkwardly when placed at target directory Cobra Compiler 0.8.0 defect Chuck closed Sep 27 2012 "The target directory for installation is: C:\Cobra\Cobra-0.9.0\ However, a user might actually put the install files there in the first place. Then when the installer goes to do its work, it gets in the way of itself. reported-by:torial Either give a nice error message, or slap an ""-installed"" on the path. " Charles Mar 27 2013 Wed 251 shared constructor wants to initialize instance variables of reference types Cobra Compiler 0.8.0 defect Chuck closed Aug 29 2010 "{{{ class A var isntShared as String cue init base.init .isntShared = '1' shared var isShared as String cue init .isShared = '2' class P def main is shared assert A().isntShared == '1' assert A.isShared == '2' }}} test.cobra(16): error: Cannot access instance member ""isntShared"" from the current shared member. Make the member ""shared"" or create an instance of the type. If the strings are changed to a class the result is the same. If the strings are changed to int, or a struct it is ok. ''Hopefully starting in October I will have time to start fixing bugs instead of just reporting them.''" nevdelap Mar 23 2013 Sat 252 var x = 1 as readonly syntax doesn't work. Cobra Compiler 0.8.0 defect closed Aug 30 2010 "If it should work then the bug report is that it doesn't. If it shouldn't work then the bug report is that the errors it gives indicate something odd going on. {{{ @args -pkg:gtk-sharp-2.0 use Gdk class Colors shared var black as Color is public, readonly var white = Color(255, 255, 255) is public, readonly cue init .black = Color(0, 0, 0) class P def main is shared print Colors.black, Colors.white }}} test2.cobra(10): error: Expecting an expression. ""public"" is a reserved keyword that is not expected here. {{{ var white = Color(255, 255, 255) is readonly }}} test2.cobra(10): error: Cannot find ""readonly"". {{{ var white = Color(255, 255, 255) is readonly, public }}} test2.cobra(10): error: Expecting EOL, but got "","" (COMMA) instead. {{{ var black as Color is readonly var black as Color is readonly, public }}} These are fine." nevdelap Mar 21 2013 Thu 303 static classes unsupported? Cobra Compiler 0.8.0 defect closed Nov 6 2012 "if I set ""is shared"" on class, I get an error. (cannot declare instance members in a static class) {{{ class ConsoleUtils is shared pass }}} the same is true for: {{{ class ConsoleUtils is shared def x is shared pass }}} Is this by design? (the benefit in setting a class static, is that it ensures all other members are static) Thanks alot!" kobi7 Mar 5 2013 Tue 317 float32?[] not compilable as a parameter type Cobra Compiler 0.9.3 defect Chuck closed Feb 19 2013 "[http://cobra-language.com/forums/viewtopic.php?f=4&t=1810#p6339] as you'll see above, nerdzero gives an example and cites the compiler's error message. i'm running: MD 3.0.6, Cobra 0.9.3 on .NET CLR v4.0.30319 on Microsoft Windows NT 6.1.7601 Service Pack 1 i'll leave it to you to set the priority field on this ticket. thanks, charles." DelphiGuy Jan 21 2013 Mon 313 readonly isnames property not listed as a keyword Cobra Compiler 0.8.0 defect closed Jan 15 2013 "'readonly' is listed in validIsNames list in CobraParser:830 but is not also listed in rawSpecs list in !KeywordSpecs.cobra unlike all the other isNames values. Presumably this is just an omission from the late addition support for 'readonly'. No additional failures in test run if make it such a keyword. trivial patch appended. Longer term, valid isNames should be pulled from rawSpecs list rather than internally recorded and used from a different and separate list. Found by didrik [http://cobra-language.com/forums/viewtopic.php?f=4&t=1172&p=5641#p5641 Official Cobra Grammar]" hopscc