Commit Graph

268 Commits

Author SHA1 Message Date
Alex Tkachman aaed9b0325 KT-504 array like expressions with type parameters 2011-11-15 12:42:51 +02:00
Alex Tkachman 3b2fb0da8f KT-508 accessors for enclosed private fields 2011-11-14 19:34:00 +02:00
Andrey Breslav 9ec55e08f4 Collective slices fixed 2011-11-14 16:25:37 +03:00
Alex Tkachman 6982ce454e KT-503 test. Never use asm.Type.getElementType() 2011-11-14 06:17:11 +02:00
Alex Tkachman 3904b91e4c backend refactoring from extension properties and proper naming scheme of inner classes and objects 2011-11-13 21:08:35 +02:00
Alex Tkachman a3ac4506af failing test for kt-475 2011-11-12 20:51:43 +02:00
Stepan Koltsov e97b91c6e4 report overload conflict of constructor and function
like this:

===
fun a() = 1

class a()
===
2011-11-12 21:24:11 +04:00
Andrey Breslav c74a0a62cc KT-313 Bug in substitutions in a function returning its type parameter T 2011-11-12 20:29:38 +04:00
Andrey Breslav 30926012c7 Support unicode escapes in chars and strings 2011-11-12 18:54:03 +04:00
Andrey Breslav bf4fef9a03 A non-generic function is always more speciic than a generic function
Example:
fun <T> array(vararg array : T) = array
fun array(vararg array : Char) = array

fun test() {
    array('1', '2') // ambiguity
}
2011-11-12 18:20:16 +04:00
Stepan Koltsov 3193b7d2c4 fix incorrect overload error on regular function and extension function with same name
===
fun ff() = 1

fun Int.ff() = 1
===
2011-11-12 16:54:33 +04:00
Stepan Koltsov 50c7364f6b fix unnecessary wrong overload in test 2011-11-12 16:54:27 +04:00
Stepan Koltsov 594ab01b1f fix incorrect overload error in different namespaces with same suffix
===
namespace a {
    fun f() = 1
}

namespace b {
    namespace a {
        fun f() = 1
    }
}
===
2011-11-12 16:05:16 +04:00
svtk 3bfd7955a0 KT-352 Function variable declaration type isn't checked inside a function body 2011-11-11 01:00:40 +04:00
Andrey Breslav 4a87566fa2 KT-442 Type inference fails on with() 2011-11-10 23:19:10 +03:00
svtk 2c0ac86973 Merge remote-tracking branch 'origin/master' 2011-11-10 22:13:57 +04:00
Andrey Breslav 4224e00cbd Most of the tests fixed 2011-11-10 21:33:46 +03:00
svtk 25d26fe6fd KT-235 Illegal assignment return type 2011-11-10 22:13:52 +04:00
Andrey Breslav 586f4c34b2 Merge remote branch 'origin/master' 2011-11-10 20:55:18 +03:00
Andrey Breslav 839d986f44 KT-385 type inference does not work properly
KT-109 Good code is red: type arguments are not inferred
KT-441 Exception in type inference when multiple overloads accepting an integer literal are accessible
2011-11-10 20:55:12 +03:00
Andrey Breslav 1e3f2889a4 KT-336 Can't infer type parameter for ArrayList in a generic function (Exception in type inference)
KT-335 Type inference fails on Collections.sort
2011-11-10 19:44:59 +03:00
Stepan Koltsov a4b62868fa KT-424 also check overloads in namespaces 2011-11-10 20:00:34 +04:00
Stepan Koltsov 31b049893f fix wrong test (unnecessary overload) 2011-11-10 20:00:26 +04:00
Stepan Koltsov d155de2bdc better diagnostics for KT-424
highlight full function definition, not only function name
2011-11-10 20:00:19 +04:00
Stepan Koltsov 5218246d80 KT-424: Check declarations for overload-compatibility
===
fun a() {}
fun a() {}
===

must be an error.
2011-11-10 20:00:15 +04:00
Stepan Koltsov 5fbf684998 continue work on KT-458
70b7810c30 fixed parser

this commit fixes typer
2011-11-10 19:07:51 +04:00
Stepan Koltsov 70b7810c30 KT-458 Need to improve quoted identifiers support
class `$$$`

should not fail
2011-11-10 16:50:23 +04:00
Stepan Koltsov 44b631cdd0 enhancements in character constant parsing
* missing assertion converted to ErrorValue
* added test for 'a
* '\' must be error (KT-461)
2011-11-10 16:16:31 +04:00
Andrey Breslav dda5759643 More tests for KT-451 Incorrect character literals cause assertion failures 2011-11-10 15:42:14 +03:00
Stepan Koltsov c8e2e06d59 missing test for KT-451 incorrect character liternals assertion error 2011-11-10 15:13:08 +04:00
svtk 7ef0debbc7 Merge remote-tracking branch 'origin/master' 2011-11-10 14:00:40 +04:00
svtk 1b8e5a4a11 Added return type check for non-local return (despite it is prohibited yet) 2011-11-10 14:00:32 +04:00
Stepan Koltsov abec6933cf KT-499 allow class object in static inner classes
like this:

===
class A {
    class object {
        class B {
            class object { }
        }
    }
}
===
2011-11-10 12:59:29 +04:00
Andrey Breslav c6f6f182b6 KT-353 Generic type argument inference sometimes doesn't work
KT-459 Type argument inference fails when class names are fully qualified
2011-11-09 22:15:37 +03:00
Andrey Breslav 8ab1f1b420 KT-287 Infer constructor type arguments
More test data
2011-11-09 21:51:01 +03:00
Andrey Breslav 0c492ae0eb KT-287 Infer constructor type arguments 2011-11-09 21:48:36 +03:00
Andrey Breslav a24e448973 Simplistic type inference:
KT-258 Support equality constraints in type inference
KT-399 Type argument inference not implemented for CALL_EXPRESSION
2011-11-09 19:52:05 +03:00
svtk 0356bd98ec KT-411 Wrong type expected when returning from a function literal 2011-11-09 16:43:29 +04:00
Stepan Koltsov 099725da7f KT-449 class object in inner class must be an error
===
class A {
  class B {
    class object { }
  }
}
===
2011-11-09 16:26:12 +04:00
Stepan Koltsov a6898c7c64 simplify KT-249
for KT-449
2011-11-09 16:26:12 +04:00
Andrey Breslav df79fa2f3d Type checking procedure simplified (dramatically!) 2011-11-09 15:22:35 +03:00
Stepan Koltsov b1df4a0045 KT-419 Strange 'unresolved' bug when using constructor parameters that aren't properties
===
class A(w: Int) {
    var c = w
    {
        c = 17
    }
}
===
2011-11-09 14:51:04 +04:00
svtk 7c05e4b9b4 Merge remote-tracking branch 'origin/master' 2011-11-09 12:22:14 +04:00
svtk 2d6337fe93 KT-456 No check for obligatory return in getters 2011-11-09 12:22:08 +04:00
Alex Tkachman cfc41361ac expressions as functions 2011-11-08 22:45:48 +01:00
svtk 24d663a08f KT-455 Do not repeat errors in definite assignment checks 2011-11-08 17:33:50 +04:00
svtk dfb17a5f0e KT-58 Allow finally around definite returns 2011-11-08 16:25:04 +04:00
Stepan Koltsov f47f462dca KT-418: test for case when safe call on non-null value returns null
1?.somethingReturnNull()

must still yield null
2011-11-08 16:00:22 +04:00
Stepan Koltsov 1f511db31c KT-418 Make 1.?plus(2) have type Int 2011-11-08 15:44:02 +04:00
Stepan Koltsov 35275466bc KT-20 Resolve class objects' contents in the 'static' scope 2011-11-08 14:21:57 +04:00