Skip to content

CSEC: isSubtype does not handle primitives properly #77

@mattcce

Description

@mattcce

The following code:

class C {
    public void r(String s) {
        
    }
    
    public void r(int s) {
        
    }
    
    public static void main(String[] args) {
        String s = "test";
        C c = new C();
        
        c.r(s);
    }
}

breaks with the error RuntimeError: Class String not declared.

The error occurs during overloading resolution; and is because isSubtype does not handle primitives properly at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions