D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5150 - lazy allows you to declare void parameters
Summary: lazy allows you to declare void parameters
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-11-01 09:24 UTC by Jonathan M Davis
Modified: 2015-06-09 05:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan M Davis 2010-11-01 09:24:46 UTC
This program compiles:

void func(lazy void a)
{
}

void main()
{
}


It shouldn't. If a were not lazy, you'd get the error

d.d(1): Error: cannot have parameter of type void


It shouldn't be any more legal to have a lazy void parameter than a void parameter. It makes it seem like lazy parameters aren't properly type checked.
Comment 1 Stewart Gordon 2010-11-01 09:53:30 UTC
The spec explicitly allows it.

http://www.digitalmars.com/d/1.0/function.html#parameters
Comment 2 Jonathan M Davis 2010-11-01 09:58:37 UTC
Okay. Why? What possible use does it have?