Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dartc allows a method and getter/setter with the same name #973

Closed
DartBot opened this issue Dec 26, 2011 · 7 comments
Closed

Dartc allows a method and getter/setter with the same name #973

DartBot opened this issue Dec 26, 2011 · 7 comments
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone

Comments

@DartBot
Copy link

DartBot commented Dec 26, 2011

This issue was originally filed by ms...@unipro.ru


When getter or setter(implicit or explicit) and a method with the same name are divided into different classes(interfaces), dartc does not produce a compile-time error.
Dartc(r2810) executes this code without errors:
Test 1:
class A {
  foo(){throw new A();}
}

class C extends A {
  get foo() { return "foo()"; }
}

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

Test 2:
class A {
  var foo;
}

class C extends A {
  foo() { return "foo()"; }
}

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

Test 3:
class A {
  void set foo(var x){}
}

class C extends A {
  foo(value) {}
}

main() {
  new C().foo(1);
}

Test 4:
interface S {
  void m();
}

interface I extends S {
  int m;
}

class A implements I {}

main() {
  new A();
}

Test 5:
interface S {
  int m;
}

interface J extends S {
  int m();
}

class A implements J {}

main() {
  new A();
}

 

@dgrove
Copy link
Contributor

dgrove commented Jan 2, 2012

in my tests on r2899, these are all correctly producing compile-time errors with dartc.


Added Area-Compiler, Fixed labels.

@DartBot
Copy link
Author

DartBot commented Apr 6, 2012

This comment was originally written by zundel@google.com


co19 test failure is not fixed: tests/co19/src/Language/07_Classes/2_Getters_A04_t03.dart

class A {
  var foo;
}

class C extends A {
  foo() { return "foo()"; }
}

Section 7.2 Getters says that this could be a compile-time error but it is only a warning.


Added Triaged label.

@kasperl
Copy link

kasperl commented Apr 17, 2012

Removed Area-Compiler label.
Added Area-Analyzer label.

@danrubel
Copy link

danrubel commented Jun 4, 2012

Added this to the M1 milestone.

@DartBot
Copy link
Author

DartBot commented Jun 6, 2012

This comment was originally written by zundel@google.com


Set owner to zundel@google.com.

@DartBot
Copy link
Author

DartBot commented Jun 7, 2012

This comment was originally written by zundel@google.com


https://chromiumcodereview.appspot.com/10533050/


Added Started label.

@DartBot
Copy link
Author

DartBot commented Jun 8, 2012

This comment was originally written by zundel@google.com


r8410


Added Fixed label.

@DartBot DartBot added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Jun 8, 2012
@DartBot DartBot added this to the M1 milestone Jun 8, 2012
dart-bot pushed a commit that referenced this issue Dec 8, 2020
2020-12-06 sgrekhov@unipro.ru Fixes #972. Remove nnbd-strong flag from static Subtyping tests
2020-12-04 irina.arkhipets@gmail.com Fixes #973: `SharedOptions=--enable-experiment=triple-shift` tag removed from the tests.
2020-12-04 irina.arkhipets@gmail.com Issue #972: needless `Requirements=nnbd-strong` tag removed.
2020-12-04 irina.arkhipets@gmail.com Issue #972: `Requirements=nnbd-strong` tags removed from the following LanguageFeatures/nnbd tests: tripple-shift, type-aliases, type-normalization.
2020-12-04 irina.arkhipets@gmail.com Issue #972: `Requirements=nnbd-strong` tags removed from LanguageFeatures/nnbd/ovrriding tests.
2020-12-04 irina.arkhipets@gmail.com Issue #972: `Requirements=nnbd-strong` tags remoed from LanguqgeFeatures/nnbd/Least-greatest-closure/nonfunction_typedef tests. Duplicated nonfunction)typedef tests removed.
2020-12-04 irina.arkhipets@gmail.com Issue #972: `Requirements=nnbd-strong` tags remoed from LanguqgeFeatures/nnbd/Least-greatest-closure/class, LanguqgeFeatures/nnbd/Least-greatest-closure/nonfunction_typedef tests.
2020-12-04 irina.arkhipets@gmail.com Issue #972: `Requirements=nnbd-strong` tags remoed from LanguqgeFeatures/nnbd/flow-analysis tests.
2020-12-04 irina.arkhipets@gmail.com Issue #463: Missing Requirements=nnbd-strong tags added.
2020-12-03 irina.arkhipets@gmail.com Fix for the Issue #972: `Requirements=nnbd-strong` removed from LanguageFeatures/nnbd tests (without subdirectories)
2020-12-02 sgrekhov@unipro.ru Cross Origin Error for HttpRequest tests fixed
2020-12-02 irina.arkhipets@gmail.com Typo corrected.
2020-12-01 sgrekhov@unipro.ru Test that use tripple shift operation moved to tripple-shift directory

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I5f19e8ddc738713b2339cae22d1d1925e35b1da2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175242
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
copybara-service bot pushed a commit that referenced this issue Jun 29, 2023
…uf, test

Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/e04a6b3..c2ed703):
  c2ed703c  2023-06-26  dependabot[bot]  Bump ossf/scorecard-action from 2.1.3 to 2.2.0 (#3454)

ecosystem (https://github.com/dart-lang/ecosystem/compare/b1056e6..19fa443):
  19fa443  2023-06-29  Lasse R.H. Nielsen  Clean-up and tweaks of the firehose project. (#117)
  9ef5948  2023-06-27  Moritz  Excise health from firehose (#118)
  36c662e  2023-06-27  Moritz  Introduce a health checking workflow (#115)

http (https://github.com/dart-lang/http/compare/ff1fcfe..d68081f):
  d68081f  2023-06-26  Nate Bosch  Prepare to publish package:http (#973)
  067bff3  2023-06-26  Alex James  Create java http package (#971)

lints (https://github.com/dart-lang/lints/compare/79581ff..89f9519):
  89f9519  2023-06-28  Parker Lougheed  Fix typo in 3.0.0-wip changelog entry (#137)

markdown (https://github.com/dart-lang/markdown/compare/bd6ae8d..4674d09):
  4674d09  2023-06-27  Zhiguang Chen  Fix HtmlBlockSyntax (#548)

mockito (https://github.com/dart-lang/mockito/compare/1d6064a..974226e):
  974226e  2023-06-27  Googler  Internal change

protobuf (https://github.com/dart-lang/protobuf/compare/e76bd74..7bebbc6):
  7bebbc6  2023-06-29  Ömer Sinan Ağacan  Update protoc_plugin Makefile: (#858)
  acc0462  2023-06-29  Ömer Sinan Ağacan  Ignore non-items in message sets (#857)
  0eb3796  2023-06-29  Ömer Sinan Ağacan  Ignore unknown tags in message set items (#856)
  2996e1d  2023-06-27  Ömer Sinan Ağacan  Implement message set wire format (#836)

test (https://github.com/dart-lang/test/compare/cdc8178..021667a):
  021667a4  2023-06-28  Jacob MacDonald  prep to release (#2048)
  3d44fcae  2023-06-28  Yaroslav Vorobev  feat(test): add MOZ_AUTOMATION=1 to ff test runner (#2049)
  6e675f80  2023-06-28  Parker Lougheed  Replace broken link to observatory with DevTools mention (#2047)
  2904779b  2023-06-28  Yaroslav Vorobev  feat(runner): add env overrides for safari and ff (#2042)
  54350282  2023-06-28  Parker Lougheed  Update link from old linter site to dart.dev (#2046)
  8c4b15d1  2023-06-28  Jacob MacDonald  allow the latest analyzer (6.x.x) (#2045)

Change-Id: I86901fb2211adf81288f0940a355d6c33ddd8a7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311927
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

4 participants