aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-12 13:01:28 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:12:28 +0200
commit845b689a4a652fa79a7d0621f5ebe15bbf9225c7 (patch)
treece308233797b8b032b25c8ed29b6663da8742340 /src/dotty/tools/dotc/typer/Namer.scala
parentb559aff35d6d365284fc1e05a3ca49a17551df29 (diff)
downloaddotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.tar.gz
dotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.tar.bz2
dotty-845b689a4a652fa79a7d0621f5ebe15bbf9225c7.zip
Add inline for vals
- allow inline as an alternative to final for vals (final is retained for backwards compatibility for now) - allow inline for parameters - check that rhs of inline value has a constant type - check that arguments to inline value parameters have constant type - check that inline members are not deferred - make inline members effectively final
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index a33061453..2e714ab6d 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -891,7 +891,7 @@ class Namer { typer: Typer =>
// println(s"final inherited for $sym: ${inherited.toString}") !!!
// println(s"owner = ${sym.owner}, decls = ${sym.owner.info.decls.show}")
- def isInline = sym.is(Final, butNot = Method | Mutable)
+ def isInline = sym.is(FinalOrInline, butNot = Method | Mutable)
// Widen rhs type and approximate `|' but keep ConstantTypes if
// definition is inline (i.e. final in Scala2).