File tree 1 file changed +24
-1
lines changed
tasty/src/dotty/tools/tasty
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ object TastyFormat {
254
254
val MajorVersion : Int = 18
255
255
val MinorVersion : Int = 0
256
256
257
- /** Tags used to serialize names */
257
+ /** Tags used to serialize names, should update [[ nameTagToString ]] if a new constant is added */
258
258
class NameTags {
259
259
final val UTF8 = 1 // A simple name in UTF8 encoding.
260
260
@@ -286,6 +286,29 @@ object TastyFormat {
286
286
}
287
287
object NameTags extends NameTags
288
288
289
+ /** Should be kept in sync with [[NameTags ]]. Converts constants to a String representing their identifier,
290
+ * or NotANameTag(tag) if unrecognised.
291
+ *
292
+ * For debugging purposes when unpickling names in a TASTy file.
293
+ */
294
+ def nameTagToString (tag : Int ) = {
295
+ import NameTags ._
296
+ tag match {
297
+ case UTF8 => " UTF8"
298
+ case QUALIFIED => " QUALIFIED"
299
+ case EXPANDED => " EXPANDED"
300
+ case EXPANDPREFIX => " EXPANDPREFIX"
301
+ case UNIQUE => " UNIQUE"
302
+ case DEFAULTGETTER => " DEFAULTGETTER"
303
+ case VARIANT => " VARIANT"
304
+ case SUPERACCESSOR => " SUPERACCESSOR"
305
+ case INLINEACCESSOR => " INLINEACCESSOR"
306
+ case OBJECTCLASS => " OBJECTCLASS"
307
+ case SIGNED => " SIGNED"
308
+ case id => s " NotANameTag( $id) "
309
+ }
310
+ }
311
+
289
312
// Position header
290
313
291
314
final val SOURCE = 4
You can’t perform that action at this time.
0 commit comments