|
Handle dynamic as bottom inside of function type reps.
This changes the way we handle dynamic at runtime to be more correct and cleaner. We now simply emit dynamic as dynamic instead of as core.Object. There are now two ways to construct a function type: one can construct a fuzzy function type (the default), or a definite function type. The constructor for a fuzzy function type replaces all uses of dynamic with bottom. This function type is used for all type annotations. Definite function types do not replace dynamic with bottom. These only occur as the runtime type of actual functions, for which we really know the type. Because we now eagerly sort this out when we create the function type, the subtyping code doesn't need to deal with this.
This allows some additional subtyping: closures which actually are typed to take dynamic would previously not have been allowed to be cast to something with a concrete argument type. Now this is allowed (see the change in runtime_tests.js for an example of this).
This fixes #107.
BUG=
R=vsm@google.com
Committed: https://github.com/dart-lang/dev_compiler/commit/ed8722d9b1b9850395b658acf55fa5f3a0195c0c
Total comments: 6
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+859 lines, -765 lines) |
Patch |
 |
M |
lib/runtime/_classes.js
|
View
|
|
4 chunks |
+3 lines, -7 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/_rtti.js
|
View
|
1
|
4 chunks |
+41 lines, -10 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/_types.js
|
View
|
1
2
|
10 chunks |
+104 lines, -25 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_foreign_helper.js
|
View
|
|
3 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_interceptors.js
|
View
|
|
5 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_internal.js
|
View
|
|
18 chunks |
+61 lines, -61 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_isolate_helper.js
|
View
|
|
18 chunks |
+71 lines, -71 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_js_helper.js
|
View
|
|
15 chunks |
+44 lines, -44 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_js_mirrors.js
|
View
|
|
8 chunks |
+12 lines, -12 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/_native_typed_data.js
|
View
|
|
14 chunks |
+34 lines, -34 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/async.js
|
View
|
|
97 chunks |
+195 lines, -195 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/collection.js
|
View
|
|
51 chunks |
+106 lines, -106 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/convert.js
|
View
|
|
26 chunks |
+54 lines, -54 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/core.js
|
View
|
|
18 chunks |
+27 lines, -27 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/isolate.js
|
View
|
|
6 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/js.js
|
View
|
|
11 chunks |
+34 lines, -34 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/math.js
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart/mirrors.js
|
View
|
|
4 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
 |
M |
lib/runtime/dart_runtime.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
lib/src/codegen/js_codegen.dart
|
View
|
|
6 chunks |
+16 lines, -28 lines |
0 comments
|
Download
|
 |
M |
test/browser/runtime_tests.js
|
View
|
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/BenchmarkBase.js
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/DeltaBlue.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/cascade.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/constructors.js
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/covariance.js
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/fieldtest.js
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/functions.js
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/methods.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/misc.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
test/codegen/expect/names.js
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
test/codegen/expect/sunflower/sunflower.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 8 (1 generated)
|