Issue #16213 has been updated by Dustin Mitchell.

Not that my opinion counts for much, but I'm very much with dpittman on this - 
dashes have been documented as illegal for a long time, but de-facto 
half-functional.  Deprecate that now, so when in the future it's impossible to 
maintain the half-functionality, it can be removed without much fuss.  So I 
guess that makes this bug a dupe of #17260, and #5268 invalid?
----------------------------------------
Bug #16213: Dashes in class names are illegal.  So the compiler should complain 
about them!
https://projects.puppetlabs.com/issues/16213#change-75314

Author: Dustin Mitchell
Status: Duplicate
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


    class abc-def($var) {
        notice("$abc-def::var")
    }

    class {
        abc-def: var => 'hi';
    }

does what a naive user might expect up through 2.7.14 (Scope(Class[Abc-def]): 
hi).  After that, it does what a more experienced user might expect 
(Scope(Class[Abc-def]): -def::var).  Adding braces:

    class abc-def($var) {
        notice("$abc-def::var")
    }

    class {
        abc-def: var => 'hi';
    }

still does what a naive user expects on 2.7.14, but gives an error on 2.7.16 
and higher.

However, in all of those versions, that class name itself is illegal - 
http://docs.puppetlabs.com/learning/modules1.html#an-aside-names-namespaces-and-scope

Classes with dashes in them should be disallowed by the parser.  At least in 
3.0.x.  And they should trigger a warning in 2.7.x since (a) they don't really 
work and (b) they'll be disallowed in 3.0.x.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to