Skip to content

CFE doesn't allow void to void assignment #33934

@MichaelRFairhurst

Description

@MichaelRFairhurst

The following should have no errors:

void f(void x) {}                                                                
void voidFn() {}                                                                 
                                                                                 
void main() {                                                                    
  f(voidFn());                                                                   
}

This is critical for mockito, which uses a template argument to accomplish the same thing:

void f<T>(T x) {}                                                                
void voidFn() {}                                                                 
                                                                                 
void main() {                                                                    
  f(voidFn());                                                                   
}   

Both of these should work. @peter-ahe-google

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failureslegacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions