X10
  1. X10
  2. XTENLANG-2541

Constraints on type parameters in method formals aren't added to the environment used to typecheck the method body

    Details

    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      Compiling

      import x10.util.Ordered;
      public class LessIsMore{
         static def doIt[T](a: T{T <: Ordered[T]}) {
            return a < a;
         }
      }
      

      yields

      LessIsMore.x10:4: No valid method call found for call in given type.    
           	 Call: operator<(T, T)    
           	 Type: x10.lang.Any
      

      Can you explain what this error message means? I thought that T<:Ordered[T] meant "T implements Ordered[T]"
      and therefore (since "<" is in that interface) I ought to be able to use it.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jonathan Brezin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: