From 2d3218c1e1ee97f3cec126770f70d30e37eeedf8 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Tue, 18 Sep 2018 18:41:10 +0200 Subject: [PATCH] Add String to tasty standard definitions --- .../dotty/tools/dotc/tastyreflect/StandardDefinitions.scala | 1 + library/src/scala/tasty/reflect/StandardDefinitions.scala | 3 +++ tests/run/tasty-definitions-1.check | 1 + tests/run/tasty-definitions-1/quoted_1.scala | 1 + 4 files changed, 6 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/tastyreflect/StandardDefinitions.scala b/compiler/src/dotty/tools/dotc/tastyreflect/StandardDefinitions.scala index 00cc6df81ddb..5d148b11d700 100644 --- a/compiler/src/dotty/tools/dotc/tastyreflect/StandardDefinitions.scala +++ b/compiler/src/dotty/tools/dotc/tastyreflect/StandardDefinitions.scala @@ -80,5 +80,6 @@ trait StandardDefinitions extends scala.tasty.reflect.StandardDefinitions { def ObjectType: Type = defn.ObjectType def NothingType: Type = defn.NothingType def NullType: Type = defn.NullType + def StringType: Type = defn.StringType } } diff --git a/library/src/scala/tasty/reflect/StandardDefinitions.scala b/library/src/scala/tasty/reflect/StandardDefinitions.scala index 6426cf9f8324..e707e36da58f 100644 --- a/library/src/scala/tasty/reflect/StandardDefinitions.scala +++ b/library/src/scala/tasty/reflect/StandardDefinitions.scala @@ -212,5 +212,8 @@ trait StandardDefinitions extends TastyCore { /** The type of core type `Null`. */ def NullType: Type + + /** The type for `scala.String`. */ + def StringType: Type } } diff --git a/tests/run/tasty-definitions-1.check b/tests/run/tasty-definitions-1.check index 266244b87d91..507aab21d794 100644 --- a/tests/run/tasty-definitions-1.check +++ b/tests/run/tasty-definitions-1.check @@ -169,3 +169,4 @@ Type.SymRef(, Type.ThisType(Type.SymRef(, NoPrefix()))) Type.SymRef(, Type.ThisType(Type.SymRef(, NoPrefix()))) Type.SymRef(, Type.ThisType(Type.SymRef(, NoPrefix()))) Type.SymRef(, Type.ThisType(Type.SymRef(, NoPrefix()))) +Type.SymRef(, Type.ThisType(Type.SymRef(, NoPrefix()))) diff --git a/tests/run/tasty-definitions-1/quoted_1.scala b/tests/run/tasty-definitions-1/quoted_1.scala index 9f9d0f8e2ce3..f134666dcd03 100644 --- a/tests/run/tasty-definitions-1/quoted_1.scala +++ b/tests/run/tasty-definitions-1/quoted_1.scala @@ -91,6 +91,7 @@ object Macros { printout(definitions.ObjectType.show) printout(definitions.NothingType.show) printout(definitions.NullType.show) + printout(definitions.StringType.show) '(println(~buff.result().mkString("\n").toExpr))