internal/core: re-allow new definitions in closed structs

This is a partial revert of CL 8062, specifically the implementation
change that disallowed new definitions in closed structs. The spec part
of CL 8062 remains.

This change is being reverted until fixes for #635 and other issues
discovered as part of the beta.1 release are resolved. #635 is a fairly
major problem - it's not unlikely people will run into correctness
issues as a result of it. The change to disallow new definitions in
closed structs will likely require changes from users (changes that
cannot safely be automatically rewritten). At this stage, getting
exposure to the other changes made as part of beta.1 is more important.
Hence the focus is on fixing #635 and friends, providing a more solid
baseline release in the form of beta.2 (which should generally speaking
be a more apples-to-apples comparison with whatever people were using
before beta.1) and _then_ make the breaking change that disallows new
definitions in closed structs.

Change-Id: I7294a2e6156ec4fe1356e489e7937355c11c56f8
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8201
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/testdata/definitions/visibility.txtar b/cue/testdata/definitions/visibility.txtar
index c95e235..7ef357d 100644
--- a/cue/testdata/definitions/visibility.txtar
+++ b/cue/testdata/definitions/visibility.txtar
@@ -10,27 +10,15 @@
     #name: "baz"
 }
 -- out/eval --
-Errors:
-foo: field `#name` not allowed:
-    ./in.cue:4:6
-    ./in.cue:9:5
-
-Result:
-(_|_){
-  // [eval]
+(struct){
   #foo: (#struct){
     name: (string){ string }
   }
-  foo: (_|_){
-    // [eval]
+  foo: (#struct){
     name: (string){ string }
     _name: (string){ "foo" }
     _#name: (string){ "bar" }
-    #name: (_|_){
-      // [eval] foo: field `#name` not allowed:
-      //     ./in.cue:4:6
-      //     ./in.cue:9:5
-    }
+    #name: (string){ "baz" }
   }
 }
 -- out/compile --
diff --git a/internal/core/adt/closed2.go b/internal/core/adt/closed2.go
index 09da29e..befde5e 100644
--- a/internal/core/adt/closed2.go
+++ b/internal/core/adt/closed2.go
@@ -37,7 +37,8 @@
 		return true, nil
 	}
 
-	if f.IsHidden() && f != InvalidLabel {
+	if !f.IsString() && f != InvalidLabel {
+		// if f.IsHidden() && f != InvalidLabel {
 		return false, nil
 	}