Skip to content

Commit fafa45b

Browse files
committed
Hide TASTy tags encoding from outside tasty package
1 parent 96bea13 commit fafa45b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

compiler/src/dotty/tools/dotc/core/tasty/Attributes.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
package dotty.tools.dotc.core.tasty
22

3-
import dotty.tools.tasty.TastyFormat
3+
import dotty.tools.tasty.TastyFormat.*
44

55
import scala.collection.immutable.BitSet
66

7-
class Attributes(
8-
val booleanTags: BitSet,
7+
class Attributes private[tasty](
8+
private[tasty] val booleanTags: BitSet,
99
) {
10-
def scala2StandardLibrary: Boolean =
11-
booleanTags.contains(TastyFormat.SCALA2STANDARDLIBRARYattr)
12-
def explicitNulls: Boolean =
13-
booleanTags.contains(TastyFormat.EXPLICITNULLSattr)
10+
def scala2StandardLibrary: Boolean = booleanTags(SCALA2STANDARDLIBRARYattr)
11+
def explicitNulls: Boolean = booleanTags(EXPLICITNULLSattr)
1412
}
1513

1614
object Attributes:
@@ -19,8 +17,8 @@ object Attributes:
1917
explicitNulls: Boolean,
2018
): Attributes =
2119
val booleanTags = BitSet.newBuilder
22-
if scala2StandardLibrary then booleanTags += TastyFormat.SCALA2STANDARDLIBRARYattr
23-
if explicitNulls then booleanTags += TastyFormat.EXPLICITNULLSattr
20+
if scala2StandardLibrary then booleanTags += SCALA2STANDARDLIBRARYattr
21+
if explicitNulls then booleanTags += EXPLICITNULLSattr
2422
new Attributes(booleanTags.result())
2523
end apply
2624

0 commit comments

Comments
 (0)