Skip to content
Browse files

Work around a type inference change in javac

The javac compiler's behavior when handling wildcards and "capture" type
variables has been changed in Java 9 [1]. This change allows the code to
be compiled with the latest version of javac.

  • Loading branch information...
cushon committed Jul 23, 2015
1 parent dc6de35 commit 1228616e472732918e73c675da104105f7bc3a9b
Showing with 7 additions and 3 deletions.
  1. +4 −0 AUTHORS
  2. +1 −1 LICENSE
  3. +2 −2 src/main/java/org/pcollections/
@@ -0,0 +1,4 @@
# This is the official list of pcollections authors for copyright purposes.

Harold Cooper
Google Inc.
@@ -1,4 +1,4 @@
Copyright (c) 2008 Harold Cooper
Copyright 2015 The pcollections Authors. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -49,13 +49,13 @@
return (ConsPStack<E>)list; //(actually we only know it's ConsPStack<? extends E>)
// but that's good enough for an immutable
// (i.e. we can't mess someone else up by adding the wrong type to it)
return from(list.iterator());
return ConsPStack.<E>from(list.iterator());

private static <E> ConsPStack<E> from(final Iterator<? extends E> i) {
if(!i.hasNext()) return empty();
E e =;
return from(i).plus(e);
return ConsPStack.<E>from(i).plus(e);

0 comments on commit 1228616

Please sign in to comment.
You can’t perform that action at this time.