Commit Graph

11 Commits

Author SHA1 Message Date
Ilya Gorbunov
4d5ec9be3f Drop identityEquals from builtins, compiler and tests. 2016-01-22 05:54:38 +03:00
Denis Zharkov
b4bb92d136 Fix overload resolution ambiguity for types intersection
There are two different forms of types intestion:
1. Type parameters with multiple bounds
2. Smart casts

The problem was that when member scope of type intersection contained
effective duplicates and that lead to overload resolution ambiguity in
strange cases like `x.hashCode()`

For first type we do effectively the same thing as when building member
scope for class extending several interfaces: group all descriptors by
both-way-overridability relation and then choose most-specific in each
group.

For smart casts we do basically the same thing but with special
treatments:
1. From all descriptors that _equal_ to most specific we choose
   the one that works without smartcast if possible (i.e. we choose first from candidates list)
2. If smart-cast value seems to be unstable we use only member scope
   of receiver type + all descriptors from smart cast possible types
   that has incompatible signature. If we'd include all of them and
   choose one as more specific, and it would lead to false
   SMART_CAST_IMPOSIBLE (see test unstableSmartCast.kt)

 #KT-3996 Fixed
 #KT-10315 Fixed
2015-12-15 16:18:31 +03:00
Yan Zhulanow
9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Dmitry Jemerov
7c20630272 diagnostics for deprecated syntax of function type parameter list 2015-10-06 16:20:47 +02:00
Alexander Udalov
cb03f0df5a Fix casts of Unit value to other types 2015-07-06 16:14:06 +03:00
Dmitry Jemerov
bb1410b20a generate more correct bytecode for casting Unit to other types 2015-03-25 17:51:04 +01:00
Dmitry Jemerov
48b0afd84d correctly generate safe casts from Unit type
#KT-4494 fixed
2015-03-05 11:59:23 +01:00
Natalia Ukhorskaya
7a9d822070 'As' function for constants 2013-12-17 15:00:30 +04:00
Natalia Ukhorskaya
66effee8cd Fix safe call 2013-12-16 20:54:09 +04:00
Alexander Udalov
75f09b7527 Fix codegen of as-casts for nullable generics 2013-02-06 17:54:28 +04:00
Alexander Udalov
10c5949199 Extract some codegen tests to black box testData 2013-01-28 18:20:33 +04:00