Boo
  1. Boo
  2. BOO-1064

Overriden explicit interface implementation crashes compiler

    Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.8.2
    • Fix Version/s: 0.9.3
    • Component/s: Compiler
    • Labels:
      None
    • Environment:
      Windows XP, under both boo 8.2 and svn
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      """
      B
      """
      
      interface I:
      	def Foo()
      
      class A(I):
      	def I.Foo():
      		print "A"
      
      class B(A):
      	def I.Foo():
      		print "B"
      
      b = B()
      (b as I).Foo()
      

      Does not matter if B also derives from I.

      Output:

      test.boo(22,3): BCE0055: Boo.Lang.Compiler.CompilerError: Internal compiler error: entities. ---> System.ArgumentException: entities
      at Boo.Lang.Compiler.TypeSystem.Ambiguous..ctor(IEntity[] entities)
      at Boo.Lang.Compiler.TypeSystem.Ambiguous..ctor(IList entities)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ResolveAmbiguousReferenceByAccessibility(Ambiguous candidates)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ResolveAmbiguousReference(ReferenceExpression node, Ambiguous candidates)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ProcessMemberReferenceExpression(MemberReferenceExpression node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.LeaveMemberReferenceExpression(MemberReferenceExpression node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnMemberReferenceExpression(MemberReferenceExpression node)
      at Boo.Lang.Compiler.Ast.MemberReferenceExpression.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      — End of inner exception stack trace —
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnError(Node node, Exception error)
      at Boo.Lang.Compiler.Steps.AbstractVisitorCompilerStep.OnError(Node node, Exception error)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.OnMethodInvocationExpression(MethodInvocationExpression node)
      at Boo.Lang.Compiler.Ast.MethodInvocationExpression.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnExpressionStatement(ExpressionStatement node)
      at Boo.Lang.Compiler.Ast.ExpressionStatement.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection`1 collection)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnBlock(Block node)
      at Boo.Lang.Compiler.Ast.Block.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ProcessNodeInMethodContext(InternalMethod entity, INamespace ns, Node node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ProcessMethodBody(InternalMethod entity, INamespace ns)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ProcessMethodBody(InternalMethod entity)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.ProcessRegularMethod(Method node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.OnMethod(Method method)
      at Boo.Lang.Compiler.Ast.Method.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection`1 collection)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.VisitTypeDefinition(TypeDefinition node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.OnClassDefinition(ClassDefinition node)
      at Boo.Lang.Compiler.Ast.ClassDefinition.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection`1 collection)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.OnModule(Module module)
      at Boo.Lang.Compiler.Ast.Module.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node[] array)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit[T](NodeCollection`1 collection)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.OnCompileUnit(CompileUnit node)
      at Boo.Lang.Compiler.Ast.CompileUnit.Accept(IAstVisitor visitor)
      at Boo.Lang.Compiler.Ast.DepthFirstVisitor.Visit(Node node)
      at Boo.Lang.Compiler.Steps.ProcessMethodBodies.Run()
      at Boo.Lang.Compiler.CompilerPipeline.RunStep(CompilerContext context, ICompilerStep step)

      Probably related to BOO-1023 and perhaps BOO-1055.

      1. BOO-1064.patch
        1.0 kB
        Greg Nagel
      2. log.txt
        13 kB
        Dmitry Malyshev

        Activity

        Hide
        Greg Nagel added a comment -

        Turns out it doesn't have anything to do with the others; just some control code which assumed that Assumption() could take an empty list.

        Patch attached; passes all the standard tests and this new one.

        Show
        Greg Nagel added a comment - Turns out it doesn't have anything to do with the others; just some control code which assumed that Assumption() could take an empty list. Patch attached; passes all the standard tests and this new one.
        Hide
        Greg Nagel added a comment -

        Er, the version is wrong. I was thinking the assemblies in /bin were 8.2 for some reason. All these tests are done under r3010.

        Show
        Greg Nagel added a comment - Er, the version is wrong. I was thinking the assemblies in /bin were 8.2 for some reason. All these tests are done under r3010.
        Hide
        Cedric Vivier added a comment -

        Above still cannot compile on trunk, but fails in EmitAssembly instead (no MethodInfo attached to the B).
        It works though if B explicitely says it implements I (which was not the case originally).

        Show
        Cedric Vivier added a comment - Above still cannot compile on trunk, but fails in EmitAssembly instead (no MethodInfo attached to the B). It works though if B explicitely says it implements I (which was not the case originally).
        Hide
        Rodrigo B. de Oliveira added a comment -

        Fixed in trunk.

        Show
        Rodrigo B. de Oliveira added a comment - Fixed in trunk.
        Hide
        Dmitry Malyshev added a comment -

        If in the last line try to call "b.Foo()" directly the compiler crashes.

        Show
        Dmitry Malyshev added a comment - If in the last line try to call "b.Foo()" directly the compiler crashes.
        Hide
        Dmitry Malyshev added a comment -

        -vvv log of internal compiler error on "b.Foo()" call

        Show
        Dmitry Malyshev added a comment - -vvv log of internal compiler error on "b.Foo()" call

          People

          • Assignee:
            Rodrigo B. de Oliveira
            Reporter:
            Greg Nagel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: