Skip to content

Merge with upstream#2

Open
Outcue wants to merge 736 commits intoOutcue:masterfrom
newspeaklanguage:master
Open

Merge with upstream#2
Outcue wants to merge 736 commits intoOutcue:masterfrom
newspeaklanguage:master

Conversation

@Outcue
Copy link
Copy Markdown
Owner

@Outcue Outcue commented Aug 8, 2021

No description provided.

gbracha and others added 30 commits February 23, 2024 21:37
…of the correct size, and that individual slides retain their styling (before it was mistakenly imposed by the presentation).
Modified build script, added deploy scripts. Changed the way the PWA …
Fix link to webIDE
Per Milan's comment
page navigation controls (because they only show refresh and back, not forward). Added help section (? button on top) explaining how navigation works in browser, PWA and Electron.  Removed the "I think" fro README.md and comments in deployment scripts.
Changed PWA from minimal-ui to standalone, added Help for back/forward navigation in PWA, removed "I think" from comments
…s. Update Hopscotch to work with latest PWA.
Force client update based on latest changes.
… documents only invoke their directly nested amplets. This addresses a bug where amplets of transcluded docs get invoked by the outer docs with erroneous results.

However, we have to be careful to update documents with active amplets, otherwise they will not run correctly under this revised implementation.
…ment, at least for now. The changes did fix some problems with transclusion, but introduced new ones that are arguably worse.
…pair of slot name and a value, which was eniugh to display them in context, but is emantically wrong. The conceptual confusion manifests once we try to ensure that the slot presenters update correctly in all cases. Now, slots are modeled with an explict model that combines the slot name and the object from which its derived.
gbracha and others added 30 commits April 10, 2026 18:30
Typechecker fixes:
- Fix superclass resolution (use superclassCall instead of superConstructorCall)
- Add cycle detection for method signature resolution
- Add variable resolution before treating unqualified sends as method calls
- Add error type handling in unary type operations
- Add _Object to special type cases
- Fix test return type annotations for all failing tests
- Add proper type annotations to nested classes

Build system improvements:
- Add parse-validate.sh tool for syntax validation
- Add run-tests.sh for command-line test execution
- Improve build scripts with better error handling

Test results: 22 PASSED / 0 FAILED / 0 CRASHED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Self type to only expose public methods (not protected/private)
- Fix self keyword to use SelfType directly for full member access
- Add 25 new tests for implicit access, setters, class access, and Self type
- Fix nested class access tests to properly instantiate outer classes
- All 95 tests now passing (up from 70)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added 18 new lexical scope tests covering:
- Inner-to-outer lexical access (6 tests)
- Shadowing behavior (2 tests)
- Outer-to-inner access restrictions (4 tests)
- Sibling class access control (6 tests)

Also added 3-level nested class hierarchy (LexicalScopeOuter/Middle/Inner)
for testing complex lexical scope scenarios, and helper method
assertErrorSet:containsMessageWith: for more precise error checking.

Improved existing tests to check specific error messages rather than
just checking for non-empty error sets.

All 113/113 tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed critical bugs in typechecker's handling of lexical scope in closures:
- Fixed Scope instantiation in blockNode: to pass parent scope correctly
- Fixed FunctionType hash method to use bitXor: instead of xor:
- Updated nestScope: to work with pre-initialized Scope objects

Added 22 comprehensive tests for lexical scope edge cases:
- 12 tests for closure + lexical scope interaction (awaiting Fun type)
- 10 tests for inheritance + lexical scope interaction (all passing)

Key finding: Typechecker correctly distinguishes lexical scope from inheritance.
Inner classes can access members lexically defined in enclosing classes, but
NOT inherited members (lexical scope is textual, not based on runtime inheritance).

Test results: 123/135 tests passing (12 closure tests blocked on Fun type issue).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Implement TypeBuilder.blockTypeNode: to handle block type AST nodes (e.g., [Number], [:String | Integer])
- Add comprehensive type annotations to all 12 closure tests to prevent errorType masking
- Fix testInnerSeesOverriddenMethod to verify derived class method (Integer return) vs base (Number return)

Note: Closure tests currently blocked on Fun type implementation. Block types like [Number]
need to resolve to Fun[Number] instances with value methods, not FunctionType objects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add closureMixin slot to look up Closure class from KernelForPrimordialSoup
- Modify blockTypeNode: to return ObjectType for Closure instead of FunctionType
- Add #Closure as special case in type:at: method for global type lookup

This is a first step toward proper Fun type support. Block type annotations
like [Number] and [:String | Number] now resolve to the Closure type, though
the parameter and return types are not yet tracked (will need Fun generic).

Current status: 123/135 tests passing, 10 closure tests failing (need value
method visibility), 2 closure tests crashing (parameter handling issue).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
No need to recompute closureMixin via type:at: when we already have it
cached in a module-level slot.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…thods

Added 16 new tests across 4 categories:
- Empty closures: 3 tests for [] syntax and Nil return type
- Non-local returns: 4 tests for NLRs from closures
- Tuples: 5 tests for tuple creation and access
- Class methods: 4 tests for Instance return type

Current status: 127/151 tests passing
- 13 failing (10 existing closure tests + 3 new empty closure/NLR tests)
- 11 crashing (2 existing + 5 tuple tests + 4 class method tests)

Issues to address:
- Tuple tests crash with "TypeIdAST setId:" (Array type creation)
- Class method tests crash with incorrect class-side access
- Empty closure and NLR tests fail (same closure value method issue)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…inheritance

- Implement ClosureType with contravariant parameters and covariant return types
- Add TupleType with position-specific element types and union-based at: method
- Add GenericType subtyping and Array<T> element type support
- Implement DoesNotMatter type alias for BottomType (used in NLR type annotations)
- Make BottomType universal: accepts all selectors, returns self
- Fix metaclass superclass lookup to navigate parallel class hierarchy correctly
- Add comprehensive tests for closures, tuples, NLRs, and class methods
- Test results: 159/161 passing (up from 138/161)

Remaining failures test advanced features:
- Tuple iteration with dynamic index and union types
- Factory method Instance type variable substitution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change default closure return type from Nil to Object in blockTypeNode
- Add Object and Array as accessible names mapping to _Object and _Array
- Add tests for closure return type covariance with union types
- Add tests for tuple iteration with type conversion using asInteger

This fixes the issue where closures without explicit return types
were defaulting to Nil instead of Object, causing subtype checks to
fail. Also ensures Object and Array resolve to the same mixins as
their internal _Object and _Array counterparts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix Instance type variable to work correctly in factory method patterns
- Changed synthetic factory methods to return Instance instead of concrete class names
- Added TypeVariable support to ObjectType's subtypeOf method
- Replaced _Array and _Object with Array and Object in tests
- Added tests to verify _Array and _Object should not be accessible (currently failing)
- Added TODO.md documenting the _Array/_Object accessibility issue

Test status: 165/167 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed namespace lookup to handle missing keys gracefully (no more NotFound crashes)
- Added NamespaceTypeTestClass with methods using namespace types
- Added 5 tests for namespace type access:
  - testNamespaceTypeCollectionsList
  - testNamespaceTypeCollectionsSet
  - testNamespaceTypeAsParameter
  - testNamespaceTypeInLocalVariable
  - testNamespaceTypeSubtyping
- Updated TODO.md documenting namespace type access limitations
- Fixed: type:at: now uses ifAbsent: for namespace lookup

Test status: 166/172 tests passing
- 4 namespace type tests failing (nested type access not yet working)
- 2 _Array/_Object accessibility tests failing (existing issue)

The namespace lookup now works but nested type access (e.g. <Collections List>)
requires further architectural work to handle module-based type qualification.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Completed implementation of namespace type access, allowing type expressions
to reference types from the global namespace using syntax like <NewspeakASTs MethodAST>.

Key changes:
- Rewrote unaryTypeOpNode: to properly handle member access via signatures
  - Uses operand at: selector to get FunctionType from member
  - Extracts return type and handles class/instance side conversion
  - Supports multi-step paths like Outer Inner NestedInner
- Fixed type:at: to handle missing namespace keys gracefully
- Updated all namespace type tests to use NewspeakASTs instead of Collections
- Removed debug output from implementation

Test results: 170/172 tests passing
- All 5 namespace type tests now pass
- Only 2 failing tests are the known _Array/_Object accessibility issue

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Renamed and improved namespace type tests:
- Renamed misleading test names that referenced Collections
- Consolidated duplicate tests
- Added test for member access on namespace-qualified types

Added error detection tests:
- Test for non-class members used as types (e.g., NewspeakASTs AST new)
- Tests for inaccessible members (private/protected methods and slots)

Fixed unaryTypeOpNode to properly report errors:
- Now detects and reports when members are inaccessible (AccessErrorType)
- Now detects and reports when members don't exist (ErrorType)
- Now detects and reports when member returns non-class type (factory methods)
- All error cases now add TypeError to errorSet for proper reporting

Test results: 170/175 tests passing
- All namespace type tests pass including new error detection tests
- 5 failing tests are unrelated pre-existing issues

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Fixed mistake where testNamespaceTypeCollectionsSet and testNamespaceTypeAsParameter
were deleted instead of being renamed. Restored them with better names:
- testNamespaceTypePathMethodAST (was testNamespaceTypeCollectionsList)
- testNamespaceTypePathClassAST (was testNamespaceTypeCollectionsSet)
- testNamespaceTypeAsParameter (restored)

Test results: 171/177 tests passing

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Changed all test names from referencing specific types (like MethodAST, ClassAST)
or namespaces to generic names that describe what is being tested:
- testNamespaceTypePathMethodAST -> testTwoLevelTypePath
- testNamespaceTypePathClassAST -> testTwoLevelTypePathAlternate
- testNamespaceTypeAsParameter -> testTypePathAsParameter
- testNamespaceTypeInLocalVariable -> testTypePathInLocalVariable
- testNamespaceTypeSubtyping -> testTypePathSubtyping
- testNamespaceTypeMemberAccess -> testTypePathMemberAccess
- testNamespaceTypeNonClassMemberError -> testTypePathNonClassMemberError
- testNamespaceTypeInaccessibleMethodError -> testTypePathInaccessibleMethodError
- testNamespaceTypeInaccessibleSlotError -> testTypePathInaccessibleSlotError
- testNamespaceTypeProtectedMethodError -> testTypePathProtectedMethodError

Test results: 171/177 tests passing

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
The error reporting for AccessErrorType was causing false positives.
AccessErrorType was being returned in cases where it shouldn't be,
and reporting it caused regressions in previously passing tests.

The underlying issue needs investigation:
- Why is AccessErrorType being returned for accessible members?
- Error detection tests need actual private/protected members to test against

Test results: 171/177 tests passing
- Regressions fixed (testToDoWithEmptyClosureBody, testTupleIterationWithUnion, etc now pass)
- Error detection tests currently fail (need proper test fixtures)

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Created TypePathAccessTestClass with:
- Public, protected, and private nested classes
- Methods returning classes at different access levels

Replaced incorrect tests that referenced non-existent members with
proper tests using actual private/protected nested classes.

New tests:
- testTypePathPublicNestedClass (passes - public members accessible)
- testTypePathProtectedNestedClassError (currently fails - needs implementation)
- testTypePathPrivateNestedClassError (currently fails - needs implementation)
- testTypePathPrivateMethodReturningClass (currently fails - needs implementation)

Test results: 172/177 tests passing
- Public nested class test now passes
- Access restriction tests correctly fail (awaiting implementation)

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Added testTypePathNonExistentMemberError to verify that accessing
a member that doesn't exist produces an error (ErrorType), which is
different from accessing an inaccessible member (AccessErrorType).

Test results: 172/178 tests passing

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Added proper error reporting for type paths when:
- Accessing members that are defined but not accessible (private/protected)
- Accessing members that don't exist on the type

Changes:
- Updated unaryTypeOpNode: to check for AccessErrorType and ErrorType
- Added error messages distinguishing between access errors and non-existent members
- Fixed testTwoLevelTypePathAlternate to use existing class (BlockAST instead of ClassAST)
- Made FactoryClass public so it can be accessed via type paths in tests

All new namespace type path tests now pass.

Test status: 176/178 passing (only 2 known architectural issues remain)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added three new tests for additional type path scenarios:

1. testThreeLevelTypePath - Tests 3-level nested type access
   (e.g., TypePathAccessTestClass PublicNestedClass DeeplyNested)

2. testTypeAccessViaMethod - Tests accessing types via methods that
   return classes (e.g., TypePathAccessTestClass publicMethodReturningClass)

3. testTypeAccessViaSlot - Tests accessing types via slots that hold
   classes (e.g., TypePathAccessTestClass classSlot)

Enhanced TypePathAccessTestClass fixture:
- Added DeeplyNested class within PublicNestedClass for 3-level testing
- Added classSlot to test type access via slots

Test status: 179/181 passing (only 2 known architectural issues remain)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ntrolClass

- Add 16 generic type tests: 8 for Array[T] (covariance, substitution,
  mismatch detection) and 8 for type-path generics via
  CollectionsForPrimordialSoup List[T] and Map[K,V].
- Fix genericInvocationNode to safely handle non-TypeIdAST generics
  (UnaryTypeOpAST from type paths) in the Tuple check.
- Fix HopscotchForCroquet and RuntimeForCroquet to pass voiceControlClass:
  to HopscotchForHTML5, matching the updated factory method signature.

197/199 tests passing (2 pre-existing _Underscore failures).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…scading bugs

Generic substitution: generalized GenericType at: to substitute errorTypes
(from unresolved type params like E) with actual type arguments for all
methods, replacing the previous at:-only special case. Added 8 new tests
for size, first, last, at:put:, copyWith:, includes: on Array[String].

Test rigor: all ~50 error-expecting tests now check exact error count
(eset size = N) and specific error message via assertErrorSet:containsMessageWith:.

Bugs fixed:
- Duplicate parameter type resolution in methodNode: (types resolved twice)
- subtypeOf: used identity check (t = errorType) instead of t isKindOfErrorType,
  causing spurious argument errors after accessibility failures
- functionTypeOf: re-evaluated receiver, duplicating errors in chained sends
- Sends to error-typed receivers produced cascading "not defined" errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants