mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 10:16:37 +00:00
fixes
This commit is contained in:
@ -4118,10 +4118,11 @@ export function compileArrayGet(
|
||||
contextualType: Type
|
||||
): ExpressionRef {
|
||||
var type = typedArraySymbolToType(target.internalName);
|
||||
if (type) return compileTypedArrayGet(compiler, target, type, thisExpression, elementExpression, contextualType);
|
||||
assert(target.prototype == compiler.program.arrayPrototype);
|
||||
type = assert(target.typeArguments)[0];
|
||||
throw new Error("not implemented");
|
||||
if (!type) {
|
||||
assert(target.prototype == compiler.program.arrayPrototype);
|
||||
type = assert(target.typeArguments)[0];
|
||||
}
|
||||
return compileTypedArrayGet(compiler, target, type, thisExpression, elementExpression, contextualType);
|
||||
}
|
||||
|
||||
function compileTypedArrayGet(
|
||||
|
@ -904,7 +904,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
if (global.hasDecorator(DecoratorFlags.INLINE)) {
|
||||
this.error(
|
||||
DiagnosticCode.Decorator_0_is_not_valid_here,
|
||||
global.identifierNode.range, "inline"
|
||||
assert(findDecorator(DecoratorKind.INLINE, global.decoratorNodes)).range, "inline"
|
||||
);
|
||||
}
|
||||
module.addGlobal(internalName, nativeType, true, global.type.toNativeZero(module));
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
} from "./diagnosticMessages.generated";
|
||||
|
||||
import {
|
||||
isLineBreak
|
||||
isLineBreak, CharCode
|
||||
} from "./util";
|
||||
|
||||
export {
|
||||
@ -244,7 +244,13 @@ export function formatDiagnosticContext(range: Range, useColors: bool = false):
|
||||
if (range.start == range.end) {
|
||||
sb.push("^");
|
||||
} else {
|
||||
while (start++ < range.end) sb.push("~");
|
||||
while (start++ < range.end) {
|
||||
if (isLineBreak(text.charCodeAt(start))) {
|
||||
sb.push(start == range.start + 1 ? "^" : "~");
|
||||
break;
|
||||
}
|
||||
sb.push("~");
|
||||
}
|
||||
}
|
||||
if (useColors) sb.push(COLOR_RESET);
|
||||
return sb.join("");
|
||||
|
Reference in New Issue
Block a user