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

Mystery Frog error: We are sorry, but... can not be property #317

Closed
rakudrama opened this issue Nov 3, 2011 · 4 comments
Closed

Mystery Frog error: We are sorry, but... can not be property #317

rakudrama opened this issue Nov 3, 2011 · 4 comments
Assignees

Comments

@rakudrama
Copy link
Member

It took me quite a while to figure this out (in a larger program):

bug2.dart:
class Foo {
  Bar bar;
  Foo() {
    Bar = new Bar();
  }
}

main() {
  var x = new Foo();
}

class Bar {
}

sra@limpopo:~/play1$ ../dart-all/dart/frog/frogsh --out=t.js bug2.dart
bug2.dart:12:1: We are sorry, but... can not be property
class Bar {
^^^^^^^^^^^^

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
CompilerException: bug2.dart:12:1: We are sorry, but... can not be property
class Bar {
^^^^^^^^^^^^
    at World._lang_message (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:15707:5)
    at World.internalError (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:15726:8)
    at TypeMember.providePropertySyntax (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:8958:16)
    at MemberSet.get$treatAsField (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:9948:16)
    at MethodGenerator._visitVarAssign (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:8129:18)
    at MethodGenerator._visitAssign (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:8101:17)
    at MethodGenerator.visitBinaryExpression (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:8090:17)
    at BinaryExpression.visit (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:13837:18)
    at MethodGenerator.visitValue (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:7566:20)
    at MethodGenerator.visitVoid (/usr/local/google/home/sra/dart-all/dart/frog/frogsh:7581:15)

The problem is that the assignment at line 4 has the class name as a LHS. 'Bar' should be 'bar'.
The diagnostic should indicate the line with the error. If 'Bar' has been underlined I think I would have got it.

Maybe line 12 could be a secondary diagnostic, e.g.

bug2.dart:4:4: class 'Bar' can not be target of assignment
    Bar = new Bar();
    ^^^
bug2.dart:12:1: class 'Bar' defined here.

The VM does a reasonable job:

'bug2.dart': Error: line 4 pos 9: Left hand side of '=' is not assignable
    Bar = new Bar();
        ^

@DartBot
Copy link

DartBot commented Nov 3, 2011

This comment was originally written by drfibonacci@google.com


Added Triaged label.

@jmesserly
Copy link

Yeah, that was actually a bogus internal error obscuring the better error we would've displayed later. Fix coming soon.

@jmesserly
Copy link

Set owner to @jmesserly.

@jmesserly
Copy link

Added Fixed label.

nex3 pushed a commit that referenced this issue Aug 31, 2016
Update devrun to use latest node.js
copybara-service bot pushed a commit that referenced this issue Dec 9, 2022
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/4d7dc93..f2bb6e9):
  f2bb6e92  2022-12-07  Sam Rawlins  Bump to 6.1.4 (#3266)

fixnum (https://github.com/dart-lang/fixnum/compare/62916f2..e4f5e97):
  e4f5e97  2022-12-08  Michael Thomsen  Change IntegerDivisionByZeroException to UnsupportedError (#100)
  3bd726f  2022-12-08  Devon Carew  rev the sdk min to 2.19.0-0 (#99)

logging (https://github.com/dart-lang/logging/compare/f322480..0373ef8):
  0373ef8  2022-12-07  Mushaheed Syed  Add a check that throws if a logger name ends with '.' (#123)
  6d46d71  2022-12-06  Devon Carew  Create no-response.yml (#124)

protobuf (https://github.com/dart-lang/protobuf/compare/4f3e328..2706b53):
  2706b53  2022-12-07  Mahdi K. Fard  Add type to a method parameter (#782)
  a57c16a  2022-12-07  Mahdi K. Fard  Fix a typo (#781)

shelf (https://github.com/dart-lang/shelf/compare/1c21047..32e342d):
  32e342d  2022-12-08  István Soós  Prepare the release of shelf_router_generator (#316)
  06e2fe6  2022-12-08  Kevin Moore  shelf: drop non-null-safe tests (#317)
  98363fd  2022-12-06  Kevin Moore  lint: sort pub dependencies
  ad6af2a  2022-12-06  Kevin Moore  shelf_static: move RegExp creation out of every request

test (https://github.com/dart-lang/test/compare/4dceb87..73cd754):
  73cd7540  2022-12-07  Nate Bosch  Record the working directory for VM platform (#1804)
  e40274a6  2022-12-07  Nate Bosch  Restore mono_repo config (#1810)
  02d8764e  2022-12-07  Sigurd Meldgaard  Use Future for return type in runner `main()`. (#1809)
  3d6039b3  2022-12-05  Nate Bosch  Merge test selections by path (#1806)

webdev (https://github.com/dart-lang/webdev/compare/e39506e..3e2364e):
  3e2364e  2022-12-07  Elliott Brooks (she/her)  Add the Dart Debugger / Flutter Inspector panels in Chrome DevTools (#1812)
  c164231  2022-12-07  Elliott Brooks (she/her)  Small fix to the extension test (#1811)
  4bbb4d0  2022-12-06  Elliott Brooks (she/her)  Gracefully handle debugger disconnect events (#1808)
  d3892cf  2022-12-05  Elliott Brooks (she/her)  Refactor puppeteer tests to use `Worker` type (#1809)

Change-Id: I42033e849f40f209831cfb344247b24ad7731ff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274580
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants