Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: X10 2.1.0
-
Component/s: None
-
Labels:None
-
Environment:MacOS, trunk
-
Testcase included:yes
-
Number of attachments :
Description
Unzip and compile the attached files.
Java backend:
bucheron-009002089078:bug3 sjfink$ ~/work/x10-trunk/x10.dist/bin/x10c TextOutputFormat.x10
x10c: ----------
1. ERROR in /private/tmp/bug3/TextOutputFormat.java (at line 1)
public class TextOutputFormat<K, V>
^^^^^^^^^^^^^^^^
The type TextOutputFormat<K,V> must implement the inherited abstract method FileOutputFormat<K,V>.getRecordWriter(Job)
----------
2. ERROR in /private/tmp/bug3/TextOutputFormat.java (at line 1)
public class TextOutputFormat<K, V>
^^^^^^^^^^^^^^^^
The type TextOutputFormat<K,V> must implement the inherited abstract method OutputFormat.getRecordWriter(Type, Type, Type, Job, Type)
----------
2 problems (2 errors)
x10c: Non-zero return code: 255
2 errors.
c++ backend:
bucheron-009002089078:bug3 sjfink$ ~/work/x10-trunk/x10.dist/bin/x10c++ TextOutputFormat.x10
/private/tmp/bug3/TextOutputFormat.x10:2-4: method public TextOutputFormat.getRecordWriter[K1,V1,V2](job:Job[K1, V1, K, V2, V]): RecordWriter[K, V] is generic and non-final, disabling virtual binding for this method
x10c++: In file included from /private/tmp/bug3/FileOutputFormat.h:11,
from /private/tmp/bug3/TextOutputFormat.h:8,
from TextOutputFormat.cc:1:
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
In file included from /private/tmp/bug3/TextOutputFormat.h:8,
from TextOutputFormat.cc:1:
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 1 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 2 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 4 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 1 is invalid
In file included from TextOutputFormat.cc:1:
/private/tmp/bug3/TextOutputFormat.h:44: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/TextOutputFormat.h:44: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/TextOutputFormat.h:44: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/TextOutputFormat.h:44: error: template argument 1 is invalid
/private/tmp/bug3/TextOutputFormat.h:44: error: template argument 2 is invalid
/private/tmp/bug3/TextOutputFormat.h:44: error: template argument 4 is invalid
/private/tmp/bug3/TextOutputFormat.h:44: error: template argument 1 is invalid
In file included from OutputFormat.cc:1:
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
In file included from /private/tmp/bug3/FileOutputFormat.h:11,
from FileOutputFormat.cc:1:
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:23: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 2 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 4 is invalid
/private/tmp/bug3/OutputFormat.h:25: error: template argument 1 is invalid
In file included from FileOutputFormat.cc:1:
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__K1' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__V1' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: 'x10__V2' was not declared in this scope
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 1 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 2 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 4 is invalid
/private/tmp/bug3/FileOutputFormat.h:32: error: template argument 1 is invalid
x10c++: Non-zero return code: 1
2 errors.
Issue Links
- depends upon
-
XTENLANG-1880
Java backend produces invalid code for abstract generic methods
-
- relates to
-
XTENLANG-1191
Non-static non-final generic methods not implemented
-
Two separate issues here. The Java backend is not generating a dispatch method, possibly because the frontend or the middle-end does not supply the correct type information. The C++ backend simply cannot handle generic virtual methods, but since it's in an interface, it cannot make them final. So it generates invalid itable initializers.
I will look into the first problem shortly.