2013-06-22 20:58:41 -05:00
|
|
|
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
2012-12-03 18:48:01 -06:00
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2013-05-17 17:28:44 -05:00
|
|
|
|
2014-05-14 14:31:30 -05:00
|
|
|
use middle::def::*;
|
2012-12-23 16:41:37 -06:00
|
|
|
use middle::ty;
|
|
|
|
use middle::typeck;
|
|
|
|
use util::ppaux;
|
|
|
|
|
|
|
|
use syntax::ast::*;
|
2014-09-14 19:21:25 -05:00
|
|
|
use syntax::ast_util;
|
2013-08-12 19:10:10 -05:00
|
|
|
use syntax::visit::Visitor;
|
|
|
|
use syntax::visit;
|
|
|
|
|
2014-09-12 05:10:30 -05:00
|
|
|
struct CheckCrateVisitor<'a, 'tcx: 'a> {
|
2014-04-22 07:56:37 -05:00
|
|
|
tcx: &'a ty::ctxt<'tcx>,
|
2014-09-12 05:10:30 -05:00
|
|
|
in_const: bool
|
2013-08-12 19:10:10 -05:00
|
|
|
}
|
|
|
|
|
2014-09-12 05:10:30 -05:00
|
|
|
impl<'a, 'tcx> CheckCrateVisitor<'a, 'tcx> {
|
|
|
|
fn with_const(&mut self, in_const: bool, f: |&mut CheckCrateVisitor<'a, 'tcx>|) {
|
|
|
|
let was_const = self.in_const;
|
|
|
|
self.in_const = in_const;
|
|
|
|
f(self);
|
|
|
|
self.in_const = was_const;
|
2013-08-12 19:10:10 -05:00
|
|
|
}
|
2014-09-12 05:10:30 -05:00
|
|
|
fn inside_const(&mut self, f: |&mut CheckCrateVisitor<'a, 'tcx>|) {
|
|
|
|
self.with_const(true, f);
|
2013-08-12 19:10:10 -05:00
|
|
|
}
|
2014-09-12 05:10:30 -05:00
|
|
|
fn outside_const(&mut self, f: |&mut CheckCrateVisitor<'a, 'tcx>|) {
|
|
|
|
self.with_const(false, f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-09 17:54:36 -05:00
|
|
|
impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
|
2014-09-12 05:10:30 -05:00
|
|
|
fn visit_item(&mut self, i: &Item) {
|
|
|
|
check_item(self, i);
|
|
|
|
}
|
|
|
|
fn visit_pat(&mut self, p: &Pat) {
|
|
|
|
check_pat(self, p);
|
|
|
|
}
|
|
|
|
fn visit_expr(&mut self, ex: &Expr) {
|
2014-10-06 23:32:58 -05:00
|
|
|
if check_expr(self, ex) {
|
rustc: Add `const` globals to the language
This change is an implementation of [RFC 69][rfc] which adds a third kind of
global to the language, `const`. This global is most similar to what the old
`static` was, and if you're unsure about what to use then you should use a
`const`.
The semantics of these three kinds of globals are:
* A `const` does not represent a memory location, but only a value. Constants
are translated as rvalues, which means that their values are directly inlined
at usage location (similar to a #define in C/C++). Constant values are, well,
constant, and can not be modified. Any "modification" is actually a
modification to a local value on the stack rather than the actual constant
itself.
Almost all values are allowed inside constants, whether they have interior
mutability or not. There are a few minor restrictions listed in the RFC, but
they should in general not come up too often.
* A `static` now always represents a memory location (unconditionally). Any
references to the same `static` are actually a reference to the same memory
location. Only values whose types ascribe to `Sync` are allowed in a `static`.
This restriction is in place because many threads may access a `static`
concurrently. Lifting this restriction (and allowing unsafe access) is a
future extension not implemented at this time.
* A `static mut` continues to always represent a memory location. All references
to a `static mut` continue to be `unsafe`.
This is a large breaking change, and many programs will need to be updated
accordingly. A summary of the breaking changes is:
* Statics may no longer be used in patterns. Statics now always represent a
memory location, which can sometimes be modified. To fix code, repurpose the
matched-on-`static` to a `const`.
static FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
change this code to:
const FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
* Statics may no longer refer to other statics by value. Due to statics being
able to change at runtime, allowing them to reference one another could
possibly lead to confusing semantics. If you are in this situation, use a
constant initializer instead. Note, however, that statics may reference other
statics by address, however.
* Statics may no longer be used in constant expressions, such as array lengths.
This is due to the same restrictions as listed above. Use a `const` instead.
[breaking-change]
[rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-06 10:17:01 -05:00
|
|
|
visit::walk_expr(self, ex);
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
2013-08-12 19:10:10 -05:00
|
|
|
}
|
|
|
|
}
|
2011-11-08 20:26:02 -06:00
|
|
|
|
2014-09-07 12:09:06 -05:00
|
|
|
pub fn check_crate(tcx: &ty::ctxt) {
|
|
|
|
visit::walk_crate(&mut CheckCrateVisitor { tcx: tcx, in_const: false },
|
|
|
|
tcx.map.krate());
|
2014-03-05 08:36:01 -06:00
|
|
|
tcx.sess.abort_if_errors();
|
2011-11-08 20:26:02 -06:00
|
|
|
}
|
|
|
|
|
2014-09-12 05:10:30 -05:00
|
|
|
fn check_item(v: &mut CheckCrateVisitor, it: &Item) {
|
2012-08-06 14:34:08 -05:00
|
|
|
match it.node {
|
rustc: Add `const` globals to the language
This change is an implementation of [RFC 69][rfc] which adds a third kind of
global to the language, `const`. This global is most similar to what the old
`static` was, and if you're unsure about what to use then you should use a
`const`.
The semantics of these three kinds of globals are:
* A `const` does not represent a memory location, but only a value. Constants
are translated as rvalues, which means that their values are directly inlined
at usage location (similar to a #define in C/C++). Constant values are, well,
constant, and can not be modified. Any "modification" is actually a
modification to a local value on the stack rather than the actual constant
itself.
Almost all values are allowed inside constants, whether they have interior
mutability or not. There are a few minor restrictions listed in the RFC, but
they should in general not come up too often.
* A `static` now always represents a memory location (unconditionally). Any
references to the same `static` are actually a reference to the same memory
location. Only values whose types ascribe to `Sync` are allowed in a `static`.
This restriction is in place because many threads may access a `static`
concurrently. Lifting this restriction (and allowing unsafe access) is a
future extension not implemented at this time.
* A `static mut` continues to always represent a memory location. All references
to a `static mut` continue to be `unsafe`.
This is a large breaking change, and many programs will need to be updated
accordingly. A summary of the breaking changes is:
* Statics may no longer be used in patterns. Statics now always represent a
memory location, which can sometimes be modified. To fix code, repurpose the
matched-on-`static` to a `const`.
static FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
change this code to:
const FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
* Statics may no longer refer to other statics by value. Due to statics being
able to change at runtime, allowing them to reference one another could
possibly lead to confusing semantics. If you are in this situation, use a
constant initializer instead. Note, however, that statics may reference other
statics by address, however.
* Statics may no longer be used in constant expressions, such as array lengths.
This is due to the same restrictions as listed above. Use a `const` instead.
[breaking-change]
[rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-06 10:17:01 -05:00
|
|
|
ItemStatic(_, _, ref ex) |
|
|
|
|
ItemConst(_, ref ex) => {
|
2014-09-07 12:09:06 -05:00
|
|
|
v.inside_const(|v| v.visit_expr(&**ex));
|
2014-01-09 07:05:33 -06:00
|
|
|
}
|
|
|
|
ItemEnum(ref enum_definition, _) => {
|
|
|
|
for var in (*enum_definition).variants.iter() {
|
|
|
|
for ex in var.node.disr_expr.iter() {
|
2014-09-12 05:10:30 -05:00
|
|
|
v.inside_const(|v| v.visit_expr(&**ex));
|
2014-01-09 07:05:33 -06:00
|
|
|
}
|
2012-01-16 03:36:47 -06:00
|
|
|
}
|
|
|
|
}
|
2014-09-12 05:10:30 -05:00
|
|
|
_ => v.outside_const(|v| visit::walk_item(v, it))
|
2011-11-08 20:26:02 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-12 05:10:30 -05:00
|
|
|
fn check_pat(v: &mut CheckCrateVisitor, p: &Pat) {
|
2014-03-05 08:36:01 -06:00
|
|
|
fn is_str(e: &Expr) -> bool {
|
2012-08-06 14:34:08 -05:00
|
|
|
match e.node {
|
2014-09-07 12:09:06 -05:00
|
|
|
ExprBox(_, ref expr) => {
|
2014-01-03 17:08:48 -06:00
|
|
|
match expr.node {
|
2014-09-07 12:09:06 -05:00
|
|
|
ExprLit(ref lit) => ast_util::lit_is_str(&**lit),
|
2014-01-03 17:08:48 -06:00
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_ => false,
|
2012-07-12 14:14:08 -05:00
|
|
|
}
|
2011-12-02 06:42:51 -06:00
|
|
|
}
|
2012-08-06 14:34:08 -05:00
|
|
|
match p.node {
|
2014-09-12 05:10:30 -05:00
|
|
|
// Let through plain ~-string literals here
|
|
|
|
PatLit(ref a) => if !is_str(&**a) { v.inside_const(|v| v.visit_expr(&**a)); },
|
|
|
|
PatRange(ref a, ref b) => {
|
|
|
|
if !is_str(&**a) { v.inside_const(|v| v.visit_expr(&**a)); }
|
|
|
|
if !is_str(&**b) { v.inside_const(|v| v.visit_expr(&**b)); }
|
|
|
|
}
|
|
|
|
_ => v.outside_const(|v| visit::walk_pat(v, p))
|
2011-12-02 06:42:51 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-06 23:32:58 -05:00
|
|
|
fn check_expr(v: &mut CheckCrateVisitor, e: &Expr) -> bool {
|
|
|
|
if !v.in_const { return true }
|
|
|
|
|
|
|
|
match e.node {
|
|
|
|
ExprUnary(UnDeref, _) => {}
|
|
|
|
ExprUnary(UnUniq, _) => {
|
|
|
|
span_err!(v.tcx.sess, e.span, E0010,
|
|
|
|
"cannot do allocations in constant expressions");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
ExprLit(ref lit) if ast_util::lit_is_str(&**lit) => {}
|
|
|
|
ExprBinary(..) | ExprUnary(..) => {
|
2014-03-05 08:36:01 -06:00
|
|
|
let method_call = typeck::MethodCall::expr(e.id);
|
2014-04-09 10:18:40 -05:00
|
|
|
if v.tcx.method_map.borrow().contains_key(&method_call) {
|
2014-07-11 11:54:01 -05:00
|
|
|
span_err!(v.tcx.sess, e.span, E0011,
|
2014-10-06 23:32:58 -05:00
|
|
|
"user-defined operators are not allowed in constant \
|
|
|
|
expressions");
|
2012-01-26 05:26:14 -06:00
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
|
|
|
ExprLit(_) => (),
|
|
|
|
ExprCast(_, _) => {
|
2014-03-05 08:36:01 -06:00
|
|
|
let ety = ty::expr_ty(v.tcx, e);
|
2013-03-04 17:22:03 -06:00
|
|
|
if !ty::type_is_numeric(ety) && !ty::type_is_unsafe_ptr(ety) {
|
2014-07-11 11:54:01 -05:00
|
|
|
span_err!(v.tcx.sess, e.span, E0012,
|
2014-10-06 23:32:58 -05:00
|
|
|
"can not cast to `{}` in a constant expression",
|
|
|
|
ppaux::ty_to_string(v.tcx, ety));
|
2012-03-14 12:04:03 -05:00
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
|
|
|
ExprPath(ref pth) => {
|
2012-11-06 19:13:52 -06:00
|
|
|
// NB: In the future you might wish to relax this slightly
|
|
|
|
// to handle on-demand instantiation of functions via
|
|
|
|
// foo::<bar> in a const. Currently that is only done on
|
|
|
|
// a path in trans::callee that only works in block contexts.
|
2013-08-07 11:47:28 -05:00
|
|
|
if !pth.segments.iter().all(|segment| segment.types.is_empty()) {
|
2014-07-11 11:54:01 -05:00
|
|
|
span_err!(v.tcx.sess, e.span, E0013,
|
2014-10-06 23:32:58 -05:00
|
|
|
"paths in constants may only refer to items without \
|
|
|
|
type parameters");
|
2012-11-06 19:13:52 -06:00
|
|
|
}
|
2014-04-09 10:18:40 -05:00
|
|
|
match v.tcx.def_map.borrow().find(&e.id) {
|
2014-10-06 23:32:58 -05:00
|
|
|
Some(&DefStatic(..)) |
|
rustc: Add `const` globals to the language
This change is an implementation of [RFC 69][rfc] which adds a third kind of
global to the language, `const`. This global is most similar to what the old
`static` was, and if you're unsure about what to use then you should use a
`const`.
The semantics of these three kinds of globals are:
* A `const` does not represent a memory location, but only a value. Constants
are translated as rvalues, which means that their values are directly inlined
at usage location (similar to a #define in C/C++). Constant values are, well,
constant, and can not be modified. Any "modification" is actually a
modification to a local value on the stack rather than the actual constant
itself.
Almost all values are allowed inside constants, whether they have interior
mutability or not. There are a few minor restrictions listed in the RFC, but
they should in general not come up too often.
* A `static` now always represents a memory location (unconditionally). Any
references to the same `static` are actually a reference to the same memory
location. Only values whose types ascribe to `Sync` are allowed in a `static`.
This restriction is in place because many threads may access a `static`
concurrently. Lifting this restriction (and allowing unsafe access) is a
future extension not implemented at this time.
* A `static mut` continues to always represent a memory location. All references
to a `static mut` continue to be `unsafe`.
This is a large breaking change, and many programs will need to be updated
accordingly. A summary of the breaking changes is:
* Statics may no longer be used in patterns. Statics now always represent a
memory location, which can sometimes be modified. To fix code, repurpose the
matched-on-`static` to a `const`.
static FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
change this code to:
const FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
* Statics may no longer refer to other statics by value. Due to statics being
able to change at runtime, allowing them to reference one another could
possibly lead to confusing semantics. If you are in this situation, use a
constant initializer instead. Note, however, that statics may reference other
statics by address, however.
* Statics may no longer be used in constant expressions, such as array lengths.
This is due to the same restrictions as listed above. Use a `const` instead.
[breaking-change]
[rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-06 10:17:01 -05:00
|
|
|
Some(&DefConst(..)) |
|
2014-10-06 23:32:58 -05:00
|
|
|
Some(&DefFn(..)) |
|
|
|
|
Some(&DefVariant(_, _, _)) |
|
|
|
|
Some(&DefStruct(_)) => { }
|
|
|
|
|
|
|
|
Some(&def) => {
|
|
|
|
debug!("(checking const) found bad def: {:?}", def);
|
|
|
|
span_err!(v.tcx.sess, e.span, E0014,
|
|
|
|
"paths in constants may only refer to constants \
|
|
|
|
or functions");
|
|
|
|
}
|
|
|
|
None => {
|
|
|
|
v.tcx.sess.span_bug(e.span, "unbound path in const?!");
|
|
|
|
}
|
2012-11-30 18:29:28 -06:00
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
|
|
|
ExprCall(ref callee, _) => {
|
2014-04-09 10:18:40 -05:00
|
|
|
match v.tcx.def_map.borrow().find(&callee.id) {
|
2014-10-01 16:28:54 -05:00
|
|
|
Some(&DefStruct(..)) |
|
2013-11-28 14:22:53 -06:00
|
|
|
Some(&DefVariant(..)) => {} // OK.
|
2014-10-06 23:32:58 -05:00
|
|
|
|
2012-11-30 18:29:28 -06:00
|
|
|
_ => {
|
2014-07-11 11:54:01 -05:00
|
|
|
span_err!(v.tcx.sess, e.span, E0015,
|
2014-10-06 23:32:58 -05:00
|
|
|
"function calls in constants are limited to \
|
|
|
|
struct and enum constructors");
|
2012-11-30 18:29:28 -06:00
|
|
|
}
|
2012-04-04 17:02:25 -05:00
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
|
|
|
ExprBlock(ref block) => {
|
2014-05-04 03:39:11 -05:00
|
|
|
// Check all statements in the block
|
|
|
|
for stmt in block.stmts.iter() {
|
|
|
|
let block_span_err = |span|
|
2014-07-11 11:54:01 -05:00
|
|
|
span_err!(v.tcx.sess, span, E0016,
|
2014-10-06 23:32:58 -05:00
|
|
|
"blocks in constants are limited to items and \
|
|
|
|
tail expressions");
|
2014-05-04 03:39:11 -05:00
|
|
|
match stmt.node {
|
|
|
|
StmtDecl(ref span, _) => {
|
|
|
|
match span.node {
|
|
|
|
DeclLocal(_) => block_span_err(span.span),
|
|
|
|
|
|
|
|
// Item statements are allowed
|
|
|
|
DeclItem(_) => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StmtExpr(ref expr, _) => block_span_err(expr.span),
|
|
|
|
StmtSemi(ref semi, _) => block_span_err(semi.span),
|
2014-10-06 23:32:58 -05:00
|
|
|
StmtMac(..) => {
|
|
|
|
v.tcx.sess.span_bug(e.span, "unexpanded statement \
|
|
|
|
macro in const?!")
|
|
|
|
}
|
2014-05-04 03:39:11 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
match block.expr {
|
rustc: Add `const` globals to the language
This change is an implementation of [RFC 69][rfc] which adds a third kind of
global to the language, `const`. This global is most similar to what the old
`static` was, and if you're unsure about what to use then you should use a
`const`.
The semantics of these three kinds of globals are:
* A `const` does not represent a memory location, but only a value. Constants
are translated as rvalues, which means that their values are directly inlined
at usage location (similar to a #define in C/C++). Constant values are, well,
constant, and can not be modified. Any "modification" is actually a
modification to a local value on the stack rather than the actual constant
itself.
Almost all values are allowed inside constants, whether they have interior
mutability or not. There are a few minor restrictions listed in the RFC, but
they should in general not come up too often.
* A `static` now always represents a memory location (unconditionally). Any
references to the same `static` are actually a reference to the same memory
location. Only values whose types ascribe to `Sync` are allowed in a `static`.
This restriction is in place because many threads may access a `static`
concurrently. Lifting this restriction (and allowing unsafe access) is a
future extension not implemented at this time.
* A `static mut` continues to always represent a memory location. All references
to a `static mut` continue to be `unsafe`.
This is a large breaking change, and many programs will need to be updated
accordingly. A summary of the breaking changes is:
* Statics may no longer be used in patterns. Statics now always represent a
memory location, which can sometimes be modified. To fix code, repurpose the
matched-on-`static` to a `const`.
static FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
change this code to:
const FOO: uint = 4;
match n {
FOO => { /* ... */ }
_ => { /* ... */ }
}
* Statics may no longer refer to other statics by value. Due to statics being
able to change at runtime, allowing them to reference one another could
possibly lead to confusing semantics. If you are in this situation, use a
constant initializer instead. Note, however, that statics may reference other
statics by address, however.
* Statics may no longer be used in constant expressions, such as array lengths.
This is due to the same restrictions as listed above. Use a `const` instead.
[breaking-change]
[rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-06 10:17:01 -05:00
|
|
|
Some(ref expr) => { check_expr(v, &**expr); }
|
2014-05-04 03:39:11 -05:00
|
|
|
None => {}
|
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
}
|
|
|
|
ExprVec(_) |
|
|
|
|
ExprAddrOf(MutImmutable, _) |
|
|
|
|
ExprParen(..) |
|
|
|
|
ExprField(..) |
|
|
|
|
ExprTupField(..) |
|
|
|
|
ExprIndex(..) |
|
|
|
|
ExprTup(..) |
|
|
|
|
ExprRepeat(..) |
|
|
|
|
ExprStruct(..) => {}
|
DST coercions and DST structs
[breaking-change]
1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code.
2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible.
3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-04 07:20:11 -05:00
|
|
|
|
2014-10-06 23:32:58 -05:00
|
|
|
ExprAddrOf(_, ref inner) => {
|
|
|
|
match inner.node {
|
|
|
|
// Mutable slices are allowed.
|
|
|
|
ExprVec(_) => {}
|
|
|
|
_ => span_err!(v.tcx.sess, e.span, E0017,
|
|
|
|
"references in constants may only refer \
|
|
|
|
to immutable values")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2013-11-16 00:58:51 -06:00
|
|
|
|
2014-10-06 23:32:58 -05:00
|
|
|
_ => {
|
|
|
|
span_err!(v.tcx.sess, e.span, E0019,
|
|
|
|
"constant contains unimplemented expression type");
|
|
|
|
return false;
|
2011-11-09 03:42:30 -06:00
|
|
|
}
|
2011-11-08 20:26:02 -06:00
|
|
|
}
|
2014-10-06 23:32:58 -05:00
|
|
|
true
|
2011-11-08 20:26:02 -06:00
|
|
|
}
|