Skip to content

Instantly share code, notes, and snippets.

@richardc
Created June 27, 2017 16:15
Show Gist options
  • Save richardc/1380cda39d7bebca19ddc9dc06fb1a16 to your computer and use it in GitHub Desktop.
Save richardc/1380cda39d7bebca19ddc9dc06fb1a16 to your computer and use it in GitHub Desktop.
$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
Copy link

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