From 6545606cefaf8ec7090f8a601123bfae61b441a6 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 14 Mar 2017 16:47:55 +0100 Subject: Encode variances in parameter names This leads to a slight overall simplification, harmonizes pickle format with internal representation, and makes MethodTypes and PolyTypes more similar to each other. I believe the change is useful as it is, but in particular it is a useful step for an eventual unification of MethodTypes and PolyTypes. --- compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala') diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala index cb1b56c3c..98577f3c5 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala @@ -151,7 +151,7 @@ Standard-Section: "ASTs" TopLevelStat* BIND Length boundName_NameRef bounds_Type // for type-variables defined in a type pattern BYNAMEtype underlying_Type - POLYtype Length result_Type NamesTypes // variance encoded in front of name: +/-/= + POLYtype Length result_Type NamesTypes // variance encoded in front of name: +/-/(nothing) METHODtype Length result_Type NamesTypes // needed for refinements PARAMtype Length binder_ASTref paramNum_Nat // needed for refinements SHARED type_ASTRef @@ -546,8 +546,4 @@ object TastyFormat { case POLYtype | METHODtype => -1 case _ => 0 } - - /** Map between variances and name prefixes */ - val varianceToPrefix = Map(-1 -> '-', 0 -> '=', 1 -> '+') - val prefixToVariance = Map('-' -> -1, '=' -> 0, '+' -> 1) } -- cgit v1.2.3