-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I wish this were a PR but I would require some guidance to where to start differentiating this error condition from others.
Improve error message when instantiating generics that lack a type
Example
import critbits
proc init(): ref CritBitTree =
new(result)
var a = init()Current Output
Error: cannot instantiate: 'CritBitTree'
Not helpful. Consider a programmer on a deadline after an all nighter at six in the morning. Shouldn't happen, but...
Expected Output
Error: cannot instantiate: 'CritBitTree'
Might the type definition be missing its concrete type, e.g. 'CritBitTree[void]' instead of 'CritBitTree'`?
Sleep deprived programmer now loves the compiler.
Possible Solution
Errors due to lacking concrete type would have to be isolated from other "cannot instantiate" error conditions and this message emitted.
Metadata
Metadata
Assignees
Labels
No labels