blob: cbb90b52c23836627a27dfc0c8c21ef8d259b7fa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
Type in expressions to have them evaluated.
Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
** :phase has been set to 'typer'. **
** scala.tools.nsc._ has been imported **
** global._, definitions._ also imported **
** Try :help, :vals, power.<tab> **
scala> val u = rootMirror.universe
u: $r.intp.global.type = <global>
scala> import u._, scala.reflect.internal.Flags
import u._
import scala.reflect.internal.Flags
scala> class C
defined class C
scala> val sym = u.typeOf[C].typeSymbol
sym: u.Symbol = class C
scala> sym.isContravariant
res0: Boolean = false
scala> sym setFlag Flags.INCONSTRUCTOR
res1: sym.type = class C
scala> sym.isClassLocalToConstructor
res2: Boolean = true
scala> sym.isContravariant // was true
res3: Boolean = false
scala> :quit
|