diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-17 17:16:28 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-26 22:54:07 -0700 |
commit | 040c0434d456dd75a174147d8a0c4cab37266ba6 (patch) | |
tree | f5e0dd086c2610d5d56dd9701028e11665ac2671 /test/files/pos/sammy_ctor_arg.scala | |
parent | a2795ba77c0e7b56b0a522eae0cca298af0ac1f1 (diff) | |
download | scala-040c0434d456dd75a174147d8a0c4cab37266ba6.tar.gz scala-040c0434d456dd75a174147d8a0c4cab37266ba6.tar.bz2 scala-040c0434d456dd75a174147d8a0c4cab37266ba6.zip |
More fixes based on feedback by Lukas
Crucially, the fully-defined expected type must be checked for
conformance to the original expected type!!
The logic in adaptToSam that checks whether pt is fully defined
probably needs some more thought. See pos/t8310 for a good test
case. Argument type checking is a challenge, as we first check
against a lenient pt (this lenient expected type has wildcards,
and thus is not fully defined, but we should still consider sam
adaptation a success even if we end up with wildcards for some
unknown type parameters, they should be determined later).
Diffstat (limited to 'test/files/pos/sammy_ctor_arg.scala')
-rw-r--r-- | test/files/pos/sammy_ctor_arg.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/files/pos/sammy_ctor_arg.scala b/test/files/pos/sammy_ctor_arg.scala new file mode 100644 index 0000000000..3c556d59f0 --- /dev/null +++ b/test/files/pos/sammy_ctor_arg.scala @@ -0,0 +1,4 @@ +trait Fun[A, B] { def apply(a: A): B } +// can't do sam expansion until the sam body def is a static method in the sam class, and not a local method in a block' +class C(f: Fun[Int, String]) +class Test extends C(s => "a")
\ No newline at end of file |