nim-lang / nim-mode

An emacs major mode for the Nim programming language
138 stars 46 forks source link

when the compiler hangs, it taks emacs with it. #193

Closed krux02 closed 5 years ago

krux02 commented 6 years ago

Currently this code makes emacs completely frozen.

type
  SimpleArray[N: static[int]; T] = array[0 .. N-1,T]
  MyEnum = enum A,B,C

template arrayLength[T: enum](arg: typedesc[T]):  int = cast[int](high(arg)) + 1
template UltraAdvancedArray(IndexType, T): untyped = SimpleArray[arrayLength(IndexType), T]
var myArray2: UltraAdvancedArray(MyEnum,  int)

When you are able to edit this buffer while the compiler just won't be able to handle this file at all, this bug is fixed. This is my nim version.

Nim Compiler Version 0.18.1 [Linux: amd64]
Copyright (c) 2006-2018 by Andreas Rumpf

git hash: 9d4fd1f1bbc0d8a2327699dd07283260d85a5245
active boot switches: -d:release
yuutayamada commented 5 years ago

closing this because of #216, but free to make new issue if the problem still keeps. and please write more detail. (it's unclear for other users writing just compiler. I guessed nimsuggest)