diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 9fe4707cf39..8aa2ca6e52b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -149,7 +149,6 @@ public interface Errors { DiagnosticFactory0 SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR); - DiagnosticFactory0 DEPRECATED_TRAIT_KEYWORD = DiagnosticFactory0.create(WARNING); DiagnosticFactory0 DELEGATION_NOT_TO_TRAIT = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 SUPERTYPE_NOT_A_CLASS_OR_TRAIT = DiagnosticFactory0.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 766b8373268..1cceb09ed64 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -280,7 +280,6 @@ public class DefaultErrorMessages { MAP.put(DELEGATION_IN_TRAIT, "Interfaces cannot use delegation"); MAP.put(DELEGATION_NOT_TO_TRAIT, "Only interfaces can be delegated to"); - MAP.put(DEPRECATED_TRAIT_KEYWORD, "'trait' keyword is deprecated, use 'interface' instead"); MAP.put(NO_CONSTRUCTOR, "This class does not have a constructor"); MAP.put(NOT_A_CLASS, "Not a class"); MAP.put(ILLEGAL_ESCAPE_SEQUENCE, "Illegal escape sequence"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java b/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java index 7974b75d717..c6834a0f59d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/lexer/JetTokens.java @@ -72,7 +72,6 @@ public interface JetTokens { JetKeywordToken WHILE_KEYWORD = JetKeywordToken.keyword("while"); JetKeywordToken DO_KEYWORD = JetKeywordToken.keyword("do"); JetKeywordToken WHEN_KEYWORD = JetKeywordToken.keyword("when"); - JetKeywordToken TRAIT_KEYWORD = JetKeywordToken.keyword("trait"); JetKeywordToken INTERFACE_KEYWORD = JetKeywordToken.keyword("interface"); // TODO: Discuss "This" keyword JetKeywordToken CAPITALIZED_THIS_KEYWORD = JetKeywordToken.keyword("This"); @@ -178,7 +177,7 @@ public interface JetTokens { JetModifierKeywordToken ANNOTATION_KEYWORD = JetModifierKeywordToken.softKeywordModifier("annotation"); JetModifierKeywordToken CROSSINLINE_KEYWORD = JetModifierKeywordToken.softKeywordModifier("crossinline"); - TokenSet KEYWORDS = TokenSet.create(PACKAGE_KEYWORD, AS_KEYWORD, TYPE_ALIAS_KEYWORD, CLASS_KEYWORD, TRAIT_KEYWORD, INTERFACE_KEYWORD, + TokenSet KEYWORDS = TokenSet.create(PACKAGE_KEYWORD, AS_KEYWORD, TYPE_ALIAS_KEYWORD, CLASS_KEYWORD, INTERFACE_KEYWORD, THIS_KEYWORD, SUPER_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, NULL_KEYWORD, TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex b/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex index a662d793286..6f29e124056 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex +++ b/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex @@ -249,7 +249,6 @@ LONG_TEMPLATE_ENTRY_START=\$\{ "while" { return JetTokens.WHILE_KEYWORD ;} "break" { return JetTokens.BREAK_KEYWORD ;} "class" { return JetTokens.CLASS_KEYWORD ;} -"trait" { return JetTokens.TRAIT_KEYWORD ;} "throw" { return JetTokens.THROW_KEYWORD ;} "false" { return JetTokens.FALSE_KEYWORD ;} "super" { return JetTokens.SUPER_KEYWORD ;} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/lexer/_JetLexer.java b/compiler/frontend/src/org/jetbrains/kotlin/lexer/_JetLexer.java index 722ea89c079..d7489d986ed 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/lexer/_JetLexer.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/lexer/_JetLexer.java @@ -1,4 +1,4 @@ -/* The following code was generated by JFlex 1.4.3 on 4/29/15 4:44 PM */ +/* The following code was generated by JFlex 1.4.3 on 9/18/15 3:17 PM */ package org.jetbrains.kotlin.lexer; @@ -14,7 +14,7 @@ import org.jetbrains.kotlin.lexer.JetTokens; /** * This class is a scanner generated by * JFlex 1.4.3 - * on 4/29/15 4:44 PM from the specification file + * on 9/18/15 3:17 PM from the specification file * /Users/yole/jetbrains/kotlin/compiler/frontend/src/org/jetbrains/kotlin/lexer/Kotlin.flex */ class _JetLexer implements FlexLexer { @@ -136,17 +136,16 @@ class _JetLexer implements FlexLexer { "\1\70\1\71\1\72\1\73\1\74\1\75\1\76\1\77"+ "\1\0\1\100\2\101\2\0\1\40\1\102\1\103\1\0"+ "\1\104\1\44\1\3\1\0\1\105\1\106\1\107\1\110"+ - "\1\0\1\2\2\0\1\111\4\3\1\112\5\3\1\113"+ + "\1\0\1\2\2\0\1\111\4\3\1\112\4\3\1\113"+ "\2\3\1\114\1\3\1\115\7\3\1\116\1\117\1\120"+ "\2\0\1\121\2\40\1\45\1\122\1\123\2\44\1\0"+ - "\1\124\2\3\1\125\4\3\1\126\1\127\7\3\1\130"+ - "\1\131\1\77\1\0\1\132\1\133\1\3\1\134\1\3"+ - "\1\135\2\3\1\136\1\137\2\3\1\140\1\141\1\0"+ - "\3\3\1\142\1\3\1\143\2\3\1\144\3\3\1\145"+ - "\1\146\1\147"; + "\1\124\2\3\1\125\3\3\1\126\1\127\7\3\1\130"+ + "\1\131\1\77\1\0\1\132\1\133\2\3\1\134\2\3"+ + "\1\135\1\136\2\3\1\137\1\140\1\0\3\3\1\141"+ + "\1\3\1\142\2\3\1\143\3\3\1\144\1\145\1\146"; private static int [] zzUnpackAction() { - int [] result = new int[240]; + int [] result = new int[237]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -191,19 +190,19 @@ class _JetLexer implements FlexLexer { "\0\u018c\0\u018c\0\u1944\0\u018c\0\u1986\0\u018c\0\u19c8\0\u1a0a"+ "\0\u1a4c\0\u1a4c\0\u018c\0\u1a8e\0\u1ad0\0\u1b12\0\u1b54\0\u018c"+ "\0\u1b96\0\u1bd8\0\u1c1a\0\u1c5c\0\u0210\0\u1c9e\0\u1ce0\0\u1d22"+ - "\0\u1d64\0\u1da6\0\u018c\0\u1de8\0\u1e2a\0\u0210\0\u1e6c\0\u0210"+ - "\0\u1eae\0\u1ef0\0\u1f32\0\u1f74\0\u1fb6\0\u1ff8\0\u203a\0\u0210"+ - "\0\u0210\0\u018c\0\u207c\0\u20be\0\u187e\0\u018c\0\u2100\0\u018c"+ - "\0\u018c\0\u018c\0\u2142\0\u2184\0\u2184\0\u0210\0\u21c6\0\u2208"+ - "\0\u0210\0\u224a\0\u228c\0\u22ce\0\u2310\0\u0210\0\u0210\0\u2352"+ - "\0\u2394\0\u23d6\0\u2418\0\u245a\0\u249c\0\u24de\0\u0210\0\u0210"+ - "\0\u018c\0\u2520\0\u0ca2\0\u0210\0\u2562\0\u0210\0\u25a4\0\u0210"+ - "\0\u25e6\0\u2628\0\u0210\0\u0210\0\u266a\0\u26ac\0\u0210\0\u0210"+ - "\0\u26ee\0\u2730\0\u2772\0\u27b4\0\u0210\0\u27f6\0\u0210\0\u2838"+ - "\0\u287a\0\u0210\0\u28bc\0\u28fe\0\u2940\0\u0210\0\u0210\0\u0210"; + "\0\u1d64\0\u018c\0\u1da6\0\u1de8\0\u0210\0\u1e2a\0\u0210\0\u1e6c"+ + "\0\u1eae\0\u1ef0\0\u1f32\0\u1f74\0\u1fb6\0\u1ff8\0\u0210\0\u0210"+ + "\0\u018c\0\u203a\0\u207c\0\u187e\0\u018c\0\u20be\0\u018c\0\u018c"+ + "\0\u018c\0\u2100\0\u2142\0\u2142\0\u0210\0\u2184\0\u21c6\0\u0210"+ + "\0\u2208\0\u224a\0\u228c\0\u0210\0\u0210\0\u22ce\0\u2310\0\u2352"+ + "\0\u2394\0\u23d6\0\u2418\0\u245a\0\u0210\0\u0210\0\u018c\0\u249c"+ + "\0\u0ca2\0\u0210\0\u24de\0\u2520\0\u0210\0\u2562\0\u25a4\0\u0210"+ + "\0\u0210\0\u25e6\0\u2628\0\u0210\0\u0210\0\u266a\0\u26ac\0\u26ee"+ + "\0\u2730\0\u0210\0\u2772\0\u0210\0\u27b4\0\u27f6\0\u0210\0\u2838"+ + "\0\u287a\0\u28bc\0\u0210\0\u0210\0\u0210"; private static int [] zzUnpackRowMap() { - int [] result = new int[240]; + int [] result = new int[237]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -330,181 +329,177 @@ class _JetLexer implements FlexLexer { "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ "\2\0\4\11\2\0\1\11\1\233\20\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\234\2\0\4\11\2\0\1\235\2\11\1\236"+ - "\16\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ - "\2\11\1\0\1\11\2\0\1\11\2\0\1\237\3\11"+ + "\2\0\1\234\2\0\4\11\2\0\1\235\21\11\21\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\1\236\3\11\2\0\22\11"+ + "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ + "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\1\11"+ + "\1\237\20\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ + "\2\0\10\11\1\240\11\11\21\0\2\11\1\0\2\11"+ + "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ + "\2\0\3\11\1\241\2\0\22\11\21\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\4\11\2\0\22\11\1\0\1\242\17\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\4\11\2\0\4\11\1\243"+ + "\15\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\1\244\3\11"+ "\2\0\22\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ - "\2\0\1\11\1\240\20\11\21\0\2\11\1\0\2\11"+ + "\2\0\5\11\1\245\14\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\10\11\1\241\11\11\21\0\2\11"+ + "\2\0\4\11\2\0\4\11\1\246\15\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\3\11\1\242\2\0\22\11\21\0"+ - "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\4\11\2\0\22\11\1\0"+ - "\1\243\17\0\2\11\1\0\2\11\6\0\4\11\1\0"+ - "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ - "\4\11\1\244\15\11\21\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\1\245\3\11\2\0\22\11\21\0\2\11\1\0\2\11"+ - "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\5\11\1\246\14\11\21\0\2\11"+ - "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\4\11\2\0\4\11\1\247\15\11"+ + "\2\0\1\11\2\0\4\11\2\0\6\11\1\247\13\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\6\11"+ - "\1\250\13\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\3\11"+ + "\1\250\16\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ - "\2\0\3\11\1\251\16\11\21\0\2\11\1\0\2\11"+ + "\2\0\5\11\1\251\14\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\5\11\1\252\14\11\21\0\2\11"+ + "\2\0\4\11\2\0\15\11\1\252\4\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\4\11\2\0\15\11\1\253\4\11"+ + "\2\0\1\11\2\0\4\11\2\0\2\11\1\253\17\11"+ + "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ + "\1\0\1\11\2\0\1\11\2\0\2\11\1\254\1\11"+ + "\2\0\2\11\1\255\17\11\21\0\2\11\1\0\2\11"+ + "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ + "\2\0\2\11\1\256\1\11\2\0\22\11\21\0\2\11"+ + "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ + "\2\0\1\11\2\0\4\11\2\0\4\11\1\257\1\11"+ + "\1\260\13\11\102\0\1\261\20\0\2\201\1\0\2\201"+ + "\6\0\4\201\1\0\2\201\1\0\1\201\2\0\1\201"+ + "\2\0\4\201\2\0\22\201\20\0\6\262\2\0\72\262"+ + "\1\0\2\263\11\0\1\263\1\0\1\263\2\0\2\263"+ + "\17\0\2\263\3\0\2\263\3\0\1\263\4\0\1\263"+ + "\50\0\1\264\51\0\6\207\1\265\1\0\72\207\1\0"+ + "\2\77\1\0\2\77\6\0\4\77\1\0\2\77\1\0"+ + "\1\77\2\0\1\77\2\0\2\77\1\266\1\77\2\0"+ + "\22\77\40\0\1\214\62\0\1\215\12\0\1\215\4\0"+ + "\1\111\25\0\1\111\32\0\6\217\1\267\1\0\72\217"+ + "\11\0\1\270\71\0\2\271\1\0\2\271\6\0\4\271"+ + "\1\0\2\271\1\0\1\271\2\0\1\271\2\0\4\271"+ + "\2\0\22\271\21\0\1\127\12\0\1\127\105\0\1\213"+ + "\3\0\1\227\14\0\1\227\41\0\2\272\11\0\1\272"+ + "\1\0\1\272\1\0\1\214\2\272\17\0\2\272\3\0"+ + "\2\272\3\0\1\272\4\0\1\272\21\0\1\273\12\0"+ + "\1\273\6\0\1\274\40\0\1\274\16\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\3\11\1\275\2\0\22\11\21\0\2\11"+ + "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ + "\2\0\1\11\2\0\4\11\2\0\11\11\1\276\10\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\254\17\11\21\0\2\11\1\0\2\11\6\0\4\11"+ - "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\2\11"+ - "\1\255\1\11\2\0\2\11\1\256\17\11\21\0\2\11"+ - "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\2\11\1\257\1\11\2\0\22\11"+ - "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\4\11"+ - "\1\260\1\11\1\261\13\11\102\0\1\262\20\0\2\201"+ - "\1\0\2\201\6\0\4\201\1\0\2\201\1\0\1\201"+ - "\2\0\1\201\2\0\4\201\2\0\22\201\20\0\6\263"+ - "\2\0\72\263\1\0\2\264\11\0\1\264\1\0\1\264"+ - "\2\0\2\264\17\0\2\264\3\0\2\264\3\0\1\264"+ - "\4\0\1\264\50\0\1\265\51\0\6\207\1\266\1\0"+ - "\72\207\1\0\2\77\1\0\2\77\6\0\4\77\1\0"+ - "\2\77\1\0\1\77\2\0\1\77\2\0\2\77\1\267"+ - "\1\77\2\0\22\77\40\0\1\214\62\0\1\215\12\0"+ - "\1\215\4\0\1\111\25\0\1\111\32\0\6\217\1\270"+ - "\1\0\72\217\11\0\1\271\71\0\2\272\1\0\2\272"+ - "\6\0\4\272\1\0\2\272\1\0\1\272\2\0\1\272"+ - "\2\0\4\272\2\0\22\272\21\0\1\127\12\0\1\127"+ - "\105\0\1\213\3\0\1\227\14\0\1\227\41\0\2\273"+ - "\11\0\1\273\1\0\1\273\1\0\1\214\2\273\17\0"+ - "\2\273\3\0\2\273\3\0\1\273\4\0\1\273\21\0"+ - "\1\274\12\0\1\274\6\0\1\275\40\0\1\275\16\0"+ - "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\3\11\1\276\2\0\22\11"+ - "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\11\11"+ - "\1\277\10\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\277\17\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ "\2\0\2\11\1\300\17\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ "\2\0\4\11\2\0\2\11\1\301\17\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\2\11\1\302\1\11\2\0\22\11"+ + "\2\0\1\11\2\0\4\11\2\0\2\11\1\302\17\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\303\17\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\12\11"+ + "\1\303\7\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ "\2\0\2\11\1\304\17\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\12\11\1\305\7\11\21\0\2\11"+ + "\2\0\4\11\2\0\4\11\1\305\15\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\4\11\2\0\2\11\1\306\17\11"+ - "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\4\11"+ - "\1\307\15\11\21\0\2\11\1\0\2\11\6\0\4\11"+ - "\1\0\2\11\1\0\1\11\2\0\1\310\2\0\4\11"+ - "\2\0\22\11\21\0\2\11\1\0\2\11\6\0\4\11"+ - "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\3\11"+ - "\1\311\2\0\22\11\21\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\3\11\1\312\2\0\22\11\21\0\2\11\1\0\2\11"+ - "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\1\313\3\11\2\0\22\11\21\0\2\11\1\0"+ - "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\4\11\2\0\2\11\1\314\17\11\21\0"+ + "\2\0\1\306\2\0\4\11\2\0\22\11\21\0\2\11"+ + "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ + "\2\0\1\11\2\0\3\11\1\307\2\0\22\11\21\0"+ "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\4\11\2\0\3\11\1\315"+ + "\1\11\2\0\1\11\2\0\3\11\1\310\2\0\22\11"+ + "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ + "\1\0\1\11\2\0\1\11\2\0\1\311\3\11\2\0"+ + "\22\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ + "\2\11\1\312\17\11\21\0\2\11\1\0\2\11\6\0"+ + "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ + "\4\11\2\0\3\11\1\313\16\11\21\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\4\11\2\0\4\11\1\314\15\11\21\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\4\11\2\0\5\11\1\315"+ + "\14\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\3\11\1\316"+ + "\2\0\22\11\20\0\6\262\1\317\1\0\72\262\1\0"+ + "\2\320\11\0\1\320\1\0\1\320\2\0\2\320\17\0"+ + "\2\320\3\0\2\320\3\0\1\320\4\0\1\320\21\0"+ + "\2\77\1\0\2\77\6\0\4\77\1\0\2\77\1\0"+ + "\1\77\2\0\1\77\2\0\3\77\1\321\2\0\22\77"+ + "\21\0\2\272\11\0\1\272\1\0\1\272\2\0\2\272"+ + "\1\0\1\227\14\0\1\227\2\272\3\0\2\272\3\0"+ + "\1\272\4\0\1\272\21\0\1\273\12\0\1\273\66\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\4\11\2\0\16\11\1\322"+ + "\3\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ + "\3\11\1\323\16\11\21\0\2\11\1\0\2\11\6\0"+ + "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ + "\4\11\2\0\6\11\1\324\13\11\21\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\4\11\2\0\6\11\1\325\13\11\21\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\4\11\2\0\3\11\1\326"+ "\16\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ - "\4\11\1\316\15\11\21\0\2\11\1\0\2\11\6\0"+ + "\6\11\1\327\13\11\21\0\2\11\1\0\2\11\6\0"+ "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\4\11\2\0\5\11\1\317\14\11\21\0\2\11\1\0"+ + "\4\11\2\0\2\11\1\330\17\11\21\0\2\11\1\0"+ "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\3\11\1\320\2\0\22\11\20\0\6\263"+ - "\1\321\1\0\72\263\1\0\2\322\11\0\1\322\1\0"+ - "\1\322\2\0\2\322\17\0\2\322\3\0\2\322\3\0"+ - "\1\322\4\0\1\322\21\0\2\77\1\0\2\77\6\0"+ - "\4\77\1\0\2\77\1\0\1\77\2\0\1\77\2\0"+ - "\3\77\1\323\2\0\22\77\21\0\2\273\11\0\1\273"+ - "\1\0\1\273\2\0\2\273\1\0\1\227\14\0\1\227"+ - "\2\273\3\0\2\273\3\0\1\273\4\0\1\273\21\0"+ - "\1\274\12\0\1\274\66\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\4\11\2\0\16\11\1\324\3\11\21\0\2\11\1\0"+ - "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\4\11\2\0\3\11\1\325\16\11\21\0"+ - "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\1\326\3\11\2\0\22\11"+ + "\1\11\2\0\3\11\1\331\2\0\22\11\21\0\2\11"+ + "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ + "\2\0\1\11\2\0\2\11\1\332\1\11\2\0\22\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\6\11"+ - "\1\327\13\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\10\11"+ + "\1\333\11\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ - "\2\0\6\11\1\330\13\11\21\0\2\11\1\0\2\11"+ + "\2\0\12\11\1\334\7\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\3\11\1\331\16\11\21\0\2\11"+ + "\2\0\4\11\2\0\2\11\1\335\17\11\21\0\2\336"+ + "\11\0\1\336\1\0\1\336\2\0\2\336\17\0\2\336"+ + "\3\0\2\336\3\0\1\336\4\0\1\336\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\4\11\2\0\6\11\1\332\13\11"+ + "\2\0\1\11\2\0\4\11\2\0\4\11\1\337\15\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\333\17\11\21\0\2\11\1\0\2\11\6\0\4\11"+ - "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\3\11"+ - "\1\334\2\0\22\11\21\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\2\11\1\335\1\11\2\0\22\11\21\0\2\11\1\0"+ - "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\4\11\2\0\10\11\1\336\11\11\21\0"+ - "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\4\11\2\0\12\11\1\337"+ - "\7\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ - "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ - "\2\11\1\340\17\11\21\0\2\341\11\0\1\341\1\0"+ - "\1\341\2\0\2\341\17\0\2\341\3\0\2\341\3\0"+ - "\1\341\4\0\1\341\21\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\4\11\2\0\4\11\1\342\15\11\21\0\2\11\1\0"+ - "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\4\11\2\0\7\11\1\343\12\11\21\0"+ - "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ - "\1\11\2\0\1\11\2\0\4\11\2\0\13\11\1\344"+ - "\6\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ - "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ - "\5\11\1\345\14\11\21\0\2\11\1\0\2\11\6\0"+ - "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\4\11\2\0\5\11\1\346\14\11\21\0\2\11\1\0"+ - "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ - "\1\11\2\0\1\347\3\11\2\0\22\11\21\0\2\204"+ - "\11\0\1\204\1\0\1\204\2\0\2\204\17\0\2\204"+ - "\3\0\2\204\3\0\1\204\4\0\1\204\21\0\2\11"+ - "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\2\11\1\350\1\11\2\0\22\11"+ - "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\3\11"+ - "\1\351\16\11\21\0\2\11\1\0\2\11\6\0\4\11"+ + "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\7\11"+ + "\1\340\12\11\21\0\2\11\1\0\2\11\6\0\4\11"+ "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\4\11"+ - "\2\0\2\11\1\352\17\11\21\0\2\11\1\0\2\11"+ - "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\353"+ - "\2\0\4\11\2\0\22\11\21\0\2\11\1\0\2\11"+ + "\2\0\13\11\1\341\6\11\21\0\2\11\1\0\2\11"+ "\6\0\4\11\1\0\2\11\1\0\1\11\2\0\1\11"+ - "\2\0\4\11\2\0\3\11\1\354\16\11\21\0\2\11"+ + "\2\0\4\11\2\0\5\11\1\342\14\11\21\0\2\11"+ "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ - "\2\0\1\11\2\0\4\11\2\0\10\11\1\355\11\11"+ + "\2\0\1\11\2\0\4\11\2\0\5\11\1\343\14\11"+ "\21\0\2\11\1\0\2\11\6\0\4\11\1\0\2\11"+ - "\1\0\1\11\2\0\1\11\2\0\4\11\2\0\2\11"+ - "\1\356\17\11\21\0\2\11\1\0\2\11\6\0\4\11"+ - "\1\0\2\11\1\0\1\11\2\0\1\11\2\0\3\11"+ - "\1\357\2\0\22\11\21\0\2\11\1\0\2\11\6\0"+ + "\1\0\1\11\2\0\1\11\2\0\1\344\3\11\2\0"+ + "\22\11\21\0\2\204\11\0\1\204\1\0\1\204\2\0"+ + "\2\204\17\0\2\204\3\0\2\204\3\0\1\204\4\0"+ + "\1\204\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\2\11\1\345"+ + "\1\11\2\0\22\11\21\0\2\11\1\0\2\11\6\0"+ "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ - "\4\11\2\0\2\11\1\360\17\11\20\0"; + "\4\11\2\0\3\11\1\346\16\11\21\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\4\11\2\0\2\11\1\347\17\11\21\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\350\2\0\4\11\2\0\22\11\21\0"+ + "\2\11\1\0\2\11\6\0\4\11\1\0\2\11\1\0"+ + "\1\11\2\0\1\11\2\0\4\11\2\0\3\11\1\351"+ + "\16\11\21\0\2\11\1\0\2\11\6\0\4\11\1\0"+ + "\2\11\1\0\1\11\2\0\1\11\2\0\4\11\2\0"+ + "\10\11\1\352\11\11\21\0\2\11\1\0\2\11\6\0"+ + "\4\11\1\0\2\11\1\0\1\11\2\0\1\11\2\0"+ + "\4\11\2\0\2\11\1\353\17\11\21\0\2\11\1\0"+ + "\2\11\6\0\4\11\1\0\2\11\1\0\1\11\2\0"+ + "\1\11\2\0\3\11\1\354\2\0\22\11\21\0\2\11"+ + "\1\0\2\11\6\0\4\11\1\0\2\11\1\0\1\11"+ + "\2\0\1\11\2\0\4\11\2\0\2\11\1\355\17\11"+ + "\20\0"; private static int [] zzUnpackTrans() { - int [] result = new int[10626]; + int [] result = new int[10494]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -552,12 +547,12 @@ class _JetLexer implements FlexLexer { "\5\11\1\1\1\0\7\1\1\11\21\1\11\11\1\1"+ "\1\0\2\11\1\1\2\0\1\1\2\11\1\0\1\11"+ "\1\1\1\11\1\0\3\1\1\11\1\0\1\1\2\0"+ - "\1\11\12\1\1\11\16\1\1\11\2\0\1\1\1\11"+ - "\1\1\3\11\2\1\1\0\23\1\1\11\1\0\16\1"+ + "\1\11\11\1\1\11\16\1\1\11\2\0\1\1\1\11"+ + "\1\1\3\11\2\1\1\0\22\1\1\11\1\0\15\1"+ "\1\0\17\1"; private static int [] zzUnpackAttribute() { - int [] result = new int[240]; + int [] result = new int[237]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -904,34 +899,34 @@ class _JetLexer implements FlexLexer { zzMarkedPos = zzMarkedPosL; switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 102: + case 101: { return JetTokens.TYPE_ALIAS_KEYWORD ; } - case 104: break; + case 103: break; case 3: { return JetTokens.IDENTIFIER; } - case 105: break; + case 104: break; case 11: { pushState(STRING); return JetTokens.OPEN_QUOTE; } - case 106: break; + case 105: break; case 77: { return JetTokens.FOR_KEYWORD ; } - case 107: break; - case 98: + case 106: break; + case 97: { return JetTokens.RETURN_KEYWORD ; } - case 108: break; - case 103: + case 107: break; + case 102: { return JetTokens.INTERFACE_KEYWORD ; } - case 109: break; + case 108: break; case 87: { return JetTokens.NULL_KEYWORD ; } - case 110: break; + case 109: break; case 35: { if (lBraceCount == 0) { popState(); @@ -940,155 +935,155 @@ class _JetLexer implements FlexLexer { lBraceCount--; return JetTokens.RBRACE; } - case 111: break; + case 110: break; case 18: { return JetTokens.LT ; } - case 112: break; + case 111: break; case 52: { return JetTokens.DO_KEYWORD ; } - case 113: break; + case 112: break; case 17: { return JetTokens.PLUS ; } - case 114: break; + case 113: break; case 55: { return JetTokens.PLUSEQ ; } - case 115: break; + case 114: break; case 90: { popState(); return JetTokens.THIS_KEYWORD; } - case 116: break; + case 115: break; case 27: { return JetTokens.COMMA ; } - case 117: break; + case 116: break; case 19: { return JetTokens.GT ; } - case 118: break; + case 117: break; case 4: { return JetTokens.WHITE_SPACE; } - case 119: break; + case 118: break; case 25: { return JetTokens.RPAR ; } - case 120: break; + case 119: break; case 54: { return JetTokens.DOUBLE_ARROW; } - case 121: break; + case 120: break; case 85: { return JetTokens.TRUE_KEYWORD ; } - case 122: break; + case 121: break; case 37: { return JetTokens.FIELD_IDENTIFIER; } - case 123: break; + case 122: break; case 59: { return JetTokens.ANDAND ; } - case 124: break; + case 123: break; case 64: { pushState(LONG_TEMPLATE_ENTRY); return JetTokens.LONG_TEMPLATE_ENTRY_START; } - case 125: break; + case 124: break; case 36: { return JetTokens.FLOAT_LITERAL; } - case 126: break; + case 125: break; case 38: { return JetTokens.EOL_COMMENT; } - case 127: break; + case 126: break; case 88: { return JetTokens.WHEN_KEYWORD ; } - case 128: break; + case 127: break; case 73: { pushState(RAW_STRING); return JetTokens.OPEN_QUOTE; } - case 129: break; + case 128: break; case 21: { return JetTokens.COLON ; } - case 130: break; + case 129: break; case 57: { return JetTokens.LTEQ ; } - case 131: break; + case 130: break; case 46: { return JetTokens.ARROW ; } - case 132: break; + case 131: break; case 32: { popState(); return JetTokens.IDENTIFIER; } - case 133: break; + case 132: break; case 22: { return JetTokens.LBRACKET ; } - case 134: break; + case 133: break; case 68: { yypushback(2); return JetTokens.INTEGER_LITERAL; } - case 135: break; + case 134: break; case 10: { return JetTokens.CHARACTER_LITERAL; } - case 136: break; + case 135: break; case 79: { return JetTokens.VAR_KEYWORD ; } - case 137: break; + case 136: break; case 58: { return JetTokens.GTEQ ; } - case 138: break; + case 137: break; case 2: { return JetTokens.INTEGER_LITERAL; } - case 139: break; + case 138: break; case 13: { return JetTokens.RBRACE ; } - case 140: break; - case 95: + case 139: break; + case 94: { return JetTokens.CLASS_KEYWORD ; } - case 141: break; + case 140: break; case 74: { return JetTokens.TRY_KEYWORD ; } - case 142: break; + case 141: break; case 7: { return JetTokens.EXCL ; } - case 143: break; + case 142: break; case 42: { return JetTokens.EXCLEQ ; } - case 144: break; + case 143: break; case 45: { return JetTokens.MINUSEQ ; } - case 145: break; - case 100: + case 144: break; + case 99: { return JetTokens.PACKAGE_KEYWORD ; } - case 146: break; + case 145: break; case 91: { return JetTokens.THROW_KEYWORD ; } - case 147: break; - case 93: + case 146: break; + case 92: { return JetTokens.SUPER_KEYWORD ; } - case 148: break; + case 147: break; case 67: { if (commentDepth > 0) { commentDepth--; @@ -1100,27 +1095,27 @@ class _JetLexer implements FlexLexer { return commentStateToTokenType(state); } } - case 149: break; - case 97: + case 148: break; + case 96: { return JetTokens.WHILE_KEYWORD ; } - case 150: break; + case 149: break; case 44: { return JetTokens.MINUSMINUS; } - case 151: break; - case 101: + case 150: break; + case 100: { return JetTokens.CONTINUE_KEYWORD ; } - case 152: break; + case 151: break; case 71: { return JetTokens.NOT_IN; } - case 153: break; + case 152: break; case 5: { return JetTokens.DIV ; } - case 154: break; + case 153: break; case 81: { int length = yytext().length(); if (length <= 3) { // closing """ @@ -1132,181 +1127,181 @@ class _JetLexer implements FlexLexer { return JetTokens.REGULAR_STRING_PART; } } - case 155: break; + case 154: break; case 29: { return JetTokens.REGULAR_STRING_PART; } - case 156: break; + case 155: break; case 16: { return JetTokens.QUEST ; } - case 157: break; + case 156: break; case 69: { pushState(DOC_COMMENT); commentDepth = 0; commentStart = getTokenStart(); } - case 158: break; + case 157: break; case 60: { return JetTokens.OROR ; } - case 159: break; + case 158: break; case 20: { return JetTokens.PERC ; } - case 160: break; + case 159: break; case 72: { return JetTokens.EXCLEQEQEQ; } - case 161: break; + case 160: break; case 61: { return JetTokens.PERCEQ ; } - case 162: break; + case 161: break; case 43: { return JetTokens.RANGE ; } - case 163: break; + case 162: break; case 1: { return TokenType.BAD_CHARACTER; } - case 164: break; + case 163: break; case 63: { pushState(SHORT_TEMPLATE_ENTRY); yypushback(yylength() - 1); return JetTokens.SHORT_TEMPLATE_ENTRY_START; } - case 165: break; + case 164: break; case 70: { return JetTokens.NOT_IS; } - case 166: break; + case 165: break; case 14: { return JetTokens.MUL ; } - case 167: break; + case 166: break; case 23: { return JetTokens.RBRACKET ; } - case 168: break; + case 167: break; case 56: { return JetTokens.PLUSPLUS ; } - case 169: break; + case 168: break; case 39: { pushState(BLOCK_COMMENT); commentDepth = 0; commentStart = getTokenStart(); } - case 170: break; + case 169: break; case 84: { return JetTokens.THIS_KEYWORD ; } - case 171: break; + case 170: break; case 8: { return JetTokens.DOT ; } - case 172: break; + case 171: break; case 26: { return JetTokens.SEMICOLON ; } - case 173: break; + case 172: break; case 49: { return JetTokens.IF_KEYWORD ; } - case 174: break; + case 173: break; case 65: { return JetTokens.ESCAPE_SEQUENCE; } - case 175: break; + case 174: break; case 31: { popState(); return JetTokens.CLOSING_QUOTE; } - case 176: break; + case 175: break; case 15: { return JetTokens.EQ ; } - case 177: break; + case 176: break; case 28: { return JetTokens.AT ; } - case 178: break; + case 177: break; case 75: { return JetTokens.AS_SAFE; } - case 179: break; + case 178: break; case 24: { return JetTokens.LPAR ; } - case 180: break; + case 179: break; case 9: { return JetTokens.MINUS ; } - case 181: break; - case 94: + case 180: break; + case 93: { return JetTokens.FALSE_KEYWORD ; } - case 182: break; + case 181: break; case 66: { commentDepth++; } - case 183: break; + case 182: break; case 76: { return JetTokens.FUN_KEYWORD ; } - case 184: break; + case 183: break; case 47: { return JetTokens.IS_KEYWORD ; } - case 185: break; + case 184: break; case 30: { popState(); yypushback(1); return JetTokens.DANGLING_NEWLINE; } - case 186: break; + case 185: break; case 34: { lBraceCount++; return JetTokens.LBRACE; } - case 187: break; + case 186: break; case 83: { yypushback(3); return JetTokens.EXCL; } - case 188: break; + case 187: break; case 40: { return JetTokens.DIVEQ ; } - case 189: break; + case 188: break; case 86: { return JetTokens.ELSE_KEYWORD ; } - case 190: break; + case 189: break; case 51: { return JetTokens.AS_KEYWORD ; } - case 191: break; + case 190: break; case 48: { return JetTokens.IN_KEYWORD ; } - case 192: break; + case 191: break; case 53: { return JetTokens.EQEQ ; } - case 193: break; + case 192: break; case 80: { return JetTokens.EQEQEQ ; } - case 194: break; + case 193: break; case 78: { return JetTokens.VAL_KEYWORD ; } - case 195: break; + case 194: break; case 89: { return JetTokens.CAPITALIZED_THIS_KEYWORD ; } - case 196: break; + case 195: break; case 50: { return JetTokens.MULTEQ ; } - case 197: break; + case 196: break; case 41: { if (zzCurrentPos == 0) { return JetTokens.SHEBANG_COMMENT; @@ -1316,39 +1311,35 @@ class _JetLexer implements FlexLexer { return JetTokens.HASH; } } - case 198: break; + case 197: break; case 12: { return JetTokens.LBRACE ; } - case 199: break; - case 99: + case 198: break; + case 98: { return JetTokens.OBJECT_KEYWORD ; } - case 200: break; - case 96: + case 199: break; + case 95: { return JetTokens.BREAK_KEYWORD ; } - case 201: break; + case 200: break; case 82: { return JetTokens.BLOCK_COMMENT; } - case 202: break; - case 92: - { return JetTokens.TRAIT_KEYWORD ; - } - case 203: break; + case 201: break; case 62: { return JetTokens.COLONCOLON; } - case 204: break; + case 202: break; case 33: { } - case 205: break; + case 203: break; case 6: { return JetTokens.HASH ; } - case 206: break; + case 204: break; default: if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { zzAtEOF = true; @@ -1360,14 +1351,14 @@ class _JetLexer implements FlexLexer { zzStartRead = commentStart; return commentStateToTokenType(state); } - case 241: break; + case 238: break; case DOC_COMMENT: { int state = yystate(); popState(); zzStartRead = commentStart; return commentStateToTokenType(state); } - case 242: break; + case 239: break; default: return null; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java index b91fb01d414..cc51bc7ca41 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetExpressionParsing.java @@ -54,7 +54,7 @@ public class JetExpressionParsing extends AbstractJetParsing { private static final TokenSet TYPE_ARGUMENT_LIST_STOPPERS = TokenSet.create( INTEGER_LITERAL, FLOAT_LITERAL, CHARACTER_LITERAL, OPEN_QUOTE, - PACKAGE_KEYWORD, AS_KEYWORD, TYPE_ALIAS_KEYWORD, TRAIT_KEYWORD, INTERFACE_KEYWORD, CLASS_KEYWORD, THIS_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, + PACKAGE_KEYWORD, AS_KEYWORD, TYPE_ALIAS_KEYWORD, INTERFACE_KEYWORD, CLASS_KEYWORD, THIS_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, FUN_KEYWORD, FOR_KEYWORD, NULL_KEYWORD, TRUE_KEYWORD, FALSE_KEYWORD, IS_KEYWORD, THROW_KEYWORD, RETURN_KEYWORD, BREAK_KEYWORD, CONTINUE_KEYWORD, OBJECT_KEYWORD, IF_KEYWORD, TRY_KEYWORD, ELSE_KEYWORD, WHILE_KEYWORD, DO_KEYWORD, @@ -119,7 +119,6 @@ public class JetExpressionParsing extends AbstractJetParsing { // declaration FUN_KEYWORD, VAL_KEYWORD, VAR_KEYWORD, - TRAIT_KEYWORD, INTERFACE_KEYWORD, CLASS_KEYWORD, TYPE_ALIAS_KEYWORD @@ -1367,7 +1366,7 @@ public class JetExpressionParsing extends AbstractJetParsing { private IElementType parseLocalDeclarationRest(boolean isEnum) { IElementType keywordToken = tt(); IElementType declType = null; - if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD || keywordToken == INTERFACE_KEYWORD) { + if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { declType = myJetParsing.parseClass(isEnum, LOCAL); } else if (keywordToken == FUN_KEYWORD) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java index 41a5c0d8759..fb104b1b112 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/JetParsing.java @@ -46,7 +46,7 @@ public class JetParsing extends AbstractJetParsing { } private static final TokenSet TOP_LEVEL_DECLARATION_FIRST = TokenSet.create( - TYPE_ALIAS_KEYWORD, TRAIT_KEYWORD, INTERFACE_KEYWORD, CLASS_KEYWORD, OBJECT_KEYWORD, + TYPE_ALIAS_KEYWORD, INTERFACE_KEYWORD, CLASS_KEYWORD, OBJECT_KEYWORD, FUN_KEYWORD, VAL_KEYWORD, PACKAGE_KEYWORD); private static final TokenSet DECLARATION_FIRST = TokenSet.orSet(TOP_LEVEL_DECLARATION_FIRST, TokenSet.create(INIT_KEYWORD, GET_KEYWORD, SET_KEYWORD, CONSTRUCTOR_KEYWORD)); @@ -399,7 +399,7 @@ public class JetParsing extends AbstractJetParsing { // declType = parsePackageBlock(); // } // else - if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD || keywordToken == INTERFACE_KEYWORD) { + if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { declType = parseClass(detector.isEnumDetected(), TOP_LEVEL); } else if (keywordToken == FUN_KEYWORD) { @@ -774,9 +774,9 @@ public class JetParsing extends AbstractJetParsing { assert _at(OBJECT_KEYWORD); } else { - assert _atSet(CLASS_KEYWORD, TRAIT_KEYWORD, INTERFACE_KEYWORD); + assert _atSet(CLASS_KEYWORD, INTERFACE_KEYWORD); } - advance(); // CLASS_KEYWORD, TRAIT_KEYWORD or OBJECT_KEYWORD + advance(); // CLASS_KEYWORD, INTERFACE_KEYWORD or OBJECT_KEYWORD if (nameParsingMode == NameParsingMode.REQUIRED) { OptionalMarker marker = new OptionalMarker(object); @@ -1068,7 +1068,7 @@ public class JetParsing extends AbstractJetParsing { private IElementType parseMemberDeclarationRest(boolean isEnum, boolean isDefault) { IElementType keywordToken = tt(); IElementType declType = null; - if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD || keywordToken == INTERFACE_KEYWORD) { + if (keywordToken == CLASS_KEYWORD || keywordToken == INTERFACE_KEYWORD) { declType = parseClass(isEnum, CLASS_MEMBER); } else if (keywordToken == FUN_KEYWORD) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.kt index 192cf9ba0ca..d5b1a79ff84 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/JetClass.kt @@ -41,8 +41,7 @@ public open class JetClass : JetClassOrObject { public fun getProperties(): List = getBody()?.getProperties().orEmpty() public fun isInterface(): Boolean = - getStub()?.isInterface() - ?: (findChildByType(JetTokens.TRAIT_KEYWORD) != null || findChildByType(JetTokens.INTERFACE_KEYWORD) != null) + getStub()?.isInterface() ?: (findChildByType(JetTokens.INTERFACE_KEYWORD) != null) public fun isEnum(): Boolean = hasModifier(JetTokens.ENUM_KEYWORD) public fun isSealed(): Boolean = hasModifier(JetTokens.SEALED_KEYWORD) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java index 43c6d1ba4c7..a6e01a87fdb 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.java @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.resolve; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; -import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -233,11 +232,6 @@ public class DeclarationsChecker { checkTypeParameters(aClass); if (aClass.isInterface()) { - ASTNode traitKeyword = aClass.getNode().findChildByType(JetTokens.TRAIT_KEYWORD); - if (traitKeyword != null) { - trace.report(Errors.DEPRECATED_TRAIT_KEYWORD.on(traitKeyword.getPsi())); - } - checkConstructorInTrait(aClass); } else if (classDescriptor.getKind() == ClassKind.ANNOTATION_CLASS) { diff --git a/compiler/testData/codegen/box/classes/kt6136.kt b/compiler/testData/codegen/box/classes/kt6136.kt index 58953e8cfc7..3f075a47c0f 100644 --- a/compiler/testData/codegen/box/classes/kt6136.kt +++ b/compiler/testData/codegen/box/classes/kt6136.kt @@ -1,4 +1,4 @@ -trait Id { +interface Id { val id: T } diff --git a/compiler/testData/codegen/box/defaultArguments/function/kt5232.kt b/compiler/testData/codegen/box/defaultArguments/function/kt5232.kt index 0d1d0e99c2c..8b91d2bd2d5 100644 --- a/compiler/testData/codegen/box/defaultArguments/function/kt5232.kt +++ b/compiler/testData/codegen/box/defaultArguments/function/kt5232.kt @@ -1,4 +1,4 @@ -trait A { +interface A { fun visit(a:String, b:String="") : String = b + a } diff --git a/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt b/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt index 08cb9da0b6e..e8a48162aed 100644 --- a/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt +++ b/compiler/testData/codegen/box/increment/postfixIncrementOnClass.kt @@ -1,4 +1,4 @@ -trait Base +interface Base class Derived: Base class Another: Base fun Base.inc(): Derived { return Derived() } diff --git a/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt b/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt index 72fd9154dbb..c732ac67ac8 100644 --- a/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt +++ b/compiler/testData/codegen/box/increment/prefixIncrementOnClass.kt @@ -1,4 +1,4 @@ -trait Base +interface Base class Derived: Base class Another: Base fun Base.inc(): Derived { return Derived() } diff --git a/compiler/testData/codegen/boxWithJava/interfaces/abstractClassInheritsFromInterface/KC.kt b/compiler/testData/codegen/boxWithJava/interfaces/abstractClassInheritsFromInterface/KC.kt index e8accf40d01..7106000b428 100644 --- a/compiler/testData/codegen/boxWithJava/interfaces/abstractClassInheritsFromInterface/KC.kt +++ b/compiler/testData/codegen/boxWithJava/interfaces/abstractClassInheritsFromInterface/KC.kt @@ -1,6 +1,6 @@ // KT-3407 Implementing (in Java) an abstract Kotlin class that implements a trait does not respect trait method definition -trait T { +interface T { fun foo() = "OK" } diff --git a/compiler/testData/codegen/java8/boxWithJava/defaultMethodCallFromTrait/defaultCall.kt b/compiler/testData/codegen/java8/boxWithJava/defaultMethodCallFromTrait/defaultCall.kt index 55133e93878..0239babedcf 100644 --- a/compiler/testData/codegen/java8/boxWithJava/defaultMethodCallFromTrait/defaultCall.kt +++ b/compiler/testData/codegen/java8/boxWithJava/defaultMethodCallFromTrait/defaultCall.kt @@ -1,4 +1,4 @@ -trait KTrait : Simple { +interface KTrait : Simple { fun bar(): String { return test("O") + Simple.testStatic("O") } diff --git a/compiler/testData/codegen/java8/boxWithJava/defaultMethodOverride/override.kt b/compiler/testData/codegen/java8/boxWithJava/defaultMethodOverride/override.kt index d834a1f60cb..9101da6aecf 100644 --- a/compiler/testData/codegen/java8/boxWithJava/defaultMethodOverride/override.kt +++ b/compiler/testData/codegen/java8/boxWithJava/defaultMethodOverride/override.kt @@ -1,4 +1,4 @@ -trait KTrait: Simple { +interface KTrait: Simple { override fun test(s: String): String { return s + "K" } diff --git a/compiler/testData/codegen/java8/boxWithJava/inheritKotlin/defaultCall.kt b/compiler/testData/codegen/java8/boxWithJava/inheritKotlin/defaultCall.kt index c9572f45f37..533a2f49413 100644 --- a/compiler/testData/codegen/java8/boxWithJava/inheritKotlin/defaultCall.kt +++ b/compiler/testData/codegen/java8/boxWithJava/inheritKotlin/defaultCall.kt @@ -1,4 +1,4 @@ -trait KTrait { +interface KTrait { fun test(): String { return "base"; } diff --git a/compiler/testData/codegen/java8/boxWithJava/invokeDefaultViaSuper/tesk.kt b/compiler/testData/codegen/java8/boxWithJava/invokeDefaultViaSuper/tesk.kt index 50db9b69aa4..514daeb5d0a 100644 --- a/compiler/testData/codegen/java8/boxWithJava/invokeDefaultViaSuper/tesk.kt +++ b/compiler/testData/codegen/java8/boxWithJava/invokeDefaultViaSuper/tesk.kt @@ -1,4 +1,4 @@ -trait KTrait : Test { +interface KTrait : Test { } diff --git a/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.kt b/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.kt deleted file mode 100644 index 8fedbb55ce2..00000000000 --- a/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.kt +++ /dev/null @@ -1,2 +0,0 @@ -trait A { -} diff --git a/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.txt b/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.txt deleted file mode 100644 index ff41c8a3cde..00000000000 --- a/compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.txt +++ /dev/null @@ -1,7 +0,0 @@ -package - -public interface A { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/types/SupertypesAndBounds.kt b/compiler/testData/loadJava/compiledKotlin/annotations/types/SupertypesAndBounds.kt index 314d699216e..ac54f390317 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/types/SupertypesAndBounds.kt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/types/SupertypesAndBounds.kt @@ -2,6 +2,6 @@ package test annotation class A -trait Foo : @A CharSequence { +interface Foo : @A CharSequence { fun bar() } diff --git a/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.kt b/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.kt index 049c63634c8..c883c5293bd 100644 --- a/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.kt +++ b/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.kt @@ -10,7 +10,7 @@ fun func() {} class C @file: -trait T +interface T @file:[] -trait T \ No newline at end of file +interface T \ No newline at end of file diff --git a/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.txt b/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.txt index 5f8a4cbb3d8..e1fa7f27f7f 100644 --- a/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.txt +++ b/compiler/testData/psi/annotation/targeted/onFile/fileAnnotationInWrongPlace.txt @@ -85,7 +85,7 @@ JetFile: fileAnnotationInWrongPlace.kt PsiElement(IDENTIFIER)('file') PsiElement(COLON)(':') PsiWhiteSpace('\n') - PsiElement(trait)('trait') + PsiElement(interface)('interface') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('T') PsiWhiteSpace('\n\n') @@ -101,6 +101,6 @@ JetFile: fileAnnotationInWrongPlace.kt PsiElement(RBRACKET)(']') PsiWhiteSpace('\n') - PsiElement(trait)('trait') + PsiElement(interface)('interface') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('T') \ No newline at end of file diff --git a/compiler/testData/renderer/TraitWithConstructor.kt b/compiler/testData/renderer/TraitWithConstructor.kt index 4748ab09a41..eb448fdb9c6 100644 --- a/compiler/testData/renderer/TraitWithConstructor.kt +++ b/compiler/testData/renderer/TraitWithConstructor.kt @@ -1,10 +1,10 @@ -trait A1() { +interface A1() { constructor(x: Int = "", y: Int) : this() { x + y } } -trait A2 private constructor(private val prop: Int) { +interface A2 private constructor(private val prop: Int) { constructor(x: Int = "", y: Int) : this(x * y) { x + y } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 096ecfa90f3..4a419d9c560 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -181,12 +181,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } - @TestMetadata("DeprecatedTraitKeyword.kt") - public void testDeprecatedTraitKeyword() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/DeprecatedTraitKeyword.kt"); - doTest(fileName); - } - @TestMetadata("DiamondFunction.kt") public void testDiamondFunction() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/DiamondFunction.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/KotlinSyntheticClassAnnotationTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/KotlinSyntheticClassAnnotationTest.java index 6d265414469..964dfc14b68 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/KotlinSyntheticClassAnnotationTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/KotlinSyntheticClassAnnotationTest.java @@ -50,7 +50,7 @@ public class KotlinSyntheticClassAnnotationTest extends CodegenTestCase { public void testTraitImpl() { doTestKotlinSyntheticClass( - "trait A { fun foo() = 42 }", + "interface A { fun foo() = 42 }", JvmAbi.TRAIT_IMPL_SUFFIX, TRAIT_IMPL ); @@ -106,7 +106,7 @@ public class KotlinSyntheticClassAnnotationTest extends CodegenTestCase { public void testLocalTraitImpl() { doTestKotlinSyntheticClass( - "fun foo() { trait Local { fun bar() = 42 } }", + "fun foo() { interface Local { fun bar() = 42 } }", "Local$$TImpl.class", LOCAL_TRAIT_IMPL ); @@ -114,7 +114,7 @@ public class KotlinSyntheticClassAnnotationTest extends CodegenTestCase { public void testLocalTraitInterface() { doTestKotlinClass( - "fun foo() { trait Local { fun bar() = 42 } }", + "fun foo() { interface Local { fun bar() = 42 } }", "Local.class", LOCAL_CLASS ); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt index aa959b67bb4..2ba3f4f26ab 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt @@ -28,7 +28,7 @@ public class MethodOrderTest: CodegenTestCase() { public fun testDelegatedMethod() { doTest( """ - trait Trait { + interface Trait { fun f0() fun f4() fun f3() diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt index 2777f5914ad..42c240a43bd 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/AbstractSMAPBaseTest.kt @@ -23,14 +23,13 @@ import org.jetbrains.kotlin.load.kotlin.PackageClassUtils import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.psi.JetFile import org.jetbrains.kotlin.test.InTextDirectivesUtils -import org.jetbrains.kotlin.test.JetTestUtils import org.jetbrains.org.objectweb.asm.ClassReader import org.jetbrains.org.objectweb.asm.ClassVisitor import org.jetbrains.org.objectweb.asm.Opcodes import org.junit.Assert import java.io.File -public trait AbstractSMAPBaseTest { +public interface AbstractSMAPBaseTest { private fun extractSMAPFromClasses(outputFiles: Iterable): List { return outputFiles.map { outputFile -> diff --git a/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java b/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java index 71c0e86ec31..370fd4167ce 100644 --- a/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java +++ b/compiler/tests/org/jetbrains/kotlin/types/JetDefaultModalityModifiersTest.java @@ -227,9 +227,9 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testEnumModality("abstract enum class A {}", Modality.ABSTRACT); tc.testEnumModality("final enum class A {}", Modality.FINAL); - tc.testTraitModality("trait A {}", Modality.ABSTRACT); - tc.testTraitModality("open trait A {}", Modality.ABSTRACT); - tc.testTraitModality("abstract trait A {}", Modality.ABSTRACT); + tc.testTraitModality("interface A {}", Modality.ABSTRACT); + tc.testTraitModality("open interface A {}", Modality.ABSTRACT); + tc.testTraitModality("abstract interface A {}", Modality.ABSTRACT); } public void testFunctionModality() { @@ -248,11 +248,11 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testFunctionModalityInEnum("abstract enum class A { ; open fun foo() }", Modality.OPEN); tc.testFunctionModalityInEnum("abstract enum class A { ; abstract fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A { fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A { abstract fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A { fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInTrait("trait A { open fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInTrait("trait A { final fun foo() {} }", Modality.FINAL); + tc.testFunctionModalityInTrait("interface A { fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInTrait("interface A { abstract fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInTrait("interface A { fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInTrait("interface A { open fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInTrait("interface A { final fun foo() {} }", Modality.FINAL); } public void testFunctionModalityWithOverride() { @@ -272,11 +272,11 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testFunctionModalityInEnum("abstract enum class A : C { ; open override fun foo() }", Modality.OPEN); tc.testFunctionModalityInEnum("abstract enum class A : C { ; abstract override fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A : C { override fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A : C { abstract override fun foo() }", Modality.ABSTRACT); - tc.testFunctionModalityInTrait("trait A : C { override fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInTrait("trait A : C { open override fun foo() {} }", Modality.OPEN); - tc.testFunctionModalityInTrait("trait A : C { final override fun foo() {} }", Modality.FINAL); + tc.testFunctionModalityInTrait("interface A : C { override fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInTrait("interface A : C { abstract override fun foo() }", Modality.ABSTRACT); + tc.testFunctionModalityInTrait("interface A : C { override fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInTrait("interface A : C { open override fun foo() {} }", Modality.OPEN); + tc.testFunctionModalityInTrait("interface A : C { final override fun foo() {} }", Modality.FINAL); } public void testPropertyModality() { @@ -297,18 +297,18 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyModalityInEnum("abstract enum class A { ; open val a: Int = 0 }", Modality.OPEN); tc.testPropertyModalityInEnum("abstract enum class A { ; abstract val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { open val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { abstract val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { open abstract val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { open val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { abstract val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { open abstract val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { val a: Int get() = 10 }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A { var a: Int get() = 1; set(v: Int) {} }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A { val a: Int open get }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { var a: Int open get open set}", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { open val a: Int get }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A { open val a: Int get() = 1 }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A { open val a: Int final get() = 1 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A { val a: Int get() = 10 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A { var a: Int get() = 1; set(v: Int) {} }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A { val a: Int open get }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { var a: Int open get open set}", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { open val a: Int get }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A { open val a: Int get() = 1 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A { open val a: Int final get() = 1 }", Modality.OPEN); } public void testPropertyModalityWithOverride() { @@ -329,18 +329,18 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyModalityInEnum("abstract enum class A : C { ; open override val a: Int = 0 }", Modality.OPEN); tc.testPropertyModalityInEnum("abstract enum class A : C { ; abstract override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { open override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { abstract override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { open abstract override val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { override val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { open override val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { abstract override val a: Int }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { open abstract override val a: Int }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { override val a: Int get() = 10 }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A : C { override var a: Int get() = 1; set(v: Int) {} }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A : C { override val a: Int open get }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { override var a: Int open get open set }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { open override val a: Int get }", Modality.ABSTRACT); - tc.testPropertyModalityInTrait("trait A : C { open override val a: Int get() = 1 }", Modality.OPEN); - tc.testPropertyModalityInTrait("trait A : C { open override val a: Int final get() = 1 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A : C { override val a: Int get() = 10 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A : C { override var a: Int get() = 1; set(v: Int) {} }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A : C { override val a: Int open get }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { override var a: Int open get open set }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { open override val a: Int get }", Modality.ABSTRACT); + tc.testPropertyModalityInTrait("interface A : C { open override val a: Int get() = 1 }", Modality.OPEN); + tc.testPropertyModalityInTrait("interface A : C { open override val a: Int final get() = 1 }", Modality.OPEN); } public void testPropertyAccessorModality() { @@ -381,23 +381,23 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyAccessorModalityInClass("abstract class A { open val a: Int open get() = 10 }", Modality.OPEN); tc.testPropertyAccessorModalityInClass("abstract class A { open val a: Int final get() = 10 }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int abstract get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int open get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int open get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int final get }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("trait A { val a: Int final get() = 1 }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int abstract get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int open get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int open get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int final get }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("interface A { val a: Int final get() = 1 }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int abstract get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int open get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int open get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int final get }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("abstract trait A { val a: Int final get() = 1 }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int abstract get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int open get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int open get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int final get }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("abstract interface A { val a: Int final get() = 1 }", Modality.FINAL); } public void testPropertyAccessorModalityWithOverride() { @@ -446,14 +446,14 @@ public class JetDefaultModalityModifiersTest extends JetLiteFixture { tc.testPropertyAccessorModalityInClass("abstract class A : C { open override val a: Int open override get() = 10 }", Modality.OPEN); tc.testPropertyAccessorModalityInClass("abstract class A : C { open override val a: Int final override get() = 10 }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int override get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int abstract get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int open get }", Modality.ABSTRACT); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int open override get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int override get() = 1 }", Modality.OPEN); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int final get }", Modality.FINAL); - tc.testPropertyAccessorModalityInTrait("trait A : C { override val a: Int final override get() = 1 }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int override get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int abstract get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int open get }", Modality.ABSTRACT); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int open override get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int override get() = 1 }", Modality.OPEN); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int final get }", Modality.FINAL); + tc.testPropertyAccessorModalityInTrait("interface A : C { override val a: Int final override get() = 1 }", Modality.FINAL); } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java b/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java index bc13e5988c8..14f963cc793 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java +++ b/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java @@ -51,7 +51,6 @@ public class KeywordStringsGenerated { "while", "do", "when", - "trait", "interface", "This" )); diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt b/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt index e6bb17a1b5d..593fa33a65f 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt @@ -60,7 +60,6 @@ fun box(): String { commonCasesWithTestNotRenamed() case("class", "class $KEYWORD_MARKER { companion object {} }", "", testNotRenamedByName) - case("trait", "trait $KEYWORD_MARKER { companion object {} }", "", testNotRenamedByName) case("interface", "interface $KEYWORD_MARKER { companion object {} }", "", testNotRenamedByName) case("enum", "enum class $KEYWORD_MARKER { foo }", "", testNotRenamed("$KEYWORD_MARKER.foo")) case("object", "object $KEYWORD_MARKER {}", "", testNotRenamedByName) @@ -165,7 +164,7 @@ fun box(): String { suite("delegated", """ -trait Trait { +interface Trait { $DECLARATION_MARKER } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt index 355e149d928..4d0f6d8f266 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/JetPsiChecker.kt @@ -151,9 +151,7 @@ public open class JetPsiChecker : Annotator, HighlightRangeExtension { when (factory) { Errors.DEPRECATED_SYMBOL, - Errors.DEPRECATED_SYMBOL_WITH_MESSAGE, - Errors.DEPRECATED_TRAIT_KEYWORD - -> annotation.setTextAttributes(CodeInsightColors.DEPRECATED_ATTRIBUTES) + Errors.DEPRECATED_SYMBOL_WITH_MESSAGE -> annotation.setTextAttributes(CodeInsightColors.DEPRECATED_ATTRIBUTES) } setUpAnnotation(diagnostic, annotation, if (factory in Errors.UNUSED_ELEMENT_DIAGNOSTICS) diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/KeywordCompletion.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/KeywordCompletion.kt index b4e5a0baa83..f133df2e911 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/KeywordCompletion.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/KeywordCompletion.kt @@ -41,8 +41,7 @@ open class KeywordLookupObject object KeywordCompletion { private val NON_ACTUAL_KEYWORDS = setOf(CAPITALIZED_THIS_KEYWORD, - TYPE_ALIAS_KEYWORD, - TRAIT_KEYWORD) + TYPE_ALIAS_KEYWORD) private val ALL_KEYWORDS = (KEYWORDS.getTypes() + SOFT_KEYWORDS.getTypes()) .filter { it !in NON_ACTUAL_KEYWORDS } .map { it as JetKeywordToken } diff --git a/idea/idea-completion/testData/basic/common/InLambda.kt b/idea/idea-completion/testData/basic/common/InLambda.kt index 068ec35333c..92092c39dcd 100644 --- a/idea/idea-completion/testData/basic/common/InLambda.kt +++ b/idea/idea-completion/testData/basic/common/InLambda.kt @@ -2,7 +2,7 @@ fun foo(p: Iterable) { p.filter { it. } } -trait D { +interface D { fun bar() } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/AfterNullableAutoCast2.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/AfterNullableAutoCast2.kt index ab2e98c99be..858e2f5fc96 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/AfterNullableAutoCast2.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/AfterNullableAutoCast2.kt @@ -1,8 +1,8 @@ -trait T1 { +interface T1 { fun inT1(){} } -trait T2 { +interface T2 { fun inT2(){} } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateExtensionMembers4.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateExtensionMembers4.kt index a82d36cf255..ecd4ae28c81 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateExtensionMembers4.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateExtensionMembers4.kt @@ -10,7 +10,7 @@ open class C { } } -trait T +interface T // EXIST: { itemText: "extFunForT", attributes: "bold" } // EXIST: { itemText: "extFunForC", attributes: "bold" } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers1.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers1.kt index e59ecce0bdf..e9cdac32a53 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers1.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers1.kt @@ -1,4 +1,4 @@ -trait T { +interface T { fun fromTrait(){} } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers2.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers2.kt index ac4dae6c718..b3b32077627 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers2.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers2.kt @@ -1,4 +1,4 @@ -trait T { +interface T { fun fromTrait(){} } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers3.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers3.kt index 3520ee9f2f8..e10eb74cbef 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers3.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers3.kt @@ -1,4 +1,4 @@ -trait T { +interface T { fun f(){} } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers4.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers4.kt index 2daa6f8f8cf..ce1f7f87137 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers4.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers4.kt @@ -1,4 +1,4 @@ -trait T { +interface T { fun foo1(){} fun foo2(){} } diff --git a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers5.kt b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers5.kt index 342ea6c64d9..dadb0559da5 100644 --- a/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers5.kt +++ b/idea/idea-completion/testData/basic/common/boldOrGrayed/ImmediateMembers5.kt @@ -1,6 +1,6 @@ fun globalFun(){} -trait T { +interface T { fun fromTrait(){} } diff --git a/idea/idea-completion/testData/basic/common/extensions/ComplexCapture.kt b/idea/idea-completion/testData/basic/common/extensions/ComplexCapture.kt index 947d1d4285f..87d0f7e357d 100644 --- a/idea/idea-completion/testData/basic/common/extensions/ComplexCapture.kt +++ b/idea/idea-completion/testData/basic/common/extensions/ComplexCapture.kt @@ -1,4 +1,4 @@ -trait I +interface I fun > T.ext() : T = this diff --git a/idea/idea-completion/testData/basic/common/extensions/NoDuplicatedMethodForSmartCast.kt b/idea/idea-completion/testData/basic/common/extensions/NoDuplicatedMethodForSmartCast.kt index ff3cf7cdd5a..ae5ffcd70c8 100644 --- a/idea/idea-completion/testData/basic/common/extensions/NoDuplicatedMethodForSmartCast.kt +++ b/idea/idea-completion/testData/basic/common/extensions/NoDuplicatedMethodForSmartCast.kt @@ -1,8 +1,8 @@ -trait A { +interface A { fun foo(): Int } -trait B: A { +interface B: A { override fun foo(): Int override fun foo1(): Int } diff --git a/idea/idea-completion/testData/basic/common/smartCast/SmartCastAfterIf.kt b/idea/idea-completion/testData/basic/common/smartCast/SmartCastAfterIf.kt index 053908d80ad..849a7046bb0 100644 --- a/idea/idea-completion/testData/basic/common/smartCast/SmartCastAfterIf.kt +++ b/idea/idea-completion/testData/basic/common/smartCast/SmartCastAfterIf.kt @@ -1,4 +1,4 @@ -trait Expr +interface Expr class Num(val value : Int) : Expr fun eval(e : Expr) { diff --git a/idea/idea-completion/testData/basic/common/smartCast/SmartCastForThis.kt b/idea/idea-completion/testData/basic/common/smartCast/SmartCastForThis.kt index d77a1be3a7c..cc3e7b5f902 100644 --- a/idea/idea-completion/testData/basic/common/smartCast/SmartCastForThis.kt +++ b/idea/idea-completion/testData/basic/common/smartCast/SmartCastForThis.kt @@ -1,4 +1,4 @@ -trait Expr { +interface Expr { public fun testThis() { if (this is Num) { this. diff --git a/idea/idea-completion/testData/basic/common/smartCast/SmartCastInWhen.kt b/idea/idea-completion/testData/basic/common/smartCast/SmartCastInWhen.kt index 4d5ce298e6b..1397fefb4b8 100644 --- a/idea/idea-completion/testData/basic/common/smartCast/SmartCastInWhen.kt +++ b/idea/idea-completion/testData/basic/common/smartCast/SmartCastInWhen.kt @@ -1,4 +1,4 @@ -trait Expr +interface Expr class Sum(val left : Expr, val right : Expr) : Expr fun evalWhen(e : Expr) : Int = when (e) { diff --git a/idea/idea-completion/testData/basic/common/substitutedSignature/SubstitutedSignature4.kt b/idea/idea-completion/testData/basic/common/substitutedSignature/SubstitutedSignature4.kt index b06136e0f02..f4d321f112d 100644 --- a/idea/idea-completion/testData/basic/common/substitutedSignature/SubstitutedSignature4.kt +++ b/idea/idea-completion/testData/basic/common/substitutedSignature/SubstitutedSignature4.kt @@ -1,4 +1,4 @@ -trait Trait +interface Trait fun Trait.extension(t: T): T = t diff --git a/idea/idea-completion/testData/basic/multifile/DoNotCompleteWithConstraints/DoNotCompleteWithConstraints.kt b/idea/idea-completion/testData/basic/multifile/DoNotCompleteWithConstraints/DoNotCompleteWithConstraints.kt index 96e8832e38b..09f9c5343ef 100644 --- a/idea/idea-completion/testData/basic/multifile/DoNotCompleteWithConstraints/DoNotCompleteWithConstraints.kt +++ b/idea/idea-completion/testData/basic/multifile/DoNotCompleteWithConstraints/DoNotCompleteWithConstraints.kt @@ -1,6 +1,6 @@ package first -trait TestedTrait() { +interface TestedTrait() { } fun firstFun() { diff --git a/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt b/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt index 3d7f3361d7d..63f31bb446a 100644 --- a/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt +++ b/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt @@ -1,4 +1,4 @@ -trait X { +interface X { open fun fn() {} } diff --git a/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt.after b/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt.after index 7831dd882de..e7913e6b052 100644 --- a/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt.after +++ b/idea/idea-completion/testData/handlers/TypeArgOfSuper.kt.after @@ -1,4 +1,4 @@ -trait X { +interface X { open fun fn() {} } diff --git a/idea/idea-completion/testData/handlers/multifile/smart/AnonymousObjectGenericJava-2.kt b/idea/idea-completion/testData/handlers/multifile/smart/AnonymousObjectGenericJava-2.kt index 6e31f064fcb..9d7ea54e3f3 100644 --- a/idea/idea-completion/testData/handlers/multifile/smart/AnonymousObjectGenericJava-2.kt +++ b/idea/idea-completion/testData/handlers/multifile/smart/AnonymousObjectGenericJava-2.kt @@ -1,3 +1,3 @@ -public trait Comparator { +public interface Comparator { public fun compare(var1: T, var2: T): Int } diff --git a/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt b/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt index 11668a02b22..24f26d7c41a 100644 --- a/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt +++ b/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt @@ -1,4 +1,4 @@ -trait Foo +interface Foo var a : Foo = diff --git a/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt.after b/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt.after index 36afa6b9282..13e969fccc9 100644 --- a/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt.after +++ b/idea/idea-completion/testData/handlers/smart/AnonymousObject1.kt.after @@ -1,4 +1,4 @@ -trait Foo +interface Foo var a : Foo = object: Foo {} diff --git a/idea/idea-completion/testData/handlers/smart/Comma8.kt b/idea/idea-completion/testData/handlers/smart/Comma8.kt index 66b472a1c2b..282441cfa6c 100644 --- a/idea/idea-completion/testData/handlers/smart/Comma8.kt +++ b/idea/idea-completion/testData/handlers/smart/Comma8.kt @@ -1,4 +1,4 @@ -trait Foo +interface Foo fun foo(f: Foo, i: Int){} diff --git a/idea/idea-completion/testData/handlers/smart/Comma8.kt.after b/idea/idea-completion/testData/handlers/smart/Comma8.kt.after index e4b1f6a014e..a23b4152b37 100644 --- a/idea/idea-completion/testData/handlers/smart/Comma8.kt.after +++ b/idea/idea-completion/testData/handlers/smart/Comma8.kt.after @@ -1,4 +1,4 @@ -trait Foo +interface Foo fun foo(f: Foo, i: Int){} diff --git a/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt b/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt index 772a80b6134..42288df8d25 100644 --- a/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt +++ b/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt @@ -4,9 +4,9 @@ fun test() { registerHandler() } -trait Message +interface Message -trait Handler { +interface Handler { fun handle(e: E) } diff --git a/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt.after b/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt.after index 572cc56155d..1af95c85ca4 100644 --- a/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt.after +++ b/idea/idea-completion/testData/handlers/smart/ConstructorForGenericType2.kt.after @@ -8,9 +8,9 @@ fun test() { }) } -trait Message +interface Message -trait Handler { +interface Handler { fun handle(e: E) } diff --git a/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt b/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt index 25049789275..a22314bd18c 100644 --- a/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt +++ b/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt @@ -1,8 +1,8 @@ class `class` -trait `trait` +interface `interface` -fun foo(p: `class`<`trait`>){} +fun foo(p: `class`<`interface`>){} fun f(){ foo() diff --git a/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt.after b/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt.after index 7771576246b..c21d9efbe39 100644 --- a/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt.after +++ b/idea/idea-completion/testData/handlers/smart/ConstructorWithKeywordName.kt.after @@ -1,8 +1,8 @@ class `class` -trait `trait` +interface `interface` -fun foo(p: `class`<`trait`>){} +fun foo(p: `class`<`interface`>){} fun f(){ foo(`class`()) diff --git a/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt b/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt index 71b7739234d..84755bdd1de 100644 --- a/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt +++ b/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt @@ -1,5 +1,5 @@ -trait X -trait Y +interface X +interface Y fun X.iterator(): Y fun Y.next(): Int diff --git a/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt.after b/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt.after index 722d4ff5044..86ea756379c 100644 --- a/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt.after +++ b/idea/idea-completion/testData/handlers/smart/ForLoopRange.kt.after @@ -1,5 +1,5 @@ -trait X -trait Y +interface X +interface Y fun X.iterator(): Y fun Y.next(): Int diff --git a/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt b/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt index c4c619f829c..dc3888f6c6e 100644 --- a/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt +++ b/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt @@ -1,5 +1,5 @@ -trait X -trait Y +interface X +interface Y fun X.iterator(): Y fun Y.next(): Int diff --git a/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt.after b/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt.after index f0448511a2e..ab183745d8a 100644 --- a/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt.after +++ b/idea/idea-completion/testData/handlers/smart/ForLoopRange2.kt.after @@ -1,5 +1,5 @@ -trait X -trait Y +interface X +interface Y fun X.iterator(): Y fun Y.next(): Int diff --git a/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt b/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt index f52e83eb2ee..b6fb1448e03 100644 --- a/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt +++ b/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt @@ -1,7 +1,7 @@ package p class Outer { - trait T { + interface T { object Null : T { } } } diff --git a/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt.after b/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt.after index 838d5e19272..ba435d76542 100644 --- a/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt.after +++ b/idea/idea-completion/testData/handlers/smart/ObjectFromType.kt.after @@ -1,7 +1,7 @@ package p class Outer { - trait T { + interface T { object Null : T { } } } diff --git a/idea/idea-completion/testData/injava/mockLib/main.kt b/idea/idea-completion/testData/injava/mockLib/main.kt index 98a6b6083f2..c930c6ad962 100644 --- a/idea/idea-completion/testData/injava/mockLib/main.kt +++ b/idea/idea-completion/testData/injava/mockLib/main.kt @@ -20,7 +20,7 @@ public class LibClass { public val nested: Nested = Nested() } -public trait LibTrait { +public interface LibTrait { public fun foo() { } } diff --git a/idea/idea-completion/testData/smart/ChainedCall.kt b/idea/idea-completion/testData/smart/ChainedCall.kt index ec414f56a48..8872b7c2fd0 100644 --- a/idea/idea-completion/testData/smart/ChainedCall.kt +++ b/idea/idea-completion/testData/smart/ChainedCall.kt @@ -1,4 +1,4 @@ -trait Foo{ +interface Foo{ public fun foo() : Foo public fun s() : String public val prop : String diff --git a/idea/idea-completion/testData/smart/ImmediateMembers.kt b/idea/idea-completion/testData/smart/ImmediateMembers.kt index 85165c9a9e6..e39974e27fb 100644 --- a/idea/idea-completion/testData/smart/ImmediateMembers.kt +++ b/idea/idea-completion/testData/smart/ImmediateMembers.kt @@ -1,4 +1,4 @@ -trait T { +interface T { fun fromTrait() = "" } diff --git a/idea/idea-completion/testData/smart/Object.kt b/idea/idea-completion/testData/smart/Object.kt index 1ec2f1cd1a5..7895de62b72 100644 --- a/idea/idea-completion/testData/smart/Object.kt +++ b/idea/idea-completion/testData/smart/Object.kt @@ -1,4 +1,4 @@ -trait I +interface I object O : I diff --git a/idea/idea-completion/testData/smart/ObjectsFromType.kt b/idea/idea-completion/testData/smart/ObjectsFromType.kt index b9099305068..f066d53c363 100644 --- a/idea/idea-completion/testData/smart/ObjectsFromType.kt +++ b/idea/idea-completion/testData/smart/ObjectsFromType.kt @@ -1,6 +1,6 @@ package p -trait T { +interface T { object Null : T { } object Other {} diff --git a/idea/idea-completion/testData/smart/WithQualifier.kt b/idea/idea-completion/testData/smart/WithQualifier.kt index 07c3c0bf03d..af6e276bd94 100644 --- a/idea/idea-completion/testData/smart/WithQualifier.kt +++ b/idea/idea-completion/testData/smart/WithQualifier.kt @@ -1,4 +1,4 @@ -trait Foo{ +interface Foo{ fun foo1() : String fun foo2() : Object val prop : String diff --git a/idea/idea-completion/testData/smart/anonymousObject/1.kt b/idea/idea-completion/testData/smart/anonymousObject/1.kt index fc0486b0cb4..66ac417e3d2 100644 --- a/idea/idea-completion/testData/smart/anonymousObject/1.kt +++ b/idea/idea-completion/testData/smart/anonymousObject/1.kt @@ -1,4 +1,4 @@ -trait Foo +interface Foo var a : Foo = diff --git a/idea/idea-completion/testData/smart/anonymousObject/WithPrefix.kt b/idea/idea-completion/testData/smart/anonymousObject/WithPrefix.kt index 26cf4e8d7d1..8901d4024e4 100644 --- a/idea/idea-completion/testData/smart/anonymousObject/WithPrefix.kt +++ b/idea/idea-completion/testData/smart/anonymousObject/WithPrefix.kt @@ -1,4 +1,4 @@ -trait Foo +interface Foo var a : Foo = o diff --git a/idea/idea-completion/testData/smart/constructor/InnerClass.kt b/idea/idea-completion/testData/smart/constructor/InnerClass.kt index 45bdabd5046..a15698a18a9 100644 --- a/idea/idea-completion/testData/smart/constructor/InnerClass.kt +++ b/idea/idea-completion/testData/smart/constructor/InnerClass.kt @@ -1,4 +1,4 @@ -trait T +interface T class C { inner class Inner1(s: String) : T diff --git a/idea/idea-completion/testData/smart/forLoopRange/ExtensionIteratorMethod.kt b/idea/idea-completion/testData/smart/forLoopRange/ExtensionIteratorMethod.kt index 253fa123c65..468f58140ef 100644 --- a/idea/idea-completion/testData/smart/forLoopRange/ExtensionIteratorMethod.kt +++ b/idea/idea-completion/testData/smart/forLoopRange/ExtensionIteratorMethod.kt @@ -1,5 +1,5 @@ -trait X -trait Y +interface X +interface Y fun X.iterator(): Y fun Y.next(): Int diff --git a/idea/idea-completion/testData/smart/forLoopRange/TypedLoopVar.kt b/idea/idea-completion/testData/smart/forLoopRange/TypedLoopVar.kt index 325447fda47..bdeb2b730ac 100644 --- a/idea/idea-completion/testData/smart/forLoopRange/TypedLoopVar.kt +++ b/idea/idea-completion/testData/smart/forLoopRange/TypedLoopVar.kt @@ -1,6 +1,6 @@ -trait X -trait Y: X -trait Z +interface X +interface Y: X +interface Z fun foo(p1: Collection, p2: Collection, p3: Collection, p4: Collection) { for (i: X in ) diff --git a/idea/idea-completion/testData/smart/heuristicSignatures/InOperator.kt b/idea/idea-completion/testData/smart/heuristicSignatures/InOperator.kt index 4ed1ab47a2f..dcd9575af4e 100644 --- a/idea/idea-completion/testData/smart/heuristicSignatures/InOperator.kt +++ b/idea/idea-completion/testData/smart/heuristicSignatures/InOperator.kt @@ -1,8 +1,8 @@ import java.util.ArrayList -trait A -trait B : A -trait C +interface A +interface B : A +interface C fun foo(a: A, cA: Collection, cB: Collection, cC: Collection, cAny: Collection, lA: List, lb: List, lC: List, lAny: List, diff --git a/idea/idea-completion/testData/smart/inElvisOperator/3.kt b/idea/idea-completion/testData/smart/inElvisOperator/3.kt index 796bccd7dfb..7ed80332d0e 100644 --- a/idea/idea-completion/testData/smart/inElvisOperator/3.kt +++ b/idea/idea-completion/testData/smart/inElvisOperator/3.kt @@ -1,6 +1,6 @@ -trait A -trait B : A -trait C +interface A +interface B : A +interface C fun foo(a: A){} fun foo(c: C){} diff --git a/idea/idea-completion/testData/smart/inElvisOperator/4.kt b/idea/idea-completion/testData/smart/inElvisOperator/4.kt index 913829bb034..4d95cace78c 100644 --- a/idea/idea-completion/testData/smart/inElvisOperator/4.kt +++ b/idea/idea-completion/testData/smart/inElvisOperator/4.kt @@ -1,6 +1,6 @@ -trait A -trait B : A -trait C +interface A +interface B : A +interface C fun foo(a: A?){} fun foo(c: C?){} diff --git a/idea/idea-completion/testData/smart/inElvisOperator/5.kt b/idea/idea-completion/testData/smart/inElvisOperator/5.kt index 3d1fd267eb3..3454d8d5ca7 100644 --- a/idea/idea-completion/testData/smart/inElvisOperator/5.kt +++ b/idea/idea-completion/testData/smart/inElvisOperator/5.kt @@ -1,6 +1,6 @@ -trait A -trait B : A -trait C +interface A +interface B : A +interface C fun foo(a: A){} fun foo(c: C){} diff --git a/idea/idea-completion/testData/smart/inElvisOperator/6.kt b/idea/idea-completion/testData/smart/inElvisOperator/6.kt index 24ba849ad57..e954773f9a9 100644 --- a/idea/idea-completion/testData/smart/inElvisOperator/6.kt +++ b/idea/idea-completion/testData/smart/inElvisOperator/6.kt @@ -1,6 +1,6 @@ -trait A -trait B : A -trait C +interface A +interface B : A +interface C fun foo(a: A){} fun foo(c: C){} diff --git a/idea/idea-completion/testData/smart/inOperator/ExtensionContains.kt b/idea/idea-completion/testData/smart/inOperator/ExtensionContains.kt index ad388021f37..72ea56f584b 100644 --- a/idea/idea-completion/testData/smart/inOperator/ExtensionContains.kt +++ b/idea/idea-completion/testData/smart/inOperator/ExtensionContains.kt @@ -1,6 +1,6 @@ -trait X -trait Y : X -trait Z +interface X +interface Y : X +interface Z fun X.contains(s: String): Boolean diff --git a/idea/idea-completion/testData/smart/inOperator/FilterByArgumentType.kt b/idea/idea-completion/testData/smart/inOperator/FilterByArgumentType.kt index 7a4cfd3f15e..0f4c52c18c2 100644 --- a/idea/idea-completion/testData/smart/inOperator/FilterByArgumentType.kt +++ b/idea/idea-completion/testData/smart/inOperator/FilterByArgumentType.kt @@ -1,12 +1,12 @@ -trait X { +interface X { fun contains(s: String): Boolean } -trait Y { +interface Y { fun contains(i: Int): Boolean } -trait Z { +interface Z { fun contains(o: Any): Boolean } diff --git a/idea/idea-completion/testData/smart/inOperator/GenericMethod2.kt b/idea/idea-completion/testData/smart/inOperator/GenericMethod2.kt index 1ed6bc8da81..40959add9cc 100644 --- a/idea/idea-completion/testData/smart/inOperator/GenericMethod2.kt +++ b/idea/idea-completion/testData/smart/inOperator/GenericMethod2.kt @@ -1,8 +1,8 @@ -trait X { +interface X { fun contains(t: T): Boolean } -trait A { +interface A { fun createX(t: T): X fun foo(s: String) { diff --git a/idea/idea-completion/testData/smart/inOperator/GenericMethod3.kt b/idea/idea-completion/testData/smart/inOperator/GenericMethod3.kt index afa74802019..227c5543730 100644 --- a/idea/idea-completion/testData/smart/inOperator/GenericMethod3.kt +++ b/idea/idea-completion/testData/smart/inOperator/GenericMethod3.kt @@ -1,8 +1,8 @@ -trait X +interface X fun X.contains(t: T): Boolean -trait A { +interface A { fun createX(t: T): X fun foo(s: String) { diff --git a/idea/idea-completion/testData/smart/inOperator/NonBooleanContains.kt b/idea/idea-completion/testData/smart/inOperator/NonBooleanContains.kt index 7b68a46a24a..10e38f3a8df 100644 --- a/idea/idea-completion/testData/smart/inOperator/NonBooleanContains.kt +++ b/idea/idea-completion/testData/smart/inOperator/NonBooleanContains.kt @@ -1,4 +1,4 @@ -trait X { +interface X { fun contains(s: String): Boolean? } diff --git a/idea/idea-completion/testData/smart/inheritors/3.kt b/idea/idea-completion/testData/smart/inheritors/3.kt index ed2ec474fde..d63d1843341 100644 --- a/idea/idea-completion/testData/smart/inheritors/3.kt +++ b/idea/idea-completion/testData/smart/inheritors/3.kt @@ -1,4 +1,4 @@ -trait T +interface T open class A : T diff --git a/idea/idea-completion/testData/smartMultiFile/AnonymousObjectGenericJava/Comparator.kt b/idea/idea-completion/testData/smartMultiFile/AnonymousObjectGenericJava/Comparator.kt index 6e31f064fcb..9d7ea54e3f3 100644 --- a/idea/idea-completion/testData/smartMultiFile/AnonymousObjectGenericJava/Comparator.kt +++ b/idea/idea-completion/testData/smartMultiFile/AnonymousObjectGenericJava/Comparator.kt @@ -1,3 +1,3 @@ -public trait Comparator { +public interface Comparator { public fun compare(var1: T, var2: T): Int } diff --git a/idea/idea-completion/testData/smartMultiFile/GenericInheritors1/KotlinInheritors.kt b/idea/idea-completion/testData/smartMultiFile/GenericInheritors1/KotlinInheritors.kt index 12efb662ecb..97237decd8c 100644 --- a/idea/idea-completion/testData/smartMultiFile/GenericInheritors1/KotlinInheritors.kt +++ b/idea/idea-completion/testData/smartMultiFile/GenericInheritors1/KotlinInheritors.kt @@ -1,10 +1,10 @@ package p -trait I1 -trait I2 -trait I3 +interface I1 +interface I2 +interface I3 -trait KotlinTrait +interface KotlinTrait open class KotlinInheritor1 : KotlinTrait diff --git a/idea/idea-completion/testData/smartMultiFile/GenericInheritors2/KotlinInheritors.kt b/idea/idea-completion/testData/smartMultiFile/GenericInheritors2/KotlinInheritors.kt index 7eeddf70d97..370b3bd8bbc 100644 --- a/idea/idea-completion/testData/smartMultiFile/GenericInheritors2/KotlinInheritors.kt +++ b/idea/idea-completion/testData/smartMultiFile/GenericInheritors2/KotlinInheritors.kt @@ -1,10 +1,10 @@ package p -trait I1 -trait I2 -trait I3 +interface I1 +interface I2 +interface I3 -trait KotlinTrait +interface KotlinTrait class KotlinInheritor : KotlinTrait diff --git a/idea/idea-completion/testData/smartMultiFile/GenericInheritors3/KotlinInheritors.kt b/idea/idea-completion/testData/smartMultiFile/GenericInheritors3/KotlinInheritors.kt index 7eeddf70d97..370b3bd8bbc 100644 --- a/idea/idea-completion/testData/smartMultiFile/GenericInheritors3/KotlinInheritors.kt +++ b/idea/idea-completion/testData/smartMultiFile/GenericInheritors3/KotlinInheritors.kt @@ -1,10 +1,10 @@ package p -trait I1 -trait I2 -trait I3 +interface I1 +interface I2 +interface I3 -trait KotlinTrait +interface KotlinTrait class KotlinInheritor : KotlinTrait diff --git a/idea/idea-completion/testData/smartMultiFile/GenericInheritors4/KotlinInheritors.kt b/idea/idea-completion/testData/smartMultiFile/GenericInheritors4/KotlinInheritors.kt index bf3ef9ee514..e68af0f9bf9 100644 --- a/idea/idea-completion/testData/smartMultiFile/GenericInheritors4/KotlinInheritors.kt +++ b/idea/idea-completion/testData/smartMultiFile/GenericInheritors4/KotlinInheritors.kt @@ -1,9 +1,9 @@ package p -trait I1 -trait I2 +interface I1 +interface I2 -trait KotlinTrait +interface KotlinTrait class KotlinInheritor : KotlinTrait> diff --git a/idea/idea-completion/testData/smartMultiFile/InheritorInTheSameFile/Declarations.kt b/idea/idea-completion/testData/smartMultiFile/InheritorInTheSameFile/Declarations.kt index 16009aa74c1..67fb7d0bbe4 100644 --- a/idea/idea-completion/testData/smartMultiFile/InheritorInTheSameFile/Declarations.kt +++ b/idea/idea-completion/testData/smartMultiFile/InheritorInTheSameFile/Declarations.kt @@ -1,4 +1,4 @@ -trait T +interface T class C : A() diff --git a/idea/idea-completion/testData/smartMultiFile/Inheritors/KotlinInheritors.kt b/idea/idea-completion/testData/smartMultiFile/Inheritors/KotlinInheritors.kt index 80b28599d6e..96365ccbe9c 100644 --- a/idea/idea-completion/testData/smartMultiFile/Inheritors/KotlinInheritors.kt +++ b/idea/idea-completion/testData/smartMultiFile/Inheritors/KotlinInheritors.kt @@ -1,6 +1,6 @@ package p2 -trait KotlinTrait +interface KotlinTrait open class KotlinInheritor1 : KotlinTrait diff --git a/idea/idea-completion/testData/smartMultiFile/InheritorsAndMultipleExpectedTypes/Declarations.kt b/idea/idea-completion/testData/smartMultiFile/InheritorsAndMultipleExpectedTypes/Declarations.kt index 31cd7708387..7df64cde7b1 100644 --- a/idea/idea-completion/testData/smartMultiFile/InheritorsAndMultipleExpectedTypes/Declarations.kt +++ b/idea/idea-completion/testData/smartMultiFile/InheritorsAndMultipleExpectedTypes/Declarations.kt @@ -1,9 +1,9 @@ class X class Y -trait T1 -trait T2 -trait T3 +interface T1 +interface T2 +interface T3 class C1 : T1 class C2 : T2, T3 diff --git a/idea/idea-completion/testData/smartMultiFile/JavaStaticMethodArgument/JavaStaticMethodArgument.kt b/idea/idea-completion/testData/smartMultiFile/JavaStaticMethodArgument/JavaStaticMethodArgument.kt index 79e1bdc1c52..56c5a21d2d4 100644 --- a/idea/idea-completion/testData/smartMultiFile/JavaStaticMethodArgument/JavaStaticMethodArgument.kt +++ b/idea/idea-completion/testData/smartMultiFile/JavaStaticMethodArgument/JavaStaticMethodArgument.kt @@ -1,4 +1,4 @@ -trait X +interface X fun foo(x: X) { JavaClass.search() diff --git a/idea/idea-completion/testData/smartMultiFile/NoObjectDuplication/Declarations.kt b/idea/idea-completion/testData/smartMultiFile/NoObjectDuplication/Declarations.kt index 53c1a36d892..1e4c2a38108 100644 --- a/idea/idea-completion/testData/smartMultiFile/NoObjectDuplication/Declarations.kt +++ b/idea/idea-completion/testData/smartMultiFile/NoObjectDuplication/Declarations.kt @@ -1,4 +1,4 @@ -trait T +interface T object OO : T diff --git a/idea/resources/intentionDescriptions/ConvertMemberToExtensionIntention/description.html b/idea/resources/intentionDescriptions/ConvertMemberToExtensionIntention/description.html index db78e07a917..34223f341dc 100644 --- a/idea/resources/intentionDescriptions/ConvertMemberToExtensionIntention/description.html +++ b/idea/resources/intentionDescriptions/ConvertMemberToExtensionIntention/description.html @@ -1,5 +1,5 @@ -This intention converts a member of a class or trait into an extension to this class/trait. +This intention converts a member of a class or interface into an extension to this class/interface. \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt index 833d2a39de0..bfecca62cb3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspection.kt @@ -82,7 +82,6 @@ public class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspe private fun Diagnostic.isCleanup() = getFactory() in cleanupDiagnosticsFactories || isObsoleteLabel() private val cleanupDiagnosticsFactories = setOf( - Errors.DEPRECATED_TRAIT_KEYWORD, Errors.DEPRECATED_LAMBDA_SYNTAX, Errors.MISSING_CONSTRUCTOR_KEYWORD, Errors.FUNCTION_EXPRESSION_WITH_NAME, diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedTraitSyntaxFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedTraitSyntaxFix.kt deleted file mode 100644 index 96371716e0e..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/DeprecatedTraitSyntaxFix.kt +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.idea.quickfix - -import com.intellij.codeInsight.intention.IntentionAction -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.diagnostics.Diagnostic -import org.jetbrains.kotlin.idea.quickfix.quickfixUtil.createIntentionFactory -import org.jetbrains.kotlin.lexer.JetTokens -import org.jetbrains.kotlin.psi.JetClass -import org.jetbrains.kotlin.psi.JetFile -import org.jetbrains.kotlin.psi.JetPsiFactory - -public class DeprecatedTraitSyntaxFix(element: PsiElement): JetIntentionAction(element), CleanupFix { - override fun getFamilyName() = "Replace 'trait' with 'interface'" - override fun getText() = getFamilyName() - - override fun invoke(project: Project, editor: Editor?, file: JetFile) - = replaceWithInterfaceKeyword(element) - - - companion object : JetSingleIntentionActionFactory() { - fun replaceWithInterfaceKeyword(element: PsiElement) { - val cls = JetPsiFactory(element.getProject()).createClass("interface A {}") - element.replace(cls.getNode().findChildByType(JetTokens.INTERFACE_KEYWORD)!!.getPsi()) - } - - override fun createAction(diagnostic: Diagnostic): IntentionAction = - DeprecatedTraitSyntaxFix(diagnostic.getPsiElement()) - - public fun createWholeProjectFixFactory(): JetSingleIntentionActionFactory = createIntentionFactory { - JetWholeProjectForEachElementOfTypeFix.createByPredicate( - predicate = { it.getNode().findChildByType(JetTokens.TRAIT_KEYWORD) != null }, - taskProcessor = { replaceWithInterfaceKeyword(it.getNode().findChildByType(JetTokens.TRAIT_KEYWORD)!!.getPsi())}, - name = "Replace 'trait' with 'interface' in whole project" - ) - } - } -} diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt index d1f54bae799..1901e5c8da5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt @@ -105,7 +105,6 @@ public class QuickFixRegistrar : QuickFixContributor { val removeRedundantModifierFactory = RemoveModifierFix.createRemoveModifierFactory(true) REDUNDANT_MODIFIER.registerFactory(removeRedundantModifierFactory) ABSTRACT_MODIFIER_IN_TRAIT.registerFactory(RemoveModifierFix.createRemoveModifierFromListOwnerFactory(ABSTRACT_KEYWORD, true)) - DEPRECATED_TRAIT_KEYWORD.registerFactory(DeprecatedTraitSyntaxFix, DeprecatedTraitSyntaxFix.createWholeProjectFixFactory()) REDUNDANT_PROJECTION.registerFactory(RemoveModifierFix.createRemoveProjectionFactory(true)) INCOMPATIBLE_MODIFIERS.registerFactory(RemoveModifierFix.createRemoveModifierFactory(false)) diff --git a/idea/testData/inspections/cleanup/cleanup.kt b/idea/testData/inspections/cleanup/cleanup.kt index 86be68f4e90..abd6d73001d 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt +++ b/idea/testData/inspections/cleanup/cleanup.kt @@ -2,9 +2,6 @@ import pack.oldFun1 import pack.oldFun2 // should not be removed for non-deprecated overload used import pack.oldFun3 -trait Foo { -} - val f = { (a: Int, b: Int) -> a + b } class A private() diff --git a/idea/testData/inspections/cleanup/cleanup.kt.after b/idea/testData/inspections/cleanup/cleanup.kt.after index 8a8bafb8e90..b2b4fae6b09 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt.after +++ b/idea/testData/inspections/cleanup/cleanup.kt.after @@ -1,9 +1,6 @@ import pack.bar import pack.oldFun2 // should not be removed for non-deprecated overload used -interface Foo { -} - val f = { a: Int, b: Int -> a + b } class A private constructor() diff --git a/idea/testData/intentions/declarations/convertMemberToExtension/override.kt b/idea/testData/intentions/declarations/convertMemberToExtension/override.kt index 6100317afb1..0b957b31c45 100644 --- a/idea/testData/intentions/declarations/convertMemberToExtension/override.kt +++ b/idea/testData/intentions/declarations/convertMemberToExtension/override.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -trait I { +interface I { fun foo() } diff --git a/idea/testData/intentions/removeExplicitType/onOverride.kt b/idea/testData/intentions/removeExplicitType/onOverride.kt index 0fb5b75c1e8..b289c741093 100644 --- a/idea/testData/intentions/removeExplicitType/onOverride.kt +++ b/idea/testData/intentions/removeExplicitType/onOverride.kt @@ -1,4 +1,4 @@ -public trait I { +public interface I { public fun foo(): String } diff --git a/idea/testData/intentions/removeExplicitType/onOverride.kt.after b/idea/testData/intentions/removeExplicitType/onOverride.kt.after index a7f04465cfa..7d86f735680 100644 --- a/idea/testData/intentions/removeExplicitType/onOverride.kt.after +++ b/idea/testData/intentions/removeExplicitType/onOverride.kt.after @@ -1,4 +1,4 @@ -public trait I { +public interface I { public fun foo(): String } diff --git a/idea/testData/intentions/removeExplicitType/onOverrideInTrait.kt b/idea/testData/intentions/removeExplicitType/onOverrideInTrait.kt index 111ec79cf3b..6fe6e355698 100644 --- a/idea/testData/intentions/removeExplicitType/onOverrideInTrait.kt +++ b/idea/testData/intentions/removeExplicitType/onOverrideInTrait.kt @@ -1,8 +1,8 @@ // IS_APPLICABLE: false -public trait I { +public interface I { public val v: String? } -public trait I1 : I { +public interface I1 : I { override val v: String } \ No newline at end of file diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt b/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt index 3a74370e8eb..0df98bd30eb 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt +++ b/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt @@ -1,6 +1,6 @@ // "Replace with 'x'" "true" -trait X { +interface X { @Deprecated("", ReplaceWith("x")) fun getX(): String diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt.after index 7582c5cc12c..430932c20c2 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/methodToProperty.kt.after @@ -1,6 +1,6 @@ // "Replace with 'x'" "true" -trait X { +interface X { @Deprecated("", ReplaceWith("x")) fun getX(): String diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt b/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt index de499751bec..2d521aa021c 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt +++ b/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt @@ -1,6 +1,6 @@ // "Replace with 'getX()'" "true" -trait X { +interface X { @Deprecated("", ReplaceWith("getX()")) val x: String diff --git a/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt.after b/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt.after index e82ef33789d..f3ab51c5cd6 100644 --- a/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt.after +++ b/idea/testData/quickfix/deprecatedSymbolUsage/propertyToMethod.kt.after @@ -1,6 +1,6 @@ // "Replace with 'getX()'" "true" -trait X { +interface X { @Deprecated("", ReplaceWith("getX()")) val x: String diff --git a/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt b/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt deleted file mode 100644 index bea391b1e06..00000000000 --- a/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt +++ /dev/null @@ -1,5 +0,0 @@ -// "Replace 'trait' with 'interface'" "true" - -trait Foo { - -} diff --git a/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt.after b/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt.after deleted file mode 100644 index 95e00443c01..00000000000 --- a/idea/testData/quickfix/migration/traitToInterface/traitToInterface.kt.after +++ /dev/null @@ -1,5 +0,0 @@ -// "Replace 'trait' with 'interface'" "true" - -interface Foo { - -} diff --git a/idea/testData/quickfix/supertypeInitialization/genericClass.kt b/idea/testData/quickfix/supertypeInitialization/genericClass.kt index 4515df16c38..954b72a377f 100644 --- a/idea/testData/quickfix/supertypeInitialization/genericClass.kt +++ b/idea/testData/quickfix/supertypeInitialization/genericClass.kt @@ -1,5 +1,5 @@ // "Add constructor parameters from Base(T, String, Base?)" "true" -trait I +interface I open class Base(p1: T1, p2: T2, p3: Base?) diff --git a/idea/testData/quickfix/supertypeInitialization/genericClass.kt.after b/idea/testData/quickfix/supertypeInitialization/genericClass.kt.after index fc34be18a21..6271c758ffa 100644 --- a/idea/testData/quickfix/supertypeInitialization/genericClass.kt.after +++ b/idea/testData/quickfix/supertypeInitialization/genericClass.kt.after @@ -1,5 +1,5 @@ // "Add constructor parameters from Base(T, String, Base?)" "true" -trait I +interface I open class Base(p1: T1, p2: T2, p3: Base?) diff --git a/idea/testData/refactoring/rename/automaticRenamerParameter/after/main.kt b/idea/testData/refactoring/rename/automaticRenamerParameter/after/main.kt index d74c10cf373..4956257bcdc 100644 --- a/idea/testData/refactoring/rename/automaticRenamerParameter/after/main.kt +++ b/idea/testData/refactoring/rename/automaticRenamerParameter/after/main.kt @@ -1,6 +1,6 @@ package testing -trait Trait { +interface Trait { open fun foo(aa: Int, b: String) { } } diff --git a/idea/testData/refactoring/rename/automaticRenamerParameter/before/main.kt b/idea/testData/refactoring/rename/automaticRenamerParameter/before/main.kt index 4bdaae4e277..2f5d8ab78ca 100644 --- a/idea/testData/refactoring/rename/automaticRenamerParameter/before/main.kt +++ b/idea/testData/refactoring/rename/automaticRenamerParameter/before/main.kt @@ -1,6 +1,6 @@ package testing -trait Trait { +interface Trait { open fun foo(a: Int, b: String) { } } diff --git a/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/after/main.kt b/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/after/main.kt index d62271b19a0..6ad71794bcd 100644 --- a/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/after/main.kt +++ b/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/after/main.kt @@ -1,6 +1,6 @@ package testing -trait Trait { +interface Trait { open fun Int.foo(aa: Int, b: String) { } } diff --git a/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/before/main.kt b/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/before/main.kt index a32d6e9590b..cb980b4bf47 100644 --- a/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/before/main.kt +++ b/idea/testData/refactoring/rename/automaticRenamerParameterInExtension/before/main.kt @@ -1,6 +1,6 @@ package testing -trait Trait { +interface Trait { open fun Int.foo(a: Int, b: String) { } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt index a4bf37ec282..a098615a025 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/codeInsight/smartEnter/SmartEnterTest.kt @@ -16,11 +16,11 @@ package org.jetbrains.kotlin.idea.codeInsight.smartEnter -import org.jetbrains.kotlin.idea.test.JetLightCodeInsightFixtureTestCase import com.intellij.openapi.actionSystem.IdeActions -import org.jetbrains.kotlin.idea.JetFileType import com.intellij.testFramework.LightProjectDescriptor import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase +import org.jetbrains.kotlin.idea.JetFileType +import org.jetbrains.kotlin.idea.test.JetLightCodeInsightFixtureTestCase class SmartEnterTest : JetLightCodeInsightFixtureTestCase() { fun testIfCondition() = doFunTest( @@ -878,13 +878,13 @@ class SmartEnterTest : JetLightCodeInsightFixtureTestCase() { fun testFunBody3() = doFileTest( """ - trait Some { + interface Some { fun (p: Int) } """ , """ - trait Some { + interface Some { fun(p: Int) } diff --git a/idea/tests/org/jetbrains/kotlin/idea/stubs/JetStubsTest.java b/idea/tests/org/jetbrains/kotlin/idea/stubs/JetStubsTest.java index c828c31a3cb..d6d6a43d78d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/stubs/JetStubsTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/stubs/JetStubsTest.java @@ -46,7 +46,7 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase { } public void testClassIsTrait() { - PsiFile psiFile = myFixture.configureByText("foo.kt", "trait Test { }"); + PsiFile psiFile = myFixture.configureByText("foo.kt", "interface Test { }"); List declarations = ((JetFile) psiFile).getDeclarations(); JetClass jetClass = (JetClass) declarations.get(0); KotlinClassStub stub = JetStubElementTypes.CLASS.createStub(jetClass, null); diff --git a/j2k/testData/KotlinApi.kt b/j2k/testData/KotlinApi.kt index d2b8fddf665..ca753774907 100644 --- a/j2k/testData/KotlinApi.kt +++ b/j2k/testData/KotlinApi.kt @@ -18,7 +18,7 @@ public open class KotlinClass(public var field: Int) { } } -public trait KotlinTrait { +public interface KotlinTrait { public fun nullableFun(): String? public fun notNullableFun(): String diff --git a/j2k/testData/fileOrElement/identifier/keywords.java b/j2k/testData/fileOrElement/identifier/keywords.java index 98414215cb4..bb210e7ddaa 100644 --- a/j2k/testData/fileOrElement/identifier/keywords.java +++ b/j2k/testData/fileOrElement/identifier/keywords.java @@ -1,2 +1,2 @@ //statement -int as, type, val, var, fun, is, in, object, when, trait, This; \ No newline at end of file +int as, type, val, var, fun, is, in, object, when, This; \ No newline at end of file diff --git a/j2k/testData/fileOrElement/identifier/keywords.kt b/j2k/testData/fileOrElement/identifier/keywords.kt index 8554ed9b603..144ed11e938 100644 --- a/j2k/testData/fileOrElement/identifier/keywords.kt +++ b/j2k/testData/fileOrElement/identifier/keywords.kt @@ -7,5 +7,4 @@ val `is`: Int val `in`: Int val `object`: Int val `when`: Int -val `trait`: Int val `This`: Int \ No newline at end of file diff --git a/j2k/testData/fileOrElement/importStatement/importWithKeywords.java b/j2k/testData/fileOrElement/importStatement/importWithKeywords.java index 10f4a3ae578..a0fd7fa6664 100644 --- a/j2k/testData/fileOrElement/importStatement/importWithKeywords.java +++ b/j2k/testData/fileOrElement/importStatement/importWithKeywords.java @@ -1,6 +1,6 @@ //file package test; -import as.type.val.var.fun.is.in.object.when.trait.This; +import as.type.val.var.fun.is.in.object.when.This; class Test {} \ No newline at end of file diff --git a/j2k/testData/fileOrElement/importStatement/importWithKeywords.kt b/j2k/testData/fileOrElement/importStatement/importWithKeywords.kt index 4f6cc97a0b1..cceda6680c2 100644 --- a/j2k/testData/fileOrElement/importStatement/importWithKeywords.kt +++ b/j2k/testData/fileOrElement/importStatement/importWithKeywords.kt @@ -1,6 +1,6 @@ // ERROR: Unresolved reference: `as` package test -import `as`.type.`val`.`var`.`fun`.`is`.`in`.`object`.`when`.`trait`.`This` +import `as`.type.`val`.`var`.`fun`.`is`.`in`.`object`.`when`.`This` internal class Test \ No newline at end of file diff --git a/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.java b/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.java index 4ac9ae7db93..c7d3cf89390 100644 --- a/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.java +++ b/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.java @@ -1,2 +1,2 @@ //statement -when(open, trait); \ No newline at end of file +when(open); \ No newline at end of file diff --git a/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.kt b/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.kt index 489e2d97b10..fa1aa02faf6 100644 --- a/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.kt +++ b/j2k/testData/fileOrElement/methodCallExpression/callWithKeywords.kt @@ -1 +1 @@ -`when`(open, `trait`) \ No newline at end of file +`when`(open) \ No newline at end of file diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt index 5b9286bd4f7..f4709719d65 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt @@ -16,10 +16,10 @@ package org.jetbrains.kotlin.jps.build -import org.jetbrains.jps.incremental.ModuleBuildTarget import org.jetbrains.jps.incremental.CompileContext +import org.jetbrains.jps.incremental.ModuleBuildTarget -public trait KotlinJpsCompilerArgumentsProvider { +public interface KotlinJpsCompilerArgumentsProvider { public fun getExtraArguments(moduleBuildTarget: ModuleBuildTarget, context: CompileContext): List public fun getClasspath(moduleBuildTarget: ModuleBuildTarget, context: CompileContext): List } \ No newline at end of file diff --git a/jps-plugin/test/org/jetbrains/kotlin/jps/build/SimpleKotlinJpsBuildTest.kt b/jps-plugin/test/org/jetbrains/kotlin/jps/build/SimpleKotlinJpsBuildTest.kt index ef23610fde3..3b1a7f395b5 100644 --- a/jps-plugin/test/org/jetbrains/kotlin/jps/build/SimpleKotlinJpsBuildTest.kt +++ b/jps-plugin/test/org/jetbrains/kotlin/jps/build/SimpleKotlinJpsBuildTest.kt @@ -35,7 +35,7 @@ public class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() { """ package m1; - trait K { + interface K { } """) createFile("m1/J.java", @@ -53,7 +53,7 @@ public class SimpleKotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() { import m1.J; import m1.K; - trait M2: J { + interface M2: J { override fun bar(): K } """) diff --git a/jps-plugin/testData/general/DependencyToOldKotlinLib/module/src/module/A.kt b/jps-plugin/testData/general/DependencyToOldKotlinLib/module/src/module/A.kt index b57a44e4536..3314395f737 100644 --- a/jps-plugin/testData/general/DependencyToOldKotlinLib/module/src/module/A.kt +++ b/jps-plugin/testData/general/DependencyToOldKotlinLib/module/src/module/A.kt @@ -1,6 +1,6 @@ package module -public trait A { +public interface A { fun oldFun(): Int = 1 fun newFun(): Int = 42 } diff --git a/jps-plugin/testData/general/DependencyToOldKotlinLib/oldModuleLib/src/module/A.kt b/jps-plugin/testData/general/DependencyToOldKotlinLib/oldModuleLib/src/module/A.kt index 0a6c17d7a78..a54a9569787 100644 --- a/jps-plugin/testData/general/DependencyToOldKotlinLib/oldModuleLib/src/module/A.kt +++ b/jps-plugin/testData/general/DependencyToOldKotlinLib/oldModuleLib/src/module/A.kt @@ -1,5 +1,5 @@ package module -public trait A { +public interface A { fun oldFun(): Int = 1 } diff --git a/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt b/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt index 073204a43e1..6d7566e3856 100644 --- a/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt +++ b/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt @@ -1,6 +1,6 @@ package test -trait Trait { +interface Trait { companion object { // Old and new constant values are different, but their hashes are the same val CONST = "BF" diff --git a/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt.new b/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt.new index 86cc1439efd..23bfae9ef54 100644 --- a/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt.new +++ b/jps-plugin/testData/incremental/pureKotlin/traitClassObjectConstantChanged/const.kt.new @@ -1,6 +1,6 @@ package test -trait Trait { +interface Trait { companion object { // Old and new constant values are different, but their hashes are the same val CONST = "Ae" diff --git a/js/js.libraries/src/core/debug.kt b/js/js.libraries/src/core/debug.kt index f6eb638e850..409d46a5e85 100644 --- a/js/js.libraries/src/core/debug.kt +++ b/js/js.libraries/src/core/debug.kt @@ -1,7 +1,7 @@ package kotlin.js // https://developer.mozilla.org/en/DOM/console -@native public trait Console { +@native public interface Console { @native public fun dir(o: Any): Unit = noImpl @native public fun error(vararg o: Any?): Unit = noImpl @native public fun info(vararg o: Any?): Unit = noImpl diff --git a/js/js.libraries/src/core/domViews.kt b/js/js.libraries/src/core/domViews.kt index eda0edb1616..e33dc25cc2d 100644 --- a/js/js.libraries/src/core/domViews.kt +++ b/js/js.libraries/src/core/domViews.kt @@ -1,6 +1,6 @@ package org.w3c.dom.views @Deprecated("Use declarations from org.w3c.dom instead") -@native public trait AbstractView { +@native public interface AbstractView { } diff --git a/js/js.libraries/src/core/htmlDom.kt b/js/js.libraries/src/core/htmlDom.kt index d0a211c1863..8299a76c7be 100644 --- a/js/js.libraries/src/core/htmlDom.kt +++ b/js/js.libraries/src/core/htmlDom.kt @@ -11,15 +11,15 @@ public val window: Window = noImpl public var document: HTMLDocument = noImpl @Deprecated("Do not use it") -public @native trait Object { +public @native interface Object { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Image : HTMLImageElement { +public @native interface Image : HTMLImageElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Navigator { +public @native interface Navigator { public @native var userAgent: String public @native var product: String public @native var appVersion: String @@ -35,7 +35,7 @@ public @native trait Navigator { public @native fun preference(prefName: String): String } -public @native trait Screen { +public @native interface Screen { public @native var width: Double public @native var height: Double public @native var availHeight: Double @@ -45,7 +45,7 @@ public @native trait Screen { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Option { +public @native interface Option { public @native var defaultSelected: Boolean public @native var selected: Boolean public @native var text: String @@ -53,7 +53,7 @@ public @native trait Option { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Location { +public @native interface Location { public @native var href: String public @native var hash: String public @native var port: String @@ -68,7 +68,7 @@ public @native trait Location { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Event { +public @native interface Event { public @native var data: Array public @native var height: Double public @native var screenX: Double @@ -89,31 +89,31 @@ public @native trait Event { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Selection { +public @native interface Selection { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait CSSRule { +public @native interface CSSRule { public @native var selectorText: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Stylesheet { +public @native interface Stylesheet { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait History { +public @native interface History { public @native fun back(): Unit public @native fun forward(): Unit public @native fun go(count: Number): Unit } -public @native trait Console { +public @native interface Console { public @native fun log(message: Any): Unit } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait Window { +public @native interface Window { public @native val document: HTMLDocument public @native val event: Event public @native val navigator: Navigator @@ -164,7 +164,7 @@ public @native trait Window { public @native var onunload: () -> Unit } -public @native trait Global { +public @native interface Global { public @native val window: Window public @native fun escape(str: String): Unit public @native fun escape(): Unit @@ -173,14 +173,14 @@ public @native trait Global { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLCollection { +public @native interface HTMLCollection { public @native val length: Double public @native fun item(index: Number): Node? public @native fun namedItem(name: String): Node? } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLOptionsCollection { +public @native interface HTMLOptionsCollection { public @native val length: Double public @native fun item(index: Number): Node? public @native fun namedItem(name: String): Node? @@ -195,7 +195,7 @@ public @native class HTMLDocument : Document() { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLElement : Element { +public @native interface HTMLElement : Element { public @native var title: String public @native var lang: String public @native var dir: String @@ -221,7 +221,7 @@ public @native trait HTMLElement : Element { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait CSSStyleDeclaration { +public @native interface CSSStyleDeclaration { public @native var cssText: String public @native var length: Double public @native var parentRule: CSSRule @@ -233,17 +233,17 @@ public @native trait CSSStyleDeclaration { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLHtmlElement : HTMLElement { +public @native interface HTMLHtmlElement : HTMLElement { public @native var version: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLHeadElement : HTMLElement { +public @native interface HTMLHeadElement : HTMLElement { public @native var profile: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLLinkElement : HTMLElement { +public @native interface HTMLLinkElement : HTMLElement { public @native var disabled: Boolean public @native var charset: String public @native var href: String @@ -256,12 +256,12 @@ public @native trait HTMLLinkElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTitleElement : HTMLElement { +public @native interface HTMLTitleElement : HTMLElement { public @native var text: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLMetaElement : HTMLElement { +public @native interface HTMLMetaElement : HTMLElement { public @native var content: String public @native var httpEquiv: String public @native var name: String @@ -269,26 +269,26 @@ public @native trait HTMLMetaElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLBaseElement : HTMLElement { +public @native interface HTMLBaseElement : HTMLElement { public @native var href: String public @native var target: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLIsIndexElement : HTMLElement { +public @native interface HTMLIsIndexElement : HTMLElement { public @native val form: HTMLFormElement public @native var prompt: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLStyleElement : HTMLElement { +public @native interface HTMLStyleElement : HTMLElement { public @native var disabled: Boolean public @native var media: String public @native var type: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLBodyElement : HTMLElement { +public @native interface HTMLBodyElement : HTMLElement { public @native var aLink: String public @native var background: String public @native var bgColor: String @@ -300,7 +300,7 @@ public @native trait HTMLBodyElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLFormElement { +public @native interface HTMLFormElement { public @native val elements: HTMLCollection public @native val length: Double public @native var name: String @@ -314,7 +314,7 @@ public @native trait HTMLFormElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLSelectElement : HTMLElement { +public @native interface HTMLSelectElement : HTMLElement { public @native val type: String public @native var selectedIndex: Double public @native var value: String @@ -333,13 +333,13 @@ public @native trait HTMLSelectElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLOptGroupElement : HTMLElement { +public @native interface HTMLOptGroupElement : HTMLElement { public @native var disabled: Boolean public @native var label: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLOptionElement : HTMLElement { +public @native interface HTMLOptionElement : HTMLElement { public @native val form: HTMLFormElement public @native var defaultSelected: Boolean public @native var text: String @@ -351,7 +351,7 @@ public @native trait HTMLOptionElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLInputElement : HTMLElement { +public @native interface HTMLInputElement : HTMLElement { public @native var defaultValue: String public @native var defaultChecked: Boolean public @native val form: HTMLFormElement @@ -379,7 +379,7 @@ public @native trait HTMLInputElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTextAreaElement : HTMLElement { +public @native interface HTMLTextAreaElement : HTMLElement { public @native var defaultValue: String public @native val form: HTMLFormElement public @native var accessKey: String @@ -397,7 +397,7 @@ public @native trait HTMLTextAreaElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLButtonElement : HTMLElement { +public @native interface HTMLButtonElement : HTMLElement { public @native val form: HTMLFormElement public @native var accessKey: String public @native var disabled: Boolean @@ -408,104 +408,104 @@ public @native trait HTMLButtonElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLLabelElement : HTMLElement { +public @native interface HTMLLabelElement : HTMLElement { public @native val form: HTMLFormElement public @native var accessKey: String public @native var htmlFor: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLFieldSetElement : HTMLElement { +public @native interface HTMLFieldSetElement : HTMLElement { public @native val form: HTMLFormElement } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLLegendElement : HTMLElement { +public @native interface HTMLLegendElement : HTMLElement { public @native val form: HTMLFormElement public @native var accessKey: String public @native var align: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLUListElement : HTMLElement { +public @native interface HTMLUListElement : HTMLElement { public @native var compact: Boolean public @native var type: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLOListElement : HTMLElement { +public @native interface HTMLOListElement : HTMLElement { public @native var compact: Boolean public @native var start: Double public @native var type: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLDListElement : HTMLElement { +public @native interface HTMLDListElement : HTMLElement { public @native var compact: Boolean } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLDirectoryElement : HTMLElement { +public @native interface HTMLDirectoryElement : HTMLElement { public @native var compact: Boolean } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLMenuElement : HTMLElement { +public @native interface HTMLMenuElement : HTMLElement { public @native var compact: Boolean } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLLIElement : HTMLElement { +public @native interface HTMLLIElement : HTMLElement { public @native var type: String public @native var value: Double } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLDivElement : HTMLElement { +public @native interface HTMLDivElement : HTMLElement { public @native var align: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLParagraphElement : HTMLElement { +public @native interface HTMLParagraphElement : HTMLElement { public @native var align: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLHeadingElement : HTMLElement { +public @native interface HTMLHeadingElement : HTMLElement { public @native var align: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLQuoteElement : HTMLElement { +public @native interface HTMLQuoteElement : HTMLElement { public @native var cite: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLPreElement : HTMLElement { +public @native interface HTMLPreElement : HTMLElement { public @native var width: Double } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLBRElement : HTMLElement { +public @native interface HTMLBRElement : HTMLElement { public @native var clear: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLBaseFontElement : HTMLElement { +public @native interface HTMLBaseFontElement : HTMLElement { public @native var color: String public @native var face: String public @native var size: Double } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLFontElement : HTMLElement { +public @native interface HTMLFontElement : HTMLElement { public @native var color: String public @native var face: String public @native var size: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLHRElement : HTMLElement { +public @native interface HTMLHRElement : HTMLElement { public @native var align: String public @native var noShade: Boolean public @native var size: String @@ -513,13 +513,13 @@ public @native trait HTMLHRElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLModElement : HTMLElement { +public @native interface HTMLModElement : HTMLElement { public @native var cite: String public @native var dateTime: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLAnchorElement : HTMLElement { +public @native interface HTMLAnchorElement : HTMLElement { public @native var accessKey: String public @native var charset: String public @native var coords: String @@ -537,7 +537,7 @@ public @native trait HTMLAnchorElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLImageElement : HTMLElement { +public @native interface HTMLImageElement : HTMLElement { public @native var name: String public @native var align: String public @native var alt: String @@ -555,7 +555,7 @@ public @native trait HTMLImageElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLObjectElement : HTMLElement { +public @native interface HTMLObjectElement : HTMLElement { public @native val form: HTMLFormElement public @native var code: String public @native var align: String @@ -578,7 +578,7 @@ public @native trait HTMLObjectElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLParamElement : HTMLElement { +public @native interface HTMLParamElement : HTMLElement { public @native var name: String public @native var type: String public @native var value: String @@ -586,7 +586,7 @@ public @native trait HTMLParamElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLAppletElement : HTMLElement { +public @native interface HTMLAppletElement : HTMLElement { public @native var align: String public @native var alt: String public @native var archive: String @@ -601,13 +601,13 @@ public @native trait HTMLAppletElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLMapElement : HTMLElement { +public @native interface HTMLMapElement : HTMLElement { public @native val areas: HTMLCollection public @native var name: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLAreaElement : HTMLElement { +public @native interface HTMLAreaElement : HTMLElement { public @native var accessKey: String public @native var alt: String public @native var coords: String @@ -619,7 +619,7 @@ public @native trait HTMLAreaElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLScriptElement : HTMLElement { +public @native interface HTMLScriptElement : HTMLElement { public @native var text: String public @native var htmlFor: String public @native var event: String @@ -630,7 +630,7 @@ public @native trait HTMLScriptElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableElement : HTMLElement { +public @native interface HTMLTableElement : HTMLElement { public @native var caption: HTMLTableCaptionElement public @native var tHead: HTMLTableSectionElement public @native var tFoot: HTMLTableSectionElement @@ -656,12 +656,12 @@ public @native trait HTMLTableElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableCaptionElement : HTMLElement { +public @native interface HTMLTableCaptionElement : HTMLElement { public @native var align: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableColElement : HTMLElement { +public @native interface HTMLTableColElement : HTMLElement { public @native var align: String public @native var ch: String public @native var chOff: String @@ -671,7 +671,7 @@ public @native trait HTMLTableColElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableSectionElement : HTMLElement { +public @native interface HTMLTableSectionElement : HTMLElement { public @native var align: String public @native var ch: String public @native var chOff: String @@ -682,7 +682,7 @@ public @native trait HTMLTableSectionElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableRowElement : HTMLElement { +public @native interface HTMLTableRowElement : HTMLElement { public @native val rowIndex: Double public @native val sectionRowIndex: Double public @native val cells: HTMLCollection @@ -696,7 +696,7 @@ public @native trait HTMLTableRowElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLTableCellElement : HTMLElement { +public @native interface HTMLTableCellElement : HTMLElement { public @native val cellIndex: Double public @native var abbr: String public @native var align: String @@ -715,13 +715,13 @@ public @native trait HTMLTableCellElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLFrameSetElement : HTMLElement { +public @native interface HTMLFrameSetElement : HTMLElement { public @native var cols: String public @native var rows: String } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLFrameElement : HTMLElement { +public @native interface HTMLFrameElement : HTMLElement { public @native var frameBorder: String public @native var longDesc: String public @native var marginHeight: String @@ -733,7 +733,7 @@ public @native trait HTMLFrameElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLIFrameElement : HTMLElement { +public @native interface HTMLIFrameElement : HTMLElement { public @native var align: String public @native var frameBorder: String public @native var height: String diff --git a/js/js.libraries/src/core/javaio.kt b/js/js.libraries/src/core/javaio.kt index 37b3a12ce5a..96734485bdd 100644 --- a/js/js.libraries/src/core/javaio.kt +++ b/js/js.libraries/src/core/javaio.kt @@ -4,8 +4,8 @@ package java.io public class IOException(message: String = "") : Exception() {} @library -public trait Closeable { +public interface Closeable { public open fun close() : Unit; } -trait Serializable +interface Serializable diff --git a/js/js.libraries/src/core/javalang.kt b/js/js.libraries/src/core/javalang.kt index 03b28418c64..95dc09696a5 100644 --- a/js/js.libraries/src/core/javalang.kt +++ b/js/js.libraries/src/core/javalang.kt @@ -28,7 +28,7 @@ public class NumberFormatException(message: String? = null) : RuntimeException(m public class NullPointerException(message: String? = null) : RuntimeException(message) {} @library -public trait Runnable { +public interface Runnable { public open fun run() : Unit; } @@ -37,7 +37,7 @@ public fun Runnable(action: () -> Unit): Runnable = object : Runnable { } @library -public trait Appendable { +public interface Appendable { public open fun append(csq: CharSequence?): Appendable public open fun append(csq: CharSequence?, start: Int, end: Int): Appendable public open fun append(c: Char): Appendable diff --git a/js/js.libraries/src/core/javautil.kt b/js/js.libraries/src/core/javautil.kt index f1cc0531619..965500a6939 100644 --- a/js/js.libraries/src/core/javautil.kt +++ b/js/js.libraries/src/core/javautil.kt @@ -7,7 +7,7 @@ private val DEFAULT_INITIAL_CAPACITY = 16 private val DEFAULT_LOAD_FACTOR = 0.75f @library -public trait Comparator { +public interface Comparator { public fun compare(obj1: T, obj2: T): Int; } @@ -85,7 +85,7 @@ public open class HashSet( } @library -public trait SortedSet : Set { +public interface SortedSet : Set { } @library @@ -128,7 +128,7 @@ public open class LinkedHashMap( public open class NoSuchElementException(message: String? = null) : Exception() {} @library -public trait Enumeration { +public interface Enumeration { public fun hasMoreElements(): Boolean public fun nextElement(): E } diff --git a/js/js.libraries/src/core/json.kt b/js/js.libraries/src/core/json.kt index 4b8ed523c7d..c8e1af33758 100644 --- a/js/js.libraries/src/core/json.kt +++ b/js/js.libraries/src/core/json.kt @@ -17,7 +17,7 @@ public fun json(vararg pairs: Pair): Json { public fun Json.add(other: Json): Json = noImpl @native -public trait JsonClass { +public interface JsonClass { public fun stringify(o: Any): String public fun stringify(o: Any, replacer: (key: String, value: Any?)->Any?): String public fun stringify(o: Any, replacer: (key: String, value: Any?)->Any?, space: Int): String diff --git a/js/js.libraries/src/core/regexp.kt b/js/js.libraries/src/core/regexp.kt index c35736a7223..1fdfaa18001 100644 --- a/js/js.libraries/src/core/regexp.kt +++ b/js/js.libraries/src/core/regexp.kt @@ -40,7 +40,7 @@ public fun RegExp.reset() { } -@native public trait RegExpMatch { +@native public interface RegExpMatch { public val index: Int public val input: String } diff --git a/js/js.libraries/src/html5/canvas.kt b/js/js.libraries/src/html5/canvas.kt index 472affd8cab..28b6b1d0486 100644 --- a/js/js.libraries/src/html5/canvas.kt +++ b/js/js.libraries/src/html5/canvas.kt @@ -4,7 +4,7 @@ import kotlin.js.dom.html.HTMLElement import org.w3c.dom.Element @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait HTMLCanvasElement : HTMLElement { +public @native interface HTMLCanvasElement : HTMLElement { public var width: Double public var height: Double public fun getContext(contextId: String, vararg attributes: Any): CanvasContext? @@ -14,7 +14,7 @@ public @native trait HTMLCanvasElement : HTMLElement { } @Deprecated("Use declarations from org.w3c.dom instead. See CanvasRenderingContext2D") -public @native trait CanvasContext { +public @native interface CanvasContext { public var canvas: HTMLCanvasElement public fun save(): Unit public fun restore(): Unit @@ -79,23 +79,23 @@ public @native trait CanvasContext { } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait CanvasGradient { +public @native interface CanvasGradient { public fun addColorStop(offset: Number, color: String): Unit } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait ImageData { +public @native interface ImageData { public var data: CanvasPixelArray public var width: Double public var height: Double } -public @native trait CanvasPixelArray { +public @native interface CanvasPixelArray { public var length: Double } @Deprecated("Use declarations from org.w3c.dom instead") -public @native trait TextMetrics { +public @native interface TextMetrics { public var width: Double } diff --git a/js/js.libraries/src/html5/files.kt b/js/js.libraries/src/html5/files.kt index 473642cf0c1..bee06c47834 100644 --- a/js/js.libraries/src/html5/files.kt +++ b/js/js.libraries/src/html5/files.kt @@ -41,6 +41,6 @@ public open class Blob(blobParts: Array? = undefined, options: BlobProperty @native @Deprecated("Use org.w3c.dom") -public trait BlobPropertyBag { +public interface BlobPropertyBag { public val type: String } \ No newline at end of file diff --git a/js/js.translator/testData/classObject/cases/inTrait.kt b/js/js.translator/testData/classObject/cases/inTrait.kt index 55c2256a745..47795f8a56c 100644 --- a/js/js.translator/testData/classObject/cases/inTrait.kt +++ b/js/js.translator/testData/classObject/cases/inTrait.kt @@ -1,6 +1,6 @@ package foo -trait A { +interface A { companion object { val OK: String = "OK" } diff --git a/js/js.translator/testData/classObject/cases/namedClassObject.kt b/js/js.translator/testData/classObject/cases/namedClassObject.kt index ed61b8dcd94..d1cc685d62c 100644 --- a/js/js.translator/testData/classObject/cases/namedClassObject.kt +++ b/js/js.translator/testData/classObject/cases/namedClassObject.kt @@ -1,6 +1,6 @@ package foo -trait Named { +interface Named { companion object Bar { val g = "a"; } diff --git a/js/js.translator/testData/defaultArguments/cases/virtualCallWithDefArg.kt b/js/js.translator/testData/defaultArguments/cases/virtualCallWithDefArg.kt index aa5541b729e..c4f36765863 100644 --- a/js/js.translator/testData/defaultArguments/cases/virtualCallWithDefArg.kt +++ b/js/js.translator/testData/defaultArguments/cases/virtualCallWithDefArg.kt @@ -1,6 +1,6 @@ package foo -trait A { +interface A { fun bar2(arg: Int = 239): Int fun bar(arg: Int = 240): Int = bar2(arg / 2) diff --git a/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt b/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt index 2b6e717d464..5ae43c8ad8b 100644 --- a/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt +++ b/js/js.translator/testData/delegateProperty/cases/propertyMetadata.kt @@ -1,6 +1,6 @@ package foo -trait WithName { +interface WithName { var name: String } diff --git a/js/js.translator/testData/delegateProperty/cases/simple.kt b/js/js.translator/testData/delegateProperty/cases/simple.kt index a3c7f476953..ce4982a2af6 100644 --- a/js/js.translator/testData/delegateProperty/cases/simple.kt +++ b/js/js.translator/testData/delegateProperty/cases/simple.kt @@ -1,6 +1,6 @@ package foo -trait WithNumber { +interface WithNumber { var number: Int } diff --git a/js/js.translator/testData/delegateProperty/cases/withGenerics.kt b/js/js.translator/testData/delegateProperty/cases/withGenerics.kt index edd45355ea8..b55c221ed2f 100644 --- a/js/js.translator/testData/delegateProperty/cases/withGenerics.kt +++ b/js/js.translator/testData/delegateProperty/cases/withGenerics.kt @@ -1,6 +1,6 @@ package foo -trait Getter { +interface Getter { fun get(): T } diff --git a/js/js.translator/testData/delegation/cases/delegation2.kt b/js/js.translator/testData/delegation/cases/delegation2.kt index 348b9f177c8..ae20c348340 100644 --- a/js/js.translator/testData/delegation/cases/delegation2.kt +++ b/js/js.translator/testData/delegation/cases/delegation2.kt @@ -1,11 +1,11 @@ // This test was adapted from compiler/testData/codegen/box/classes package foo -trait Trait1 { +interface Trait1 { fun foo(): String } -trait Trait2 { +interface Trait2 { fun bar(): String } diff --git a/js/js.translator/testData/delegation/cases/delegation3.kt b/js/js.translator/testData/delegation/cases/delegation3.kt index 73646e4ca50..2cdaab8d1ee 100644 --- a/js/js.translator/testData/delegation/cases/delegation3.kt +++ b/js/js.translator/testData/delegation/cases/delegation3.kt @@ -1,11 +1,11 @@ // This test was adapted from compiler/testData/codegen/box/classes package foo -trait One { +interface One { public open fun foo(): Int public open fun faz(): Int = 10 } -trait Two { +interface Two { public open fun foo(): Int public open fun quux(): Int = 100 } diff --git a/js/js.translator/testData/delegation/cases/delegationByArg.kt b/js/js.translator/testData/delegation/cases/delegationByArg.kt index 0ab2e99976a..329b031bf92 100644 --- a/js/js.translator/testData/delegation/cases/delegationByArg.kt +++ b/js/js.translator/testData/delegation/cases/delegationByArg.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String var prop: String } diff --git a/js/js.translator/testData/delegation/cases/delegationByExprWithArgs.kt b/js/js.translator/testData/delegation/cases/delegationByExprWithArgs.kt index 8e7d3adc315..719e0d2240f 100644 --- a/js/js.translator/testData/delegation/cases/delegationByExprWithArgs.kt +++ b/js/js.translator/testData/delegation/cases/delegationByExprWithArgs.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(arg: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationByFunExpr.kt b/js/js.translator/testData/delegation/cases/delegationByFunExpr.kt index 0a2d87f62fb..6dbfa5228ee 100644 --- a/js/js.translator/testData/delegation/cases/delegationByFunExpr.kt +++ b/js/js.translator/testData/delegation/cases/delegationByFunExpr.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationByIfExpr.kt b/js/js.translator/testData/delegation/cases/delegationByIfExpr.kt index 4d3955d0704..f115490abe9 100644 --- a/js/js.translator/testData/delegation/cases/delegationByIfExpr.kt +++ b/js/js.translator/testData/delegation/cases/delegationByIfExpr.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationByInh.kt b/js/js.translator/testData/delegation/cases/delegationByInh.kt index a1a2fd48703..2b89c4483dd 100644 --- a/js/js.translator/testData/delegation/cases/delegationByInh.kt +++ b/js/js.translator/testData/delegation/cases/delegationByInh.kt @@ -1,14 +1,14 @@ package foo -trait Base { +interface Base { abstract fun foo(s: String): String var prop: String } -trait Base1 : Base { +interface Base1 : Base { } -trait Base2 : Base1 { +interface Base2 : Base1 { override fun foo(s: String): String = "Base2:foo ${s}" } diff --git a/js/js.translator/testData/delegation/cases/delegationByNewInstance.kt b/js/js.translator/testData/delegation/cases/delegationByNewInstance.kt index 3dd4a2bc22b..345595e396f 100644 --- a/js/js.translator/testData/delegation/cases/delegationByNewInstance.kt +++ b/js/js.translator/testData/delegation/cases/delegationByNewInstance.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationChain.kt b/js/js.translator/testData/delegation/cases/delegationChain.kt index 3122c18fcb4..60f23be6a32 100644 --- a/js/js.translator/testData/delegation/cases/delegationChain.kt +++ b/js/js.translator/testData/delegation/cases/delegationChain.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String var prop: String } diff --git a/js/js.translator/testData/delegation/cases/delegationEvaluationOrder1.kt b/js/js.translator/testData/delegation/cases/delegationEvaluationOrder1.kt index 4142f3eb395..f9181e9a8e3 100644 --- a/js/js.translator/testData/delegation/cases/delegationEvaluationOrder1.kt +++ b/js/js.translator/testData/delegation/cases/delegationEvaluationOrder1.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationEvaluationOrder2.kt b/js/js.translator/testData/delegation/cases/delegationEvaluationOrder2.kt index 915c9ea1afd..5be4b33daf2 100644 --- a/js/js.translator/testData/delegation/cases/delegationEvaluationOrder2.kt +++ b/js/js.translator/testData/delegation/cases/delegationEvaluationOrder2.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun foo(x: String): String } @@ -8,7 +8,7 @@ class BaseImpl(val s: String) : Base { override fun foo(x: String): String = "Base: ${s}:${x}" } -trait Base2 { +interface Base2 { abstract fun bar(x: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationExtFun1.kt b/js/js.translator/testData/delegation/cases/delegationExtFun1.kt index a3f86436ad9..3dcfdd7793c 100644 --- a/js/js.translator/testData/delegation/cases/delegationExtFun1.kt +++ b/js/js.translator/testData/delegation/cases/delegationExtFun1.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun Int.foo(): String } diff --git a/js/js.translator/testData/delegation/cases/delegationExtFun2.kt b/js/js.translator/testData/delegation/cases/delegationExtFun2.kt index c1f3e041ff6..06ef839e6e3 100644 --- a/js/js.translator/testData/delegation/cases/delegationExtFun2.kt +++ b/js/js.translator/testData/delegation/cases/delegationExtFun2.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { abstract fun String.foo(arg: String): String } diff --git a/js/js.translator/testData/delegation/cases/delegationExtProp.kt b/js/js.translator/testData/delegation/cases/delegationExtProp.kt index c9d37263fcc..258ceee5f2b 100644 --- a/js/js.translator/testData/delegation/cases/delegationExtProp.kt +++ b/js/js.translator/testData/delegation/cases/delegationExtProp.kt @@ -1,6 +1,6 @@ package foo -trait Base { +interface Base { var prop: String var Int.foo: String } diff --git a/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt b/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt index f31a63a7191..b49157aa65d 100644 --- a/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt +++ b/js/js.translator/testData/delegation/cases/delegationExtensionPropertyDelegated.kt @@ -2,7 +2,7 @@ package foo class State(var value: Int) -trait Base { +interface Base { var State.multiplied: Int } diff --git a/js/js.translator/testData/delegation/cases/delegationGenericArg.kt b/js/js.translator/testData/delegation/cases/delegationGenericArg.kt index 04eb57f7ab8..1b683c99112 100644 --- a/js/js.translator/testData/delegation/cases/delegationGenericArg.kt +++ b/js/js.translator/testData/delegation/cases/delegationGenericArg.kt @@ -1,7 +1,7 @@ // This test was adapted from compiler/testData/codegen/box/classes package foo -trait A { +interface A { fun foo(t: T): String } diff --git a/js/js.translator/testData/delegation/cases/delegationMethodsWithArgs.kt b/js/js.translator/testData/delegation/cases/delegationMethodsWithArgs.kt index dde24624dbc..3c41155e86f 100644 --- a/js/js.translator/testData/delegation/cases/delegationMethodsWithArgs.kt +++ b/js/js.translator/testData/delegation/cases/delegationMethodsWithArgs.kt @@ -1,15 +1,15 @@ // This test was adapted from compiler/testData/codegen/box/classes package foo -trait TextField { +interface TextField { fun getText(): String } -trait InputTextField : TextField { +interface InputTextField : TextField { fun setText(text: String) } -trait MooableTextField : InputTextField { +interface MooableTextField : InputTextField { fun moo(a: Int, b: Int, c: Int): Int } diff --git a/js/js.translator/testData/delegation/cases/onObject.kt b/js/js.translator/testData/delegation/cases/onObject.kt index 6fcfedcbae8..63e91202404 100644 --- a/js/js.translator/testData/delegation/cases/onObject.kt +++ b/js/js.translator/testData/delegation/cases/onObject.kt @@ -1,6 +1,6 @@ package foo -trait T { +interface T { fun foo(): String } diff --git a/js/js.translator/testData/enum/cases/enumInheritedFromTrait.kt b/js/js.translator/testData/enum/cases/enumInheritedFromTrait.kt index a13d7506618..7753e0ab65e 100644 --- a/js/js.translator/testData/enum/cases/enumInheritedFromTrait.kt +++ b/js/js.translator/testData/enum/cases/enumInheritedFromTrait.kt @@ -11,6 +11,6 @@ enum class MyEnum : T { } } -trait T { +interface T { fun f(): String } \ No newline at end of file diff --git a/js/js.translator/testData/enum/cases/enumWithInheritance.kt b/js/js.translator/testData/enum/cases/enumWithInheritance.kt index 74a75030167..74c033d16a3 100644 --- a/js/js.translator/testData/enum/cases/enumWithInheritance.kt +++ b/js/js.translator/testData/enum/cases/enumWithInheritance.kt @@ -14,7 +14,7 @@ enum class B(open val bar: Int) { var y = 12; } -trait X { +interface X { val foo: Int fun bar(): Int { return foo; diff --git a/js/js.translator/testData/examples/cases/funDelegation.kt b/js/js.translator/testData/examples/cases/funDelegation.kt index 00cedb1cda3..f779339376a 100644 --- a/js/js.translator/testData/examples/cases/funDelegation.kt +++ b/js/js.translator/testData/examples/cases/funDelegation.kt @@ -2,7 +2,7 @@ open class Base() { fun n(n: Int): Int = n + 1 } -trait Abstract { +interface Abstract { } class Derived1() : Base(), Abstract { diff --git a/js/js.translator/testData/examples/cases/propertyDelegation.kt b/js/js.translator/testData/examples/cases/propertyDelegation.kt index 8e3f239a957..b38849af870 100644 --- a/js/js.translator/testData/examples/cases/propertyDelegation.kt +++ b/js/js.translator/testData/examples/cases/propertyDelegation.kt @@ -10,7 +10,7 @@ open class Base() { } } -trait Abstract { +interface Abstract { } class Derived1() : Base(), Abstract { diff --git a/js/js.translator/testData/examples/cases/rightHandOverride.kt b/js/js.translator/testData/examples/cases/rightHandOverride.kt index 76cef58292e..131d8c27561 100644 --- a/js/js.translator/testData/examples/cases/rightHandOverride.kt +++ b/js/js.translator/testData/examples/cases/rightHandOverride.kt @@ -1,6 +1,6 @@ // Changed when traits were introduced. May not make sense any more -trait Left { +interface Left { } open class Right() { open fun f() = 42 diff --git a/js/js.translator/testData/examples/sortedTests/unsupported/basicmethod.kt b/js/js.translator/testData/examples/sortedTests/unsupported/basicmethod.kt index 33e6c67d064..bd5e24e1a02 100644 --- a/js/js.translator/testData/examples/sortedTests/unsupported/basicmethod.kt +++ b/js/js.translator/testData/examples/sortedTests/unsupported/basicmethod.kt @@ -1,6 +1,6 @@ import java.util.ArrayList -trait Tr { +interface Tr { fun extra(): String = "_" } diff --git a/js/js.translator/testData/examples/sortedTests/unsupported/enclosed.kt b/js/js.translator/testData/examples/sortedTests/unsupported/enclosed.kt index 4b6e8d36060..f3d5ae5daa6 100644 --- a/js/js.translator/testData/examples/sortedTests/unsupported/enclosed.kt +++ b/js/js.translator/testData/examples/sortedTests/unsupported/enclosed.kt @@ -1,8 +1,8 @@ -trait BK { +interface BK { fun x(): Int = 50 } -trait K : BK { +interface K : BK { override fun x(): Int = super.x() * 2 } diff --git a/js/js.translator/testData/examples/sortedTests/unsupported/inheritance.kt b/js/js.translator/testData/examples/sortedTests/unsupported/inheritance.kt index f0d06a2615f..9684e43a6c3 100644 --- a/js/js.translator/testData/examples/sortedTests/unsupported/inheritance.kt +++ b/js/js.translator/testData/examples/sortedTests/unsupported/inheritance.kt @@ -2,7 +2,7 @@ open class X(val x: Int) { } -trait Y { +interface Y { abstract val y: Int } @@ -13,7 +13,7 @@ class Point(x: Int, yy: Int) : X(x), Y { override val y: Int = yy } -trait Abstract { +interface Abstract { } class P1(x: Int, yy: Y) : Abstract, X(x), Y by yy { diff --git a/js/js.translator/testData/examples/sortedTests/unsupported/traitproperty.kt b/js/js.translator/testData/examples/sortedTests/unsupported/traitproperty.kt index 51c0f2893f5..4560051120f 100644 --- a/js/js.translator/testData/examples/sortedTests/unsupported/traitproperty.kt +++ b/js/js.translator/testData/examples/sortedTests/unsupported/traitproperty.kt @@ -1,4 +1,4 @@ -trait M { +interface M { var backingB: Int var b: Int get() = backingB diff --git a/js/js.translator/testData/expression/function/cases/manglingClashWithFunctionsWithoutParameters.kt b/js/js.translator/testData/expression/function/cases/manglingClashWithFunctionsWithoutParameters.kt index 5504fb6eff2..e7115f66db9 100644 --- a/js/js.translator/testData/expression/function/cases/manglingClashWithFunctionsWithoutParameters.kt +++ b/js/js.translator/testData/expression/function/cases/manglingClashWithFunctionsWithoutParameters.kt @@ -5,7 +5,7 @@ public fun foo(): Int = 4 public fun boo(): Int = 23 fun boo(i: Int): String = "boo" + i -trait T { +interface T { public fun foo(): Int public fun boo(): Int } diff --git a/js/js.translator/testData/expression/function/cases/manglingStability.kt b/js/js.translator/testData/expression/function/cases/manglingStability.kt index c0411525b2e..f917fbf5afa 100644 --- a/js/js.translator/testData/expression/function/cases/manglingStability.kt +++ b/js/js.translator/testData/expression/function/cases/manglingStability.kt @@ -127,7 +127,7 @@ public fun A.boo(): Int = 2 val public_ext_f = { A.(): Int -> this.foo() + this.foo } val public_ext_b = { A.(): Int -> this.boo() + this.boo } -trait TestPublicInTrait { +interface TestPublicInTrait { public fun foo(): Int = 2 public val foo: Int public val boo: Int @@ -137,7 +137,7 @@ trait TestPublicInTrait { val public_in_trait_f = { obj: TestPublicInTrait -> obj.foo() + obj.foo } val public_in_trait_b = { obj: TestPublicInTrait -> obj.boo() + obj.boo } -trait TestInternalInTrait { +interface TestInternalInTrait { fun foo(): Int = 2 val foo: Int val boo: Int diff --git a/js/js.translator/testData/expression/function/cases/overloadOverridenFun.kt b/js/js.translator/testData/expression/function/cases/overloadOverridenFun.kt index 71d5d0c3299..3f69520635a 100644 --- a/js/js.translator/testData/expression/function/cases/overloadOverridenFun.kt +++ b/js/js.translator/testData/expression/function/cases/overloadOverridenFun.kt @@ -2,7 +2,7 @@ package foo -trait I { +interface I { fun test(): String } diff --git a/js/js.translator/testData/expression/function/cases/overloadingWithInheritance.kt b/js/js.translator/testData/expression/function/cases/overloadingWithInheritance.kt index 41d51e3dcd8..91c2e031185 100644 --- a/js/js.translator/testData/expression/function/cases/overloadingWithInheritance.kt +++ b/js/js.translator/testData/expression/function/cases/overloadingWithInheritance.kt @@ -1,10 +1,10 @@ package foo -trait A { +interface A { fun foo(i: Int) = "A" } -trait B { +interface B { fun foo(s: String) = "B" } diff --git a/js/js.translator/testData/expression/misc/cases/KT-1361-2.kt b/js/js.translator/testData/expression/misc/cases/KT-1361-2.kt index 9c9b1c17ce7..d55fb39f489 100644 --- a/js/js.translator/testData/expression/misc/cases/KT-1361-2.kt +++ b/js/js.translator/testData/expression/misc/cases/KT-1361-2.kt @@ -30,7 +30,7 @@ class Color(r: Int, g: Int, b: Int) : ColorLike { override val blue: Int = b } -trait ColorLike { +interface ColorLike { val red: Int; val green: Int; val blue: Int; diff --git a/js/js.translator/testData/inheritance/cases/kt3499.kt b/js/js.translator/testData/inheritance/cases/kt3499.kt index d0b2f907a66..13b0b31e2e9 100644 --- a/js/js.translator/testData/inheritance/cases/kt3499.kt +++ b/js/js.translator/testData/inheritance/cases/kt3499.kt @@ -1,13 +1,13 @@ package foo -trait A : B, E -trait B +interface A : B, E +interface B open class C { fun foo() = true } -trait D -trait E -trait F : G, D -trait G +interface D +interface E +interface F : G, D +interface G fun box() = C().foo() \ No newline at end of file diff --git a/js/js.translator/testData/inlineMultiFile/cases/builders/builders.2.kt b/js/js.translator/testData/inlineMultiFile/cases/builders/builders.2.kt index d88d5581a52..18cfaf8c041 100644 --- a/js/js.translator/testData/inlineMultiFile/cases/builders/builders.2.kt +++ b/js/js.translator/testData/inlineMultiFile/cases/builders/builders.2.kt @@ -8,7 +8,7 @@ package foo import java.util.ArrayList import java.util.HashMap -trait Element { +interface Element { fun render(builder: StringBuilder, indent: String) override fun toString(): String { diff --git a/js/js.translator/testData/inlineMultiFile/cases/buildersAndLambdaCapturing/buildersAndLambdaCapturing.2.kt b/js/js.translator/testData/inlineMultiFile/cases/buildersAndLambdaCapturing/buildersAndLambdaCapturing.2.kt index 53181d20959..d27a8e86038 100644 --- a/js/js.translator/testData/inlineMultiFile/cases/buildersAndLambdaCapturing/buildersAndLambdaCapturing.2.kt +++ b/js/js.translator/testData/inlineMultiFile/cases/buildersAndLambdaCapturing/buildersAndLambdaCapturing.2.kt @@ -8,7 +8,7 @@ package foo import java.util.ArrayList import java.util.HashMap -trait Element { +interface Element { fun render(builder: StringBuilder, indent: String) override fun toString(): String { diff --git a/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt b/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt index ded57608acd..684585d863c 100644 --- a/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt +++ b/js/js.translator/testData/inlineMultiFile/cases/trait/trait.2.kt @@ -5,7 +5,7 @@ package test -internal trait InlineTrait { +internal interface InlineTrait { internal inline final fun finalInline(s: () -> String): String { return s() diff --git a/js/js.translator/testData/jsCode/cases/literal.kt b/js/js.translator/testData/jsCode/cases/literal.kt index 7f528402571..19d4b190041 100644 --- a/js/js.translator/testData/jsCode/cases/literal.kt +++ b/js/js.translator/testData/jsCode/cases/literal.kt @@ -1,6 +1,6 @@ package foo -@native trait HasName { +@native interface HasName { val name: String } diff --git a/js/js.translator/testData/jsCode/cases/object.kt b/js/js.translator/testData/jsCode/cases/object.kt index 41320e22eb0..7bcc47fb147 100644 --- a/js/js.translator/testData/jsCode/cases/object.kt +++ b/js/js.translator/testData/jsCode/cases/object.kt @@ -1,6 +1,6 @@ package foo -@native trait Summizer { +@native interface Summizer { fun sum(a: Int, b: Int): Int } diff --git a/js/js.translator/testData/jsCode/cases/objectScopes.kt b/js/js.translator/testData/jsCode/cases/objectScopes.kt index 3947ab6377a..4d19376a32e 100644 --- a/js/js.translator/testData/jsCode/cases/objectScopes.kt +++ b/js/js.translator/testData/jsCode/cases/objectScopes.kt @@ -1,6 +1,6 @@ package foo -@native trait Summizer { +@native interface Summizer { fun sum(a: Int, b: Int): Int } diff --git a/js/js.translator/testData/nameClashes/cases/methodOverloadInClassWithTwoUpperBounds.kt b/js/js.translator/testData/nameClashes/cases/methodOverloadInClassWithTwoUpperBounds.kt index ec24dff2667..259dced97e7 100644 --- a/js/js.translator/testData/nameClashes/cases/methodOverloadInClassWithTwoUpperBounds.kt +++ b/js/js.translator/testData/nameClashes/cases/methodOverloadInClassWithTwoUpperBounds.kt @@ -1,7 +1,7 @@ package foo -trait TraitA -trait TraitB +interface TraitA +interface TraitB public open abstract class Node() where T : TraitB { public abstract fun bar(arg: T): String diff --git a/js/js.translator/testData/native/cases/inheritanceFromNativeTrait.kt b/js/js.translator/testData/native/cases/inheritanceFromNativeTrait.kt index 56f3e428c5f..c06f4d31bb1 100644 --- a/js/js.translator/testData/native/cases/inheritanceFromNativeTrait.kt +++ b/js/js.translator/testData/native/cases/inheritanceFromNativeTrait.kt @@ -1,7 +1,7 @@ package foo @native -trait NativeTrait { +interface NativeTrait { val foo: String fun bar(a: Int): Any @@ -9,7 +9,7 @@ trait NativeTrait { fun baz(): String } -trait Trait : NativeTrait +interface Trait : NativeTrait class Class : NativeTrait { override val foo: String = "Class().foo" diff --git a/js/js.translator/testData/native/cases/kt2209.kt b/js/js.translator/testData/native/cases/kt2209.kt index b98013b5b54..e5838a4d2d3 100644 --- a/js/js.translator/testData/native/cases/kt2209.kt +++ b/js/js.translator/testData/native/cases/kt2209.kt @@ -1,17 +1,17 @@ package foo @native -trait Chrome { +interface Chrome { val extension: Extension } @native -trait Extension { +interface Extension { val lastError: LastError? } @native -trait LastError { +interface LastError { val message: String } diff --git a/js/js.translator/testData/native/cases/nestedElements.kt b/js/js.translator/testData/native/cases/nestedElements.kt index 8d4893c74ce..a07b9f7a753 100644 --- a/js/js.translator/testData/native/cases/nestedElements.kt +++ b/js/js.translator/testData/native/cases/nestedElements.kt @@ -116,7 +116,7 @@ object Object { } } - trait Trait { + interface Trait { val a: String var b: String fun test(): Int = noImpl @@ -157,7 +157,7 @@ class Class { fun test(): Int = noImpl } - trait Trait { + interface Trait { val a: String var b: String fun test(): Int = noImpl @@ -178,7 +178,7 @@ class Class { } @native -trait Trait { +interface Trait { @native("SomeObject") object Object { val a: String = noImpl @@ -198,7 +198,7 @@ trait Trait { } @native("SomeTrait") - trait Trait { + interface Trait { val a: String var b: String fun test(): Int = noImpl diff --git a/js/js.translator/testData/object/cases/objectInheritingFromATrait.kt b/js/js.translator/testData/object/cases/objectInheritingFromATrait.kt index d90b7107fc9..c68962cd279 100644 --- a/js/js.translator/testData/object/cases/objectInheritingFromATrait.kt +++ b/js/js.translator/testData/object/cases/objectInheritingFromATrait.kt @@ -1,6 +1,6 @@ package foo -trait Foo { +interface Foo { fun execute(handler: () -> Unit) { execute(false, handler) } diff --git a/js/js.translator/testData/propertyAccess/cases/overloadedOverriddenFunctionPropertyName.kt b/js/js.translator/testData/propertyAccess/cases/overloadedOverriddenFunctionPropertyName.kt index efde8db356e..f74d24dc523 100644 --- a/js/js.translator/testData/propertyAccess/cases/overloadedOverriddenFunctionPropertyName.kt +++ b/js/js.translator/testData/propertyAccess/cases/overloadedOverriddenFunctionPropertyName.kt @@ -1,6 +1,6 @@ package foo -trait I { +interface I { fun test(): String } diff --git a/js/js.translator/testData/propertyOverride/cases/checkSupertypeOrder.kt b/js/js.translator/testData/propertyOverride/cases/checkSupertypeOrder.kt index 73ac6fb79dc..cc1b3dc936b 100644 --- a/js/js.translator/testData/propertyOverride/cases/checkSupertypeOrder.kt +++ b/js/js.translator/testData/propertyOverride/cases/checkSupertypeOrder.kt @@ -1,6 +1,6 @@ package foo -trait A { +interface A { val bal: Int get() { return 42 diff --git a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructor.kt b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructor.kt index 224091f6997..a4217eea85a 100644 --- a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructor.kt +++ b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructor.kt @@ -2,7 +2,7 @@ package foo -trait Holder { +interface Holder { val element: String } diff --git a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorComplex.kt b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorComplex.kt index b47bc9dcb98..aa704ced61e 100644 --- a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorComplex.kt +++ b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorComplex.kt @@ -2,7 +2,7 @@ package foo -trait Holder { +interface Holder { val element: String } diff --git a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorExplicitThis.kt b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorExplicitThis.kt index f8eb7e1c39c..a01f39a3c69 100644 --- a/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorExplicitThis.kt +++ b/js/js.translator/testData/propertyOverride/cases/initOverrideInConstructorExplicitThis.kt @@ -2,7 +2,7 @@ package foo -trait Holder { +interface Holder { val element: String } diff --git a/js/js.translator/testData/propertyOverride/cases/initOverrideVarInConstructor.kt b/js/js.translator/testData/propertyOverride/cases/initOverrideVarInConstructor.kt index bf7c39aadf0..b3b7c055a8c 100644 --- a/js/js.translator/testData/propertyOverride/cases/initOverrideVarInConstructor.kt +++ b/js/js.translator/testData/propertyOverride/cases/initOverrideVarInConstructor.kt @@ -2,7 +2,7 @@ package foo -trait Holder { +interface Holder { var element: String } diff --git a/js/js.translator/testData/propertyOverride/cases/overrideValFromTraits.kt b/js/js.translator/testData/propertyOverride/cases/overrideValFromTraits.kt index fb52c9e05d5..07466618e98 100644 --- a/js/js.translator/testData/propertyOverride/cases/overrideValFromTraits.kt +++ b/js/js.translator/testData/propertyOverride/cases/overrideValFromTraits.kt @@ -1,6 +1,6 @@ package foo -trait A { +interface A { val bal: Int get() { return 5 @@ -17,7 +17,7 @@ trait A { } -trait B { +interface B { val bal: Int get() { return 42 diff --git a/js/js.translator/testData/reified/cases/innerObject.kt b/js/js.translator/testData/reified/cases/innerObject.kt index c0d35e452d7..0d4d2cb9910 100644 --- a/js/js.translator/testData/reified/cases/innerObject.kt +++ b/js/js.translator/testData/reified/cases/innerObject.kt @@ -8,7 +8,7 @@ class B class C : A() -trait TypePredicate { +interface TypePredicate { fun invoke(x: Any): Boolean } diff --git a/js/js.translator/testData/reified/cases/isClass.kt b/js/js.translator/testData/reified/cases/isClass.kt index fa5e92ff89d..b01f937941b 100644 --- a/js/js.translator/testData/reified/cases/isClass.kt +++ b/js/js.translator/testData/reified/cases/isClass.kt @@ -2,8 +2,8 @@ package foo // CHECK_NOT_CALLED: isInstance -trait A -trait B +interface A +interface B open class C : A, B diff --git a/js/js.translator/testData/rtti/cases/rttiForTrait.kt b/js/js.translator/testData/rtti/cases/rttiForTrait.kt index a9eccbbf436..172abe0c753 100644 --- a/js/js.translator/testData/rtti/cases/rttiForTrait.kt +++ b/js/js.translator/testData/rtti/cases/rttiForTrait.kt @@ -3,7 +3,7 @@ package foo open class A -trait B +interface B class C : A(), B diff --git a/js/js.translator/testData/rtti/cases/rttiForTrait2.kt b/js/js.translator/testData/rtti/cases/rttiForTrait2.kt index 14c76c57ae6..c571f8661f6 100644 --- a/js/js.translator/testData/rtti/cases/rttiForTrait2.kt +++ b/js/js.translator/testData/rtti/cases/rttiForTrait2.kt @@ -1,10 +1,10 @@ package foo -trait A -trait B : A -trait C : A -trait D : B, C -trait E : C +interface A +interface B : A +interface C : A +interface D : B, C +interface E : C open class CB : B class CB2 : CB() diff --git a/js/js.translator/testData/superCall/cases/traitSuperCall.kt b/js/js.translator/testData/superCall/cases/traitSuperCall.kt index 259a587f104..9dd4e65f6d7 100644 --- a/js/js.translator/testData/superCall/cases/traitSuperCall.kt +++ b/js/js.translator/testData/superCall/cases/traitSuperCall.kt @@ -1,11 +1,11 @@ package foo -trait A { +interface A { fun bar(): Int = 2 fun foo(t: Int): Int = t + 1 } -trait B : A { +interface B : A { override fun bar(): Int = 3 } diff --git a/js/js.translator/testData/trait/cases/checkImplementationCharacteristics.kt b/js/js.translator/testData/trait/cases/checkImplementationCharacteristics.kt index 8f1476bba22..a97f6dc15d6 100644 --- a/js/js.translator/testData/trait/cases/checkImplementationCharacteristics.kt +++ b/js/js.translator/testData/trait/cases/checkImplementationCharacteristics.kt @@ -1,10 +1,10 @@ package foo -public trait A { +public interface A { fun foo() { } } -public trait B : A { +public interface B : A { fun boo() { } } diff --git a/js/js.translator/testData/trait/cases/classDerivesFromClassAndTrait.kt b/js/js.translator/testData/trait/cases/classDerivesFromClassAndTrait.kt index 4e9d3afee99..cba4101b51a 100644 --- a/js/js.translator/testData/trait/cases/classDerivesFromClassAndTrait.kt +++ b/js/js.translator/testData/trait/cases/classDerivesFromClassAndTrait.kt @@ -5,7 +5,7 @@ open class A() { val value = "BAR" } -trait Test { +interface Test { fun addFoo(s: String): String { return s + "FOO" } diff --git a/js/js.translator/testData/trait/cases/classDerivesFromTraitAndClass.kt b/js/js.translator/testData/trait/cases/classDerivesFromTraitAndClass.kt index 6c322a3b5f0..106c25e2354 100644 --- a/js/js.translator/testData/trait/cases/classDerivesFromTraitAndClass.kt +++ b/js/js.translator/testData/trait/cases/classDerivesFromTraitAndClass.kt @@ -5,7 +5,7 @@ open class A() { val value = "BAR" } -trait Test { +interface Test { fun addFoo(s: String): String { return s + "FOO" } diff --git a/js/js.translator/testData/trait/cases/definitionOrder.kt b/js/js.translator/testData/trait/cases/definitionOrder.kt index 7724f06f539..d5a2737b10e 100644 --- a/js/js.translator/testData/trait/cases/definitionOrder.kt +++ b/js/js.translator/testData/trait/cases/definitionOrder.kt @@ -32,16 +32,16 @@ open class A() : F { } } -trait F : G { +interface F : G { fun bar() = "F" } // KT-3437 -trait G : H -trait K : H -trait L -trait H : L -trait Dummy +interface G : H +interface K : H +interface L +interface H : L +interface Dummy fun box(): Boolean { return (C().order == "ABC") && (D().order == "ABD") && (E().order == "AE") && (C().bar() == "F") && (A().bar() == "F") diff --git a/js/js.translator/testData/trait/cases/example.kt b/js/js.translator/testData/trait/cases/example.kt index 87eee23fbd0..3e9c487eedc 100644 --- a/js/js.translator/testData/trait/cases/example.kt +++ b/js/js.translator/testData/trait/cases/example.kt @@ -1,6 +1,6 @@ package foo -trait AL { +interface AL { fun get(index: Int): Any? = null } diff --git a/js/js.translator/testData/trait/cases/funDelegation.kt b/js/js.translator/testData/trait/cases/funDelegation.kt index 4905ea58279..5509ec19afa 100644 --- a/js/js.translator/testData/trait/cases/funDelegation.kt +++ b/js/js.translator/testData/trait/cases/funDelegation.kt @@ -4,7 +4,7 @@ open class Base() { fun n(n: Int): Int = n + 1 } -trait Abstract { +interface Abstract { } class Derived1() : Base(), Abstract { diff --git a/js/js.translator/testData/trait/cases/traitAddsFunctionsToClass.kt b/js/js.translator/testData/trait/cases/traitAddsFunctionsToClass.kt index 5ecfee18d13..dab95bd29ea 100644 --- a/js/js.translator/testData/trait/cases/traitAddsFunctionsToClass.kt +++ b/js/js.translator/testData/trait/cases/traitAddsFunctionsToClass.kt @@ -1,6 +1,6 @@ package foo -trait Test { +interface Test { fun addFoo(s: String): String { return s + "FOO" } diff --git a/js/js.translator/testData/trait/cases/traitExtendsTrait.kt b/js/js.translator/testData/trait/cases/traitExtendsTrait.kt index 145c2bc2004..bb3b5761748 100644 --- a/js/js.translator/testData/trait/cases/traitExtendsTrait.kt +++ b/js/js.translator/testData/trait/cases/traitExtendsTrait.kt @@ -1,12 +1,12 @@ package foo -trait Test { +interface Test { fun addFoo(s: String): String { return s + "FOO" } } -trait ExtendedTest : Test { +interface ExtendedTest : Test { fun hooray(): String { return "hooray" } diff --git a/js/js.translator/testData/trait/cases/traitExtendsTwoTraits.kt b/js/js.translator/testData/trait/cases/traitExtendsTwoTraits.kt index 41321a4cd26..1f6d6e2eebf 100644 --- a/js/js.translator/testData/trait/cases/traitExtendsTwoTraits.kt +++ b/js/js.translator/testData/trait/cases/traitExtendsTwoTraits.kt @@ -1,18 +1,18 @@ package foo -trait A { +interface A { fun addFoo(s: String): String { return s + "FOO" } } -trait B { +interface B { fun hooray(): String { return "hooray" } } -trait AD : A, B { +interface AD : A, B { } diff --git a/js/js.translator/testData/webDemoExamples2/cases/builder.kt b/js/js.translator/testData/webDemoExamples2/cases/builder.kt index f55f677c64f..608f9227057 100644 --- a/js/js.translator/testData/webDemoExamples2/cases/builder.kt +++ b/js/js.translator/testData/webDemoExamples2/cases/builder.kt @@ -45,7 +45,7 @@ fun main(args: Array) { println(result) } -trait Element { +interface Element { fun render(builder: StringBuilder, indent: String) override fun toString(): String { diff --git a/plugins/android-compiler-plugin/testData/codegen/android/FakeContext.kt b/plugins/android-compiler-plugin/testData/codegen/android/FakeContext.kt index 1fe9df2d12f..e7cec17acd1 100644 --- a/plugins/android-compiler-plugin/testData/codegen/android/FakeContext.kt +++ b/plugins/android-compiler-plugin/testData/codegen/android/FakeContext.kt @@ -1,3 +1,3 @@ package android.content -trait Context +interface Context