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

Issue 8826001: frog bug 642: type variables can't be used in allocations. (Closed)

Created:
9 years ago by Siggi Cherem (dart-lang)
Modified:
9 years ago
Reviewers:
Jennifer Messerly
CC:
reviews_dartlang.org
Visibility:
Public.

Description

frog bug 642: type variables can't be used in allocations. Committed: https://code.google.com/p/dart/source/detail?r=2141

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -2 lines) Patch
M frog/gen.dart View 1 1 chunk +10 lines, -0 lines 1 comment Download
M frog/minfrog View 1 2 chunks +9 lines, -1 line 0 comments Download
M frog/type.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/language/language.status View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A tests/language/src/NewExpressionTypeArgsFrogTest.dart View 1 2 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Siggi Cherem (dart-lang)
9 years ago (2011-12-06 19:41:02 UTC) #1
Jennifer Messerly
9 years ago (2011-12-06 22:14:55 UTC) #2
lgtm, but I've got a follow up suggestion for a more comprehensive fix (which
I'd be happy to do--let me know)

http://codereview.chromium.org/8826001/diff/5/frog/gen.dart
File frog/gen.dart (right):

http://codereview.chromium.org/8826001/diff/5/frog/gen.dart#newcode2113
frog/gen.dart:2113: && ((method.typeParameters === null && type.hasTypeParams)
I don't understand the (method.typeParameters === null && type.hasTypeParams)
part

Also, could this just be one warning:

if (type is ParameterType) {
  world.error('cannot instantiate a type parameter', node.span);
   return _makeMissingValue(constructorName);
}

IMHO, there's not a lot of value in checking 2 things here.

However, we probably still need the other error, but it needs to happen
somewhere else (like resolveType?) because you can refer to a type in other ways
besides a "new", for example:

class SomeType<T> {
  static foo() {
    T t = bar(); // or "bar is T"
    return t; 
  }
}

The boolean parameter to resolveType is called "isRequired" but it really
*means* something along the lines of "isStaticContext"

Powered by Google App Engine
This is Rietveld 408576698