You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting some "x is not a member of z" warnings in the editor (when I don't use that little check box in the preferences - as a side note - can't we make that check box a 'positive' - i.e. "use inferred type information..." instead of a "don't use..."?) where I think that the inference should work.
Here is my example:
void drawImage(Image image, num dx, num dy) {
assert(image is HtmlImage);
final htmlImage = image;// as HtmlImage;
_context2d.drawImage(htmlImage.element, dx, dy);
}
since the assert contains an "is" check I would expect not to get a "not a member of" warning on the .element of my HtmlImage class. If I uncomment the 'as' the warning goes away, but I think the 'is' should be enough?
if I wrap the assignment and the method call in an if statement then the warning goes away:
void drawImage(Image image, num dx, num dy) {
assert(image is HtmlImage);
if(image is HtmlImage)
{
final htmlImage = image;// as HtmlImage;
_context2d.drawImage(htmlImage.element, dx, dy);
}
}
What version of the product are you using? On what operating system?
Dart Editor 10315, Windows 64
The text was updated successfully, but these errors were encountered:
This issue was originally filed by [email protected]
Hi guys,
I'm getting some "x is not a member of z" warnings in the editor (when I don't use that little check box in the preferences - as a side note - can't we make that check box a 'positive' - i.e. "use inferred type information..." instead of a "don't use..."?) where I think that the inference should work.
Here is my example:
void drawImage(Image image, num dx, num dy) {
assert(image is HtmlImage);
final htmlImage = image;// as HtmlImage;
_context2d.drawImage(htmlImage.element, dx, dy);
}
since the assert contains an "is" check I would expect not to get a "not a member of" warning on the .element of my HtmlImage class. If I uncomment the 'as' the warning goes away, but I think the 'is' should be enough?
if I wrap the assignment and the method call in an if statement then the warning goes away:
void drawImage(Image image, num dx, num dy) {
assert(image is HtmlImage);
if(image is HtmlImage)
{
final htmlImage = image;// as HtmlImage;
_context2d.drawImage(htmlImage.element, dx, dy);
}
}
What version of the product are you using? On what operating system?
Dart Editor 10315, Windows 64
The text was updated successfully, but these errors were encountered: