Commit Graph

11676 Commits

Author SHA1 Message Date
Svetlana Isakova e2f681c587 report type mismatch deeply on branches for if
in type argument inference case
2013-09-02 23:18:45 +04:00
Svetlana Isakova c5b6ee4df3 added 'commonSupertypeForPossiblyNumberTypes' 2013-09-02 23:18:45 +04:00
Svetlana Isakova e4325cd92d resolve argument of 'if' call
with right data flow info
2013-09-02 23:18:45 +04:00
Svetlana Isakova e37af4de67 added DataFlowInfoForArguments param to contexts 2013-09-02 23:18:45 +04:00
Svetlana Isakova 99bb6f13b5 data flow info for arg may affect next argument's type for type argument inference case 2013-09-02 23:18:45 +04:00
Svetlana Isakova 9ccd1e5ddd added DataFlowInfoForArguments
data flow info for argument depends on previous argument analysis
special interface was added to support case with argument types inference
and 'if' (with special data flow info for then and else arguments)
2013-09-02 23:18:45 +04:00
Svetlana Isakova 27cff93ed8 use data flow info in constraint system
intersect data flow value possible types
add intersection type (or exact type for the most cases) as a lower bound to constraint system

always get common super type for intersection type as a result
(avoid returning it, even in error messages)
2013-09-02 23:18:45 +04:00
Svetlana Isakova b91846eb5d resolve 'if' as call when expected type is unknown 2013-09-02 23:18:44 +04:00
Svetlana Isakova 9eda531eea refactoring: extracted method 'reportTypeInferenceExpectedTypeMismatch'
to reuse it later from 'tracing for if'
changed required/found types order in message to synchronize it with 'TYPE_MISMATCH' error
2013-09-02 23:18:44 +04:00
Svetlana Isakova 5d2ae9aec5 added ability to resolve call with uncustomary tracing strategy
(necessary for special 'tracing for if')
2013-09-02 23:18:44 +04:00
Svetlana Isakova 7842327d20 added 'getDataFlowInfoForValueArgument' to ResolvedCall interface 2013-09-02 23:18:44 +04:00
Svetlana Isakova 9938c58354 check all upper bounds even if there are some error types in bounds
for cases like 'val l:List<Int> = id(newList())'
List<???> is a lower bound for id's type parameter here
2013-09-02 23:18:44 +04:00
Svetlana Isakova eb1c29b507 removed code duplication
extracted 'getTypeInfoWhenOnlyOneBranchIsPresent'
2013-09-02 23:18:44 +04:00
Svetlana Isakova 0609f61ee7 added test for nontrivial nested calls 2013-09-02 23:18:44 +04:00
Svetlana Isakova 919714e027 refactoring: extracted methods
from 'completeNestedCallsInference'
2013-09-02 23:18:44 +04:00
Svetlana Isakova 0849798af0 report only 'The value is out of range'
not 'An integer literal does not conform to the expected type Int/Long'
2013-09-02 23:18:44 +04:00
Svetlana Isakova f2746b835e report ERROR_COMPILE_TIME_VALUE for constants instead of TYPE_MISMATCH
(functionality returned)
2013-09-02 23:18:44 +04:00
Svetlana Isakova 6bb768892f added todo comment 2013-09-02 23:18:43 +04:00
Svetlana Isakova fa1740a26e changed way to compute common supertype for number types
(using only supertypes, not exact value)
2013-09-02 23:18:43 +04:00
Svetlana Isakova fccfa0051e added DoubleValueTypeConstructor
no need to store exact value in IntegerValueTypeConstructor, it was removed
2013-09-02 23:18:43 +04:00
Svetlana Isakova 8b7585af66 added diagnostic message tests to ensure that number value types don't appear in error messages 2013-09-02 23:18:43 +04:00
Svetlana Isakova 80eb45b793 process number value types properly in constraint system
the case when type parameter has number value types (constants) as lower bounds
should be handled specially, because upper bound for primitive number types is 'Number',
but by default we want Int (or Long)
2013-09-02 23:18:43 +04:00
Svetlana Isakova 517c24c8f6 added UNKNOWN_EXPECTED_TYPE, NumberValueTypeConstructor
analyze function arguments with UNKNOWN_EXPECTED_TYPE
(for several times in different traces yet)

for number literals create type with NumberValueTypeConstructor with exact value,
transform it to the corresponding type when resolve arguments (expected type is known)

doesn't work properly for if, elvis operator, etc. (throws exceptions)
2013-09-02 23:18:43 +04:00
Svetlana Isakova 8d0573f448 added 'isDenotable' flag to TypeConstructor 2013-09-02 23:18:43 +04:00
Svetlana Isakova d1a21bfd3e changed comparison to NO_EXPECTED_TYPE to
'noExpectedType' invocation
2013-09-02 23:18:43 +04:00
Svetlana Isakova 0eed0c6c7f extracted 'getResultingCall' method
rewrote 'getResultingType' in terms of it
2013-09-02 23:18:43 +04:00
Svetlana Isakova 2eadd5202d check argument types through complete phase
with right data flow info
2013-09-02 23:18:42 +04:00
Svetlana Isakova 4f2df78066 analyze all function arguments without expected types
arguments are now analyzed for several times, for each resolution candidate;
the goal is to analyze them once

todo (don't work properly):
 - number literals
 - if/when expressions
2013-09-02 23:18:42 +04:00
Svetlana Isakova 543e0343c5 moved ResolveMode, ResolutionResultsCache
from CallResolutionContext to ResolutionContext
2013-09-02 23:18:42 +04:00
Nikolay Krasko 6641563044 Store files with the replaced version in separate folder to prevent putting them to artifacts 2013-09-02 15:31:06 +04:00
Nikolay Krasko e54784efcc Convert line separators when checking test results 2013-09-02 15:31:05 +04:00
Nikolay Krasko 215e736d65 Enable debug for slice rewrite in delegation traces 2013-09-02 15:31:04 +04:00
Evgeny Gerashchenko 440716c817 Updated to IDEA 132.27 EAP. 2013-08-30 21:08:23 +04:00
Pavel Talanov e29c593c58 Fix check in JetQuickDocumentationProvider#isKotlinDeclaration
Always return true if we navigated to JetElement
2013-08-30 17:41:38 +04:00
Pavel Talanov 1072b1943f Provide sources of dependency in AbstractJavaWithLibCompletionTest
Test compiles dependency before running
2013-08-30 17:41:37 +04:00
develar 3bf32c09a9 JS backend: added ability to debug kotlin code in browser with using JavaScript Debugger configuration.
(cherry picked from commit 8537ce4, 72eeb92)
2013-08-30 13:18:13 +04:00
develar b3658472ac JS backend: improved sourcemap generation and moved SourceMap3Builder and JsSourceGenerationVisitor to kotlin sources from dart-ast(develar fork).
#KT-927 in progress

(cherry picked from commit 10fb0f9)
2013-08-30 13:18:12 +04:00
develar e05ffd03c3 JS backend: sourcemap should use absolute file urls.
#KT-927 in progress

(cherry picked from commit 8931d26)
2013-08-30 13:17:53 +04:00
develar 3ab095a4f5 JS backend: started to implement source maps
#KT-927 in progress

(cherry picked from commits 5543cda, 6ed296b, 11186f9, 5b84d0b)
2013-08-30 13:17:20 +04:00
develar e39943f9bd JS backend: report expression location on error in StringTemplateTranslator.
(cherry picked from commit a2765d3)
2013-08-29 21:45:27 +04:00
develar 1c173c5224 JS backend: improve compilation performance -- don't create extra list.
(cherry picked from commit 2d7cb8a and f3d9f73)
2013-08-29 21:45:27 +04:00
develar 4f9485b40e JS backend: fixed bug when explicitly use invoke method in function literal call.
(cherry picked from commit f832cee)
2013-08-29 21:45:27 +04:00
develar f08cb5f6ca JS backend: inline private class ExtensionCallConstructor to place of use.
(cherry picked from commit 4d17e96)
2013-08-29 21:45:26 +04:00
develar 92e76d18d9 JS backend: change name mangling -- right now before indexing we sort functions by Visibility and Modality.
(cherry picked from commit 7620a07)
2013-08-29 21:45:26 +04:00
develar 8789a0d648 JS backend: refactoring 'is' operator translation. 2013-08-29 21:45:26 +04:00
develar df0a218015 JS backend: generate ref for not public api open classes as ref to internal class pool (_c var), but not to namespace definition.
(cherry picked from commit fa3db43)
2013-08-29 21:45:25 +04:00
develar c27fb10f5a JS backend: improve and move getQualifiedReference function from TranslationUtils to TranslationContext and StaticContext.
(cherry picked from commit fa3db43)
2013-08-29 21:45:25 +04:00
develar 3f0c1b2645 JS backend: elvis operator must compare value with undefined.
(cherry picked from commit 3978a8e)
2013-08-29 21:45:24 +04:00
develar 4b0cbb5dbf JS backend: removed unnecessary code -- the "toStringHack" Role
(cherry picked from commit 902d323)
2013-08-29 21:45:24 +04:00
develar 6ff784efc1 JS backend: fixed wrong @lends annotation when using nested packages. 2013-08-29 21:45:24 +04:00