diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-02-07 09:14:42 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-02-11 19:18:29 +0100 |
commit | 07bcb6176ac7836e81ec7c849e1140126bb6b327 (patch) | |
tree | d6c87a73514d89050f36e1d883670e35299949a8 /src/reflect | |
parent | bebd62d5665b9166c1a44b3bcdc01287220a30b7 (diff) | |
download | scala-07bcb6176ac7836e81ec7c849e1140126bb6b327.tar.gz scala-07bcb6176ac7836e81ec7c849e1140126bb6b327.tar.bz2 scala-07bcb6176ac7836e81ec7c849e1140126bb6b327.zip |
SI-7045 reflection now auto-initializes selfType
selfType joins the happy family of flags, annotations and privateWithin,
which automatically trigger initialization, when used within runtime
reflection.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 004f7d176a..df17e3b751 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -91,10 +91,14 @@ trait Symbols extends api.Symbols { self: SymbolTable => children } + def selfType = { + if (!isCompilerUniverse && needsInitialize(isFlagRelated = false, mask = 0)) initialize + typeOfThis + } + def baseClasses = info.baseClasses def module = sourceModule def thisPrefix: Type = thisType - def selfType: Type = typeOfThis def typeSignature: Type = { fullyInitializeSymbol(this); info } def typeSignatureIn(site: Type): Type = { fullyInitializeSymbol(this); site memberInfo this } |