Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exempting parts of the program (especially external library calls) from type checking while running in checked mode #16638

Closed
DartBot opened this issue Feb 7, 2014 · 3 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Feb 7, 2014

This issue was originally filed by jirkadanek7...@gmail.com


What steps will reproduce the problem?

I use a library function that has a restrictive type on its argument while in fact anything that has a socketId() method that returns something numeric would work just fine.

I like using checked mode. I feel more comfortable when the machine pays attention to what I am putting where. But I also need to pass "incompatible" objects to that method I described.

I think there is a value in something as a checked mode where things actually break as opposed to static warning in the editor which is too easy to ignore.

What is the expected output? What do you see instead?

I am asking for a mechanism that would disable a static warning in the Editor (as per Issue #4190) and also a possibility to tune the checked mode. I have the following ideas

  * Have option to enable checked mode only for my code, ignoring what happens inside libraries. Possibly some annotation on library imports for selectively not checking the code being imported from that library.
Together with some mechanism (annotation?) to disable the check at the interface between my code and a library.
  * Make the type system more powerful to allow expressing things like TypeA OR TypeB
  * Improve type inference in the Editor. In my example in the beginning, it should be feasible to statically derive the requirement for having a socketId() method on the argument. Then even though I set up the annotation to ignore types, the Editor could warn if it is absolutely certain that the object I am passing in does not have that method and there is no way that the code will successfully execute.

@dgrove
Copy link
Contributor

dgrove commented Feb 7, 2014

Removed Type-Defect label.
Added Type-Enhancement, Area-Language labels.

@dgrove
Copy link
Contributor

dgrove commented Feb 7, 2014

Added Triaged label.

@gbracha
Copy link
Contributor

gbracha commented Aug 26, 2014

So we have bus for fine grain control over checked mode (issue #4938), for union types (issue #18138). And the editor is not part of the language. This bug is about all of these, so I'm closing it as too broad.


Set owner to @gbracha.
Added TooBroad label.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Aug 26, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants