Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$regexp = /^.$/
notice(type($regexp))
class foo($bar) {
notice(type($bar))
}
class { 'foo': bar => $regexp }
Notice: Scope(Class[main]): Regexp[/^.$/]
Notice: Scope(Class[Foo]): String
@binford2k

This comment has been minimized.

Copy link

@binford2k binford2k commented Jun 27, 2017

Hah. It gets worse:

$regexp = /^.$/
notice(type($regexp))

class foo($bar) {
    $buz = Regexp[$bar]
    notice(type($bar))
    notice(type($buz))
}

class { 'foo': bar => $regexp }
root@master:~ # puppet apply test.pp
Notice: Scope(Class[main]): Regexp[/^.$/]
Notice: Scope(Class[Foo]): String
Notice: Scope(Class[Foo]): Type[Regexp[/\/^.$\//]]
Notice: Compiled catalog for master.puppetlabs.vm in environment production in 0.10 seconds
Notice: Applied catalog in 0.31 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment