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

compile error for a typedef that uses a class that indirectly uses the typedef #19459

Closed
DartBot opened this issue Jun 14, 2014 · 8 comments
Closed
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Milestone

Comments

@DartBot
Copy link

DartBot commented Jun 14, 2014

This issue was originally filed by bslesinsk...@gmail.com


Sample code:

import 'dart:collection';

abstract class Template {
  expand(TemplateMap others);
}

abstract class TemplateMap extends UnmodifiableMapBase<dynamic, CreateTemplate> {
}

typedef Template CreateTemplate();

The error is:

"Type alias cannot reference itself directly or recursively via another typedef."

It seems like this should be allowed due to the indirection through a class? Dart doesn't use structural typing for classes, so it seems like the type checker shouldn't need to look at the methods within Template when checking the return value of the typedef.

Or if this is disallowed, it seems like the error could be better. It should mention that the recursion has to do with the parameter of the "expand" method.

Dart Editor version 1.5.0.dev_04_11 (DEV)
Dart SDK version 1.5.0-dev.4.11

@lrhn
Copy link
Member

lrhn commented Jun 15, 2014

Seems like a bug in the analyzer.


Added Area-Analyzer, Triaged labels.

@bwilkerson
Copy link
Member

Added this to the 1.6 milestone.
Removed Priority-Unassigned label.
Added Priority-Medium label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the 1.6 milestone.
Added Oldschool-Milestone-1.6 label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-1.6 label.

@stereotype441
Copy link
Member

Set owner to @stereotype441.
Added Started label.

@stereotype441
Copy link
Member

Fix submitted for review: https://codereview.chromium.org/705553003/

@stereotype441
Copy link
Member

Fixed in revision 41525.


Added Fixed label.

@clayberg
Copy link

Added this to the 1.8 milestone.

@DartBot DartBot added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 28, 2014
@DartBot DartBot added this to the 1.8 milestone Nov 28, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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

6 participants