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

Cascading of static functions produces unexpected result #8998

Closed
DartBot opened this issue Mar 8, 2013 · 4 comments
Closed

Cascading of static functions produces unexpected result #8998

DartBot opened this issue Mar 8, 2013 · 4 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Mar 8, 2013

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


What steps will reproduce the problem?

Following code:

class MyClass {
  static void A() {}
  static void B() {}
}

void main() {
  MyClass..A()..B();
}

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

Expected output would be that MyClass.A() is called and then MyClass.B().

Instead I get this (in Dartium):

Exception: Class '_Type' has no instance method 'A'. 

NoSuchMethodError : method not found: 'A' 
Receiver: Type: class 'MyClass' 
Arguments: []

What version of the product are you using? On what operating system?

Dart SDK version 0.4.1.0_r19425
Ubuntu 12.04 64-bit

Please provide any additional information below.

The IDE accepts the code as valid.

@iposva-google
Copy link
Contributor

cc @gbracha.
Added area-vm, Triaged labels.

@iposva-google
Copy link
Contributor

My understanding is that the VM has the correct behaviour, but I want to check with Gilad first.

@iposva-google
Copy link
Contributor

Removed area-vm label.
Added Area-VM label.

@gbracha
Copy link
Contributor

gbracha commented Mar 13, 2013

THe VM is behaving as specified. MyClass is an expression in this context, and as such represents an object of type Type.

Changing the language to allow this sort of thing is in many ways desirable, but has implications that need to be thought through. That is why it isn't this way at this point. It may change in the future.


Removed Type-Defect, Area-VM labels.
Added Type-Enhancement, Area-Language, Accepted labels.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Mar 13, 2013
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed accepted labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 22, 2018
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). closed-obsolete Closed as the reported issue is no longer relevant P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants