Special diagnostics when no type arguments passed on teh right-hand side of 'is' expression

Example:

if (a is Map) // ERROR: Say 'Map<*, *>' if you don't want to pass type arguments
This commit is contained in:
Andrey Breslav
2012-11-27 13:50:00 +04:00
parent 1378f836f5
commit dff5f382ab
7 changed files with 77 additions and 3 deletions
@@ -0,0 +1,16 @@
package p
public fun foo(a: Any) {
a is Map<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!>
a is <!NO_TYPE_ARGUMENTS_ON_RHS_OF_IS_EXPRESSION!>Map<!>
a is Map<out Any?, Any?>
a is Map<*, *>
a is Map<<!SYNTAX!><!>>
a is <!CANNOT_CHECK_FOR_ERASED!>List<<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Map<!>><!>
a is <!NO_TYPE_ARGUMENTS_ON_RHS_OF_IS_EXPRESSION!>List<!>
a is Int
(a <!USELESS_CAST!>as<!> <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Map<!>) is Int
}