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

Key: BOO-974
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Cedric Vivier
Reporter: Spruce Weber
Votes: 0
Watchers: 0
Operations

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

Compiler crashes on same-class instance generic method invocation when self keyword is not used and a non-generic compatible overload exists.

Created: 21/Feb/08 05:07 PM   Updated: 21/Apr/08 08:34 AM
Component/s: Compiler
Affects Version/s: 0.8.1
Fix Version/s: 0.8.2

Time Tracking:
Not Specified

Environment:
Windows XP Sp2
MS .Net 2.0
Issue Links:
Related
 

Testcase included: yes


 Description  « Hide
class Foo:
def Do(param as object):
debug param

def Do[of T](param as T):
debug param

def test():
self.Do[of string]('asdf')

f = Foo()
f.Do[of string]('asdf')
f.test()

In the above code if I remove the reference to self, ie: I replace...
self.Do[of string]('asdf')
with...
Do[of string]('asdf')

The compiler fails with ...

Entering Boo.Lang.Compiler.Steps.EmitAssembly
ASSEMBLY LOADED: <dynamic>test2, Version=1.0.2974.0, Culture=neutral, PublicKeyToken=null
ASSEMBLY LOADED: C:\WINDOWS\assembly\GAC_32\ISymWrapper\2.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll
MyClass.boo(14,22): Internal compiler error on node 'Do[of string]('asdf')': System.NullReferenceException: Object reference not set to an instance of an object.
at Boo.Lang.Compiler.Steps.EmitAssembly.InvokeRegularMethod(IMethod method, MethodInfo mi, MethodInvocationExpression node)
at Boo.Lang.Compiler.Steps.EmitAssembly.InvokeMethod(IMethod method, MethodInvocationExpression node)
at Boo.Lang.Compiler.Steps.EmitAssembly.OnMethodInvocationExpression(MethodInvocationExpression node)
at Boo.Lang.Compiler.Ast.MethodInvocationExpression.Accept(IAstVisitor visitor)
at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
Leaving Boo.Lang.Compiler.Steps.EmitAssembly



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Cedric Vivier - 21/Apr/08 07:02 AM - edited
(removed comment.. my mistake, a non-generic method with same name was indeed needed to trigger the bug)

Fixed in rev. 2928