Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

name clash ceylon backend error #7437

Open
MikhailMalyutin opened this issue Nov 21, 2018 · 0 comments
Open

name clash ceylon backend error #7437

MikhailMalyutin opened this issue Nov 21, 2018 · 0 comments

Comments

@MikhailMalyutin
Copy link
Contributor

Next code:

@FunctionalInterface
public
interface BiIntPredicate<T> {
    boolean test(T t, int u);
}

@FunctionalInterface
public
interface BiIntFunction<T, R> {
    R apply(T t, int u);
}

shared BiIntPredicate<T> toBiIntPredicate<T>(Boolean(T, Integer) fn) given T satisfies Object {
    return object satisfies BiIntPredicate<T>  {
        shared actual Boolean test(T t, Integer u) {
            return fn(t, u);
        }
    };
}

shared BiIntFunction<T, R> toBiIntFunction<T, R>(R(T, Integer) fn) given T satisfies Object given R satisfies Object {
    return object satisfies BiIntFunction<T, R> {
        shared actual R apply(T t, Integer u) {
            return fn(t, u);
        }
    };
}

Ceylon IDE shows no problems.

But after ceylon compile we see:

error: Ceylon backend error: name clash: test(T#1,int) in anonymous_0_ and test(T#2,int) in BiIntPredicate have the same erasure, yet neither overrides the other
        shared actual Boolean test(T t, Integer u) {
               ^
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>toBiIntPredicate(TypeDescriptor,Callable<? extends Boolean>)
    T#2 extends Object declared in interface BiIntPredicate
source/problemcode.ceylon:15: error: Ceylon backend error: name clash: apply(T#1,int) in anonymous_1_ and apply(T#2,int) in BiIntFunction have the same erasure, yet neither overrides the other
        shared actual R apply(T t, Integer u) {
               ^
  where T#1,R#1,T#2,R#2 are type-variables:
    T#1 extends Object declared in method <T#1,R#1>toBiIntFunction(TypeDescriptor,TypeDescriptor,Callable<? extends R#1>)
    R#1 extends Object declared in method <T#1,R#1>toBiIntFunction(TypeDescriptor,TypeDescriptor,Callable<? extends R#1>)
    T#2 extends Object declared in interface BiIntFunction
    R#2 extends Object declared in interface BiIntFunction
2 errors
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant