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

VM exits abnormally if a getter calls an abstract superclass getter #7420

Closed
alan-knight opened this issue Dec 14, 2012 · 2 comments
Closed
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant

Comments

@alan-knight
Copy link
Contributor

The following program yields the error below, and if run in the editor does not drop into the debugger. Instead the VM exits with status 255. The code is clearly incorrect, but only shows a warning in the editor, and seems like it should end up in noSuchMethod or some other more normal failure mode.

file:///Users/alanknight/dart/Scratch/missingsuper.dart': Error: line 9 pos 20: field or getter 'foo' not found in superclass
    print(super.foo);

abstract class Superclass {
  get foo;
}

class CallAbstractSuperMethod extends Superclass {
  get foo {
    print(x);
    print(super.foo);
    return 3;
  }
}

main() {
  new CallAbstractSuperMethod().foo;
}

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@dgrove
Copy link
Contributor

dgrove commented Jan 15, 2015

FYI - with version 1.9.0-dev.3.0, this does the right thing:

Unhandled exception:
Class 'CallAbstractSuperMethod' has no instance getter 'x'.

NoSuchMethodError: method not found: 'x'
Receiver: Instance of 'CallAbstractSuperMethod'
Arguments: []
#­0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#­1 CallAbstractSuperMethod.foo (file:///usr/local/google/home/dgrove/tmp/x.dart:7:11)
#­2 main (file:///usr/local/google/home/dgrove/tmp/x.dart:14:33)
#­3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:260)
#­4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:142)


Added AssumedStale label.

@alan-knight alan-knight added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant labels Jan 15, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

3 participants