summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/scope.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index e81664219..b441fd4bc 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -639,7 +639,13 @@ module Puppet
# Define our type.
def settype(name,ltype)
- @typetable[name] = ltype
+ # Don't let them redefine the class in this scope.
+ if @typetable.include?(name)
+ raise Puppet::ParseError,
+ "%s is already defined" % name
+ else
+ @typetable[name] = ltype
+ end
end
# Return an interpolated string.