Skip to content

Error equality without matching types #162

Description

@mgudemann

For the following program

public class NullPointer5
{
  void f()
  {
    Object o = new Object();
    if(null == o)
      assert false;
    assert true;
  }
  void g()
  {
    Object o = new Object();
    if(o == null)
      assert false;
    assert true;
  }
}

the result of checking --function NullPointer5.g is ok, while --function NullPointer.f fails with the above error.

The same error is triggered with --function Inheritance3.f in

class Inheritance3
{
  class A
  {
  }
  class B extends A
  {
  }
  void f()
  {
    A a = new A();
    B b = new B();
    if(a == b)
      assert false;
    assert true;
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions