Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: X10 2.1.2
-
Fix Version/s: X10 2.3.2
-
Component/s: X10 Compiler: Front-end Constraints
-
Labels:None
-
Environment:SVN Revision: 20648
-
Testcase included:yes
-
Number of attachments :
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
Igor Peshansky
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | X10 2.2 [ 16002 ] | |
| Affects Version/s | X10 2.1.2 [ 16498 ] | |
| Component/s | X10 Compiler: Front-end Constraints [ 14507 ] | |
| Component/s | X10 Compiler: Front-end [ 13471 ] |
Igor Peshansky
made changes -
| Link |
This issue is depended upon by |
Igor Peshansky
made changes -
| Fix Version/s | X10 2.2.1 [ 17131 ] | |
| Fix Version/s | X10 2.2 [ 16002 ] |
Igor Peshansky
made changes -
| Link |
This issue is depended upon by |
David Grove
made changes -
| Summary | What does Ordered interface mean? Another strange error message | Constraints on type parameters in method guards aren't added to the environment used to typecheck the method body |
David Grove
made changes -
| Summary | Constraints on type parameters in method guards aren't added to the environment used to typecheck the method body | Constraints on type parameters in method formals aren't added to the environment used to typecheck the method body |
David Grove
made changes -
| Fix Version/s | X10 2.2.2 [ 17639 ] | |
| Fix Version/s | X10 2.2.1 [ 17131 ] |
David Grove
made changes -
| Fix Version/s | X10 2.2.3 [ 18146 ] | |
| Fix Version/s | X10 2.2.2 [ 17639 ] |
David Grove
made changes -
| Assignee | Igor Peshansky [ ipeshansky ] |
David Grove
made changes -
| Fix Version/s | X10 2.3 [ 17009 ] | |
| Fix Version/s | X10 2.2.3 [ 18146 ] |
David Grove
made changes -
| Fix Version/s | X10 2.3.1 [ 18657 ] | |
| Fix Version/s | X10 2.3 [ 17009 ] |
David Grove
made changes -
| Fix Version/s | X10 2.3.2 [ 19010 ] | |
| Fix Version/s | X10 2.3.1 [ 18657 ] |
This is a bug in propagating type constraints from method arguments into the environment. A workaround for now is to move the type constraint into the method guard, namely: