Ticket #40 (closed defect: fixed)
Bug in partial classes and overloaded method handling
Reported by: | hopscc | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
Theres a new or just uncovered bug related to partial classes and overloaded method handling - Just noticed it occurring since breakout of sharpGenerator code. Havent done any more tracing of it than that.
If you build the cobra compiler then run that compiler on the cobra source you get a RequireException? in Members.cobra:1715.
This line is in a require clause - if comment it out temp get another failure further on...
Heres the first page of the emitted output
Unhandled Exception: Cobra.Lang.RequireException: sourceSite = C:\home\hops\src\cobra\wkspace1\Source\Members.cobra:1715 in MemberOverload.addMember for object MemberOverload-sh(94802, name=writeSharpDefInContext, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(DEF, 'def', 'def', ln 15, col 2, SharpGenerator.cobra), name=writeSharpDefInContext, isNames=[], numMembers=1, box=Class-mi(80235, name=Expr, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(ID, 'Expr', 'Expr', ln 21, col 7, Expr.cobra), didBindInh=false, isGeneric=false, isGenericDef=false, needsConstruction=false, 80235), 94802) info = nil this = MemberOverload-de(94802, name=writeSharpDefInContext, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(DEF, 'def', 'def', ln 15, col 2, SharpGenerator.cobra), name=writeSharpDefInContext, isNames=[], numMembers=1, box=Class-mi(80235, name=Expr, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(ID, 'Expr', 'Expr', ln 21, col 7, Expr.cobra), didBindInh=false, isGeneric=false, isGenericDef=false, needsConstruction=false, 80235), docString=nil, members=['Method'-'sh'(94588, 'name'='writeSharpDefInContext', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('DEF', ''def'', ''def'', ln 15, col 2, 'SharpGenerator.cobra')', 'name'='writeSharpDefInContext', 'isNames'=[], 'box'=''Class'-'mi'(80235, 'name'='Expr', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('ID', ''Expr'', ''Expr'', ln 21, col 7, 'Expr.cobra')', 'didBindInh'=false, 'isGeneric'=false, 'isGenericDef'=false, 'needsConstruction'=false, 80235)', 'returnTypeNode'=''VoidType'-'mi'(5263, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false)', 'returnType'=nil, 'implementsType'=nil, 94588)], 94802) (member.overloadGroup is nil) = false member.overloadGroup = MemberOverload-de(94594, name=writeSharpDefInContext, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(DEF, 'def', 'def', ln 15, col 2, SharpGenerator.cobra), name=writeSharpDefInContext, isNames=[], numMembers=2, box=Class-mi(94585, name=Expr, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(ID, 'Expr', 'Expr', ln 12, col 7, SharpGenerator.cobra), didBindInh=false, isGeneric=false, isGenericDef=false, needsConstruction=false, 94585), docString=nil, members=['Method'-'sh'(94588, 'name'='writeSharpDefInContext', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('DEF', ''def'', ''def'', ln 15, col 2, 'SharpGenerator.cobra')', 'name'='writeSharpDefInContext', 'isNames'=[], 'box'=''Class'-'mi'(80235, 'name'='Expr', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('ID', ''Expr'', ''Expr'', ln 21, col 7, 'Expr.cobra')', 'didBindInh'=false, 'isGeneric'=false, 'isGenericDef'=false, 'needsConstruction'=false, 80235)', 'returnTypeNode'=''VoidType'-'mi'(5263, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false)', 'returnType'=nil, 'implementsType'=nil, 94588), 'Method'-'sh'(94599, 'name'='writeSharpDefInContext', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('DEF', ''def'', ''def'', ln 18, col 2, 'SharpGenerator.cobra')', 'name'='writeSharpDefInContext', 'isNames'=[], 'box'=''Class'-'mi'(94585, 'name'='Expr', 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('ID', ''Expr'', ''Expr'', ln 12, col 7, 'SharpGenerator.cobra')', 'didBindInh'=false, 'isGeneric'=false, 'isGenericDef'=false, 'needsConstruction'=false, 94585)', 'returnTypeNode'=''VoidType'-'mi'(5263, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false)', 'returnType'=nil, 'implementsType'=nil, 94599)], 94594) member = Method-de(94599, name=writeSharpDefInContext, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(DEF, 'def', 'def', ln 18, col 2, SharpGenerator.cobra), name=writeSharpDefInContext, isNames=[], box=Class-mi(94585, name=Expr, didBindInh=false, didBindInt=false, didBindImp=false, token=Token(ID, 'Expr', 'Expr', ln 12, col 7, SharpGenerator.cobra), didBindInh=false, isGeneric=false, isGenericDef=false, needsConstruction=false, 94585), returnTypeNode=VoidType-mi(5263, didBindInh=false, didBindInt=false, didBindImp=false), returnType=nil, implementsType=nil, docString= When an expression is used where a particular type is expected, such as: # assignment x = y # argument passing obj.foo(x, y) obj[x, y] it may need C# typecasting--particularly if it is dynamic typed expression. This method relies on having had its .contextType set beforehand. This method should be invoked instead of `writeSharpDef` in any situation where .contextType was set. , params=['Param'(94596, "'sw'" ('ID'), 'sw', '(no type)'), 'Param'(94598, "'parens'" ('ID'), 'parens', '(no type)')], requirePart=nil, ensurePart=nil, locals=[], stmts=['AssignExpr'-'sh'(94604, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('ASSIGN', ''='', ''='', ln 30, col 8, 'SharpGenerator.cobra')', 'type'=nil, 'definition'=nil, 94604), 'AssignExpr'-'sh'(94607, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('ASSIGN', ''='', ''='', ln 31, col 8, 'SharpGenerator.cobra')', 'type'=nil, 'definition'=nil, 94607), 'IfStmt'-'sh'(94634, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('IF', ''if'', ''if'', ln 32, col 3, 'SharpGenerator.cobra')', 94634), 'IfStmt'-'sh'(94653, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('IF', ''if'', ''if'', ln 37, col 3, 'SharpGenerator.cobra')', 94653), 'DotExpr'-'sh'(94657, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('DOT', ''.'', ''.'', ln 40, col 3, 'SharpGenerator.cobra')', 'type'=nil, 'definition'=nil, 94657), 'IfStmt'-'sh'(94671, 'didBindInh'=false, 'didBindInt'=false, 'didBindImp'=false, 'token'=''Token'('IF', ''if'', ''if'', ln 41, col 3, 'SharpGenerator.cobra')', 94671)], genericParams=[], 94599) at MemberOverload.AddMember(BoxMember member) in c:\home\hops\src\cobra\wkspace1\Source\Members.cobra:line 1714 at Parser._nameSpaceAddDecl(NameSpace ns, INameSpaceMember decl) in c:\home\hops\src\cobra\wkspace1\Source\CobraParser.cobra:line 1054 at Parser._parseTokens() in c:\home\hops\src\cobra\wkspace1\Source\CobraParser.cobra:line 529 at Parser.ParseSource(String fileName, String source) in c:\home\hops\src\cobra\wkspace1\Source\CobraParser.cobra:line 173 at Parser.ParseFileNamed(String fileName) in c:\home\hops\src\cobra\wkspace1\Source\CobraParser.cobra:line 157 at Compiler.ParseFilesNamed(IList`1 filenames) in c:\home\hops\src\cobra\wkspace1\Source\Compiler.cobra:line 385 at Compiler._compileFilesNamed(IList`1 paths, Boolean writeTestInvocation, Boolean stopAfterBindInt) in c:\home\hops\src\cobra\wkspace1\Source\Compiler.cobra:line 266 at Compiler.CompileFilesNamed(IList`1 paths, Boolean writeTestInvocation, Boolean stopAfterBindInt) in c:\home\hops\src\cobra\wkspace1\Source\Compiler.cobra:
Change History
Note: See
TracTickets for help on using
tickets.