-
Notifications
You must be signed in to change notification settings - Fork 26
dev_compiler emits errors compiling SDK #103
Comments
Here's the current count - many are analyzer warnings that we should treat as errors: package AE IMO IRCE STE LOC package AE IMO IRCE STE LOC Where: |
*** Compiling SDK to JavaScript |
for JSDouble/JSInt/JSBool/JSString, ideally we could find a way to make those work with the checker. My current CL that attempts to fix the double/int/bool/string methods is using those dart2js types. They're a little strange ... for one thing, they illegally implement the primitive interfaces ... and int/double/num have some magic typing rules for operators (special cases in the spec). Hmmm, maybe I will take another look at just getting rid of those types. |
Note, some of the errors are recently promoted analyzer warnings that were introduced in this CL: |
The analyzer errors are (as you mention) new since I last looked at this. The _interceptor/ errors I had ignored, since it wasn't clear what we were going to do with that code. Some of it is definitely oddly typed. The (v is K) code is interesting. This seems to be the only use of this idiom in the sdk, but it's a pretty hard one to work around. We might want to allow these "is" checks and throw at runtime if they turn out to be questions we can't accurately answer. |
This is to keep us from inadvertently regressing the SDK. See related bug #103 [email protected] Review URL: https://codereview.chromium.org/1154213008
@leafpetersen not sure we can throw at runtime ... this is for map/set lookups. It would be unfortunate if If the key is "invalid", Set/Map want to bail early, rather than look up the item. Ignoring the test entirely (
If we did want to be more strict, IMO, we could just constrain lookup to require a K: V operator [](K key) { ... } That would disallow lookups from other key types. Alternatively, we can change how our SDK is implemented, it doesn't need to use the Of these, I think my favorite is the |
Related: http://dartbug.com/23356 . |
ah, yup. I forgot about compareTo. Yeah that makes more sense. |
Based on that, maybe require |
Somewhat related: https://github.com/chalin/DEP-non-null/blob/master/doc/dep-non-null-AUTOGENERATED-DO-NOT-EDIT.md#ii32-dart-sdk-library the non-null DEP changes library methods like |
On Wed, Jun 24, 2015 at 12:15 PM, John Messerly [email protected]
bool isSubset(MySet s, MySet t) { will result in a dynamic type error when invoked with sets, say, {'a', 1} CheersPatrice [image: View my LinkedIn Profile.] |
btw, we should look at warnings too. DownCastComposite casts probably fail. For example:
from this code: factory StreamController({void onListen(),
void onPause(),
void onResume(),
onCancel(),
bool sync: false}) {
if (onListen == null && onPause == null &&
onResume == null && onCancel == null) {
return sync
? new _NoCallbackSyncStreamController/*<T>*/()
: new _NoCallbackAsyncStreamController/*<T>*/();
}
return sync
? new _SyncStreamController<T>(onListen, onPause, onResume, onCancel)
: new _AsyncStreamController<T>(onListen, onPause, onResume, onCancel);
} |
fyi, I landed a change to allow us to implement the disallowed types (e.g. int/double/bool/String) so when we update Analyzer, those will go away at least. |
more progress: https://codereview.chromium.org/1348453004/ |
also improved codegen of JSNumber's methods [email protected] Review URL: https://codereview.chromium.org/1348453004 .
94d823b too |
We have errors here again. Marking as a soundness issue as we're force compiling. |
This issue was moved to dart-lang/sdk#27260 |
related to #58, but this is tracking the errors instead of the JS code issues. The errors can be seen with:
The text was updated successfully, but these errors were encountered: