sbt/compile
Grzegorz Kossakowski a6ae339515 Fix instability of self variable API representation
The reason for instability is a bit tricky so let's unpack what the
previous code checking if there's self type declared was doing. It would
check if `thisSym` of a class is equal to a symbol representing the class.
If that's true, we know that there's no self type. If it's false, then
`thisSym` represents either a self type or a self variable. The second
(type test) was supposed to check whether the type of `thisSym` is
different from a type of the class. However, it would always yield false
because TypeRef of `thisSym` was compared to ClassInfoType of a class.
So if you had a self variable the logic would see a self type (and that's
what API representation would give you).

Now the tricky bit: `thisSym` is not pickled when it's representing just
a self variable because self variable doesn't affect other classes
referring to a class. If you looked at a type after unpickling, the
symbol equality test would yield true and we would not see self type when
just a self variable was declared.

The fix is to check equality of type refs on both side of the type equality
check. This makes the pending test passing.

Also, I added another test that checks if self types are represented in
various combinations of declaring a self variable or/and self type.

Fixes #2504.
2016-03-08 22:24:26 +01:00
..
api Add a pending test for self variable bug (#2504) 2016-03-08 20:42:11 +01:00
inc Merge branch '0.13.10' into wip/0.13.10-merge 2016-02-22 13:19:38 -05:00
integration/src/main/scala/sbt/compiler Do not create dir, if trying to output classes to a jar 2016-02-04 15:11:55 +01:00
interface Fix instability of self variable API representation 2016-03-08 22:24:26 +01:00
ivy/src/main/scala/sbt/compiler Fix deprecation messages 2015-09-04 12:25:59 +02:00
persist Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
src Make sbt aware of Dotty 2016-01-03 20:35:29 +01:00
NOTICE - Stuart's improvements to triggered execution 2010-07-05 12:53:37 -04:00