No, the type syntax is not at all related to the pattern literal experiment. We never put in the spec because someday I'd like to find a solution compatible with fully pluggable types, using metadata to store the type info.
The syntax is given in class TypedNS3Grammar, which is them used to override the regular grammar:
public class TypedNS3Grammar = NS3Grammar ((* A parser for Strongtalk syntax. Adds productions for the Strongtalk type expression sublanguage, and the changes needed to use types in Newsqueak code. *)|
arg = tokenFromSymbol: #arg.
for = tokenFromSymbol: #for.
generic = tokenFromSymbol: #generic.
inheritedTypeOf = tokenFromSymbol: #inheritedTypeOf.
is = tokenFromSymbol: #is.
mssg = tokenFromSymbol: #message.
of = tokenFromSymbol: #of.
receiverType = tokenFromSymbol: #receiverType.
subtypeOf = tokenFromSymbol: #subtypeOf.
typeArg = tokenFromSymbol: #typeArg.
where = tokenFromSymbol: #where.
returnType = hat, type.
(* Type Grammar *)
type = langleBracket, typeExpr, rangleBracket.
typePrimary = identifier, typeArguments opt.
typeFactor = typePrimary | blockType | tupleType | parenthesizedTypeExpression.
parenthesizedTypeExpression = lparen, typeExpr, rparen.
typeTerm = typeFactor, identifier star.
typeExpr = typeTerm, ((vbar | semicolon | slash), typeExpr) opt.
typeArguments = lbracket, (typeExpr plusSeparatedBy: comma), rbracket.
tupleType = lcurly, (typeExpr starSeparatedBy: dot), rcurly.
blockArgType = colon, typeTerm.
blockReturnType = typeExpr.
nonEmptyBlockArgList = blockArgType plus, (vbar, blockReturnType) opt.
blockType = lbracket, (nonEmptyBlockArgList | blockReturnType opt), rbracket.
(* Type inference *)
typePattern = langleBracket, typeFormal, (semicolon, typeFormal) star, rangleBracket. (* changed from {} to <> brackets to avoid conflict with tuples *)
typeFormal = where, identifier, typeParamConstraint opt, is, inferenceClause.
typeParamConstraint = langleBracket, typeBoundQualifier opt, typeExpr, rangleBracket.
typeBoundQualifier = subtypeOf | inheritedTypeOf.
inferenceClause = receiverType
| (returnType, returnTypeInferenceClause)
| typeArgInferenceClause
| (arg, number, (of, msgSelector) opt).
returnTypeInferenceClause = of, msgSelector.
msgSelector = symbolConstant, mssg, of, inferenceClause.
typeArgInferenceClause = typeArg, number, for, generic, symbolConstant, of, inferenceClause.
|) (
messagePattern = (
^super messagePattern, returnType opt, typePattern opt. (* Type annotations *)
)
slotDecl = (
^super slotDecl , type opt.
)
) : (
)