import java.util.List;
class IncompleteInfer
{
public <T> List<T> nil() { return null; }
public <T> T getHead(List<T> x) { return null; }
IncompleteInfer()
{
String s = getHead(nil());
}
}
/* error mesasage
IncompleteInfer.java:16: incompatible types
found : java.lang.Object
required: java.lang.String
String s = getHead(nil());
^
1 error
*/
class IncompleteInfer
{
public <T> List<T> nil() { return null; }
public <T> T getHead(List<T> x) { return null; }
IncompleteInfer()
{
String s = getHead(nil());
}
}
/* error mesasage
IncompleteInfer.java:16: incompatible types
found : java.lang.Object
required: java.lang.String
String s = getHead(nil());
^
1 error
*/