Skip to content

Commit

Permalink
- Fixed issue #335
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Mar 31, 2013
1 parent 2361db9 commit d7a7c70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/resolver.cc
Expand Up @@ -101,6 +101,7 @@ void Resolver::visit(FunctionDecl* node)

Value* fval = new Value;
fval->setObj(CLEVER_FUNC_TYPE, func);
fval->setConst(true);

if (m_class && !node->isAnonymous()) {
func->setContext(m_class);
Expand Down
14 changes: 14 additions & 0 deletions tests/lang/class_007.test
@@ -0,0 +1,14 @@
[FATAL] Testing member overwrite
==CODE==
import std.io;

class Test {
function method() {
io:println('aa');
}
}

var w = Test.new;
w.method = 'aaa';
==RESULT==
Fatal error: Cannot assign to a const variable! on \S+ line 10

0 comments on commit d7a7c70

Please sign in to comment.