More Typing Problems

Ming-Yee Iu mingyeeiu+lambda at
Mon Sep 6 14:39:25 PDT 2010

I'm having more problems with getting my code to type properly. The
following piece of code does not compile due to typing problems:

public class Test
   public static class Customer {
      public String getName() { return "";}
   public abstract static class StringSorter<U> {
      abstract String value(U val);
   public static interface Select<U, V> {
      public V select(U val);
   public static class DBSet<T>  {
      public <U> DBSet<U> select(Select<T,U> x) {return new DBSet<U>();}
      public DBSet<T> sortedByStringAscending(StringSorter<T> x) {return this;}

   public static DBSet<Customer> allCustomer()
      return new DBSet<Customer>();

   public static void main(String[] args)
      DBSet<String> result = allCustomer()
//; result = result    // if you uncomment this line, then it compiles fine

But if I uncomment the 4th line from the bottom, it then compiles fine.


More information about the lambda-dev mailing list