You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Konstantin Ignatyev (JIRA)" <ji...@apache.org> on 2015/09/17 22:09:04 UTC

[jira] [Commented] (GEODE-336) Function extends Identifiable without specifying generics type for Identifiable

    [ https://issues.apache.org/jira/browse/GEODE-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14804399#comment-14804399 ] 

Konstantin Ignatyev commented on GEODE-336:
-------------------------------------------

http://stackoverflow.com/questions/21473614/implementing-multilevel-java-interfaces-in-scala

> Function extends Identifiable without specifying generics type for Identifiable
> -------------------------------------------------------------------------------
>
>                 Key: GEODE-336
>                 URL: https://issues.apache.org/jira/browse/GEODE-336
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Konstantin Ignatyev
>            Priority: Critical
>   Original Estimate: 1m
>  Remaining Estimate: 1m
>
> Function interface is defined as 
> public interface Function extends Identifiable { 
>    public String getId();
> ...}
> but that is not correct because Identifiable requires type parameter 
> public interface Identifiable<T extends Comparable<T>> extends Serializable { 
>    public T getId();
> }
> so when custom function is defined as 
> class SomeFunction extends FunctionAdapter {
>   override def getId:String = "SomeFunction-v1"
> }
> Java compiler tolerates that, but Scala compiler refuses to compile because  because String is not compatible with 'Nothing' that is expected from getId because Function extends Identifiable without specifying type.
> Solution:
> define Function as
> public interface Function extends Identifiable<String> 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)