Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 8728001: Support for 'abstract' modifier for class and spec recommended warnings, issue 375 (Closed)

Created:
9 years ago by scheglov
Modified:
9 years ago
Reviewers:
gbracha, zundel
CC:
reviews_dartlang.org, dart-lang-team_google.com
Visibility:
Public.

Description

Support for 'abstract' modifier for class and spec recommended warnings, issue 375 http://code.google.com/p/dart/issues/detail?id=375 R=zundel@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=2181

Patch Set 1 #

Total comments: 5

Patch Set 2 : Merge. Warning for factory constructor of abstract class. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+432 lines, -202 lines) Patch
M client/dom/src/DOMWrapperBase.dart View 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartClass.java View 4 chunks +43 lines, -4 lines 0 comments Download
M compiler/java/com/google/dart/compiler/backend/js/Normalizer.java View 1 4 chunks +4 lines, -114 lines 0 comments Download
M compiler/java/com/google/dart/compiler/parser/DartParser.java View 1 4 chunks +20 lines, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassElement.java View 1 chunk +6 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java View 5 chunks +22 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/DynamicElementImplementation.java View 1 1 chunk +5 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/SyntheticDefaultConstructorElement.java View 1 1 chunk +11 lines, -7 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/TypeErrorCode.java View 1 2 chunks +7 lines, -2 lines 0 comments Download
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 1 7 chunks +88 lines, -47 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/CompilerTestCase.java View 1 1 chunk +6 lines, -2 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java View 3 chunks +3 lines, -2 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java View 1 1 chunk +189 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java View 1 3 chunks +6 lines, -14 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/dom/AST.java View 1 chunk +1 line, -1 line 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/completion/ast/ClassCompleter.java View 2 chunks +20 lines, -6 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
scheglov
9 years ago (2011-11-28 18:19:32 UTC) #1
zundel
LGTM, but please get someone on the language team to confirm this is what we ...
9 years ago (2011-11-28 23:27:06 UTC) #2
gbracha
Hi, I don't know the codebase nearly well enough to comment, but for the most ...
9 years ago (2011-11-30 17:29:34 UTC) #3
scheglov
9 years ago (2011-11-30 17:44:25 UTC) #4
Thank you for comments.

http://codereview.chromium.org/8728001/diff/1/compiler/javatests/com/google/d...
File
compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
(right):

http://codereview.chromium.org/8728001/diff/1/compiler/javatests/com/google/d...
compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java:340:
*/
On 2011/11/30 17:29:34, gbracha wrote:
> Why is it ok to call a factory of an abstract class? How is it different from
an
> ordinary constructor? And where in the spec did you find this exception?

  It is just logical to allow call of factory constructor without warning.
  As we think optimistically in Dart, we suppose that developer knows what he
does, so we suppose that factory constructor will create valid instance of some
concrete subclass. When we see using normal constructor for abstract class -
this is obviously bad thing. But for factory - no.

  You are right, there are no exception for this in spec.

  I've just thought that for warnings I can speculate a little what is good and
what is bad. I just think what would be useful for IDE users and what not.
  I'm OK with restoring warning, but probably with different ID, to allow IDE
users disable it separately from using non-factory constructor for abstract
class.

Powered by Google App Engine
This is Rietveld 408576698