diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-12-11 12:57:32 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-12-12 08:18:30 +0100 |
commit | a4a892fb0196f2f66d86f9cfa508deabe7d2aaae (patch) | |
tree | f86405ae87fe1ebac37f92bef3a01d94d8075c91 /test/files/neg/names-defaults-neg.check | |
parent | 36b1014ac63205a38e73ae18a05ac6f956c3410f (diff) | |
download | scala-a4a892fb0196f2f66d86f9cfa508deabe7d2aaae.tar.gz scala-a4a892fb0196f2f66d86f9cfa508deabe7d2aaae.tar.bz2 scala-a4a892fb0196f2f66d86f9cfa508deabe7d2aaae.zip |
SI-8841 report named arg / assignment ambiguity also in silent mode.
For local definitions (eg. in a block that is an argument of a method
call), the type completer may have a silent context. A CyclicReference
is then not thrown but transformed into a NormalTypeError. When
deciding if 'x = e' is an assignment or a named arg, we need to report
cyclic references, but not other type errors. In the above case, the
cyclic reference was not reported.
Also makes sure that warnings are printed after typing argument
expressions.
Diffstat (limited to 'test/files/neg/names-defaults-neg.check')
-rw-r--r-- | test/files/neg/names-defaults-neg.check | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 20ddd55f1f..2db24b6f32 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -151,15 +151,15 @@ names-defaults-neg.scala:144: error: variable definition needs type because 'x' names-defaults-neg.scala:147: error: variable definition needs type because 'x' is used as a named argument in its body. object t6 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:147: warning: type-checking the invocation of method f checks if the named argument expression 'x = ...' is a valid assignment -in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for x. +names-defaults-neg.scala:147: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +an explicit type is required for the definition mentioned in the error message above. object t6 { var x = t.f(x = 1) } ^ names-defaults-neg.scala:150: error: variable definition needs type because 'x' is used as a named argument in its body. class t9 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:150: warning: type-checking the invocation of method f checks if the named argument expression 'x = ...' is a valid assignment -in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for x. +names-defaults-neg.scala:150: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +an explicit type is required for the definition mentioned in the error message above. class t9 { var x = t.f(x = 1) } ^ names-defaults-neg.scala:164: error: variable definition needs type because 'x' is used as a named argument in its body. @@ -174,8 +174,8 @@ names-defaults-neg.scala:170: error: reference to x is ambiguous; it is both a m names-defaults-neg.scala:177: error: variable definition needs type because 'x' is used as a named argument in its body. class u15 { var x = u.f(x = 1) } ^ -names-defaults-neg.scala:177: warning: type-checking the invocation of method f checks if the named argument expression 'x = ...' is a valid assignment -in the current scope. The resulting type inference error (see above) can be fixed by providing an explicit type in the local definition for x. +names-defaults-neg.scala:177: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +an explicit type is required for the definition mentioned in the error message above. class u15 { var x = u.f(x = 1) } ^ names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. |