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 doesn't fully treat get as a pseudo keyword #379

Closed
DartBot opened this issue Nov 8, 2011 · 5 comments
Closed

VM doesn't fully treat get as a pseudo keyword #379

DartBot opened this issue Nov 8, 2011 · 5 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).

Comments

@DartBot
Copy link

DartBot commented Nov 8, 2011

This issue was originally filed by jimhug@google.com


I've recently fixed a bug in frog to allow get and set to be used as member names - as I believe they are allowed by the spec. When I tried to use this feature in the frog compiler, I got a parse error from the VM.

I believe that this should be allowed by the spec and is one of the most useful things that we get out of the otherwise somewhat interesting decision to include pseudo-keywords in a v1 language spec. I'd love to get a fix for this, but even more valuable would be a quick response to let me know if you do consider this a bug in the VM or if it is my misreading of the spec. The High priority is just to verify if this is or is not a VM bug - so that I don't take frog down the wrong road. The actual fix is a much lower priority as this is easy enough to work around.

The code that is responsible for the error is this method declaration in frog/value.dart (Note: not currently checked in as that would break our VM tests <smile>).

    Value get(MethodGenerator context, String name, Node node) { ... }

Errors encountered while loading script: '/Users/jimhug/dartfrog/dart/frog/frogc.dart': Error: line 6 pos 1: library handler failed: '/Users/jimhug/dartfrog/dart/frog/lang.dart': Error: line 26 pos 1: library handler failed: '/Users/jimhug/dartfrog/dart/frog/value.dart': Error: line 34 pos 12: identifier expected
  Value get(MethodGenerator context, String name,

import('lang.dart');

^

@DartBot
Copy link
Author

DartBot commented Nov 8, 2011

This comment was originally written by @mhausner


This is currently a bug in the VM.

My main concern is that with allowing get and set to be "pseudo-keywords", the semantics of

get f() { ... }

are unclear. Is this a function f returning a value of type get, or is it a getter f that has no return type specified.

@DartBot
Copy link
Author

DartBot commented Nov 8, 2011

This comment was originally written by jimhug@google.com


Thanks for the quick reply!

I think that your concern is resolved by the current behavior of the VM on PseudoKWNegativeTest. This prohibits the use of pseudo keywords as type names - but not as member names. I've opened a separate issue #356 to track this one, but I hope that we can resolve that issue in favor of the current VM behavior and address this ambiguity at the same time. Of course, if someone wanted to just make all of the current dart keywords true keywords for the v1 release I would also be very supportive of that change.


Removed Priority-High label.
Added Priority-Medium label.

@DartBot
Copy link
Author

DartBot commented Nov 8, 2011

This comment was originally written by @mhausner


The behavior currently implemented in the VM reflects the understanding we had earlier in the year that pseudo-keywords are proper keywords "at the top level", that is outside of a function block. From this it follows that get or set can be used as local variable names, but not as type, function, field or parameter name.

The spec does say something different than what I describe above. Gilad will revisit the issue.

Personally, I'd love to see all pseudo-keywords be proper keywords.

@iposva-google
Copy link
Contributor

Over to Gilad to clarify.


Set owner to @gbracha.
Removed Area-VM label.
Added Area-Language, Accepted labels.

@gbracha
Copy link
Contributor

gbracha commented Apr 13, 2012

The spec now disallows built-in identifiers as types, but tolerates them with warnings otherwise. Using them is terrible style, and the warnings are no doubt enough to annoy anyone who likes the idea. The only reason for tolerating this usage is to ease conversion from other languages (mainly JS).


Added Done label.

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Apr 13, 2012
dart-bot pushed a commit that referenced this issue Jun 12, 2019
2019-06-11 tvolkert@users.noreply.github.com More fixes to cast response to Stream<List<int>> (#385)
2019-06-11 tvolkert@users.noreply.github.com Pass Uint8List to Datagram (#382)
2019-06-11 tvolkert@users.noreply.github.com Cast HttpRequest and HttpClientResponse streams to List<int> (#384)
2019-06-10 sgrekhov@unipro.ru Fixes #364. Change expected result to null for default values of clientMaxWindowBits and serverMaxWindowBits
2019-06-07 sgrekhov@unipro.ru Fixes #380. Added tests for logical and bitwise operations via type aliases
2019-06-07 sgrekhov@unipro.ru Additional fix for #373. Code style improved and more strict pattern checking
2019-06-06 sgrekhov@unipro.ru Fix for #380. Added tests for type aliases for built-in types. Test string concatenation and arithmetic operations
2019-06-05 sgrekhov@unipro.ru Fixes #380. Added tests for type aliases for built-in types initialization
2019-06-05 sgrekhov@unipro.ru Fixes #373. Expect reasonable file mode on Unix
2019-06-04 sgrekhov@unipro.ru Fixes #379. Numerous fixes for io/Process tests
2019-06-04 sgrekhov@unipro.ru Fixes #378. Use Platform.resolvedExecutable instead of 'dart' command
2019-06-04 irina.arkhipets@gmail.com Fixed Issue #375: it's possible that IPv6 loopback does not exist.
2019-06-04 irina.arkhipets@gmail.com Fixed Issue #236: host.host can be either "localhost" or Platform.localHostname.
2019-06-04 irina.arkhipets@gmail.com Issue #370, instantiate-to-bounds: added static tests for non-function type aliases.
2019-06-04 sgrekhov@unipro.ru Fix for #377. Use correct network interface type name (IPvX)
2019-06-04 sgrekhov@unipro.ru Fixes #374. Change pattern for error messages
2019-06-04 irina.arkhipets@gmail.com Issue #370, instantiate-to-bounds: added dynamic tests for non-function type aliases.
2019-06-04 sgrekhov@unipro.ru Fix for #372. Expect.fail() on timeout added
2019-06-04 sgrekhov@unipro.ru Fixes #371. Remove excessive asyncStart()
2019-06-03 irina.arkhipets@gmail.com Issue #147, test super bounded types: added tests for non-function type aliases.
2019-05-30 sgrekhov@unipro.ru Fixes #369. Use correct type arguments to avoid errors
2019-05-30 sgrekhov@unipro.ru Fixes #368. Don't try to bind system port
2019-05-30 sgrekhov@unipro.ru Fixes #367. Remove excessive asyncStart()
2019-05-30 sgrekhov@unipro.ru Fixes #366. Change expected result to SocketException

TBR=whesse@google.com

Change-Id: I137689755907b3333e597d7d210db2b4d37d70d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105641
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@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
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

4 participants