mirror of https://github.com/sbt/sbt.git
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. |
||
|---|---|---|
| .. | ||
| API.scala | ||
| Analyzer.scala | ||
| Command.scala | ||
| Compat.scala | ||
| CompilerInterface.scala | ||
| ConsoleInterface.scala | ||
| DelegatingReporter.scala | ||
| Dependency.scala | ||
| ExtractAPI.scala | ||
| ExtractUsedNames.scala | ||
| LocateClassFile.scala | ||
| Log.scala | ||
| Message.scala | ||
| ScaladocInterface.scala | ||