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

Implement correct parametrized types for factories #417

Closed
ghost opened this issue Nov 10, 2011 · 7 comments
Closed

Implement correct parametrized types for factories #417

ghost opened this issue Nov 10, 2011 · 7 comments
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@ghost
Copy link

ghost commented Nov 10, 2011

This test crashes in debug mode:
./vm/ast.h:1689: error: expected: type_arguments_.IsNull() || (type_arguments_.Length() == Class::Handle(constructor_.owner()).NumTypeArguments())

Once the crash is analyzed and eliminated, feel free to lower this issues's priority.


FactoryNegativeTest.dart:

main() {
  // Compile time error, wrong factory method.
  var a = new Link<int>.create();
}

interface Link<T> factory LinkFactory {
  Link.create();
}

class LinkFactory {
  // Compile time error: should be Link<T>.create().
  factory Link.create() {
    return null;
  }
}

@ghost
Copy link
Author

ghost commented Nov 11, 2011

The crash has been eliminated, an error is reported.


Removed Priority-Critical label.
Added Priority-High label.

@crelier
Copy link
Contributor

crelier commented Nov 17, 2011

Proper factory syntax was implemented by the VM in r1595.
dartc and frog have to implement it too, so that all libraries can be fixed.
Reassigning to dartc area.


Removed the owner.
Removed Area-VM label.
Added Area-Compiler label.

@DartBot
Copy link

DartBot commented Nov 28, 2011

This comment was originally written by mmendez@google.com


Eric, could you take a look at this issue? We should definitely support parsing and static type checking. I'll leave it up to you to make a recommendation on code generation support for this.


Set owner to zundel@google.com.
Added Accepted label.

@DartBot
Copy link

DartBot commented Nov 28, 2011

This comment was originally written by mmendez@google.com


Also, I believe that it is section 8.3 of v0.5 of the spec that covers this. Ivan mentioned that the map.dart, hash_map_set.dart have commented out code that demonstrate the syntax. You will see comments marked with issue #417.

@DartBot
Copy link

DartBot commented Dec 1, 2011

This comment was originally written by zundel@google.com


as of r2004, the parser will start accepting the new syntax for factory methods, (but nothing will be done with the types).

@crelier
Copy link
Contributor

crelier commented Dec 13, 2011

The revised factory syntax is supported in the VM in r2394.
The old factory syntax is still supported, but warnings are issued.

@DartBot
Copy link

DartBot commented Dec 20, 2011

This comment was originally written by zundel@google.com


dartc updated as of r2629.


Added Fixed label.

@ghost ghost added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures labels Dec 20, 2011
copybara-service bot pushed a commit that referenced this issue Jun 2, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 5699caf..e3f4bd2
 https://dart.googlesource.com/markdown.git/+/e3f4bd2 example: update CDN asset links (#435)
 https://dart.googlesource.com/markdown.git/+/a678bfc example: add GitHub markdown CSS (#434)
 https://dart.googlesource.com/markdown.git/+/bc79c43 Merge pull request #425 from dart-lang/pq-patch-1
 https://dart.googlesource.com/markdown.git/+/4e8aa03 add pub badge
 https://dart.googlesource.com/markdown.git/+/7987e1e Remove dependency on third party package:charcode.
 https://dart.googlesource.com/markdown.git/+/90995fd Split block_parser.dart and inline_parser.dart (#422)
 https://dart.googlesource.com/markdown.git/+/8bb9062 Add trailing commas to some parameter lists to get better formatting (#420)
 https://dart.googlesource.com/markdown.git/+/1c5f2e7 Enable raw strings lint rules (#418)
 https://dart.googlesource.com/markdown.git/+/4784153 Enable use_if_null_to_convert_nulls_to_bools lint rule (#417)
 https://dart.googlesource.com/markdown.git/+/0d67e99 Enable prefer_interpolation_to_compose_strings (#416)
 https://dart.googlesource.com/markdown.git/+/5561351 Enable prefer_final_locals lint rule (#415)
 https://dart.googlesource.com/markdown.git/+/6d39147 Create DelimiterSyntax to replace TagSyntax (#407)
 https://dart.googlesource.com/markdown.git/+/4f4e899 Add caseSensitive parameter on the InlineSyntax constructor (#400)
 https://dart.googlesource.com/markdown.git/+/e16aff0 Check parser.isDone when title is null in _parseInlineBracketedLink (#394)
 https://dart.googlesource.com/markdown.git/+/3471578 Use `Uri.toFilePath()` instead of `Uri.path` for locating tests (#396)

```

Diff: https://dart.googlesource.com/markdown.git/+/5699cafa9ef004875fd7de8ae9ea00e5295e87a4~..e3f4bd28c9e61b522f75f291d4d6cfcfeccd83ee/
Change-Id: Ie04b17dfcce57fcd9e814bd8b9a09677a91136d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246984
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@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
P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

2 participants