Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear type error #917

Closed
JLedelay opened this issue Dec 23, 2022 · 0 comments
Closed

Unclear type error #917

JLedelay opened this issue Dec 23, 2022 · 0 comments
Labels
A-Bug M-log Misc: Error reporting and logging

Comments

@JLedelay
Copy link

The following input:

public class C {
    void m() {
        //@ ghost bag<int>{} + seq<int>{};
        //@ ghost bag<int>{} - 3;
        //@ ghost [t: int] + 1;
        //@ ghost 3 + {t: int};
    }
}

Gives the following output:

======================================
At Test.java:3:19:
--------------------------------------
    1  public class C {
    2      void m() {
                        [-----------------------
    3          //@ ghost bag<int>{} + seq<int>{};
                         -----------------------]
    4          //@ ghost bag<int>{} - 3;
    5          //@ ghost [t: int] + 1;
--------------------------------------
Expected the type of this expression to be Expected both operands to be numeric, a process, a sequence, set, or bag; or a pointer and integer, but got bag<int> and seq<int>., but got any.
======================================

======================================
At Test.java:4:19:
--------------------------------------
    2      void m() {
    3          //@ ghost bag<int>{} + seq<int>{};
                        [--------------
    4          //@ ghost bag<int>{} - 3;
                         --------------]
    5          //@ ghost [t: int] + 1;
    6          //@ ghost 3 + {t: int};
--------------------------------------
Expected the type of this expression to be Expected both operands to be numeric, a set or a bag; or a pointer and integer, but got bag<int> and {3..4}., but got any.
======================================

======================================
At Test.java:5:19:
--------------------------------------
    3          //@ ghost bag<int>{} + seq<int>{};
    4          //@ ghost bag<int>{} - 3;
                        [------------
    5          //@ ghost [t: int] + 1;
                         ------------]
    6          //@ ghost 3 + {t: int};
    7      }
--------------------------------------
Expected the type of this expression to be Expected both operands to be numeric, a process, a sequence, set, or bag; or a pointer and integer, but got seq<int> and {1..2}., but got any.
======================================

======================================
At Test.java:6:19:
--------------------------------------
    4          //@ ghost bag<int>{} - 3;
    5          //@ ghost [t: int] + 1;
                        [------------
    6          //@ ghost 3 + {t: int};
                         ------------]
    7      }
    8  }
--------------------------------------
Expected the type of this expression to be Expected both operands to be numeric, a process, a sequence, set, or bag; or a pointer and integer, but got {3..4} and set<int>., but got rational.
======================================

Looks like two error messages are being combined here.

@pieter-bos pieter-bos added A-Bug M-log Misc: Error reporting and logging labels Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bug M-log Misc: Error reporting and logging
Projects
None yet
Development

No branches or pull requests

2 participants