Skip to content
Browse files

[fix] stdlib: Removed redundant ty from Mongo.collection.

  • Loading branch information...
1 parent 7f30c22 commit 12150a6512bb092301f0f25a3dd6115092b230e9 @nrs135 nrs135 committed Dec 22, 2011
Showing with 6 additions and 6 deletions.
  1. +3 −3 stdlib/apis/mongo/collection.opa
  2. +3 −3 stdlib/apis/mongo/view.opa
View
6 stdlib/apis/mongo/collection.opa
@@ -74,7 +74,7 @@
//@abstract
type Mongo.collection('a) = {
db: Mongo.mongodb;
- ty: OpaType.ty; // type of the collection
+ //ty: OpaType.ty; // type of the collection
}
/**
@@ -171,7 +171,7 @@ MongoCollection = {{
* Note, however, that we clone the connection so that we will be using the same connection
* to the server as the parent connection.
**/
- create(db:Mongo.mongodb): Mongo.collection('value) = { db=MongoConnection.clone(db); ty=@typeval('value); }
+ create(db:Mongo.mongodb): Mongo.collection('value) = { db=MongoConnection.clone(db); /*ty=@typeval('value);*/ }
/**
* Open a connection and create a collection on top of it. Unlike [create] the connection
@@ -180,7 +180,7 @@ MongoCollection = {{
**/
open(name:string, dbname:string, collection:string): outcome(Mongo.collection('value),Mongo.failure) =
match MongoConnection.open(name) with
- | {success=mongo} -> {success={ db=MongoConnection.namespace(mongo,dbname,collection); ty=@typeval('value); }}
+ | {success=mongo} -> {success={ db=MongoConnection.namespace(mongo,dbname,collection); /*ty=@typeval('value);*/ }}
| {~failure} -> {~failure}
/** Same as [open] but treat a failure to open the connection as a fatal error. **/
View
6 stdlib/apis/mongo/view.opa
@@ -115,7 +115,7 @@ MongoView = {{
create(c:Mongo.collection('collection), vfields:Mongo.fields, is_opa:bool): Mongo.view('collection,'view) =
coll = MongoCollection.fields(c, {some=vfields})
pty = @typeval('collection)
- do verify_type_match(pty, coll.ty, "View.create","Attempt to create view from non-matching parent type")
+ //do verify_type_match(pty, coll.ty, "View.create","Attempt to create view from non-matching parent type")
fvty = type_from_fields(pty, vfields)
vty = if is_opa then fvty else MongoTypeSelect.map_field(fvty, make_reg)
cvty = @typeval('view)
@@ -127,11 +127,11 @@ MongoView = {{
{ ~coll; ~vty; ~is_opa; }
of_collection(c:Mongo.collection('collection), is_opa:bool): Mongo.view('collection,'collection) =
- { coll=c; vty=c.ty; ~is_opa; }
+ { coll=c; vty=@typeval('collection)/*c.ty*/; ~is_opa; }
@private
runtime_view_type_check(v:Mongo.view('value,'view), from:string): void =
- do verify_type_match(@typeval('value), v.coll.ty, from, "Collection type does not match view type")
+ //do verify_type_match(@typeval('value), v.coll.ty, from, "Collection type does not match view type")
do verify_type_match(@typeval('view), v.vty, from, "View type does not match result type")
void

0 comments on commit 12150a6

Please sign in to comment.
Something went wrong with that request. Please try again.