sbt/compile/interface/src/main/scala/xsbt
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.scala Avoid CCE when scalac internally uses compileLate. Fixes #2452 2016-02-11 16:29:09 -05:00
Analyzer.scala Avoid CCE when scalac internally uses compileLate. Fixes #2452 2016-02-11 16:29:09 -05:00
Command.scala added scalariform 2014-05-01 12:50:07 -04:00
Compat.scala ExtractAPI: avoid unnecessary duplication of defs with primitive types 2016-01-25 02:53:52 +01:00
CompilerInterface.scala Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
ConsoleInterface.scala Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
DelegatingReporter.scala Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
Dependency.scala Avoid CCE when scalac internally uses compileLate. Fixes #2452 2016-02-11 16:29:09 -05:00
ExtractAPI.scala Fix instability of self variable API representation 2016-03-08 22:24:26 +01:00
ExtractUsedNames.scala Port fix for #1544 from Dependency to ExtractUsedNames 2014-10-03 22:01:49 +02:00
LocateClassFile.scala added scalariform 2014-05-01 12:50:07 -04:00
Log.scala added scalariform 2014-05-01 12:50:07 -04:00
Message.scala added scalariform 2014-05-01 12:50:07 -04:00
ScaladocInterface.scala Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00