diff options
Diffstat (limited to 'test/files/pos/trait_fields_owners.scala')
-rw-r--r-- | test/files/pos/trait_fields_owners.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/pos/trait_fields_owners.scala b/test/files/pos/trait_fields_owners.scala new file mode 100644 index 0000000000..6aa5572171 --- /dev/null +++ b/test/files/pos/trait_fields_owners.scala @@ -0,0 +1,19 @@ +trait V { + // ok + // error: java.lang.IllegalArgumentException: Could not find proxy for val f: Function1 in List(value f, value v, trait V, package <empty>, package <root>) (currentOwner= value <local V$class> ) + val v = { val f = (x: Int) => x + 1; f(2) } + + // ok + // assertion failed: + // Trying to access the this of another class: tree.symbol = trait V, class symbol = object V$class compilation unit: fields.scala + val developmentVersion = + for { + v <- scalaPropOrNone("maven.version.number") + if v endsWith "-SNAPSHOT" + ov <- scalaPropOrNone("version.number") + } yield ov + + def scalaPropOrNone(name: String): Option[String] = ??? +} + +object O extends V
\ No newline at end of file |